Unable to add a new column to a table named "in" (look like a bug ...) - Mailing list pgsql-general

From David Gagnon
Subject Unable to add a new column to a table named "in" (look like a bug ...)
Date
Msg-id 012401c8a090$15159590$6701a8c0@cesart.local
Whole thread Raw
Responses Re: Unable to add a new column to a table named "in" (look like a bug ...)  ("Adam Rich" <adam.r@sbcglobal.net>)
List 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=#






pgsql-general by date:

Previous
From: Terry Lee Tucker
Date:
Subject: Duplicate Symbols - Compiler Warnings
Next
From: "Adam Rich"
Date:
Subject: Re: Unable to add a new column to a table named "in" (look like a bug ...)