Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-30 Thread Vincenzo Romano
Il 28 lug 2017 16:18, "Tom Lane" ha scritto: Vincenzo Romano writes: > I would like to understand the typo protection mentioned by Tom earlier: > I need to understand the reason for creating that special case. Well, case A: create function

Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-28 Thread Tom Lane
Vincenzo Romano writes: > I would like to understand the typo protection mentioned by Tom earlier: > I need to understand the reason for creating that special case. Well, case A: create function foo(out x int4) returns setof int8 ... This is indubitably a typo.

Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-28 Thread Vincenzo Romano
2017-07-28 8:36 GMT+02:00 David G. Johnston : > On Thursday, July 27, 2017, David G. Johnston > wrote: >> >> On Thursday, July 27, 2017, Vincenzo Romano >> wrote: >>> >>> The main difference is that with RETURNS

Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-28 Thread David G. Johnston
On Thursday, July 27, 2017, David G. Johnston wrote: > On Thursday, July 27, 2017, Vincenzo Romano > wrote: >> >> The main difference is that with RETURNS SETOF RECORD I still

Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-28 Thread David G. Johnston
On Thursday, July 27, 2017, Vincenzo Romano wrote: > > The main difference is that with RETURNS SETOF RECORD I still get the > "usual"(tm) function argument list in the usual place: between two > parentheses. > It's a matter of style. And a consistent one. > But I

Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-27 Thread Vincenzo Romano
2017-07-27 16:03 GMT+02:00 Tom Lane : Thanks a lot for your reply with valuable details. > Vincenzo Romano writes: >> CREATE OR REPLACE FUNCTION afun1( OUT ot TEXT ) >> RETURNS SETOF RECORD > >> The error message for afun1() reads: >> ERROR:

Re: [GENERAL] RETURNS SETOF RECORD with 1 column

2017-07-27 Thread Tom Lane
Vincenzo Romano writes: > CREATE OR REPLACE FUNCTION afun1( OUT ot TEXT ) > RETURNS SETOF RECORD > The error message for afun1() reads: > ERROR: function result type must be text because of OUT parameters Indeed. It's trying to protect you from simple typos. If