Re: Dumping from older version

Lists: pgsql-general
From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: 'PostgreSQL' <pgsql-general(at)postgresql(dot)org>
Subject: Dumping from older version
Date: 2007-09-26 15:06:18
Message-ID: 46FA756A.1040807@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Just wondering - when using a newer pg_dump to dump from an older
Postgres, does pg_dump automatically generate INSERT statements for the
data rather than using COPY?

I noticed this today when transferring data to a newer server - pg_dump
generated INSERTs although I didn't ask for them. Not a problem, but I
was curious.

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
---------------------------------------------------------------


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Raymond O'Donnell" <rod(at)iol(dot)ie>
Cc: "'PostgreSQL'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dumping from older version
Date: 2007-09-26 15:22:18
Message-ID: 20070926152218.GF8572@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Raymond O'Donnell wrote:
> Just wondering - when using a newer pg_dump to dump from an older Postgres,
> does pg_dump automatically generate INSERT statements for the data rather
> than using COPY?

No.

> I noticed this today when transferring data to a newer server - pg_dump
> generated INSERTs although I didn't ask for them. Not a problem, but I was
> curious.

Perhaps you included -d in the command line options?

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"El miedo atento y previsor es la madre de la seguridad" (E. Burke)


From: Carlos Moreno <moreno_pg(at)mochima(dot)com>
To:
Cc: "'PostgreSQL'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dumping from older version
Date: 2007-09-26 15:26:01
Message-ID: 46FA7A09.6040305@mochima.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Raymond O'Donnell wrote:
> Just wondering - when using a newer pg_dump to dump from an older
> Postgres, does pg_dump automatically generate INSERT statements for
> the data rather than using COPY?
>
> I noticed this today when transferring data to a newer server -
> pg_dump generated INSERTs although I didn't ask for them. Not a
> problem, but I was curious.

Maybe you used the switch -d to specify the database? (like with psql
and some
other client applications).

The switch -d in pg_dump goes for "Generate inserts instead of COPY
commands"

Double-check the syntax/switches for pg_dump (pg_dump --help)

HTH,

Carlos
--


From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Carlos Moreno <moreno_pg(at)mochima(dot)com>, 'PostgreSQL' <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dumping from older version
Date: 2007-09-26 15:37:00
Message-ID: 46FA7C9C.4020907@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 26/09/2007 16:26, Carlos Moreno wrote:

> Maybe you used the switch -d to specify the database? (like with psql
> and some other client applications).

Duhhh! I've just realised my mistake - here's my command line:

pg_dump -h 192.168.200.2 -U postgres -d assetreg -f assetreg.txt -E utf8

....I had thought that the -d option was to specify the database, but of
course not.

Thanks all - I'm sadder and wiser!

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
---------------------------------------------------------------