CREATE LANGUAGE workaround

Started by Martin Gaintyover 16 years ago3 messagesgeneral
Jump to latest
#1Martin Gainty
mgainty@hotmail.com

I am slowly transferring my Procedures over and came upon this workaround
implemented by a script which maps the plpgsql (type) to call plpgsql.dll pg_finfo_plpgsql_call_handler

# Create a plpgsql handler for plpgsql type
CREATE FUNCTION pg_finfo_plpgsql_call_handler() RETURNS plpgsql AS '/postgres/pgsql/bin/plpgsql.dll' LANGUAGE C;
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER pg_finfo_plpgsql_call_handler;

is there a system defined script I can run which would map the plpgsql handler to the plpgsql type automatically?

thanks!
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

_________________________________________________________________
Microsoft brings you a new way to search the web. Try Bing™ now
http://www.bing.com?form=MFEHPG&publ=WLHMTAG&crea=TEXT_MFEHPG_Core_tagline_try bing_1x1

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: Martin Gainty (#1)
Re: CREATE LANGUAGE workaround

2009/9/27 Martin Gainty <mgainty@hotmail.com>:

I am slowly transferring my Procedures over and came upon this workaround
implemented by a script which maps the plpgsql (type) to call plpgsql.dll
pg_finfo_plpgsql_call_handler

# Create a plpgsql handler for plpgsql type
CREATE FUNCTION pg_finfo_plpgsql_call_handler() RETURNS plpgsql AS
'/postgres/pgsql/bin/plpgsql.dll' LANGUAGE C;
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER
pg_finfo_plpgsql_call_handler;

is there a system defined script I can run which would map the plpgsql
handler to the plpgsql type automatically?

On Unix there's a createlang command (run from the CLI, not from psql)
that does this.

createlang plpgsql dbname

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Martin Gainty (#1)
Re: CREATE LANGUAGE workaround

Martin Gainty <mgainty@hotmail.com> writes:

I am slowly transferring my Procedures over and came upon this workaround
implemented by a script which maps the plpgsql (type) to call plpgsql.dll pg_finfo_plpgsql_call_handler

# Create a plpgsql handler for plpgsql type
CREATE FUNCTION pg_finfo_plpgsql_call_handler() RETURNS plpgsql AS '/postgres/pgsql/bin/plpgsql.dll' LANGUAGE C;
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER pg_finfo_plpgsql_call_handler;

is there a system defined script I can run which would map the plpgsql handler to the plpgsql type automatically?

I'm not sure what you are trying to accomplish, but the above looks like
it should all just be replaced by
CREATE LANGUAGE plpgsql;
in reasonably modern versions of Postgres.

There is no such thing as a "plpgsql type".

regards, tom lane