Re: Probably a stupid question

From: greg(at)turnstep(dot)com
To: pgsql-novice(at)postgresql(dot)org
Cc: giorgio(at)opla(dot)it
Subject: Re: Probably a stupid question
Date: 2003-06-27 13:20:47
Message-ID: b52f39381a51aea3cc3eb292aaa2678b@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)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-----

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message greg 2003-06-27 13:29:19 Re: missing postmaster.conf
Previous Message Nabil Sayegh 2003-06-27 13:19:33 Re: Address Table