mirror of
https://github.com/postgres/postgres.git
synced 2026-03-02 21:30:36 -05:00
PL/Sample is an example template of procedural-language handler. This can be used as a base to implement a custom PL, or as a facility to test APIs dedicated to PLs. Much more could be done in this module, like adding a simple validator, but this is left as future work. The documentation included originally some C code to understand the basics of PL handler implementation, but it was outdated, and not really helpful either if trying to implement a new procedural language, particularly when it came to the integration of a PL installation with CREATE EXTENSION. Author: Mark Wong Reviewed-by: Tom Lane, Michael Paquier Discussion: https://postgr.es/m/20200612172648.GA3327@2ndQuadrant.com
14 lines
469 B
SQL
14 lines
469 B
SQL
/* src/test/modules/plsample/plsample--1.0.sql */
|
|
|
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
|
\echo Use "CREATE EXTENSION plsample" to load this file. \quit
|
|
|
|
CREATE FUNCTION plsample_call_handler() RETURNS language_handler
|
|
AS 'MODULE_PATHNAME' LANGUAGE C;
|
|
|
|
CREATE TRUSTED LANGUAGE plsample
|
|
HANDLER plsample_call_handler;
|
|
|
|
ALTER LANGUAGE plsample OWNER TO @extowner@;
|
|
|
|
COMMENT ON LANGUAGE plsample IS 'PL/Sample procedural language';
|