HI Ah I see what you mean, no user-defined functions will not work for this case.
I have no problem with including this function, but I think you should verify that the syntax for string_agg is the same as PostgreSQL, not a mix of H2 and PostgreSQL.
Also don't forget to write a couple of unit tests for it. Thanks, Noel. On 2015-04-01 01:24 PM, Fred&Dani&Pandora&Aquiles wrote:
Hi Noel, The string_agg is aggregate function similar to group_concat. The user defined functions can be applied in this case? As I wasn't sure about this, I started to work in a simple patch to support the string_agg in Postgres style. To keep simplicity, I just added the possibility of comma as delimiter and the string_agg aggregate with the group_concat type. However, I noted that is possible to mix the syntaxes of H2 and Postgres which could lead to some errors like: select string_agg(cola order by colb,colc,'/'). In the previous example, the default comma delimiter will be used because the delimiter '/' will be treated as a 'column' during agg.setGroupConcatOrder(parseSimpleOrderList()). In cases where the string_agg be wrote as expected in Postgres, the aggregation will work. Finally, If you considerer beneficial the inclusion of the new aggregate function, do you think would be valid to ensure the correct syntaxe of Postgres aggregate? Regards, Fred 2015-04-01 4:28 GMT-03:00 Noel Grandin <[email protected] <mailto:[email protected]>>: On 2015-03-31 03:15 PM, Laurent Wang Stemmer wrote: Do you have any idea how I can mimic this aggregate function string_agg with H2 without making my test irrelevant ? http://h2database.com/html/__features.html#user_defined___functions <http://h2database.com/html/features.html#user_defined_functions> -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscribe@__googlegroups.com <mailto:h2-database%[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>. Visit this group at http://groups.google.com/__group/h2-database <http://groups.google.com/group/h2-database>. For more options, visit https://groups.google.com/d/__optout <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
