Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id ADA4713C7C39 for ; Sun, 10 Jun 2012 00:45:58 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SdZ6B-0000d0-TR for pgsql-bugs@postgresql.org; Sun, 10 Jun 2012 03:45:57 +0000 Received: by dady13 with SMTP id y13so3955613dad.19 for ; Sat, 09 Jun 2012 20:45:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=9Gi7NZVIp7iYqGZmD8+TSj9jqSVUh3jiuSJEept5KS0=; b=i3IS2ttc8iFhzu0XoSOafgWBai3FIvXMtmU19t9dpqkCg2Xg4c4a9/iFKlOcankWLi mBqa8xcC2LTB/SQyjY3NWIzXKi9t17UFSiznWNvALoZeSn4yrGRqdTsaU0rTNPy4pTJD axNuyLIRdfEo5ONYGwIgnN6mzqlGCF8RIGgSn3nUcTXHHCaqtP1tcAEES4sQZVQACTOj ueq0Sd6aRj3m87UZzuhe4Rm10IQ4pXLhvb3OU38BRzMI3sJ/Lgf/zEMj0+umN7CZjQdg CFtDFf6QDZhvRzn2/9mlmjCZwD5PdT1LSc5VPplbB0o1WSE6FlLMb4m7UU5p0sranZjR Hkrw== Received: by 10.68.228.39 with SMTP id sf7mr14254123pbc.45.1339299942529; Sat, 09 Jun 2012 20:45:42 -0700 (PDT) Received: from ayaki.localdomain (203-59-174-91.dyn.iinet.net.au. [203.59.174.91]) by mx.google.com with ESMTPS id wi8sm13482823pbc.11.2012.06.09.20.45.39 (version=SSLv3 cipher=OTHER); Sat, 09 Jun 2012 20:45:41 -0700 (PDT) Message-ID: <4FD41860.5030200@ringerc.id.au> Date: Sun, 10 Jun 2012 11:45:36 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Tom Lane CC: phb.emaj@free.fr, pgsql-bugs@postgresql.org Subject: Re: BUG #6683: dropping a table with a serial column from an extension needs to explicitely drop the associated seq References: <5280.1339280042@sss.pgh.pa.us> In-Reply-To: <5280.1339280042@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQm9A8mqUfAtPA15apa1WgET5qJSYL0bZqFMtv3sVbAYHfPcydPuwviTDtTiuppbTfs4qeQ9 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/85 X-Sequence-Number: 33312 On 06/10/2012 06:14 AM, Tom Lane wrote: > phb.emaj@free.fr writes: >> When a table having a seial column has been created by a CREATE EXTENSION, >> and when this table is later dropped from the extension, the associated >> sequence must be also explicitely dropped from the extension. > This doesn't really seem like a bug to me. The sequence is a somewhat > independent object. I disagree; it is inconsistent with the expectation established in normal operations that the sequence created to serve a SERIAL column is owned by that table/column and is dropped when it is. regress=# create table test (x serial primary key); NOTICE: CREATE TABLE will create implicit sequence "test_x_seq" for serial column "test.x" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test" CREATE TABLE regress=# \d List of relations Schema | Name | Type | Owner --------+------------+----------+------- public | test | table | craig public | test_x_seq | sequence | craig (2 rows) regress=# drop table test; DROP TABLE regress=# \d No relations found. regress=# create table test (x serial primary key); NOTICE: CREATE TABLE will create implicit sequence "test_x_seq" for serial column "test.x" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test" CREATE TABLE regress=# alter table test drop column x; ALTER TABLE regress=# \d List of relations Schema | Name | Type | Owner --------+------+-------+------- public | test | table | craig (1 row) -- Craig Ringer