LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2004, 02:07 AM   #1
vickr1z
Member
 
Registered: Mar 2004
Location: manila, philippines
Distribution: RH 7.3
Posts: 63

Rep: Reputation: 15
postgres dump needed help.


good day to all. can anybody help me on postgres? i want to dump a specific table and its data only from the postgres server to local pc in a data.sql??

im only using this command at this time:
Code:
pg_dump -h 192.12.0.100 -U alf -d polmap > dbdump.sql
with this im dumping a large database and it consumed me alot of time before its finished.
i really dont know how to only choose an specific table to dump?
any suggestion will appreciated very much and thanks in advance.

-chris-
 
Old 11-09-2004, 05:25 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 69
Code:
pg_dump -t tablename
You may also need --schema schemaname if you have different tables with the same name in different schemas.

Note that this will not dump any dependant data.

Also, if you're running an older version of Postgresql, please note that newer versions can do data-consistant dumps without using an exclusive lock (so you can still use the database while the dump is being generated).
 
Old 11-10-2004, 12:15 AM   #3
vickr1z
Member
 
Registered: Mar 2004
Location: manila, philippines
Distribution: RH 7.3
Posts: 63

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by rjlee
Code:
pg_dump -t tablename
You may also need --schema schemaname if you have different tables with the same name in different schemas.

Note that this will not dump any dependant data.

Also, if you're running an older version of Postgresql, please note that newer versions can do data-consistant dumps without using an exclusive lock (so you can still use the database while the dump is being generated).
thanks for the help rjlee..

now im progressing..

BYW may i ask if you know php programming? just incase, id like to ask if how can i make a php script to connect on remote postgres server.
let say my localhost was 192.19.0.100 and the remote postgres server host was 192.19.0.101.

any idea? thanks again in advance, and more power!

chris
 
Old 11-10-2004, 04:22 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 69
Quote:
Originally posted by vickr1z
BYW may i ask if you know php programming? just incase, id like to ask if how can i make a php script to connect on remote postgres server.
let say my localhost was 192.19.0.100 and the remote postgres server host was 192.19.0.101.
You're better off asking that as a seperate question/thread. I think you just pass the servername of the remote server when making the connection (and a suitable username and password). But I haven't used PHP in a while, and never with postgres myself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postgres Hiper1 Linux - Newbie 8 04-10-2005 06:43 PM
Installing Postgres 7.3 Hiper1 Linux - Software 0 12-01-2004 02:38 AM
php postgres connecting needed help vickr1z Linux - Newbie 2 11-11-2004 04:13 AM
postgres COPY function needed help vickr1z Linux - Newbie 1 11-08-2004 06:36 AM
How to forcely dump the history of user commands to the admin dump file. mcp_achindra Linux - Security 1 03-19-2004 01:04 PM


All times are GMT -5. The time now is 09:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration