Re: how can i add my own procedural language? - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: how can i add my own procedural language?
Date
Msg-id 41B554C4.5000702@mailblocks.com
Whole thread Raw
In response to how can i add my own procedural language?  (Sibtay Abbas <sibtay_abbas@yahoo.com>)
Responses Re: how can i add my own procedural language?
List 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



pgsql-hackers by date:

Previous
From: Sibtay Abbas
Date:
Subject: how can i add my own procedural language?
Next
From: "Andrew Dunstan"
Date:
Subject: Re: Call for port reports