X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5A2DB9DCDE4 for ; Fri, 24 Mar 2006 23:22:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16398-02 for ; Fri, 24 Mar 2006 23:23:01 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web50310.mail.yahoo.com (web50310.mail.yahoo.com [206.190.38.243]) by postgresql.org (Postfix) with SMTP id 222459DCCB7 for ; Fri, 24 Mar 2006 23:22:54 -0400 (AST) Received: (qmail 66692 invoked by uid 60001); 25 Mar 2006 03:22:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=iMfzASZpuVroUgHuw9aaa8E5XAmdlz0+kJLc+Uy5bkUdbG8WZdt8QojF0GQ5mrTY2K3Y+DEmxjjb/69UjTc+K1Og/M+Wd5xd9u8X0XBwxCJI2cd6uN7SYLj6PgwHw5E+xuqNeNjWyVbvFx4xJIq3s+6INOSmMofXO8NV67SoU8E= ; Message-ID: <20060325032259.66690.qmail@web50310.mail.yahoo.com> Date: Fri, 24 Mar 2006 19:22:59 -0800 (PST) From: Subject: Renaming a sequence? To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.616 required=5 tests=[AWL=-0.220, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879, FORGED_YAHOO_RCVD=0.928, NO_REAL_NAME=0.55] X-Spam-Score: 2.616 X-Spam-Level: ** X-Archive-Number: 200603/253 X-Sequence-Number: 21010 Hi, I just renamed some of my tables, but I now have sequences with older names. I followed info from http://www.postgresql.org/docs/current/static/sql-altersequence.html : "Some variants of ALTER TABLE can be used with sequences as well; for example, to rename a sequence use ALTER TABLE RENAME" So this is what I did: ALTER TABLE topic_id_seq RENAME TO watchlist_id_seq; That *appeared* to work, but I still see the old sequence name: mydb => \d watchlist Table "public.watchlist" Column | Type | Modifiers --------------+-------------------------------+------------------------------------------------------- id | integer | not null default nextval('public.topic_id_seq'::text) ... Indexes: "pk_topic_id" PRIMARY KEY, btree (id) It looks like my sequence WAS renamed, but my table's PK points to the old sequence name, which is not supposed to exist any more. Is there any way to change this without killing the sequence? Thanks, Otis