pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Function return number of affected rows
Date: Thu, 10 Feb 2005 07:46:54 -0700
Message-ID: <20050210144654.GB68483@winnie.fuhr.org> (raw)
In-Reply-To: <420B46AC.9080002@yahoo.com.br>
References: <420B46AC.9080002@yahoo.com.br>

On Thu, Feb 10, 2005 at 09:34:04AM -0200, Francisco Figueiredo Jr. wrote:
> 
> I'd like to know if it is possible to get the number of affected rows of
> an insert, update or delete command inside a function.

Yes, but how you get that information depends on your client interface.
With libpq, for example, you could call PQcmdTuples().  If you're using
something else then see the relevant documentation.

> I'd like to know that, because I want to add this support, if possible,
> to Npgsql.
> 
> I know the server sends a CompletedResponse message indicating the
> number of rows affected by a insert update and delete sent directly. But
> if this is inside a function? Is it possible to get this message too?

Does Npgsql use its own implemention of the PostgreSQL protocol?
If so, then that implementation will have to provide the desired
functionality itself.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (7+ messages)  latest in thread

Message-ID: <20050210144654.GB68483@winnie.fuhr.org>
Permalink:  ../20050210144654.GB68483@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050210144654.GB68483@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: mike@fuhr.org, fxjrlists@yahoo.com.br
  Subject: Re: Function return number of affected rows
  In-Reply-To: <20050210144654.GB68483@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox