Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

In postgresql, I had taken backup. That file didn't have any insert queries instead it used Some copy statments like

COPY user_customers (userid, customerlist) FROM stdin;
anil    customer1:customer2
babu    customer1:customer4
srikakulapu customer1:customer2
\.

But i want insert statements of that table....

How could I get the insert statements of table data in backup file?

Besides that I couldn't execute pg_dump command....

I am generating backup file by right clicking on a table by chosing backup option..

Kindly help me out... Otherwise I have to rewrite all the insert queries manually for documentation....

waiting for your help.........

share|improve this question

2 Answers 2

up vote 0 down vote accepted
1.Open command prompt

2.Make it to point to bin in postgres folder

3.execute following command


pg_dump --column-inserts -U postgres databasename>filename



4. File will be stored in bin folder of postgres
share|improve this answer

If you use pg_dump , then you can add the -inserts parameter.

Dump data as INSERT commands (rather than COPY).

Source

If you could add the code of your attempt to use pg_dump, we could solve this problem, too.

share|improve this answer
    
But pg_dump command is not working... DO I need to create any extenstion?????? @akkusativobjekt –  ANILBABU Sep 27 '13 at 9:40
    
pg_dump is a client program, not a SQL command. –  Richard Huxton Sep 27 '13 at 10:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.