From: Pavel Stehule on 24 Jan 2010 13:45 2010/1/24 David E. Wheeler <david(a)kineticode.com>: > On Jan 24, 2010, at 1:19 AM, Pavel Stehule wrote: > >> can I help with it, please. My English is terrible. > > Yes, I added a bit in the patch I submitted. > >> array user functions are used more time in pg core. The complexity of >> array functions are much higher, so I don't think we need special >> file. > > Okay. Should have tried it in PL/pgSQL then, perhaps. > :) - I'll look on it again. >> I'll recheck it. I am sure so all parameters should be a text. > > Probably shouldn't go into varchar.c then, yes? > >> We can, but it isn't good way. Processing of arrays is little bit more >> expensive then processing plain text. It is reason why listagg is >> faster, than your custom aggregate. More, the final function could be >> faster - the content is final. > > Understood. > >> It normal for aggregate functions. We need more transfn function, >> because we need two two variant: listagg(col), listagg(col, sep). Our >> coding guidlines doesn't advice share C functions - but these >> functions are +/- wrapper for accumStringResult - so there is zero >> overhead. > > Ah, okay, it's because of the second argument. Now I understand. > >> I don't think. When we have function, with same parameters, same >> behave like some Oracle function, then I am strongly prefer Oracle >> name. I don't see any benefit from different name. It can only confuse >> developers and add the trable to people who porting applications. > > Meh. If the name is terrible, we don't have to use it, and it's easy enough to create an alias in SQL for those who need it. > The "list" is common name for this content - it is usual in Microsoft SQL Server, it is usual in Oracle. Maybe we can vote about the name Regards Pavel Stehule > Best, > > David > > -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Scott Bailey on 25 Jan 2010 00:29 >> I don't think. When we have function, with same parameters, same >> behave like some Oracle function, then I am strongly prefer Oracle >> name. I don't see any benefit from different name. It can only confuse >> developers and add the trable to people who porting applications. > > Meh. If the name is terrible, we don't have to use it, and it's easy enough to create an alias in SQL for those who need it. The corresponding function in Oracle is called wm_concat. In MySQL its called group_concat. I don't believe DB2 or SQL Server have built in equivalents. The Oracle name isn't really an option ("wm' stands for workspace manager) I think listagg or string_agg would be the most appropriate names. Oh and before Oracle had wm_concat, Tom Kyte wrote a function called stragg that was pretty popular. Scott -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Peter Eisentraut on 25 Jan 2010 05:09 On sön, 2010-01-24 at 21:29 -0800, Scott Bailey wrote: > I think listagg or string_agg would be the most appropriate names. Oh > and before Oracle had wm_concat, Tom Kyte wrote a function called > stragg that was pretty popular. Well, xmlagg -> concatenates values to form xml datum array_agg -> concatenates values to form array datum ??? -> concatenates values to form string datum So it's pretty clear that listagg does not fit into this scheme. -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Pavel Stehule on 25 Jan 2010 05:34 2010/1/25 Peter Eisentraut <peter_e(a)gmx.net>: > On sön, 2010-01-24 at 21:29 -0800, Scott Bailey wrote: >> I think listagg or string_agg would be the most appropriate names. Oh >> and before Oracle had wm_concat, Tom Kyte wrote a function called >> stragg that was pretty popular. > > Well, > > xmlagg -> concatenates values to form xml datum > array_agg -> concatenates values to form array datum > ??? -> concatenates values to form string datum > > So it's pretty clear that listagg does not fit into this scheme. when you define list as text domain, then this the name is correct. searching "list sql string" on google. You can see, so "list" is usually used. Regards Pavel > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers > -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Tom Lane on 25 Jan 2010 08:57
Pavel Stehule <pavel.stehule(a)gmail.com> writes: > 2010/1/25 Peter Eisentraut <peter_e(a)gmx.net>: >> xmlagg -> concatenates values to form xml datum >> array_agg -> concatenates values to form array datum >> ??? -> concatenates values to form string datum >> >> So it's pretty clear that listagg does not fit into this scheme. > when you define list as text domain, then this the name is correct. IOW, if you define away the problem then there's no problem? I agree that "list" is a terrible choice of name here. "string_agg" seemed reasonable and in keeping with the standardized "array_agg". regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |