From jkanter@virginia.edu Tue Aug 19 18:25:22 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D2499D1BA65 for ; Tue, 19 Aug 2003 15:25:22 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 30398-01 for ; Tue, 19 Aug 2003 15:25:13 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id 97985D1B94A for ; Tue, 19 Aug 2003 15:25:11 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id EAF423514E for ; Tue, 19 Aug 2003 14:24:34 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h7JIOYl05692 for ; Tue, 19 Aug 2003 14:24:34 -0400 Message-ID: <3F426DB0.1040607@virginia.edu> Date: Tue, 19 Aug 2003 14:34:24 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Postgres Admin List Subject: changing field length Content-Type: multipart/alternative; boundary="------------040202090809050905020800" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/206 X-Sequence-Number: 9927 --------------040202090809050905020800 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I am running 7.3.3. Can I change a field that is varying character(128) to varying character(250)? Thanks Jodi -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------040202090809050905020800 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit I am running 7.3.3. Can I change a field that is varying character(128) to varying character(250)?

Thanks
Jodi
--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 

--------------040202090809050905020800-- From mendola@bigfoot.com Tue Aug 19 19:11:40 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5BD43D1B8BF for ; Tue, 19 Aug 2003 16:11:40 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 44596-06 for ; Tue, 19 Aug 2003 16:11:31 -0300 (ADT) Received: from smtp.noos.fr (nan-smtp-13.noos.net [212.198.2.121]) by svr1.postgresql.org (Postfix) with ESMTP id 2AD88D1BB0A for ; Tue, 19 Aug 2003 16:11:29 -0300 (ADT) Received: (qmail 21065 invoked by uid 0); 19 Aug 2003 19:11:28 -0000 Received: from unknown (HELO gmendola) ([::ffff:212.198.37.110]) (envelope-sender ) by ::ffff:212.198.2.121 (qmail-ldap-1.03) with SMTP for ; 19 Aug 2003 19:11:28 -0000 Message-ID: <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> From: "Gaetano Mendola" To: Cc: "Jodi Kanter" References: <3F426DB0.1040607@virginia.edu> Subject: Re: changing field length Date: Tue, 19 Aug 2003 21:09:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/207 X-Sequence-Number: 9928 "Jodi Kanter" wrote: > I am running 7.3.3. Can I change a field that is varying character(128) > to varying character(250)? nope. You can a) create a new column named tmp of character(250). b) copy the content from old column to new column c) drop the old column d) rename the tmp column to the correct name Regards Gaeatano Mendola PS: Be carefull with the constraint.... From sszabo@megazone.bigpanda.com Tue Aug 19 19:33:30 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 02A1FD1B99D for ; Tue, 19 Aug 2003 16:33:30 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 50103-02 for ; Tue, 19 Aug 2003 16:33:20 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 88FF4D1BA1A for ; Tue, 19 Aug 2003 16:33:14 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 68827D675; Tue, 19 Aug 2003 12:33:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 5E1D35C0B; Tue, 19 Aug 2003 12:33:00 -0700 (PDT) Date: Tue, 19 Aug 2003 12:33:00 -0700 (PDT) From: Stephan Szabo To: Jodi Kanter Cc: Postgres Admin List Subject: Re: changing field length In-Reply-To: <3F426DB0.1040607@virginia.edu> Message-ID: <20030819122924.O72868-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/208 X-Sequence-Number: 9929 On Tue, 19 Aug 2003, Jodi Kanter wrote: > I am running 7.3.3. Can I change a field that is varying character(128) > to varying character(250)? You can either add a column, copy the data across and drop the old column and use rename to give the new column the old name or if you're willing to hack at system tables, you can change atttypmod in pg_attribute for the column from 132 (maxsize + 4 to hold the real size) to 254. From nickf@ontko.com Wed Aug 20 00:38:54 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CDFCDD1B8B4 for ; Tue, 19 Aug 2003 21:38:54 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29240-08 for ; Tue, 19 Aug 2003 21:38:47 -0300 (ADT) Received: from flamingo.mail.pas.earthlink.net (flamingo.mail.pas.earthlink.net [207.217.120.232]) by svr1.postgresql.org (Postfix) with ESMTP id E3580D1CD1E for ; Tue, 19 Aug 2003 21:38:43 -0300 (ADT) Received: from 0-1pool116-81.nas15.indianapolis1.in.us.da.qwest.net ([65.128.116.81] helo=nick) by flamingo.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 19pGzu-00023H-00; Tue, 19 Aug 2003 17:38:46 -0700 Reply-To: From: "Nick Fankhauser" To: "Jodi Kanter" , "Postgres Admin List" Subject: Re: changing field length Date: Tue, 19 Aug 2003 19:37:38 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: <3F426DB0.1040607@virginia.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/209 X-Sequence-Number: 9930 Jodi- Here's an example of the "hack" approach, which I've used without causing any problems for some time: update pg_attribute set atttypmod = 104 where attrelid = ( select oid from pg_class where relname = 'actor' and attname = 'actor_full_name' ); In your case, you'd substitute 254 for 104, your table name for "actor" and your field name for "actor_full_name"; -Nick -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Jodi Kanter Sent: Tuesday, August 19, 2003 1:34 PM To: Postgres Admin List Subject: [ADMIN] changing field length I am running 7.3.3. Can I change a field that is varying character(128) to varying character(250)? Thanks Jodi -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu From jkanter@virginia.edu Wed Aug 20 14:07:00 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A074ED1D0B7 for ; Wed, 20 Aug 2003 11:07:00 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 61096-06 for ; Wed, 20 Aug 2003 11:06:50 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id 7214DD1BB7E for ; Wed, 20 Aug 2003 11:06:46 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id F0B89923DD; Wed, 20 Aug 2003 10:06:50 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h7KE6nl08724; Wed, 20 Aug 2003 10:06:50 -0400 Message-ID: <3F4382C6.3030101@virginia.edu> Date: Wed, 20 Aug 2003 10:16:38 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Gaetano Mendola Cc: pgsql-admin@postgresql.org Subject: Re: changing field length References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> Content-Type: multipart/alternative; boundary="------------040902090108080807000103" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/212 X-Sequence-Number: 9933 --------------040902090108080807000103 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit how do I copy from one field to another? Gaetano Mendola wrote: >"Jodi Kanter" wrote: > >>I am running 7.3.3. Can I change a field that is varying character(128) >>to varying character(250)? >> > >nope. > >You can > a) create a new column named tmp of character(250). > b) copy the content from old column to new column > c) drop the old column > d) rename the tmp column to the correct name > > >Regards >Gaeatano Mendola > >PS: Be carefull with the constraint.... > > > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------040902090108080807000103 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit how do I copy from one field to another?

Gaetano Mendola wrote:
"Jodi Kanter" <jkanter@virginia.edu> wrote:
I am running 7.3.3. Can I change a field that is varying character(128) 
to varying character(250)?

nope.

You can
a) create a new column named tmp of character(250).
b) copy the content from old column to new column
c) drop the old column
d) rename the tmp column to the correct name


Regards
Gaeatano Mendola

PS: Be carefull with the constraint....



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 


--------------040902090108080807000103-- From bruno@wolff.to Wed Aug 20 14:21:02 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 088BED1CD1E for ; Wed, 20 Aug 2003 11:21:02 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 66573-01 for ; Wed, 20 Aug 2003 11:20:54 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 6ED13D1B92B for ; Wed, 20 Aug 2003 11:20:50 -0300 (ADT) Received: (qmail 10127 invoked by uid 500); 20 Aug 2003 14:26:39 -0000 Date: Wed, 20 Aug 2003 09:26:39 -0500 From: Bruno Wolff III To: Jodi Kanter Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length Message-ID: <20030820142639.GA10047@wolff.to> Mail-Followup-To: Jodi Kanter , Gaetano Mendola , pgsql-admin@postgresql.org References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4382C6.3030101@virginia.edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/213 X-Sequence-Number: 9934 On Wed, Aug 20, 2003 at 10:16:38 -0400, Jodi Kanter wrote: > how do I copy from one field to another? update tablename set newcol = oldcol; From jkanter@virginia.edu Wed Aug 20 14:29:49 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3DEA2D1B8F1 for ; Wed, 20 Aug 2003 11:29:49 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 69357-02 for ; Wed, 20 Aug 2003 11:29:42 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id CD69ED1B9B2 for ; Wed, 20 Aug 2003 11:29:37 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id D4ABF9167C; Wed, 20 Aug 2003 10:29:40 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h7KETbl08908; Wed, 20 Aug 2003 10:29:37 -0400 Message-ID: <3F43881D.2020908@virginia.edu> Date: Wed, 20 Aug 2003 10:39:25 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Bruno Wolff III Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> <20030820142639.GA10047@wolff.to> Content-Type: multipart/alternative; boundary="------------080105020504030509010306" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/214 X-Sequence-Number: 9935 --------------080105020504030509010306 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit ExecUpdate: Fail to add null value in not null attribute study_name Is there any way around this error. Col1 is a not null field but col2 is not obviously since it is currently empty! Thanks for the help. Jodi Bruno Wolff III wrote: >On Wed, Aug 20, 2003 at 10:16:38 -0400, > Jodi Kanter wrote: > >>how do I copy from one field to another? >> > >update tablename set newcol = oldcol; > -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------080105020504030509010306 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit ExecUpdate: Fail to add null value in not null attribute study_name

Is there any way around this error. Col1 is a not null field but col2 is not obviously since it is currently empty!
Thanks for the help.
Jodi

Bruno Wolff III wrote:
On Wed, Aug 20, 2003 at 10:16:38 -0400,
Jodi Kanter <jkanter@virginia.edu> wrote:
how do I copy from one field to another?

update tablename set newcol = oldcol;

--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 


--------------080105020504030509010306-- From jkanter@virginia.edu Wed Aug 20 14:30:54 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 35537D1B92B for ; Wed, 20 Aug 2003 11:30:54 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 66733-08 for ; Wed, 20 Aug 2003 11:30:46 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id 62646D1BAA3 for ; Wed, 20 Aug 2003 11:30:42 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id B74D5980AC; Wed, 20 Aug 2003 10:30:39 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h7KEUcl34290; Wed, 20 Aug 2003 10:30:38 -0400 Message-ID: <3F43885B.5080802@virginia.edu> Date: Wed, 20 Aug 2003 10:40:27 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Bruno Wolff III Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> <20030820142639.GA10047@wolff.to> Content-Type: multipart/alternative; boundary="------------010804010205080605090906" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/215 X-Sequence-Number: 9936 --------------010804010205080605090906 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit please ignore last message. I had my columns switched. sorry about that! Thanks for the quick response. jodi Bruno Wolff III wrote: >On Wed, Aug 20, 2003 at 10:16:38 -0400, > Jodi Kanter wrote: > >>how do I copy from one field to another? >> > >update tablename set newcol = oldcol; > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------010804010205080605090906 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit please ignore last message. I had my columns switched.
sorry about that!
Thanks for the quick response.
jodi

Bruno Wolff III wrote:
On Wed, Aug 20, 2003 at 10:16:38 -0400,
Jodi Kanter <jkanter@virginia.edu> wrote:
how do I copy from one field to another?

update tablename set newcol = oldcol;

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 


--------------010804010205080605090906-- From jkanter@virginia.edu Wed Aug 20 14:39:27 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 49B50D1B56C for ; Wed, 20 Aug 2003 11:39:27 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 72998-06 for ; Wed, 20 Aug 2003 11:39:20 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id 64247D1BAE2 for ; Wed, 20 Aug 2003 11:39:16 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id 389108EA46; Wed, 20 Aug 2003 10:39:21 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h7KEdKl34420; Wed, 20 Aug 2003 10:39:20 -0400 Message-ID: <3F438A64.8030206@virginia.edu> Date: Wed, 20 Aug 2003 10:49:08 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Bruno Wolff III Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> <20030820142639.GA10047@wolff.to> Content-Type: multipart/alternative; boundary="------------000308040704010504000802" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/217 X-Sequence-Number: 9938 --------------000308040704010504000802 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit can I now make this field not null? is it possible to move a field up in a table? now that I have done this move the new field is at the bottom of the list of fields. From time to time we have had to make changes to our schema so I will rerun our script and do a pg_dump of the data only and then restore the data from within psql. This new field in the dump is in a different location then it is when the script runs. I expect this will cause an error. I am doing pg_dumps with the following: -Rau I realize I can move it down in the script but was wondering if there were another solution. Logically it makes sense to list it toward the top of the table. Thanks Jodi Bruno Wolff III wrote: >On Wed, Aug 20, 2003 at 10:16:38 -0400, > Jodi Kanter wrote: > >>how do I copy from one field to another? >> > >update tablename set newcol = oldcol; > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------000308040704010504000802 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit can I now make this field not null?

is it possible to move a field up in a table? now that I have done this move the new field is at the bottom of the list of fields. From time to time we have had to make changes to our schema so I will rerun our script and do a pg_dump of the data only and then restore the data from within psql. This new field in the dump is in a different location then it is when the script runs. I expect this will cause an error. I am doing pg_dumps with the following: -Rau
I realize I can move it down in the script but was wondering if there were another solution. Logically it makes sense to list it toward the top of the table.

Thanks
Jodi

Bruno Wolff III wrote:
On Wed, Aug 20, 2003 at 10:16:38 -0400,
Jodi Kanter <jkanter@virginia.edu> wrote:
how do I copy from one field to another?

update tablename set newcol = oldcol;

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 


--------------000308040704010504000802-- From bruno@wolff.to Wed Aug 20 14:53:07 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DDAE6D1CDD9 for ; Wed, 20 Aug 2003 11:53:07 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 75388-10 for ; Wed, 20 Aug 2003 11:53:01 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id BEF3ED1BB7A for ; Wed, 20 Aug 2003 11:52:56 -0300 (ADT) Received: (qmail 12332 invoked by uid 500); 20 Aug 2003 14:58:47 -0000 Date: Wed, 20 Aug 2003 09:58:47 -0500 From: Bruno Wolff III To: Jodi Kanter Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length Message-ID: <20030820145847.GB11204@wolff.to> Mail-Followup-To: Jodi Kanter , Gaetano Mendola , pgsql-admin@postgresql.org References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> <20030820142639.GA10047@wolff.to> <3F438A64.8030206@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F438A64.8030206@virginia.edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/219 X-Sequence-Number: 9940 On Wed, Aug 20, 2003 at 10:49:08 -0400, Jodi Kanter wrote: > can I now make this field not null? > > is it possible to move a field up in a table? now that I have done this Currently, not without recreating the table. There was some discussion about that a few months ago, but nothing is happening in 7.4 on that front. Maybe in 7.5 there will be a way to change the column order, but don't count on it. From jkanter@virginia.edu Wed Aug 20 15:06:43 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C63C3D1BA51 for ; Wed, 20 Aug 2003 12:06:43 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 85147-06 for ; Wed, 20 Aug 2003 12:06:33 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id BFCB2D1B8F1 for ; Wed, 20 Aug 2003 12:06:32 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id DE1A992A6D; Wed, 20 Aug 2003 11:06:31 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h7KF6Ul19548; Wed, 20 Aug 2003 11:06:30 -0400 Message-ID: <3F4390C2.6050106@virginia.edu> Date: Wed, 20 Aug 2003 11:16:18 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Bruno Wolff III Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> <20030820142639.GA10047@wolff.to> <3F438A64.8030206@virginia.edu> <20030820145847.GB11204@wolff.to> Content-Type: multipart/alternative; boundary="------------060907030700050903020807" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/220 X-Sequence-Number: 9941 --------------060907030700050903020807 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Ok. so for now I want to return to where I started. so I renamed the table and regenerated my original table with the fields in the order that I like. I cannot just do a insert into table select * from other_table; because the fields are in a different order. Can I do this by listing the fields in my insert in the order in which I want them placed? Thanks Jodi Bruno Wolff III wrote: >On Wed, Aug 20, 2003 at 10:49:08 -0400, > Jodi Kanter wrote: > >>can I now make this field not null? >> >>is it possible to move a field up in a table? now that I have done this >> > >Currently, not without recreating the table. There was some discussion >about that a few months ago, but nothing is happening in 7.4 on that >front. Maybe in 7.5 there will be a way to change the column order, >but don't count on it. > >---------------------------(end of broadcast)--------------------------- >TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------060907030700050903020807 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Ok. so for now I want to return to where I started. so I renamed the table and regenerated my original table with the fields in the order that I like. I cannot just do a
insert into table select * from other_table;
because the fields are in a different order.
Can I do this by listing the fields in my insert in the order in which I want them placed?
Thanks
Jodi

Bruno Wolff III wrote:
On Wed, Aug 20, 2003 at 10:49:08 -0400,
Jodi Kanter <jkanter@virginia.edu> wrote:
can I now make this field not null?

is it possible to move a field up in a table? now that I have done this

Currently, not without recreating the table. There was some discussion
about that a few months ago, but nothing is happening in 7.4 on that
front. Maybe in 7.5 there will be a way to change the column order,
but don't count on it.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 


--------------060907030700050903020807-- From bruno@wolff.to Wed Aug 20 15:12:57 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id ACF11D1BAA4 for ; Wed, 20 Aug 2003 12:12:57 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 86503-04 for ; Wed, 20 Aug 2003 12:12:47 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 777FDD1B92B for ; Wed, 20 Aug 2003 12:12:46 -0300 (ADT) Received: (qmail 13723 invoked by uid 500); 20 Aug 2003 15:18:31 -0000 Date: Wed, 20 Aug 2003 10:18:31 -0500 From: Bruno Wolff III To: Jodi Kanter Cc: Gaetano Mendola , pgsql-admin@postgresql.org Subject: Re: changing field length Message-ID: <20030820151831.GA13575@wolff.to> Mail-Followup-To: Jodi Kanter , Gaetano Mendola , pgsql-admin@postgresql.org References: <3F426DB0.1040607@virginia.edu> <000d01c36685$78b2c090$10d4a8c0@mm.eutelsat.org> <3F4382C6.3030101@virginia.edu> <20030820142639.GA10047@wolff.to> <3F438A64.8030206@virginia.edu> <20030820145847.GB11204@wolff.to> <3F4390C2.6050106@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4390C2.6050106@virginia.edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/221 X-Sequence-Number: 9942 On Wed, Aug 20, 2003 at 11:16:18 -0400, Jodi Kanter wrote: > Ok. so for now I want to return to where I started. so I renamed the > table and regenerated my original table with the fields in the order > that I like. I cannot just do a > insert into table select * from other_table; > because the fields are in a different order. > Can I do this by listing the fields in my insert in the order in which I > want them placed? Yes. Instead of using '*' list the columns from the table that currently has the data in the order that they appear in the table that is currently empty. From scott.marlowe@ihs.com Wed Aug 20 15:50:57 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8CFB5D1BA74 for ; Wed, 20 Aug 2003 12:50:57 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 95470-03 for ; Wed, 20 Aug 2003 12:50:47 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 7F563D1B8CE for ; Wed, 20 Aug 2003 12:50:46 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h7KFmgdb018920; Wed, 20 Aug 2003 09:48:42 -0600 (MDT) Date: Wed, 20 Aug 2003 09:48:39 -0600 (MDT) From: "scott.marlowe" To: Jodi Kanter Cc: Bruno Wolff III , Gaetano Mendola , Subject: Re: changing field length In-Reply-To: <3F4390C2.6050106@virginia.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/225 X-Sequence-Number: 9946 As always, there's more than one way to skin a cat... Create a new table and insert into it: create newtable (field newdef, field2 newdef); insert into newtable ( select oldfield, oldfield2 from oldtable ); Create it on the fly with Postgresql casting shortcuts: select field1::newtype, field2::newtype, field3, field4 into newtable from oldtable; Create it on the fly with ANSI style casting: select cast(field1 as newtype), cast(field2 as newtype), field3, field4 into newtable from oldtable; On Wed, 20 Aug 2003, Jodi Kanter wrote: > Ok. so for now I want to return to where I started. so I renamed the > table and regenerated my original table with the fields in the order > that I like. I cannot just do a > insert into table select * from other_table; > because the fields are in a different order. > Can I do this by listing the fields in my insert in the order in which I > want them placed? > Thanks > Jodi > > Bruno Wolff III wrote: > > >On Wed, Aug 20, 2003 at 10:49:08 -0400, > > Jodi Kanter wrote: > > > >>can I now make this field not null? > >> > >>is it possible to move a field up in a table? now that I have done this > >> > > > >Currently, not without recreating the table. There was some discussion > >about that a few months ago, but nothing is happening in 7.4 on that > >front. Maybe in 7.5 there will be a way to change the column order, > >but don't count on it. > > > >---------------------------(end of broadcast)--------------------------- > >TIP 6: Have you searched our list archives? > > > > http://archives.postgresql.org > > > >