Thu Jan 6 19:59:00 PST 2005
- Previous message: [Slony1-general] execute script
- Next message: [Slony1-general] [PATCH] Fix for Sequence ID in create_set.pl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1/5/2005 2:33 PM, sarlav kumar wrote: > Hi, > > I tried using execute script to add a column to a table. But it doesn't work. > I read in articles that it is possible to execute a set of alter table commands using execute script. > > Here is what I tried: (I am pasting only the relevant stuff) > > #-- > execute script ( SET ID = 1, FILENAME = 'DDL.sql', EVENT NODE = 1); > echo 'DDL executed'; > #-- > > DDL.sql file contains: > alter table newt ADD column newcol int; The really relevant bit is that you executed that ALTER TABLE on the origin node already. Jan > > I also have other files DDL1.sql, DDL2.sql which contain the following respectively > alter table newt alter column newcol set default 0; > > update newt SET newcol = 0 where newcol is null; > > When I execute DDL.sql, I get the following error: > <stdin>:16: PGRES_FATAL_ERROR select "_test".ddlScript(1, 'alter table newt ADD column newcol int; > '); - ERROR: column "newcol" of relation "newt" already exists > CONTEXT: PL/pgSQL function "ddlscript_int" line 45 at execute statement > PL/pgSQL function "ddlscript" line 30 at perform > > But in the subscriber node, the column does not exist. What am I doing wrong here? > When I add the column manually in the subscriber node and execute DDL1 and DDL2, I dont have any problem. > > Thanks, > Saranya > > > > > > --------------------------------- > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Slony1-general mailing list > Slony1-general at gborg.postgresql.org > http://gborg.postgresql.org/mailman/listinfo/slony1-general -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck at Yahoo.com #
- Previous message: [Slony1-general] execute script
- Next message: [Slony1-general] [PATCH] Fix for Sequence ID in create_set.pl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list