Skip site navigation (1) Skip section navigation (2)

Re: Calling stored function that returns a cursor from a libpq program

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mazen Abdel-Rahman <saba(dot)mazen(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Calling stored function that returns a cursor from a libpq program
Date: 2009-08-13 15:30:38
Message-ID: 7631.1250177438@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Mazen Abdel-Rahman <saba(dot)mazen(at)gmail(dot)com> writes:
> I am trying to use a stored functions that returns a CURSOR in a C
> program that uses that libpq library.

It looks like you've just hardwired an assumption about what the name of
the cursor will be.  It'd be better to pay attention to the name
returned by the function.

It also looks like you're not bothering to check that the BEGIN command
succeeded.  If it didn't for some reason, that could explain the
failure.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Mazen Abdel-RahmanDate: 2009-08-13 16:04:37
Subject: Re: Calling stored function that returns a cursor from a libpq program
Previous:From: Mazen Abdel-RahmanDate: 2009-08-13 15:12:49
Subject: Calling stored function that returns a cursor from a libpq program

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group