diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-02-02 11:58:55 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-02-02 11:58:55 +0100 |
commit | 87669de72c2249e6aec84b8c27fdc3ffb7284e13 (patch) | |
tree | 64300b4701a300fac670ef95b068a619ad547416 | |
parent | cb2bab14fff5b4e1c065b8546323f1a9fefc9611 (diff) | |
download | postgresql-87669de72c2249e6aec84b8c27fdc3ffb7284e13.tar.gz postgresql-87669de72c2249e6aec84b8c27fdc3ffb7284e13.zip |
Some cleanup for change of collate and ctype fields to type text
Some cleanup for commit 54637508f87bd5f07fb9406bac6b08240283be3b:
Reformat pg_database.dat to reflect the new field order. Also update
the corresponding example in bki.sgml. Reorder the way the fields are
filled in dbcommands.c to correspond to the new order.
-rw-r--r-- | doc/src/sgml/bki.sgml | 17 | ||||
-rw-r--r-- | src/backend/commands/dbcommands.c | 4 | ||||
-rw-r--r-- | src/include/catalog/pg_database.dat | 8 |
3 files changed, 15 insertions, 14 deletions
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml index ae32bfcb7e6..33955494c63 100644 --- a/doc/src/sgml/bki.sgml +++ b/doc/src/sgml/bki.sgml @@ -175,19 +175,20 @@ will demonstrate the key features: </para> -<programlisting> +<!-- The "slight modification" is the apostrophe in the description. --> +<programlisting><![CDATA[ [ # A comment could appear here. -{ oid => '1', oid_symbol => 'TemplateDbOid', - descr => 'database\'s default template', - datname => 'template1', encoding => 'ENCODING', datcollate => 'LC_COLLATE', - datctype => 'LC_CTYPE', datistemplate => 't', datallowconn => 't', - datconnlimit => '-1', datfrozenxid => '0', - datminmxid => '1', dattablespace => 'pg_default', datacl => '_null_' }, +{ oid => '1', oid_symbol => 'TemplateDbOid', + descr => 'database\'s default template', + datname => 'template1', encoding => 'ENCODING', datistemplate => 't', + datallowconn => 't', datconnlimit => '-1', datfrozenxid => '0', + datminmxid => '1', dattablespace => 'pg_default', datcollate => 'LC_COLLATE', + datctype => 'LC_CTYPE', datacl => '_null_' }, ] -</programlisting> +]]></programlisting> <para> Points to note: diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 5a6c9beaa47..e673138cbdf 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -570,14 +570,14 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt) DirectFunctionCall1(namein, CStringGetDatum(dbname)); new_record[Anum_pg_database_datdba - 1] = ObjectIdGetDatum(datdba); new_record[Anum_pg_database_encoding - 1] = Int32GetDatum(encoding); - new_record[Anum_pg_database_datcollate - 1] = CStringGetTextDatum(dbcollate); - new_record[Anum_pg_database_datctype - 1] = CStringGetTextDatum(dbctype); new_record[Anum_pg_database_datistemplate - 1] = BoolGetDatum(dbistemplate); new_record[Anum_pg_database_datallowconn - 1] = BoolGetDatum(dballowconnections); new_record[Anum_pg_database_datconnlimit - 1] = Int32GetDatum(dbconnlimit); new_record[Anum_pg_database_datfrozenxid - 1] = TransactionIdGetDatum(src_frozenxid); new_record[Anum_pg_database_datminmxid - 1] = TransactionIdGetDatum(src_minmxid); new_record[Anum_pg_database_dattablespace - 1] = ObjectIdGetDatum(dst_deftablespace); + new_record[Anum_pg_database_datcollate - 1] = CStringGetTextDatum(dbcollate); + new_record[Anum_pg_database_datctype - 1] = CStringGetTextDatum(dbctype); /* * We deliberately set datacl to default (NULL), rather than copying it diff --git a/src/include/catalog/pg_database.dat b/src/include/catalog/pg_database.dat index d0b0c2d9a0e..e7e42d60234 100644 --- a/src/include/catalog/pg_database.dat +++ b/src/include/catalog/pg_database.dat @@ -14,9 +14,9 @@ { oid => '1', oid_symbol => 'TemplateDbOid', descr => 'default template for new databases', - datname => 'template1', encoding => 'ENCODING', datcollate => 'LC_COLLATE', - datctype => 'LC_CTYPE', datistemplate => 't', datallowconn => 't', - datconnlimit => '-1', datfrozenxid => '0', - datminmxid => '1', dattablespace => 'pg_default', datacl => '_null_' }, + datname => 'template1', encoding => 'ENCODING', datistemplate => 't', + datallowconn => 't', datconnlimit => '-1', datfrozenxid => '0', + datminmxid => '1', dattablespace => 'pg_default', datcollate => 'LC_COLLATE', + datctype => 'LC_CTYPE', datacl => '_null_' }, ] |