Thread: PG Admin on the command line = pg_dump

PG Admin on the command line = pg_dump

From
Laurent ROCHE
Date:
Hi,

I would like to automate the generation of a backup script of a schema (which I used to perform with PG Admin backup
command).
I looked into pg_dump command: it does the job BUT not correctly for me as it does not create SERIAL column but INTEGER
andthen it creates SEQUENCES (I have scripts parsing the generated SQL file and looking for SERIAL columns). 

I was wondering if it is possible to use command line switches to make the fantastic PG Admin III generate a script
(withoutany user interaction). 
I could not see any thing in the doc about that, so I am asking you guys and gals.

Cheers,
L@u
The Computing Froggy





___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com


Re: PG Admin on the command line = pg_dump

From
Dave Page
Date:
Laurent ROCHE wrote:
> Hi,
> 
> I would like to automate the generation of a backup script of a schema (which I used to perform with PG Admin backup
command).
> I looked into pg_dump command: it does the job BUT not correctly for me as it does not create SERIAL column but
INTEGERand then it creates SEQUENCES (I have scripts parsing the generated SQL file and looking for SERIAL columns).
 
> 
> I was wondering if it is possible to use command line switches to make the fantastic PG Admin III generate a script
(withoutany user interaction).
 
> I could not see any thing in the doc about that, so I am asking you guys and gals.

pgAdmin just uses pg_dump to generate it's backup scripts, so we don't 
have any command line options to this as we'd just say 'use pg_dump'.

Regards, Dave.


Re: PG Admin on the command line = pg_dump

From
"Raymond O'Donnell"
Date:
On 26 Dec 2006 at 17:42, Laurent ROCHE wrote:

> pg_dump command: it does the job BUT not correctly for me as it does
> not create SERIAL column but INTEGER and then it creates SEQUENCES (I

This is correct - SERIAL isn't a "real" data type, but rather a 
shortcut that creates an integer column with a default which executes 
nextval() on a sequence which it also creates.

http://www.postgresql.org/docs/8.2/static/datatype-
numeric.html#DATATYPE-SERIAL

--Ray.


----------------------------------------------------------------------

Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod@iol.ie
----------------------------------------------------------------------