Re: insert order question - Mailing list pgsql-general

From Gauthier, Dave
Subject Re: insert order question
Date
Msg-id 482E80323A35A54498B8B70FF2B879800493F1FE7C@azsmsx504.amr.corp.intel.com
Whole thread Raw
In response to Re: insert order question  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: insert order question  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
Ya, I'm sort of coming to that conclusion because of a different consideration.  I'm worried about whether or not the
triggerswill be fired immediately after each record inserted, or once ot the end, or something else.  Just too risky.
I'mgoing to go with the discrete insert statements in the order I desire. 

Thanks

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Thursday, May 12, 2011 4:06 PM
To: Gauthier, Dave
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] insert order question

"Gauthier, Dave" <dave.gauthier@intel.com> writes:
> Does...
>                insert into mytbl (col1) values ('a'),('b'),('c');
> ... insert records 'a','b','c' in that order while...
>                insert into mytbl (col1) values ('c'),('b'),('a');
> ... insert the records in the opposite order?

I believe so, but it seems unwise to hard-wire a dependency on that into
your application, since this is only an implementation artifact and not
anything guaranteed by the standard.  If you need the inserts to occur
in a specific order, issue them as separate commands ... you're not
going to save all that much by having them be one command.

            regards, tom lane

pgsql-general by date:

Previous
From: "James B. Byrne"
Date:
Subject: Re: How to handle bogus nulls from ActiveRecord
Next
From: Tomas Vondra
Date:
Subject: Re: Massive delete from a live production DB