Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-25 Thread Amit Kapila
On Monday, September 24, 2012 8:19 PM Tom Lane wrote: Amit Kapila amit.kap...@huawei.com writes: Below test results into Loop: [ AFTER INSERT trigger does another insert into its target table ] Well, of course. The INSERT results in scheduling another AFTER event. I understand

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-25 Thread Adrian Klaver
On 09/24/2012 06:40 PM, David Johnston wrote: Server parameter: server_version_num http://www.postgresql.org/docs/9.2/interactive/runtime-config-preset.html To elaborate: test= SELECT current_setting('server_version_num'); current_setting - 90009 And yes, I know it needs

Re: [GENERAL] Custom prompt

2012-09-25 Thread craig
Aha, exactly what I was looking for. Thanks! Well I certainly feel dumb. The answer is right in the documentation, I just failed to find it (I did look first). The system-wide psqlrc, and the ~/.psqlrc files fit the bill perfectly, and the documentation explains it all quite nicely. I

Re: [GENERAL] plpython2u not getting any output - on independent script I get the desired output

2012-09-25 Thread Adrian Klaver
On 09/24/2012 08:27 PM, ichBinRene wrote: Hello everybody and thanks for your attention. I have this function: ### CREATE OR REPLACE FUNCTION check_current_xlog() RETURNS text AS $$ import subprocess p =

[GENERAL] unique constraint with significant nulls?

2012-09-25 Thread Mike Blackwell
How would one go about building a multi-column unique constraint where null is a significant value, eg. (1, NULL) (2, NULL)? I see a number of references to not being able to use an index for this, but no mention of an alternative. Any pointers would be appreciated

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread hubert depesz lubaczewski
On Tue, Sep 25, 2012 at 10:05:15AM -0500, Mike Blackwell wrote: How would one go about building a multi-column unique constraint where null is a significant value, eg. (1, NULL) (2, NULL)? I see a number of references to not being able to use an index for this, but no mention of an

Re: [GENERAL] Running CREATE only on certain Postgres versions

2012-09-25 Thread Igor Neyman
-Original Message- From: Daniele Varrazzo [mailto:daniele.varra...@gmail.com] Sent: Tuesday, September 25, 2012 11:26 AM To: Adrian Klaver Cc: David Johnston; Robert James; Igor Neyman; Postgres General Subject: Re: [GENERAL] Running CREATE only on certain Postgres versions On

[GENERAL] PostgreSQL data loads - turn off WAL

2012-09-25 Thread hartrc
My version: PostgreSQL v9.1.5 Version string: PostgreSQL 9.1.5 on x86_64-unknown-linux-gnu, compiled by gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973], 64-bit Basically my question is: Is there currently any way to avoid wal generation during data load for given tables and then have

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread Mike Blackwell
Interesting, but that assumes there's a value to use in the coalesce that isn't a valid data value. __ *Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnelley* 1750 Wallace Ave |

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread hubert depesz lubaczewski
On Tue, Sep 25, 2012 at 11:34:36AM -0500, Mike Blackwell wrote: Interesting, but that assumes there's a value to use in the coalesce that isn't a valid data value. no, it doesn't. Best regards, depesz -- The best thing about modern society is how easy it is to avoid contact with it.

[GENERAL] pljava and Postgres 9.2.1

2012-09-25 Thread Misa Simic
Hi, We have a bit strange error with pljava deploy and postgresql 9.2.1... We are not sure is it related to pljava itself, because of when we add to postgresql.conf: custom_variable_classes = 'pljava' we cant start Postgres any more... server log says; LOG: unrecognized configuration

Re: [GENERAL] pljava and Postgres 9.2.1

2012-09-25 Thread Tom Lane
Misa Simic misa.si...@gmail.com writes: We have a bit strange error with pljava deploy and postgresql 9.2.1... We are not sure is it related to pljava itself, because of when we add to postgresql.conf: custom_variable_classes = 'pljava' we cant start Postgres any more...

Re: [GENERAL] pljava and Postgres 9.2.1

2012-09-25 Thread Misa Simic
Thanks Tom, without custom_variable_classes = 'pljava' but with pljava.classpath = pathTopljava.jar everything works fine.. Many thanks, Misa 2012/9/25 Tom Lane t...@sss.pgh.pa.us Misa Simic misa.si...@gmail.com writes: We have a bit strange error with pljava deploy and postgresql

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread Andreas Joseph Krogh
On 09/25/2012 05:05 PM, Mike Blackwell wrote: How would one go about building a multi-column unique constraint where null is a significant value, eg. (1, NULL) (2, NULL)? I see a number of references to not being able to use an index for this, but no mention of an alternative. Any pointers

[GENERAL] Rank based on the number of matching OR fields?

2012-09-25 Thread W. Matthew Wilson
I want to run a query like to_tsquery(A | B | C) and then rank the results so that if a document contained A, B, and C, then it would rank above a document that just had some subset. How would I do such a thing? -- W. Matthew Wilson m...@tplus1.com http://tplus1.com -- Sent via pgsql-general

Re: [GENERAL] Rank based on the number of matching OR fields?

2012-09-25 Thread François Beausoleil
Le 2012-09-25 à 14:16, W. Matthew Wilson a écrit : I want to run a query like to_tsquery(A | B | C) and then rank the results so that if a document contained A, B, and C, then it would rank above a document that just had some subset. How would I do such a thing?

[GENERAL] idle in transaction query makes server unresponsive

2012-09-25 Thread Scot Kreienkamp
Hi everyone, I have a problem that I've been struggling with for quite some time. Every once in a while I will get a connection that goes to idle in transaction on an in-house programmed application that connects with JDBC. That happens fairly regularly and the programmers are trying to

Re: [GENERAL] idle in transaction query makes server unresponsive

2012-09-25 Thread John R Pierce
On 09/25/12 12:23 PM, Scot Kreienkamp wrote: I have a problem that I've been struggling with for quite some time. Every once in a while I will get a connection that goes to idle in transaction on an in-house programmed application that connects with JDBC. That happens fairly regularly and

Re: [GENERAL] idle in transaction query makes server unresponsive

2012-09-25 Thread Scot Kreienkamp
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of John R Pierce Sent: Tuesday, September 25, 2012 3:53 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] idle in transaction query makes server unresponsive

Re: [GENERAL] Rank based on the number of matching OR fields?

2012-09-25 Thread Joel Hoffman
If you're easily able to do it, (i.e. you're building rather than receiving the query), you could rank them by the conjunction of the search terms first: ORDER BY ts_rank(vector, to_tsquery('A B C')) desc, ts_rank(vector, to_tsquery('A | B | C')) desc Or just explicitly order by whether the

Re: [GENERAL] idle in transaction query makes server unresponsive

2012-09-25 Thread John R Pierce
On 09/25/12 1:35 PM, Scot Kreienkamp wrote: The problem is how do I investigate this when PG is entirely unresponsive? Why is it becoming unresponsive, and how do I prevent the PG server from becoming unresponsive? I think I'd push that 9.1.latest upgrade ASAP, and then see if this problem

Re: [GENERAL] idle in transaction query makes server unresponsive

2012-09-25 Thread Thomas Kellerer
Scot Kreienkamp wrote on 25.09.2012 22:35: The application is using a pooler and generally runs around 100 connections, but I've seen it as high as 200 during the day for normal use. It's on a large server; 64 cores total and about 500 gigs of memory. That's one of the reasons I left it at 512

[GENERAL] 8.4.13 Windows Service fails to start

2012-09-25 Thread malcolm . sievwright
Folks, Apologies for the long post but I want to put in as much detail as possible I just upgraded from 8.4.1 to 8.4.13 on my laptop (Vista 32 bit) and the installation seemed to go fine. However, when I try and start the windows service I get an error message, after a minute or so, saying:

Re: [GENERAL] Memory issues

2012-09-25 Thread Shiran Kleiderman
Hi Thanks for your answer. I understood that the server is ok memory wise. What can I check on the client side or the DB queries? Thank u. On Wed, Sep 26, 2012 at 2:56 AM, Scott Marlowe scott.marl...@gmail.comwrote: On Mon, Sep 24, 2012 at 12:45 AM, Shiran Kleiderman shira...@gmail.com wrote:

Re: [GENERAL] Memory issues

2012-09-25 Thread Scott Marlowe
On Mon, Sep 24, 2012 at 12:45 AM, Shiran Kleiderman shira...@gmail.com wrote: Hi, I'm using and Amazon ec2 instance with the following spec and the application that I'm running uses a postgres DB 9.1. The app has 3 main cron jobs. Ubuntu 12, High-Memory Extra Large Instance 17.1 GB of

Re: [GENERAL] PostgreSQL data loads - turn off WAL

2012-09-25 Thread Jayadevan M
Hi, Basically my question is: Is there currently any way to avoid wal generation during data load for given tables and then have point in time recovery after that? Please have a look at unlogged and temporary options here - http://www.postgresql.org/docs/9.1/static/sql-createtable.html I don't

Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-25 Thread Alban Hertroys
But some other databases like Oracle handles the scenario reported but not loop. To handle for After triggers, there is mutation table concept in Oracle due to which it errors out and for Before triggers, it errors out with maximum number of recursive SQL levels(50) exceeded. Oracle uses

[GENERAL] Multiple Schema and extensions

2012-09-25 Thread Alan Nilsson
Is it the case that extensions can be added to only one schema? If so, what is the recommended practice for accessing a function from an extension in multiple schemas? Is it *ok* to load the extension in the pg_catalog schema so functions can be accessed by unqualified names? Is it *better*