Re: alter table

From: Maciej Piekielniak <piechcio(at)isb(dot)com(dot)pl>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: alter table
Date: 2006-02-15 19:45:00
Message-ID: 1112676794.20060215204500@isb.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)isb(dot)com(dot)pl

Browse pgsql-sql by date

  From Date Subject
Next Message Owen Jacobson 2006-02-15 19:56:05 Re: alter table
Previous Message Owen Jacobson 2006-02-15 19:31:17 Re: alter table