Re: copy table

From: "Melissa Peterson" <Melissa(at)gigacrete(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: copy table
Date: 2010-02-09 00:11:58
Message-ID: A1FD0C847C4A724CAD5412A2448483CA02B8C4@SBServer.GigaCrete.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

For your primary key column, does the SQL in your table creation script look like:

column_name integer NOT NULL DEFAULT nextval('rd."table_name_columname_seq"'::regclass)

or

column_name serial

If the former, and if your original sequence wasn't anything custom, try changing it to "column_name serial" (or bigserial, depending on your needs).

Melissa Peterson
R&D Engineer
melissa(at)gigacrete(dot)com
GigaCrete, Inc.
6775 Speedway Boulevard, Suite M-104
Las Vegas, NV 89115
Phone 702-643-6363
Fax 702-543-7010
www.gigacrete.com

B U I L D S T R O N G. B U I L D F O R W A R D.

This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is strictly prohibited. If you have received this communication in error, please notify us by reply email and immediately and permanently delete this message and any attachments.

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org on behalf of Marc Fromm
Sent: Mon 2/8/2010 4:38 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] copy table

I created a new database and I want to copy a table from a different database into the new database.
1. I used phpPgAdmin and exported the table that I want a copy of.
2. In the new database I pasted the export into the SQL box in phpPgAdmin and clicked execute to create the table.
The table was created with no errors
The only problem is it did not create the sequence for the primary key.

Do I have to manually create the sequence or did I miss a step in exporting and creating the table?

Thanks

Marc

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Kempter 2010-02-09 01:00:26 "effective_io_concurrency" cannot be changed error when starting 8.4.2 instance
Previous Message Marc Fromm 2010-02-08 23:38:11 copy table