Re: PL/pgSQL 2

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Joel Jacobson <joel(at)trustly(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL 2
Date: 2014-09-01 14:35:48
Message-ID: CAFj8pRB5K9+FQd7Ns6GHp1aybZ9EGPgR2m+60LzwmJ2RLjkxFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-09-01 16:26 GMT+02:00 Craig Ringer <craig(at)2ndquadrant(dot)com>:

> On 09/01/2014 10:24 PM, Andres Freund wrote:
> > I know of format(), but it doesn't allow you to pass parameters as
> > actual query variables unfortunately.
> > I'm wondering if there's a way to marry USING and format()...
>
> Well, the idiom:
>
> EXECUTE format("SELECT %I FROM %I WHERE $1", col, tbl) USING val;
>
> is not lovely. It works, but it's clumsy.
>

It is not intuitive, but It is well descriptive about PL/pgSQL. I cannot to
imagine some different - it is mix of two independent worlds. And at end it
is elegant.

If we start new language from scratch, then we don't need to introduce
concept of embedded SQL or dynamic SQL.

But why? If it is too clumsy for you, use PLPerl or PLPython. Everytime
will be problem how to merge two different namespaces together.

>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2014-09-01 14:39:56 Re: PL/pgSQL 2
Previous Message Joel Jacobson 2014-09-01 14:34:50 Re: PL/pgSQL 2