From: professor@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10674: syntax error with CREATE TABLE table AS SELECT (column1, column 2) FROM table2
Date: Mon, 16 Jun 2014 22:03:46 +0000
Message-ID: <20140616220346.2586.475@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: professor@gmail.com
Subject: Re: BUG #10674: syntax error with CREATE TABLE table AS SELECT (column1, column 2) FROM table2
In-Reply-To: <20140616220346.2586.475@wrigleys.postgresql.org>
References: <20140616220346.2586.475@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox