Re: [GENERAL] explain plan visibility

2012-11-12 Thread Albe Laurenz
高健 wrote: Please let me dig it a little more: I think that when a session is accessing a postgersql table. It will be influenced by the followings: Really old data (needed to be vacuumed, eg: old image at one day ago). Recent data (committed and uncommitted), because they are

Re: [GENERAL] Understanding streaming replication

2012-11-12 Thread Albe Laurenz
I'll try to answer the questions I can. Pawel Veselov wrote: I've been struggling with understanding all the necessary pieces for streaming replication. So I put down the pieces as I did understand them, and would appreciate if you guys could point out any of the stuff I understood or have

[GENERAL] PostgreSQL and a clustered file system

2012-11-12 Thread Ivan Voras
Hello, Is anyone running PostgreSQL on a clustered file system on Linux? By clustered I actually mean shared, such that the same storage is mounted by different servers at the same time (of course, only one instance of PostgreSQL on only one server can be running on such a setup, and there are a

Re: [GENERAL] integer instead of 'double precision'?

2012-11-12 Thread Willy-Bas Loos
On Fri, Sep 9, 2011 at 5:09 PM, Guillaume Lelarge guilla...@lelarge.infowrote: You divide an integer with an integer, that should give you an integer. Can you tell me the reasoning behind that idea? Is it a rule that the output type of an operator must equal the input type? In this case that

Re: [GENERAL] integer instead of 'double precision'?

2012-11-12 Thread Chris Angelico
On Tue, Nov 13, 2012 at 12:16 AM, Willy-Bas Loos willy...@gmail.com wrote: On Fri, Sep 9, 2011 at 5:09 PM, Guillaume Lelarge guilla...@lelarge.info wrote: You divide an integer with an integer, that should give you an integer. Can you tell me the reasoning behind that idea? Is it a rule

Re: [GENERAL] Can dml realize the partition table's rule and make good execution plan?

2012-11-12 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: It'd be really interesting to enhance the query planner to be smarter about this particular case, At least for this particular example, it's not at all clear to me that it'd be worth the cost. Getting rid of accesses to tables altogether is

[GENERAL] PSA: XFS and Linux Cache Poisoning

2012-11-12 Thread Shaun Thomas
Hey everyone, We recently got bit by this, and I wanted to make sure it was known to the general community. In new(er) Linux kernels, including late versions of the 2.6 tree, XFS has introduced dynamic speculative preallocation. What does this do? It was added to prevent filesystem

Re: [GENERAL] PSA: XFS and Linux Cache Poisoning

2012-11-12 Thread Ben Chobot
On Nov 12, 2012, at 7:37 AM, Shaun Thomas wrote: Hey everyone, We recently got bit by this, and I wanted to make sure it was known to the general community. In new(er) Linux kernels, including late versions of the 2.6 tree, XFS has introduced dynamic speculative preallocation. What

Re: [GENERAL] Understanding streaming replication

2012-11-12 Thread Philippe Amelant
Hello all, I read this thread with interest but I still have some questions about cascading replication as you describe it. Le 12/11/2012 10:36, Albe Laurenz a écrit : I'll try to answer the questions I can. 3. Recovery. That part is a bit confusing. The majority of the documentation says

Re: [GENERAL] PostgreSQL and a clustered file system

2012-11-12 Thread Achilleas Mantzios
Hello Ivan, this sounds so mainframe-ish, i recall, in IBM MVS (circa 1990+) we used to attach two systems to the same DASDie storage, and then employ disk serialization provided by the OS to achieve some integrity to the data. (do not get me wrong i had adequate Unix/SUNOS/Ultrix experience

[GENERAL] FATAL: sorry, too many clients already when I start the replication

2012-11-12 Thread Velislav Stoychev
I have strange problem. I am trying to achieve streaming replication between 2 PostgreSQL servers with version 9.2.1. The replications worked just fine then the servers was without load. The problem is that now then the servers are loaded I cannot start the replication without receiving this

Re: [GENERAL] Understanding streaming replication

2012-11-12 Thread Pawel Veselov
On Mon, Nov 12, 2012 at 1:36 AM, Albe Laurenz laurenz.a...@wien.gv.atwrote: I'll try to answer the questions I can. Thank you! Pawel Veselov wrote: I've been struggling with understanding all the necessary pieces for streaming replication. So I put down the pieces as I did understand

Re: [GENERAL] Understanding streaming replication

2012-11-12 Thread Pawel Veselov
On Mon, Nov 12, 2012 at 10:11 AM, Pawel Veselov pawel.vese...@gmail.comwrote: On Mon, Nov 12, 2012 at 1:36 AM, Albe Laurenz laurenz.a...@wien.gv.atwrote: I'll try to answer the questions I can. Thank you! Pawel Veselov wrote: I've been struggling with understanding all the necessary

Re: [GENERAL] Unexpectedly high disk space usage RESOLVED (Manual reindex/vacuum)

2012-11-12 Thread Lists
On 11/10/2012 02:21 PM, Jeff Janes wrote: On Fri, Nov 9, 2012 at 4:28 PM, Lists li...@benjamindsmith.com wrote: ... 3) For each of the tables from #2, run the commands REINDEX TABLE $table; VACUUM FULL ANALYZE $table; The end result is a squeaky-clean database server with expected disk

[GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Lists
The good news is that we have now resolved our critical problem (disk space overuse) with a somewhat hackish, slow answer that is nonetheless good enough for now. Now I'd like to work out how to get autovacuum to work smoothly within our cluster. I'm happy to try to clarify my notes and post

[GENERAL] plpgsql cursor reuse

2012-11-12 Thread David Greco
Came across this problem when trying to assign to a variable a field from a record that could come from multiple cursors. PG throws an error - ERROR: type of parameter 7 (bigint) does not match that when preparing the plan (unknown). If I make the null column in c1 null::bigint to match cursor

Re: [GENERAL] plpgsql cursor reuse

2012-11-12 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David Greco Sent: Monday, November 12, 2012 3:35 PM To: pgsql-general@postgresql.org Subject: [GENERAL] plpgsql cursor reuse Came across this problem when trying to assign to a variable a field

Re: [GENERAL] PostgreSQL and a clustered file system

2012-11-12 Thread Gunnar Nick Bluth
Am 12.11.2012 11:03, schrieb Ivan Voras: Hello, Is anyone running PostgreSQL on a clustered file system on Linux? By clustered I actually mean shared, such that the same storage is mounted by different servers at the same time (of course, only one instance of PostgreSQL on only one server can

Re: [GENERAL] Unexpectedly high disk space usage RESOLVED (Manual reindex/vacuum)

2012-11-12 Thread Jeff Janes
On Mon, Nov 12, 2012 at 10:38 AM, Lists li...@benjamindsmith.com wrote: On 11/10/2012 02:21 PM, Jeff Janes wrote: On Fri, Nov 9, 2012 at 4:28 PM, Lists li...@benjamindsmith.com wrote: 2) It was sheer chance that I discovered the need to reindex prior to vacuum in order to get the disk

Re: [GENERAL] plpgsql cursor reuse

2012-11-12 Thread salah jubeh
Hello David, Well, I think this is normal you can t assign null to a variable without a proper cating in your example you can do somthing like this  c1 cursor FOR SELECT 1 as shipmentid, null::bigint as olmid; Regards From: David Greco

Re: [GENERAL] PostgreSQL and a clustered file system

2012-11-12 Thread David Boreham
On 11/12/2012 1:52 PM, Gunnar Nick Bluth wrote: Am 12.11.2012 11:03, schrieb Ivan Voras: Is anyone running PostgreSQL on a clustered file system on Linux? By clustered I actually mean shared, such that the same storage is mounted by different servers at the same time (of course, only one

Re: [GENERAL] Unexpectedly high disk space usage RESOLVED (Manual reindex/vacuum)

2012-11-12 Thread Lists
On 11/12/2012 01:31 PM, Jeff Janes wrote: On Mon, Nov 12, 2012 at 10:38 AM, Lists li...@benjamindsmith.com wrote: On 11/10/2012 02:21 PM, Jeff Janes wrote: On Fri, Nov 9, 2012 at 4:28 PM, Lists li...@benjamindsmith.com wrote: 2) It was sheer chance that I discovered the need to reindex prior

Re: [GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Kevin Grittner
Lists wrote: There's a wealth of how to tune PG instruction that's old and (based on this thread alone) often stale enough to be classified as disinformative. For example, nearest I can tell, the entirety of this page is just wrong and/or irrelevant for 9.x and up:

Re: [GENERAL] PostgreSQL and a clustered file system

2012-11-12 Thread Stephen Frost
Ivan, * Ivan Voras (ivo...@freebsd.org) wrote: Is anyone running PostgreSQL on a clustered file system on Linux? By clustered I actually mean shared, such that the same storage is mounted by different servers at the same time (of course, only one instance of PostgreSQL on only one server can

Re: [GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Greg Williamson
Kevin -- You wrote: ... running transactions can cause autovacuum processes to stall out or be autocancelled. Long running transactions - is now long? In our system it's rare to have a transaction (even a prepared transaction) last much longer than a few minutes. Is that enough time to cause

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

2012-11-12 Thread Carlos Henrique Reimer
Hi, That is what I got from gdb: TopMemoryContext: 88992 total in 10 blocks; 10336 free (7 chunks); 78656 used Type information cache: 24576 total in 2 blocks; 11888 free (5 chunks); 12688 used Operator lookup cache: 24576 total in 2 blocks; 11888 free (5 chunks); 12688 used Operator class

Re: [GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Craig Ringer
On 11/13/2012 04:04 AM, Lists wrote: There's a wealth of how to tune PG instruction that's old and (based on this thread alone) often stale enough to be classified as disinformative. For example, nearest I can tell, the entirety of this page is just wrong and/or irrelevant for 9.x and up:

Re: [GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Craig Ringer
On 11/13/2012 10:29 AM, Craig Ringer wrote: On 11/13/2012 04:04 AM, Lists wrote: There's a wealth of how to tune PG instruction that's old and (based on this thread alone) often stale enough to be classified as disinformative. For example, nearest I can tell, the entirety of this page is

Re: [GENERAL] integer instead of 'double precision'?

2012-11-12 Thread Martijn van Oosterhout
On Mon, Nov 12, 2012 at 02:16:21PM +0100, Willy-Bas Loos wrote: On Fri, Sep 9, 2011 at 5:09 PM, Guillaume Lelarge guilla...@lelarge.infowrote: You divide an integer with an integer, that should give you an integer. Can you tell me the reasoning behind that idea? Is it a rule that the