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

Michael Fuhr wrote:
> 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.
> 

Hi Michael.

Thx for info. I will check what PQcmdTuples is doing.

> 
>>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.
> 

Yeap. Npgsql implements protocol itself. This is exactly the problem. 
I'm not receiving the CompletedResponse protocol message when executing 
the insert inside a function. It is through the CompletedResponse 
postgresql server says how many rows were affected. But it seems that 
when calling a function it doesn't return any.

Thanks for your feedback Michael.

Regards,

Francisco Figueiredo Jr.





view thread (7+ messages)  latest in thread

Message-ID: <420B9122.2090802@yahoo.com.br>
Permalink:  ../420B9122.2090802@yahoo.com.br/
Also on:    postgresql.org/message-id/420B9122.2090802@yahoo.com.br

 · 

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: fxjrlists@yahoo.com.br, mike@fuhr.org
  Subject: Re: Function return number of affected rows
  In-Reply-To: <420B9122.2090802@yahoo.com.br>

* 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