Creating Table Copy - Mailing list pgsql-general

From Rich Shepard
Subject Creating Table Copy
Date
Msg-id alpine.LNX.2.11.1406161342100.28452@localhost
Whole thread Raw
Responses Re: Creating Table Copy [RESOLVED]
Re: Creating Table Copy
List pgsql-general
   I have a table with some NULL values in a date column. I need to make a
copy of that table containing only those rows where the date column is not
null. Reading the CREATE TABLE man page I've tried to create a copy of the
original table from which I could drop rows. While the table creating is
successful, it contains no rows. I do not see an option to include the data
as well as the schema.

   The syntax I thought would work is,

# create table benthos (like benthosraw including all);

but it creates an empty table.

   Please pass me a clue on copying the data as well as the schema.

   While I suspect there's a way to write a SELECT statement for those rows
that are not null and save the results to a different table name, I've not
found the syntax in my postgres and SQL references.

TIA,

Rich



pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: (Relatively) Oversized Checkpoint
Next
From: Rich Shepard
Date:
Subject: Re: Creating Table Copy [RESOLVED]