Proof-of-concept patch for CREATE LANGUAGE template idea

Started by Tom Laneabout 21 years ago1 messagespatches
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Attached is a preliminary patch for the "PL template" facility I
proposed a couple days ago. This is a stripped-down implementation
that just hardwires a lookup table in proclang.c, instead of putting
the data into a system catalog as should happen in 8.2. It's not
ready to apply yet because I haven't touched pg_dump or the
documentation, but I thought I'd put it up for comment.

Note that the patch disables createlang's -L option. I can't see that
that option has any use anymore; it used to be needed by pg_regress
for testing temporary installations, but since we put in the
auto-package-relocation support, $libdir works fine. Anyone still
see a need for it?

One small annoyance is that since createlang no longer knows what
languages are supported, it gives a fairly unhelpful error message
if you misspell:

$ createlang plprl
createlang: language installation failed: ERROR: no handler specified for procedural language

This could of course be fixed properly if the pltemplate system catalog
existed, but in the meantime it seems we need a kluge. I hate to
duplicate the list of known PLs in both the backend and createlang
... anyone have a better idea?

regards, tom lane