Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0E5E5475EF0 for ; Mon, 4 Nov 2002 22:05:30 -0500 (EST) Received: from txsmtp03.texas.rr.com (smtp3.texas.rr.com [24.93.36.231]) by postgresql.org (Postfix) with ESMTP id 50EF1475E4A for ; Mon, 4 Nov 2002 22:05:29 -0500 (EST) Received: from SUZIE (cs6669177-54.houston.rr.com [66.69.177.54]) by txsmtp03.texas.rr.com (8.12.5/8.12.2) with SMTP id gA533nUq024755 for ; Mon, 4 Nov 2002 22:03:50 -0500 (EST) Message-ID: <000801c28478$2c97e810$6401a8c0@SUZIE> From: "Roberto Benitez" To: Subject: insert trigger Date: Mon, 4 Nov 2002 21:05:17 -0600 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0005_01C28445.E0B20C50" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/84 X-Sequence-Number: 6272 This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C28445.E0B20C50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have the following situation: when a new record is inserted in to a psql table, i want to be able to = update certain fields. the way i'm doing it right now..to find the last re= cord inserted...is by sorting the primary key (serial) in descending order = and taking the first item in the list...the one at the top should be the on= e i just entered...and of course, i then procede to update the fieldsd i ne= ed to update.. So, basically would like to know if this will always work. will the one at= the top (the one w/ the highest primary key [serial type]) always be the o= ne i just entered. AND does psql ALWAYS execute the trigger(s) after EVERY = single record that is inerted. what would happen if [ n ] different users t= ry to insert records simultaniously? will psql insert one-execute the trigg= er, insert the next-execute the trigger..and so on? or will it insert ALL [= n] records AND THEN execute the trigger? i would appreciate any advice--if this would work, or if there is a better = way. thanks rbenitez22@yahoo.com ------=_NextPart_000_0005_01C28445.E0B20C50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I have the following situation:
 
    when a new record is in= serted in=20 to a psql table, i want to be able to update certain fields.  the way = i'm=20 doing it right now..to find the last record inserted...is by sorting the pr= imary=20 key (serial) in descending order and taking the first item in the list...th= e one=20 at the top should be the one i just entered...and of course, i then procede= to=20 update the fieldsd i need to update..
So, basically would like to know if this w= ill=20 always work.  will the one at the top (the one w/ the highest primary = key=20 [serial type]) always be the one i just entered. AND does psql ALWAYS execu= te=20 the trigger(s) after EVERY single record that is inerted. what would happen= =20 if [ n ] different users try to insert records simultaniously? will ps= ql=20 insert one-execute the trigger, insert the next-execute the trigger..and so= on?=20 or will it insert ALL [n] records AND THEN  execute the=20 trigger?
 
i would appreciate any advice--if this wou= ld work,=20 or if there is a better way.
 
thanks
rbenitez22@yahoo.com
 
 
 
 
 
------=_NextPart_000_0005_01C28445.E0B20C50--