I want to backup a postgres table with pgAdmin and have the dump ordered by ID (or any other column). How do I do that?
[EDIT] The dump should contain INSERT queries, not the pure data! [/EDIT]
What I tested so far:
1) I checked pg_dump too and did not find any solution.
2) Another solution would be to export the results of a SELECT
statement which is not possible too with pgAdmin.
3) With psql
the only solution I found was psql -h localhost -U myuser -W -c 'copy (SELECT * FROM mytable ORDER BY id) to stdout'
which only prints the data as csv.
Can anyone help me out? Thanks!
INSERT
s compared to a single one? Or aCOPY
statement?