Re: select count() out of memory - Mailing list pgsql-general

From Steve Crawford
Subject Re: select count() out of memory
Date
Msg-id 4720CD5C.2020904@pinpointresearch.com
Whole thread Raw
In response to Re: select count() out of memory  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: select count() out of memory  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-general
Alvaro Herrera wrote:
...
>
> You can use CREATE TABLE LIKE, which copies the definition but does not
> set the inheritance.
>

Well, sort of.

Unless I'm using it incorrectly it only copies the basic column
definitions and, as optionally specified, defaults and some of the
constraints.

Primary key constraints are lost as CREATE TABLE newtable (LIKE
oldtable) does not create any indexes including those necessary for the
primary key.

I don't know how foreign-key constraints are handled as I haven't used
this form of CREATE TABLE where foreign keys are involved.

Cheers,
Steve

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: select count() out of memory
Next
From: Tom Lane
Date:
Subject: Re: 2 versions running & using pg_dumpall