Re: 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: "'Adam Rich'" <adam(dot)r(at)sbcglobal(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unable to add a new column to a table named "in" (look like a bug ...)
Date: 2008-04-17 15:17:17
Message-ID: 015401c8a09e$1fa9d580$6701a8c0@cesart.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Adam,

Yes your right .. here is the output. The only thing is that in PGadminIII
I just see the "in" table....

Thanks for your help anyway!

Have a good day
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=# \?
General
\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]
connect to new database (currently "postgres")
\cd [DIR] change the current working directory
\copyright show PostgreSQL usage and distribution terms
\encoding [ENCODING]
show or set client encoding
\h [NAME] help on syntax of SQL commands, * for all commands
\q quit psql
\set [NAME [VALUE]]
set internal variable, or list all if no parameters
\timing toggle timing of commands (currently off)
\unset NAME unset (delete) internal variable
\prompt [TEXT] NAME
prompt user to set internal variable
\! [COMMAND] execute command in shell or start interactive shell

Query Buffer
\e [FILE] edit the query buffer (or file) with external editor
\g [FILE] send query buffer to server (and results to file or |pipe)
\p show the contents of the query buffer
\r reset (clear) the query buffer
\w FILE write query buffer to file

^Cpostgres=# \c reference
You are now connected to database "reference".
reference=# \d "IN"
Table "public.IN"
Column | Type | Modifiers
---------+-----------------------------+------------------------
innum | character varying(10) | not null
ts | timestamp without time zone | not null default now()
indescs | character varying[] |
descs | character varying[] |

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()
indescs | character varying[] |
Indexes:
"in_pk" PRIMARY KEY, btree (innum)

reference=#

-----Message d'origine-----
De : pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] De la part de Adam Rich
Envoyé : Thursday, April 17, 2008 10:33 AM
À : 'David Gagnon'; pgsql-general(at)postgresql(dot)org
Objet : Re: [GENERAL] Unable to add a new column to a table named "in" (look
like a bug ...)

>
> It worked Thanks!! But there is definitly something wrong with the
> error
> message I got (right?):
>
> reference=# alter table "IN" add column INDESCS VARCHAR[];
> ERROR: column "indescs" of relation "IN" already exists
>

I don't know, what do you see when you \d "IN" ?

When you use double-quotes, capitalization is significant,
So "in" and "IN" and "In" are all different tables. This error
message means you already have an upper-case "IN" table and it
already has a column INDESCS.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Blackwell 2008-04-17 15:23:10 Using meta-data for foreign key?
Previous Message Michael Enke 2008-04-17 15:09:36 good experience with performance in 8.2 for multi column indexes