Re: Adding multiple column in alter statement?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Adding multiple column in alter statement?
Date: 2007-04-05 06:09:09
Message-ID: 20070405060909.GD24814@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am Thu, dem 05.04.2007, um 6:58:01 +0100 mailte Ashish Karalkar folgendes:
> Hello All,
> I want to add multiple column to a table using single alter statemet,
> someting like this:
>
> alter table admin_session add column accounting_session varchar(1) not null
> default '0',accounting_active varchar(1),acc_start_date date,acc_end_date date;
>
> is there any way?

Yes, read the doc ;-)

test=# \d bla
Table "public.bla"
Column | Type | Modifiers
--------+---------+-----------
id | integer |

test=# alter table bla add column name1 text, add column name2 text, add column name3 text;
ALTER TABLE
test=*# \d bla
Table "public.bla"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
name1 | text |
name2 | text |
name3 | text |

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ashish Karalkar 2007-04-05 06:41:06 All objects of a Particular USER
Previous Message Ashish Karalkar 2007-04-05 05:58:01 Adding multiple column in alter statement?