X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5B2A95E40AC for ; Tue, 24 Aug 2004 15:43:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14792-06 for ; Tue, 24 Aug 2004 18:43:14 +0000 (GMT) Received: from pop.sanbrunocable.com (pop.sanbrunocable.com [65.172.230.120]) by svr1.postgresql.org (Postfix) with ESMTP id 6CE5C5E37D0 for ; Tue, 24 Aug 2004 15:43:13 -0300 (ADT) Received: from oss4u.com (cpe-65-172-234-54.sanbrunocable.com [65.172.234.54]) by pop.sanbrunocable.com (8.11.6/8.11.6) with SMTP id i7OIg1J01255 for ; Tue, 24 Aug 2004 11:42:01 -0700 Received: (qmail 6241 invoked from network); 24 Aug 2004 18:38:54 -0000 Received: from tiburon.oss4u.com (192.168.1.4) by gw.oss4u.com (192.168.1.1) with ESMTP; 24 Aug 2004 18:38:54 -0000 From: "Uwe C. Schroeder" Organization: OSS4U, LLC To: "Keith" , Subject: Re: add serial no Date: Tue, 24 Aug 2004 11:43:08 -0700 User-Agent: KMail/1.5.3 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="big5" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200408241143.08959.uwe@oss4u.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/240 X-Sequence-Number: 14635 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 22 August 2004 02:47 am, Keith wrote: > Dear All, > > Someone can help me to solve the below problems > > 1. I create a table for a period of time, there is huge records already > posted. I would like to alter table and add serial primary key on that > table. It's impossible to add serial no by hand. Please adv how can I a= dd > the serial number automatically. Create a table with the same structure as your original table, just add a sid int4 serial column to it. (sid can be any column name you want it to be) The serial col= umn=20 has to be at the end! Then do a INSERT INTO SELECT FROM The serial column will automatically be set to 1,2,3,4,5 etc. After that check if all the data made it to the new table and then you can= =20 drop the old table and rename the new table to the name of the old table. As usual I'd make a backup of the original table before doing all this. > 2. Is there any library to translate digit number to English, I mean > translate '1234' to 'one thousand two hundred thirty four'.. Pls help. Sorry, can't help with that one. UC - -- Open Source Solutions 4U, LLC 2570 Fleetwood Drive Phone: +1 650 872 2425 San Bruno, CA 94066 Cell: +1 650 302 2405 United States Fax: +1 650 872 2417 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFBK4w8jqGXBvRToM4RAm5MAJ0c5ygo1V9ISdn7nOy51rHazWbnDACg0QBF 1nlwxalbrc8vVb64dxk7QgE=3D =3Dhi8w -----END PGP SIGNATURE-----