Re: [GENERAL] HowTo SSL probaply with ODBC ?

2007-05-18 Thread Albe Laurenz
Andreas wrote: is there a documentation on how to secure a connection withe SSL? That is an option of the ODBC driver, isn't it? The motivation is that I need to rent a remote server for PG. Their admin proposes to open port 5432 on the outside of their firewall but he has no idea how to

[GENERAL] how to return 0 rows in function

2007-05-18 Thread Tomas Macek
Hi, I have simplified function like this: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE addr ALIAS FOR $1; BEGIN -- return NULL; -- return ''; END $FUNC$ LANGUAGE 'plpgsql'; - This function is returning varchar and it always

[GENERAL]

2007-05-18 Thread Tomas Macek
Hi, I have simplified function like this: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE addr ALIAS FOR $1; BEGIN -- return NULL; -- return ''; END $FUNC$ LANGUAGE 'plpgsql'; - This function is returning varchar and it always

Re: [GENERAL] Problem with inherited tables vs query planning

2007-05-18 Thread Richard Huxton
Dave Golombek wrote: create table base (file integer, data integer); create table child_0 () inherits (base); create table child_1 () inherits (base); create index child_0_file_index on child_0 using btree (file); create index child_1_file_index on child_1 using btree (file); create table other

Re: [GENERAL] Admin-Functions in Ubuntu's PG 8.2 missing?

2007-05-18 Thread Andreas
Joshua D. Drake schrieb: Andreas wrote: I've got an Ubuntu 7.04 (Feisty Fawn) set up and it has Ubuntu's binary PG 8.2.4 running. If I connect with a pgAdmin3 1.6.3 from Windows Tools -- Server Status pgAdmin complains that The server lacks instrumentation functions. pgAdmin III uses some

[GENERAL] how to return 0 rows in function

2007-05-18 Thread Tomas Macek
Hi, I have simplified function like this: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE addr ALIAS FOR $1; BEGIN -- return NULL; -- return ''; END $FUNC$ LANGUAGE 'plpgsql'; - This function is returning varchar and it always

Re: [GENERAL] how to return 0 rows in function

2007-05-18 Thread Richard Huxton
Tomas Macek wrote: Hi, I have simplified function like this: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE addr ALIAS FOR $1; BEGIN -- return NULL; -- return ''; END $FUNC$ LANGUAGE 'plpgsql'; - This function is returning

Re: [GENERAL] how to return 0 rows in function

2007-05-18 Thread Peter Eisentraut
Am Freitag, 18. Mai 2007 10:20 schrieb Tomas Macek: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE      addr ALIAS FOR $1; BEGIN      -- return NULL;      -- return ''; END $FUNC$ LANGUAGE 'plpgsql'; - This function is returning

Re: [GENERAL] how to return 0 rows in function

2007-05-18 Thread Tomas Macek
On Fri, 18 May 2007, Richard Huxton wrote: Tomas Macek wrote: Hi, I have simplified function like this: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE addr ALIAS FOR $1; BEGIN -- return NULL; -- return ''; END $FUNC$ LANGUAGE 'plpgsql';

[GENERAL] Tools for dumping pg_xlog, pg_clog, etc?

2007-05-18 Thread Gerhard Wiesinger
Hello! Are there any tools available to dump the files of the pg_xlog, pg_clog, ... directories in human readable format to understand how transaction handling is done? Thanx. Ciao, Gerhard -- http://www.wiesinger.com/ ---(end of

Re: [GENERAL] Paypal and going root

2007-05-18 Thread Kenneth Downs
Dave Page wrote: Kenneth Downs wrote: The last one left that I have is the sticky issue of a paypal IPN transaction coming in. I believe it applies generally to financial transactions. The user is sent by our application to the Paypal site. When they pay, paypal sends a POST with various

[GENERAL] Location of \pgsql\src\test\regress\readme.

2007-05-18 Thread Alexi Gen
Hello, I've connected to the open-source community CVS and got the source code of PostgreSQL. According to the available documentation there is supposed to be a 'readme' file in the '\pgsql\src\test\regress\' folder. But from what I received after downloading using WinCVS - there was no

Re: [GENERAL] Paypal and going root

2007-05-18 Thread Richard Huxton
Kenneth Downs wrote: Richard Huxton wrote: Kenneth Downs wrote: The last one left that I have is the sticky issue of a paypal IPN transaction coming in. I believe it applies generally to financial transactions. The user is sent by our application to the Paypal site. When they pay, paypal

Re: [GENERAL] Paypal and going root

2007-05-18 Thread Kenneth Downs
Richard Huxton wrote: Kenneth Downs wrote: Richard Huxton wrote: Kenneth Downs wrote: The last one left that I have is the sticky issue of a paypal IPN transaction coming in. I believe it applies generally to financial transactions. The user is sent by our application to the Paypal site.

Re: [GENERAL] Paypal and going root

2007-05-18 Thread Kenneth Downs
Richard Huxton wrote: Kenneth Downs wrote: The last one left that I have is the sticky issue of a paypal IPN transaction coming in. I believe it applies generally to financial transactions. The user is sent by our application to the Paypal site. When they pay, paypal sends a POST with

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Martijn van Oosterhout
On Fri, May 18, 2007 at 02:48:03PM +0200, Thomas Lopatic wrote: What I keep wondering: Isn't there substantial risk involved? I mean, suppose the master fails in the middle of a write. Isn't there the possibility that this corrupts the database? How robust is PostgreSQL's on-disk file format

Re: [GENERAL] Memory settings, vm.overcommit, how to get it really safe?

2007-05-18 Thread Florian Weimer
* Scott Marlowe: What distro / kernel version of linux are you running? We have a similar issue with late model hardware and RHEL4 recently here at work, where our workstations are running out of memory. They aren't running postgresql, they're java dev workstations and it appears to be a

Re: [GENERAL] Problem with inherited tables vs query planning

2007-05-18 Thread Dave Golombek
Tom Lane writes: Dave Golombek [EMAIL PROTECTED] writes: Is there a way I can reformulate the query to help the planner use the indices? Use 8.2. Also put an index on the base table, not only the children --- the forced seqscan on the base weighs down the cost estimate for the plan you

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Andrew Sullivan
On Fri, May 18, 2007 at 02:48:03PM +0200, Thomas Lopatic wrote: I am currently looking into replicated two-node master/slave PostgreSQL environments. Lately I've heard more and more people recommend replicating data from the master to the slave at the disk device level as opposed to the DBMS

Re: [GENERAL] Fault Tolerant Postgresql (two machines, two postmasters, one disk array)

2007-05-18 Thread Andrew Sullivan
On Thu, May 17, 2007 at 03:55:43PM -0500, Ron Johnson wrote: Aren't there PCI heartbeat cards that are independent of the load on the host machine? Yes, there is more than one way to do this. My main point is to emphasise that you have to pay attention to the details -- all of them. It's

Re: [GENERAL] Admin-Functions in Ubuntu's PG 8.2 missing?

2007-05-18 Thread Joshua D. Drake
Andreas wrote: Joshua D. Drake schrieb: Andreas wrote: I've got an Ubuntu 7.04 (Feisty Fawn) set up and it has Ubuntu's binary PG 8.2.4 running. If I connect with a pgAdmin3 1.6.3 from Windows Tools -- Server Status pgAdmin complains that The server lacks instrumentation functions.

Re: [GENERAL] Location of \pgsql\src\test\regress\readme.

2007-05-18 Thread Tom Lane
Alexi Gen [EMAIL PROTECTED] writes: According to the available documentation there is supposed to be a 'readme' file in the '\pgsql\src\test\regress\' folder. But from what I received after downloading using WinCVS - there was no readme file. It's not in CVS because it's generated during a

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Lee Keel
Thanks to everyone for their input on this. After reading all the emails and some of the documentation (section 23.3), I think this is all a little more than what I need. My database is basically read-only and all I was looking to do is to be able to take snap-shots of it and be able to restore

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Richard Huxton
Lee Keel wrote: Thanks to everyone for their input on this. After reading all the emails and some of the documentation (section 23.3), I think this is all a little more than what I need. My database is basically read-only and all I was looking to do is to be able to take snap-shots of it and

Re: [GENERAL] Problem with inherited tables vs query planning

2007-05-18 Thread Tom Lane
Dave Golombek [EMAIL PROTECTED] writes: Ah, I forgot to try the index on the base table using 8.2, which does indeed solve the problem. It unfortunately doesn't help with 8.1.4, which we have in the field; any thoughts on workarounds for older versions or should I just use a function until we

Re: [GENERAL] Memory settings, vm.overcommit, how to get it really safe?

2007-05-18 Thread Scott Marlowe
Florian Weimer wrote: * Scott Marlowe: What distro / kernel version of linux are you running? We have a similar issue with late model hardware and RHEL4 recently here at work, where our workstations are running out of memory. They aren't running postgresql, they're java dev workstations

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Alvaro Herrera
Lee Keel escribió: So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer? Actually you can do single databases, but you must also include some other directories besides the

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Lee Keel
So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer? -LK -Original Message- From: Richard Huxton [mailto:[EMAIL PROTECTED] Sent: Friday, May 18, 2007 10:35 AM To: Lee

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Richard Huxton
Alvaro Herrera wrote: Lee Keel escribió: So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer? Actually you can do single databases, but you must also include some other

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Thomas Lopatic
[Disk-level replication instead of using Slony-I] What are the reasons they recommend this? (See my blathering in another thread about how often the hand-wavy recommendations that are made on this topic can really bite you hard if you don't know all the intimate details underneath.) The

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Alvaro Herrera
Richard Huxton escribió: Alvaro Herrera wrote: Lee Keel escribió: So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer? Actually you can do single databases, but you must

[GENERAL] contirb install

2007-05-18 Thread ABHANG RANE
Hi, I have redhat enterprpise release 4. I need to use the cube operator. Please can you let me know to install the necessary contrib modules. I tried to make in the directory of the contrib but it says Makefile:23: ../../src/Makefile.global: No such file or directory Makefile:24:

[GENERAL] Creating a function if it's not there in Postgres

2007-05-18 Thread Robert James
I use a set of DDL scripts to automatically create the database for an app. I need to create certain functions (from contrib), if they're not there already. If they are there, I don't want to DROP or REPLACE them, since they may be used in certain indexes and triggers. Is there a way to only

Re: [GENERAL] Creating a function if it's not there in Postgres

2007-05-18 Thread Joshua D. Drake
Robert James wrote: I use a set of DDL scripts to automatically create the database for an app. I need to create certain functions (from contrib), if they're not there already. If they are there, I don't want to DROP or REPLACE them, since they may be used in certain indexes and triggers.

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Andrew Sullivan
On Fri, May 18, 2007 at 07:55:24PM +0200, Thomas Lopatic wrote: For Slony-I it seems to me that my risk is losing a couple of rows in my database, which is something that I could live with. For disk-level replication it seems to me that, in case of a master failure, I could easily end up with

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Richard Huxton
Alvaro Herrera wrote: Richard Huxton escribió: Alvaro Herrera wrote: Lee Keel escribió: So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer? Actually you can do single

Re: [GENERAL] contirb install

2007-05-18 Thread Richard Huxton
ABHANG RANE wrote: Hi, I have redhat enterprpise release 4. I need to use the cube operator. Please can you let me know to install the necessary contrib modules. I tried to make in the directory of the contrib but it says Makefile:23: ../../src/Makefile.global: No such file or directory

[GENERAL] Random Sample

2007-05-18 Thread tom
How do I pull a random sample of either 100 records or 5% of the population of a table? ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Jan Bilek
Hello, I've got following problem: I use this simple query: select * from mytable where creation_time (CURRENT_TIMESTAMP - interval '7 days'); --- it selects all rows from mytable, which were created before one week or sooner (creation_time is column in mytable). I would like to use this

Re: [GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Martin Gainty
Hi Jan how about casting the parameter to date format e.g. select * from mytable where creation_time (CURRENT_TIMESTAMP - $1::date) Anyone? M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is

Re: [GENERAL] Random Sample

2007-05-18 Thread Reece Hart
On Fri, 2007-05-18 at 15:36 -0500, [EMAIL PROTECTED] wrote: How do I pull a random sample of either 100 records or 5% of the population of a table? If you can be a little flexible about the number of samples, you can try select * from table where random()=0.05; Of course, there's

Re: [GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Tom Lane
Jan Bilek [EMAIL PROTECTED] writes: I would like to use this query in java PreparedStatement, where age of a = row would be one of its parameters: PreparedStatement could look like this: select * from mytable where creation_time (CURRENT_TIMESTAMP - ?) But nothing works with

Re: [GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Jan Bilek
Got it! Jan Bilek [EMAIL PROTECTED] writes: I would like to use this query in java PreparedStatement, where age of a = row would be one of its parameters: PreparedStatement could look like this: select * from mytable where creation_time (CURRENT_TIMESTAMP - ?) But nothing works with

Re: [GENERAL] UNION help

2007-05-18 Thread Dann Corbit
SELECT '1st Query' as whichone, col1, col2, col3 from table1 UNION SELECT '2ND Query' as whichone, col1, col2, col3 from table2 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert James Sent: Thursday, May 17, 2007 12:11 PM To:

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Ben
If you're just looking for a way to have high availability and you're ok being tied to linux, DRBD is a good way to go. It keeps things simple in that all changes are replicated, it won't say an fsync is finished until it's finished on the remote host too, and it won't let you mount the block

Re: [GENERAL] Database corruption

2007-05-18 Thread Alvaro Herrera
Shane wrote: Hello all, Whilst running a regular pg_dumpall, I received the following error from our spamassassin DB. pg_dump: ERROR: could not access status of transaction 4521992 DETAIL: could not open file pg_clog/0004: No such file or directory pg_dump: SQL command to dump the

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Alvaro Herrera
Ben wrote: If you're just looking for a way to have high availability and you're ok being tied to linux, DRBD is a good way to go. It keeps things simple in that all changes are replicated, it won't say an fsync is finished until it's finished on the remote host too, Oh, so that's how it

Re: [GENERAL] Data replication through disk replication

2007-05-18 Thread Ben
You pay a price writes, but with write caching enabled on your (battery-backed, of course) RAID card and using gigabit, it's easy to get 100MB/s throughput. It's also easy to replicate different block devices over separate network links, if that becomes your bottleneck. On May 18, 2007,

Re: [GENERAL] Large Database Restore

2007-05-18 Thread Alvaro Herrera
Richard Huxton escribió: Alvaro Herrera wrote: Richard Huxton escribió: Alvaro Herrera wrote: Lee Keel escribió: So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer?