From: | Thomas Hallgren <thhal(at)mailblocks(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: how can i add my own procedural language? |
Date: | 2004-12-07 06:59:16 |
Message-ID: | 41B554C4.5000702@mailblocks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Sibtay,
> hi
>
> is "Procedural language handler function" the
> interface for adding your own procedural languages to
> postgres?
>
> I ve read the documentation but i am not able to
> understand where do we deal with stuff like parse
> trees, query trees, plan trees etc.
>
> Ofcourse any procedural language should pass through
> all the steps ie parsing, planning/optimization and
> execution.
>
> so where do we define these steps? and what interface
> is provided by postgresql?
>
You normally don't deal with parsing, planning etc. at all from within a
language handler.
If you want to know how to issue a SQL query from within a function, a
good start is to look at the Server Programming Interface (SPI) . The
functions described there are normally the ones your language handler
will use to access the database from within the function.
http://www.postgresql.org/docs/7.4/interactive/spi.html
Take a look at the code for the languages that are bundled with
PostgreSQL. In the source tree, you will find them under src/pl. The
pltcl.c was very helpful to me when I first did this.
Other links where you will find source that might be helpful:
http://pgfoundry.org/projects/plperlng
http://gborg.postgresql.org/project/pljava
Regards,
Thomas Hallgren
From | Date | Subject | |
---|---|---|---|
Next Message | Sibtay Abbas | 2004-12-07 07:05:28 | spi and other languages |
Previous Message | Sibtay Abbas | 2004-12-07 06:33:45 | how can i add my own procedural language? |