Re: dump order by - Mailing list pgsql-general

From Adrian Klaver
Subject Re: dump order by
Date
Msg-id 50D5F3AF.7080606@gmail.com
Whole thread Raw
In response to dump order by  (jo <jose.soares@sferacarta.com>)
List 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.klaver@gmail.com


pgsql-general by date:

Previous
From: salah jubeh
Date:
Subject: Re: dump order by
Next
From: Adrian Klaver
Date:
Subject: Re: rule / trigger definition