Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5MCfCa50326 for ; Fri, 22 Jun 2001 08:41:12 -0400 (EDT) (envelope-from pgsql-admin-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5L81ba27693 for ; Thu, 21 Jun 2001 04:01:37 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f5L80Hn13144 for pgsql-admin@postgresql.org; Thu, 21 Jun 2001 04:00:17 -0400 (EDT) (envelope-from news) From: Kostis Mentzelos X-Newsgroups: comp.databases.postgresql.admin Subject: rename a table Date: Thu, 21 Jun 2001 11:07:35 +0300 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 29 Message-ID: <3B31AB47.2A46172B@ematic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.19 i686) X-Accept-Language: en To: pgsql-admin@postgresql.org X-Archive-Number: 200106/154 X-Sequence-Number: 1721 Hi all, I want to rename a table from DATA to 'unique' every month and then recreate table DATA. (a number of applications works with table DATA) DATA contains among the others a SERIAL field. create table DATA (a int, b serial,...); I tried ALTER TABLE DATA RENAME TO XXXX but when I recreate table DATA I get this error: relation 'data_b_seq' already exists. Is there any way to rename sequences? Is it better to create the new table, copy 1.000.000 to the new table and then delete them from DATA and then VACCUM the database? kostis. --------------------------------------------------------------- Why do I need to do such a thing? I think that I need to do this because I have 1.000.000 tuples/month and I don't want to work into a very big table. So 'I said' I have to find a way to move table DATA to something else and then recreate table DATA. This way I am going to work into a table of maximum 1.000.000 tuples at the end of the month.