Re: getting the number of rows affected by a query

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: getting the number of rows affected by a query
Date: 2007-11-16 10:02:32
Message-ID: 20071116100232.GN1955@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2007-11-16 10:07:16 Re: Common criteria evaluation?
Previous Message Ow Mun Heng 2007-11-16 09:26:00 Re: getting the number of rows affected by a query