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 AEA22565A6 for ; Mon, 28 Feb 2005 15:44:38 +0000 (GMT) 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 32744-03 for ; Mon, 28 Feb 2005 15:44:33 +0000 (GMT) Received: from trendinterscan.pnp.co.za (unknown [196.7.24.196]) by svr1.postgresql.org (Postfix) with ESMTP id D596D52AAA for ; Mon, 28 Feb 2005 15:44:31 +0000 (GMT) Received: by pnp.co.za (8.9.3+Sun/8.9.3) with ESMTP id RAA20222for ; Mon, 28 Feb 2005 17:44:39 +0200 (SAST) Received: from 164.101.15.103 (unknown [164.101.15.103])by scorenet.score.pnp.co.za (Postfix) with ESMTP id 9C30FFCE3for ; Mon, 28 Feb 2005 17:45:24 +0200 (SAST) Subject: ALTER TABLE help. From: Marco Rademeyer Reply-To: mrademeyer@pnp.co.za To: pgsql-admin@postgresql.org Content-Type: text/plain Organization: Score Date: Mon, 28 Feb 2005 17:42:37 +0200 Message-Id: <1109605357.5019.265.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Content-Transfer-Encoding: 7bit X-imss-version: 2.8 X-imss-result: Passed X-imss-scores: Clean:99.90000 C:14 M:5 S:5 R:5 X-imss-settings: Baseline:4 C:3 M:3 S:3 R:3 (1.0000 1.0000) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.492 tagged_above=0 required=5 tests=DNS_FROM_RFC_WHOIS X-Spam-Level: X-Archive-Number: 200503/11 X-Sequence-Number: 16509 Hi I am quite new to PostgreSQL. Could someone please help or gide me in the right direction. My problem is that I have a table with about 15 billion entries. I need to auto increment the table for the start and then every entry after that. I have create the field "num" that has the auto increment field set, but it is only for the new fields that get added. this is what I have done: step one : CREATE TABLE num_table (num SERIAL); step two : ALTER TABLE test_stock ALTER COLUMN num SET DEFAULT nextval(num_table_num_seq'); But this is how far I got. Regards Marco Read our disclaimer at: http://www.picknpay.co.za/pnp/view/pnp/en/page5093? If you don't have web access, the disclaimer can be mailed to you on request. Disclaimer requests to be sent to it-security@pnp.co.za