aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-04-06 08:42:53 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-04-06 08:42:53 +0000
commit1eef90d0a21167c4043c7d8cacaa0e937c9eb8e8 (patch)
treee638cb48d3ec22453585250506b051e4d82436c0 /src/backend
parentf2110a757d0bdca766fa1b8562c7dcb1a53fd422 (diff)
downloadpostgresql-1eef90d0a21167c4043c7d8cacaa0e937c9eb8e8.tar.gz
postgresql-1eef90d0a21167c4043c7d8cacaa0e937c9eb8e8.zip
Rename the new CREATE DATABASE options to set collation and ctype into
LC_COLLATE and LC_CTYPE, per discussion on pgsql-hackers.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/dbcommands.c14
-rw-r--r--src/backend/parser/gram.y29
2 files changed, 22 insertions, 21 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index f9dcb973c0d..2b9b11e2fea 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.219 2009/01/30 17:24:47 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.220 2009/04/06 08:42:52 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -169,7 +169,7 @@ createdb(const CreatedbStmt *stmt)
errmsg("conflicting or redundant options")));
dencoding = defel;
}
- else if (strcmp(defel->defname, "collate") == 0)
+ else if (strcmp(defel->defname, "lc_collate") == 0)
{
if (dcollate)
ereport(ERROR,
@@ -177,7 +177,7 @@ createdb(const CreatedbStmt *stmt)
errmsg("conflicting or redundant options")));
dcollate = defel;
}
- else if (strcmp(defel->defname, "ctype") == 0)
+ else if (strcmp(defel->defname, "lc_ctype") == 0)
{
if (dctype)
ereport(ERROR,
@@ -362,7 +362,7 @@ createdb(const CreatedbStmt *stmt)
(errmsg("encoding %s does not match locale %s",
pg_encoding_to_char(encoding),
dbctype),
- errdetail("The chosen CTYPE setting requires encoding %s.",
+ errdetail("The chosen LC_CTYPE setting requires encoding %s.",
pg_encoding_to_char(ctype_encoding))));
if (!(collate_encoding == encoding ||
@@ -375,7 +375,7 @@ createdb(const CreatedbStmt *stmt)
(errmsg("encoding %s does not match locale %s",
pg_encoding_to_char(encoding),
dbcollate),
- errdetail("The chosen COLLATE setting requires encoding %s.",
+ errdetail("The chosen LC_COLLATE setting requires encoding %s.",
pg_encoding_to_char(collate_encoding))));
/*
@@ -394,8 +394,8 @@ createdb(const CreatedbStmt *stmt)
if (strcmp(dbctype, src_ctype))
ereport(ERROR,
- (errmsg("new ctype is incompatible with the ctype of the template database (%s)", src_ctype),
- errhint("Use the same ctype as in the template database, or use template0 as template")));
+ (errmsg("new LC_CTYPE is incompatible with LC_CTYPE of the template database (%s)", src_ctype),
+ errhint("Use the same LC_CTYPE as in the template database, or use template0 as template")));
}
/* Resolve default tablespace for new database */
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 9821bc15b5f..d1ff21946b9 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.661 2009/04/04 21:12:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.662 2009/04/06 08:42:52 heikki Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -437,7 +437,7 @@ static TypeName *TableFuncTypeName(List *columns);
CLUSTER COALESCE COLLATE COLUMN COMMENT COMMIT
COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS
CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE CREATEDB
- CREATEROLE CREATEUSER CROSS CSV CTYPE CURRENT_P
+ CREATEROLE CREATEUSER CROSS CSV CURRENT_P
CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA
CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
@@ -464,9 +464,9 @@ static TypeName *TableFuncTypeName(List *columns);
KEY
- LANCOMPILER LANGUAGE LARGE_P LAST_P LEADING LEAST LEFT LEVEL
- LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION
- LOCK_P LOGIN_P
+ LANCOMPILER LANGUAGE LARGE_P LAST_P LC_COLLATE_P LC_CTYPE_P LEADING
+ LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP
+ LOCATION LOCK_P LOGIN_P
MAPPING MATCH MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE
@@ -6011,21 +6011,21 @@ createdb_opt_item:
{
$$ = makeDefElem("encoding", NULL);
}
- | COLLATE opt_equal Sconst
+ | LC_COLLATE_P opt_equal Sconst
{
- $$ = makeDefElem("collate", (Node *)makeString($3));
+ $$ = makeDefElem("lc_collate", (Node *)makeString($3));
}
- | COLLATE opt_equal DEFAULT
+ | LC_COLLATE_P opt_equal DEFAULT
{
- $$ = makeDefElem("collate", NULL);
+ $$ = makeDefElem("lc_collate", NULL);
}
- | CTYPE opt_equal Sconst
+ | LC_CTYPE_P opt_equal Sconst
{
- $$ = makeDefElem("ctype", (Node *)makeString($3));
+ $$ = makeDefElem("lc_ctype", (Node *)makeString($3));
}
- | CTYPE opt_equal DEFAULT
+ | LC_CTYPE_P opt_equal DEFAULT
{
- $$ = makeDefElem("ctype", NULL);
+ $$ = makeDefElem("lc_ctype", NULL);
}
| CONNECTION LIMIT opt_equal SignedIconst
{
@@ -10169,7 +10169,6 @@ unreserved_keyword:
| CREATEROLE
| CREATEUSER
| CSV
- | CTYPE
| CURRENT_P
| CURSOR
| CYCLE
@@ -10236,6 +10235,8 @@ unreserved_keyword:
| LANGUAGE
| LARGE_P
| LAST_P
+ | LC_COLLATE_P
+ | LC_CTYPE_P
| LEVEL
| LISTEN
| LOAD