To create a sql script that will create tables as they exist in this database, follow these steps:
pg_dump --schema-only --no-owner the_database > create_the_tables.sql
This will give you a bunch of create table instructions. To see how portable I tried the following:
bvm$ pg_dump -s --no-owner devdb | sqlite3 so_ans.db
And then:
bvm$ sqlite3 so_ans.db .schema CREATE TABLE courses ( id integer NOT NULL, name text, created_by integer, jc text );
Kind of cool.
unmounted May 17 '11 at 2:39 2011-05-17 02:39
source share