Search Postgresql Archives

C SRF question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am writing a C set returning function to standardize address strings like:

select * from standard_address(
	sql_for_lexicon,
	sql_for_gazeteer,
	sql_for_rules,
	sql_for_addresses);

On the first call, the first 3 sql statements are executed with SPI to collect and build the standardizer internal structures and a pointer to this is saved in functx->user_fctx.

Next I plan to create an SPI cursor to get the addresses that need to be standardized and fetch one record on each call, standardize it and return it. Is this the best strategy? In other functions I have written, I have created a result structure and fetched all the results into that then saved that structure and returned the record from that on successive calls but those result sets were small.

Does this cursor need to be saved between successive calls to the function? How? Do I need to SPI_connect on each all? or does it remember that across calls?

Thanks for any insight you can offer.

-Steve


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux