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

2011-05-27 Thread Albe Laurenz
Scott Marlowe wrote: > Then just use pid or something that can uniquely identify the queries > when they're running. I recommend %c in log_line_prefix. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.post

Re: [GENERAL] max_connections proposal

2011-05-27 Thread Cédric Villemain
2011/5/27 Tom Lane : > Craig Ringer writes: >> On 05/26/2011 09:48 PM, Tom Lane wrote: >>> Craig Ringer  writes: max_connections = 100                   # (change requires restart) # WARNING: If you're about to increase max_connections above 100, you # should probably be using a con

Re: [GENERAL] max_connections proposal

2011-05-27 Thread Stuart Bishop
On Fri, May 27, 2011 at 6:22 AM, Craig Ringer wrote: > Best performance is often obtained with the number of _active_ connections > in the 10s to 30s on commonplace hardware. I'd want to use "hundreds" - > because mailing list posts etc suggest that people start running into > problems under load

Re: [GENERAL] Feature request: Replicate only parts of a database

2011-05-27 Thread Peter Geoghegan
On 27 May 2011 05:53, A B wrote: > I have a small problem, in a database I need to export parts of a > database table to another server, and I could easily accomplish  ( I > hope)  that by creating a view and select * from the view and send it > over to the other server or use triggers to record

Re: [GENERAL] Feature request: Replicate only parts of a database

2011-05-27 Thread Andrew Sullivan
On Fri, May 27, 2011 at 06:53:17AM +0200, A B wrote: > hope) that by creating a view and select * from the view and send it > over to the other server or use triggers to record what rows are > inserted and deleted. (I have not written that part yet) You could do this today with Slony or Londiste

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Tom Lane
Per-Olov Esgard writes: > This is my setup: > - linux kernel 2.6.20.16 in a custom OS installation based on Fedora Core > 3, yes I know, stone age :-) > - memory 512 MB > - swap 512 MB > - cpu p4 2.8 GHz - single core - no hyper threading > - db encoding UTF-8 > - client encoding default Latin-1

Re: [GENERAL] syntax for updating an aliased table

2011-05-27 Thread Andy Chambers
On Thu, May 26, 2011 at 1:40 PM, Rick Genter wrote: > > The UPDATE statement when multiple tables are involved always drives me nuts. > I think what you need to do is remove all of the "old." from the SET clause > and use "triple." in the WHERE clause instead of "old." - and remove the old > tab

Re: [GENERAL] copy record?

2011-05-27 Thread Merlin Moncure
On Thu, May 26, 2011 at 3:23 PM, Gauthier, Dave wrote: > Hi: > > > > From within a perl/DBI script, I want to be able to make a copy of a record > in a table, changing only the value of the primary key.  I don't know in > advance what all the columns are, just the table name. > > > > I suppose I c

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Simon Riggs
On Fri, May 27, 2011 at 4:28 PM, Tom Lane wrote: > Hah, I replicated the problem.  Here is what's going on: the main loop > in PostgresMain is intended to do its work in MessageContext.  But if > ProcessCompletedNotifies does any work, it exits with > CurrentMemoryContext having been reset to Top

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Tom Lane
Simon Riggs writes: > On Fri, May 27, 2011 at 4:28 PM, Tom Lane wrote: >> I think the right fix is to make sure that ProcessCompletedNotifies >> saves and restores the call-time CurrentMemoryContext. > Can we put a WARNING in there if we try to commit while in TopMemoryContext? That has nothing

[GENERAL] adding applications to the stack builder

2011-05-27 Thread Gaetano Giunta
Hello I would like to know what is the process to get new applications accepted for inclusion in the stack builder (namely the eZ Publish cms). I would be ready spend some time to package the application according to some specific format, and to host the built package on some dedicated server i

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Per-Olov Esgard
Thank you very much for your fast answers (both Tom and Merlin), I really appreciate it. Do I have to send a proper bug report for this? We have this problem in our product now, so I volunteer to test a patch  :-)   Best regards, Per-Olov Esgård-Tom Lane wrote: - To: Per-Olov Esgard From

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Merlin Moncure
On Fri, May 27, 2011 at 11:12 AM, Per-Olov Esgard wrote: > Thank you very much for your fast answers (both Tom and Merlin), I really > appreciate it. > Do I have to send a proper bug report for this? > We have this problem in our product now, so I volunteer to test a patch  :-) download REL9_0_ST

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Tom Lane
I wrote: > I think the right fix is to make sure that ProcessCompletedNotifies > saves and restores the call-time CurrentMemoryContext. The patch committed here appears to fix it for me: http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=722548e4309c28631ada292fe6cad04ae8f9c151

[GENERAL] SELECT COUNT(*) execution time on large tables (v9.0.4-1)

2011-05-27 Thread Carlos Sotto Maior (SIM)
Hi, My application has a frequent need to issue a select count(*) on tables. Some have a large row count. (The example below are from a 5.7 M row; Some are larger). Issuing either SELECT COUNT(*) or SELECT COUNT() yelds a sequential scan on table; I have browsed catalog tables, digging for a

[GENERAL] Re: 500KB PDF files for postgresql8.3, which is the most efficient way?

2011-05-27 Thread Emi Lu
Hello, I'd like to have more comments about the following case: . 500KB per PDF file; 30 files per year . PSQL8.3 . struts2.2.3 + mybatis for sql operation . tomcat6 Added more info Solution: (1) Save pdfs to file system, only point file name in psql8.3 (2) Save

[GENERAL] 500KB PDF files for postgresql8.3, which is the most efficient way?

2011-05-27 Thread Emi Lu
Hello, I'd like to have more comments about the following case: . 500KB per PDF file; 30 files per year . PSQL8.3 Solution: (1) Save pdfs to file system, only point file name in psql8.3 (2) Save oids of pdfs into table (3) Save pdf files as bytea column in psql8.3 Pros a

[GENERAL] Inspecting a DB - psql or system tables ?

2011-05-27 Thread Andre Majorel
Suppose you want to write a program that connects to a PostgreSQL database and lists its tables and views, the type of their columns and their relationships (REFERENCES) for automatic joins. Would you look at the system tables (pg_class et al.) or the output of psql \d, \dt, etc ? While parsing t

Re: [GENERAL] Inspecting a DB - psql or system tables ?

2011-05-27 Thread fork
Andre Majorel teaser.fr> writes: > > Suppose you want to write a program that connects to a > PostgreSQL database and lists its tables and views, the type of > their columns and their relationships (REFERENCES) for automatic > joins. I personally would try to hit the "informat_schema", which is

Re: [GENERAL] Inspecting a DB - psql or system tables ?

2011-05-27 Thread Tomas Vondra
Dne 27.5.2011 19:24, Andre Majorel napsal(a): > Suppose you want to write a program that connects to a > PostgreSQL database and lists its tables and views, the type of > their columns and their relationships (REFERENCES) for automatic > joins. > > Would you look at the system tables (pg_class et

Re: [GENERAL] Inspecting a DB - psql or system tables ?

2011-05-27 Thread Andrew Sullivan
On Fri, May 27, 2011 at 08:26:33PM +0200, Tomas Vondra wrote: > > While parsing the output of psql is cumbersome, accessing the > > system tables seems more likely to break whenever a new version > > of PostgreSQL comes out. > > Really? Those catalogs are pretty stable, and when changed they're >

Re: [GENERAL] trigger - dynamic WHERE clause

2011-05-27 Thread Tarlika Elisabeth Schmitz
Hello Pavel, Thanks for taking the time to reply. On Fri, 27 May 2011 09:12:20 +0200 Pavel Stehule wrote: >Hello > >2011/5/26 Tarlika Elisabeth Schmitz : >> On Sun, 22 May 2011 20:39:01 +0200 >> Pavel Stehule wrote: >> >>>2011/5/22 Tarlika Elisabeth Schmitz >>>: EXECUTE 'SELECT 1 FROM ' ||

[GENERAL] Re: [SQL] Re: 500KB PDF files for postgresql8.3, which is the most efficient way?

2011-05-27 Thread Samuel Gendler
On Fri, May 27, 2011 at 9:15 AM, Emi Lu wrote: > > Solution: > > (1) Save pdfs to file system, only point file name in psql8.3 > > (2) Save oids of pdfs into table > > (3) Save pdf files as bytea column in psql8.3 > > > Pros and cons for (1), (2), (3), which is the most

[GENERAL] Shared Buffer Size

2011-05-27 Thread preetika tyagi
Hi All, I am little confused about the internal working of PostgreSQL. There is a parameter shared_buffer in postgres.conf and I am assuming that it is used for buffer management in PostgreSQL. If there is a need to bring in a new page in the buffer and size exceeds the shared_buffer limit, a vict

Re: [GENERAL] SELECT COUNT(*) execution time on large tables (v9.0.4-1)

2011-05-27 Thread David Johnston
Counting live data is inherently imprecise. There are supposedly some system tables that can give you rough numbers. You would be better off figuring out an alternative method to get the data you desire and stop continually recounting all 5.7M records. A Trigger driven counter, for insert and d

Re: [GENERAL] Shared Buffer Size

2011-05-27 Thread Derrick Rice
Check out the "Inside the PostgreSQL Buffer Cache" link here: http://projects.2ndquadrant.com/talks Thanks to Greg Smith (active here). Derrick On Fri, May 27, 2011 at 3:36 PM, preetika tyagi wrote: > Hi All, > > I am little confused about the internal working of PostgreSQL. There is a > param

[GENERAL] String library

2011-05-27 Thread Little, Douglas
I'm working a string parser. Is there a user module that expands the set of string functions? Doug Little Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide 500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-

Re: [GENERAL] Shared Buffer Size

2011-05-27 Thread preetika tyagi
Hi Derrick, Thank you for your response. I saw this document and trying to understand "Interaction with the Operating System Cache" which is mentioned in this document. I have the following question- Hows does the shared buffer in Postgres rely on the Operating System cache? Suppose my RAM is 8 G