Re: Upper and Lower-cased Database names?

From: "Ian Barwick" <barwick(at)gmail(dot)com>
To: "Daniel B(dot) Thurman" <dant(at)cdkkt(dot)com>
Cc: "Pgsql-General (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Upper and Lower-cased Database names?
Date: 2007-10-10 08:20:14
Message-ID: 1d581afe0710100120x7be79de5nffa9e513f67bfc7e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2007/10/10, Daniel B. Thurman <dant(at)cdkkt(dot)com>:
>
> I am finding out for the first time that by having a database created
> with the name: MyTest, I cannot do a simple query as follows:
>
> postgres=# select * from MyTest.public.cars;
> ERROR: cross-database references are not implemented: "mytest.public.cars"
>
> Notice, however since I created a cars table in the postgres database, I was
> able to do a query:
>
> postgres=# select * from postgres.public.cars ;
>
> carid | name | vendor | type
> -------+--------------+--------+------
> H1 | Civic | Honda | FF
> N1 | Skyline GT-R | Nissan | 4WD
> T1 | Supra | Toyota | FR
> T2 | MR-2 | Toyota | FF
> (4 rows)
>
> So the problem, it seems that mixed case database names might not be supported
> with pssql? I have a feeling that the default character set is SQL-ASCII and should be
> changed to something else? What might that be and how can I change/update the
> character-set (encoding)?

PostgreSQL doesn't support cross-database references, as per the error
message, i.e. you can only perform queries on the current database.
*However*, the syntax works when the named database is the same as one
you're connected to. If you do

\c MyTest
mytest=# select * from MyTest.public.cars;

the query will work (case is not the problem here).

HTH

Ian Barwick

--
http://sql-info.de/index.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-10-10 08:21:36 Re: Upper and Lower-cased Database names?
Previous Message Harald Armin Massa 2007-10-10 08:14:02 Re: Upper and Lower-cased Database names?