pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Joe Conway <mail@joeconway.com>
To: Gerard Matthews <gerardmatt@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-docs <pgsql-docs@postgresql.org>
Subject: Re: nothing ever works
Date: Thu, 22 Jun 2017 16:25:08 -0700
Message-ID: <bbf66634-3fc5-06d4-baee-64f3b198197e@joeconway.com> (raw )
In-Reply-To: <CAO=GzUjXrZp81NNqgDu3bEPpftMN9hvLf1oWxx8M9nvGS45hOg@mail.gmail.com >
References: <20170621083940.27874.47470@wrigleys.postgresql.org >
<CAFj8pRBVZSw_COwXxQhPKmucMSPiETKVM0d9sMH6PYRN73CMXg@mail.gmail.com >
<CAB7nPqSWzvVKvfHz3bt5Cf_bZ1t6m3Qg__a67OWSiODV9T8tgw@mail.gmail.com >
<CAKFQuwZnmtzwdGfHrd+vtebWCX7F_qna9CepDiZwFPHpiQ6KhA@mail.gmail.com >
<CAO=GzUhm9buGcS2KZFqZ60cnBV1ezW7PsMVhY4wXLSJy=As-hw@mail.gmail.com >
<CAO=GzUgrZNqWb0RPHvsWz=mTDV0sH8-eL+x0AceHa6OJqfr+uQ@mail.gmail.com >
<CAFj8pRCf=sm8QMizxWb0vYVi6PhC4zchv_3guDLCORCaFRX6Gw@mail.gmail.com >
<CAO=GzUjXrZp81NNqgDu3bEPpftMN9hvLf1oWxx8M9nvGS45hOg@mail.gmail.com >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Attachments:
signature.asc (application/pgp-signature, 818B) download
view thread (12+ messages) latest in thread
Message-ID: <bbf66634-3fc5-06d4-baee-64f3b198197e@joeconway.com>
Permalink: ../bbf66634-3fc5-06d4-baee-64f3b198197e@joeconway.com/
Also on: postgresql.org/message-id/bbf66634-3fc5-06d4-baee-64f3b198197e@joeconway.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: mail@joeconway.com, gerardmatt@gmail.com, pavel.stehule@gmail.com, david.g.johnston@gmail.com, michael.paquier@gmail.com
Subject: Re: nothing ever works
In-Reply-To: <bbf66634-3fc5-06d4-baee-64f3b198197e@joeconway.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox