Skip site navigation (1) Skip section navigation (2)

Re: InitPostgres and flatfiles question

From: Markus Schiltknecht <markus(at)bluegap(dot)ch>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: InitPostgres and flatfiles question
Date: 2007-01-04 09:00:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Tom Lane wrote:
> It should happen automatically at commit of the CREATE DATABASE ... and
> you'd not be able to see the pg_database row before that anyway.  So I'm
> not clear on what you're worried about.

I've just found the stumbling block: the -c option of psql wraps all in 
a transaction, as man psql says:

     If the command string contains multiple SQL commands,  they  are
     processed  in  a  single  transaction, unless there are explicit
     BEGIN/COMMIT commands included in the string to divide  it  into
     multiple  transactions. This is different from the behavior when
     the same string is fed to psql’s standard input.

Thank you for clarification, I wouldn't have expected that (especially 
because CREATE DATABASE itself says, it cannot be run inside a 
transaction block... A transaction block (with BEGIN and COMMIT) seems 
to be more than just a transaction, right?)



In response to


pgsql-hackers by date

Next:From: Simon RiggsDate: 2007-01-04 10:32:33
Subject: Re: 8.3 pending patch queue
Previous:From: Tom LaneDate: 2007-01-04 05:49:03
Subject: Re: costing for arbitrary path

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group