pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Question about undefinably query...
2+ messages / 2 participants
[nested] [flat]

* Question about undefinably query...
@ 2007-04-10 14:05  A. Kretschmer <andreas.kretschmer@schollglas.com>
  0 siblings, 1 reply; 2+ messages in thread

From: A. Kretschmer @ 2007-04-10 14:05 UTC (permalink / raw)
  To: pgsql-sql

Hi all,

there was a question on #postgresql (irc-channel) from CyberDuck without
an answer. A little example:

test=*# select generate_series(1,5), generate_series(6,10) order by 1;
 generate_series | generate_series
-----------------+-----------------
               1 |               6
               2 |               7
               3 |               8
               4 |               9
               5 |              10
(5 rows)

test=*# select generate_series(1,5), generate_series(7,10) order by 1;
 generate_series | generate_series
-----------------+-----------------
               1 |               7
               1 |               8
               1 |               9
               1 |              10
               2 |               8
               2 |               9
               2 |              10
               2 |               7
               3 |               9
               3 |              10
               3 |               7
               3 |               8
               4 |              10
               4 |               7
               4 |               8
               4 |               9
               5 |               7
               5 |               8
               5 |               9
               5 |              10
(20 rows)

Why returns the first select 5 rows (i think, this is okay) and the 2nd
20 rows?

Version is a 8.1 on Debian.



Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Question about undefinably query...
@ 2007-04-10 14:46  Tom Lane <tgl@sss.pgh.pa.us>
  parent: A. Kretschmer <andreas.kretschmer@schollglas.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2007-04-10 14:46 UTC (permalink / raw)
  To: A. Kretschmer <andreas.kretschmer@schollglas.com>; +Cc: pgsql-sql

"A. Kretschmer" <andreas.kretschmer@schollglas.com> writes:
> there was a question on #postgresql (irc-channel) from CyberDuck without
> an answer. A little example:

Multiple SRFs in a targetlist behave, um, strangely.  I think the rule
is that all are cycled until they all chance to report "done" at the
same time, so the number of result rows is the least common multiple
of the period lengths.

This is one of the reasons that SRF-in-targetlist is deprecated ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-04-10 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-10 14:05 Question about undefinably query... A. Kretschmer <andreas.kretschmer@schollglas.com>
2007-04-10 14:46 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox