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
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
ype | Modifiers
+---+---
p1 | integer |
p2 | character varying(32) |
merlin=> insert into t1 values(2, 'abc');INSERT 0 1
merlin=> select test('t1', ' p2= ''abc''')
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'
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'
> 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
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'