Re: Probably a stupid question

Поиск
Список
Период
Сортировка
От greg@turnstep.com
Тема Re: Probably a stupid question
Дата
Msg-id b52f39381a51aea3cc3eb292aaa2678b@biglumber.com
обсуждение исходный текст
Ответ на Probably a stupid question  ("Giorgio Ponza" <giorgio@opla.it>)
Ответы Re: Probably a stupid question  (Dani Oderbolz <oderbolz@ecologic.de>)
Список pgsql-novice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1




> CREATE TABLE "MirrorHosts" ..... etc etc
>
> 1) the command \d MirrorHosts doesn't work (table MirrorHost not found),
>    i have to use \d "MirrorHosts"
> 2) when i do SELECT * FROM MirrorHosts;   (the same prob)
>    i have to use "MirrorHosts"
>
> I'd like to know if there is a way to bypass this problem.
> Tx in advance and ..... PostgreSQL is really GREAT!

When you created the table using the quotes, it forced the name to use
mixed-case. Therefore, you must use the exact same case afterwards.
The simple way to get around this is to not use quotes around the
tablename, or simply lowercase the name in your initial create:

CREATE TABLE MirrorHosts ...

or

CREATE TABLE "mirrorhosts"...


If you have already created the "MirrorHosts" table and do not want to
lose the data inside it, you could do this:

CREATE TABLE mirrorhosts AS SELECT * FROM mirrorhosts;

DROP TABLE mirrorhosts;

(this assumes the table is simple and has no foreign keys, triggers, etc.)


- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200306270912

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+/ERSvJuQZxSWSsgRAqSRAJ9Te5Nln3IQGoXSA/OAoT+z7sLw/ACfXjXu
ZbXB5apFwC0OiOJrFomR57g=
=noEp
-----END PGP SIGNATURE-----



В списке pgsql-novice по дате отправления:

Предыдущее
От: Nabil Sayegh
Дата:
Сообщение: Re: Address Table
Следующее
От: greg@turnstep.com
Дата:
Сообщение: Re: missing postmaster.conf