Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Heikki Linnakangas
Tom Lane wrote: Josh Berkus [EMAIL PROTECTED] writes: Oh, and wal_buffers, the default for which we should just change if it weren't for SHMMAX. Uh, why? On a workload of mostly small transactions, what value is there in lots of wal_buffers? None. But there's also little to no harm in

Re: [HACKERS] Runtime checking of MCV (Was: ... histogram bucket numdistinct statistics)

2008-06-11 Thread Csaba Nagy
On Tue, 2008-06-10 at 19:03 -0400, Tom Lane wrote: Given such an MCV list, the planner will always make the right choice of whether to do index or seqscan ... as long as it knows the value being searched for, that is. Parameterized plans have a hard time here, but that's not really the fault

[HACKERS] B-tree finish incomplete split bug

2008-06-11 Thread Heikki Linnakangas
While testing my xlogutils.c refactoring patch, I bumped into an existing bug in the B-tree code that finishes an incomplete split: btree_xlog_cleanup() calls _bt_insert_parent() to insert the parent pointer. If the split page was the root page, _bt_insert_parent() creates a new root page by

Re: [HACKERS] Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics

2008-06-11 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Gregory Stark [EMAIL PROTECTED] writes: It's possible that the second option I described -- teaching Append when to use something other than sum() -- would only work in the cases where constraint exclusion could be fixed though. In which case having

[HACKERS] why copy tuple in the end of trigger when nothing changed in NEW OLD record variable

2008-06-11 Thread billy
pgsql-hackers,hello: version 8.3.0 in function plpgsql_exec_trigger. in a trigger, if NEW is returned as the result and we do nothing to NEW. for example, we have a table like this: create table test (a int); insert into test values(1); and a trigger

Re: [HACKERS] math error or rounding problem Money type

2008-06-11 Thread Merlin Moncure
On 6/8/08, Gregory Stark [EMAIL PROTECTED] wrote: I don't think as late as possible applies with money. If you were dealing with approximate measurements you want to round as late as possible because rounding is throwing away precision. But if you're dealing with money you're dealing with

[HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Zdenek Kotala
1) Overview This proposal is part of inplace upgrade project. PostgreSQL should be able to read any page in old version. This is basic for all possible upgrade method. 2) Background We have several macros for manipulating of the page structures but this list is not complete and many parts

Re: [HACKERS] B-tree finish incomplete split bug

2008-06-11 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: The trivial fix is to not call CacheInvalidateRelcache() in recovery (patch attached). Another option is to put the check into CacheInvalidateRelcache() itself, but in the name of consistency we should then put the same check into the other

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Tom Lane
Zdenek Kotala [EMAIL PROTECTED] writes: There are examples: void PageSetFull(Page page) { switch ( PageGetPageLayoutVersion(page) ) { case 4 : ((PageHeader_04) (page))-pd_flags |= PD_PAGE_FULL; break; default

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Heikki Linnakangas
Zdenek Kotala wrote: 4) Implementation The main point of implementation is to have several version of PageHeader structure (e.g. PageHeader_04, PageHeader_03 ...) and correct structure will be handled in special branch (see examples). (this won't come as a surprise as we talked about this

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: (this won't come as a surprise as we talked about this in PGCon, but) I think we should rather convert the page structure to new format in ReadBuffer the first time a page is read in. That would keep the changes a lot more isolated. The problem

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Zdenek Kotala
Tom Lane napsal(a): Zdenek Kotala [EMAIL PROTECTED] writes: There are examples: void PageSetFull(Page page) { switch ( PageGetPageLayoutVersion(page) ) { case 4 : ((PageHeader_04) (page))-pd_flags |= PD_PAGE_FULL; break;

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: (this won't come as a surprise as we talked about this in PGCon, but) I think we should rather convert the page structure to new format in ReadBuffer the first time a page is read in. That would keep the changes a lot more isolated.

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Greg Sabino Mullane wrote: * The word 'paramters' is still misspelled. :) Corrected for 8.4. -- Bruce Momjian [EMAIL PROTECTED]http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Zdenek Kotala
Heikki Linnakangas napsal(a): Zdenek Kotala wrote: 4) Implementation The main point of implementation is to have several version of PageHeader structure (e.g. PageHeader_04, PageHeader_03 ...) and correct structure will be handled in special branch (see examples). (this won't come as a

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Zdenek Kotala
Heikki Linnakangas napsal(a): Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: (this won't come as a surprise as we talked about this in PGCon, but) I think we should rather convert the page structure to new format in ReadBuffer the first time a page is read in. That would keep

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Joshua D. Drake
On Wed, 2008-06-11 at 11:45 -0400, Bruce Momjian wrote: Greg Sabino Mullane wrote: * The word 'paramters' is still misspelled. :) Corrected for 8.4. Technically this is a bug fix... why not backpatch it too? -- Bruce Momjian [EMAIL PROTECTED]http://momjian.us

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Josh Berkus
Heikki, Ideally, of course, there would be no wal_buffers setting, and WAL buffers would be allocated from shared_buffers pool on demand... +1 --Josh -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Josh Berkus
Tom Lane wrote: Josh Berkus [EMAIL PROTECTED] writes: Oh, and wal_buffers, the default for which we should just change if it weren't for SHMMAX. Uh, why? On a workload of mostly small transactions, what value is there in lots of wal_buffers? Actually, it's also useful for any workload with

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Alvaro Herrera
Josh Berkus wrote: Heikki, Ideally, of course, there would be no wal_buffers setting, and WAL buffers would be allocated from shared_buffers pool on demand... Same for pg_subtrans, pg_clog, etc (as previously discussed) -- Alvaro Herrera

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Robert Lor wrote: Robert Treat wrote: On Wednesday 04 June 2008 22:04:54 Greg Smith wrote: I was just talking to someone today about building a monitoring tool for this. Not having a clear way to recommend people monitor use of work_mem and its brother spilled to disk sorts is an

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Joshua D. Drake wrote: On Wed, 2008-06-11 at 11:45 -0400, Bruce Momjian wrote: Greg Sabino Mullane wrote: * The word 'paramters' is still misspelled. :) Corrected for 8.4. Technically this is a bug fix... why not backpatch it too? That might show up as a diff for people doing

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Magnus Hagander
Bruce Momjian wrote: Joshua D. Drake wrote: On Wed, 2008-06-11 at 11:45 -0400, Bruce Momjian wrote: Greg Sabino Mullane wrote: * The word 'paramters' is still misspelled. :) Corrected for 8.4. Technically this is a bug fix... why not backpatch it too? That might show up as a diff for

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Jignesh K. Shah
Josh Berkus wrote: Heikki, Ideally, of course, there would be no wal_buffers setting, and WAL buffers would be allocated from shared_buffers pool on demand... +1 --Josh +1 -Jignesh -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Dave Page wrote: On Mon, Jun 2, 2008 at 5:46 AM, Joshua D. Drake [EMAIL PROTECTED] wrote: I've seen people not doing so more often than you would think. Perhaps because they are DBAs and not sysadmins? I also meant a tool to do things like verify that the changes are valid, as someone

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Dave Page
On Wed, Jun 11, 2008 at 6:56 PM, Bruce Momjian [EMAIL PROTECTED] wrote: Dave Page wrote: On Mon, Jun 2, 2008 at 5:46 AM, Joshua D. Drake [EMAIL PROTECTED] wrote: pg_ctl -D data check? I would +1 that. I would also really like to see that - though I'd also like to see an SQL interface

[HACKERS] How to Sponsor a Feature

2008-06-11 Thread David Fetter
Folks, I forgot to post the fact that I'd put up a http://wiki.postgresql.org/wiki/How_to_sponsor_a_feature, per my TODO from the developers' meeting in Ottawa. Sorry about that. Anyhow, Jignesh has come up with a proposal template http://wiki.postgresql.org/wiki/ProposalTemplate that could use

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Dave Page wrote: On Wed, Jun 11, 2008 at 6:56 PM, Bruce Momjian [EMAIL PROTECTED] wrote: Dave Page wrote: On Mon, Jun 2, 2008 at 5:46 AM, Joshua D. Drake [EMAIL PROTECTED] wrote: pg_ctl -D data check? I would +1 that. I would also really like to see that - though I'd also like

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Josh Berkus wrote: Ideally, of course, there would be no wal_buffers setting, and WAL buffers would be allocated from shared_buffers pool on demand... Same for pg_subtrans, pg_clog, etc (as previously discussed) I agree with that for pg_clog and

Re: [HACKERS] How to Sponsor a Feature

2008-06-11 Thread Andrew Dunstan
David Fetter wrote: Folks, I forgot to post the fact that I'd put up a http://wiki.postgresql.org/wiki/How_to_sponsor_a_feature, per my TODO from the developers' meeting in Ottawa. Sorry about that. Anyhow, Jignesh has come up with a proposal template

Re: [HACKERS] How to Sponsor a Feature

2008-06-11 Thread Greg Smith
On Wed, 11 Jun 2008, Andrew Dunstan wrote: If we want to help people to sponsor features, then I think we need to deal with subjects like finding someone to undertake the development, the sponsor's relationship with the developer, methods and times of payment, etc. The bit on the wiki is

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: * Can we build a configuration wizard to tell newbies what settings they need to tweak? That would trump all the other suggestions conclusively. Anyone good at expert systems? How far could we get with the

[HACKERS] Adding more context to tuptoaster's elog messages

2008-06-11 Thread Tom Lane
Reflecting on this thread: http://archives.postgresql.org/pgsql-general/2008-06/msg00344.php it strikes me that the elog messages in tuptoaster.c would be significantly more useful if they gave the name of the toast table containing the problem, which is readily available at the sites of the elog

[HACKERS] .psqlrc output for \pset commands

2008-06-11 Thread Bruce Momjian
In my .psqlrc I have: \pset format wrapped and this outputs this on psql startup: $ psql test -- Output format is wrapped. psql (8.4devel) Type help for help. Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am wondering if we should be

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: The second idea is the idea of having one parameter depend on another. Not only could we do that for some of our existing parameters, but we could have pseudo-parameters like concurrent_queries, memory_usage, and extra_disk_space that could be at the

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: The second idea is the idea of having one parameter depend on another. Not only could we do that for some of our existing parameters, but we could have pseudo-parameters like concurrent_queries, memory_usage, and extra_disk_space

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: (Likely counterexample: adding collation info to text values.) I don't think the argument really needs an example, but I would be pretty upset if we proposed tagging every text datum with a collation. Encoding perhaps, though that seems like a bad idea to me

Re: [HACKERS] .psqlrc output for \pset commands

2008-06-11 Thread Gregory Stark
Bruce Momjian [EMAIL PROTECTED] writes: In my .psqlrc I have: \pset format wrapped and this outputs this on psql startup: $ psql test -- Output format is wrapped. psql (8.4devel) Type help for help. Is this desirable? \set QUIET at the top of .psqlrc fixes

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Alvaro Herrera [EMAIL PROTECTED] writes: Josh Berkus wrote: Ideally, of course, there would be no wal_buffers setting, and WAL buffers would be allocated from shared_buffers pool on demand... Same for pg_subtrans, pg_clog, etc (as previously discussed)

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Josh Berkus
Greg, At least that way we could always steal more if we want or return some, as long as we're careful about when we do it. That would open the door to having these parameters be dynamically adjustable. That alone would be worthwhile even if we bypass all bells and whistles of the buffer

Re: [HACKERS] cannot use result of (insert..returning)

2008-06-11 Thread Bruce Momjian
Heikki Linnakangas wrote: dvs wrote: Hello, I need to use query like: select (insert into test (a) values (x) returning b),c from anytable where condition but it say ERROR: syntax error at or near into Is this a bug? No, it's a known limitation. Is there a TODO item

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Magnus Hagander wrote: Bruce Momjian wrote: Joshua D. Drake wrote: On Wed, 2008-06-11 at 11:45 -0400, Bruce Momjian wrote: Greg Sabino Mullane wrote: * The word 'paramters' is still misspelled. :) Corrected for 8.4. Technically this is a bug fix... why not backpatch it too?

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: The second idea is the idea of having one parameter depend on another. We have tried to do that in the past, and it didn't work well *at all*. We have? When? Just a couple months ago we had to

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Gregory Stark
Josh Berkus [EMAIL PROTECTED] writes: Greg, At least that way we could always steal more if we want or return some, as long as we're careful about when we do it. That would open the door to having these parameters be dynamically adjustable. That alone would be worthwhile even if we bypass

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: I agree with that for pg_clog and friends, but I'm much more leery of folding WAL into the same framework. Well it may still be worthwhile stealing buffers from shared_buffers even if we set a special flag marking

Re: [HACKERS] cannot use result of (insert..returning)

2008-06-11 Thread Andrew Dunstan
Bruce Momjian wrote: Heikki Linnakangas wrote: dvs wrote: Hello, I need to use query like: select (insert into test (a) values (x) returning b),c from anytable where condition but it say ERROR: syntax error at or near into Is this a bug? No, it's a known limitation.

Re: [HACKERS] Proposal: Multiversion page api (inplace upgrade)

2008-06-11 Thread Stephen Denne
Gregory Stark wrote: Tom Lane [EMAIL PROTECTED] writes: (Likely counterexample: adding collation info to text values.) I don't think the argument really needs an example, but I would be pretty upset if we proposed tagging every text datum with a collation. Encoding perhaps, though

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Greg Smith
On Wed, 11 Jun 2008, Tom Lane wrote: Who said anything about loops? What I am talking about is what happens during set memory_usage = X; // implicitly sets work_mem = X/100, say set work_mem = Y; set memory_usage = Z; What is work_mem now, and what's your excuse for

Re: [HACKERS] .psqlrc output for \pset commands

2008-06-11 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Anyways the thing that struck me as odd was the messages appearing *before* the header. It seems to me the header should print followed by .psqlrc output followed by normal output. I think the reason for the current behavior is to allow \set QUIET in

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: The idea has a fundamental logical flaw, which is that it's not clear which parameter wins if the user changes both. Yes, you could get into problems by having variable dependency loops, Who said anything about

Re: [HACKERS] Overhauling GUCS

2008-06-11 Thread Bruce Momjian
Greg Smith wrote: On Wed, 11 Jun 2008, Tom Lane wrote: Who said anything about loops? What I am talking about is what happens during set memory_usage = X; // implicitly sets work_mem = X/100, say set work_mem = Y; set memory_usage = Z; What is work_mem now, and what's