Обсуждение: Whassup with this? (Create table xxx like yyy fails)

Поиск
Список
Период
Сортировка

Whassup with this? (Create table xxx like yyy fails)

От
Karl Denninger
Дата:
childrensjustice=# create table petition_bail like petition_white;
ERROR:  syntax error at or near "like"
LINE 1: create table petition_bail like petition_white;

Huh?

Yes, the source table exists and obviously as postgres superuser
("pgsql") I have select permission on the parent.

--
Karl Denninger (karl@denninger.net)
http://www.denninger.net





Re: Whassup with this? (Create table xxx like yyy fails)

От
"Adam Rich"
Дата:
>
> childrensjustice=# create table petition_bail like petition_white;
> ERROR:  syntax error at or near "like"
> LINE 1: create table petition_bail like petition_white;
>
> Huh?
>
> Yes, the source table exists and obviously as postgres superuser
> ("pgsql") I have select permission on the parent.
>

What version of postgresql are you using?







Re: Whassup with this? (Create table xxx like yyy fails)

От
"Douglas McNaught"
Дата:
On Sat, Jul 19, 2008 at 9:02 PM, Karl Denninger <karl@denninger.net> wrote:
> childrensjustice=# create table petition_bail like petition_white;
> ERROR:  syntax error at or near "like"
> LINE 1: create table petition_bail like petition_white;

It's not super-easy to see from the docs, but I think you need parentheses:

CREATE TABLE petition_bail (LIKE petition_white);

-Doug

Re: Whassup with this? (Create table xxx like yyy fails)

От
Karl Denninger
Дата:

Douglas McNaught wrote:
On Sat, Jul 19, 2008 at 9:02 PM, Karl Denninger <karl@denninger.net> wrote: 
childrensjustice=# create table petition_bail like petition_white;
ERROR:  syntax error at or near "like"
LINE 1: create table petition_bail like petition_white;   
It's not super-easy to see from the docs, but I think you need parentheses:

CREATE TABLE petition_bail (LIKE petition_white);

-Doug
 
Aha.

Thank you.

Karl Denninger (karl@denninger.net)
http://www.denninger.net