Thread: GET DIAGNOSTICS SELECT PROCESSED INTO
Does anyone know if this feature exists? If so, what version or where can a patch be obtained? Thanks ------- Forwarded message follows ------- Date sent: Mon, 15 Jan 2001 08:44:46 +0100 From: "J.H.M. Dassen (Ray)" <jdassen@cistron-office.nl> To: pgsql-general@postgresql.org Subject: Re: getting number of rows updated within a procedure On Sun, Jan 14, 2001 at 23:27:06 +1300, Dan Langille wrote: > I'm writing some stuff in PL/pgsql (actually, a lot of stuff). I have a > question: At various times, it does UPDATEs. Is there a way to tell if > the UPDATE actually affected any rows or not? I couldn't see how to get > UPDATE to return anything. Quoting a recent message by Jan Wieck <janwieck@Yahoo.com>: :Do a : : GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>; : :directly after an INSERT, UPDATE or DELETE statement and you'll know :how many rows have been hit. : :Also you can get the OID of an inserted row with : : GET DIAGNOSTICS SELECT RESULT INTO <int4_variable>; HTH, Ray -- "The software `wizard' is the single greatest obstacle to computer literacy since the Mac." http://www.osopinion.com/Opinions/MichaelKellen/MichaelKellen1.html ------- End of forwarded message ------- -- Dan Langille The FreeBSD Diary - http://freebsddiary.org/ FreshPorts - http://freshports.org/ NZ Broadband - http://unixathome.org/broadband/
On Thu, Jan 18, 2001 at 20:15:39 +1300, Dan Langille wrote: > Does anyone know if this feature exists? If so, what version or where > can a patch be obtained? Apparently you missed Jan's follow-up to my message: "New functionality in 7.1 - sorry." So you'll have to use the beta. Ray -- [Open Source] is the finest expression of the free market. Ideas are encouraged to proliferate and the best thinking wins. By contrast, most corporations today operate in a central planning straitjacket. http://www.thestandard.com/article/display/0,1151,15772,00.html
On 18 Jan 2001, at 9:05, J.H.M. Dassen (Ray) wrote: > On Thu, Jan 18, 2001 at 20:15:39 +1300, Dan Langille wrote: > > Does anyone know if this feature exists? If so, what version or where > > can a patch be obtained? > > Apparently you missed Jan's follow-up to my message: "New functionality in > 7.1 - sorry." So you'll have to use the beta. Yes, I did. Thank you for clearing that up. I have been searching the mailing list archives, but they seem to be out of date. I could only find my original post and no replies. Of course, my next two questions are: When will 7.1 leave beta (roughly)? How stable is it? FWIW, I'll be using it for development, not production and basically the only feature not in pre 7.1 I'm looking for is the above. -- Dan Langille The FreeBSD Diary - http://freebsddiary.org/ FreshPorts - http://freshports.org/ NZ Broadband - http://unixathome.org/broadband/
On Thu, Jan 18, 2001 at 22:30:48 +1300, Dan Langille wrote: > When will 7.1 leave beta (roughly)? From what I've been reading on the lists, "soon". I suspect within the next month or two. > How stable is it? FWIW, I'll be using it for development, not production I've not tested it extensively myself, but it passed my lithmus test (import a database of a couple of million records in one of its tables, with numerous constraints and indexes, drop some data based on columns which aren't indexed, then vacuum it [*]). HTH, Ray [*] I've had infinite loops VACUUMing this database under 7.0.3. -- "The problem with the global village is all the global village idiots." Paul Ginsparg
It is in 7.1beta, and is not documented yet. it> Does anyone know if this feature exists? If so, what version or where > can a patch be obtained? > > Thanks > > ------- Forwarded message follows ------- > Date sent: Mon, 15 Jan 2001 08:44:46 +0100 > From: "J.H.M. Dassen (Ray)" <jdassen@cistron-office.nl> > To: pgsql-general@postgresql.org > Subject: Re: getting number of rows updated within a procedure > > On Sun, Jan 14, 2001 at 23:27:06 +1300, Dan Langille wrote: > > I'm writing some stuff in PL/pgsql (actually, a lot of stuff). I have a > > question: At various times, it does UPDATEs. Is there a way to tell if > > the UPDATE actually affected any rows or not? I couldn't see how to get > > UPDATE to return anything. > > Quoting a recent message by Jan Wieck <janwieck@Yahoo.com>: > :Do a > : > : GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>; > : > :directly after an INSERT, UPDATE or DELETE statement and you'll know > :how many rows have been hit. > : > :Also you can get the OID of an inserted row with > : > : GET DIAGNOSTICS SELECT RESULT INTO <int4_variable>; > > HTH, > Ray > -- > "The software `wizard' is the single greatest obstacle to computer literacy > since the Mac." > http://www.osopinion.com/Opinions/MichaelKellen/MichaelKellen1.html > ------- End of forwarded message ------- > > -- > Dan Langille > The FreeBSD Diary - http://freebsddiary.org/ > FreshPorts - http://freshports.org/ > NZ Broadband - http://unixathome.org/broadband/ > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026