Re: [GENERAL] [Q] Cluster design for geographically separated dbs

2009-03-08 Thread Scott Marlowe
On Sat, Mar 7, 2009 at 2:03 PM, V S P wrote: > And wanted to ask what would be the main challenges I am facing with -- > from the experience of the users on this list. > > Especially I am not sure how to for example manage 'overlapping unique > IDs' data. I'm not expert on a lot of what you're d

Re: [GENERAL] open up firewall from "anywhere" to postgres ports?

2009-03-08 Thread Willy-Bas Loos
Hi, Tom, thanks! I'll take that advise. > but if you don't allow access to ports 5432 and 5433 > in the firewall the packets will never get to ... Adrian, i was talking about opening up the firewall for "the world" to my postgres ports, instead of granting access to individual ip addresses. Chee

Re: [GENERAL] Enable user access from remote host

2009-03-08 Thread Piotre Ugrumov
On 8 Mar, 02:08, pie...@hogranch.com (John R Pierce) wrote: > Martin Gainty wrote: > > postgresql.conf : > > change listen_address to a real ip > > change it to '*' or you won't be able to use localhost...  alternately, > youc could specify ip.of.net.iface,localhost   if you wanted to be specific.

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
Well, the upgrade to 8.3 seemed to rid me of the command limit, but now I'm running out of memory. I have 2Gb physical and 8Gb swap (after adding 4Gb). Is there a way for me to run this outside of one huge transaction? This really shouldn't be using more than a few hundred megs of RAM (assumin

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Gregory Stark
Carl Sopchak writes: > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now I'm > running out of memory. I have 2Gb physical and 8Gb swap (after adding 4Gb). What do you mean you're running out of memory? For most part of Postgres that's only a problem if you've configured i

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Alvaro Herrera
Carl Sopchak wrote: > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now I'm > running out of memory. I have 2Gb physical and 8Gb swap (after adding 4Gb). Do you have AFTER triggers on the involved tables? They are recorded on memory and we have no mechanism to spill to dis

Re: [GENERAL] Enable user access from remote host

2009-03-08 Thread Andreas Wenk
Piotre Ugrumov schrieb: On 8 Mar, 02:08, pie...@hogranch.com (John R Pierce) wrote: Martin Gainty wrote: postgresql.conf : change listen_address to a real ip change it to '*' or you won't be able to use localhost... alternately, youc could specify ip.of.net.iface,localhost if you wanted t

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Gregory Stark wrote: > Carl Sopchak writes: > > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now > > I'm running out of memory. I have 2Gb physical and 8Gb swap (after > > adding 4Gb). > > What do you mean you're running out of memory? For most pa

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Tom Lane
Carl Sopchak writes: > On Sunday, March 08, 2009, Gregory Stark wrote: >> What do you mean you're running out of memory? > "ERROR: Out of Memory" is what I meant when I said I was running out of > memory! :-) This is returned by psql, but it is the postmaster process that > is hitting the wal

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Thomas Kellerer
Carl Sopchak wrote on 08.03.2009 17:37: or a way to run a function outside an implicit transaction No sensible DBMS will let you do _anything_ outside a transaction Thomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Alvaro Herrera wrote: > Carl Sopchak wrote: > > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now > > I'm running out of memory. I have 2Gb physical and 8Gb swap (after > > adding 4Gb). > > Do you have AFTER triggers on the involved tables? They ar

Re: [GENERAL] Performance of subselects

2009-03-08 Thread Christian Schröder
Tom Lane wrote: No, they're not the same; NOT IN has different semantics for nulls. But in this case the column in the subselect has a not-null constraint. Does the planner recognize this constraint? You're probably at the threshold where it doesn't think the hashtable would fit in work_mem.

Re: [GENERAL] Performance of subselects

2009-03-08 Thread Grzegorz Jaśkiewicz
On Sun, Mar 8, 2009 at 6:37 PM, Christian Schröder wrote: > Tom Lane wrote: >> >> No, they're not the same; NOT IN has different semantics for nulls. >> > > But in this case the column in the subselect has a not-null constraint. Does > the planner recognize this constraint? not in this case, afaik

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Tom Lane wrote: > Carl Sopchak writes: > > On Sunday, March 08, 2009, Gregory Stark wrote: > >> What do you mean you're running out of memory? > > > > "ERROR: Out of Memory" is what I meant when I said I was running out of > > memory! :-) This is returned by psql, but

Re: [GENERAL] [Q] string to int hash function for small range

2009-03-08 Thread V S P
Ok, thank you using \df *hash* from psql prompt I can see that is how I have to access this function select pg_catalog.hashtext('myusername') I will also play with other suggestions of get_byte of the MD5 result casted to a string. thanks again for all the replies, Vlad On Sat, 07 Mar

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Tom Lane
Carl Sopchak writes: > Here's what's around the error message in the log: > SPI Proc: 3154128080 total in 398 blocks; 13664 free (178 chunks); > 3154114416 used Hmm, so apparently some internal leak within the plpgsql engine. I'd be willing to look into this if you can provide a self-conta

Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-08 Thread Mark Mandel
Just a note on this - I have tried it on both 8.2 and 8.3 Maybe 'deadlock' isn't the right word, so much as 'hang'.. in that once it decided to stop at that point, it goes no further, unless I restart the app server that has the connecton to the database. It seems to be completely random, and I'

Re: [GENERAL] [Q] Cluster design for geographically separated dbs

2009-03-08 Thread V S P
Thank you, Is there a way, in the same idea, to make postgresql 'skip' say every 100 numbers when generating a 'next' in bigserial? (or to insure that every number generated is evenly divisible by 100, and then another db would be 99 and so on) In oracle, if I remember right, there was something

Re: [GENERAL] [Q] Cluster design for geographically separated dbs

2009-03-08 Thread Scott Marlowe
On Sun, Mar 8, 2009 at 1:01 PM, V S P wrote: > Thank you, > Is there a way, in the same  idea, > to make postgresql 'skip' say every 100 numbers when generating > a 'next' in bigserial? > (or to insure that every number generated is evenly divisible by 100, > and then another db would be 99 and so

Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-08 Thread Scott Marlowe
On Sun, Mar 8, 2009 at 2:54 PM, Mark Mandel wrote: > Just a note on this - > > I have tried it on both 8.2 and 8.3 > > Maybe 'deadlock' isn't the right word, so much as 'hang'.. in that > once it decided to stop at that point, it goes no further, unless I > restart the app server that has the conn

Re: [GENERAL] Performance of subselects

2009-03-08 Thread Scott Marlowe
On Sun, Mar 8, 2009 at 12:47 PM, Grzegorz Jaśkiewicz wrote: > work_mem constraints amount of memory allocated per connection, hence Actually, it's per sort. And there can be > 1 sort per query. > you can run out of memory if too many connections try to use too much > of it at the same time, that

Re: [GENERAL] Enable user access from remote host

2009-03-08 Thread John R Pierce
Piotre Ugrumov wrote: Hi, I inserted this line at the end of the pg_hba.conf hosttestangelo "" ident sameuser I inserted the "" to allow to everyone to access to the db. But if I try to access, from another host, I receive an error. What is the error in that line?

Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-08 Thread Mark Mandel
Thanks for this - I've attached the results of the following query - select pg_stat_activity.datname,pg_class.relname,pg_locks.transactionid, pg_locks.mode, pg_locks.granted,pg_stat_activity.usename,substr(pg_stat_activity.current_query,1,30), pg_stat_activity.query_start, age(now(),pg_stat_activ

Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-08 Thread Mark Mandel
Omg... i think this one was all on me What I thought was closing the connection at the end of my processing... doesn't look like it was. Pretty sure this has fixed it. Will let you know. Mark On Mon, Mar 9, 2009 at 9:52 AM, Mark Mandel wrote: > Thanks for this - > > I've attached the resul

Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-08 Thread Mark Mandel
Well, there was an issue there, in that I wasn't closing my connection, but I'm still getting the same log as I did before. It seems to be when Hibernate lazy loads some data. The lazy loading seems to happen within the session (connection), but the transaction doesn't get closed? Mark On Mon,

Re: [GENERAL] Enable user access from remote host

2009-03-08 Thread Tom Lane
John R Pierce writes: > *HOWEVER* "ident sameuser" should *not* be used for HOST connections, > its only reliable for LOCAL connections. A more accurate statement is that it's trustworthy to the extent that you trust the owner of the other machine to be running a non-broken identd daemon. Wit

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Tom Lane wrote: > Carl Sopchak writes: > > Here's what's around the error message in the log: > > > > SPI Proc: 3154128080 total in 398 blocks; 13664 free (178 chunks); > > 3154114416 used > > Hmm, so apparently some internal leak within the plpgsql engine. I'd be >

Re: [GENERAL] Enable user access from remote host

2009-03-08 Thread John R Pierce
Tom Lane wrote: John R Pierce writes: *HOWEVER* "ident sameuser" should *not* be used for HOST connections, its only reliable for LOCAL connections. A more accurate statement is that it's trustworthy to the extent that you trust the owner of the other machine to be running a non-bro

Re: [GENERAL] Log SQL code before executing it

2009-03-08 Thread Chris
Alexander Farber wrote: Dear PgSQL users, is there please a way to display the executed SQL code? I'm using phpBB 3.0.4 / PostgreSQL 8.2.6 / PHP 5.2.5 / OpenBSD 4.3 to develop a card game in Flash / C / Perl (at http://preferans.de ) and would like to log each game round by simply posting and r

Re: [GENERAL] Enable user access from remote host

2009-03-08 Thread Tom Lane
John R Pierce writes: > Tom Lane wrote: >> A more accurate statement is that it's trustworthy to the extent that >> you trust the owner of the other machine to be running a non-broken >> identd daemon. Within a LAN it might be perfectly reasonable to use. > you would have to extend that trust to

Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-08 Thread Mark Mandel
Final words - If you use PostGres and Hibernate, * everything * has to be in a transaction, ALWAYS. That and remember to close your sessions. Thanks for listening to my rambling. Mark On Mon, Mar 9, 2009 at 10:31 AM, Mark Mandel wrote: > Well, there was an issue there, in that I wasn't closin