Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Unable to add a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 15309 of 17598
Post > Topic >>

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

by david.gagnon@[EMAIL PROTECTED] ("David Gagnon") Apr 17, 2008 at 09:36 AM

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=#

 




-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 4 Posts in Topic:
Unable to add a new column to a table named "in" (look like a bu
david.gagnon@[EMAIL PROTE  2008-04-17 09:36:46 
Re: Unable to add a new column to a table named "in" (look like
david.gagnon@[EMAIL PROTE  2008-04-17 10:26:52 
Re: Unable to add a new column to a table named "in" (look like
david.gagnon@[EMAIL PROTE  2008-04-17 11:17:17 
Re: Unable to add a new column to a table named "in" (look like
david.gagnon@[EMAIL PROTE  2008-04-17 11:25:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 8:33:13 CST 2008.