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 SELECT
2011/10/20 Valentine Gogichashvili val...@gmail.com:
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
On Thu, Oct 20, 2011 at 2:28 AM, Pavel Stehule pavel.steh...@gmail.com 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
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
2011/10/20 Merlin Moncure mmonc...@gmail.com:
On Thu, Oct 20, 2011 at 2:28 AM, Pavel Stehule pavel.steh...@gmail.com
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
Valentine Gogichashvili val...@gmail.com 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
2011/10/20 Tom Lane t...@sss.pgh.pa.us:
Valentine Gogichashvili val...@gmail.com 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
Pavel Stehule pavel.steh...@gmail.com 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
On Thu, Oct 20, 2011 at 3:01 PM, Tom Lane t...@sss.pgh.pa.us wrote:
Pavel Stehule pavel.steh...@gmail.com 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
On Tue, Sep 6, 2011 at 1:43 PM, Bruce Momjian br...@momjian.us 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
On Wed, Oct 19, 2011 at 7:36 AM, Robert Haas robertmh...@gmail.com wrote:
On Tue, Sep 6, 2011 at 1:43 PM, Bruce Momjian br...@momjian.us wrote:
Well, this problem isn't isolated to WITH queries:
test= do
$$begin
perform(
select 1 UNION ALL select 1
);
Merlin Moncure mmonc...@gmail.com 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 ...
Tom Lane t...@sss.pgh.pa.us 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
I wrote:
Merlin Moncure mmonc...@gmail.com 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
On 10/20/2011 05:23 AM, Tom Lane wrote:
I wrote:
Merlin Moncuremmonc...@gmail.com 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.
2011/10/19 Tom Lane t...@sss.pgh.pa.us:
I wrote:
Merlin Moncure mmonc...@gmail.com 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.
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
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(
with A as (select
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
);
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 subscription:
On Thu, Mar 24, 2011 at 10:36 AM, Pavel Stehule pavel.steh...@gmail.com 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' statement.
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
On Sun, Mar 6, 2011 at 14:29, depst...@alliedtesting.com 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
23 matches
Mail list logo