Re: sql function with empty row

2018-05-16 Thread Philipp Kraus
> Am 16.05.2018 um 20:40 schrieb Adrian Klaver : > > On 05/16/2018 11:07 AM, Philipp Kraus wrote: >> Hello, >> I have defined a SQL function >> CREATE OR REPLACE FUNCTION substancetrivialname(text) >> RETURNS substance >> LANGUAGE 'sql&

sql function with empty row

2018-05-16 Thread Philipp Kraus
Hello, I have defined a SQL function CREATE OR REPLACE FUNCTION substancetrivialname(text) RETURNS substance LANGUAGE 'sql' COST 100 VOLATILE AS $BODY$ select s.* from substancetrivialname n join substance s on s.id = n.idsubstance where lower(btrim(n.name)) = lower

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 signed with OpenPGP using GPG

array_agg to array

2018-05-15 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, '[0-9]*[A-Z][a-z]?\d*|\((?:[^()]*(?:\(.*\))?[^()]*)

Re: cursor empty

2018-05-08 Thread Philipp Kraus
Am 08.05.2018 um 16:18 schrieb David G. Johnston mailto:david.g.johns...@gmail.com>>: On Tue, May 8, 2018 at 6:36 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: select * from vectorize('myvec'); fetch all from myvec; Can you explain me, which part is wrong? I am going to say: p

cursor empty

2018-05-08 Thread Philipp Kraus
Hello, I have got a function with this definition: CREATE OR REPLACE FUNCTION vectorize(refcursor) RETURNS SETOF refcursor LANGUAGE 'plpgsql' COST 100 STABLE ROWS 1000 AS $BODY$ begin perform pivottable( '_vector', 'select * from vi

Re: void function and view select

2018-05-07 Thread Philipp Kraus
Thanks a lot for this answer. Am 07.05.2018 um 16:06 schrieb David G. Johnston mailto:david.g.johns...@gmail.com>>: On Mon, May 7, 2018 at 6:52 AM, Philipp Kraus mailto:philipp.kr...@tu-clausthal.de>> wrote: Hello, I have got a complex query with a dynamic column result e

void function and view select

2018-05-07 Thread Philipp Kraus
Hello, I have got a complex query with a dynamic column result e.g.: select builddata('_foo‘); select * from _foo; The first is a plsql function which creates a temporary table, but the function returns void. The second call returns all the data from this table. But the columns of the temporar

Re: postgres with graph model

2018-04-19 Thread Philipp Kraus
Am 19.04.2018 um 18:42 schrieb Fabrízio de Royes Mello mailto:fabri...@timbira.com.br>>: Em qui, 19 de abr de 2018 às 11:54, Philipp Kraus mailto:philipp.kr...@tu-clausthal.de>> escreveu: Hello, I’m using in a project Postgresql and PostGIS for a geospatial data model, but now I

postgres with graph model

2018-04-19 Thread Philipp Kraus
Hello, I’m using in a project Postgresql and PostGIS for a geospatial data model, but now I need also a graph in this structure, so my question is, is there any existing extension for Postgres to build a graph. I found ltree but this is for tree structures only, not for graphs. In general I hav