Take the dump of Postgresql database from Linux console

February 20, 2008 at 12:28 pm 1 comment

*To dump data or structure in the database from a dump file

$psql -u DBUserName datbaseName < databaseName_dump.sql

*To take the dump from the database

$pg_dump -u databaseName > filename.sql // data + structure
It will ask the username and password of database

$pg_dump -u databaseName -a > filename.sql // only data

$pg_dump -u databaseName -s > filename.sql // only structure

$pg_dump –username=sql-ledger -W databaseName > filename.sql
It will ask the password of database

Advertisements

Entry filed under: Technical. Tags: , , , , .

Quote from Bible for Valentine’s day mysql_pconnect() vs mysql_connect()

1 Comment Add your own

  • 1. Sanjay  |  February 22, 2008 at 8:23 pm

    The exact command should be:
    $pg_dump –-username=sql-ledger -W databaseName > filename.sql

    or
    $pg_dump –U -W databaseName > filename.sql

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Pages

Blog Stats

  • 33,758 hits
February 2008
M T W T F S S
« Jan   Mar »
 123
45678910
11121314151617
18192021222324
2526272829  

Twitter Updates

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

religion and spirituality

%d bloggers like this: