Re: dump order by

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: jo <jose(dot)soares(at)sferacarta(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: dump order by
Date: 2012-12-22 17:53:51
Message-ID: 50D5F3AF.7080606@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/22/2012 09:29 AM, jo wrote:
> Hi all,
> I would like to know if it is possible to dump a table ordered by its
> primary key.
> Take a look at the this test table...
> \d test
> Table "public.test"
> Column | Type | Modifiers
> -----------+---------+---------------------------------------------------
> id | integer | not null name | text |
> id_father | integer |
> Indexes:
> "test_pkey" PRIMARY KEY, btree (id)
> Foreign-key constraints:
> "test_id_father_fkey" FOREIGN KEY (id_father) REFERENCES test(id)
>

Why not use the COPY command directly?:

http://www.postgresql.org/docs/9.2/interactive/sql-copy.html

FYI:

"COPY with a file name instructs the PostgreSQL server to directly read
from or write to a file. The file must be accessible to the server and
the name must be specified from the viewpoint of the server. When STDIN
or STDOUT is specified, data is transmitted via the connection between
the client and the server.
"

If you want to work from the client you can use \copy in psql.

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2012-12-22 18:13:12 Re: rule / trigger definition
Previous Message salah jubeh 2012-12-22 17:45:48 Re: dump order by