[ADMIN] Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)

2012-12-13 Thread Haifeng Liu
Hi,

I have a DB writer program written in Java, it do batch updates, and will try 
to update each record in a batch if it failed. I think no any record in a batch 
will be update if the batch failed, but weirdly I found a few records update 
twice(very little amount among all records). 

Well, there is less stuff about postgresql jdbc driver. I wanna know if 
executeBatch really keep all the records in a batch untouched when the batch 
failed. Any help is appreciate.

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[ADMIN] pooler/router?

2012-12-13 Thread Bèrto ëd Sèra
Hi all,

I have a customer who needs to split a set of pg databases that have
outgrown any possible big iron and needs to do it quick, at zero
impact on lots of existing and basically undocumented applications.

I was wondering whether there is anything I can drop in as a
middleware, that will get any incoming connections to oldserver:5432
and reroute them to a set of individual boxes, based on the targeted
database. PgPooler + routing, sort of.

Any hint is greatly appreciated.
Cheers
Bèrto

-- 
==
If Pac-Man had affected us as kids, we'd all be running around in a
darkened room munching pills and listening to repetitive music.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] pooler/router?

2012-12-13 Thread Gabriele Bartolini

Hi Bèrto,

On Thu, 13 Dec 2012 12:39:28 +, Bèrto ëd Sèra 
berto.d.s...@gmail.com wrote:

I was wondering whether there is anything I can drop in as a
middleware, that will get any incoming connections to 
oldserver:5432

and reroute them to a set of individual boxes, based on the targeted
database. PgPooler + routing, sort of.


With pgbouncer you can create virtual databases and map them on 
different hosts. It is very light and open source: 
http://wiki.postgresql.org/wiki/PgBouncer


Cheers,
Gabriele
--
 Gabriele Bartolini - 2ndQuadrant Italia
 PostgreSQL Training, Services and Support
 gabriele.bartol...@2ndquadrant.it - www.2ndQuadrant.it


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)

2012-12-13 Thread Kevin Grittner
Haifeng Liu wrote:

 I wanna know if executeBatch really keep all the records in a
 batch untouched when the batch failed.

I recommend asking on the pgsql-jdbc list. You might want to
mention what autoCommit is set to during the attempt.

-Kevin


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[ADMIN] allow a user to see current_query in pg_stat_activity in 8.4

2012-12-13 Thread Greg Williamson
This seems like a question whose answer must be right in front of me, but I am 
not seeing it.

We want to create a role used by a monitor to check for IDLE in Transaction 
with the most restrictive permissions we can on a 8.4.13 instance.

The user has been granted connect privilege to the database and some limited 
permissions to user tabhles that need to be monitored. But pg_stat_activity 
shows only insufficient privilege

I've trolled the archives and postgres docs with no success.

Could some kind soul point me in the right direction ?

Thanks!

Greg Williamson

Re: [ADMIN] allow a user to see current_query in pg_stat_activity in 8.4

2012-12-13 Thread Tom Lane
Greg Williamson gwilliamso...@yahoo.com writes:
 We want to create a role used by a monitor to check for IDLE in 
 Transaction with the most restrictive permissions we can on a 8.4.13 
 instance.

 The user has been granted connect privilege to the database and some limited 
 permissions to user tabhles that need to be monitored. But pg_stat_activity 
 shows only insufficient privilege

Yup.  You can only see the query of another session if (1) you are a
superuser, or (2) you are the same user the other session is logged in
as.  Table permissions have nothing to do with this.

regards, tom lane


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] allow a user to see current_query in pg_stat_activity in 8.4

2012-12-13 Thread Greg Williamson
Tom --


Greg Williamson gwilliamso...@yahoo.com writes:
 We want to create a role used by a monitor to check for IDLE in 
 Transaction with the most restrictive permissions we can on a 8.4.13 
 instance.

 The user has been granted connect privilege to the database and some limited 
 permissions to user tabhles that need to be monitored. But pg_stat_activity 
 shows only insufficient privilege

Yup.  You can only see the query of another session if (1) you are a
superuser, or (2) you are the same user the other session is logged in
as.  Table permissions have nothing to do with this.



Thanks for the swi8ft answer even if wasn't the one I was hoping for. ;-}

Another solution suggests itself then ... thanks!

Greg



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin