Andreas Kretschmer wrote:
>
> Maciej Piekielniak <piechcio@isb.com.pl> schrieb:
>
> > Hello Andreas,
> >
> > Wednesday, February 15, 2006, 7:54:28 PM, you wrote:
> > AK> test=# alter table xyz alter column id set default
> nextval('xyz_seq'), alter column foo set default '';
> >
> > PGAdmin-SQL:
> >
> > alter table xyz alter column id set default
> nextval('xyz_seq'), alter column foo set default '';
> >
> > ERROR: syntax error at or near "," at character 63
>
> Hmm.
>
> test=# select version();
> version
> --------------------------------------------------------------
> ------------------------------------------------
> PostgreSQL 8.1.2 on i486-pc-linux-gnu, compiled by GCC cc
> (GCC) 4.0.3 20060104 (prerelease) (Debian 4.0.2-6)
> (1 row)
Note that prior to 8.0 PostgreSQL does not support multiple ALTER actions in a single query. To get an equivalent
effect,wrap separate ALTER TABLE queries in a transaction:
BEGIN;
alter table xyz alter column id set default nextval('xyz_seq');
alter table xyz alter column foo set default '';
COMMIT;
Also, are you sure you want '' as a column default, and not ALTER COLUMN foo DROP DEFAULT?
-Owen