Question

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.........

Was it helpful?

Solution 2

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top