[GENERAL] Escaping regular expressions in plperl

2009-06-14 Thread Toomas Vendelin
How should one escape regular expressions in plperl? In the following chunk of PlPerl code the date doesn't match the regex: my $endby = '2009-06-13'; my $t = spi_exec_query(qq|SELECT CASE WHEN '$endby' ~ E'.*\\d\\d\\d\\d \\-\\d\\d?\\-\\d\\d?.*' THEN '$endby'::timestamptz ELSE CURRENT_D

Re: [GENERAL] citext.so

2009-06-14 Thread Sim Zacks
> I can't find it anywhere and we are *compiling* binary, so I can't compile > it without downloading the source... I mean we are installing binary -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

[GENERAL] citext.so

2009-06-14 Thread Sim Zacks
Does anyone have citext.so compiled for postgresql 8.2.* 64 bit? I can't find it anywhere and we are compiling binary, so I can't compile it without downloading the source... Thank you Sim -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [sfpug] [GENERAL] "Rails and PostgreSQL" now up on media.postgresql.org

2009-06-14 Thread Peter Eisentraut
On Thursday 11 June 2009 21:48:22 Dave Page wrote: > Can you embed the files on the PUGs page like JD suggests? What I want > to avoid is an ad-hoc website springing up on media.postgresql.org > that ends up in Google and being linked from who-knows-where. While there is a point to that, having th

Re: [GENERAL] Escaping regular expressions in plperl

2009-06-14 Thread Tom Lane
Toomas Vendelin writes: > In the following chunk of PlPerl code the date doesn't match the regex: > my $endby = '2009-06-13'; > my $t = spi_exec_query(qq|SELECT CASE WHEN '$endby' ~ E'.*\\d\\d\\d\\d > \\-\\d\\d?\\-\\d\\d?.*' > THEN '$endby'::timestamptz ELSE CURRENT_DATE::timestamptz EN

[GENERAL] terminating connection because of crash of another server process

2009-06-14 Thread sergio nogueira
Hi, all. i have two tables (teste1 and teste2). i was inserting one million rows on each by a script PHP. In another process, i have created a view (ct1t2) to count rows on the tables and started it then i killed the script (killing the apache server) and in another process i've executed the comma

Re: [GENERAL] terminating connection because of crash of another server process

2009-06-14 Thread Tom Lane
sergio nogueira writes: > then i kill the process executing the truncate. > the result: > LOG: server process (PID 3421) was terminated by signal 9: > Killed > Any idea on how to prevent this? Don't do that. kill -9 is *never* the recommended way to terminate a query. Next time try kill -INT

[GENERAL] Opinions on how to Integrate Transactions

2009-06-14 Thread APseudoUtopia
Hey, I'm new to using transactions. I'd like to integrate them into my PHP application to prevent a few issues we've been having. Such as, some queries in the beginning of the php script running, then an error occurring, preventing queries toward the bottom of the script from running. It's leaving

Re: [GENERAL] help with data recovery from injected UPDATE

2009-06-14 Thread Gus Gutoski
Merlin Moncure wrote: >> postgresql 8.1 supports pitr archiving. you can >> do continuous backups and restore the database to just before the bad >> data. I tried using point-in-time-recovery to restore the state of the database immediately before the corruption. It didn't work, but it was quit

[GENERAL] cygwin and postgresql

2009-06-14 Thread James B. Byrne
This may not be the right place for this question but I am going to start here anyway. I have installed postgresql in cygwin on a MS-WinXPpro system. I wish to initialise a database instance. However, I cannot find any program file called initdb. In /usr/bin I can see files like: pg_config.exe

Re: [GENERAL] cygwin and postgresql

2009-06-14 Thread Tom Lane
"James B. Byrne" writes: > I have installed postgresql in cygwin on a MS-WinXPpro system. I > wish to initialise a database instance. However, I cannot find any > program file called initdb. In /usr/bin I can see files like: > pg_config.exe, pg_dump.exe and pg_dumpall.exe but no initdb.exe > a

Re: [GENERAL] cygwin and postgresql

2009-06-14 Thread James B. Byrne
On Sun, June 14, 2009 13:34, Tom Lane wrote: > > That sounds suspiciously like a client-only installation. What > package did you install exactly? Was there a -server package > beside it? The packages that cygwin says I have installed are: 8.2.11-1 postgresql: PostgreSQL Data Base Management

Re: [GENERAL] cygwin and postgresql

2009-06-14 Thread Tom Lane
"James B. Byrne" writes: > The packages that cygwin says I have installed are: > 8.2.11-1 postgresql: PostgreSQL Data Base Management System 3,707k > 8.2.11-1 postgresql-client: Front-end programs for PostgreSQL 8.x 972k > 8.2.11-1 postgresql-contrib ... 373k > 8.2.11-1 postgresql-devel: ... serv

Re: [GENERAL] cygwin and postgresql

2009-06-14 Thread Scott Marlowe
On Sun, Jun 14, 2009 at 11:30 AM, James B. Byrne wrote: > This may not be the right place for this question but I am going to > start here anyway. > > I have installed postgresql in cygwin on a MS-WinXPpro system.  I > wish to initialise  a database instance.  However, I cannot find any > program f

Re: [GENERAL] cygwin and postgresql

2009-06-14 Thread James B. Byrne
On Sun, June 14, 2009 15:45, Scott Marlowe wrote: why it would not form part of the cygwin >> installation? > > Is there a reason you're not using the native windows postgresql > packages? > Because for some reason, processes running in the cygwin environment could not create databases in the pos

Re: [GENERAL] cygwin and postgresql

2009-06-14 Thread James B. Byrne
Found it. The cygwin executables for postgres are installed under /usr/sbin, which is NOT in the PATH thus the problem, and the obvious solution. -- *** E-Mail is NOT a SECURE channel *** James B. Byrnemailto:byrn...@harte-lyne.ca Harte & Lyne Limited h

[GENERAL] running pg_dump from python

2009-06-14 Thread Garry Saddington
I ahve the following python file that I am running as an external method in Zope. def backup(): import os os.popen("c:/scholarpack/postgres/bin/pg_dump scholarpack > c:/scholarpack/ancillary/scholarpack.sql") data=open('c:/scholarpack/ancillary/scholarpack.sql','r') r=data.read()

Re: [GENERAL] running pg_dump from python

2009-06-14 Thread Scott Mead
On Sun, Jun 14, 2009 at 4:06 PM, Garry Saddington < ga...@schoolteachers.co.uk> wrote: > I ahve the following python file that I am running as an external method in > Zope. > > def backup(): > import os > os.popen("c:/scholarpack/postgres/bin/pg_dump scholarpack > > c:/scholarpack/ancillary/

Re: [GENERAL] running pg_dump from python

2009-06-14 Thread Garry Saddington
Scott Mead wrote: On Sun, Jun 14, 2009 at 4:06 PM, Garry Saddington mailto:ga...@schoolteachers.co.uk>> wrote: I ahve the following python file that I am running as an external method in Zope. def backup(): import os os.popen("c:/scholarpack/postgres/bin/pg_dump schola

Re: [GENERAL] running pg_dump from python

2009-06-14 Thread Tom Lane
Garry Saddington writes: >> import os >> os.popen("c:/scholarpack/postgres/bin/pg_dump scholarpack > >> c:/scholarpack/ancillary/scholarpack.sql") > scholarpack but no OS user scholarpack, but why should it create a file > then not fill the contents? Because that's exactly what will happen if

Re: [GENERAL] Opinions on how to Integrate Transactions

2009-06-14 Thread Tomas Vondra
Hey, I'm new to using transactions. I'd like to integrate them into my PHP application to prevent a few issues we've been having. Such as, some queries in the beginning of the php script running, then an error occurring, preventing queries toward the bottom of the script from running. It's leavin

Re: [GENERAL] Opinions on how to Integrate Transactions

2009-06-14 Thread Craig Ringer
On Sun, 2009-06-14 at 11:14 -0400, APseudoUtopia wrote: > associated forum posts. From what I've read on transactions, they > would be the solution to my problems. Yes, but proper use of transactions - and a proper understanding of transactions - will help you a lot more than that. I very, very

Re: [GENERAL] help with data recovery from injected UPDATE

2009-06-14 Thread Craig Ringer
On Sun, 2009-06-14 at 10:32 -0400, Gus Gutoski wrote: > 0. Shortly after the corruption on June 9, 2009, I shut down the > server and backed up the entire data directory. The recovery > procedure described herein begins with this file system backup. > 1. The most recent non-corrupted snapshot of

Re: [GENERAL] citext.so

2009-06-14 Thread Sim Zacks
citext is not a new contrib module, I have been using it since 7.4 I believe it is being built into core in 8.4. I have it compiled on 32 bit 8.2, and 64 bit 8.1 and 8.3 My 8.3 compilation says it is incompatible and the 8.1 compilation says that it is missing the magic block. It is compiled with