Re: nothing ever works

From: Joe Conway <mail(at)joeconway(dot)com>
To: Gerard Matthews <gerardmatt(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: nothing ever works
Date: 2017-06-22 23:25:08
Message-ID: bbf66634-3fc5-06d4-baee-64f3b198197e@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 06/22/2017 04:29 AM, Gerard Matthews wrote:
> It's under this page on the
> docs https://www.postgresql.org/docs/9.1/static/ecpg-dynamic.html.

Perhaps a bit confusing but notice the title in the top middle of the
page: "Chapter 33. ECPG - Embedded SQL in C"

That is definitely not what you are looking for by the sound of it. As
others have pointed out, most likely you want plpgsql:

https://www.postgresql.org/docs/current/static/plpgsql.html

although you can also write dynamic SQL in other Procedural Languages
which ship with Postgres, for example plpython and plperl:

https://www.postgresql.org/docs/current/static/plpython.html
https://www.postgresql.org/docs/current/static/plperl.html

Note however, while plpgsql is installed into your database by default,
plperl and plpython are not, so you would have to log into the database
of interest and run the following (once), e.g. (only do for the language
of interest, not all three; also note that depending on how you
installed Postgres, you might need to also install extra packages):

CREATE EXTENSION plperl;
CREATE EXTENSION plpythonu;
CREATE EXTENSION plperlu;

Also note the difference between "trusted" and "untrusted" procedural
languages. plpgsql and plperl are "trusted" while plperlu and plpythonu
are "untrusted". See this link for an explanation:

https://www.postgresql.org/docs/current/static/plperl-trusted.html

Hope this helps.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Michael Paquier 2017-06-23 01:23:36 Re: gen_random_uuid security not explicit in documentation
Previous Message Heikki Linnakangas 2017-06-22 18:02:03 Re: gen_random_uuid security not explicit in documentation