Unable to add a new column to a table named "in" (look like a bug ...)

From: "David Gagnon" <david(dot)gagnon(at)cesart(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Unable to add a new column to a table named "in" (look like a bug ...)
Date: 2008-04-17 13:36:46
Message-ID: 012401c8a090$15159590$6701a8c0@cesart.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I all,

Could you just have a look to the output below? I try to add a column to a
table named "in" (I know "in" is a reserved keyword but the table exists and
I cannot change it). Postgresql complains that the column already exist but
it didn't. Am I doing something wrong ?

Thanks to point me my error or to give me any advice to add the column I
need.

Regards
David

Welcome to psql 8.3.0, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

Warning: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.

postgres=# \c reference
You are now connected to database "reference".
reference=# \d "in"
Table "public.in"
Column | Type | Modifiers
------------+-----------------------------+------------------------
innum | character varying(10) | not null
indesc_pri | character varying(100) |
indesc_sec | character varying(100) |
ts | timestamp without time zone | not null default now()
Indexes:
"in_pk" PRIMARY KEY, btree (innum)

reference=# alter table 'IN' add column INDESCS VARCHAR[];
ERROR: syntax error at or near "'IN'"
LINE 1: alter table 'IN' add column INDESCS VARCHAR[];
^
reference=# alter table "IN" add column INDESCS VARCHAR[];
ERROR: column "indescs" of relation "IN" already exists
reference=# \d "in"
Table "public.in"
Column | Type | Modifiers
------------+-----------------------------+------------------------
innum | character varying(10) | not null
indesc_pri | character varying(100) |
indesc_sec | character varying(100) |
ts | timestamp without time zone | not null default now()
Indexes:
"in_pk" PRIMARY KEY, btree (innum)

reference=# alter table "IN" add column DESCS VARCHAR[];
ALTER TABLE
reference=# \d "in"
Table "public.in"
Column | Type | Modifiers
------------+-----------------------------+------------------------
innum | character varying(10) | not null
indesc_pri | character varying(100) |
indesc_sec | character varying(100) |
ts | timestamp without time zone | not null default now()
Indexes:
"in_pk" PRIMARY KEY, btree (innum)

reference=#

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2008-04-17 14:03:41 Duplicate Symbols - Compiler Warnings
Previous Message Rob Collins 2008-04-17 11:33:13 Re: Master-master replication with PostgreSQL