Re: [GENERAL] Comparing txid_current() to xmin

2012-11-08 Thread Marko Kreen
On Wed, Nov 7, 2012 at 10:21 AM, Andres Freund wrote: > On Tue, Nov 06, 2012 at 02:55:40PM -0800, Mike Lewis wrote: >> I am trying to make a trigger that updates a row once and only once per >> transaction (even if this trigger gets fired multiple times). The general >> idea is that for a user we

[GENERAL] Running out of memory while making a join

2012-11-08 Thread Carlos Henrique Reimer
Hi, The following SQL join command runs the PostgreSQL server out of memory. The server runs on a box with Red Hat Enterprise Linux Server release 6.3 (Santiago) and PostgreSQL 8.3.21. select wm_nfsp from "5611_isarq".wm_nfsp left join "5611_nfarq".nfe on wm_nfsp.tpdoc = 7 where 1 = 1 and wm_nfsp

Re: [GENERAL] Comparing txid_current() to xmin

2012-11-08 Thread Andres Freund
On Thu, Nov 08, 2012 at 11:47:37AM +0200, Marko Kreen wrote: > On Wed, Nov 7, 2012 at 10:21 AM, Andres Freund wrote: > > On Tue, Nov 06, 2012 at 02:55:40PM -0800, Mike Lewis wrote: > >> I am trying to make a trigger that updates a row once and only once per > >> transaction (even if this trigger g

Re: [GENERAL] Running out of memory while making a join

2012-11-08 Thread Craig Ringer
On 11/08/2012 06:20 PM, Carlos Henrique Reimer wrote: > Is there a way to make PostgreSQL 8.3.21 server stop memory bound > backends as PostgreSQL 9.0.0 does? Are there any triggers on the table? What's the setting for work_mem? -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] Problem with streaming replication over SSL

2012-11-08 Thread Albe Laurenz
I wrote: >Magnus Hagander wrote: > I have streaming replication configured over SSL, and > there seems to be a problem with SSL renegotiation. >>> [...] > After that, streaming replication reconnects and resumes working. > > Is this an oversight in the replication protocol, or i

Re: [GENERAL] Running out of memory while making a join

2012-11-08 Thread Carlos Henrique Reimer
Hi Craig, work_mem is defined with 10MB and yes, there are triggers defined on both tables: FiscalWeb=# \d "5611_isarq".wm_nfsp Table "5611_isarq.wm_nfsp" Column | Type | Modifiers ---+---+--- tpdoc | smallint |

Re: [GENERAL] How is execution plan cost calculated for index scan

2012-11-08 Thread Jeff Janes
On Wed, Nov 7, 2012 at 11:17 PM, 高健 wrote: > Hi all: > > > > I want to see the explain plan for a simple query. My question is : How > is the cost calculated? > > > > The cost parameter is: > > > > random_page_cost= 4 > > seq_page_cost = 1 > > cpu_tuple_cost =0.01 >

Re: [GENERAL] How is execution plan cost calculated for index scan

2012-11-08 Thread Tom Lane
=?UTF-8?B?6auY5YGl?= writes: > I want to see the explain plan for a simple query. My question is : How > is the cost calculated? In the case you're looking at, it's basically one random index page fetch plus one random heap page fetch (hence 8.0), plus assorted CPU costs making up the other

Re: [GENERAL] Use order by clause, got index scan involved

2012-11-08 Thread Jeff Janes
On Wed, Nov 7, 2012 at 11:41 PM, 高健 wrote: > Hi all: > > > > What confused me is that: When I select data using order by clause, I > got the following execution plan: > > > > postgres=# set session > enable_indexscan=true; > > > SET > > > postgres=# explain SELECT * FROM pg_proc ORDER BY > oid;

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Tianyin Xu
Hi, Pavel, Bruce, Thanks for the explanation! I have another question regarding the regress test suite. What does the test result mean to the users/administrators? Are they the basic functions that have to be supported by PG server? Or, they are just some benchmarks (failure is ok?) Under certa

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Pavel Stehule
Hello 2012/11/8 Tianyin Xu : > Hi, Pavel, Bruce, > > Thanks for the explanation! > > I have another question regarding the regress test suite. > > What does the test result mean to the users/administrators? Are they the > basic functions that have to be supported by PG server? Or, they are just >

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Jeff Janes
On Thu, Nov 8, 2012 at 10:47 AM, Tianyin Xu wrote: > Hi, Pavel, Bruce, > > Thanks for the explanation! > > I have another question regarding the regress test suite. > > What does the test result mean to the users/administrators? Are they the > basic functions that have to be supported by PG server

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Andres Freund
On 2012-11-08 10:47:18 -0800, Tianyin Xu wrote: > (p.s., in the default configuration, all the test suites are passed.) What did you change? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Tianyin Xu
Thanks a lot, Pavel, Jeff, Andres! I just changed the configuration file, postgresql.conf. Using the default one, all the regress tests are passed (so it should not be the block size?). But when I changed something, quite a number of tests are failed. I looked at the regression.diffs file, but I

[GENERAL] Message: incomplete startup packet

2012-11-08 Thread Rodrigo Pereira da Silva
Hi Guys, We are having a problem with our pgsql 9.1 on Linux(Debian). Suddently, the database stop working and the logs shows the statements below just before the problem. Any thoughts? 2012-11-08 02:46:44.216 CST 0 509b70fb.4570LOG: execute S_2: COMMIT 20

Re: [GENERAL] Message: incomplete startup packet

2012-11-08 Thread David Boreham
On 11/8/2012 2:05 PM, Rodrigo Pereira da Silva wrote: Hi Guys, We are having a problem with our pgsql 9.1 on Linux(Debian). Suddently, the database stop working and the logs shows the statements below just before the problem. Any thoughts? Just a word of caution

[GENERAL] pg_hba.conf directory?

2012-11-08 Thread Matt Zagrabelny
Hello, I've searched the mailing list archives and google regarding using a directory to contain pg_hba.conf snippets. Does such a feature exist for any version of PG? Would this be a better question for a pg dev mailing list? Please Cc me, I am not (yet) subscribed to the list. Thanks! -Matt

[GENERAL] Range constraint with unique index

2012-11-08 Thread Steven Plummer
I have a table that has an integer and a int8range. What I want is to add a constraint that stops anyone adding This email transmission is confidential and intended solely for the person or organisation to whom it is addressed. If you are not the intended recipient, you must not copy, dis

Re: [GENERAL] Range constraint with unique index

2012-11-08 Thread Kevin Grittner
Steven Plummer wrote: > I have a table that has an integer and a int8range. > What I want is to add a constraint that stops anyone adding Maybe you want an exclusion constraint: http://www.postgresql.org/docs/9.0/static/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION For example: CREATE EXTE

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Craig Ringer
On 11/09/2012 03:28 AM, Tianyin Xu wrote: > Thanks a lot, Pavel, Jeff, Andres! > > I just changed the configuration file, postgresql.conf. > > Using the default one, all the regress tests are passed (so it should > not be the block size?). But when I changed something, quite a number > of tests are

Re: [GENERAL] pg_hba.conf directory?

2012-11-08 Thread Craig Ringer
On 11/09/2012 04:49 AM, Matt Zagrabelny wrote: > Hello, > > I've searched the mailing list archives and google regarding using a > directory to contain pg_hba.conf snippets. Does such a feature exist > for any version of PG? If I understand you correctly, you want a `pg_hba.conf.d` where PostgreSQL

Re: [GENERAL] pg_hba.conf directory?

2012-11-08 Thread Craig Ringer
On 11/09/2012 04:49 AM, Matt Zagrabelny wrote: > Hello, > > I've searched the mailing list archives and google regarding using a > directory to contain pg_hba.conf snippets. Does such a feature exist > for any version of PG? Oh, by the way; proposals are currently being discussed on pgsql-hackers a

Re: [GENERAL] Unexpectedly high disk space usage

2012-11-08 Thread Lists
On 11/07/2012 12:42 PM, Tom Lane wrote: ... because it >occasionally causes transactions and queries to hang when an update >causes a vacuum mid-day, effectively taking us offline randomly. I suspect this claim is based on ancient and no longer very relevant experience. Even so, if I felt the ne

Re: [GENERAL] Unexpectedly high disk space usage

2012-11-08 Thread Tom Lane
Lists writes: > Even so, if I felt the need to keep autovacuum off, what would I need to > run regularly in order to keep things neat and tidy under the hood? > Would a simple "vacuum" within each database suffice? Should I be logged > in as the database owner or as an administrative user? A p

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Tianyin Xu
Thanks, Craig, Yes, I know "context diff". What I don't know is whether + or - some rows is a big problem, let's say correctness problem. I didn't write the test cases so I don't know what these test cases are exactly doing. If you tell me the failure of these test cases are severe and not accepta

Re: [GENERAL] Use order by clause, got index scan involved

2012-11-08 Thread 高健
Hi Jeff Thank you for your reply. I will try to learn about effective_cache_size . Jian gao 2012/11/9 Jeff Janes > On Wed, Nov 7, 2012 at 11:41 PM, 高健 wrote: > >> Hi all: >> >> >> >> What confused me is that: When I select data using order by clause, I >> got the following execution plan: >

Re: [GENERAL] How is execution plan cost calculated for index scan

2012-11-08 Thread 高健
Hi Jeff Thank you very much. >I determined this by changing each cost parameter and running explain, >to see how much each one changed the cost estimate (after verifying >the overall plan did not change). your method is so smart! Jian Gao 2012/11/9 Jeff Janes > On Wed, Nov 7, 2012 at 11:17 P

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Bruce Momjian
On Thu, Nov 8, 2012 at 05:37:22PM -0800, Tianyin Xu wrote: > Thanks, Craig, > > Yes, I know "context diff". What I don't know is whether + or - some rows is a > big problem, let's say correctness problem. I didn't write the test cases so I > don't know what these test cases are exactly doing. > I

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Craig Ringer
On 11/09/2012 09:37 AM, Tianyin Xu wrote: > Thanks, Craig, > > Yes, I know "context diff". What I don't know is whether + or - some > rows is a big problem, let's say correctness problem. I didn't write > the test cases so I don't know what these test cases are exactly doing. The SQL to the test ca

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Tianyin Xu
Ok, I agree that "2147483647" is not a reasonable setting. But what's the definition of "reasonable"? I just want to study the impact of the setting so I test the big number first. Having the setting: cpu_index_tuple_cost = 10 I still get failures of "create_index", "inherit", "join", "stats".

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Tianyin Xu
Thanks, Craig. That makes sense. Yes, it's quite a number of work to do. :-) I'll take a look at the comments and code and try to understand it. T On Thu, Nov 8, 2012 at 6:28 PM, Craig Ringer wrote: > On 11/09/2012 09:37 AM, Tianyin Xu wrote: > > Thanks, Craig, > > > > Yes, I know "context di

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Alvaro Herrera
Craig Ringer wrote: > It'd be nice to split the tests up into clearer groups - "will fail if > planner settings are changed; WARNING", "will fail only if incorrect > result is returned; FATAL" etc. Right now, AFAIK that hasn't been done. Not sure that's enough of an improvement. Really, these te

Re: [GENERAL] Unexpectedly high disk space usage

2012-11-08 Thread Scott Marlowe
On Thu, Nov 8, 2012 at 6:05 PM, Lists wrote: > On 11/07/2012 12:42 PM, Tom Lane wrote: >>> >>> ... because it >>> >occasionally causes transactions and queries to hang when an update >>> >causes a vacuum mid-day, effectively taking us offline randomly. >> >> I suspect this claim is based on ancien

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Alvaro Herrera
Tianyin Xu wrote: > Ok, I agree that "2147483647" is not a reasonable setting. But what's the > definition of "reasonable"? I just want to study the impact of the setting > so I test the big number first. Please don't top-post. Those values are not wrong. They just don't match what our current t

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Tianyin Xu
On Thu, Nov 8, 2012 at 6:40 PM, Alvaro Herrera wrote: > Tianyin Xu wrote: > > Ok, I agree that "2147483647" is not a reasonable setting. But what's > the > > definition of "reasonable"? I just want to study the impact of the > setting > > so I test the big number first. > > Please don't top-post.

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Craig Ringer
On 11/09/2012 10:36 AM, Alvaro Herrera wrote: > Craig Ringer wrote: > >> It'd be nice to split the tests up into clearer groups - "will fail if >> planner settings are changed; WARNING", "will fail only if incorrect >> result is returned; FATAL" etc. Right now, AFAIK that hasn't been done. > Not su

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Bruce Momjian
On Fri, Nov 9, 2012 at 10:50:42AM +0800, Craig Ringer wrote: > On 11/09/2012 10:36 AM, Alvaro Herrera wrote: > > Craig Ringer wrote: > > > >> It'd be nice to split the tests up into clearer groups - "will fail if > >> planner settings are changed; WARNING", "will fail only if incorrect > >> result

[GENERAL] Using hstore, json, lo, etc from C extensions?

2012-11-08 Thread Craig Ringer
Hi all With the growing number of extensions that expose useful and increasingly widely used custom data types, I'm wondering: is there any way to use them from a C extension without going through the SPI? A look at the sources for hstore and json shows that they mostly define static functions an

Re: [GENERAL] Running out of memory while making a join

2012-11-08 Thread Craig Ringer
On 11/08/2012 11:35 PM, Carlos Henrique Reimer wrote: > Hi Craig, > > work_mem is defined with 10MB and yes, there are triggers defined on > both tables Come to think of it, the triggers don't make any difference to memory use for a SELECT anyway. Your work_mem is perfectly reasonable. The plan

Re: [GENERAL] Using hstore, json, lo, etc from C extensions?

2012-11-08 Thread Tom Lane
Craig Ringer writes: > With the growing number of extensions that expose useful and > increasingly widely used custom data types, I'm wondering: is there any > way to use them from a C extension without going through the SPI? Invoke the extension's exposed SQL functions at fmgr level?

Re: [GENERAL] Using hstore, json, lo, etc from C extensions?

2012-11-08 Thread Craig Ringer
On 11/09/2012 02:12 PM, Tom Lane wrote: > Craig Ringer writes: >> With the growing number of extensions that expose useful and >> increasingly widely used custom data types, I'm wondering: is there any >> way to use them from a C extension without going through the SPI? > Invoke the extension's ex