Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Craig Ringer
On 07/11/2012 07:23 AM, Andy Chambers wrote: I think I made a poor decision by having our application generate checkbook numbers on demand using sequences. Sure did. Sequences are exempt from most transactional rules; that's why they're fast and lock-free. I'm surprised to find that the on

Re: [GENERAL] Error with plpython

2012-07-10 Thread Craig Ringer
On 07/11/2012 06:16 AM, Efraín Déctor wrote: However, once we installed it on our production server that function doesnt work, it keeps sending this message: ERROR: ImportError: cannot import name SSLError CONTEXT: Traceback (most recent call last): The strange thing is that our server are the

Re: [GENERAL] Python + listen/notify

2012-07-10 Thread Josh Kupershmidt
On Tue, Jul 10, 2012 at 3:56 PM, Filipe Brandão wrote: > Hi all. > I needed to have a trigger firing after a commit, but allready realized it's > not possible. > As i searched upon a solution i came across the LISTEN / NOTIFY. I haven't > yet realized exactly what i can do with it, but can i use

[GENERAL] Python + listen/notify

2012-07-10 Thread Filipe Brandão
Hi all. I needed to have a trigger firing after a commit, but allready realized it's not possible. As i searched upon a solution i came across the LISTEN / NOTIFY. I haven't yet realized exactly what i can do with it, but can i use it to run a simple python script located out my DB? Can't run it

Re: [GENERAL] Transaction question

2012-07-10 Thread Adrian Klaver
On 07/10/2012 07:30 PM, Jeff Ross wrote: On 7/10/12 6:21 PM, Adrian Klaver wrote: On 07/10/2012 01:06 PM, Jeff Ross wrote: Hi all, Thanks for any and all ideas! For your initial attempt everything was done in one session? All the inserts were done in one session, yes. I am also confu

Re: [GENERAL] Transaction question

2012-07-10 Thread Jeff Ross
On 7/10/12 6:21 PM, Adrian Klaver wrote: On 07/10/2012 01:06 PM, Jeff Ross wrote: Hi all, I have an anomaly on my hands that I'm at a loss to understand. We recently ran a small survey where participants were required to answer all the questions. After validation for skipped questions, mis-ra

Re: [GENERAL] Error with plpython

2012-07-10 Thread Adrian Klaver
On 07/10/2012 05:34 PM, Efraín Déctor wrote: We tested, the code directly into Python: from googlemaps import GoogleMaps gmaps= GoogleMaps() address = gmaps.latlng_to_address(18.835124317498853,-97.11448417315677) repr(address) And on both servers work without a problem. My guess is that somet

Re: [GENERAL] Error with plpython

2012-07-10 Thread Efraín Déctor
We tested, the code directly into Python: from googlemaps import GoogleMaps gmaps= GoogleMaps() address = gmaps.latlng_to_address(18.835124317498853,-97.11448417315677) repr(address) And on both servers work without a problem. My guess is that something about OpenSSL on the production server i

Re: [GENERAL] Error with plpython

2012-07-10 Thread Adrian Klaver
On 07/10/2012 02:59 PM, Efraín Déctor wrote: Hello. Strange thing happening: We rencently installed plpython in one of our test servers and installed an extension to use the google api (http://pypi.python.org/pypi/googlemaps) , everything went fine we tested this function: CREATE OR REPLACE FUNCT

Re: [GENERAL] Transaction question

2012-07-10 Thread Adrian Klaver
On 07/10/2012 01:06 PM, Jeff Ross wrote: Hi all, I have an anomaly on my hands that I'm at a loss to understand. We recently ran a small survey where participants were required to answer all the questions. After validation for skipped questions, mis-ranking answers that had to be ranked and so

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Andy Chambers
On Tue, Jul 10, 2012 at 6:48 PM, Tom Lane wrote: > Andy Chambers writes: > > When testing the failover procedure, we noticed that when the new master > > comes up, some sequences have moved forward (by between 30 and 40). I > see > > there's a "cache" option when creating the sequence but we're

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Tom Lane
Andy Chambers writes: > When testing the failover procedure, we noticed that when the new master > comes up, some sequences have moved forward (by between 30 and 40). I see > there's a "cache" option when creating the sequence but we're not using > that. > Is this to be expected? Yes. This is

Re: [GENERAL] Do I need archive_mode = on for hot standby?

2012-07-10 Thread Andy Chambers
On Mon, Jul 2, 2012 at 3:33 AM, Janne H wrote: > Hi there. > > I'm planning on setting up a master database and multiple hot standby > slaves using streaming replication. > > If I use a large(*) value on > wal_keep_segments > do I really need archive_mode = on then? > > Any potential problems wit

[GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Andy Chambers
Hey All, We used the linked guide to setup streaming replication. http://wiki.postgresql.org/wiki/Streaming_Replication When testing the failover procedure, we noticed that when the new master comes up, some sequences have moved forward (by between 30 and 40). I see there's a "cache" option whe

[GENERAL] Error with plpython

2012-07-10 Thread Efraín Déctor
Hello. Strange thing happening: We rencently installed plpython in one of our test servers and installed an extension to use the google api (http://pypi.python.org/pypi/googlemaps ) , everything went fine we tested this function: CREATE OR REPLACE FUNCTION google_reverse_geocode(lat numeric, l

Re: [GENERAL] BUG? Regular expression matching of optional character group at beginning of RE

2012-07-10 Thread Tom Lane
Viktor Rosenfeld writes: > I've noticed that regular expressions which are anchored at the > beginning of the text but have an optional part at the beginning > (e.g. '^(ge)?kommen$') are not evaluated correctly if there is an > index on the column. I have committed fixes for this. Thanks for the

[GENERAL] Error with plpython

2012-07-10 Thread Efraín Déctor
Hello. Strange thing happening: We rencently installed plpython in one of our test servers and installed an extension to use the google api (http://pypi.python.org/pypi/googlemaps ) , everything went fine we tested this function: CREATE OR REPLACE FUNCTION google_reverse_geocode(lat numeric, l

[GENERAL] Transaction question

2012-07-10 Thread Jeff Ross
Hi all, I have an anomaly on my hands that I'm at a loss to understand. We recently ran a small survey where participants were required to answer all the questions. After validation for skipped questions, mis-ranking answers that had to be ranked and so on, I did all of the inserts to the su

[GENERAL] Pg CRUD for joined tables

2012-07-10 Thread gvim
I'm looking for FOSS PostgreSQL CRUD software, preferably Perl-compatible, which will enable me to design input forms which can handle input to tables which reference other tables by foreign key. Most CRUD applications I have seen so far only deal with direct, form field to table field input bu

[GENERAL] Ignore hash indices on replicas

2012-07-10 Thread Steven Schlansker
I'm using Postgres hash indices on a streaming replica master. As is documented, hash indices are not logged, so the replica does not have access to them. I understand that the current wisdom is "don't use hash indices", but (unfortunately?) I have benchmarks that show that our particular applic