Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WwksX-0004xF-I2 for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Jun 2014 04:20:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WwksW-0007Gx-UD for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Jun 2014 04:20:12 +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 1Wwf0Z-00083Q-Db for pgsql-bugs@postgresql.org; Mon, 16 Jun 2014 22:04:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wwf0V-0005xw-IL for pgsql-bugs@postgresql.org; Mon, 16 Jun 2014 22:04:06 +0000 MIME-Version: 1.0 Subject: BUG #10674: syntax error with CREATE TABLE table AS SELECT (column1, column 2) FROM table2 To: pgsql-bugs@postgresql.org From: professor@gmail.com Date: Mon, 16 Jun 2014 22:03:46 +0000 Message-ID: <20140616220346.2586.475@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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: 10674 Logged by: Todd Sedano Email address: professor@gmail.com PostgreSQL version: 9.3.3 Operating system: Mac OS 10.8.5 Description: Note: I feel like I must be doing something wrong, but I've been able to reproduce this in two very different environments. The following SQL is valid postgres, see http://www.postgresql.org/docs/9.3/static/sql-createtableas.html "CREATE TABLE retail_demo.imported_table AS SELECT (column1, column2) FROM retail_demo.external_table;" However, it generates the odd message "ERROR: column "row" has pseudo-type record" We were able to get around this issue, by removing the () around (column1, column2) "CREATE TABLE retail_demo.imported_table AS SELECT column1, column2 FROM retail_demo.external_table;" This is reproducible with this sequence.... create table source_table (column1 text, column2 text, column3 text); insert into source_table values ('value 1', 'value 2', 'value 3'); create table destination_table AS SELECT (column1, column2) from source_table; ERROR: column "row" has pseudo-type record create table destination_table AS SELECT column1, column2 from source_table; -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs