Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XSXpB-0000Cc-0h for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 20:52:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XSXp9-0004S9-FR for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 20:52:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XSXp8-0004S2-RG for pgsql-bugs@postgresql.org; Fri, 12 Sep 2014 20:52:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XSXp5-0006zm-AM for pgsql-bugs@postgresql.org; Fri, 12 Sep 2014 20:52:05 +0000 MIME-Version: 1.0 Subject: BUG #11411: ALTER DOMAIN VALIDATE CONSTRAINT fails if the domain is used in a composite type To: pgsql-bugs@postgresql.org From: obouda@email.cz Date: Fri, 12 Sep 2014 20:51:48 +0000 Message-ID: <20140912205148.2488.66328@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.1 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 11411 Logged by: Ondřej Bouda Email address: obouda@email.cz PostgreSQL version: 9.3.5 Operating system: Windows 7 64bit Description: The documentation for ALTER DOMAIN notes that "ALTER DOMAIN ADD CONSTRAINT and ALTER DOMAIN SET NOT NULL will fail if the named domain or any derived domain is used within a composite-type column of any table in the database." It appears current Postgres also fails on ALTER DOMAIN VALIDATE CONSTRAINT in such a case, as demonstrated by the following script: CREATE DOMAIN test_domain AS TEXT CONSTRAINT some_check CHECK (TRUE); CREATE TYPE test_composite AS (num INT, word test_domain); CREATE TABLE test_table (val test_composite); ALTER DOMAIN test_domain VALIDATE CONSTRAINT some_check; Since the documentation says nothing special regarding ALTER DOMAIN VALIDATE CONSTRAINT on a domain used by composite-type columns, the query is expected to run without errors. Instead, the following error is reported: [0A000] ERROR: cannot alter type "test_domain" because column "test_table.val" uses it It is questionable whether this is an implementation or documentation bug, but it certainly is a bug. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs