Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Darren Duncan
Michael Nolan wrote: Earlier today I was working on a MySQL database (not by choice, I assure you), and I typed a statement like this: Update tablexyz set field1 = '15' where field2 - 20; The '-' was supposed to be an equal sign, but MySQL executed it anyway. (Field2 is an integer.) I was

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Vincent Veyron
Le dimanche 26 juin 2011 à 00:05 -0700, Darren Duncan a écrit : Michael Nolan wrote: Having real BOOLEAN is just one of the reasons I like Postgres the most. Would you mind giving an example of where a boolean field would be a win over an integer one? I'm asking this because I frequently

[GENERAL] Cached prepared statement slow after using it 5 times

2011-06-26 Thread Rob Gansevles
Hi, I came across a strange issue when caching prepared statement.. We are accessing postgres(9.0.3) via the jdbc driver (9.0b801) using a prepared statement cache. This works very good but in -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Pavel Stehule
hello 2011/6/26 Vincent Veyron vv.li...@wanadoo.fr: Le dimanche 26 juin 2011 à 00:05 -0700, Darren Duncan a écrit : Michael Nolan wrote: Having real BOOLEAN is just one of the reasons I like Postgres the most. Would you mind giving an example of where a boolean field would be a win over

[GENERAL] Reusing cached prepared statement slow after 5 executions

2011-06-26 Thread Rob Gansevles
Hi, I came across a strange issue when caching prepared statement.. We are accessing postgres(9.0.3) via the jdbc driver (9.0b801) using a prepared statement cache. This works very good but in 1 case the 5th execution (and later ones) suddenly takes 30 seconds as the first few just take less

Re: [GENERAL] Reusing cached prepared statement slow after 5 executions

2011-06-26 Thread David Johnston
This is likely the case where the first few prepared statements are not truly prepared. Once you hit five the cache kicks in and computes a generic query plan to cache. Since this plan is generic, where the first five were specific, it exhibits worse performance than queries where the where

Re: [GENERAL] Reusing cached prepared statement slow after 5 executions

2011-06-26 Thread Tom Lane
David Johnston pol...@yahoo.com writes: This is likely the case where the first few prepared statements are not truly prepared. Once you hit five the cache kicks in and computes a generic query plan to cache. Not so much that as that JDBC decides that it should tell the backend to start using

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Stephen Frost
* Vincent Veyron (vv.li...@wanadoo.fr) wrote: Would you mind giving an example of where a boolean field would be a win over an integer one? Where you only ever want 2 (or perhaps 2+NULL) values allowed for the column. It's about domain, consistency, etc, primairly. That said, don't we

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread sfrost
This message has been digitally signed by the sender. Re___GENERAL__An_amusing_MySQL_weakness__not_.eml Description: Binary data Hi-Tech Gears Ltd, Gurgaon, India Sent using PostMaster by QuantumLink Communications Get your free

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Gavin Flower
On 26/06/11 16:44, Michael Nolan wrote: Earlier today I was working on a MySQL database (not by choice, I assure you), and I typed a statement like this: Update tablexyz set field1 = '15' where field2 - 20; The '-' was supposed to be an equal sign, but MySQL executed it anyway. (Field2 is

Re: [GENERAL] unique across two tables

2011-06-26 Thread Gavin Flower
On 23/06/11 23:28, Tarlika Elisabeth Schmitz wrote: Hello Gavin, On Wed, 22 Jun 2011 20:53:19 +1200 Gavin Flowergavinflo...@archidevsys.co.nz wrote: [...] This design ensures that: names of towns are unique within a given country andregion. Note you will still need business logic, in a

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-26 Thread Alban Hertroys
On 23 Jun 2011, at 19:48, Alexander Farber wrote: Sorry for the late reply - but I still haven't found a solution, for example I have a PHP script with 5 consecutive SELECT statements (source code + problem described again under:

[GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Dave Coventry
I'm having huge problems with a Drupal install using Postgres 8.4.8. I'm getting the following error: PDOException: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host localhost and accepting TCP/IP connections on port 5432? in

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Adrian Klaver
On Sunday, June 26, 2011 12:36:59 pm Dave Coventry wrote: I'm having huge problems with a Drupal install using Postgres 8.4.8. I'm getting the following error: PDOException: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host localhost and

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Peter Bex
On Sun, Jun 26, 2011 at 09:36:59PM +0200, Dave Coventry wrote: I'm having huge problems with a Drupal install using Postgres 8.4.8. I'm getting the following error: Do you get the error in the logs or do you see it while going to the site manually and does it show this instead of rendering a

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread hernan gonzalez
On Sat, Jun 25, 2011 at 3:56 AM, David Johnston pol...@yahoo.com wrote: First: I would suggest your use of “Local Time” is incorrect and that you would be better off thinking of it as “Abstract Time”. My responses below go into more detail but in short you obtain a “Local” time by

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread Adrian Klaver
On Friday, June 24, 2011 10:37:43 am hernan gonzalez wrote: As I understand it, documentation patches are welcomed:) I'd indeed wish some radical changes to the documentation. To start with, the fundamental data type names are rather misleading; SQL standard sucks here, true, but

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread Adrian Klaver
On Sunday, June 26, 2011 12:57:15 pm hernan gonzalez wrote: An instant is a point in the universal time, it's a physical concept, unrelated to world calendars. The time point at which the man first landed on the moon is an instant, as is the moment at which my server restarted. It is not

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread hernan gonzalez
You might want to review the Theories of Relativity, which pretty much blew away the notion of an absolute time and introduced the notion of frame of reference for time. Well, I give up. -- Hernán J. González http://hjg.com.ar/

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread Adrian Klaver
On Sunday, June 26, 2011 12:57:15 pm hernan gonzalez wrote: An instant is a point in the universal time, it's a physical concept, unrelated to world calendars. The time point at which the man first landed on the moon is an instant, as is the moment at which my server restarted. It is not

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread Adrian Klaver
On Sunday, June 26, 2011 1:36:32 pm hernan gonzalez wrote: You might want to review the Theories of Relativity, which pretty much blew away the notion of an absolute time and introduced the notion of frame of reference for time. Well, I give up. As it happens I am currently reading a

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Dave Coventry
Thank you very much for your responses. On 26 June 2011 21:54, Peter Bex peter@xs4all.nl wrote: Do you get the error in the logs or do you see it while going to the site manually and does it show this instead of rendering a page? The log don't really give much indication of anything

Re: [GENERAL] Relative path specified for data_directory is not working as expected

2011-06-26 Thread Eduard-Cristian Stefan
On Fri, Jun 24, 2011 at 09:42, Rob Sargent robjsarg...@gmail.com wrote: Can't the service script be something like   cd d:/me/data/PostgreSQL; ./pg_ctl.exe runservice -N pgsql -D d:/me/etc/PostgreSQL Don't know about that, the service was installed by pg_ctl. Still, if two relative paths are

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Peter Bex
On Sun, Jun 26, 2011 at 11:23:30PM +0200, Dave Coventry wrote: [snip] 2011-06-26 17:13:24 EDT DETAIL: Failed system call was shmget(key=5432001, size=29278208, 03600). 2011-06-26 17:13:24 EDT HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread John R Pierce
On 06/26/11 2:23 PM, Dave Coventry wrote: While the server is a little challenged in the way of RAM, it is by no means under any sort of load. I didn't read the whole thread, but is this a Linux server? Linux has a horrible feature, the Out of Memory Killer, which kills off processes when

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-26 Thread Tomas Vondra
Dne 25.6.2011 13:22, Alban Hertroys napsal(a): As another possible improvement, I'd probably not create a new connection in every function call, but use a global $db object instead. Creating DB-connections is relatively expensive, so you don't want to do that more often than strictly

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Dave Coventry
Apologies, I didn't notice that I was replying off-list. On 27 June 2011 00:29, Dave Coventry dgcoven...@gmail.com wrote: On 26 June 2011 23:37, John R Pierce pie...@hogranch.com wrote: I didn't read the whole thread, but is this a Linux server?   Linux has a horrible feature, the Out of

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread John R Pierce
On 06/26/11 4:10 PM, Dave Coventry wrote: work_mem: 64kB shared_buffers: 128kB maintenance_work_mem: 1MB I'll see if that makes any difference. I'd watch the systems' memory usage as shown by `top` or `free`... as long as the 'cached' value (add in 'free' if its significant) stays

Re: [GENERAL] Postgres errors in Drupal install.

2011-06-26 Thread Martin Gainty
Dave and John drupal is built on php php is a binary which plays by the memory limitations posted in php.ini php.ini: memory_limit=32M ; Maximum amount of memory a script may consume (32MB) crank that down if Drupal is exhausting heapspace Martin Gainty GMT+5 (this week)

[GENERAL] Retrieving the original table of a tuple stored in a tuplestore?

2011-06-26 Thread Spencer Pearson
Hi, I'm pretty new to postgres, but I'm currently working on a project to extend some of the code. For what we're doing, we need to sometimes store tuples from multiple tables into the same tuplestore. The way I understand the code, tuples stored in tuplestores do not also store the TupleDesc

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Vincent Veyron
Le dimanche 26 juin 2011 à 12:05 -0400, Stephen Frost a écrit : (the driver converts t/f to 0/1), but I like to tune my fields properly. Yes, which is pretty horrible of it, imo. There is an option to turn it off and get the characters t/f returned (pg_bool_tf) -- Vincent Veyron

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-26 Thread Vincent Veyron
Le dimanche 26 juin 2011 à 16:41 +0200, Pavel Stehule a écrit : everywhere, where you require readability. For me a FALSE is more readable than 1 0 or TRUE instead 1 = 1 Actually, in Perl it's just 0 for false and 1 for true, so it's very readable if you're used to it. I'm asking this

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-26 Thread David Johnston
On Sunday, June 26, 2011 12:57:15 pm hernan gonzalez wrote: An instant is a point in the universal time, it's a physical concept, unrelated to world calendars. The time point at which the man first landed on the moon is an instant, as is the moment at which my server restarted. It is

Re: [GENERAL] Retrieving the original table of a tuple stored in a tuplestore?

2011-06-26 Thread Tom Lane
Spencer Pearson crzyb...@gmail.com writes: The way I understand the code, tuples stored in tuplestores do not also store the TupleDesc or a way to access the original table the tuple came from. This - again, as I understand the code - would make it impossible to know what types of