dbTalk Databases Forums  

[BUGS] BUG #2572: ALTER TABLE ADD COLUMN

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2572: ALTER TABLE ADD COLUMN in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Emil J.
 
Posts: n/a

Default [BUGS] BUG #2572: ALTER TABLE ADD COLUMN - 08-13-2006 , 08:35 AM







The following bug has been logged online:

Bug reference: 2572
Logged by: Emil J.
Email address: emilj (AT) pyton (DOT) sk
PostgreSQL version: 8.1.4
Operating system: Windows XP
Description: ALTER TABLE ADD COLUMN
Details:

I create some function (PLPGSQL):

......
BEGIN
ALTER TABLE sch.table ADD COLUMN abc INTEGER;
RETURN NULL;
END;

After i called it, nothing happend. No Error, No Exception, No effect - no
column added.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] BUG #2572: ALTER TABLE ADD COLUMN - 08-13-2006 , 09:00 AM






On Sat, Aug 12, 2006 at 11:53:08AM +0000, Emil J. wrote:
Quote:
I create some function (PLPGSQL):

.....
BEGIN
ALTER TABLE sch.table ADD COLUMN abc INTEGER;
RETURN NULL;
END;

After i called it, nothing happend. No Error, No Exception, No effect - no
column added.
Works here. Is it possible that the calling transaction rolled
back or that it hadn't committed yet and you looked at the table
in another transaction? Can you provide a complete test case?

Example:

test=> CREATE TABLE foo (id integer);
CREATE TABLE
test=> CREATE FUNCTION test() RETURNS void AS $$
test$> BEGIN
test$> ALTER TABLE foo ADD COLUMN newcol integer;
test$> END;
test$> $$ LANGUAGE plpgsql;
CREATE FUNCTION
test=> \d foo
Table "public.foo"
Column | Type | Modifiers
--------+---------+-----------
id | integer |

test=> SELECT test();
test
------

(1 row)

test=> \d foo
Table "public.foo"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
newcol | integer |

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.