Re: getting the number of rows affected by a query - Mailing list pgsql-general

From Sam Mason
Subject Re: getting the number of rows affected by a query
Date
Msg-id 20071116100232.GN1955@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to getting the number of rows affected by a query  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Responses Re: getting the number of rows affected by a query  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
On Fri, Nov 16, 2007 at 09:00:46AM +0800, Ow Mun Heng wrote:
> I'm trying to do some periodic updates from another DB and would like to
> know the # of updates/inserts/deletes from that job.

Humm; it would be nice if you could use the new RETURNING construct
that's been introduced in 8.2, i.e. something like:

  SELECT COUNT(*) FROM (
    DELETE FROM foo RETURNING 1) x;

However PG doesn't seem to support this.  It seems logical to support
this construct now that RETURNING has been incorporated.  There's
probably something obvious that I'm missing here though.


  Sam

pgsql-general by date:

Previous
From: Ow Mun Heng
Date:
Subject: Re: getting the number of rows affected by a query
Next
From: Sam Mason
Date:
Subject: Re: Common criteria evaluation?