PostgreSQL 7.4 and 8.0 - psql reference

Started by Halley Pacheco de Oliveiraalmost 21 years ago3 messagesdocs
Jump to latest
#1Halley Pacheco de Oliveira
halleypo@yahoo.com.br

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Halley Pacheco de Oliveira (#1)
Re: PostgreSQL 7.4 and 8.0 - psql reference

Halley Pacheco de Oliveira <halleypo@yahoo.com.br> writes:

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.

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

#3Halley Pacheco de Oliveira
halleypo@yahoo.com.br
In reply to: Tom Lane (#2)
Re: PostgreSQL 7.4 and 8.0 - psql reference

Ok, now I understand

CREATE TABLE "fooBARbaz" (foo TEXT);

CREATE TABLE

\dt

...
---------+---------------+--------+----------
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

--- Tom Lane <tgl@sss.pgh.pa.us> escreveu:

Halley Pacheco de Oliveira <halleypo@yahoo.com.br> writes:

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.

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

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