No subject


Tue Aug 10 10:44:33 EDT 2010


quotes when connecting or dropping it.  It's also necessary to put the
database name in quotes when CREATING the database.

The simplest fix would be, if connected to postgres, always put the
database or tablename in double quotes when referring to the database
or table name.  The double quotes always work whether or not the
database or table name has uppercase characters in it.  Double quotes
also help if the database or tablenames have spaces in them (something
that people with a windows background will sometimes want).

The test below is with the postgresql command line program.  But that
just calls the postgresql API so the results should apply to programs
that use the API too.

gerald=3D# create database Camel;
CREATE DATABASE
gerald=3D# \c Camel
FATAL:  database "Camel" does not exist
Previous connection kept
gerald=3D# \c camel
psql (8.4.4)
You are now connected to database "camel".

gerald=3D# drop database "Camel";
ERROR:  database "Camel" does not exist
gerald=3D# drop database "camel";
DROP DATABASE
gerald=3D# create database "CamelDB";
CREATE DATABASE
gerald=3D# \l
gerald=3D# \c "CamelDB";
psql (8.4.4)
You are now connected to database "CamelDB".
CamelDB=3D# drop database CamelDB
CamelDB-# ;
ERROR:  database "cameldb" does not exist
CamelDB=3D# drop database "CamelDB"
;
ERROR:  cannot drop the currently open database
CamelDB=3D# \c gerald
psql (8.4.4)
You are now connected to database "gerald".
gerald=3D# drop database "CamelDB"
;
DROP DATABASE

Gerald

--=20
Gerald Timothy Quimpo http://bopolissimus.blogspot.com
bopolissimus.lists at gmail.com bopolissimus at gmail.com

Even Tom Lane said: "Or, if you're worried
about actions from functions, use a trigger
to do the logging.=A0 There are approximately
no cases where a rule is really better than
a trigger :-( "


More information about the gnucash-user mailing list