pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres functions(.so)
2+ messages / 2 participants
[nested] [flat]

* postgres functions(.so)
@ 2000-09-30 08:27  Vladimir V. Zolotych <gsmith@eurocom.od.ua>
  0 siblings, 1 reply; 2+ messages in thread

From: Vladimir V. Zolotych @ 2000-09-30 08:27 UTC (permalink / raw)
  To: pgsql-admin

  Hello

Can anybody help me?
The question is: Is it possible to write
postgres function on C/C++ that selects
some tables of a database ?

More detailed description.
Suppose I have database with tables A, B.
I've written program on C++ with 'main' function
that reads tables A, B and returns some value, e.g. integer.
Now I'd like to implement the same actions as postgres
function (e.g. as .so module).

Is it possible ?

I know:
    1) How compile C/C++ code to .so
    2) How to CREATE FUNCTION .....
I don't know:
    1) Is it possible to postges function
       to read tables of the database
    2) If possible, how it should be done?
    3) Which restrictions applicable to .so
       functions ?

If you know examples those do something similar,
please let me know.

Any help will be appreciated.

Thanks


--
Vladimir Zolotych                         gsmith@eurocom.od.ua

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: postgres functions(.so)
@ 2000-10-07 23:01  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Vladimir V. Zolotych <gsmith@eurocom.od.ua>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2000-10-07 23:01 UTC (permalink / raw)
  To: Vladimir V. Zolotych <gsmith@eurocom.od.ua>; +Cc: pgsql-admin

You can read a brief introduction in chapter 19 of my book at:

	http://www.postgresql.org/docs/awbook.html

Sounds like you want to use the SPI interface.  See the PostgreSQL
manuals for more information.

[ Charset KOI8-R unsupported, converting... ]
>   Hello
> 
> Can anybody help me?
> The question is: Is it possible to write
> postgres function on C/C++ that selects
> some tables of a database ?
> 
> More detailed description.
> Suppose I have database with tables A, B.
> I've written program on C++ with 'main' function
> that reads tables A, B and returns some value, e.g. integer.
> Now I'd like to implement the same actions as postgres
> function (e.g. as .so module).
> 
> Is it possible ?
> 
> I know:
>     1) How compile C/C++ code to .so
>     2) How to CREATE FUNCTION .....
> I don't know:
>     1) Is it possible to postges function
>        to read tables of the database
>     2) If possible, how it should be done?
>     3) Which restrictions applicable to .so
>        functions ?
> 
> If you know examples those do something similar,
> please let me know.
> 
> Any help will be appreciated.
> 
> Thanks
> 
> 
> --
> Vladimir Zolotych                         gsmith@eurocom.od.ua
> 
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-10-07 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-30 08:27 postgres functions(.so) Vladimir V. Zolotych <gsmith@eurocom.od.ua>
2000-10-07 23:01 ` Bruce Momjian <pgman@candle.pha.pa.us>

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