Re: PL/pgSQL 2 - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: PL/pgSQL 2
Date
Msg-id 54063764.70805@wi3ck.info
Whole thread Raw
In response to Re: PL/pgSQL 2  (Joel Jacobson <joel@trustly.com>)
List pgsql-hackers
On 09/01/2014 10:41 AM, Joel Jacobson wrote:
> On Mon, Sep 1, 2014 at 4:26 PM, Craig Ringer <craig@2ndquadrant.com> wrote:
>> Well, the idiom:
>>
>>   EXECUTE format("SELECT %I FROM %I WHERE $1", col, tbl) USING val;
>>
>> is not lovely. It works, but it's clumsy.
>
> This is exactly why we need a new language.
> All the clumsy stuff we cannot fix in plpgsql, can easily be fixed in
> plpgsql2, with the most beautiful syntax we can come up with.

You know that you're running into problems with the SPI subsystem on 
that one, no?

Identifiers cannot be parameters in SPI_prepare(). So how do you propose 
to make that "pretty" and "performant"?

Because the moment, your "pretty" language is out there, be sure users 
will kick your behind that whenever they use that "pretty" stuff on 
anything but a toy setup, it spirals their servers into a DOS attack state.


Regards,
Jan

-- 
Jan Wieck
Senior Software Engineer
http://slony.info



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Escaping from blocked send() reprised.
Next
From: Álvaro Hernández Tortosa
Date:
Subject: Re: PL/pgSQL 2