Multiple SRF right after SELECT - Mailing list pgsql-hackers

From Nikolay Samokhvalov
Subject Multiple SRF right after SELECT
Date
Msg-id e431ff4c0803190503m49eeef76pb91a692009a30331@mail.gmail.com
Whole thread Raw
Responses Re: Multiple SRF right after SELECT
Re: Multiple SRF right after SELECT
Re: Multiple SRF right after SELECT
List pgsql-hackers
Hi,

I wonder, if the following is correct and provides expected result:

test=# select generate_series(1, 2), generate_series(1, 4);generate_series | generate_series
-----------------+-----------------              1 |               1              2 |               2              1 |
            3              2 |               4
 
(4 rows)


Actually I have two questions on this:1. Is it correct at all to use SRF in select list, w/o explicit FROM?
Why then we do not allow using subselects that return multiple rows?
I'd rather expect that these two things work in similar manner.2. Why the query above provides 4 rows, not 2*4=8?
Actually,that's
 
interesting -- I can use this query to find l.c.m. But it's defenetely
not that I'd expect before my try...
-- 
Best regards,
Nikolay


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: fast count(*) through statistics collector
Next
From: Kenneth Marshall
Date:
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)