2011/10/20 Tom Lane :
> Pavel Stehule writes:
>> I didn't design a PERFORM statement. There is two views - somebody
>> from sybase's family know so SELECT without into is forwarded to
>> client. This functionality is missing on Oracle's family. Is true so
>> PERFORM statement is strange, but mayb
On Thu, Oct 20, 2011 at 3:01 PM, Tom Lane wrote:
> Pavel Stehule writes:
>> I didn't design a PERFORM statement. There is two views - somebody
>> from sybase's family know so SELECT without into is forwarded to
>> client. This functionality is missing on Oracle's family. Is true so
>> PERFORM sta
Pavel Stehule writes:
> I didn't design a PERFORM statement. There is two views - somebody
> from sybase's family know so SELECT without into is forwarded to
> client. This functionality is missing on Oracle's family. Is true so
> PERFORM statement is strange, but maybe it's open door for sybase'
2011/10/20 Tom Lane :
> Valentine Gogichashvili writes:
>> And, ernestly, if it were useless to have SELECT without INTO in plpgsql,
>> there also would be no PERFORM command in plpgsql...
>
> Precisely. Pavel's claim is nonsense. The only real question is how
> useful is it to call it PERFORM i
Valentine Gogichashvili writes:
> And, ernestly, if it were useless to have SELECT without INTO in plpgsql,
> there also would be no PERFORM command in plpgsql...
Precisely. Pavel's claim is nonsense. The only real question is how
useful is it to call it PERFORM instead of SELECT.
2011/10/20 Merlin Moncure :
> On Thu, Oct 20, 2011 at 2:28 AM, Pavel Stehule
> wrote:
>>>
>>> it would be really a good idea to allow SELECT without INTO in plpgsql.
>>
>> SELECT without INTO is useless in plpgsql - because you have to drop result.
>
> not if you're calling a function:
> select f
>
>
> >>
> >> it would be really a good idea to allow SELECT without INTO in plpgsql.
> >
> > SELECT without INTO is useless in plpgsql - because you have to drop
> result.
>
> not if you're calling a function:
> select func();
>
> or calling bunch of functions:
SELECT func(param) FROM some_su
On Thu, Oct 20, 2011 at 2:28 AM, Pavel Stehule wrote:
>>
>> it would be really a good idea to allow SELECT without INTO in plpgsql.
>
> SELECT without INTO is useless in plpgsql - because you have to drop result.
not if you're calling a function:
select func();
merlin
--
Sent via pgsql-bugs ma
2011/10/20 Valentine Gogichashvili :
>>
>> I suppose you could argue that selecting a value and implicitly throwing
>> it away is confusing to novices, but on the other hand I've seen a whole
>> lot of novices confused by the need to write PERFORM instead of SELECT.
>> I think it wouldn't be an unr
>
>
> I suppose you could argue that selecting a value and implicitly throwing
> it away is confusing to novices, but on the other hand I've seen a whole
> lot of novices confused by the need to write PERFORM instead of SELECT.
> I think it wouldn't be an unreasonable thing to just interpret a SELE
2011/10/19 Tom Lane :
> I wrote:
>> Merlin Moncure writes:
>>> The point being, how do I convert any query to a non WITH variant so
>>> it can be PERFORM'd? Anyways, I always thought having to do perform
>>> at all was pretty weak sauce -- not sure why it's required.
>
>> Possibly it was an Oracl
On 10/20/2011 05:23 AM, Tom Lane wrote:
I wrote:
Merlin Moncure writes:
The point being, how do I convert any query to a non WITH variant so
it can be PERFORM'd? Anyways, I always thought having to do perform
at all was pretty weak sauce -- not sure why it's required.
Possibly it was an Or
I wrote:
> Merlin Moncure writes:
>> The point being, how do I convert any query to a non WITH variant so
>> it can be PERFORM'd? Anyways, I always thought having to do perform
>> at all was pretty weak sauce -- not sure why it's required.
> Possibly it was an Oracle compatibility thing ... anyo
Tom Lane wrote:
> I think it wouldn't be an unreasonable thing to just interpret a
> SELECT with no INTO clause as being a PERFORM (ie execute and
> discard results).
FWIW, that would probably confuse people coming from MS SQL Server
or Sybase ASE, since doing that in Transact-SQL would return
Merlin Moncure writes:
> The point being, how do I convert any query to a non WITH variant so
> it can be PERFORM'd? Anyways, I always thought having to do perform
> at all was pretty weak sauce -- not sure why it's required.
Possibly it was an Oracle compatibility thing ... anyone know PL/SQL
w
On Wed, Oct 19, 2011 at 7:36 AM, Robert Haas wrote:
> On Tue, Sep 6, 2011 at 1:43 PM, Bruce Momjian wrote:
>> Well, this problem isn't isolated to WITH queries:
>>
>> test=> do
>> $$begin
>> perform(
>> select 1 UNION ALL select 1
>> );
>> end$$;
>>
On Tue, Sep 6, 2011 at 1:43 PM, Bruce Momjian wrote:
> Well, this problem isn't isolated to WITH queries:
>
> test=> do
> $$begin
> perform(
> select 1 UNION ALL select 1
> );
> end$$;
> ERROR: more than one row returned by a subquery used as an ex
depst...@alliedtesting.com wrote:
> Update: It has been suggested to wrap perform around a select like this:
>
> do
> $$begin
> perform(
> with A as (select 1 as foo)
> select foo from A
> );
> end$$;
>
> This won't work if select returns more than one statement:
>
> do
> $$begin
> perform(
> wi
Added to TODO:
Improve PERFORM handling of WITH queries or document limitation
---
depst...@alliedtesting.com wrote:
> Update: It has been suggested to wrap perform around a select like this:
>
> do
> $$begin
> per
On Thu, Mar 24, 2011 at 10:36 AM, Pavel Stehule wrote:
> Hello
>
> why you can do it?
>
> please, try to RETURN QUERY ...
>
> Regards
>
> Pavel Stehule
>
>
>>
>> $$begin
>>
>> perform(
>>
>> with A as (select generate_series(1,3) as foo)
>>
>> select foo from A
>>
>> );
>>
>> end$$;
This is 'DO'
Hello
why you can do it?
please, try to RETURN QUERY ...
Regards
Pavel Stehule
>
> $$begin
>
> perform(
>
> with A as (select generate_series(1,3) as foo)
>
> select foo from A
>
> );
>
> end$$;
>
>
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subs
Update: It has been suggested to wrap perform around a select like this:
do
$$begin
perform(
with A as (select 1 as foo)
select foo from A
);
end$$;
This won't work if select returns more than one statement:
do
$$begin
perform(
with A as (select generate_series(1,3) as foo)
select foo from A
);
On Sun, Mar 6, 2011 at 14:29, wrote:
> The only workaround that I can think of is to use a dummy variable to
> capture the query result. This has to be done even when the query doesn’t
> have a result (as when calling a function returning void).
>
>
>
> do
>
> $$declare
>
> dummy record;
>
> begi
PostgreSQL 9.0.1
It seems that PostgreSQL doesn't understand the WITH construct when used in a
PERFORM query inside PL/pgSQL functions and code blocks:
Example:
do
$$begin
with A as (select 1 as foo)
perform foo from A;
end$$;
syntax error at or near "perform"
do
$$begin
with A as (select
24 matches
Mail list logo