Discussion:
Help---- Urgent
(too old to reply)
Chitta Ranjan Mishra
2003-12-11 05:19:50 UTC
Permalink
Dear Sir,
I wnat to alter the size of one of the column of a
table. How to do this in Postgres ? Plz help me.
It's very urgent...

I tried with the following syntax :
but it failed....

alter table tablename modify(coumnname varchar(25));

it's very urgnet...plz reply soon..

Thanking you,
Regds
C.R.Mishra




________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ***@postgresql.org
Andrei Bintintan
2003-12-11 15:42:57 UTC
Permalink
Create a new column

alter <tablename> add column <newcolname> varchar(25);

Then copy the old column into the new column:
update <tablename> set <newcolname> = <oldcolname>;

Drop the last column:
alter <tablename> drop column <oldcolname>;

Rename the column:
alter <tablename> rename column <newcolname> to <oldcolname>;

Take care for INDEXES if there are any.

This should do it.

Best regards.


----- Original Message -----
From: "Chitta Ranjan Mishra" <***@yahoo.co.in>
To: <pgsql-***@postgresql.org>
Sent: Thursday, December 11, 2003 7:19 AM
Subject: [ADMIN] Help---- Urgent
Post by Chitta Ranjan Mishra
Dear Sir,
I wnat to alter the size of one of the column of a
table. How to do this in Postgres ? Plz help me.
It's very urgent...
but it failed....
alter table tablename modify(coumnname varchar(25));
it's very urgnet...plz reply soon..
Thanking you,
Regds
C.R.Mishra
________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com
---------------------------(end of broadcast)---------------------------
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Contact
2003-12-11 15:24:06 UTC
Permalink
Create a new column

alter <tablename> add column <newcolname> varchar(25);

Then copy the old column into the new column:
update <tablename> set <newcolname> = <oldcolname>;

Drop the last column:
alter <tablename> drop column <oldcolname>;

Rename the column:
alter <tablename> rename column <newcolname> to <oldcolname>;

Take care for INDEXES if there are any.

This should do it.

Best regards.


----- Original Message -----
From: "Chitta Ranjan Mishra" <***@yahoo.co.in>
To: <pgsql-***@postgresql.org>
Sent: Thursday, December 11, 2003 7:19 AM
Subject: [ADMIN] Help---- Urgent
Post by Chitta Ranjan Mishra
Dear Sir,
I wnat to alter the size of one of the column of a
table. How to do this in Postgres ? Plz help me.
It's very urgent...
but it failed....
alter table tablename modify(coumnname varchar(25));
it's very urgnet...plz reply soon..
Thanking you,
Regds
C.R.Mishra
________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com
---------------------------(end of broadcast)---------------------------
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly

Loading...