Embedded C function returning a set of rows

From: Alessandro Candini <candini(at)meeo(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Embedded C function returning a set of rows
Date: 2011-02-14 13:41:48
Message-ID: 4D59311C.6000008@meeo.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have read http://www.postgresql.org/docs/9.0/static/xfunc-c.html, but
it is not clear to me how to implement a function which retrieve a set
of rows.
In the example given it seems that I have to recall my function for
every row, but this is not what I want.
With libpq I can perform a query which returns a set of rows in a single
operation.

What types and methos have I to use in order to output my result,
embedding my function in postgresql?

Can anyone give me a simple example?

I want to do something like this:
psql -p 5433 -d mydb -U myuser -C "SELECT myfunc(SELECT * FROM mytable);"

I know that this seems stupid, but please answer me only if you know how
to do this...

Thanks in advance.

--
Alessandro Candini

MEEO S.r.l.
Via Saragat 9
I-44122 Ferrara, Italy
Tel: +39 0532 1861501
Fax: +39 0532 1861637
http://www.meeo.it

========================================
"ATTENZIONE:le informazioni contenute in questo messaggio sono
da considerarsi confidenziali ed il loro utilizzo è riservato unicamente
al destinatario sopra indicato. Chi dovesse ricevere questo messaggio
per errore è tenuto ad informare il mittente ed a rimuoverlo
definitivamente da ogni supporto elettronico o cartaceo."

"WARNING:This message contains confidential and/or proprietary
information which may be subject to privilege or immunity and which
is intended for use of its addressee only. Should you receive this
message in error, you are kindly requested to inform the sender and
to definitively remove it from any paper or electronic format."

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2011-02-14 14:25:10 Re: Embedded C function returning a set of rows
Previous Message Ruben Blanco 2011-02-14 10:15:40 Re: Heavy queries not run by user application