Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tll8N-0001do-A6 for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Dec 2012 18:46:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tll8M-0001mH-1H for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Dec 2012 18:46:18 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlfQg-0002fJ-PF for pgsql-bugs@postgresql.org; Thu, 20 Dec 2012 12:40:50 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlfQd-0004w1-5X for pgsql-bugs@postgresql.org; Thu, 20 Dec 2012 12:40:50 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlfQb-00033T-6E for pgsql-bugs@postgresql.org; Thu, 20 Dec 2012 12:40:46 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TlfQa-0005LY-PL for pgsql-bugs@postgresql.org; Thu, 20 Dec 2012 12:40:44 +0000 Date: Thu, 20 Dec 2012 12:40:44 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7763: "CREATE TABLE ... (LIKE ... INCLUDING INDEXES ...)" does not work with indexes on composite types To: pgsql-bugs@postgresql.org From: norbi@nix.hu X-Pg-Spam-Score: -1.9 (-) 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: 7763 Logged by: Norbert Buchmuller Email address: norbi@nix.hu PostgreSQL version: 9.2.2 Operating system: Linux 2.6.32, i386, Debian GNU/Linux 6.0.5 Description:=20=20=20=20=20=20=20=20 There's a table that has a B-Tree index on a composite type expression. When attempting to create another table just like the first table and with the indexes also "copied" using the "CREATE TABLE ... (LIKE ... INCLUDING INDEXES ...)" statement, it throws an error (see below) and the table is not created. I believe it's a bug, from the documentation i assumed that it should create the table with a similar index, no matter that the index is on a composite type expression. postgres@vger:~$ cat create_table_like_including_indexes-and-index_on_composite_type.sql=20 \set VERBOSITY verbose=20 \set ECHO all SELECT version(); CREATE TYPE type1 AS (x int, y int); CREATE TABLE table1 (a int, b int); CREATE INDEX index1 ON table1 ( ( (a, b)::type1 ) ); CREATE TABLE table2 ( LIKE table1 INCLUDING INDEXES ); \d table2 postgres@vger:~$ dropdb test1; createdb test1 && psql --no-align --tuples -d test1 -f create_table_like_including_indexes-and-index_on_composite_type.sql SELECT version(); PostgreSQL 9.2.2 on i686-pc-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 32-bit CREATE TYPE type1 AS (x int, y int); CREATE TYPE CREATE TABLE table1 (a int, b int); CREATE TABLE CREATE INDEX index1 ON table1 ( ( (a, b)::type1 ) ); CREATE INDEX CREATE TABLE table2 ( LIKE table1 INCLUDING INDEXES ); psql:create_table_like_including_indexes-and-index_on_composite_type.sql:7: ERROR: 42P16: column "" has pseudo-type record LOCATION: CheckAttributeType, heap.c:496 \d table2 Did not find any relation named "table2". --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs