Обсуждение: PostgreSQL 7.4 and 8.0 - psql reference

Поиск
Список
Период
Сортировка

PostgreSQL 7.4 and 8.0 - psql reference

От
Halley Pacheco de Oliveira
Дата:
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

Re: PostgreSQL 7.4 and 8.0 - psql reference

От
Tom Lane
Дата:
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

Re: PostgreSQL 7.4 and 8.0 - psql reference

От
Halley Pacheco de Oliveira
Дата:
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/