[HACKERS] template0 database comment

2011-03-12 Thread Bruce Momjian
People are confused about what template0 is for, so I created the attached one-line patch to add a database comment to template0. No initdb, I assume, becuase it is just a comment. I plan to work on more system table and view comments for 9.2. -- Bruce Momjian http://momjian.us Ente

Re: [HACKERS] template0 database comment

2011-03-12 Thread Tom Lane
Bruce Momjian writes: > People are confused about what template0 is for, so I created the > attached one-line patch to add a database comment to template0. No > initdb, I assume, becuase it is just a comment. > + "COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n", No obje

Re: [HACKERS] template0 database comment

2011-03-12 Thread Dave Page
On 3/12/11, Tom Lane wrote: > Bruce Momjian writes: >> People are confused about what template0 is for, so I created the >> attached one-line patch to add a database comment to template0. No >> initdb, I assume, becuase it is just a comment. > >> +"COMMENT ON DATABASE template0 IS 'on

Re: [HACKERS] On-the-fly index tuple deletion vs. hot_standby

2011-03-12 Thread Noah Misch
On Thu, Dec 09, 2010 at 09:48:25AM +, Simon Riggs wrote: > On Fri, 2010-12-03 at 21:43 +0200, Heikki Linnakangas wrote: > > On 29.11.2010 08:10, Noah Misch wrote: > > > I have a hot_standby system and use it to bear the load of various > > > reporting > > > queries that take 15-60 minutes each

Re: [HACKERS] Fwd: index corruption in PG 8.3.13

2011-03-12 Thread Daniel Farina
On Wed, Mar 9, 2011 at 6:02 AM, Alvaro Herrera wrote: > I'll send you a perl program we wrote for a customer to check for > strange issues in btrees.  Please give it a spin; it may give you more > clues.  If you find additional checks to add, please let me know! I have also, coincidentally, encou

[HACKERS] memory-related bugs

2011-03-12 Thread Noah Misch
A suitably-instrumented run of "make installcheck-world" under valgrind turned up a handful of memory-related bugs: * memcpy()/strncpy() between overlapping regions uniqueentry() and dispell_lexize() both deduplicate an array by iteratively copying elements downward to occlude the duplicates. Bef

Re: [HACKERS] template0 database comment

2011-03-12 Thread Bruce Momjian
Dave Page wrote: > On 3/12/11, Tom Lane wrote: > > Bruce Momjian writes: > >> People are confused about what template0 is for, so I created the > >> attached one-line patch to add a database comment to template0. No > >> initdb, I assume, becuase it is just a comment. > > > >> + "COMMENT

Re: [HACKERS] template0 database comment

2011-03-12 Thread Thom Brown
On 12 March 2011 13:59, Bruce Momjian wrote: > Dave Page wrote: >> On 3/12/11, Tom Lane wrote: >> > Bruce Momjian writes: >> >> People are confused about what template0 is for, so I created the >> >> attached one-line patch to add a database comment to template0. No >> >> initdb, I assume, becua

Re: [HACKERS] template0 database comment

2011-03-12 Thread Bruce Momjian
Thom Brown wrote: > On 12 March 2011 13:59, Bruce Momjian wrote: > > Dave Page wrote: > >> On 3/12/11, Tom Lane wrote: > >> > Bruce Momjian writes: > >> >> People are confused about what template0 is for, so I created the > >> >> attached one-line patch to add a database comment to template0. No

Re: [HACKERS] template0 database comment

2011-03-12 Thread Christopher Browne
On Sat, Mar 12, 2011 at 8:59 AM, Bruce Momjian wrote: > Dave Page wrote: >> On 3/12/11, Tom Lane wrote: >> > Bruce Momjian writes: >> >> People are confused about what template0 is for, so I created the >> >> attached one-line patch to add a database comment to template0. No >> >> initdb, I assu

Re: [HACKERS] template0 database comment

2011-03-12 Thread Christopher Browne
On Sat, Mar 12, 2011 at 9:14 AM, Bruce Momjian wrote: > I like that.  Perhaps "unmodified template database'? "why" tends to be more important than "what", particularly to a confused DBA who's trying to figure out "why do they have all these extra databases???" Perhaps... "backup template databa

Re: [HACKERS] template0 database comment

2011-03-12 Thread Bruce Momjian
Christopher Browne wrote: > On Sat, Mar 12, 2011 at 8:59 AM, Bruce Momjian wrote: > > Dave Page wrote: > >> On 3/12/11, Tom Lane wrote: > >> > Bruce Momjian writes: > >> >> People are confused about what template0 is for, so I created the > >> >> attached one-line patch to add a database comment

Re: [HACKERS] Macros for time magic values

2011-03-12 Thread Bruce Momjian
Applied. --- Bruce Momjian wrote: > It has bothered me that many of our time routines use special magic > constants for time values, e.g. 24, 12, 60, etc. > > The attached patch changes these magic constants to macros to cl

Re: [HACKERS] FuncExpr.collid/OpExpr.collid unworkably serving double duty

2011-03-12 Thread Martijn van Oosterhout
On Fri, Mar 11, 2011 at 04:56:31PM -0500, Tom Lane wrote: > > In my implementation I needed to expand this to the general set of > > operators postgresql supported and relaxed this to only consider > > arguments to the function/operator that had the same type as the > > resulting type of the functi

Re: [HACKERS] template0 database comment

2011-03-12 Thread Greg Stark
On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian wrote: > OK, funny guys.  ;-)  Can someone give me the right text.  Obviously I > don' know what template0 is used for either.  Is it pg_dumpall perhaps? > template0: unmodifiable pristine empty database template1: default template for new databases

Re: [HACKERS] memory-related bugs

2011-03-12 Thread Greg Stark
On Sat, Mar 12, 2011 at 1:32 PM, Noah Misch wrote: > A suitably-instrumented run of "make installcheck-world" under valgrind turned > up a handful of memory-related bugs: Nice work. How did you instrument things so valgrind knew about palloc et al? I remember trying this in the past and running

Re: [HACKERS] Fwd: index corruption in PG 8.3.13

2011-03-12 Thread Greg Stark
On Sat, Mar 12, 2011 at 3:06 AM, Nikhil Sontakke wrote: > Live 522's      (LSN: logid 29, recoff 0xd1fade3c) previous points to > the zeroed out 523 block. Note that this seems to be latest LSN in the > data file. > So do you have logs from the server when it was restarted? It should say how far

Re: [HACKERS] template0 database comment

2011-03-12 Thread Bruce Momjian
Greg Stark wrote: > On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian wrote: > > OK, funny guys. ?;-) ?Can someone give me the right text. ?Obviously I > > don' know what template0 is used for either. ?Is it pg_dumpall perhaps? > > > > template0: unmodifiable pristine empty database > template1: def

Re: [HACKERS] template0 database comment

2011-03-12 Thread Tom Lane
Greg Stark writes: > On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian wrote: >> OK, funny guys. ;-) Can someone give me the right text. Obviously I >> don' know what template0 is used for either. Is it pg_dumpall perhaps? > template0: unmodifiable pristine empty database > template1: default t

[HACKERS] Collations versus user-defined functions

2011-03-12 Thread Tom Lane
I've thought of another area that AFAICT the current patch fails to address at all: what should happen in user-defined functions? Consider create function my_lt(x text, y text) returns bool as $$ begin return x < y; end

Re: [HACKERS] memory-related bugs

2011-03-12 Thread Tom Lane
Noah Misch writes: > A suitably-instrumented run of "make installcheck-world" under valgrind turned > up a handful of memory-related bugs: Hmm, interesting work, but I don't think I believe in the necessity for this kluge: > + else if (attributeName != &(att->attname)) > + namest

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Martijn van Oosterhout
On Sat, Mar 12, 2011 at 12:17:11PM -0500, Tom Lane wrote: > I've thought of another area that AFAICT the current patch fails to > address at all: what should happen in user-defined functions? The POLA suggests that the collation derivation of the original query should not be affected by the impl

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Greg Stark
On Sat, Mar 12, 2011 at 5:17 PM, Tom Lane wrote: >        create function my_lt(x text, y text) returns bool as >        $ >                begin >                        return x < y; >                end >        $ language plpgsql; > >        select my_lt('foo', 'bar' collate "de_DE"); >      

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Tom Lane
Greg Stark writes: > On Sat, Mar 12, 2011 at 5:17 PM, Tom Lane wrote: >>create function my_lt(x text, y text) returns bool as >>$ >>begin >>return x < y; >>end >>$ language plpgsql; >> >>select my_lt('foo', '

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Tom Lane
Martijn van Oosterhout writes: > On Sat, Mar 12, 2011 at 12:17:11PM -0500, Tom Lane wrote: >> I've thought of another area that AFAICT the current patch fails to >> address at all: what should happen in user-defined functions? > The POLA suggests that the collation derivation of the original quer

Re: [HACKERS] template0 database comment

2011-03-12 Thread Peter Eisentraut
On lör, 2011-03-12 at 12:01 -0500, Tom Lane wrote: > Shouldn't the "postgres" database get a comment too, while we're at > it? Perhaps "default database to connect to"? That's not actually true, though. Maybe it's the "default database used by administration programs"? In practice it might be "

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Peter Eisentraut
On lör, 2011-03-12 at 12:17 -0500, Tom Lane wrote: > Does the SQL standard have anything to say on the matter, or is there > a precedent in the behavior of TSQL or other DBMSes? I had investigated this issue but the SQL standard doesn't say anything about it. The SQL inlining issue is tricky. Ot

Re: [HACKERS] template0 database comment

2011-03-12 Thread Greg Stark
On Sat, Mar 12, 2011 at 5:01 PM, Tom Lane wrote: > The problem with Greg's wording is that it's falsifiable: it is possible > for someone to modify template0 if they're determined to mess things up. > So a description like "unmodifiable" is promising too much. > Eh, it's possible for someone to m

Re: [HACKERS] Macros for time magic values

2011-03-12 Thread Peter Eisentraut
On fre, 2011-03-11 at 12:50 -0500, Bruce Momjian wrote: > It has bothered me that many of our time routines use special magic > constants for time values, e.g. 24, 12, 60, etc. > > The attached patch changes these magic constants to macros to clarify > the code. I would like to apply this for 9.1

Re: [HACKERS] template0 database comment

2011-03-12 Thread Robert Haas
On Mar 12, 2011, at 12:01 PM, Tom Lane wrote: > Greg Stark writes: >> On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian wrote: >>> OK, funny guys. ;-) Can someone give me the right text. Obviously I >>> don' know what template0 is used for either. Is it pg_dumpall perhaps? > >> template0: unmo

Re: [HACKERS] template0 database comment

2011-03-12 Thread Greg Stark
On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas wrote: > A preposition is something you should try not to end a sentence with. > Something to keep in mind when someone localises Postgres for Latin which has this rule. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Martijn van Oosterhout
On Sat, Mar 12, 2011 at 02:46:19PM -0500, Tom Lane wrote: > > Similarly, inside the function the parameters should be considered to > > be IMPLICIT collation, to avoid strange errors depending on how its > > called. > > Not convinced by this. If we say that that's how it works, then no > user-def

Re: [HACKERS] template0 database comment

2011-03-12 Thread Andrew Dunstan
On 03/12/2011 04:24 PM, Greg Stark wrote: On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas wrote: A preposition is something you should try not to end a sentence with. Something to keep in mind when someone localises Postgres for Latin which has this rule. I assume Robert's comment was in j

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Tom Lane
Martijn van Oosterhout writes: > I think I didn't explain myself well. The *state* should be implicit, > the actual collation should be whatever the query says. What I was > thinking of is the following: > CREATE FUNCTION my_english_lt(text, text) RETURNS boolean AS $$ >return $1 < $2 COLLATE

Re: [HACKERS] pg_dump -X

2011-03-12 Thread Aaron W. Swenson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 12/24/2010 02:32 AM, J. Roeleveld wrote: > > Also, unless Gentoo actually strips the man-page and "--help" page (which I > do > seriously doubt), I do not see the "-X" option in the documentation. > > -- > Joost > Delayed response: No, we do

Re: [HACKERS] Collations versus user-defined functions

2011-03-12 Thread Tom Lane
Martijn van Oosterhout writes: > On Sat, Mar 12, 2011 at 02:46:19PM -0500, Tom Lane wrote: >> This would actually seem more sensible if we went with something even >> simpler than the current patch's behavior, namely that COLLATE only >> affects the operator it is an *immediate* input of, and noth