Re: [GENERAL] Problem with Memory Leak

2010-03-26 Thread Tom Lane
Pete Kay pete...@gmail.com writes: I am setting up a connection pooling obj to pool a bunch of PGConnection object. That is why I am not closing the PGConn object when the query is done. Is that the right way to do it? Well, that's fine, but you should not be complaining about some memory

Re: [GENERAL] Avoiding deadlocks on mass delete / update

2010-03-26 Thread Роман Маширов
Craig Ringer wrote: Роман Маширов wrote: I've got a simple 'spool' table, one process 'worker' reads and updates this table, other 'stat' performs 'delete ... where ... returning *'. Sometimes I've got dedlocks on delete operation in 'stat', seems like at the moment of expiration

[GENERAL] Invitation to connect on LinkedIn

2010-03-26 Thread Paresh Masani
LinkedIn Paresh Masani requested to add you as a connection on LinkedIn: -- Andrew, I'd like to add you to my professional network on LinkedIn. - Paresh Accept invitation from Paresh Masani

Re: [GENERAL] Large index operation crashes postgres

2010-03-26 Thread Frans Hals
Operation is now running for around 13 hrs. Two postmaster processes above 1% memory usage are running. One of them uses constantly 26.5% of memory. The other one is growing: After 1 hr25% After 9 hrs 59% After 13 hrs64% Thanks regards Frans 2010/3/25 Frans Hals

[GENERAL] How to write Rules on a View to allow all actions as in the physical table?

2010-03-26 Thread Andre Lopes
Hi, I have one problem with a view and his rules. Ok, I have a table to store Session data, the structure is this: [code] CREATE TABLE cti_sessions ( session_id varchar(40) NOT NULL DEFAULT 0, ip_address varchar(16) NOT NULL DEFAULT 0, user_agent varchar(50) NOT NULL,

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Alan McKay
On Thu, Mar 25, 2010 at 4:04 PM, Merlin Moncure mmonc...@gmail.com wrote: There is very little reason to do this.  both postgres and the operating system cache frequently used pages in memory already and they are pretty smart about it -- this leaves more memory for temporary demands like

[GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Rajan, Pavithra
Hello - I have this table with 90 rows, which contains 2 columns ,column A (type 'numeric') and column B(type text) . Column 'A' is filled with a constant number and column 'B' has an unique entry for each row. E.g. A B (numeric)(text)

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Alan McKay
On Thu, Mar 25, 2010 at 4:15 PM, Scott Marlowe scott.marl...@gmail.com wrote: These questions always get the first question back, what are you trying to accomplish?  Different objectives will have different answers. We have a real-time application that processes data as it comes in. Doing some

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Ozz Nixon
On 3/26/10 10:06 AM, Alan McKay wrote: On Thu, Mar 25, 2010 at 4:15 PM, Scott Marlowescott.marl...@gmail.com wrote: These questions always get the first question back, what are you trying to accomplish? Different objectives will have different answers. We have a real-time

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Szymon Guz
2010/3/26 Rajan, Pavithra raj...@coned.com Hello - I have this table with 90 rows, which contains 2 columns ,column A (type 'numeric') and column B(type text) . Column 'A' is filled with a constant number and* column 'B' has an unique entry for each row*. E.g. A

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Rajan, Pavithra
Hello , Yes -I need to get the exact the same result as you had listed.Thanks. From: Timo Klecker [mailto:klec...@decoit.de] Sent: Friday, March 26, 2010 10:12 AM To: Rajan, Pavithra ; pgsql-general@postgresql.org Subject: AW: [GENERAL] Need help on

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Timo Klecker
Hello, what do you expect as Result? Something like this? E.g. A B (numeric)(text) 06959.0 002 15308.0 003 15968.0 004 18916.0 011 19961.0

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Thom Brown
On 26 March 2010 13:47, Rajan, Pavithra raj...@coned.com wrote: Hello - I have this table with 90 rows, which contains 2 columns ,column A (type 'numeric') and column B(type text) . Column 'A' is filled with a constant number and column 'B' has an unique entry for each row. E.g. 

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Alan McKay
On Fri, Mar 26, 2010 at 10:14 AM, Ozz Nixon ozzni...@gmail.com wrote: I have to ask the obvious question... as we develop solutions which must process 100,000 queries a second. In those cases, we use a combination hash table and link-lists. There are times where SQL is not the right choice, it

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Grzegorz Jaśkiewicz
create temporary table, insert your data, and than run update with join against the table you wish to modify. And than drop your temp table. simple.

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Gordan Bobic
Alan McKay wrote: On Thu, Mar 25, 2010 at 4:15 PM, Scott Marlowe scott.marl...@gmail.com wrote: These questions always get the first question back, what are you trying to accomplish? Different objectives will have different answers. We have a real-time application that processes data as it

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Timo Klecker
Hi again, are there oids in your table or do you have any possibility to assure the mentioned order of your data lines when you do a select? If you can assure the order, you could use the temp table solution mentioned by Grzegorz Jaśkiewicz. If you cannot assure the order this could

[GENERAL] Solid State Drives with PG (was: in RAM DB)

2010-03-26 Thread Alan McKay
Have you considered using one of these: http://www.acard.com/english/fb01-product.jsp?idno_no=270prod_no=ANS-9010type1_title= Solid State Drivetype1_idno=13 We did some research which suggested that performance may not be so great with them because the PG engine is not optimized to utilize

[GENERAL] Using readline for frequently used queries

2010-03-26 Thread Tim Landscheidt
Hi, depending on the database, I use some dashboard queries rather frequently. To ease executing them, I've put: | $include /etc/inputrc | $if psql | \e[24~: \fSELECT * FROM DashboardQuery;\n | $endif in my ~/.inputrc (\e[24~ is [F12]). Obviously, this only works if a) the current line and

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Szymon Guz
W dniu 26 marca 2010 15:21 użytkownik Grzegorz Jaśkiewicz gryz...@gmail.com napisał: create temporary table, insert your data, and than run update with join against the table you wish to modify. And than drop your temp table. simple. It would be a nice solution, assuming that we know

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Grzegorz Jaśkiewicz
you can't really do any updates sensibly unless you know what the relation is. So, I kind of silently assume that you know that.

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Timo Klecker
Hello, you could use an plpgsql function: CREATE OR REPLACE FUNCTION update(numeric[]) RETURNS void AS $BODY$ declare data alias for $1; table_obj record; I integer; Begin i:=0; for table_obj in execute select * from TABLENAME order by THE_ORDER loop

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Rajan, Pavithra
Yes thanks -I am trying to figure writing out a script that will do the update than doing individual inserts or update.I'll try this idea. From: Timo Klecker [mailto:klec...@decoit.de] Sent: Friday, March 26, 2010 10:51 AM To: Rajan, Pavithra ;

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread John Gage
As a kind of [very?] dumb question, is this where SQLite has been used? I am just curious. On Mar 26, 2010, at 3:14 PM, Ozz Nixon wrote: On 3/26/10 10:06 AM, Alan McKay wrote: On Thu, Mar 25, 2010 at 4:15 PM, Scott Marlowescott.marl...@gmail.com wrote: These questions always get the

[GENERAL] Error 42501 permission denied for schema

2010-03-26 Thread akp geek
Dear all I have 2 schemas , schema1 and schema 2. 1. GRANT USAGE ON SCHEMA schema1 TO schema2; I am trying to create a function in shema2, In that function I need to access some tables from schema1. p I am getting the following error when I compile the function Search path set to

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Merlin Moncure
On Fri, Mar 26, 2010 at 10:06 AM, Alan McKay alan.mc...@gmail.com wrote: We are trying a test right now where initdb was run against /ramdisk/data so that absolutely everything should be in there.  Will report back with results. We are also about to try another test with a regular disk-based

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Ozz Nixon
On 3/26/10 11:12 AM, John Gage wrote: As a kind of [very?] dumb question, is this where SQLite has been used? I am just curious. All questions are good ones, as that is how we all learn. ;-) SQLite is useful for small foot print environments, along with simpler solutions like XBase (DBase)

Re: [GENERAL] Error 42501 permission denied for schema

2010-03-26 Thread Tom Lane
akp geek akpg...@gmail.com writes: I have 2 schemas , schema1 and schema 2. 1. GRANT USAGE ON SCHEMA schema1 TO schema2; You seem to be confusing schemas and users --- they are not the same thing at all. The above grants the right to lookup objects in schema1 to the user (a/k/a role) named

Re: [GENERAL] Error 42501 permission denied for schema

2010-03-26 Thread akp geek
Sorry for the confusion that I have caused - roles role1 , role2 - schemas schema1, schema2 - GRANT USAGE ON SCHEMA schema1 TO role2; - create function fnc_name(IN i_id numeric) - function is created using role2 I ended up getting the error ERROR: permission denied for

Re: [GENERAL] Large index operation crashes postgres

2010-03-26 Thread Tom Lane
Frans Hals fha...@googlemail.com writes: Operation is now running for around 13 hrs. Two postmaster processes above 1% memory usage are running. One of them uses constantly 26.5% of memory. The other one is growing: After 1 hr25% After 9 hrs 59% After 13 hrs64% Well, it's

Re: [GENERAL] Large index operation crashes postgres

2010-03-26 Thread Paul Ramsey
Occams razor says it's PostGIS. However, I'm concerned about how old the code being run is. In particular, the library underneath PostGIS, GEOS, had a *lot* of memory work done on it over the last year. I'd like to see if things improve if you upgrade to GEOS 3.2. On Fri, Mar 26, 2010 at 9:04 AM,

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread John Gage
Thanks very, very much for this reply. It is extremely useful. So far, I have not run into anything remotely resembling a performance barrier in Postgres. I'm still looking :-) On Mar 26, 2010, at 4:43 PM, Ozz Nixon wrote: On 3/26/10 11:12 AM, John Gage wrote: As a kind of [very?]

Re: [GENERAL] Need help on updating an entire column with a list of values, I have.

2010-03-26 Thread Rajan, Pavithra
Hello all - Thanks for all your inputs and Klecker's script.Slightly tweaked the script, with Bryan's help to implement it. CREATE OR REPLACE FUNCTION update(numeric[]) RETURNS void AS $BODY$ declare data alias for $1; table_obj record; I integer; Begin i:=1;

Re: [GENERAL] Solid State Drives with PG (was: in RAM DB)

2010-03-26 Thread Merlin Moncure
On Fri, Mar 26, 2010 at 10:32 AM, Alan McKay alan.mc...@gmail.com wrote: Have you considered using one of these: http://www.acard.com/english/fb01-product.jsp?idno_no=270prod_no=ANS-9010type1_title= Solid State Drivetype1_idno=13 We did some research which suggested that performance may not

[GENERAL] round(x) function

2010-03-26 Thread Gaietti, Mauro (SELEX GALILEO Guest, Italy)
This query: select round(0.5), round(0.5::integer), round(0.5::bigint), round( 0.5::float ), round( 0.5::double precision ),round(cast(0.5 as double precision )),round(cast(0.5::double precision as numeric )); has strange result: 1 1 1 0 0 0 1 Is this correct? My expected result is 1 1 1 1

Re: [GENERAL] round(x) function

2010-03-26 Thread Tom Lane
Gaietti, Mauro \(SELEX GALILEO Guest, Italy\) mauro.gaie...@guests.selexgalileo.com writes: This query: select round(0.5), round(0.5::integer), round(0.5::bigint), round( 0.5::float ), round( 0.5::double precision ),round(cast(0.5 as double precision )),round(cast(0.5::double precision as

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread John R Pierce
Chris Barnes wrote: We are testing in memory postgres database and have questions about configuring the ram mount point and whether there is great gains in setting it up this way? Are there any considerations for postgres? If you have experience, can you please give us some ideas on

Re: [GENERAL] round(x) function

2010-03-26 Thread Justin Graf
On 3/26/2010 12:12 PM, Tom Lane wrote: Gaietti, Mauro \(SELEX GALILEO Guest, Italy\)mauro.gaie...@guests.selexgalileo.com writes: This query: select round(0.5), round(0.5::integer), round(0.5::bigint), round( 0.5::float ), round( 0.5::double precision ),round(cast(0.5 as double

Re: [GENERAL] Does anyone use in ram postgres database?

2010-03-26 Thread Chris Barnes
I just looked into timesten, at 46K for perpetual licence or 10k for yearly plus support. Is there anything else available? LOL Chris Date: Fri, 26 Mar 2010 10:39:37 -0700 From: pie...@hogranch.com To: compuguruchrisbar...@hotmail.com CC: pgsql-general@postgresql.org Subject:

Re: [GENERAL] Error 42501 permission denied for schema

2010-03-26 Thread Tom Lane
akp geek akpg...@gmail.com writes: Sorry for the confusion that I have caused - roles role1 , role2 - schemas schema1, schema2 - GRANT USAGE ON SCHEMA schema1 TO role2; - create function fnc_name(IN i_id numeric) - function is created using role2 I ended up getting the

[GENERAL] Moving data directory from one server to another

2010-03-26 Thread Ehsan Haq
Hi,    I have two Linux servers both having same Hardware architecture one have ES5 and the other having ES4. Both the servers have same version of PostGres installed (8.3). I want to move all my DBs from ES5 server to ES4 server. I have tried the pg_dump but there are a lot of encoding

Re: [GENERAL] Warm Standby Setup Documentation

2010-03-26 Thread Greg Smith
Bryan Murphy wrote: The one thing you should be aware of is that when you fail over, your spare has no spares. I have not found a way around this problem yet. So, when you fail over, there is a window where you have no backups while you're building the new spares. This can be pretty nerve

Re: [GENERAL] Solid State Drives with PG

2010-03-26 Thread Greg Smith
Merlin Moncure wrote: So flash isn't yet a general purpose database solution, and wont be until the write performance problem is fixed in a way that doesn't compromise on volatility. Flash drives that ship with a supercapacitor large enough to ensure orderly write cache flushing in the event

Re: [GENERAL] Warm Standby Setup Documentation

2010-03-26 Thread Ogden
On Mar 26, 2010, at 1:32 PM, Greg Smith wrote: Bryan Murphy wrote: The one thing you should be aware of is that when you fail over, your spare has no spares. I have not found a way around this problem yet. So, when you fail over, there is a window where you have no backups while you're

[GENERAL] Storing data on a regular lat/lon grid

2010-03-26 Thread Mike Charles
Hi all, I have temperature data that has been interpolated to a regular lat/lon grid. I have one grid per day. I want to be able to select points within a certain region, and within a certain time period. Now, I could store each grid point as a separate record (a new row for every single

Re: [GENERAL] Solid State Drives with PG

2010-03-26 Thread Merlin Moncure
On Fri, Mar 26, 2010 at 2:32 PM, Greg Smith g...@2ndquadrant.com wrote: Merlin Moncure wrote: So flash isn't yet a general purpose database solution, and wont be until the write performance problem is fixed in a way that doesn't compromise on volatility. Flash drives that ship with a

Re: [GENERAL] Storing data on a regular lat/lon grid

2010-03-26 Thread Merlin Moncure
On Fri, Mar 26, 2010 at 3:25 PM, Mike Charles gamemusicma...@gmail.com wrote: Hi all, I have temperature data that has been interpolated to a regular lat/lon grid. I have one grid per day. I want to be able to select points within a certain region, and within a certain time period. Now, I

Re: [GENERAL] Solid State Drives with PG

2010-03-26 Thread Brad Nicholson
On Fri, 2010-03-26 at 15:27 -0400, Merlin Moncure wrote: On Fri, Mar 26, 2010 at 2:32 PM, Greg Smith g...@2ndquadrant.com wrote: Merlin Moncure wrote: So flash isn't yet a general purpose database solution, and wont be until the write performance problem is fixed in a way that doesn't

Re: [GENERAL] Solid State Drives with PG

2010-03-26 Thread Merlin Moncure
On Fri, Mar 26, 2010 at 3:43 PM, Brad Nicholson bnich...@ca.afilias.info wrote: I'm not sure what the price point is though. here is a _used_ 320gb ramsan for 15k :-). dram storage is pricey. merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

R: [GENERAL] round(x) function

2010-03-26 Thread Gaietti, Mauro (SELEX GALILEO Guest, Italy)
I think this is not consistent with documentation that says there is just one round function, with one argument of numeric type. It seems there is at least 2 different round functions with two different behaviours. One for float4/float8 that round to nearest even and another one for numeric

Re: R: [GENERAL] round(x) function

2010-03-26 Thread Tom Lane
Gaietti, Mauro \(SELEX GALILEO Guest, Italy\) mauro.gaie...@guests.selexgalileo.com writes: I think this is not consistent with documentation that says there is just one round function, with one argument of numeric type. The documentation you're quoting says there is just one round function

Re: [GENERAL] Warm Standby Setup Documentation

2010-03-26 Thread Bryan Murphy
On Fri, Mar 26, 2010 at 1:32 PM, Greg Smith g...@2ndquadrant.com wrote: If there's another server around, you can have your archive_command on the master ship to two systems, then use the second one as a way to jump-start this whole process. After fail-over, just start shipping from the new

[GENERAL] Connection Pooling

2010-03-26 Thread David Kerr
Howdy all, I have some apps that are connecting to my DB via direct JDBC and I'd like to pool their connections. I've been looking at poolers for a while, and pgbouncer and pgpool-ii seem to be some of the most popular, so i've started with those. I'm setting up pgbouncer, and i've hit a bit

Re: [GENERAL] Large index operation crashes postgres

2010-03-26 Thread Frans Hals
Tom, I'm pretty new to memory debugging, so please be patient if I'm not as precise as you suppose me to be. For the records I have run a valgrind postmaster session, starting my initial indexing routine until it crashes postgres. If you think this might be enlightning for you, I'll send you the

Re: [GENERAL] Large index operation crashes postgres

2010-03-26 Thread Frans Hals
The index mentioned below has been created in some minutes without problems. Dropped it and created it again. Uses around 36 % of memorywhile creating, after completion postmaster stays at 26 %. I'm not sure, what you're thinking about generating a self-contained test that exhibits similar