mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Message improvements
This commit is contained in:
parent
75c8af902e
commit
689cabf402
@ -842,12 +842,12 @@ ParallelWorkerMain(Datum main_arg)
|
||||
if (seg == NULL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("unable to map dynamic shared memory segment")));
|
||||
errmsg("could not map dynamic shared memory segment")));
|
||||
toc = shm_toc_attach(PARALLEL_MAGIC, dsm_segment_address(seg));
|
||||
if (toc == NULL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("bad magic number in dynamic shared memory segment")));
|
||||
errmsg("invalid magic number in dynamic shared memory segment")));
|
||||
|
||||
/* Look up fixed parallel state. */
|
||||
fps = shm_toc_lookup(toc, PARALLEL_KEY_FIXED);
|
||||
@ -998,7 +998,7 @@ ParallelExtensionTrampoline(dsm_segment *seg, shm_toc *toc)
|
||||
static void
|
||||
ParallelErrorContext(void *arg)
|
||||
{
|
||||
errcontext("parallel worker, pid %d", *(int32 *) arg);
|
||||
errcontext("parallel worker, PID %d", *(int32 *) arg);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4976,9 +4976,10 @@ readRecoveryCommandFile(void)
|
||||
else
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid value for recovery parameter \"%s\"",
|
||||
"recovery_target_action"),
|
||||
errhint("The allowed values are \"pause\", \"promote\", and \"shutdown\".")));
|
||||
errmsg("invalid value for recovery parameter \"%s\": \"%s\"",
|
||||
"recovery_target_action",
|
||||
item->value),
|
||||
errhint("Valid values are \"pause\", \"promote\", and \"shutdown\".")));
|
||||
|
||||
ereport(DEBUG2,
|
||||
(errmsg_internal("recovery_target_action = '%s'",
|
||||
@ -5058,7 +5059,9 @@ readRecoveryCommandFile(void)
|
||||
else
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid value for recovery parameter \"recovery_target\""),
|
||||
errmsg("invalid value for recovery parameter \"%s\": \"%s\"",
|
||||
"recovery_target",
|
||||
item->value),
|
||||
errhint("The only allowed value is \"immediate\".")));
|
||||
ereport(DEBUG2,
|
||||
(errmsg_internal("recovery_target = '%s'",
|
||||
@ -6142,7 +6145,7 @@ StartupXLOG(void)
|
||||
unlink(TABLESPACE_MAP_OLD);
|
||||
if (rename(TABLESPACE_MAP, TABLESPACE_MAP_OLD) == 0)
|
||||
ereport(LOG,
|
||||
(errmsg("ignoring \"%s\" file because no \"%s\" file exists",
|
||||
(errmsg("ignoring file \"%s\" because no file \"%s\" exists",
|
||||
TABLESPACE_MAP, BACKUP_LABEL_FILE),
|
||||
errdetail("File \"%s\" was renamed to \"%s\".",
|
||||
TABLESPACE_MAP, TABLESPACE_MAP_OLD)));
|
||||
@ -6150,7 +6153,7 @@ StartupXLOG(void)
|
||||
ereport(LOG,
|
||||
(errmsg("ignoring \"%s\" file because no \"%s\" file exists",
|
||||
TABLESPACE_MAP, BACKUP_LABEL_FILE),
|
||||
errdetail("File \"%s\" could not be renamed to \"%s\": %m.",
|
||||
errdetail("Could not rename file \"%s\" to \"%s\": %m.",
|
||||
TABLESPACE_MAP, TABLESPACE_MAP_OLD)));
|
||||
}
|
||||
|
||||
@ -6281,24 +6284,24 @@ StartupXLOG(void)
|
||||
LastRec = RecPtr = checkPointLoc;
|
||||
|
||||
ereport(DEBUG1,
|
||||
(errmsg("redo record is at %X/%X; shutdown %s",
|
||||
(errmsg_internal("redo record is at %X/%X; shutdown %s",
|
||||
(uint32) (checkPoint.redo >> 32), (uint32) checkPoint.redo,
|
||||
wasShutdown ? "TRUE" : "FALSE")));
|
||||
ereport(DEBUG1,
|
||||
(errmsg("next transaction ID: %u/%u; next OID: %u",
|
||||
(errmsg_internal("next transaction ID: %u/%u; next OID: %u",
|
||||
checkPoint.nextXidEpoch, checkPoint.nextXid,
|
||||
checkPoint.nextOid)));
|
||||
ereport(DEBUG1,
|
||||
(errmsg("next MultiXactId: %u; next MultiXactOffset: %u",
|
||||
(errmsg_internal("next MultiXactId: %u; next MultiXactOffset: %u",
|
||||
checkPoint.nextMulti, checkPoint.nextMultiOffset)));
|
||||
ereport(DEBUG1,
|
||||
(errmsg("oldest unfrozen transaction ID: %u, in database %u",
|
||||
(errmsg_internal("oldest unfrozen transaction ID: %u, in database %u",
|
||||
checkPoint.oldestXid, checkPoint.oldestXidDB)));
|
||||
ereport(DEBUG1,
|
||||
(errmsg("oldest MultiXactId: %u, in database %u",
|
||||
(errmsg_internal("oldest MultiXactId: %u, in database %u",
|
||||
checkPoint.oldestMulti, checkPoint.oldestMultiDB)));
|
||||
ereport(DEBUG1,
|
||||
(errmsg("commit timestamp Xid oldest/newest: %u/%u",
|
||||
(errmsg_internal("commit timestamp Xid oldest/newest: %u/%u",
|
||||
checkPoint.oldestCommitTs,
|
||||
checkPoint.newestCommitTs)));
|
||||
if (!TransactionIdIsNormal(checkPoint.nextXid))
|
||||
|
@ -1652,7 +1652,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
|
||||
if (!missing_ok)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("user mapping for user \"%s\" in server \"%s\" does not exist",
|
||||
errmsg("user mapping for user \"%s\" on server \"%s\" does not exist",
|
||||
username, servername)));
|
||||
return address;
|
||||
}
|
||||
@ -1678,7 +1678,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
|
||||
if (!missing_ok)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("user mapping for user \"%s\" in server \"%s\" does not exist",
|
||||
errmsg("user mapping for user \"%s\" on server \"%s\" does not exist",
|
||||
username, servername)));
|
||||
return address;
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
|
||||
if (is_from)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("COPY FROM not supported with row level security."),
|
||||
errmsg("COPY FROM not supported with row-level security."),
|
||||
errhint("Use INSERT statements instead.")));
|
||||
|
||||
/* Build target list */
|
||||
|
@ -3028,7 +3028,7 @@ read_whole_file(const char *filename, int *length)
|
||||
if (fst.st_size > (MaxAllocSize - 1))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("file too large")));
|
||||
errmsg("file \"%s\" is too large", filename)));
|
||||
bytes_to_read = (size_t) fst.st_size;
|
||||
|
||||
if ((file = AllocateFile(filename, PG_BINARY_R)) == NULL)
|
||||
|
@ -11195,9 +11195,7 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
|
||||
case RELPERSISTENCE_TEMP:
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
|
||||
errmsg("cannot change logged status of table %s",
|
||||
RelationGetRelationName(rel)),
|
||||
errdetail("Table %s is temporary.",
|
||||
errmsg("cannot change logged status of table \"%s\" because it is temporary",
|
||||
RelationGetRelationName(rel)),
|
||||
errtable(rel)));
|
||||
break;
|
||||
@ -11256,9 +11254,7 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
|
||||
if (foreignrel->rd_rel->relpersistence != RELPERSISTENCE_PERMANENT)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
|
||||
errmsg("cannot change status of table %s to logged",
|
||||
RelationGetRelationName(rel)),
|
||||
errdetail("Table %s references unlogged table %s.",
|
||||
errmsg("could not change table \"%s\" to logged because it references unlogged table \"%s\"",
|
||||
RelationGetRelationName(rel),
|
||||
RelationGetRelationName(foreignrel)),
|
||||
errtableconstraint(rel, NameStr(con->conname))));
|
||||
@ -11268,11 +11264,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
|
||||
if (foreignrel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
|
||||
errmsg("cannot change status of table %s to unlogged",
|
||||
RelationGetRelationName(rel)),
|
||||
errdetail("Logged table %s is referenced by table %s.",
|
||||
RelationGetRelationName(foreignrel),
|
||||
RelationGetRelationName(rel)),
|
||||
errmsg("could not change table \"%s\" to unlogged because it references logged table \"%s\"",
|
||||
RelationGetRelationName(rel),
|
||||
RelationGetRelationName(foreignrel)),
|
||||
errtableconstraint(rel, NameStr(con->conname))));
|
||||
}
|
||||
|
||||
|
@ -800,7 +800,7 @@ remove_symlink:
|
||||
/* Refuse to remove anything that's not a directory or symlink */
|
||||
ereport(redo ? LOG : ERROR,
|
||||
(ERRCODE_SYSTEM_ERROR,
|
||||
errmsg("not a directory or symbolic link: \"%s\"",
|
||||
errmsg("\"%s\" is not a directory or symbolic link",
|
||||
linkloc)));
|
||||
}
|
||||
|
||||
@ -886,7 +886,7 @@ remove_tablespace_symlink(const char *linkloc)
|
||||
{
|
||||
/* Refuse to remove anything that's not a directory or symlink */
|
||||
ereport(ERROR,
|
||||
(errmsg("not a directory or symbolic link: \"%s\"",
|
||||
(errmsg("\"%s\" is not a directory or symbolic link",
|
||||
linkloc)));
|
||||
}
|
||||
}
|
||||
|
@ -668,8 +668,7 @@ recv_password_packet(Port *port)
|
||||
errmsg("invalid password packet size")));
|
||||
|
||||
/* Do not echo password to logs, for security. */
|
||||
ereport(DEBUG5,
|
||||
(errmsg("received password packet")));
|
||||
elog(DEBUG5, "received password packet");
|
||||
|
||||
/*
|
||||
* Return the received string. Note we do not attempt to do any
|
||||
|
@ -1136,7 +1136,7 @@ pq_startmsgread(void)
|
||||
if (PqCommReadingMsg)
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
||||
errmsg("terminating connection because protocol sync was lost")));
|
||||
errmsg("terminating connection because protocol synchronization was lost")));
|
||||
|
||||
PqCommReadingMsg = true;
|
||||
}
|
||||
|
@ -979,7 +979,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
|
||||
if (!gsets)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_STATEMENT_TOO_COMPLEX),
|
||||
errmsg("too many grouping sets present (max 4096)"),
|
||||
errmsg("too many grouping sets present (maximum 4096)"),
|
||||
parser_errposition(pstate,
|
||||
qry->groupClause
|
||||
? exprLocation((Node *) qry->groupClause)
|
||||
|
@ -2856,7 +2856,7 @@ transformOnConflictArbiter(ParseState *pstate,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("ON CONFLICT DO UPDATE requires inference specification or constraint name"),
|
||||
errhint("For example, ON CONFLICT (<column>)."),
|
||||
errhint("For example, ON CONFLICT (column_name)."),
|
||||
parser_errposition(pstate,
|
||||
exprLocation((Node *) onConflictClause))));
|
||||
|
||||
|
@ -3080,7 +3080,7 @@ errorMissingColumn(ParseState *pstate,
|
||||
errmsg("column %s.%s does not exist", relname, colname) :
|
||||
errmsg("column \"%s\" does not exist", colname),
|
||||
state->rfirst ? closestfirst ?
|
||||
errhint("Perhaps you meant to reference the column \"%s\".\"%s\".",
|
||||
errhint("Perhaps you meant to reference the column \"%s.%s\".",
|
||||
state->rfirst->eref->aliasname, closestfirst) :
|
||||
errhint("There is a column named \"%s\" in table \"%s\", but it cannot be referenced from this part of the query.",
|
||||
colname, state->rfirst->eref->aliasname) : 0,
|
||||
@ -3099,7 +3099,7 @@ errorMissingColumn(ParseState *pstate,
|
||||
relname ?
|
||||
errmsg("column %s.%s does not exist", relname, colname) :
|
||||
errmsg("column \"%s\" does not exist", colname),
|
||||
errhint("Perhaps you meant to reference the column \"%s\".\"%s\" or the column \"%s\".\"%s\".",
|
||||
errhint("Perhaps you meant to reference the column \"%s.%s\" or the column \"%s.%s\".",
|
||||
state->rfirst->eref->aliasname, closestfirst,
|
||||
state->rsecond->eref->aliasname, closestsecond),
|
||||
parser_errposition(pstate, location)));
|
||||
|
@ -2047,8 +2047,10 @@ retry1:
|
||||
else if (!parse_bool(valptr, &am_walsender))
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid value for parameter \"replication\""),
|
||||
errhint("Valid values are: false, 0, true, 1, database.")));
|
||||
errmsg("invalid value for parameter \"%s\": \"%s\"",
|
||||
"replication",
|
||||
valptr),
|
||||
errhint("Valid values are: \"false\", 0, \"true\", 1, \"database\".")));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode)
|
||||
ereport(LOG,
|
||||
(errhidestmt(true),
|
||||
errhidecontext(true),
|
||||
errmsg("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d",
|
||||
errmsg_internal("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d",
|
||||
MyProcPid,
|
||||
where, T_NAME(lock), T_ID(lock),
|
||||
!!(state & LW_VAL_EXCLUSIVE),
|
||||
@ -207,7 +207,7 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
|
||||
ereport(LOG,
|
||||
(errhidestmt(true),
|
||||
errhidecontext(true),
|
||||
errmsg("%s(%s %d): %s", where,
|
||||
errmsg_internal("%s(%s %d): %s", where,
|
||||
T_NAME(lock), T_ID(lock), msg)));
|
||||
}
|
||||
}
|
||||
|
@ -746,7 +746,7 @@ array_position_common(FunctionCallInfo fcinfo)
|
||||
if (PG_ARGISNULL(2))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
|
||||
errmsg("initial position should not be NULL")));
|
||||
errmsg("initial position must not be null")));
|
||||
|
||||
position_min = PG_GETARG_INT32(2);
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ b64_decode(const char *src, unsigned len, char *dst)
|
||||
if (b < 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid symbol '%c' while decoding base64 sequence", (int) c)));
|
||||
errmsg("invalid symbol \"%c\" while decoding base64 sequence", (int) c)));
|
||||
}
|
||||
/* add it to buffer */
|
||||
buf = (buf << 6) + b;
|
||||
@ -325,7 +325,7 @@ b64_decode(const char *src, unsigned len, char *dst)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid base64 end sequence"),
|
||||
errhint("Input data is missing padding, truncated, or otherwise corrupted.")));
|
||||
errhint("Input data is missing padding, is truncated, or is otherwise corrupted.")));
|
||||
|
||||
return p - dst;
|
||||
}
|
||||
|
@ -1179,7 +1179,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
|
||||
if (nargs % 2 != 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid number or arguments: object must be matched key value pairs")));
|
||||
errmsg("invalid number of arguments: object must be matched key value pairs")));
|
||||
|
||||
memset(&result, 0, sizeof(JsonbInState));
|
||||
|
||||
@ -1193,7 +1193,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
|
||||
if (PG_ARGISNULL(i))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("arg %d: key cannot be null", i + 1)));
|
||||
errmsg("argument %d: key must not be null", i + 1)));
|
||||
val_type = get_fn_expr_argtype(fcinfo->flinfo, i);
|
||||
|
||||
/*
|
||||
@ -1215,7 +1215,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
|
||||
if (val_type == InvalidOid || val_type == UNKNOWNOID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("arg %d: could not determine data type", i + 1)));
|
||||
errmsg("argument %d: could not determine data type", i + 1)));
|
||||
|
||||
add_jsonb(arg, false, &result, val_type, true);
|
||||
|
||||
|
@ -2462,7 +2462,7 @@ static struct config_int ConfigureNamesInt[] =
|
||||
|
||||
{
|
||||
{"wal_retrieve_retry_interval", PGC_SIGHUP, REPLICATION_STANDBY,
|
||||
gettext_noop("Sets the time to wait before retrying to retrieve WAL"
|
||||
gettext_noop("Sets the time to wait before retrying to retrieve WAL "
|
||||
"after a failed attempt."),
|
||||
NULL,
|
||||
GUC_UNIT_MS
|
||||
@ -2580,7 +2580,7 @@ static struct config_int ConfigureNamesInt[] =
|
||||
|
||||
{
|
||||
{"ssl_renegotiation_limit", PGC_USERSET, CONN_AUTH_SECURITY,
|
||||
gettext_noop("SSL regenotiation is no longer supported; this can only be 0"),
|
||||
gettext_noop("SSL regenotiation is no longer supported; this can only be 0."),
|
||||
NULL,
|
||||
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE,
|
||||
},
|
||||
@ -3388,7 +3388,7 @@ static struct config_string ConfigureNamesString[] =
|
||||
|
||||
{
|
||||
{"cluster_name", PGC_POSTMASTER, PROCESS_TITLE,
|
||||
gettext_noop("Sets the name of the cluster which is included in the process title."),
|
||||
gettext_noop("Sets the name of the cluster, which is included in the process title."),
|
||||
NULL,
|
||||
GUC_IS_NAME
|
||||
},
|
||||
|
@ -122,7 +122,7 @@ check_enable_rls(Oid relid, Oid checkAsUser, bool noError)
|
||||
if (!row_security && !noError)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("insufficient privilege to bypass row security.")));
|
||||
errmsg("insufficient privilege to bypass row-level security")));
|
||||
|
||||
/* RLS should be fully enabled for this relation. */
|
||||
return RLS_ENABLED;
|
||||
|
@ -186,7 +186,7 @@ _dosmaperr(unsigned long e)
|
||||
(errmsg_internal("mapped win32 error code %lu to %d",
|
||||
e, doserr)));
|
||||
#elif FRONTEND_DEBUG
|
||||
fprintf(stderr, _("mapped win32 error code %lu to %d"), e, doserr);
|
||||
fprintf(stderr, "mapped win32 error code %lu to %d", e, doserr);
|
||||
#endif
|
||||
errno = doserr;
|
||||
return;
|
||||
@ -198,7 +198,7 @@ _dosmaperr(unsigned long e)
|
||||
(errmsg_internal("unrecognized win32 error code: %lu",
|
||||
e)));
|
||||
#else
|
||||
fprintf(stderr, _("unrecognized win32 error code: %lu"), e);
|
||||
fprintf(stderr, "unrecognized win32 error code: %lu", e);
|
||||
#endif
|
||||
|
||||
errno = EINVAL;
|
||||
|
@ -551,7 +551,7 @@ create table atacc1 ( test int );
|
||||
-- add a check constraint (fails)
|
||||
alter table atacc1 add constraint atacc_test1 check (test1>3);
|
||||
ERROR: column "test1" does not exist
|
||||
HINT: Perhaps you meant to reference the column "atacc1"."test".
|
||||
HINT: Perhaps you meant to reference the column "atacc1.test".
|
||||
drop table atacc1;
|
||||
-- something a little more complicated
|
||||
create table atacc1 ( test int, test2 int, test3 int);
|
||||
@ -1358,7 +1358,7 @@ select f1 from c1;
|
||||
ERROR: column "f1" does not exist
|
||||
LINE 1: select f1 from c1;
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "c1"."f2".
|
||||
HINT: Perhaps you meant to reference the column "c1.f2".
|
||||
drop table p1 cascade;
|
||||
NOTICE: drop cascades to table c1
|
||||
create table p1 (f1 int, f2 int);
|
||||
@ -1372,7 +1372,7 @@ select f1 from c1;
|
||||
ERROR: column "f1" does not exist
|
||||
LINE 1: select f1 from c1;
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "c1"."f2".
|
||||
HINT: Perhaps you meant to reference the column "c1.f2".
|
||||
drop table p1 cascade;
|
||||
NOTICE: drop cascades to table c1
|
||||
create table p1 (f1 int, f2 int);
|
||||
@ -2550,8 +2550,7 @@ CREATE UNLOGGED TABLE unlogged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unl
|
||||
CREATE UNLOGGED TABLE unlogged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged3); -- self-referencing foreign key
|
||||
ALTER TABLE unlogged3 SET LOGGED; -- skip self-referencing foreign key
|
||||
ALTER TABLE unlogged2 SET LOGGED; -- fails because a foreign key to an unlogged table exists
|
||||
ERROR: cannot change status of table unlogged2 to logged
|
||||
DETAIL: Table unlogged2 references unlogged table unlogged1.
|
||||
ERROR: could not change table "unlogged2" to logged because it references unlogged table "unlogged1"
|
||||
ALTER TABLE unlogged1 SET LOGGED;
|
||||
-- check relpersistence of an unlogged table after changing to permament
|
||||
SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1'
|
||||
@ -2594,8 +2593,7 @@ ORDER BY relname;
|
||||
CREATE TABLE logged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged1); -- foreign key
|
||||
CREATE TABLE logged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged3); -- self-referencing foreign key
|
||||
ALTER TABLE logged1 SET UNLOGGED; -- fails because a foreign key from a permanent table exists
|
||||
ERROR: cannot change status of table logged1 to unlogged
|
||||
DETAIL: Logged table logged2 is referenced by table logged1.
|
||||
ERROR: could not change table "logged1" to unlogged because it references logged table "logged2"
|
||||
ALTER TABLE logged3 SET UNLOGGED; -- skip self-referencing foreign key
|
||||
ALTER TABLE logged2 SET UNLOGGED;
|
||||
ALTER TABLE logged1 SET UNLOGGED;
|
||||
|
@ -226,7 +226,7 @@ insert into insertconflicttest values (1, 'Apple') on conflict do update set fru
|
||||
ERROR: ON CONFLICT DO UPDATE requires inference specification or constraint name
|
||||
LINE 1: ...nsert into insertconflicttest values (1, 'Apple') on conflic...
|
||||
^
|
||||
HINT: For example, ON CONFLICT (<column>).
|
||||
HINT: For example, ON CONFLICT (column_name).
|
||||
-- inference succeeds:
|
||||
insert into insertconflicttest values (1, 'Apple') on conflict (key) do update set fruit = excluded.fruit;
|
||||
insert into insertconflicttest values (2, 'Orange') on conflict (key, key, key) do update set fruit = excluded.fruit;
|
||||
@ -246,13 +246,13 @@ insert into insertconflicttest values (1, 'Apple') on conflict (keyy) do update
|
||||
ERROR: column "keyy" does not exist
|
||||
LINE 1: ...nsertconflicttest values (1, 'Apple') on conflict (keyy) do ...
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "insertconflicttest"."key".
|
||||
HINT: Perhaps you meant to reference the column "insertconflicttest.key".
|
||||
-- Have useful HINT for EXCLUDED.* RTE within UPDATE:
|
||||
insert into insertconflicttest values (1, 'Apple') on conflict (key) do update set fruit = excluded.fruitt;
|
||||
ERROR: column excluded.fruitt does not exist
|
||||
LINE 1: ... 'Apple') on conflict (key) do update set fruit = excluded.f...
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "excluded"."fruit".
|
||||
HINT: Perhaps you meant to reference the column "excluded.fruit".
|
||||
-- inference fails:
|
||||
insert into insertconflicttest values (3, 'Kiwi') on conflict (key, fruit) do update set fruit = excluded.fruit;
|
||||
ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
|
||||
|
@ -2299,7 +2299,7 @@ select t1.x from t1 join t3 on (t1.a = t3.x);
|
||||
ERROR: column t1.x does not exist
|
||||
LINE 1: select t1.x from t1 join t3 on (t1.a = t3.x);
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "t3"."x".
|
||||
HINT: Perhaps you meant to reference the column "t3.x".
|
||||
--
|
||||
-- regression test for 8.1 merge right join bug
|
||||
--
|
||||
@ -3982,19 +3982,19 @@ select t1.uunique1 from
|
||||
ERROR: column t1.uunique1 does not exist
|
||||
LINE 1: select t1.uunique1 from
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "t1"."unique1".
|
||||
HINT: Perhaps you meant to reference the column "t1.unique1".
|
||||
select t2.uunique1 from
|
||||
tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t2" suggestion
|
||||
ERROR: column t2.uunique1 does not exist
|
||||
LINE 1: select t2.uunique1 from
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "t2"."unique1".
|
||||
HINT: Perhaps you meant to reference the column "t2.unique1".
|
||||
select uunique1 from
|
||||
tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, suggest both at once
|
||||
ERROR: column "uunique1" does not exist
|
||||
LINE 1: select uunique1 from
|
||||
^
|
||||
HINT: Perhaps you meant to reference the column "t1"."unique1" or the column "t2"."unique1".
|
||||
HINT: Perhaps you meant to reference the column "t1.unique1" or the column "t2.unique1".
|
||||
--
|
||||
-- Take care to reference the correct RTE
|
||||
--
|
||||
|
@ -1373,7 +1373,7 @@ SELECT jsonb_build_object(1,2);
|
||||
|
||||
-- keys must be scalar and not null
|
||||
SELECT jsonb_build_object(null,2);
|
||||
ERROR: arg 1: key cannot be null
|
||||
ERROR: argument 1: key must not be null
|
||||
SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
|
||||
ERROR: key value must be scalar, not array, composite, or json
|
||||
SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
|
||||
|
@ -253,11 +253,11 @@ WARNING: error for policy,{addr_nsp,zwei},{integer}: relation "addr_nsp" does n
|
||||
WARNING: error for policy,{eins,zwei,drei},{}: schema "eins" does not exist
|
||||
WARNING: error for policy,{eins,zwei,drei},{integer}: schema "eins" does not exist
|
||||
WARNING: error for user mapping,{eins},{}: argument list length must be exactly 1
|
||||
WARNING: error for user mapping,{eins},{integer}: user mapping for user "eins" in server "integer" does not exist
|
||||
WARNING: error for user mapping,{eins},{integer}: user mapping for user "eins" on server "integer" does not exist
|
||||
WARNING: error for user mapping,{addr_nsp,zwei},{}: argument list length must be exactly 1
|
||||
WARNING: error for user mapping,{addr_nsp,zwei},{integer}: user mapping for user "addr_nsp" in server "integer" does not exist
|
||||
WARNING: error for user mapping,{addr_nsp,zwei},{integer}: user mapping for user "addr_nsp" on server "integer" does not exist
|
||||
WARNING: error for user mapping,{eins,zwei,drei},{}: argument list length must be exactly 1
|
||||
WARNING: error for user mapping,{eins,zwei,drei},{integer}: user mapping for user "eins" in server "integer" does not exist
|
||||
WARNING: error for user mapping,{eins,zwei,drei},{integer}: user mapping for user "eins" on server "integer" does not exist
|
||||
WARNING: error for default acl,{eins},{}: argument list length must be exactly 1
|
||||
WARNING: error for default acl,{eins},{integer}: unrecognized default ACL object type i
|
||||
WARNING: error for default acl,{addr_nsp,zwei},{}: argument list length must be exactly 1
|
||||
|
@ -2577,7 +2577,7 @@ COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ',';
|
||||
SET SESSION AUTHORIZATION rls_regress_user1;
|
||||
SET row_security TO OFF;
|
||||
COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --fail - insufficient to bypass rls
|
||||
ERROR: insufficient privilege to bypass row security.
|
||||
ERROR: insufficient privilege to bypass row-level security
|
||||
SET row_security TO ON;
|
||||
COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --ok
|
||||
0,cfcd208495d565ef66e7dff9f98764da
|
||||
@ -2618,7 +2618,7 @@ COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --ok
|
||||
SET SESSION AUTHORIZATION rls_regress_user2;
|
||||
SET row_security TO OFF;
|
||||
COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --fail - insufficient to bypass rls
|
||||
ERROR: insufficient privilege to bypass row security.
|
||||
ERROR: insufficient privilege to bypass row-level security
|
||||
SET row_security TO ON;
|
||||
COPY (SELECT * FROM copy_t ORDER BY a ASC) TO STDOUT WITH DELIMITER ','; --fail - permission denied
|
||||
ERROR: permission denied for relation copy_t
|
||||
@ -2642,7 +2642,7 @@ COPY copy_rel_to TO STDOUT WITH DELIMITER ',';
|
||||
SET SESSION AUTHORIZATION rls_regress_user1;
|
||||
SET row_security TO OFF;
|
||||
COPY copy_rel_to TO STDOUT WITH DELIMITER ','; --fail - insufficient to bypass rls
|
||||
ERROR: insufficient privilege to bypass row security.
|
||||
ERROR: insufficient privilege to bypass row-level security
|
||||
SET row_security TO ON;
|
||||
COPY copy_rel_to TO STDOUT WITH DELIMITER ','; --ok
|
||||
-- Check COPY TO as user with permissions and BYPASSRLS
|
||||
@ -2671,10 +2671,10 @@ COPY copy_t FROM STDIN; --ok
|
||||
SET SESSION AUTHORIZATION rls_regress_user1;
|
||||
SET row_security TO OFF;
|
||||
COPY copy_t FROM STDIN; --fail - insufficient privilege to bypass rls.
|
||||
ERROR: insufficient privilege to bypass row security.
|
||||
ERROR: insufficient privilege to bypass row-level security
|
||||
SET row_security TO ON;
|
||||
COPY copy_t FROM STDIN; --fail - COPY FROM not supported by RLS.
|
||||
ERROR: COPY FROM not supported with row level security.
|
||||
ERROR: COPY FROM not supported with row-level security.
|
||||
HINT: Use INSERT statements instead.
|
||||
-- Check COPY FROM as user with permissions and BYPASSRLS
|
||||
SET SESSION AUTHORIZATION rls_regress_exempt_user;
|
||||
|
Loading…
x
Reference in New Issue
Block a user