Re: [GENERAL] [HACKERS] optimization join on random value

2015-05-04 Thread Martijn van Oosterhout
On Mon, May 04, 2015 at 12:15:54AM +0300, Anton wrote: Hello guru of postgres, it's possoble to tune query with join on random string ? i know that it is not real life example, but i need it for tests. soe=# explain soe-# SELECT ADDRESS_ID, soe-# CUSTOMER_ID, soe-#

Re: [GENERAL] [HACKERS] optimization join on random value

2015-05-04 Thread Anton
Yahooo ! Many thanks ! soe=# explain EXECUTE test( random()*45000 ); QUERY PLAN - Index Scan using addresses_cust_ix on addresses (cost=0.43..16.48 rows=3 width=84)

Re: [GENERAL] Errors using JDBC batchUpdate with plpgsql function

2015-05-04 Thread Hannes Erven
Hi, String sql = select test_user_result_insert_func(?, ?, ?);; You can't call functions via JDBC like that. You need to use: CallableStatement cs = connection.prepareCall({call func(?,?,?)}); // Loop starts... cs.clearParameters(); cs.setString(1, foo); cs.setString(2, bar);

Re: [GENERAL] Errors using JDBC batchUpdate with plpgsql function

2015-05-04 Thread Thomas Kellerer
Hannes Erven schrieb am 04.05.2015 um 12:31: Hi, String sql = select test_user_result_insert_func(?, ?, ?);; You can't call functions via JDBC like that. That's perfectly valid - unless the function uses out parameters or ref cursors. I am however unsure about batched

Re: [GENERAL] Errors using JDBC batchUpdate with plpgsql function

2015-05-04 Thread Dave Cramer
The logs from the server would be useful Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On 4 May 2015 at 07:05, Thomas Kellerer spam_ea...@gmx.net wrote: Hannes Erven schrieb am 04.05.2015 um 12:31: Hi, String sql = select test_user_result_insert_func(?, ?,

Re: [GENERAL] Setting up a database for 10000 concurrent users

2015-05-04 Thread sanjeetkamble
Hello, Please let me know how The database server is started with max_connections = 1 ??? I have same issue, but i have a SAN storage where Postgresql is installed. Sanjeet -- View this message in context:

Re: [GENERAL] Setting up a database for 10000 concurrent users

2015-05-04 Thread Andy Colson
On 05/04/2015 02:02 AM, sanjeetkamble wrote: Hello, Please let me know how The database server is started with max_connections = 1 ??? I have same issue, but i have a SAN storage where Postgresql is installed. Sanjeet No doubt that would be a problem. Its bad idea. set

Re: [GENERAL] Setting up a database for 10000 concurrent users

2015-05-04 Thread Melvin Davidson
I suggest pg_bouncer as opposed to pg_pool. My testing showed it handled connections better. Ultimately the choice is yours, but with 1 connections, you absolutely need a connection manger. On Mon, May 4, 2015 at 10:08 AM, Andy Colson a...@squeakycode.net wrote: On 05/04/2015 02:02 AM,

Re: [GENERAL] Setting up a database for 10000 concurrent users

2015-05-04 Thread Andy Colson
On 05/04/2015 02:02 AM, sanjeetkamble wrote: Hello, Please let me know how The database server is started with max_connections = 1 ??? I have same issue, but i have a SAN storage where Postgresql is installed. Sanjeet On Mon, May 4, 2015

Re: [GENERAL] Removing and readding bdr nodes

2015-05-04 Thread Mathew Moon
Hi Craig, Thank you for your reply. Below you will see the entire process that I have used along with relevant log output. Something else that I have noticed is that the status of nodes in bdr.bdr_nodes stays 'i' on the first server that I initialize (lets call it primary and the others backups

Re: [GENERAL] Limiting user from changing its own attributes

2015-05-04 Thread Sameer Kumar
Sorry about the long silence on this. On Mon, Apr 13, 2015 at 3:34 PM David G. Johnston david.g.johns...@gmail.com wrote: On Sun, Apr 12, 2015 at 10:23 PM, Sameer Kumar sameer.ku...@ashnik.com wrote: On Mon, Apr 13, 2015 at 1:03 PM Jim Nasby jim.na...@bluetreble.com wrote: No. I suspect

Re: [GENERAL] plpgsql functions organisation

2015-05-04 Thread Jan de Visser
On May 4, 2015 02:32:14 PM Yves Dorfsman wrote: As for performance concerns, in 99% of cases code maintainability is going to be way more important than performance microoptimization. If you're *that* concerned about performance than plpgsql probably isn't the right answer anyway. Isn't

Re: [HACKERS] [GENERAL] Insert result does not match record count

2015-05-04 Thread mark
Did this every go any further? I wrote some data transformation script at work, and after seeing with count -2017657667 (and similar) in my scripts log I got a bit worried. seeing else where were folks just run a full on count(*) later to check counts but that is even MORE time and I was

Re: [GENERAL] Errors using JDBC batchUpdate with plpgsql function

2015-05-04 Thread Nanker Phelge
The database function does not use out parameters or a ref cursor, which was why I was confused. The Java sample I provided is a simplification of the built-in default logic of the Spring Batch ItemWriter - I put it into my own implementation class to help with debugging. The root cause seems to

Re: [GENERAL] PostgreSQL HA config recommendations

2015-05-04 Thread Jim Nasby
On 4/30/15 1:23 PM, Greg Sabino Mullane wrote: Bucardo and pg_pool are both based on the idea of replaying SQL statements instead of replicating actual data. They have their uses, but I personally distrust that idea, especially for DR. Actually, Bucardo is very data-based, not statement at

Re: [GENERAL] plpgsql functions organisation

2015-05-04 Thread Jim Nasby
On 5/2/15 2:32 PM, Adrian Klaver wrote: On 05/02/2015 09:53 AM, Yves Dorfsman wrote: I find my plpgsql functions becomes unreadable very quickly. I want to break them up in smaller functions. What is the best way to organised them? Is there any way to define functions inside functions? When I

Re: [GENERAL] plpgsql functions organisation

2015-05-04 Thread Yves Dorfsman
As for performance concerns, in 99% of cases code maintainability is going to be way more important than performance microoptimization. If you're *that* concerned about performance than plpgsql probably isn't the right answer anyway. Isn't one of the advantage of running on the server to

Re: [GENERAL] Removing and readding bdr nodes

2015-05-04 Thread Mathew Moon
I just realized this also. The node that was removed and recreated shows only one replication slot once it is recreated. That slot has its own id in it too. That appears to be the problem. I have no idea why when creating it the first time the slots for the other two nodes are created correctly,

Re: [GENERAL] Limiting user from changing its own attributes

2015-05-04 Thread David G. Johnston
On Mon, May 4, 2015 at 10:23 PM, Sameer Kumar sameer.ku...@ashnik.com wrote: Sorry about the long silence on this. On Mon, Apr 13, 2015 at 3:34 PM David G. Johnston david.g.johns...@gmail.com wrote: On Sun, Apr 12, 2015 at 10:23 PM, Sameer Kumar sameer.ku...@ashnik.com wrote: On Mon,