From: | "David Olbersen" <DOlbersen(at)stbernard(dot)com> |
---|---|
To: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Rows UPDATEd? (solved!) |
Date: | 2003-05-29 18:27:35 |
Message-ID: | E7E213858379814A9AE48CA6754F5ECB0D6E96@mail01.stbernard.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Using the Pg module, one can use
$res->cmdStatus for UPDATE as well as INSERT and DELETE to see how many rows were UPDATE/INSERT/DELETEd and what action was taken.
One can also use $res->cmdTuples in the same manner.
Looks like the documentation is just a little lacking.
--------------------------
David Olbersen
iGuard Engineer
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152
> -----Original Message-----
> From: David Olbersen
> Sent: Thursday, May 29, 2003 10:01 AM
> To: pgsql-sql(at)postgresql(dot)org
> Subject: [SQL] Rows UPDATEd?
>
>
>
> I'm looking for a way to see how many rows were UPDATEd. I
> Googled a bit and found that if I were using pl/pgsql I could
> use 'GET DIAGNOSTICS'. But I'm not using pl/pgsql. Is there
> some other way I could find out how many rows were affected
> by the last statement in my transaction?
>
> For what it's worth, a Perl script is doing this using the Pg
> module. I didn't see anything in the Pg man page describing
> this. It does cover INSERT and DELETE by using "$cmdStatus =
> $result->cmdStatus", but not UPDATE.
>
> Any suggestions?
>
> --------------------------
> David Olbersen
> iGuard Engineer
> 11415 West Bernardo Court
> San Diego, CA 92127
> 1-858-676-2277 x2152
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-05-29 18:46:34 | Re: Index scan never executed? |
Previous Message | Morten Tryfoss | 2003-05-29 18:24:50 | Re: Index scan never executed? |