Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Noah Misch
On Tue, Jul 26, 2011 at 06:04:16PM -0400, Tom Lane wrote: Noah Misch n...@2ndquadrant.com writes: On Tue, Jul 26, 2011 at 05:05:15PM -0400, Tom Lane wrote: Dirty cache line, maybe not, but what if the assembly code commands the CPU to load those variables into CPU registers before doing the

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread Nikhil Sontakke
Hi, Yeah, but I think we need to take that chance. At the very least, we need to support the equivalent of a non-inherited CHECK (false) on parent tables. Indeed. I usually enforce that with a trigger that raises an exception, but of course that doesn't help at all with constraint

Re: [HACKERS] WIP: Fast GiST index build

2011-07-27 Thread Alexander Korotkov
I found a problem in WAL with this patch. I use simplified insert algorithm in my patch which don't insert downlink one by one but insert them at once. Thus FollowRight flag is leaving uncleared when redoing from WAL, because only one flag can be cleared by one WAL record. Do you think

Re: [HACKERS] WIP: Fast GiST index build

2011-07-27 Thread Heikki Linnakangas
On 27.07.2011 15:29, Alexander Korotkov wrote: I found a problem in WAL with this patch. I use simplified insert algorithm in my patch which don't insert downlink one by one but insert them at once. Thus FollowRight flag is leaving uncleared when redoing from WAL, because only one flag can be

Re: [HACKERS] [COMMITTERS] pgsql: Add missing newlines at end of error messages

2011-07-27 Thread Peter Eisentraut
On tis, 2011-07-26 at 15:13 -0700, David Fetter wrote: This seems like a mechanical check. Should it be part of what gets checked when people push? It's not really that mechanical, because some libpq functions supply the newline, so you can't just mechanically add or enforce it everywhere.

Re: [HACKERS] Pull up aggregate sublink (was: Parameterized aggregate subquery (was: Pull up aggregate subquery))

2011-07-27 Thread Robert Haas
On Tue, Jul 26, 2011 at 5:37 PM, Tom Lane t...@sss.pgh.pa.us wrote: Yeb Havinga yebhavi...@gmail.com writes: A few days ago I read Tomas Vondra's blog post about dss tpc-h queries on PostgreSQL at http://fuzzy.cz/en/articles/dss-tpc-h-benchmark-with-postgresql/ - in which he showed how to

Re: [HACKERS] XMLATTRIBUTES vs. values of type XML

2011-07-27 Thread Peter Eisentraut
On tis, 2011-07-26 at 22:44 +0200, Florian Pflug wrote: While reviewing the (now applied) XPATH escaping patches, Radoslaw found one case where the previous failure of XPATH to escape its return value was offset by XMLATTRIBUTES insistence to escape all input values, even if they're already

Re: [HACKERS] Pull up aggregate sublink (was: Parameterized aggregate subquery (was: Pull up aggregate subquery))

2011-07-27 Thread Yeb Havinga
On 2011-07-27 16:16, Robert Haas wrote: On Tue, Jul 26, 2011 at 5:37 PM, Tom Lanet...@sss.pgh.pa.us wrote: Yeb Havingayebhavi...@gmail.com writes: A few days ago I read Tomas Vondra's blog post about dss tpc-h queries on PostgreSQL at

Re: [HACKERS] WIP: Fast GiST index build

2011-07-27 Thread Alexander Korotkov
On Wed, Jul 27, 2011 at 6:05 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Dunno, both approaches seem reasonable to me. There's no rule against changing WAL record structure across major releases, if that's what you were worried about. OK, thanks. I also found behaviour

Re: [HACKERS] Pull up aggregate sublink (was: Parameterized aggregate subquery (was: Pull up aggregate subquery))

2011-07-27 Thread Tom Lane
Yeb Havinga yebhavi...@gmail.com writes: Tom and Robert, thank you both for your replies. I think I'm having some blind spots and maybe false assumptions regarding the overal work in the optimizer, as it is not clear to me what 'the same sort of query' would look like. I was under the

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-07-27 Thread Robert Haas
On Tue, Jul 26, 2011 at 9:21 PM, Josh Kupershmidt schmi...@gmail.com wrote: On Tue, Jul 26, 2011 at 9:53 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Jul 25, 2011 at 10:29 PM, Josh Kupershmidt schmi...@gmail.com wrote: I think this is basically the right approach but I found what you

Re: [HACKERS] WIP: Fast GiST index build

2011-07-27 Thread Heikki Linnakangas
On 27.07.2011 17:43, Alexander Korotkov wrote: 1(l:1) blk: 324 numTuple: 129 free: 2472b(69.71%) rightlink:4294967295 (InvalidBlockNumber) 1(l:2) blk: 242 numTuple: 164 free: 932b(88.58%) rightlink:4294967295 (InvalidBlockNumber) 2(l:2) blk: 525 numTuple: 121 free:

[HACKERS] Re: Pull up aggregate sublink (was: Parameterized aggregate subquery (was: Pull up aggregate subquery))

2011-07-27 Thread Hitoshi Harada
2011/7/27 Yeb Havinga yebhavi...@gmail.com: On 2011-07-22 17:35, Hitoshi Harada wrote: 2011/7/23 Yeb Havingayebhavi...@gmail.com: A few days ago I read Tomas Vondra's blog post about dss tpc-h queries on PostgreSQL at http://fuzzy.cz/en/articles/dss-tpc-h-benchmark-with-postgresql/ - in

Re: [HACKERS] Pull up aggregate sublink (was: Parameterized aggregate subquery (was: Pull up aggregate subquery))

2011-07-27 Thread Hitoshi Harada
2011/7/27 Tom Lane t...@sss.pgh.pa.us: Yeb Havinga yebhavi...@gmail.com writes: A few days ago I read Tomas Vondra's blog post about dss tpc-h queries on PostgreSQL at http://fuzzy.cz/en/articles/dss-tpc-h-benchmark-with-postgresql/ - in which he showed how to manually pull up a dss subquery

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Robert Haas
On Tue, Jul 26, 2011 at 9:57 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Jul 26, 2011 at 4:38 PM, Noah Misch n...@2ndquadrant.com wrote: No new ideas come to mind, here. OK, I have a new idea.  :-) 1. Add a new flag to each procState called something like timeToPayAttention. 2.

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, Jul 26, 2011 at 9:57 PM, Robert Haas robertmh...@gmail.com wrote: 1. Add a new flag to each procState called something like timeToPayAttention. 2. Each call to SIGetDataEntries() iterates over all the ProcStates whose index is lastBackend

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: There turned out to be a little bit of further subtlety to this, but it seems to work. Patch attached. Stylistic question: Why is stateP-hasMessages set to false in one place and FALSE and TRUE in others? It seems like it would be less confusing to

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Robert Haas
On Wed, Jul 27, 2011 at 12:34 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Jul 26, 2011 at 9:57 PM, Robert Haas robertmh...@gmail.com wrote: 1. Add a new flag to each procState called something like timeToPayAttention. 2. Each call to

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Noah Misch
On Tue, Jul 26, 2011 at 09:57:10PM -0400, Robert Haas wrote: On Tue, Jul 26, 2011 at 4:38 PM, Noah Misch n...@2ndquadrant.com wrote: No new ideas come to mind, here. OK, I have a new idea. :-) 1. Add a new flag to each procState called something like timeToPayAttention. 2. Each call

Re: [HACKERS] isolation test deadlocking on buildfarm member coypu

2011-07-27 Thread Noah Misch
On Tue, Jul 26, 2011 at 05:04:28PM -0400, Alvaro Herrera wrote: *** /home/pgbuildfarm/workdir/HEAD/pgsql.20950/src/test/isolation/expected/fk-deadlock2.out Sun Jul 24 08:46:44 2011 --- /home/pgbuildfarm/workdir/HEAD/pgsql.20950/src/test/isolation/results/fk-deadlock2.out Sun Jul 24

Re: [HACKERS] [COMMITTERS] pgsql: Add missing newlines at end of error messages

2011-07-27 Thread David Fetter
On Wed, Jul 27, 2011 at 05:14:58PM +0300, Peter Eisentraut wrote: On tis, 2011-07-26 at 15:13 -0700, David Fetter wrote: This seems like a mechanical check. Should it be part of what gets checked when people push? It's not really that mechanical, because some libpq functions supply the

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Robert Haas
On Wed, Jul 27, 2011 at 12:55 PM, Noah Misch n...@2ndquadrant.com wrote: This approach would work if a spinlock release constrained the global stores timeline.  It makes a weaker guarantee: all stores preceding the lock release in program order will precede it globally.  Consequently, no

Re: [HACKERS] XMLATTRIBUTES vs. values of type XML

2011-07-27 Thread Florian Pflug
On Jul27, 2011, at 16:18 , Peter Eisentraut wrote: On tis, 2011-07-26 at 22:44 +0200, Florian Pflug wrote: While reviewing the (now applied) XPATH escaping patches, Radoslaw found one case where the previous failure of XPATH to escape its return value was offset by XMLATTRIBUTES insistence

[HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-07-27 Thread Petro Meier
Normal021false falsefalseDEX-NONEX-NONE MicrosoftInternetExplorer4

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-07-27 Thread Florian Pflug
On Jul27, 2011, at 08:51 , Petro Meier wrote: If I use PQescapeByteaConn() for a conenction to a PG9.1 Beta3 server, this function returns (e.g.) \xea2abd8ef31...(and so on.) Here the problem: there should be a second backslash in the prefix. The SQL Statement which uses this string

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Noah Misch
On Wed, Jul 27, 2011 at 01:30:47PM -0400, Robert Haas wrote: On Wed, Jul 27, 2011 at 12:55 PM, Noah Misch n...@2ndquadrant.com wrote: [wrong objection] Eh, how can this possibly happen? You have to hold msgNumLock to to set maxMsgNum and msgNumLock to read maxMsgNum. If that's not enough

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-07-27 Thread Alvaro Herrera
Excerpts from Petro Meier's message of mié jul 27 02:51:22 -0400 2011: If  I use PQescapeByteaConn() for a conenction to a PG9.1 Beta3 server, this function returns (e.g.) \xea2abd8ef31...(and so on.) Here the problem: there should be a second backslash in the prefix.

Re: [HACKERS] sinval synchronization considered harmful

2011-07-27 Thread Robert Haas
On Wed, Jul 27, 2011 at 1:58 PM, Noah Misch n...@2ndquadrant.com wrote: I think a benchmark is in order, something like 900 idle connections and 80 connections running small transactions that create a few temporary tables.  If that shows no statistically significant regression, then we're

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-07-27 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Petro Meier's message of mié jul 27 02:51:22 -0400 2011: If  I use PQescapeByteaConn() for a conenction to a PG9.1 Beta3 server, this function returns (e.g.) \xea2abd8ef31...(and so on.) Here the problem: there

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-07-27 Thread Florian Pflug
On Jul27, 2011, at 20:05 , Alvaro Herrera wrote: Excerpts from Petro Meier's message of mié jul 27 02:51:22 -0400 2011: If I use PQescapeByteaConn() for a conenction to a PG9.1 Beta3 server, this function returns (e.g.) \xea2abd8ef31...(and so on.) Here the problem:

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread Robert Haas
On Wed, Jul 27, 2011 at 6:39 AM, Nikhil Sontakke nikhil.sonta...@enterprisedb.com wrote: Yeah, but I think we need to take that chance.  At the very least, we need to support the equivalent of a non-inherited CHECK (false) on parent tables. Indeed. I usually enforce that with a trigger that

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Well, I don't have anything strongly against the idea of an uninherited constraint, though it sounds like Tom does. But I think allowing it just in the case of CHECK (false) would be pretty silly. And, I'm fairly certain that this isn't going to play

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread David E. Wheeler
On Jul 27, 2011, at 1:08 PM, Tom Lane wrote: Yeah. If we're going to allow this then we should just have a concept of a non-inherited constraint, full stop. This might just be a matter of removing the error thrown in ATAddCheckConstraint, but I'd be worried about whether pg_dump will handle

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread Andrew Dunstan
On 07/27/2011 04:14 PM, David E. Wheeler wrote: On Jul 27, 2011, at 1:08 PM, Tom Lane wrote: Yeah. If we're going to allow this then we should just have a concept of a non-inherited constraint, full stop. This might just be a matter of removing the error thrown in ATAddCheckConstraint, but

Re: [HACKERS] SSI error messages

2011-07-27 Thread Peter Eisentraut
On lör, 2011-07-16 at 15:01 -0400, Tom Lane wrote: Well, as I mentioned in the commit message, I've thought for some time that there were use cases for errdetail_internal. Whether these particular places in predicate.c use it or not doesn't affect that. Looking at commit

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread Robert Haas
On Wed, Jul 27, 2011 at 4:08 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Well, I don't have anything strongly against the idea of an uninherited constraint, though it sounds like Tom does.  But I think allowing it just in the case of CHECK (false) would be

Re: [HACKERS] SSI error messages

2011-07-27 Thread Peter Eisentraut
On lör, 2011-07-16 at 21:55 +0300, Heikki Linnakangas wrote: I find it strange to simply leave those strings untranslated. It's going to look wrong, like someone just forgot to translate them. However, I agree it's perhaps a bit too much detail to translate all of those messages, and the

Re: [HACKERS] SSI error messages

2011-07-27 Thread Alvaro Herrera
Excerpts from Peter Eisentraut's message of mié jul 27 16:19:22 -0400 2011: On lör, 2011-07-16 at 15:01 -0400, Tom Lane wrote: Well, as I mentioned in the commit message, I've thought for some time that there were use cases for errdetail_internal. Whether these particular places in

[HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-07-27 Thread Phil Sorber
Hello, The attached patch changes the location of the dumpUserConfig call in the dumpRoles function of pg_dumpall. This is related to this thread: http://archives.postgresql.org/pgsql-hackers/2011-02/msg02359.php Currently if you use 'ALTER ROLE rolename SET ROLE', pg_dumpall will dump an

Re: [HACKERS] XMLATTRIBUTES vs. values of type XML

2011-07-27 Thread Peter Eisentraut
On ons, 2011-07-27 at 19:37 +0200, Florian Pflug wrote: Per SQL standard, the attribute values may not be of type XML, so maybe we should just prohibit it. We probably should have, but I think it's too late for that. I don't believe I'm the only one who uses XPATH results as attribute

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-07-27 Thread Peter Eisentraut
On tis, 2011-07-26 at 09:53 -0400, Robert Haas wrote: On Mon, Jul 25, 2011 at 10:29 PM, Josh Kupershmidt schmi...@gmail.com wrote: That seems like a good way to document this; patch for master updated. I avoided mucking with the documentation for COMMENT ON RULE and COMMENT ON TRIGGER

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-07-27 Thread Andrew Dunstan
On 07/27/2011 02:05 PM, Alvaro Herrera wrote: Excerpts from Petro Meier's message of mié jul 27 02:51:22 -0400 2011: If I use PQescapeByteaConn() for a conenction to a PG9.1 Beta3 server, this function returns (e.g.) \xea2abd8ef31...(and so on.) Here the problem: there should

Re: [HACKERS] XMLATTRIBUTES vs. values of type XML

2011-07-27 Thread Florian Pflug
On Jul27, 2011, at 23:08 , Peter Eisentraut wrote: Well, offhand I would expect that passing an XML value to XMLATTRIBUTES would behave as in SELECT XMLELEMENT(NAME t, XMLATTRIBUTES(XMLSERIALIZE(content 'amp;'::XML AS text) AS a)) With both 9.1 and 9.2 this query returns xmlelement

[HACKERS] Is a heads-up in 9.1 in order regarding the XML-related changes in 9.2?

2011-07-27 Thread Florian Pflug
Hi As it stands, we're going to release 9.1, knowing that 9.2 will change the behavior of XPATH. This brings forth the question whether we should somehow warn about that in either the release notes or the documentation of 9.1 If we don't, then applications developed on 9.1 might contain

Re: [HACKERS] Check constraints on partition parents only?

2011-07-27 Thread Alex Hunsaker
On Wed, Jul 27, 2011 at 14:08, Tom Lane t...@sss.pgh.pa.us wrote: Yeah.  If we're going to allow this then we should just have a concept of a non-inherited constraint, full stop.  This might just be a matter of removing the error thrown in ATAddCheckConstraint, but I'd be worried about

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-07-27 Thread Josh Kupershmidt
On Wed, Jul 27, 2011 at 5:19 PM, Peter Eisentraut pete...@gmx.net wrote: On tis, 2011-07-26 at 09:53 -0400, Robert Haas wrote: On Mon, Jul 25, 2011 at 10:29 PM, Josh Kupershmidt schmi...@gmail.com wrote: That seems like a good way to document this; patch for master updated. I avoided

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-07-27 Thread Robert Haas
On Wed, Jul 27, 2011 at 5:19 PM, Peter Eisentraut pete...@gmx.net wrote: I would like to argue for reverting this.  If you want to word-smith details like this, relation doesn't carry any additional meaning.  PG hackers know that internally, a relation is a table, view, index, sequence, etc.,

Re: [HACKERS] patch for 9.2: enhanced errors

2011-07-27 Thread Florian Pflug
On Jul27, 2011, at 23:20 , Pavel Stehule wrote: this is a refreshed patch. Only constraints and RI is supported now. There is about 1000 ereport calls, where a enhanced diagnostics should be used, but probably we don't modify all in one time. I wonder if it wouldn't be better to have something

Re: [HACKERS] Is a heads-up in 9.1 in order regarding the XML-related changes in 9.2?

2011-07-27 Thread Tom Lane
Florian Pflug f...@phlo.org writes: Is there an establishes practice for situations like this, i.e. a behavior- changing bug-fix committed to X.Y+1 before X.Y is released? Generally, we do nothing. It's a bit premature (in fact a lot premature) to assume that the current behavior of HEAD is

Re: [HACKERS] Is a heads-up in 9.1 in order regarding the XML-related changes in 9.2?

2011-07-27 Thread Florian Pflug
On Jul28, 2011, at 01:28 , Tom Lane wrote: Florian Pflug f...@phlo.org writes: Is there an establishes practice for situations like this, i.e. a behavior- changing bug-fix committed to X.Y+1 before X.Y is released? Generally, we do nothing. It's a bit premature (in fact a lot premature) to

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-07-27 Thread Tom Lane
Phil Sorber p...@omniti.com writes: Currently if you use 'ALTER ROLE rolename SET ROLE', pg_dumpall will dump an 'ALTER ROLE' out right after the 'CREATE ROLE' statement. I think pg_dumpall is the very least of your problems if you do something like that. We probably ought to forbid it

[HACKERS] Ripping out pg_restore's attempts to parse SQL before sending it

2011-07-27 Thread Tom Lane
In http://archives.postgresql.org/message-id/201107270042.22427.jul...@mehnle.net it's pointed out that pg_restore in direct-to-database mode is pretty badly broken if standard_conforming_strings=on. The reason is that it tries to lex SQL commands well enough to find line boundaries, and the code

[HACKERS] error: could not find pg_class tuple for index 2662

2011-07-27 Thread daveg
My client has been seeing regular instances of the following sort of problem: ... 03:06:09.453 exec_simple_query, postgres.c:900 03:06:12.042 XX000: could not find pg_class tuple for index 2662 at character 13 03:06:12.042 RelationReloadIndexInfo, relcache.c:1740 03:06:12.042 INSERT INTO

[HACKERS] cheaper snapshots

2011-07-27 Thread Robert Haas
On Wed, Oct 20, 2010 at 10:07 PM, Tom Lane t...@sss.pgh.pa.us wrote: I wonder whether we could do something involving WAL properties --- the current tuple visibility logic was designed before WAL existed, so it's not exploiting that resource at all.  I'm imagining that the kernel of a snapshot

Re: [HACKERS] Ripping out pg_restore's attempts to parse SQL before sending it

2011-07-27 Thread Tom Lane
I wrote: While I've not yet done any excavation in the commit logs to confirm this, the nearby comments in the code indicate that separation of COPY data from SQL commands was adopted in archive format version 1.3, which is ancient. In fact, it's so ancient that there was never a production

Re: [HACKERS] patch for 9.2: enhanced errors

2011-07-27 Thread Pavel Stehule
2011/7/28 Florian Pflug f...@phlo.org: On Jul27, 2011, at 23:20 , Pavel Stehule wrote: this is a refreshed patch. Only constraints and RI is supported now. There is about 1000 ereport calls, where a enhanced diagnostics should be used, but probably we don't modify all in one time. I wonder