Re: array_agg to array

2018-05-16 Thread Philipp Kraus
> Am 16.05.2018 um 09:10 schrieb Torsten Förtsch : > > select array_agg(i[1]) as e from regexp_matches( 'H2O', > '[0-9]*[A-Z][a-z]?\d*|\((?:[^()]*(?:\(.*\))?[^()]*)+\)\d+', 'g') t(i); perfect, this helps with the t(i) call Phil signature.asc Description: Message

Re: array_agg to array

2018-05-16 Thread Torsten Förtsch
On Wed, May 16, 2018 at 8:14 AM, Philipp Kraus < philipp.kr...@tu-clausthal.de> wrote: > Hello, > > I have got a function with a reg expr to split chemical formulas e.g. H2O > -> H2 O. > > CREATE OR REPLACE FUNCTION daimon.text2sumformula(text) RETURNS text[] AS > $$ > select

Re: array_agg to array

2018-05-16 Thread Pavel Stehule
Hi 2018-05-16 8:14 GMT+02:00 Philipp Kraus : > Hello, > > I have got a function with a reg expr to split chemical formulas e.g. H2O > -> H2 O. > > CREATE OR REPLACE FUNCTION daimon.text2sumformula(text) RETURNS text[] AS > $$ > select array_agg(i::text) as e

array_agg to array

2018-05-16 Thread Philipp Kraus
Hello, I have got a function with a reg expr to split chemical formulas e.g. H2O -> H2 O. CREATE OR REPLACE FUNCTION daimon.text2sumformula(text) RETURNS text[] AS $$ select array_agg(i::text) as e from ( select unnest( regexp_matches( $1,