Any reasons for 'DO' statement not returning result? - Mailing list pgsql-general

From Xtra Coder
Subject Any reasons for 'DO' statement not returning result?
Date
Msg-id CAL2enjJinzk_UZbTU3bRNBYuox9dn+LbzD0sBeu4v7vjrSeaag@mail.gmail.com
Whole thread Raw
Responses Re: Any reasons for 'DO' statement not returning result?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Re: Any reasons for 'DO' statement not returning result?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hi, 

I'm just curious about the reasons of the design of 'DO' statement so that it is not able to return result of the SELECT in its body. 

References:

With some former experience with MsSQL server, where 'complex' script is executed easily and straightforward without any 'wrapping', like this dummy-one ...

    DECLARE @a int; 
    DECLARE @b int;
    ... 
    select @a + @b as "a+b"

... every time I need to execute some one-time-through-away complex code in PostgreSQL which returns rowset I'm disappointed - this has to be wrapped into normal 'temp' function which I have to delete all the time in current session, thus making an anonymous 'DO' statement use-less in 95% of my use-cases.

So ... may someone know good reasons for such inconvenient design of 'DO' statement?

Thanks.

pgsql-general by date:

Previous
From: Philippe Girolami
Date:
Subject: Re: Should a DB vacuum use up a lot of space ?
Next
From: Christian Ohler
Date:
Subject: Re: Detecting if current transaction is modifying the database