Re: big problem

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: big problem
Дата
Msg-id 3C8CEA01.2DCFB420@mascari.com
обсуждение исходный текст
Ответ на big problem  (Frank_Lupo Frank_Lupo <frank_lupo@telemail.it>)
Список pgsql-general
Frank_Lupo Frank_Lupo wrote:
>
> Problem in insert
>
> CREATE TABLE "irelbcmb" (
> "id" int4,
> "id_pad" int4,
> "desc" int4,
> "cod" varchar(40),
> "sys_var" varchar(1),
> "nom_var" varchar(16)
> ) WITH OIDS;
>
> gedis30=# insert into irelbcmb (id,id_pad,desc,cod,sys_var,nom_var) values 1,1,1,"pippo","1","pippo");
> ERROR: parser: parse error at or near "desc"

PostgreSQL allowed for the CREATE TABLE with a column of "desc" because
you used double-quotes around the name. DESC is a keyword as in:

SELECT name
FROM employees
ORDER BY name DESC;
              ^^^^

Therefore, if you use it as a column, you must put double-quotes around
it in all your queries:

INSERT INTO irelbcmb (id, id_pad, "desc", cod, sys_var, nom_var)
VALUES (1, 1, 1, 'pippo','1','pippo');

Hope that helps,

Mike Mascari
mascarm@mascari.com

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: big problem
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Nice Oracle tuning article