Re: [GENERAL] Performance degrades until dump/restore

2012-04-18 Thread Willy-Bas Loos
what performance, insert or select? On Thu, Apr 19, 2012 at 8:35 AM, Chris wrote: > Hello, > I'm using PG 9.1. Data is streaming into one particularly large table (at > 11 million rows currently) on a constant basis. It is pretty much all > inserts, very little updates or deletes (if any). > A

Re: [GENERAL] Performance degrades until dump/restore

2012-04-18 Thread Chris Travers
Is autovacuum running? Are tables being analyzed from time to time? Best Wishes, Chris Travers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Performance degrades until dump/restore

2012-04-18 Thread Chris
Hello, I'm using PG 9.1. Data is streaming into one particularly large table (at 11 million rows currently) on a constant basis. It is pretty much all inserts, very little updates or deletes (if any). After a week or so, query performance on this table turns abysmal. If I dump the db, then resto

Re: [GENERAL] Log to syslog in one line

2012-04-18 Thread Sergey Konoplev
On Wed, Apr 18, 2012 at 8:55 AM, Roberto De Oliveira wrote: > postgres database. For this purpose , I configured postgres to send > all query to syslog-ng to parser them and store them in another > database, but I have a issue: all query splits into diferents lines > making imposible work with the

[GENERAL] remove some rows from resultset

2012-04-18 Thread Ondrej Ivanič
Hi, I have the following table: org_id | contract_name | org_specific_rule | count --+--+---+--- smpj28p2 | Group 123| f | 3 smpj28p2 | Group 2 | f | 3 smpj28p2 | Group 2 | t

Re: [GENERAL] Compile docs on ArchLinux

2012-04-18 Thread Michael Paquier
On Wed, Apr 18, 2012 at 11:08 PM, Tom Lane wrote: > Michael Paquier writes: > > is it possible to compile postgres docs with docbook 4.5? At config step, > > it looks that only docbook 4.2 is supported. > > If ArchLinux doesn't provide the 4.2 DTD, you ought to complain to > whoever packages th

Re: [GENERAL] Two instances show same databases

2012-04-18 Thread Jose Hales-Garcia
On Apr 18, 2012, at 2:00 PM, Scott Mead wrote: > Then you need to connect to the 9.1.3 DB with the 9.1.3 port and the 8.3.5 DB > with the 8.3.5 port: > > psql -p 5432 -l > would show 8.3.5 databases > > psql -p 5433 -l > >would show 9.1.3 databases That solves my problem. Thank you,

Re: [GENERAL] "EXECUTE command-string INTO target USING expression" isn't working

2012-04-18 Thread Bartosz Dmytrak
Hi, I have create small proof of concept (pg v. 9.1.3): 1. to map Your dynamic function: CREATE OR REPLACE FUNCTION public.testReturnDynamic(OUT "retValue" TEXT) RETURNS text AS $BODY$ BEGIN "retValue" = 'aaa'; END; $BODY$ LANGUAGE plpgsql SECURITY DEFINER; 2. to test function SELECT public.tes

Re: [GENERAL] Two instances show same databases

2012-04-18 Thread Scott Mead
On Wed, Apr 18, 2012 at 7:45 PM, Jose Hales-Garcia < jose.halesgar...@stat.ucla.edu> wrote: > > Hello, > > I'm setting up a second instance on a server. The instance versions are > 8.3.5 (original instance) and 9.1.3 (the new instance I'm attempting to set > up). > > I believe I have followed the

[GENERAL] "EXECUTE command-string INTO target USING expression" isn't working

2012-04-18 Thread Ken Winter
I swear this used to work, but in PostgreSQL 9.1 it doesn't work any more... CASE 1: If I write it like this: FOR func IN ( SELECT * FROM information_schema.routines WHERE routine_schema = 'tests' ) LOOP q := 'SELECT tests.' || fun

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Wed, Apr 18, 2012 at 3:47 PM, Tom Lane wrote: > Eliot Gable writes: > > On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: > >> However, there still might be an issue, because the CONTEXT trace that > >> you showed certainly seemed to point where you thought it did. > > > After re-reading the

Re: [GENERAL] Two instances show same databases

2012-04-18 Thread Raghavendra
On Thu, Apr 19, 2012 at 1:15 AM, Jose Hales-Garcia < jose.halesgar...@stat.ucla.edu> wrote: > > Hello, > > I'm setting up a second instance on a server. The instance versions are > 8.3.5 (original instance) and 9.1.3 (the new instance I'm attempting to set > up). > > I believe I have followed the

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Tom Lane
Eliot Gable writes: > On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: >> However, there still might be an issue, because the CONTEXT trace that >> you showed certainly seemed to point where you thought it did. > After re-reading the LOCK modes and realizing that ACCESS SHARE is not the > same a

[GENERAL] Two instances show same databases

2012-04-18 Thread Jose Hales-Garcia
Hello, I'm setting up a second instance on a server. The instance versions are 8.3.5 (original instance) and 9.1.3 (the new instance I'm attempting to set up). I believe I have followed the steps in setting up a second instance faithfully. The new instance starts up, but I'm seeing that when

[GENERAL] spanish locale question

2012-04-18 Thread jbiskofski
Hello everyone, I have a lc_collate problem. Im in Mexico and I need the following three lastnames to be sorted this way : álvarez ( accent on first a ) chavez cota Using the default locale on my mac ( en_US ) I end up with : chavez cota álvarez So I switched to es_ES.ISO8859-15 and that gives

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread Raghavendra
AFAIK, I dont see any catalog's giving that information. --- Regards, Raghavendra EnterpriseDB Corporation Blog: http://raghavt.blogspot.com/ On Wed, Apr 18, 2012 at 7:20 PM, F. BROUARD / SQLpro < sql...@club-internet.fr> wrote: > Hi, > > is there anyway to have the value of Catalog version nu

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: > Eliot Gable writes: > > While attempting to reproduce this issue in a sanitized set of tables, > > functions, and triggers, I was able to locate the issue. Apparently I did > > have another function call in there inside my summarize_individuals(

[GENERAL] somewhat high profile project using PostgreSQL

2012-04-18 Thread Welty, Richard
some of you may have seen this in the NYT two weeks ago: http://bits.blogs.nytimes.com/2012/04/05/pentagon-pushes-crowdsourced-manufacturing/ just FYI, the database being used by the MIT/GE team is PostgreSQL 9.1.3 cheers, richard

Re: [GENERAL] Feature Proposal: Constant Values in Columns or Foreign Keys

2012-04-18 Thread Nils Gösche
Bartosz Dmytrak wrote: > according to DB theory: > 1NF: Table faithfully represents a relation and has no repeating groups > 2NF: No non-prime attribute in the table is functionally dependent on a > proper subset of anycandidate key. > source: http://en.wikipedia.org/wiki/Database_normalization#N

[GENERAL] pgstat wait timeout

2012-04-18 Thread Efraín Déctor
Hello list: Today I started to see this messages on the PostgreSQL log: 2012-04-18 00:01:05 UTC : @ :WARNING: 01000: pgstat wait timeout 2012-04-18 00:01:05 UTC : @ :LOCATION: backend_read_statsfile, pgstat.c:3807 I searched and to fix it it was recommended to disable autovacuum, I did it an

Re: [GENERAL] Feature Proposal: Constant Values in Columns or Foreign Keys

2012-04-18 Thread Bartosz Dmytrak
Hi, according to DB theory: *1NF: Table faithfully represents a relation and has no repeating groups* *2NF: No non-prime attribute in the table is functionally dependent on a proper subset of anycandidate key.* source: http://en.wikipedia.org/wiki/Database_normalization#Normal_forms so these const

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Tom Lane
Eliot Gable writes: > While attempting to reproduce this issue in a sanitized set of tables, > functions, and triggers, I was able to locate the issue. Apparently I did > have another function call in there inside my summarize_individuals() > function and that other function was marked as STABLE w

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Wed, Apr 18, 2012 at 10:18 AM, Eliot Gable < egable+pgsql-gene...@gmail.com> wrote: > On Tue, Apr 17, 2012 at 7:11 PM, Tom Lane wrote: > >> Eliot Gable writes: >> > When the trigger fires, I get this in my postgres.log file: >> > 2012-04-17 16:57:15 >> EDT|test_db|169.254.5.138(56783)||[u

Re: [GENERAL] Feature Proposal: Constant Values in Columns or Foreign Keys

2012-04-18 Thread Nils Gösche
Vincent Veyron wrote: > use a trigger on each of the derived tables, that cancels any insert if > the same id already exists in the other table? Yes, that would work. > You don't say how your data gets inserted, but considering how > complicated your preferred option looks, I have to ask why you

Re: [GENERAL] Feature Proposal: Constant Values in Columns or Foreign Keys

2012-04-18 Thread Vincent Veyron
Le mercredi 18 avril 2012 à 00:06 +0200, Nils Gösche a écrit : > Bartosz Dmytrak wrote: > > > > The reason I like this particular way of modeling the data is that I have a > guarantee that there won't be an entry in both derived tables at the same > time for the same row in the base table; also,

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Tue, Apr 17, 2012 at 7:11 PM, Tom Lane wrote: > Eliot Gable writes: > > When the trigger fires, I get this in my postgres.log file: > > 2012-04-17 16:57:15 EDT|test_db|169.254.5.138(56783)||[unknown]|30474 > > WARNING: Failed to materialize the live_user_activity table; code > 0A000: >

Re: [GENERAL] Compile docs on ArchLinux

2012-04-18 Thread Tom Lane
Michael Paquier writes: > is it possible to compile postgres docs with docbook 4.5? At config step, > it looks that only docbook 4.2 is supported. If ArchLinux doesn't provide the 4.2 DTD, you ought to complain to whoever packages that. On my Fedora 16 box, for example, a wide range of docbook v

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread F. BROUARD / SQLpro
Hi, is there anyway to have the value of Catalog version number in a query ? I do not see it in pg_settings... A + Le 18/04/2012 15:35, Raghavendra a écrit : On Wed, Apr 18, 2012 at 6:22 PM, F. BROUARD / SQLpro mailto:sql...@club-internet.fr>> wrote: Hi there, when creating a table

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread Chetan Suttraway
On Wed, Apr 18, 2012 at 6:22 PM, F. BROUARD / SQLpro < sql...@club-internet.fr> wrote: > Hi there, > > when creating a tablespace pointing to an existing directory, PG create a > subderictory with this pattern : > > PG_???_! > > where ??? is the version (by instance 9.1) > > but I don't kn

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread F. BROUARD / SQLpro
Thanks ! Le 18/04/2012 15:35, Raghavendra a écrit : On Wed, Apr 18, 2012 at 6:22 PM, F. BROUARD / SQLpro mailto:sql...@club-internet.fr>> wrote: Hi there, when creating a tablespace pointing to an existing directory, PG create a subderictory with this pattern : PG_???_!!

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread Raghavendra
On Wed, Apr 18, 2012 at 6:22 PM, F. BROUARD / SQLpro < sql...@club-internet.fr> wrote: > Hi there, > > when creating a tablespace pointing to an existing directory, PG create a > subderictory with this pattern : > > PG_???_! > > where ??? is the version (by instance 9.1) > > but I don't kn

[GENERAL] - tablespace and directory

2012-04-18 Thread F. BROUARD / SQLpro
Hi there, when creating a tablespace pointing to an existing directory, PG create a subderictory with this pattern : PG_???_! where ??? is the version (by instance 9.1) but I don't know what is !, actually 201105231 I can imagine that is a build version, but how can I obtain

[GENERAL] Detecting corrupt table

2012-04-18 Thread David Larochelle
Our database has some corrupt tables and I'm trying to figure out what data can be salvaged and what needs to be restored from backup or regenerated. Initially I tried running select count(*) on all user tables. While this did detect some corrupt tables, it missed others. For example, I was able t

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
No, I have lots of calls to current_timestamp inside volatile functions which lock tables without complaints. I am beginning to think I hit some sort of bug. This is PostgreSQL 9.0.1. On Tue, Apr 17, 2012 at 5:55 PM, Michael Nolan wrote: > > > On Tue, Apr 17, 2012 at 5:20 PM, Eliot Gable wrote

[GENERAL] Log to syslog in one line

2012-04-18 Thread Roberto De Oliveira
Hi everybody, I am interesting on do some kind of audit on a web system through his postgres database. For this purpose , I configured postgres to send all query to syslog-ng to parser them and store them in another database, but I have a issue: all query splits into diferents lines making imposibl

Re: [GENERAL] Compile docs on ArchLinux

2012-04-18 Thread Michael Paquier
> > I don't think it will be solved - I reported it in november 2009 > : http://archives.postgresql.org/pgsql-general/2009-11/msg00325.php > then asked on serverfault > : > http://serverfault.com/questions/83206/how-to-build-docbook-4-2-docs-on-arch-linux Thanks, I saw those posts while looking fo

Re: [GENERAL] Compile docs on ArchLinux

2012-04-18 Thread hubert depesz lubaczewski
On Wed, Apr 18, 2012 at 01:25:14PM +0900, Michael Paquier wrote: > Hi all, > > Under Arch, I am not able to compile Postgres docs. > > By having a look at config.log, it cannot find the docbook folder: > configure:29356: checking for DocBook V4.2 > onsgmls:/etc/xml/catalog:2:78:E: name expected >

Re: [GENERAL] Feature Proposal: Constant Values in Columns or Foreign Keys

2012-04-18 Thread Nils Gösche
Tom Lane wrote: > =?UTF-8?Q?Nils_G=C3=B6sche?= writes: > > I was quite surprised to find that this wasn't possible. Is there any > > good reason why not? > > It's contrary to SQL standard is why not. And it's not just a matter > of > being outside the spec, as inheritance is; this is messing w