Emmanuel Charpentier <charpent(at)bacbuc(dot)dyndns(dot)org> writes:
> In other words, may I guarantee that :
> select recnum, glue(linenum)as authors from (select recnum, linenum, author
> from cit_authors where <some conditions on recnum> order by recnum,
> linenum) as foo;
> will indeed give me the authors in the original order ?
The query as given is illegal; you'd need to add "GROUP BY recnum" to
the outer query to make it legal. And once you do that, I don't think
you can rely on the ordering of the rows.
This problem has been discussed before, and I think we came up with some
workaround for it, but I don't have time to go trolling the archives for
the solution at the moment.
regards, tom lane