pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Contact <contact@ar-sd.net>
To: Chitta Ranjan Mishra <c_r_mishra@yahoo.co.in>
To: pgsql-admin@postgresql.org
Subject: Re: Help---- Urgent
Date: Thu, 11 Dec 2003 17:24:06 +0200
Message-ID: <003201c3bffa$d3c35930$0b00a8c0@andyy> (raw)
References: <20031211051950.38379.qmail@web8002.mail.in.yahoo.com>

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" <c_r_mishra@yahoo.co.in>
To: <pgsql-admin@postgresql.org>
Sent: Thursday, December 11, 2003 7:19 AM
Subject: [ADMIN] Help---- Urgent


> 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 majordomo@postgresql.org



view thread (5+ messages)  latest in thread

Message-ID: <003201c3bffa$d3c35930$0b00a8c0@andyy>
Permalink:  ../003201c3bffa$d3c35930$0b00a8c0@andyy/
Also on:    postgresql.org/message-id/003201c3bffa$d3c35930$0b00a8c0@andyy

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: contact@ar-sd.net, c_r_mishra@yahoo.co.in
  Subject: Re: Help---- Urgent
  In-Reply-To: <003201c3bffa$d3c35930$0b00a8c0@andyy>
  References: <20031211051950.38379.qmail@web8002.mail.in.yahoo.com> <003201c3bffa$d3c35930$0b00a8c0@andyy>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox