X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 91093476285 for ; Wed, 26 Mar 2003 04:54:19 -0500 (EST) Received: from shield.pirmabanka.lv (unknown [195.114.57.4]) by postgresql.org (Postfix) with ESMTP id 268034761C0 for ; Wed, 26 Mar 2003 04:54:17 -0500 (EST) Received: from wall2.pirmabanka.lv (wall2-pub.pirmabanka.lv [195.114.57.14]) by shield.pirmabanka.lv (8.12.8/8.9.3) with SMTP id h2Q9sHtw028712 for ; Wed, 26 Mar 2003 11:54:17 +0200 Received: from share.pirmabanka.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Wed, 26 Mar 2003 11:54:16 +0200 (EET) Received: from pc311x1.pirmabanka.lv (localhost.localdomain [127.0.0.1]) by pirmabanka.lv (8.11.6/8.11.6) with SMTP id h2Q9sFn11199 for ; Wed, 26 Mar 2003 11:54:15 +0200 Received: (qmail 317 invoked by uid 100); 26 Mar 2003 09:56:06 -0000 Date: Wed, 26 Mar 2003 11:56:06 +0200 From: "Victor Yegorov" To: "Marc Soler" Cc: Subject: Re: About changing type af a column Message-ID: <20030326095606.GH1556@pirmabanka.lv> Mail-Followup-To: "Marc Soler" , References: <03b401c2f37b$97512640$0300a8c0@terra> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0qVF/w3MHQqLSynd" Content-Disposition: inline In-Reply-To: <03b401c2f37b$97512640$0300a8c0@terra> User-Agent: Mutt/1.4.1i X-Spam-Status: No, hits=-38.4 required=5.0 tests=BAYES_10,IN_REP_TO,PGP_SIGNATURE_2,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/435 X-Sequence-Number: 8075 --0qVF/w3MHQqLSynd Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Marc Soler [26.03.2003 11:48]: > Hi all, >=20 > I need to change a column length. >=20 > >From varchar(150) to varchar(250). >=20 > It's easy to change with an ALTER command? Or I need to create a new colu= mn, > copy all data from the old column to the new one, then drop the old and > rename the new. >=20 > If only exists the second solutions, the new column it will be created la= st > one of the columns, then I must change all INSERT and UPDATE commands in = my > application. How order of fields in the table can affect UPDATE statements? About INSERTs - it's a good thing to specify all fields being inserted just to prevent 'inconveniences' like you've mentioned. > It's possible to create a column in a given position in the columns > structure of a table?. Yes. create a new table with same design except for the field you'd like to change, than copy all data into new table, drop old one and rename new one. >=20 > Thanks in advance. --=20 Victor Yegorov --0qVF/w3MHQqLSynd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+gXk22RKGLEykUDYRAnyKAKCFPvCFS6xvsg1Yr0IO8GtDUYbMRwCgyb/Y lTMcWCd//PLzfQ3qAbURbno= =BWrX -----END PGP SIGNATURE----- --0qVF/w3MHQqLSynd--