Embedded C function returning a set of rows - Mailing list pgsql-general

From Alessandro Candini
Subject Embedded C function returning a set of rows
Date
Msg-id 4D59311C.6000008@meeo.it
Whole thread Raw
Responses Re: Embedded C function returning a set of rows  (Merlin Moncure <mmoncure@gmail.com>)
List 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."


pgsql-general by date:

Previous
From: Ruben Blanco
Date:
Subject: Re: Heavy queries not run by user application
Next
From: Merlin Moncure
Date:
Subject: Re: Embedded C function returning a set of rows