Re: [GENERAL] database corruption

2009-04-09 Thread Albe Laurenz *EXTERN*
This thread is a top posting mess. I'll try to rearrange: Jeff Brenton wrote: REINDEX INDEX testrun_log_pkey; ERROR: could not write block 1832079 of temporary file: No space left on device HINT: Perhaps out of disk space? There is currently 14GB free on the disk that postgres is

Re: [GENERAL] database corruption

2009-04-09 Thread Ivan Sergio Borgonovo
On Wed, 8 Apr 2009 22:14:38 -0400 Jeff Brenton jbren...@sandvine.com wrote: There are no filesystem level content size restrictions that I am aware of on this system. The user pgsql should have full access to the filesystems indicated except for the root filesystem. finished inodes? A lot

[GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread CM J
Hi, To start the postgres server in background mode in windows, i executed the following command: *runas /user:postgres D:\postgres_new\pgsql\bin\pg_ctl.exe -W start -D D:\postgres_new\pgsql\data -l D:\postgres_new\pgsql\data\logfile* The postgres starts up all fine and logs get

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread CM J
Hi, I do not want start postgres as a service.Postgres will bundled along with my application and i am only looking at starting it only from cmd line.If there are any options to disable this cmd window which appears after executing the pg_ctl.exe start, that would be great ! Thanks. On

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-09 Thread Richard Huxton
Ivan Sergio Borgonovo wrote: On Wed, 8 Apr 2009 17:39:02 +0100 Sam Mason s...@samason.me.uk wrote: who num mails of total Tom Lane 1,9358.0% Scott Marlowe 1,0774.5% Alvaro Herrera 5212.2% Joshua Drake4681.9%

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 04:53:06PM +0530, CM J wrote: I do not want start postgres as a service.Postgres will bundled along with my application and i am only looking at starting it only from cmd line.If there are any options to disable this cmd window which appears after executing the

[GENERAL] Will PostgreSQL 8.4 allow having different encoding databases on a same PostgreSQL server ?

2009-04-09 Thread Bruno Baguette
Hello ! Currently, I have several PostgreSQL databases, some of them are using LATIN1 encoding, some of them are using UTF-8 encoding. In order to have theses two encoding, we had to install two PostgreSQL server on two different ports. One is for LATIN1 databases and one is for UTF-8

Re: [GENERAL] Will PostgreSQL 8.4 allow having different encoding databases on a same PostgreSQL server ?

2009-04-09 Thread Guillaume Lelarge
Hi, Le jeudi 09 avril 2009 à 14:03:28, Bruno Baguette a écrit : [...] Currently, I have several PostgreSQL databases, some of them are using LATIN1 encoding, some of them are using UTF-8 encoding. In order to have theses two encoding, we had to install two PostgreSQL server on two different

[GENERAL] Trigger function cost

2009-04-09 Thread Glyn Astill
Hi Chaps, Can anyone point me to docs for trigger function estimated cost? I see that when I create a volatile plpgsql trigger function it gets given a cost of 100 and a c function gets given a cost of 1. Is there any reason to mess with this? Thanks Glyn -- Sent via pgsql-general

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-09 Thread Robert Treat
On Wednesday 08 April 2009 18:25:25 Ron Mayer wrote: Robert Treat wrote: You can be sure that discussion of this topic in this forum will soon be visited by religious zealots, but the short answer is nulls are bad, mmkay. A slightly longer answer would be that, as a general rule,

Re: [GENERAL] Will PostgreSQL 8.4 allow having different encoding databases on a same PostgreSQL server ?

2009-04-09 Thread Scott Marlowe
On Thu, Apr 9, 2009 at 6:03 AM, Bruno Baguette bruno.bague...@gmail.com wrote: Hello ! Currently, I have several PostgreSQL databases, some of them are using LATIN1 encoding, some of them are using UTF-8 encoding. In order to have theses two encoding, we had to install two PostgreSQL server

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-09 Thread Grzegorz Jaśkiewicz
If I may, I got an instance once, where table with bytea field was pretty slow. Turned out, that queries modified everything apart from bytea bit. moving it to separate table actually helped performance. But that only will happen providing that you have the bytea/text/whatever that won't change,

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Craig Ringer
CM J wrote: Hi, To start the postgres server in background mode in windows, i executed the following command: *runas /user:postgres D:\postgres_new\pgsql\bin\pg_ctl.exe -W start -D D:\postgres_new\pgsql\data -l D:\postgres_new\pgsql\data\logfile* The postgres starts up

Re: [GENERAL] Will PostgreSQL 8.4 allow having different encoding databases on a same PostgreSQL server ?

2009-04-09 Thread Scott Marlowe
Nevermind, I'm an idiot. yeah, for latin1 you'd need locale=C On Thu, Apr 9, 2009 at 6:24 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Thu, Apr 9, 2009 at 6:03 AM, Bruno Baguette bruno.bague...@gmail.com wrote: Hello ! Currently, I have several PostgreSQL databases, some of them are

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Thomas Kellerer
CM J, 09.04.2009 13:23: I do not want start postgres as a service.Postgres will bundled along with my application and i am only looking at starting it only from cmd line.If there are any options to disable this cmd window which appears after executing the pg_ctl.exe start, that would be

Re: [GENERAL] Trigger function cost

2009-04-09 Thread Tom Lane
Glyn Astill glynast...@yahoo.co.uk writes: I see that when I create a volatile plpgsql trigger function it gets given a cost of 100 and a c function gets given a cost of 1. Is there any reason to mess with this? No. The planner doesn't actually bother to figure the cost of triggers anyway,

[GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Hello everyone, I've got 3 tables: hosts (with host.id column) and reservation (with reservation.id column) in many-to-many relation, and reservation_hosts which is an association table (with reservation_id and host_id columns). So I've got this query which selects hosts and reservations

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Aurimas Černius
Hi, I've got 3 tables: hosts (with host.id column) and reservation (with reservation.id column) in many-to-many relation, and reservation_hosts which is an association table (with reservation_id and host_id columns). So I've got this query which selects hosts and reservations under certain

Re: [GENERAL] Will PostgreSQL 8.4 allow having different encoding databases on a same PostgreSQL server ?

2009-04-09 Thread Albe Laurenz *EXTERN*
Bruno Baguette wrote: Currently, I have several PostgreSQL databases, some of them are using LATIN1 encoding, some of them are using UTF-8 encoding. In order to have theses two encoding, we had to install two PostgreSQL server on two different ports. One is for LATIN1 databases and one is

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Tino Wildenhain
CM J wrote: Hi, I do not want start postgres as a service.Postgres will bundled along with my application and i am only looking at starting it only from cmd line.If there are any options to disable this cmd window which appears after executing the pg_ctl.exe start, that would be great !

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Hello Aurimas, Thanks for answer! Do you need a MIN(start_date) for each host you get from the query before last join? Yes, I really do - the idea is that from several reservations fulfilling the dates condition the earliest reservation has to be selected (i.e. the one with minimum start

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 04:47:32PM +0200, Marcin Krol wrote: I've got 3 tables: hosts (with host.id column) and reservation (with reservation.id column) in many-to-many relation, and reservation_hosts which is an association table (with reservation_id and host_id columns). So I've got this

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Sam Mason wrote: On Thu, Apr 09, 2009 at 04:47:32PM +0200, Marcin Krol wrote: I've got 3 tables: hosts (with host.id column) and reservation (with reservation.id column) in many-to-many relation, and reservation_hosts which is an association table (with reservation_id and host_id columns).

[GENERAL] ON condition in LEFT OUTER JOIN doesn't work?!

2009-04-09 Thread Marcin Krol
Hello everyone, I've got this query: SELECT hosts.id, MIN(reservation.start_date) FROM hosts LEFT OUTER JOIN reservation_hosts ON reservation_hosts.host_id = hosts.id LEFT OUTER JOIN reservation ON (reservation_hosts.reservation_id = reservation.id AND reservation.start_date 2009-04-09)

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 06:08:04PM +0200, Marcin Krol wrote: What I'm trying to accomplish is producing list of hosts available within a specified timeframe. What I have is a table of hosts, table of reservations (containing id, start_date and end_date) and an association table

Re: [GENERAL] ON condition in LEFT OUTER JOIN doesn't work?!

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 06:34:27PM +0200, Marcin Krol wrote: SELECT hosts.id, MIN(reservation.start_date) FROM hosts LEFT OUTER JOIN reservation_hosts ON reservation_hosts.host_id = hosts.id LEFT OUTER JOIN reservation ON (reservation_hosts.reservation_id = reservation.id AND

Re: [GENERAL] Trigger function cost

2009-04-09 Thread Glyn Astill
From: Tom Lane t...@sss.pgh.pa.us Is there any reason to mess with this? No. The planner doesn't actually bother to figure the cost of triggers anyway, since presumably every correct plan will fire the same set of triggers. So even if you had a more accurate cost estimate than that

[GENERAL] Storing HTML: HTML entities being rendered in that raw form

2009-04-09 Thread linnewbie
Hi all, I have stored HTML in a text field that I subsequently render on the web. However when I retrieve and render this data on the web I am getting the entities being rendered in their raw form, ie, instead of getting the '' symbol when 'amp;' is stored I'm getting the 'raw' 'amp;'. I

Re: [GENERAL] ON condition in LEFT OUTER JOIN doesn't work?!

2009-04-09 Thread Raymond O'Donnell
On 09/04/2009 17:34, Marcin Krol wrote: reservation.start_date 2009-04-09) You need to phrase it like this: ... reservation.start_date '2009-04-09'::date ... Try this and see what happens. :-) Ray. -- Raymond O'Donnell,

Re: [GENERAL] Storing HTML: HTML entities being rendered in that raw form

2009-04-09 Thread Raymond O'Donnell
On 09/04/2009 17:27, linnewbie wrote: I have stored HTML in a text field that I subsequently render on the web. However when I retrieve and render this data on the web I am getting the entities being rendered in their raw form, ie, instead of getting the '' symbol when 'amp;' is stored I'm

[GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Thomas Kellerer
Hi, I have been actively recommending Postgres in my company but had now three people coming back to me because they couldn't manage to install Postgres on Windows or MacOS. The common sympton is always that the installer (the PG installer as well as the EnterpriseDB installers) suggests to

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Hello Sam, Thanks a million for reply! I'm so frustrated with this.. Sam Mason wrote: On Thu, Apr 09, 2009 at 06:08:04PM +0200, Marcin Krol wrote: What I'm trying to accomplish is producing list of hosts available within a specified timeframe. What I have is a table of hosts, table of

Re: [GENERAL] Storing HTML: HTML entities being rendered in that raw form

2009-04-09 Thread Steve Atkins
On Apr 9, 2009, at 9:27 AM, linnewbie wrote: Hi all, I have stored HTML in a text field that I subsequently render on the web. However when I retrieve and render this data on the web I am getting the entities being rendered in their raw form, ie, instead of getting the '' symbol when 'amp;'

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Raymond O'Donnell
On 09/04/2009 18:03, Marcin Krol wrote: - If I quote date values like '2009-04-09' it doesn't work again! I.e. result set includes one host id that should have been excluded (bc it has reservation whose date doesn't match the condition) - I have replaced OVERLAPS with explicit date condition

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 07:03:55PM +0200, Marcin Krol wrote: - If I quote date values like '2009-04-09' it doesn't work again! I.e. result set includes one host id that should have been excluded (bc it has reservation whose date doesn't match the condition) You *need* those quotes in there;

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Sam Mason wrote: This is a big hint that things are going wrong. You need those quotes in there, an integer is a plain number and not a date. This one does work in the sense of selecting out the wrong host but it still produces nothing but NULLs! SELECT h.id, r.id, r.start_date,

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Martin Gainty
could provide greater assistance if you could post the database schema you're using cheers (from across the pond) Martin GMT+5(this week) __ Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité Diese Nachricht ist

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 07:25:42PM +0200, Marcin Krol wrote: Sam Mason wrote: This is a big hint that things are going wrong. You need those quotes in there, an integer is a plain number and not a date. This one does work in the sense of selecting out the wrong host but it still produces

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Martin Gainty wrote: could provide greater assistance if you could post the database schema you're using Not sure what you mean by schema (I'm really new to DB world), if you mean table descriptions from psql, here it is: reservations=# \d hosts Table

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Dave Page
On Thu, Apr 9, 2009 at 6:02 PM, Thomas Kellerer spam_ea...@gmx.net wrote: Hi, I have been actively recommending Postgres in my company but had now three people coming back to me because they couldn't manage to install Postgres on Windows or MacOS. The common sympton is always that the

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Thomas Kellerer
Now when doing this on Windows this is *bound* to fail because the Program Files are usually not writeable for non-admin users. The directory is created during installation by the user running the installation (which is usually an admin user). The PG service runs under a regular user account and

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Marcin Krol
Sam Mason wrote: On Thu, Apr 09, 2009 at 07:25:42PM +0200, Marcin Krol wrote: Sam Mason wrote: This is a big hint that things are going wrong. You need those quotes in there, an integer is a plain number and not a date. This one does work in the sense of selecting out the wrong host but it

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Dave Page
On Thu, Apr 9, 2009 at 6:59 PM, Thomas Kellerer spam_ea...@gmx.net wrote: OK, that's good news, but then those failures need to have a different source. But interesting enough the problems were all caused by wrong permissions (just look at the thread I pointed to in dbforums). Probably

[GENERAL] Minimizing Recovery Time (wal replication)

2009-04-09 Thread Bryan Murphy
I have two hot-spare databases that use wal archiving and continuous recovery mode. I want to minimize recovery time when we have to fail over to one of our hot spares. Right now, I'm seeing the following behavior which makes a quick recovery seem problematic: (1) hot spare applies 70 to 75 wal

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Russell Hltn
On Thu, Apr 9, 2009 at 7:59 AM, Thomas Kellerer spam_ea...@gmx.net wrote: But still: I think it is a much better strategy to *not* put the data dir into the program directory. Microsoft abandoned that model after W95/98/(ME?). A new model came out in Win2000, but rarely followed. MS got out

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Greg Smith
On Thu, 9 Apr 2009, Dave Page wrote: I suspect if you are seeing multiple failures then it is likely a side effect of a local security policy or similar. If you can supply an installation log that would help diagnose the problem. If you look at the forum post Thomas referenced, the errors

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Dave Page
On Thu, Apr 9, 2009 at 8:37 PM, Greg Smith gsm...@gregsmith.com wrote: On Thu, 9 Apr 2009, Dave Page wrote: I suspect if you are seeing multiple failures then it is likely a side effect of a local security policy or similar. If you can supply an installation log that would help diagnose the

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Tom Lane
Greg Smith gsm...@gregsmith.com writes: If you look at the forum post Thomas referenced, the errors all look like variations on this during initdb: creating directory C:/Archivos de programa/PostgreSQL/8.3/data ... ok creating subdirectories ... ok selecting default max_connections ... 10

Re: [GENERAL] Some suggestions for the non Linux installers

2009-04-09 Thread Dave Page
On Thu, Apr 9, 2009 at 8:34 PM, Russell Hltn russellh...@gmail.com wrote: On Thu, Apr 9, 2009 at 7:59 AM, Thomas Kellerer spam_ea...@gmx.net wrote: But still: I think it is a much better strategy to *not* put the data dir into the program directory. Microsoft abandoned that model after

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Aurimas Černius
Hi, Do you need a MIN(start_date) for each host you get from the query before last join? Yes, I really do - the idea is that from several reservations fulfilling the dates condition the earliest reservation has to be selected (i.e. the one with minimum start date). I edited your code

Re: [GENERAL] complicated query (newbie..)

2009-04-09 Thread Sam Mason
On Thu, Apr 09, 2009 at 08:16:55PM +0200, Marcin Krol wrote: Sam Mason wrote: On Thu, Apr 09, 2009 at 07:25:42PM +0200, Marcin Krol wrote: SELECT h.id, r.id, r.start_date, r.end_date FROM hosts h LEFT JOIN (reservation_hosts m INNER JOIN reservation r ON m.reservation_id = r.id

[GENERAL] Evidently no support for the mmddyyyy date format

2009-04-09 Thread Bernard Barton
Today I tried every permutation of the DateStyle parameter I could find, and still cannot get PostgreSQL 8.3 to accept dates in the format mmdd. I tried setting this in the postgresql.conf file, and also in psql using set datestyle to style. So, am I correct to conclude that it is not

Re: [GENERAL] Evidently no support for the mmddyyyy date format

2009-04-09 Thread Tom Lane
Bernard Barton bf...@comcast.net writes: Today I tried every permutation of the DateStyle parameter I could find, and still cannot get PostgreSQL 8.3 to accept dates in the format mmdd. I tried setting this in the postgresql.conf file, and also in psql using set datestyle to style.

Re: [GENERAL] Minimizing Recovery Time (wal replication)

2009-04-09 Thread Greg Smith
On Thu, 9 Apr 2009, Bryan Murphy wrote: (1) hot spare applies 70 to 75 wal files (~1.1g) in 2 to 3 min period Yeah, if you ever let this many files queue up you're facing a long recovery time. You really need to get into a position where you're applying WAL files regularly enough that you

Re: [GENERAL] Minimizing Recovery Time (wal replication)

2009-04-09 Thread Bryan Murphy
On Thu, Apr 9, 2009 at 6:38 PM, Greg Smith gsm...@gregsmith.com wrote: What does vmstat say about the bi/bo during this time period?  It sounds like the volume of random I/O produced by recovery is just backing up as expected.  Some quick math: I'll have to capture this, unfortunately I won't

Re: [GENERAL] Minimizing Recovery Time (wal replication)

2009-04-09 Thread Greg Smith
On Thu, 9 Apr 2009, Bryan Murphy wrote: 1) Decrease the maximum possible segment backlog so you can never get this   far behind I understand conceptually what you are saying, but I don't know how to practically realize this. :) Do you mean lower checkpoint_segments? Theoretically, every

Re: [GENERAL] Storing HTML: HTML entities being rendered in that raw form

2009-04-09 Thread linnewbie
On Apr 9, 1:00 pm, st...@blighty.com (Steve Atkins) wrote: On Apr 9, 2009, at 9:27 AM, linnewbie wrote: Hi all, I have stored HTML in a text field that I subsequently render on the web.  However when I retrieve and render this data on the web I  am getting the entities being rendered in

Re: [GENERAL] Minimizing Recovery Time (wal replication)

2009-04-09 Thread Bryan Murphy
On Thu, Apr 9, 2009 at 7:33 PM, Greg Smith gsm...@gregsmith.com wrote: 1) Decrease the maximum possible segment backlog so you can never get this   far behind I understand conceptually what you are saying, but I don't know how to practically realize this. :)  Do you mean lower

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Craig Ringer
Tino Wildenhain wrote: The problem here is, Postgres is not an embedded database but really a database management system. Therefore trying to bundle it with a desktop application will usually cause more headaches. I'd suggest installing Postgres as central service Note that Windows is

Re: [GENERAL] Anyone testing changes to libpq/bcc32.mak?

2009-04-09 Thread ljb
br...@momjian.us wrote: Magnus Hagander wrote: I don't know that anybody does. We usually get a report a couple of minor versions in and fix it then, which backs that guess. It's also not tested by the buildfarm. So I think you can call it semi- maintained at best. So if you want to

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Scott Marlowe
On Thu, Apr 9, 2009 at 8:18 PM, Craig Ringer cr...@postnewspapers.com.au wrote: Tino Wildenhain wrote: The problem here is, Postgres is not an embedded database but really a database management system. Therefore trying to bundle it with a desktop application will usually cause more headaches.

Re: [GENERAL] indirect membership in group roles

2009-04-09 Thread Kevin Field
On Apr 2, 6:48 pm, t...@sss.pgh.pa.us (Tom Lane) wrote: Kev kevinjamesfi...@gmail.com writes: For some reason, which I couldn't see spelled out very well in the docs for GRANT ROLE and SET ROLE,indirectmembership in the group user doesn't give one its privileges unless you SET ROLE user