Re: insert order question

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: insert order question
Date: 2011-05-12 20:07:49
Message-ID: 482E80323A35A54498B8B70FF2B879800493F1FE7C@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ya, I'm sort of coming to that conclusion because of a different consideration. I'm worried about whether or not the triggers will be fired immediately after each record inserted, or once ot the end, or something else. Just too risky. I'm going to go with the discrete insert statements in the order I desire.

Thanks

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

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2011-05-12 20:09:34 Re: Massive delete from a live production DB
Previous Message James B. Byrne 2011-05-12 20:06:06 Re: How to handle bogus nulls from ActiveRecord