X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5073E475B99 for ; Wed, 16 Apr 2003 09:54:37 -0400 (EDT) Received: from jobs1.unisoftbg.com (unknown [194.12.229.207]) by postgresql.org (Postfix) with SMTP id 61FE1475ED4 for ; Wed, 16 Apr 2003 09:54:03 -0400 (EDT) Received: (qmail 13423 invoked from network); 16 Apr 2003 15:28:19 -0000 Received: from unknown (HELO t1.unisoftbg.com) (194.12.229.193) by 0 with SMTP; 16 Apr 2003 15:28:19 -0000 Message-ID: <3E9D5227.E346BAE0@t1.unisoftbg.com> Date: Wed, 16 Apr 2003 14:52:55 +0200 From: pginfo X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: Rudi Starcevic Cc: pgsql-sql@postgresql.org Subject: Re: changing column size and type. References: <3E9C155B.7A694675@t1.unisoftbg.com> <000401c303a4$b2d88500$7308a18e@cleartag> <3E9CDF76.C2B2D50@t1.unisoftbg.com> <3E9CF0DB.60509@oasis.net.au> <3E9D1F55.9582B0E6@t1.unisoftbg.com> <20030416130931.M25027@oasis.net.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-24.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,QUOTED_EMAIL_TEXT,RCVD_IN_DSBL, RCVD_IN_OSIRUSOFT_COM,REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/254 X-Sequence-Number: 12955 Hi Rudi, I think it is good solution for now. Many thanks, ivan. Rudi Starcevic wrote: > Ivan, > > Oops sorry about that .. > I should have read your email closer. > Have you seen Joel Burton's doc at: > http://techdocs.postgresql.org/techdocs/updatingcolumns.php > > Looks like you may need to use temporary tables and move > the data back and forth. > > That's the way I do it. > I'm pretty sure this also how it's done using the phpPgAdmin > web admin tool. > I guess since phpPgAdmin's a web tool the task is achieved 'online'. > > Cheers > Best regards > Rudi. > > > Hi Rudi, > > > > I readet the doc, but it is about how to ann new column. > > That is well documented in pgDoc's. > > > > I will to change the column type of existing column. > > For example if my columnt was declared as int4, I will to change it > > to int8. Or if it was varchar(20) I will to make it varchar(100) and > > so on. Also I will it without to dump the db. > > > > regards, > > ivan. > > > > Rudi Starcevic wrote: > > > > > Ivan, > > > > > > This link show's how to do it online. > > > > > > http://www.edoceo.com/liberum/default.php?doc=postgresql-tricks > > > > > > There are other links around too. > > > > > > Cheers > > > Rudi > > > > > > > > > pginfo wrote: > > > > > >> Hi George, > > >> > > >> It is possible to do it so, but I wanted some better solution. > > >> For example with oracle I can do it "online". > > >> > > >> regards, > > >> ivan. > > >> > > >> George Weaver wrote: > > >> > > >> > > >> > Hi Ivan, > > >> > > > >> > I don't know if this is a recommended practice or not, but you can > > >> > try the > > >> > following. > > >> > > > >> > Use PgDump to back up the entire database as a text file. Edit the > > >> > backup > > >> > text file and change the CREATE TABLE statement for the table you > > >> > want to > > >> > change, changing the column width to the new width desired. > > >> > Restore the > > >> > database. The database will be restored with the new width for the > > >> > column > > >> > in the table. > > >> > > > >> > The ability to do this depends on the size of the database, whether > > >> > it can > > >> > be taken off line, etc. etc. > > >> > > > >> > HTH > > >> > George > > >> > > > >> > ----- Original Message ----- > > >> > From: "pginfo" > > >> > To: > > >> > Sent: Tuesday, April 15, 2003 9:21 AM > > >> > Subject: [SQL] changing column size and type. > > >> > > > >> > > > >> >> Hi, > > >> >> > > >> >> I am using pg 7.3.2. > > >> >> > > >> >> Is it possible to change: > > >> >> - column size ot existing table. > > >> >> - columnt size ( it is varchar basicaly). > > >> >> > > >> >> The problem is that the table have many freferences from and to > > >> >> it. > > >> >> > > >> >> many thanks, > > >> >> ivan. > > >> >> > > >> >> > > >> >> ---------------------------(end of > > >> >> broadcast)--------------------------- > > >> >> TIP 5: Have you checked our extensive FAQ? > > >> >> > > >> >> http://www.postgresql.org/docs/faqs/FAQ.html > > >> >> > > >> >> > > >> > > >> ---------------------------(end of > > >> broadcast)--------------------------- > > >> TIP 5: Have you checked our extensive FAQ? > > >> > > >> http://www.postgresql.org/docs/faqs/FAQ.html > > >> > > >> > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)