Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/extprotocol/expected/exttableext.out
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ ERROR: protocol "demoprot" does not exist (seg0 slice1 rh55-qavm55:7532 pid=18
-- However demoprot implementation prevents using any other protocol name than "demoprot"
-- therefore the error is expected.
select count(*) from exttabtest_r_new;
ERROR: internal error: demoprot called with a different protocol (demoprot_new) (gpextprotocol.c:107) (seg0 slice1 rh55-qavm55:7532 pid=18394) (cdbdisp.c:1453)
ERROR: internal error: demoprot called with a different protocol (demoprot_new) (seg0 slice1 rh55-qavm55:7532 pid=18394) (cdbdisp.c:1453)
CONTEXT: External table exttabtest_r_new, line 1 of file demoprot_new://exttabtest.txt
-- Rename protocol name back to demoprot
ALTER PROTOCOL demoprot_new RENAME to demoprot;
Expand Down
6 changes: 4 additions & 2 deletions contrib/extprotocol/gpextprotocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ demoprot_import(PG_FUNCTION_ARGS)
myData->filename = pstrdup(parsed_url->path);

if(strcasecmp(parsed_url->protocol, p_name) != 0)
elog(ERROR, "internal error: demoprot called with a different protocol (%s)",
parsed_url->protocol);
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("internal error: demoprot called with a different protocol (%s)",
parsed_url->protocol)));

/* An example of checking options */
check_ext_options(fcinfo);
Expand Down
9 changes: 6 additions & 3 deletions src/backend/task/job_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ ScheduleCronJob(text *scheduleText, text *commandText, text *databaseText,
aclresult = pg_database_aclcheck(get_database_oid(database_name, false),
userIdcheckacl, ACL_CONNECT);
if (aclresult != ACLCHECK_OK)
elog(ERROR, "User %s does not have CONNECT privilege on %s",
GetUserNameFromId(userIdcheckacl, false), database_name);
ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("User %s does not have CONNECT privilege on %s",
GetUserNameFromId(userIdcheckacl, false), database_name)));

GetUserIdAndSecContext(&savedUserId, &savedSecurityContext);

Expand Down Expand Up @@ -680,7 +681,9 @@ AlterCronJob(int64 jobId, char *schedule, char *command,
userIdcheckacl, ACL_CONNECT);

if (aclresult != ACLCHECK_OK)
elog(ERROR, "User %s does not have CONNECT privilege on %s", GetUserNameFromId(userIdcheckacl, false), database_name);
ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("User %s does not have CONNECT privilege on %s",
GetUserNameFromId(userIdcheckacl, false), database_name)));
}

/* ensure schedule is valid */
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/expected/task.out
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ create user task_cron with password 'pwd';
NOTICE: resource queue required -- using default resource queue "pg_default"
-- Create a task for another user
create task another_user_task schedule '* 10 * * *' database task_dbno user task_cron as 'vacuum';
ERROR: User task_cron does not have CONNECT privilege on task_dbno (job_metadata.c:210)
ERROR: User task_cron does not have CONNECT privilege on task_dbno
-- Schedule a task for this user on the database that does not accept connections
alter task vacuum_db database task_dbno user task_cron;
ERROR: User task_cron does not have CONNECT privilege on task_dbno (job_metadata.c:683)
ERROR: User task_cron does not have CONNECT privilege on task_dbno
-- Schedule a task that user doest not exist
alter task vacuum_db user hopedoesnotexist;
ERROR: role "hopedoesnotexist" does not exist
Expand Down