Re: BUG #4166: Alter table add column from PgAdminIII

Lists: pgsql-bugs
From: "Mike Gagnon" <mike(dot)gagnon(at)bellnet(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4166: Alter table add column from PgAdminIII
Date: 2008-05-14 02:05:38
Message-ID: 200805140205.m4E25cv2015285@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4166
Logged by: Mike Gagnon
Email address: mike(dot)gagnon(at)bellnet(dot)ca
PostgreSQL version: 8.3.1-1
Operating system: Windows XP
Description: Alter table add column from PgAdminIII
Details:

Hi Postgres Experts,
I used PGAdmin III to add a character varying column(400) length, not null
default ''. I get the column displayed in psql when I do a simple query
like SELECT * from MyTable limit 1;

When I try to do Update MyTable set NewColumn='something'; I get the error
saying that the column doesn't exist.... It thinks it exists when I do my
select, but it doesn't recognize this new column in my UPDATE...

I'm scared... I have a deadline coming up and I'm praying this one gets
fixed soon.

Many thanks!
Mike


From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Mike Gagnon" <mike(dot)gagnon(at)bellnet(dot)ca>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4166: Alter table add column from PgAdminIII
Date: 2008-05-14 08:18:37
Message-ID: 482AA05D.6080903@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Mike Gagnon wrote:
> I used PGAdmin III to add a character varying column(400) length, not null
> default ''. I get the column displayed in psql when I do a simple query
> like SELECT * from MyTable limit 1;
>
> When I try to do Update MyTable set NewColumn='something'; I get the error
> saying that the column doesn't exist.... It thinks it exists when I do my
> select, but it doesn't recognize this new column in my UPDATE...

Perhaps you created the column with a capital letter? If that's the
case, you'll have to quote the column name: ... set
"NewColumn"='something'. If that's what happened, I'd suggest dropping
and recreating the column in all-lowercase.

If this didn't help, please post the output of the "SELECT *" verbatim.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mike Gagnon" <mike(dot)gagnon(at)bellnet(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4166: Alter table add column from PgAdminIII
Date: 2008-05-14 14:34:09
Message-ID: 19213.1210775649@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Mike Gagnon" <mike(dot)gagnon(at)bellnet(dot)ca> writes:
> I used PGAdmin III to add a character varying column(400) length, not null
> default ''. I get the column displayed in psql when I do a simple query
> like SELECT * from MyTable limit 1;

> When I try to do Update MyTable set NewColumn='something'; I get the error
> saying that the column doesn't exist....

I'm betting you have a case sensitivity problem. Either you created the
column as "NewColumn" with quotes and are trying to reference it without
quotes, or vice versa.

regards, tom lane