[HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
Hello It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. create aggregate la(text, text) (SFUNC=listagg2_transfn, STYPE=internal, FINALFUNC=listagg_finalfn); postgres=# select la(town,',') from country; la ---

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax. Put the aggregate arguments first, then the ORDER BY. regards, tom lane -- Sent via pgsql-hackers mailing

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax.  Put the aggregate arguments first, then the ORDER BY. Sorry, I don't see it. Please,

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Pavel Stehule pavel.steh...@gmail.com: 2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax.  Put the aggregate arguments first,

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax.  Put the aggregate arguments first, then the ORDER BY. I was wrong. But it should be

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: I was wrong. But it should be syntax error no? SELECT foo(expr ORDER BY expr, .) currently it quietly ignore arguments over ORDER BY clause. No, because you could have more than one ORDER BY item. regards, tom lane

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: I was wrong. But it should be syntax error no? SELECT foo(expr ORDER BY expr, .) currently it quietly ignore arguments over ORDER BY clause. No, because you could have more than one ORDER BY item. I

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2009/12/25 Tom Lane t...@sss.pgh.pa.us: No, because you could have more than one ORDER BY item. hmm - this isn't bullet-prof design :( I notice that ORDER BY 'x' draws an error at the query level but not within aggregates or window functions. I