diff -ruN postgresql-7.2.old/doc/src/sgml/ref/create_database.sgml postgresql-7.2/doc/src/sgml/ref/create_database.sgml
--- postgresql-7.2.old/doc/src/sgml/ref/create_database.sgml Sun Jan 20 17:19:56 2002
+++ postgresql-7.2/doc/src/sgml/ref/create_database.sgml Wed Feb 13 19:30:56 2002
@@ -24,9 +24,9 @@
CREATE DATABASE name
- [ WITH [ LOCATION = 'dbpath' ]
- [ TEMPLATE = template ]
- [ ENCODING = encoding ] ]
+ [ WITH [ LOCATION [=] 'dbpath' ]
+ [ TEMPLATE [=] template ]
+ [ ENCODING [=] encoding ] ]
@@ -177,7 +177,7 @@
An alternate location can be specified in order to,
for example, store the database on a different disk.
- The path must have been prepared with the
+ The path must have been prepared with the
command.
@@ -197,14 +197,14 @@
By default, the new database will be created by cloning the standard
system database template1>. A different template can be
- specified by writing TEMPLATE =>
+ specified by writing TEMPLATE>
name. In particular,
- by writing TEMPLATE = template0>, you can create a virgin
+ by writing TEMPLATE template0>, you can create a virgin
database containing only the standard objects predefined by your
version of PostgreSQL. This is useful
if you wish to avoid copying
any installation-local objects that may have been added to
- template1>.
+ template1>.
@@ -251,7 +251,7 @@
comment from Olly; response from Thomas...
initlocation does not create a PG_VERSION file in the specified location.
- How will PostgreSQL handle the situation if it is upgraded to an
+ How will PostgreSQL handle the situation if it is upgraded to an
incompatible database version?
Hmm. This isn't an issue since the upgrade would do
@@ -296,18 +296,18 @@
initlocation is complete.
-
+
$ psql olly
Welcome to psql, the PostgreSQL interactive terminal.
-
+
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
-olly=> CREATE DATABASE elsewhere WITH LOCATION = '/home/olly/private_db';
+olly=> CREATE DATABASE elsewhere WITH LOCATION '/home/olly/private_db';
CREATE DATABASE
diff -ruN postgresql-7.2.old/src/backend/parser/gram.y postgresql-7.2/src/backend/parser/gram.y
--- postgresql-7.2.old/src/backend/parser/gram.y Sat Dec 8 23:39:39 2001
+++ postgresql-7.2/src/backend/parser/gram.y Wed Feb 13 19:00:05 2002
@@ -206,7 +206,7 @@
%type for_update_clause, opt_for_update_clause, update_list
%type opt_all
%type opt_table
-%type opt_chain, opt_trans
+%type opt_chain, opt_trans, opt_equals
%type join_outer, join_qual
%type join_type
@@ -3066,23 +3066,23 @@
* createdb_opt_item returns 2-element lists, with the first element
* being an integer code to indicate which item was specified.
*/
-createdb_opt_item: LOCATION '=' Sconst
+createdb_opt_item: LOCATION opt_equals Sconst
{
$$ = lconsi(1, makeList1($3));
}
- | LOCATION '=' DEFAULT
+ | LOCATION opt_equals DEFAULT
{
$$ = lconsi(1, makeList1(NULL));
}
- | TEMPLATE '=' name
+ | TEMPLATE opt_equals name
{
$$ = lconsi(2, makeList1($3));
}
- | TEMPLATE '=' DEFAULT
+ | TEMPLATE opt_equals DEFAULT
{
$$ = lconsi(2, makeList1(NULL));
}
- | ENCODING '=' Sconst
+ | ENCODING opt_equals Sconst
{
int encoding;
#ifdef MULTIBYTE
@@ -3096,7 +3096,7 @@
#endif
$$ = lconsi(3, makeListi1(encoding));
}
- | ENCODING '=' Iconst
+ | ENCODING opt_equals Iconst
{
#ifdef MULTIBYTE
if (!pg_get_enconv_by_encoding($3))
@@ -3107,12 +3107,15 @@
#endif
$$ = lconsi(3, makeListi1($3));
}
- | ENCODING '=' DEFAULT
+ | ENCODING opt_equals DEFAULT
{
$$ = lconsi(3, makeListi1(-1));
}
;
+opt_equals: '=' { $$ = TRUE; }
+ | /*EMPTY*/ { $$ = TRUE; }
+ ;
/*****************************************************************************
*