From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | professor(at)gmail(dot)com |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #10674: syntax error with CREATE TABLE table AS SELECT (column1, column 2) FROM table2 |
Date: | 2014-06-17 04:43:59 |
Message-ID: | CAB7nPqQ4-8709=zLk_joacoqMGqq8d6Tm4ruBQXO+3wD+tBTMA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Tue, Jun 17, 2014 at 7:03 AM, <professor(at)gmail(dot)com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 10674
> Logged by: Todd Sedano
> Email address: professor(at)gmail(dot)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"
This is not a bug. Writing a list of columns within parentheses in a
SELECT list represents them as a row (this is valid SQL).
> 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;"
And you are right, simply remove the parentheses in the SELECT list
and the columns will be selected one by one, which is what you are
looking for.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | smsiebe | 2014-06-17 17:55:11 | BUG #10680: LDAP bind password leaks to log on failed authentication |
Previous Message | maxim.boguk | 2014-06-17 03:24:38 | BUG #10675: alter database set tablespace and unlogged table |