Re: Relax requirement for INTO with SELECT in pl/pgsql

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Relax requirement for INTO with SELECT in pl/pgsql
Date: 2016-03-22 04:09:26
Message-ID: CAFj8pRBcQ6FbS2t1KypNk_7Tpkg8y143C=aAj531VvUzSFrVNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-03-21 23:26 GMT+01:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>:

> On 3/21/16 5:03 PM, Merlin Moncure wrote:
>
>> in Oracle, you'd simply do:
>> LogIt('I did something');
>>
>
> It would be *great* if we could support that in plpgsql.
>
> I'm not sure what Oracle does for SELECT statements without INTO/BULK
>> UPDATE. I'm not really inclined to care -- I'm really curious to see
>> an argument where usage of PERFORM actually helps in some meaningful
>> way. Notably, SELECT without INTO is accepted syntax, but fails only
>> after running the query. I think that's pretty much stupid but it's
>> fair to say I'm not inventing syntax, only disabling the error.
>>
>
> I don't think it buys much at all.
>
> While we're on the subject, it'd be great if variable := SELECT ... worked
> too.
>

We are support

var := (query expression)

and this syntax is required and supported by ANSI/SQL - there are no any
reason to support other proprietary extension.

Regards

Pavel

>
> I'm not sure what other databases do is relevant. They use other
>> procedure languages than pl//sql (the biggest players are pl/psm and
>> t-sql) which have a different set of rules in terms of passing
>> variables in and out of queries.
>>
>
> +1
> --
> Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
> Experts in Analytics, Data Architecture and PostgreSQL
> Data in Trouble? Get it in Treble! http://BlueTreble.com
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-22 04:10:52 Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5)
Previous Message Pavel Stehule 2016-03-22 04:07:10 Re: Relax requirement for INTO with SELECT in pl/pgsql