Re: [HACKERS] Misaligned BufferDescriptors causing major performance problems on AMD

2014-02-06 Thread Andres Freund
On 2014-02-05 12:36:42 -0500, Robert Haas wrote: It may well be that your proposal is spot on. But I'd like to see some data-structure-by-data-structure measurements, rather than assuming that alignment must be a good thing. I am fine with just aligning BufferDescriptors properly. That

Re: [HACKERS] PoC: Partial sort

2014-02-06 Thread Marti Raudsepp
On Thu, Feb 6, 2014 at 5:31 AM, Robert Haas robertmh...@gmail.com wrote: Hmm, sounds a little steep. Why is it so expensive? I'm probably missing something here, because I would have thought that planner support for partial sorts would consist mostly of considering the same sorts we consider

Re: [HACKERS] Row-security on updatable s.b. views

2014-02-06 Thread Yeb Havinga
On 2014-02-06 05:43, Craig Ringer wrote: Based on Tom's objections, another approach is presented in rls-9.4-upd-sb-views-v5 on g...@github.com:ringerc/postgres.git . The Query node is used to record the recursive expansion parent list instead, and copying is avoided. Cannot fetch or clone.

Re: [HACKERS] Patch: show xid and xmin in pg_stat_activity and pg_stat_replication

2014-02-06 Thread Andres Freund
On 2014-02-05 13:26:15 -0500, Robert Haas wrote: On Wed, Feb 5, 2014 at 1:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: It feels weird to me that the new columns are called transactionid and xmin. Why not xid and xmin? Actually the part of that

Re: [HACKERS] [doc patch] extra_float_digits and casting from real to numeric

2014-02-06 Thread Christoph Berg
Re: Robert Haas 2014-02-05 ca+tgmozy4kkaptkf2pxcoqnt-jb0ysp8w2php_qge62nilv...@mail.gmail.com literal0/literal, the output is the same on every platform supported by PostgreSQL. Increasing it will produce output that more accurately represents the stored value, but

Re: [HACKERS] Minor performance improvement in transition to external sort

2014-02-06 Thread Jeremy Harris
On 05/02/14 21:56, Robert Haas wrote: On Tue, Feb 4, 2014 at 5:22 PM, Jeremy Harris j...@wizmail.org wrote: The attached patch replaces the existing siftup method for heapify with a siftdown method. Tested with random integers it does 18% fewer compares and takes 10% less time for the heapify,

Re: [HACKERS] GiST support for inet datatypes

2014-02-06 Thread Emre Hasegeli
2014-01-19 12:10, Emre Hasegeli e...@hasegeli.com: 2014-01-19 Andreas Karlsson andr...@proxel.se: I am a bit suspicious about your memcmp based optimization in bitncommon, but it could be good. Have you benchmarked it compared to doing the same thing with a loop? I did, when I was writing

Re: [HACKERS] Retain dynamic shared memory segments for postmaster lifetime

2014-02-06 Thread Kyotaro HORIGUCHI
Hello, I've understood how this works and seems working as expected. Anyway this is just a test module so if things works for you by changing the above way, its fine. However I wonder why its not generating .def file for you. Surely. Getting back on topic, using dsm_keep_segment, I saw

Re: [HACKERS] GIN improvements part2: fast scan

2014-02-06 Thread Heikki Linnakangas
On 02/05/2014 12:42 PM, Alexander Korotkov wrote: Attached patch is light version of fast scan. It does extra consistent function calls only on startScanKey, no extra calls during scan of the index. It finds subset of rarest entries absence of which guarantee false consistent function result.

Re: [HACKERS] Retain dynamic shared memory segments for postmaster lifetime

2014-02-06 Thread Kyotaro HORIGUCHI
Hello, let me say in passing, However I wonder why its not generating .def file for you. Is the 'it' is Visual Studio IDE or CL? Mmm, as far as I know .def file is a stuff that programmers should write by their hands as a matter of course. I've found no way to automatically generate .def

Re: [HACKERS] GIN improvements part2: fast scan

2014-02-06 Thread Alexander Korotkov
On Thu, Feb 6, 2014 at 2:21 PM, Heikki Linnakangas hlinnakan...@vmware.comwrote: On 02/05/2014 12:42 PM, Alexander Korotkov wrote: Attached patch is light version of fast scan. It does extra consistent function calls only on startScanKey, no extra calls during scan of the index. It finds

[HACKERS] Small GIN optimizations (after 9.4)

2014-02-06 Thread Heikki Linnakangas
While hacking on the GIN patches, I've come up with a few different ideas for improving performance. It's too late for 9.4, but I'll list them here if someone wants to work on them later: * Represent ItemPointers as uint64's, to speed up comparisons. ginCompareItemPointers is inlined into

Re: [HACKERS] Performance Improvement by reducing WAL for Update Operation

2014-02-06 Thread Amit Kapila
On Thu, Feb 6, 2014 at 9:13 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Feb 5, 2014 at 8:50 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 02/05/2014 04:48 PM, Amit Kapila wrote: I have done one test where there is a large suffix match, but not large enough that it can

Re: [HACKERS] Add CREATE support to event triggers

2014-02-06 Thread Robert Haas
On Thu, Feb 6, 2014 at 12:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, Feb 5, 2014 at 2:26 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Then again, why is the behavior of schema-qualifying absolutely everything even desirable? Well,

Re: [HACKERS] Performance Improvement by reducing WAL for Update Operation

2014-02-06 Thread Amit Kapila
On Wed, Feb 5, 2014 at 8:56 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Feb 5, 2014 at 5:13 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 02/05/2014 07:54 AM, Amit Kapila wrote: That's not the worst case, by far. First, note that the skipping while scanning new tuple

Re: [HACKERS] Row-security on updatable s.b. views

2014-02-06 Thread Craig Ringer
On 02/06/2014 04:54 PM, Yeb Havinga wrote: On 2014-02-06 05:43, Craig Ringer wrote: Based on Tom's objections, another approach is presented in rls-9.4-upd-sb-views-v5 on g...@github.com:ringerc/postgres.git . The Query node is used to record the recursive expansion parent list instead, and

Re: [HACKERS] Retain dynamic shared memory segments for postmaster lifetime

2014-02-06 Thread Amit Kapila
On Thu, Feb 6, 2014 at 4:10 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hello, let me say in passing, However I wonder why its not generating .def file for you. Is the 'it' is Visual Studio IDE or CL? Mmm, as far as I know .def file is a stuff that programmers should write

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Peter Eisentraut
On 7/20/13, 9:06 PM, Greg Stark wrote: In theory this tool is promising though since it works by looking at the llvm bytecode to determine what the real syntax is. It should be able to handle the typedef issues we have with most of the the tools. Since clang-format has no options to specify

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2013-07-21 02:06:02 +0100, Greg Stark wrote: On Thu, Jun 27, 2013 at 10:31 PM, Tom Lane t...@sss.pgh.pa.us wrote: AFAIR, no one has ever done a serious comparison to anything except GNU indent, and (at least at the time) it seemed to have bugs as bad as pgindent's, just different ones.

Re: [HACKERS] Row-security on updatable s.b. views

2014-02-06 Thread Craig Ringer
On 02/06/2014 12:43 PM, Craig Ringer wrote: 1. Try (again) to do row-security in the rewriter. This was previously impossible because of the definition of row-security behaviour around inheritance, but with the simplified inheritance model now proposed I think it's possible. Thanks to the

Re: [HACKERS] Minor performance improvement in transition to external sort

2014-02-06 Thread Robert Haas
On Thu, Feb 6, 2014 at 4:22 AM, Jeremy Harris j...@wizmail.org wrote: On 05/02/14 21:56, Robert Haas wrote: On Tue, Feb 4, 2014 at 5:22 PM, Jeremy Harris j...@wizmail.org wrote: The attached patch replaces the existing siftup method for heapify with a siftdown method. Tested with random

Re: [HACKERS] Row-security on updatable s.b. views

2014-02-06 Thread Craig Ringer
On 02/06/2014 10:19 PM, Craig Ringer wrote: On 02/06/2014 12:43 PM, Craig Ringer wrote: 1. Try (again) to do row-security in the rewriter. This was previously impossible because of the definition of row-security behaviour around inheritance, but with the simplified inheritance model now

[HACKERS] open and close columns in the NEW record not allowed

2014-02-06 Thread Rafael Martinez Guerrero
Hello One of our users is having a problem with a trigger in a system running postgresql 9.3. The problem is that pl/pgsql does not accept open and close as column names when used in the NEW record in a trigger function. This page:

Re: [HACKERS] extension_control_path

2014-02-06 Thread Greg Stark
On Tue, Feb 4, 2014 at 6:07 PM, David E. Wheeler da...@justatheory.com wrote: The install failed, of course, because extensions want to install in $PGROOT/share/extensions. Homebrew sounds kind of confused. Having a non-root user have access to make global system changes sounds like privilege

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Alvaro Herrera
Andres Freund wrote: What I haven't seen in any tool yet is something to resemble our indentation style for variable declarations. Do we feel that's a dealbreaker for any tool? I find our style more aesthetically pleasing than any other I've seen; but anyway the changes if we used a tool that

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: What I haven't seen in any tool yet is something to resemble our indentation style for variable declarations. Do we feel that's a dealbreaker for any tool? Well, we're unlikely to change pgindent's rules to conform to the behavior of some random

Re: [HACKERS] Row-security on updatable s.b. views

2014-02-06 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: We don't rerun rewrite on plan invalidation. Don't we? plancache.c certainly does, in fact it starts from the raw grammar output. Skipping the rewriter would mean failing to respond to CREATE OR REPLACE VIEW, for example.

Re: [HACKERS] open and close columns in the NEW record not allowed

2014-02-06 Thread Adrian Klaver
On 02/06/2014 06:35 AM, Rafael Martinez Guerrero wrote: Hello One of our users is having a problem with a trigger in a system running postgresql 9.3. The problem is that pl/pgsql does not accept open and close as column names when used in the NEW record in a trigger function. This page:

Re: [HACKERS] open and close columns in the NEW record not allowed

2014-02-06 Thread Tom Lane
Rafael Martinez Guerrero r.m.guerr...@usit.uio.no writes: The problem is that pl/pgsql does not accept open and close as column names when used in the NEW record in a trigger function. Yup. Those words (and other words that can start a plpgsql statement) are reserved so far as plpgsql is

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2014-02-06 10:04:54 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: What I haven't seen in any tool yet is something to resemble our indentation style for variable declarations. Do we feel that's a dealbreaker for any tool? Well, we're unlikely to change pgindent's

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Nah, not for that ;). I mean I haven't seen any replacement for pgindent that generates equivalent variable indentations. Seems odd. I thought netbsd's indent was pretty much the granddaddy of them all --- so you'd expect newer tools to be able to

Re: [HACKERS] open and close columns in the NEW record not allowed

2014-02-06 Thread Rafael Martinez Guerrero
On Thu, 2014-02-06 at 07:11 -0800, Adrian Klaver wrote: On 02/06/2014 06:35 AM, Rafael Martinez Guerrero wrote: We think the behavior should be consistent, either it is allow to use them or not, but not like it is today. As a general rule, if you get spurious parser errors for commands

Re: [HACKERS] open and close columns in the NEW record not allowed

2014-02-06 Thread k...@rice.edu
On Thu, Feb 06, 2014 at 04:21:41PM +0100, Rafael Martinez Guerrero wrote: On Thu, 2014-02-06 at 07:11 -0800, Adrian Klaver wrote: On 02/06/2014 06:35 AM, Rafael Martinez Guerrero wrote: We think the behavior should be consistent, either it is allow to use them or not, but not like it is

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2014-02-06 10:24:34 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Nah, not for that ;). I mean I haven't seen any replacement for pgindent that generates equivalent variable indentations. Seems odd. I thought netbsd's indent was pretty much the granddaddy of them

Re: [HACKERS] extension_control_path

2014-02-06 Thread Stephen Frost
* Greg Stark (st...@mit.edu) wrote: On Tue, Feb 4, 2014 at 6:07 PM, David E. Wheeler da...@justatheory.com wrote: The install failed, of course, because extensions want to install in $PGROOT/share/extensions. Homebrew sounds kind of confused. Having a non-root user have access to make

adt Makefile, was Re: [HACKERS] jsonb and nested hstore

2014-02-06 Thread Andrew Dunstan
On 02/01/2014 05:20 PM, Andres Freund wrote: diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile index 1ae9fa0..fd93d9b 100644 --- a/src/backend/utils/adt/Makefile +++ b/src/backend/utils/adt/Makefile @@ -32,7 +32,8 @@ OBJS = acl.o arrayfuncs.o array_selfuncs.o

Re: [HACKERS] Small GIN optimizations (after 9.4)

2014-02-06 Thread PostgreSQL - Hans-Jürgen Schönig
i think there is one more thing which would be really good in GIN and which would solve a ton of issues. atm GIN entries are sorted by item pointer. if we could sort them by a column it would fix a couple of real work issues such as ... SELECT ... FROM foo WHERE tsearch_query ORDER BY

Re: adt Makefile, was Re: [HACKERS] jsonb and nested hstore

2014-02-06 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 02/01/2014 05:20 PM, Andres Freund wrote: Odd, most OBJS lines are kept in alphabetical order, but that doesn't seem to be the case here. This whole list is a mess, and we don't even have all the range_types files following each other. Worth

Re: adt Makefile, was Re: [HACKERS] jsonb and nested hstore

2014-02-06 Thread Alvaro Herrera
Andrew Dunstan wrote: This whole list is a mess, and we don't even have all the range_types files following each other. Worth cleaning up? I'm actually wondering if it might be worth having some subgroups of object files and then combining them into $OBJS. Doesn't the MSVC build stuff

Re: [HACKERS] extension_control_path

2014-02-06 Thread David E. Wheeler
On Feb 6, 2014, at 6:51 AM, Greg Stark st...@mit.edu wrote: Homebrew sounds kind of confused. Having a non-root user have access to make global system changes sounds like privilege escalation vulnerability by design. Well, the point is that it *doesn’t* make global system changes. I got an

Re: [HACKERS] extension_control_path

2014-02-06 Thread David E. Wheeler
On Feb 6, 2014, at 7:32 AM, Stephen Frost sfr...@snowman.net wrote: The end-admin would have to modify the system-installed postgresql.conf anyway to enable this other directory. David wasn't suggesting that Homebrew *should* be able to do so, he was pointing out that it *can't*, which all

Re: adt Makefile, was Re: [HACKERS] jsonb and nested hstore

2014-02-06 Thread Andrew Dunstan
On 02/06/2014 11:38 AM, Alvaro Herrera wrote: Andrew Dunstan wrote: This whole list is a mess, and we don't even have all the range_types files following each other. Worth cleaning up? I'm actually wondering if it might be worth having some subgroups of object files and then combining them

Re: [HACKERS] jsonb and nested hstore

2014-02-06 Thread David E. Wheeler
On Feb 5, 2014, at 3:59 PM, Andrew Dunstan and...@dunslane.net wrote: I got a slightly earlier start ;-) For people wanting to play along, here's what this change looks like: https://github.com/feodor/postgres/commit/3fe899b3d7e8f806b14878da4a4e2331b0eb58e8 Man I love seeing all that read.

Re: [HACKERS] extension_control_path

2014-02-06 Thread Greg Stark
On Thu, Feb 6, 2014 at 5:49 PM, David E. Wheeler da...@justatheory.com wrote: On Feb 6, 2014, at 6:51 AM, Greg Stark st...@mit.edu wrote: Homebrew sounds kind of confused. Having a non-root user have access to make global system changes sounds like privilege escalation vulnerability by

Re: [HACKERS] Minor performance improvement in transition to external sort

2014-02-06 Thread Jeff Janes
On Tue, Feb 4, 2014 at 2:22 PM, Jeremy Harris j...@wizmail.org wrote: The attached patch replaces the existing siftup method for heapify with a siftdown method. Tested with random integers it does 18% fewer compares and takes 10% less time for the heapify, over the work_mem range 1024 to

[HACKERS] 'dml' value for log_statement

2014-02-06 Thread Sawada Masahiko
Hi all, Attaching patch provides new value 'dml' for log_statement. Currently, The server logs modification statements AND data definition statements if log_statement is set 'mod'. So we need to set the 'all' value for log_statement and remove unnecessary information if we would like to log only

Re: [HACKERS] extension_control_path

2014-02-06 Thread David E. Wheeler
On Feb 6, 2014, at 9:14 AM, Greg Stark st...@mit.edu wrote: Installing into /usr/local is a global system change. Only root should be able to do that and any user that can do that can easily acquire root privileges. I agree with you, but I don’t think the Homebrew folks do. Or at least their

Re: [HACKERS] PoC: Partial sort

2014-02-06 Thread Robert Haas
On Thu, Feb 6, 2014 at 3:39 AM, Marti Raudsepp ma...@juffo.org wrote: On Thu, Feb 6, 2014 at 5:31 AM, Robert Haas robertmh...@gmail.com wrote: Hmm, sounds a little steep. Why is it so expensive? I'm probably missing something here, because I would have thought that planner support for

Re: Fwd: [HACKERS] Proposal: variant of regclass

2014-02-06 Thread Marti Raudsepp
On Tue, Jan 28, 2014 at 10:38 AM, Yugo Nagata nag...@sraoss.co.jp wrote: I revised the patch. Could you please review this? I didn't test the patch due to the duplicate OID compilation error. But a few things stuck out from the diffs: * You added some unnecessary spaces at the beginning of the

Re: [HACKERS] PoC: Partial sort

2014-02-06 Thread Marti Raudsepp
On Thu, Feb 6, 2014 at 9:15 PM, Robert Haas robertmh...@gmail.com wrote: It may be that having the capability to do a partial sort makes it seem worth spending more CPU looking for merge joins, but I'd vote for making any such change a separate patch. Agreed. Alexander, should I work on

Re: [HACKERS] PoC: Partial sort

2014-02-06 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Feb 6, 2014 at 3:39 AM, Marti Raudsepp ma...@juffo.org wrote: I guess it's because the patch undoes some optimizations in the mergejoin planner wrt caching merge clauses and adds a whole lot of code to find_mergeclauses_for_pathkeys. In other

[HACKERS] Re: [DOCS] Re: Viability of text HISTORY/INSTALL/regression README files (was Re: [COMMITTERS] pgsql: Document a few more regression test hazards.)

2014-02-06 Thread Stefan Kaltenbrunner
On 02/05/2014 07:27 PM, Robert Haas wrote: On Tue, Feb 4, 2014 at 11:43 PM, Noah Misch n...@leadboat.com wrote: Right. I mean, a lot of the links say things like Section 26.2 which obviously makes no sense in a standalone text file. For xrefs normally displayed that way, text output could

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Greg Stark
On Mon, Feb 3, 2014 at 12:02 AM, Tom Lane t...@sss.pgh.pa.us wrote: What version were you running before 9.1.11 exactly? I took a look through all the diffs from 9.1.9 up to 9.1.11, and couldn't find any changes that seemed even vaguely related to this. There are some changes in

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-02-02 15:16:45 -0500, Tom Lane wrote: I've been thinking about this for the past little while, and I believe that it's probably okay to have RelationClearRelation leave the relcache entry un-rebuilt, but with rd_isvalid = false so it will be

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Tom Lane
Greg Stark st...@mit.edu writes: Both the primary and the standby were 9.1.11 from the get-go. The database the primary was forked off of was 9.1.10 but as far as I can tell the primary in the current pair has no problems. What's worse is we created a new standby from the same base backup and

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2014-02-06 Thread Andres Freund
On 2014-02-06 16:35:07 -0500, Tom Lane wrote: I wonder though, if we couldn't just stop doing the RelationReloadIndexInfo() for nailed indexes. No; you're confusing nailed indexes with mapped indexes. There are nailed indexes that aren't on mapped catalogs, see the load_critical_index

[HACKERS] Release schedule for 9.3.3?

2014-02-06 Thread Sean Chittenden
Are there any tentative plans for the 9.3.3 release date? 9.3.2 was released in December and it’s getting close to the two month mark for another micro release, or at least one seems like one should be right around the corner. It’s a little early, but I haven’t seen any movement or discussion

Re: [HACKERS] Release schedule for 9.3.3?

2014-02-06 Thread Greg Stark
On Thu, Feb 6, 2014 at 10:55 PM, Sean Chittenden s...@chittenden.org wrote: Are there any tentative plans for the 9.3.3 release date? 9.3.2 was released in December and it's getting close to the two month mark for another micro release, or at least one seems like one should be right around

Re: [HACKERS] Minor performance improvement in transition to external sort

2014-02-06 Thread Jeremy Harris
On 06/02/14 18:21, Jeff Janes wrote: How big of sets were you sorting in each case? Big enough to go external. The timings and compare-counts given are purely for the heapify stage not the total for the sort, so are constrained by the work_mem not by the sort size per se. I'm limited to

Re: [HACKERS] 'dml' value for log_statement

2014-02-06 Thread David Johnston
Sawada Masahiko wrote Hi all, Attaching patch provides new value 'dml' for log_statement. Currently, The server logs modification statements AND data definition statements if log_statement is set 'mod'. So we need to set the 'all' value for log_statement and remove unnecessary information

Re: [HACKERS] Minor performance improvement in transition to external sort

2014-02-06 Thread Jeremy Harris
On 06/02/14 14:22, Robert Haas wrote: On Thu, Feb 6, 2014 at 4:22 AM, Jeremy Harris j...@wizmail.org wrote: On 05/02/14 21:56, Robert Haas wrote: On Tue, Feb 4, 2014 at 5:22 PM, Jeremy Harris j...@wizmail.org wrote: The attached patch replaces the existing siftup method for heapify with a

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Greg Stark
On Thu, Feb 6, 2014 at 10:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: I had noticed that the WAL records that were mis-replayed seemed to be bunched pretty close together (two of them even adjacent). Could you confirm that? If so, it seems like we're looking for some condition that makes

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Andres Freund
On 2014-02-06 23:41:19 +0100, Greg Stark wrote: The problem with the bgwriter being at fault is that from what I can see the bgwriter will never extend a file. That means the xlog recovery code must have done it. That means even if the bgwriter came along and looked at the buffer we just read

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2014-02-06 Thread Tom Lane
I wrote: (BTW, I see that the CLOBBER_CACHE_ALWAYS members of the buildfarm are unhappy with the IsTransactionState check in RelationIdGetRelation. Will look at that ... but it seems to be in initdb which breaks a lot of these rules anyway, so I think it's probably not significant.) So what's

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-02-06 16:35:07 -0500, Tom Lane wrote: Thoughts? Let's let it stew a while in master, there certainly are enough subtleties around this that I'd hesitate to add it to a point release in the not too far away future. Doesn't seem that urgent

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Greg Stark
On Thu, Feb 6, 2014 at 11:48 PM, Andres Freund and...@2ndquadrant.com wrote: That's not necessarily true. If e.g. the buffer mapping would change racily, the result write from the bgwriter could very well end up increasing the file size, leaving a hole inbetween its write and the original

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Tom Lane
Greg Stark st...@mit.edu writes: On Thu, Feb 6, 2014 at 11:48 PM, Andres Freund and...@2ndquadrant.com wrote: That's not necessarily true. If e.g. the buffer mapping would change racily, the result write from the bgwriter could very well end up increasing the file size, leaving a hole

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Andres Freund
On 2014-02-06 18:42:05 -0500, Tom Lane wrote: Greg Stark st...@mit.edu writes: On Thu, Feb 6, 2014 at 11:48 PM, Andres Freund and...@2ndquadrant.com wrote: That's not necessarily true. If e.g. the buffer mapping would change racily, the result write from the bgwriter could very well end

Re: adt Makefile, was Re: [HACKERS] jsonb and nested hstore

2014-02-06 Thread Michael Paquier
On Fri, Feb 7, 2014 at 1:18 AM, Andrew Dunstan and...@dunslane.net wrote: On 02/01/2014 05:20 PM, Andres Freund wrote: diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile index 1ae9fa0..fd93d9b 100644 --- a/src/backend/utils/adt/Makefile +++

Re: [HACKERS] Recovery inconsistencies, standby much larger than primary

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: That reminds me, not that I directly see how it could be responsible, there's still 20131029011623.gj20...@awork2.anarazel.de ff. around. I don't think we came to a agreement in that thread how to fix the problem. Hm, yeah. I'm not sure I believe

Re: [HACKERS] Retain dynamic shared memory segments for postmaster lifetime

2014-02-06 Thread Amit Kapila
On Thu, Feb 6, 2014 at 3:42 PM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hello, I've understood how this works and seems working as expected. Anyway this is just a test module so if things works for you by changing the above way, its fine. However I wonder why its not

Re: [HACKERS] Row-security on updatable s.b. views

2014-02-06 Thread Craig Ringer
On 02/06/2014 11:11 PM, Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: We don't rerun rewrite on plan invalidation. Don't we? plancache.c certainly does, in fact it starts from the raw grammar output. Skipping the rewriter would mean failing to respond to CREATE OR REPLACE

Re: [HACKERS] narwhal and PGDLLIMPORT

2014-02-06 Thread Hiroshi Inoue
(2014/02/05 14:52), Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: On 02/05/2014 06:29 AM, Tom Lane wrote: I had been okay with the manual PGDLLIMPORT-sprinkling approach (not happy with it, of course, but prepared to tolerate it) as long as I believed the buildfarm would reliably

Re: [HACKERS] PostgreSQL Failback without rebuild

2014-02-06 Thread James Sewell
I've just noticed that on PostgreSQL 9.3 I can do the following with a master node A and a slave node B (as long as I have set recovery_target_timeline = 'latest'): 1. Stop Node A 2. Promote Node B 3. Attach Node A as slave This is sufficient for my needs (I know it doesn't cover a

Re: [HACKERS] Inconsistency between pg_stat_activity and log_duration

2014-02-06 Thread Amit Kapila
On Tue, Feb 4, 2014 at 9:36 AM, Tatsuo Ishii is...@postgresql.org wrote: As you can see, at 2014-02-04 12:47:27.210981+09 the query SELECT count(*) FROM pg_catalog.pg_class... is active and it seems still running. On the other side, Here is an excerpt from PostgreSQL log: 21850 2014-02-04

Re: [HACKERS] Inconsistency between pg_stat_activity and log_duration

2014-02-06 Thread Amit Kapila
On Fri, Feb 7, 2014 at 10:43 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Tue, Feb 4, 2014 at 9:36 AM, Tatsuo Ishii is...@postgresql.org wrote: As you can see, at 2014-02-04 12:47:27.210981+09 the query SELECT count(*) FROM pg_catalog.pg_class... is active and it seems still running. On

Re: [HACKERS] narwhal and PGDLLIMPORT

2014-02-06 Thread Hiroshi Inoue
OK I can see the error message at PostgreSQL Build Farm Log. I see a similar problem in a simple test case. gcc -DCALLPG=\import1\ -c export.c -o export1.o dlltool --export-all --output-def export1.def export1.o dlltool --dllname export1.exe --def export1.def --output-lib export1.a dlltool

Re: [HACKERS] PostgreSQL Failback without rebuild

2014-02-06 Thread Michael Paquier
On Fri, Feb 7, 2014 at 1:57 PM, James Sewell james.sew...@lisasoft.comwrote: I've just noticed that on PostgreSQL 9.3 I can do the following with a master node A and a slave node B (as long as I have set recovery_target_timeline = 'latest'): 1. Stop Node A 2. Promote Node B 3.

Re: [HACKERS] PostgreSQL Failback without rebuild

2014-02-06 Thread James Sewell
Node A could get ahead even if it has been shut down cleanly BEFORE the promotion? I'd always assumed if I shut down the master the slave would be at the same point after shutdown - is this incorrect? Cheers, James Sewell, PostgreSQL Team Lead / Solutions Architect

[HACKERS] Typo in a comment?

2014-02-06 Thread Amit Langote
In src/backend/storage/freespace/freespace.c, * * MaxFSMRequestSize depends on the architecture and BLCKSZ, but assuming * default 8k BLCKSZ, and that MaxFSMRequestSize is 24 bytes, the categories * look like this * Is 24 bytes a typo considering that #define MaxFSMRequestSize

Re: [HACKERS] Inconsistency between pg_stat_activity and log_duration

2014-02-06 Thread Tatsuo Ishii
I think that is the probable reason for the above mentioned behaviour. As I understand here, the problem is that 'state' of backend is shown as active along with 'query' which according to docs (If state is active this field shows the currently executing query.) means that query is

Re: [HACKERS] Inconsistency between pg_stat_activity and log_duration

2014-02-06 Thread Amit Kapila
On Fri, Feb 7, 2014 at 11:46 AM, Tatsuo Ishii is...@postgresql.org wrote: I think that is the probable reason for the above mentioned behaviour. As I understand here, the problem is that 'state' of backend is shown as active along with 'query' which according to docs (If state is active this

Re: [HACKERS] PostgreSQL Failback without rebuild

2014-02-06 Thread Michael Paquier
On Fri, Feb 7, 2014 at 3:02 PM, James Sewell james.sew...@lisasoft.comwrote: Node A could get ahead even if it has been shut down cleanly BEFORE the promotion? I'd always assumed if I shut down the master the slave would be at the same point after shutdown - is this incorrect? Yes and no. A

Re: [HACKERS] PostgreSQL Failback without rebuild

2014-02-06 Thread Albe Laurenz
Michael Paquier wrote: On Fri, Feb 7, 2014 at 3:02 PM, James Sewell james.sew...@lisasoft.com wrote: Node A could get ahead even if it has been shut down cleanly BEFORE the promotion? I'd always assumed if I shut down the master the slave would be at the same point after shutdown - is