Re: [SQL] [ADMIN] PostgreSQL Active-Active Configuration

2010-03-05 Thread Devrim GÜNDÜZ
On Fri, 2010-03-05 at 09:20 +0100, Iñigo Martinez Lasala wrote:
> For example, if you use functions or sentences that make use of
> timestamp, random, etc it won't be possible to use pg_pool since each
> node will have a different value.
> If not, it could probably work for you. 

FWIW, timestamps are rewritten in recent pgpool versions to avoid such
issues.

However, similar problems exist for serial, etc.

-HTH.
-- 
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz


signature.asc
Description: This is a digitally signed message part


[SQL] client_timezone to server_timezone and reverse

2010-03-05 Thread silly sad

HELO

i am looking for strange things:
a timezone conversion AS transparent AS a charset encoding conversion are.

for __example__ (not intending to override the current behavior)

i want to see now()::timestampTZ always the same
(the server side time with the timezone predefined firmly)

and to see now()::timeztamp calculated according to the client_timezone 
setting whatever the user set it to.


In addition to the current behavior it whould be NICE to
cast timestamTZ to timestamp taking in account a shift between server 
and client time, if client specified his TZ.



--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] PostgreSQL Active-Active Configuration

2010-03-05 Thread Plugge, Joe R.
You may want to try Bucardo ...   By performance, are you referring to latency? 
 If so, bandwidth between sites typically is the factor with latency in any 
replication solution.

http://bucardo.org/


-Original Message-
From: [email protected] [mailto:[email protected]] On 
Behalf Of Dave Clements
Sent: Friday, March 05, 2010 1:25 AM
To: [email protected]; pgsql-sql
Subject: [SQL] PostgreSQL Active-Active Configuration

Hi everyone,

I am looking for some Master-Master replication solutions for
PostgreSQL database. Please let me know if you are using one and if
you are happy with the performance.



Thanks

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] Does IMMUTABLE property propagate?

2010-03-05 Thread Petru Ghita
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Given f1(x) as IMMUTABLE and f2(x) as IMMUTABLE, and f3(f1,f2) as
IMMUTABLE, does the query planner cache the result of f3 and reuse it
or if you want to get a little more speed you better explicitly define
yourself f3 as IMMUTABLE?

I had an aggregate query like:

select id,
   sum(p1*f1(a)/f2(b) as r1,
   sum(p2*f1(a)/f2(b) as r2,
   ...
   sum(pn*f1(a)/f2(b) as rn

...
group by id;

Where f1(x) and f2(x) were defined as IMMUTABLE.

By the experiments I ran looks like after defining a new function
f3(a,b):= f1(a)/f2(b) and rewriting the query as:

select id,
   sum(p1*f3(a,b) as r1,
   sum(p2*f3(a,b) as r2,
   ...
   sum(pn*f3(a,b) as rn

...
group by id;

*Looks like* I got a little (5%) improvement in performance of the
query. Is there a way to find out if the function is re-evaluated each
time?
Is this the recommended way to proceed?

Thank you!

Petru Ghita
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iEYEARECAAYFAkuRwYQACgkQt6IL6XzynQTHEgCffi2QMWkkvTIsuglsanvcUyRB
I+wAoKr22B7FJJVDCssGKGwB8zr4NjQG
=V/BS
-END PGP SIGNATURE-


-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql