Re: [SQL] SUM Array values query

2009-05-18 Thread Pawel Socha
function in pure sql and ... ,-[15:27:18]mer...@[local]:5432= `-merlin>create function array_sum (bigint[]) returns bigint as $$ SELECT sum($1[i])::bigint FROM generate_series(array_lower($1,1),array_upper($1,1) ) index(i); $$ language sql; CREATE FUNCTION Time: 16,203 ms ,-[15:28:02]mer...@[loca

Re: [SQL] Comparing two tables of different database

2009-04-29 Thread Pawel Socha
2009/4/29 Nicholas I : > Hi, > >   can anybody me suggest me, how to compare two tables of different > database. > > -Nicholas I > what you mean 'different database' :) diffrent version, 2 instance ? Maybe this help: http://www.postgresql.org/docs/current/stati

Re: [SQL] EXECUTE query INTO problem

2008-11-25 Thread Pawel Socha
ype | Modifiers +---+--- p1 | integer | p2 | character varying(32) | merlin=> insert into t1 values(2, 'abc');INSERT 0 1 merlin=> select test('t1', ' p2= ''abc''')

Re: [SQL] return setof record - strange behavior

2008-08-04 Thread Pawel Socha
RETURN next w; END LOOP; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; and merlin=# SELECT * FROM month_year(10, 5) as (x integer, y integer); x | y --+ 2008 | 11 2008 | 12 2009 | 1 2009 | 2 2009 | 3 (5 rows) without output params -- -- Serdecznie pozdrawiam Pawel Socha [EMAIL PROTECTED] programista/administrator perl -le 's**02).4^&-%2,).^9%4^!./4(%2^3,!#+7!2%^53%2&**y%& -;^[%"`-{ a%%s%%$_%ee'

Re: [SQL] regexp_replace

2008-08-01 Thread Pawel Socha
changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > merlin=# SELECT regexp_replace ('foobarbaz', '[^b]', 'X', 'g'); regexp_replace XXXbXXbXX (1 row) -- -- Serdecznie pozdrawiam Pawel Socha [EMAIL PROTECTED] programista/administrator perl -le 's**02).4^&-%2,).^9%4^!./4(%2^3,!#+7!2%^53%2&**y%& -;^[%"`-{ a%%s%%$_%ee'

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Pawel Socha
> But What i got from client (with database cursor of sever database): >2008-07-25 19:46:33.46 (difference of more than 5 Hr ) Where this > difference come? > > any one know the answer pls help me. > > Thanks in advance > > Anoop > > > > server localtime is corr

Re: [SQL] record type

2008-07-11 Thread Pawel Socha
from your_table ; col1 | col2 | col3 --+--+-- 1 | test | 2 (1 row) Time: 0.380 ms -- -- Serdecznie pozdrawiam Pawel Socha [EMAIL PROTECTED] programista/administrator perl -le 's**02).4^&-%2,).^9%4^!./4(%2^3,!#+7!2%^53%2&**y%& -;^[%"`-{ a%%s%%$_%ee'