Reputation: 769
With pgAdmin, on my created DB, I have seven tables (all of them have at least one primary key, and some of them include foreign keys). Let's suppose in a moment I need to do a mayor correction so I don't have no other choice that to move it to another DB, and I don't want to rewrite the characteristics of the seven tables over and over again.
So, with that said, how I can export my tables (the structure, not the data), so, when I create another DB with pgAdmin, I can import my tables previously created.
Upvotes: 0
Views: 1401
Reputation: 4225
With pgAdmin 1.14 and prior releases, there were only two ways to insert data in a table: use the restore tool (which uses pg_restore) ; use the query tool to execute INSERT queries (COPY queries are allowed if they use a file, but not stdin/stdout). This link would help you
Upvotes: 1
Reputation: 4650
create table new (
like old
including defaults
including constraints
including indexes
);
REF Copy table structure into new table
Upvotes: 1