Subject: PostgreSQL 7.4 and 8.0 - psql reference

From: Halley Pacheco de Oliveira <[email-masked]>
Date: Sun, 12 Jun 2005 07:42:58 -0300 (ART)

In Part II - PostgreSQL Client Applications, psql --  PostgreSQL interactive terminal
(psql-ref.sgml - http://www.postgresql.org/docs/8.0/interactive/app-psql.html) is written:

For example, FOO"BAR"BAZ is interpreted as fooBARbaz, and "A weird"" name" becomes A weird" name.

So using psql I tried:

CREATE TABLE FOO"BAR"BAZ (foo text);

and got:

ERROR:  syntax error at or near ""BAR"" at character 17

AND

> CREATE TABLE "A weird"" name" (foo text);
CREATE TABLE
> \dt
...
---------+---------------+--------+----------
 public  | A weird" name | table  | postgres

So what is happening with FOO"BAR"BAZ? What is really written in the documentation?

Thanks,
Halley

____________________________________________________
Yahoo! Mail, cada vez melhor: agora com 1GB de espaço grátis! http://mail.yahoo.com.br

---

From: Tom Lane <[email-masked]>
Date: Sun, 12 Jun 2005 11:10:38 -0400

> For example, FOO"BAR"BAZ is interpreted as fooBARbaz, and "A weird"" name" becomes A weird" name.

Please observe the context in which that statement appears: it is
talking about backslash commands only.

For the syntax of SQL commands see
http://www.postgresql.org/docs/8.0/static/sql-syntax.html

			regards, tom lane

---

From: Halley Pacheco de Oliveira <[email-masked]>
Date: Sun, 12 Jun 2005 12:50:22 -0300 (ART)

Ok, now I understand

>CREATE TABLE "fooBARbaz" (foo TEXT);
CREATE TABLE

...
---------+---------------+--------+----------
 public  | A weird" name | tabela | postgres
 public  | fooBARbaz     | tabela | postgres
...

> \dt fooBARbaz

No relation found

> \dt foo"BAR"baz
...
---------+-----------+--------+----------
 public  | fooBARbaz | table  | postgres
(1 row)

Thanks,
Halley

> http://www.postgresql.org/docs/8.0/static/sql-syntax.html

__________________________________________________
Converse com seus amigos em tempo real com o Yahoo! Messenger 
http://br.download.yahoo.com/messenger/