X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0B6669DCA17 for ; Wed, 15 Feb 2006 15:45:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02987-03 for ; Wed, 15 Feb 2006 15:45:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from isb.com.pl (isb.com.pl [212.160.150.140]) by postgresql.org (Postfix) with ESMTP id CDF409DCA54 for ; Wed, 15 Feb 2006 15:45:01 -0400 (AST) Received: from 192.168.0.17 (sembrz [192.168.1.50]) by isb.com.pl (Postfix) with ESMTP id 97D9F57842 for ; Wed, 15 Feb 2006 20:42:17 +0100 (CET) Date: Wed, 15 Feb 2006 20:45:00 +0100 From: Maciej Piekielniak X-Mailer: The Bat! (v1.62r) Reply-To: Maciej Piekielniak X-Priority: 3 (Normal) Message-ID: <1112676794.20060215204500@isb.com.pl> To: pgsql-sql@postgresql.org Subject: Re: alter table Resent-From: Maciej Piekielniak MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-Id: <20060215194217.97D9F57842@isb.com.pl> Resent-Date: Wed, 15 Feb 2006 20:42:17 +0100 (CET) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120, UPPERCASE_25_50=0] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200602/180 X-Sequence-Number: 24190 Hello Owen, Wednesday, February 15, 2006, 8:31:17 PM, you wrote: OJ> 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: OJ> BEGIN; OJ> alter table xyz alter column id set default nextval('xyz_seq'); OJ> alter table xyz alter column foo set default ''; OJ> COMMIT; OJ> Also, are you sure you want '' as a column default, and not ALTER COLUMN foo DROP DEFAULT? OJ> -Owen OK. THX. Second question: First, maybe set many fields with the same action - ex. set default? Ex. on mysql ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, MODIFY specific_name char(64) DEFAULT '' NOT NULL, MODIFY sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL.... Second, can i modify more than 1 option with alter table on one field?: ex (mysql): ALTER TABLE proc MODIFY name varchar(64) DEFAULT '' NOT NULL; -- Best regards, Maciej mailto:piechcio@isb.com.pl