aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:35:54 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:35:54 -0400
commit382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch)
treef558251492f2c6f86e3566f7a82f9d00509122c2 /src/backend/commands/dbcommands.c
parentc7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff)
downloadpostgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.tar.gz
postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.zip
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 96ab6f23cd1..e138539035e 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -429,7 +429,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
if (dst_deftablespace == GLOBALTABLESPACE_OID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("pg_global cannot be used as default tablespace")));
+ errmsg("pg_global cannot be used as default tablespace")));
/*
* If we are trying to change the default tablespace of the template,
@@ -491,8 +491,8 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
if (CountOtherDBBackends(src_dboid, &notherbackends, &npreparedxacts))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
- errmsg("source database \"%s\" is being accessed by other users",
- dbtemplate),
+ errmsg("source database \"%s\" is being accessed by other users",
+ dbtemplate),
errdetail_busy_db(notherbackends, npreparedxacts)));
/*
@@ -736,8 +736,8 @@ check_encoding_locale_matches(int encoding, const char *collate, const char *cty
errmsg("encoding \"%s\" does not match locale \"%s\"",
pg_encoding_to_char(encoding),
ctype),
- errdetail("The chosen LC_CTYPE setting requires encoding \"%s\".",
- pg_encoding_to_char(ctype_encoding))));
+ errdetail("The chosen LC_CTYPE setting requires encoding \"%s\".",
+ pg_encoding_to_char(ctype_encoding))));
if (!(collate_encoding == encoding ||
collate_encoding == PG_SQL_ASCII ||
@@ -751,8 +751,8 @@ check_encoding_locale_matches(int encoding, const char *collate, const char *cty
errmsg("encoding \"%s\" does not match locale \"%s\"",
pg_encoding_to_char(encoding),
collate),
- errdetail("The chosen LC_COLLATE setting requires encoding \"%s\".",
- pg_encoding_to_char(collate_encoding))));
+ errdetail("The chosen LC_COLLATE setting requires encoding \"%s\".",
+ pg_encoding_to_char(collate_encoding))));
}
/* Error cleanup callback for createdb */
@@ -799,7 +799,7 @@ dropdb(const char *dbname, bool missing_ok)
pgdbrel = heap_open(DatabaseRelationId, RowExclusiveLock);
if (!get_db_info(dbname, AccessExclusiveLock, &db_id, NULL, NULL,
- &db_istemplate, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
+ &db_istemplate, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
{
if (!missing_ok)
{
@@ -1094,7 +1094,7 @@ movedb(const char *dbname, const char *tblspcname)
pgdbrel = heap_open(DatabaseRelationId, RowExclusiveLock);
if (!get_db_info(dbname, AccessExclusiveLock, &db_id, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, &src_tblspcoid, NULL, NULL))
+ NULL, NULL, NULL, NULL, NULL, &src_tblspcoid, NULL, NULL))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_DATABASE),
errmsg("database \"%s\" does not exist", dbname)));
@@ -1472,8 +1472,8 @@ AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel)
if (list_length(stmt->options) != 1)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("option \"%s\" cannot be specified with other options",
- dtablespace->defname),
+ errmsg("option \"%s\" cannot be specified with other options",
+ dtablespace->defname),
parser_errposition(pstate, dtablespace->location)));
/* this case isn't allowed within a transaction block */
PreventTransactionChain(isTopLevel, "ALTER DATABASE SET TABLESPACE");
@@ -1664,7 +1664,7 @@ AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
if (!have_createdb_privilege())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied to change owner of database")));
+ errmsg("permission denied to change owner of database")));
memset(repl_null, false, sizeof(repl_null));
memset(repl_repl, false, sizeof(repl_repl));
@@ -1993,7 +1993,7 @@ errdetail_busy_db(int notherbackends, int npreparedxacts)
notherbackends);
else
errdetail_plural("There is %d prepared transaction using the database.",
- "There are %d prepared transactions using the database.",
+ "There are %d prepared transactions using the database.",
npreparedxacts,
npreparedxacts);
return 0; /* just to keep ereport macro happy */