From: | Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: pg_dump? |
Date: | 2007-05-14 22:56:19 |
Message-ID: | 4648E913.9010908@autoledgers.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Richard Dunne wrote:
> PostgreSQL begginer. Whats the best way of exporting(dumping) a database/table/view/query to a file?
> I am using PostgreSQL v 8.2. I am starting postgres server with
> C:\WINDOWS\system32\net.exe start pgsql-8.2, (start service)
> C:\postgresql-8.2.3-1\bin\psql.exe -h localhost -p 5432 postgres "Richard"
> (psql to 'postgres')
> both of which are run from shortcuts in the start menu.
> my cli starts with "postgres #", then "databasename #" after connecting using \c.
>
> Richard.
>
>
With exactly what you said in the subject... pg_dump
http://www.postgresql.org/docs/8.2/static/app-pgdump.html
Your other option would be with an SQL 'COPY'
http://www.postgresql.org/docs/8.2/static/sql-copy.html
The difference between the two is dump will give you output including
the SQL used to put it back into the database, i.e. INSERT INTO
statements whereas copy will give you a flat delimited file.
--
Paul Lambert
Database Administrator
AutoLedgers
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Buttafuoco | 2007-05-14 23:16:14 | Re: Doing a conditional aggregate (e.g. count(*) if x=y) in postgres? |
Previous Message | Bryce Nesbitt | 2007-05-14 22:55:45 | Doing a conditional aggregate (e.g. count(*) if x=y) in postgres? |