Re: [HACKERS] Multiple sorts in a query

2009-05-21 Thread Simon Riggs
On Wed, 2009-05-20 at 23:01 -0400, Zdenek Kotala wrote: We use default one. I did not tested difference between them, but IIRC that Jignesh did some testing with umem. I will ask him. However if you give me test scenario I can test it. Talk with Dimitri from Sun who is doing scalability

Re: [HACKERS] Compiler warning

2009-05-21 Thread Heikki Linnakangas
Peter Eisentraut wrote: Note that applying this patch would introduce a double-translation issue of the sort that you had complained about a while ago. I'm unsure which way to proceed here. Hmm, the patch looks fine to me. The strings are marked with gettext_noop() in the array, and passed

[HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Dmitry Koterov
Hello. PostgreSQL is very fast when we perform (even on a huge table) ALTER TABLE ... ADD COLUMN ... NULL; (nullable without a default value). This is because of NULL bitmap in tuples. And it's greatest feature for a developer! But another very common-case query like ALTER TABLE ... ADD

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Peter Eisentraut
On Thursday 21 May 2009 11:06:29 Dmitry Koterov wrote: 1. Store the DEFAULT flag directly in NULL BITMAP (add a bit to NULL bitmap not only for NULLable fields, but also for NOT NULL DEFAULT ... fields). 2. Add another bitmap for each tuple (DEFAULT bitmap). Bit value 0 means that there is a

Re: [HACKERS] Compiler warning

2009-05-21 Thread Peter Eisentraut
On Thursday 21 May 2009 10:01:59 Heikki Linnakangas wrote: Peter Eisentraut wrote: Note that applying this patch would introduce a double-translation issue of the sort that you had complained about a while ago. I'm unsure which way to proceed here. Hmm, the patch looks fine to me. The

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Sam Mason
On Thu, May 21, 2009 at 12:06:29PM +0400, Dmitry Koterov wrote: ALTER TABLE ... ADD COLUMN ... NULL; (nullable without a default value). This is because of NULL bitmap in tuples. And it's greatest feature for a developer! I don't think this is because of the NULL bitmap. PG just never needs

Re: [HACKERS] Compiler warning

2009-05-21 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Thursday 21 May 2009 10:01:59 Heikki Linnakangas wrote: Hmm, the patch looks fine to me. The strings are marked with gettext_noop() in the array, and passed through _() when used in errmsg. But his patch changes that to errhint(%s,

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Robert Haas
(In most cases NOT NULL DEFAULT xxx fields are BOOLEAN, flags: it is not handy to have 3-way flags.) This is certainly not true for me. I have both nullable booleans and not-nullable, defaulted columns of other types. So, are there plans to optimize such kind of queries? This could be done

Re: [HACKERS] pull raw text of a message by message-id

2009-05-21 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: We currently have a (really handy) facility to pull a message from the archives by message-ID, eg: http://archives.postgresql.org/message-id/603c8f070905202040v66cd3054t434c0b73aa844...@mail.gmail.com Could we possibly get a similar type of link that

Re: [HACKERS] from_collapse_limit vs. geqo_threshold

2009-05-21 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: Robert, It appears that this statement has been in our documentation since Tom Lane added FROM_COLLAPSE_LIMIT (back then, it was capitalized) on January 25, 2003 (9bf97ff426de9), but I can't find any justification for it anywhere. I think we either need

Re: [HACKERS] from_collapse_limit vs. geqo_threshold

2009-05-21 Thread Robert Haas
On Thu, May 21, 2009 at 7:50 AM, Tom Lane t...@sss.pgh.pa.us wrote: Josh Berkus j...@agliodbs.com writes: Robert, It appears that this statement has been in our documentation since Tom Lane added FROM_COLLAPSE_LIMIT (back then, it was capitalized) on January 25, 2003 (9bf97ff426de9), but I

Re: [HACKERS] Compiler warning

2009-05-21 Thread Peter Eisentraut
On Thursday 21 May 2009 14:29:51 Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On Thursday 21 May 2009 10:01:59 Heikki Linnakangas wrote: Hmm, the patch looks fine to me. The strings are marked with gettext_noop() in the array, and passed through _() when used in errmsg. But

[HACKERS] psql is broken in 8.4

2009-05-21 Thread Zdenek Kotala
Hi all, last version of psql is broken: psql (8.4beta1, server 8.3.7) WARNING: psql version 8.4, server version 8.3. Some psql features might not work. Type help for help. postgres=# \d test ERROR: syntax error at or near , LINE 1: ...index, relhasrules, reltriggers 0, relhasoids,

Re: [HACKERS] from_collapse_limit vs. geqo_threshold

2009-05-21 Thread Greg Stark
Having just raised the statistics targets I wonder if we should look at raising these two parameters too. The experience on the lists are that when people run into either of these two limits we recommend raising them and we've never seen anyone come back complaining that their planning time goes

Re: [HACKERS] from_collapse_limit vs. geqo_threshold

2009-05-21 Thread Robert Haas
On Thu, May 21, 2009 at 8:51 AM, Greg Stark st...@enterprisedb.com wrote: Having just raised the statistics targets I wonder if we should look at raising these two parameters too. The experience on the lists are that when people run into either of these two limits we recommend raising them and

Re: [HACKERS] psql is broken in 8.4

2009-05-21 Thread Heikki Linnakangas
Zdenek Kotala wrote: last version of psql is broken: psql (8.4beta1, server 8.3.7) WARNING: psql version 8.4, server version 8.3. Some psql features might not work. Type help for help. postgres=# \d test ERROR: syntax error at or near , LINE 1: ...index, relhasrules, reltriggers 0,

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Tom Lane
Sam Mason s...@samason.me.uk writes: On Thu, May 21, 2009 at 12:06:29PM +0400, Dmitry Koterov wrote: ALTER TABLE ... ADD COLUMN ... NULL; (nullable without a default value). This is because of NULL bitmap in tuples. And it's greatest feature for a developer! I don't think this is because

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Robert Haas
On Thu, May 21, 2009 at 10:45 AM, Tom Lane t...@sss.pgh.pa.us wrote: Sam Mason s...@samason.me.uk writes: On Thu, May 21, 2009 at 12:06:29PM +0400, Dmitry Koterov wrote: ALTER TABLE ... ADD COLUMN ... NULL; (nullable without a default value). This is because of NULL bitmap in tuples. And

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Greg Stark
On Thu, May 21, 2009 at 3:45 PM, Tom Lane t...@sss.pgh.pa.us wrote: All that needs to be tracked is the first default value (this is currently assumed to be NULL). You're being a bit vague, but in any case I don't think it can work for non-constant defaults (consider DEFAULT NOW()).  And

Re: [HACKERS] psql is broken in 8.4

2009-05-21 Thread Zdenek Kotala
Heikki Linnakangas píše v čt 21. 05. 2009 v 16:53 +0300: Zdenek Kotala wrote: last version of psql is broken: psql (8.4beta1, server 8.3.7) WARNING: psql version 8.4, server version 8.3. Some psql features might not work. Type help for help. postgres=# \d test ERROR:

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Tom Lane
Greg Stark st...@enterprisedb.com writes: Schemes like this have been discussed before but I don't think we considered applying the limitation that only the first default value would be covered. We always wanted to be able to handle new defaults or making a non-null column nullable later.

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Robert Haas
On Thu, May 21, 2009 at 11:13 AM, Greg Stark st...@enterprisedb.com wrote: On Thu, May 21, 2009 at 3:45 PM, Tom Lane t...@sss.pgh.pa.us wrote: All that needs to be tracked is the first default value (this is currently assumed to be NULL). You're being a bit vague, but in any case I don't

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Greg Stark
On Thu, May 21, 2009 at 4:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: Greg Stark st...@enterprisedb.com writes: Schemes like this have been discussed before but I don't think we considered applying the limitation that only the first default value would be covered. We always wanted to be able to

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Tom Lane
Greg Stark st...@enterprisedb.com writes: On Thu, May 21, 2009 at 4:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah ... I don't see exactly what it would buy to restrict it to just the first such value. Well it wouldn't buy you steady-state space savings or performance improvements. What

[HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Steve Prentice
Hello, This patch is intended to supplement Pavel's patch for named and mixed notation support in 8.5. This patch makes it so a plpgsql function can call another function with the same parameter names using the named parameters notation. Without this patch, the following example will

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Tom Lane
Steve Prentice prent...@cisco.com writes: This patch is intended to supplement Pavel's patch for named and mixed notation support in 8.5. This patch makes it so a plpgsql function can call another function with the same parameter names using the named parameters notation. Well,

Re: [HACKERS] Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

2009-05-21 Thread Greg Stark
-- Greg On 21 May 2009, at 12:26, Tom Lane t...@sss.pgh.pa.us wrote: Greg Stark st...@enterprisedb.com writes: On Thu, May 21, 2009 at 4:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah ... I don't see exactly what it would buy to restrict it to just the first such value. Well it

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v3

2009-05-21 Thread Steve Prentice
On May 21, 2009, at 10:52 AM, Tom Lane wrote: It's probably time to bite the bullet and redo the parser as has been suggested in the past, ie fix things so that the main parser is used. Ideally I'd like to switch the name resolution priority to be more Oracle-like, but even if we don't do that

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Josh Berkus
The patch adds the AS keyword to the plpgsql grammar and doesn't assign an expression parameter to the sql construct if the scalar follows the AS keyword. Would it be possible to also support = as well as as? I believe that SQL Server uses = exclusively, and supporting that syntax would

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Pavel Stehule
2009/5/21 Josh Berkus j...@agliodbs.com: The patch adds the AS keyword to the plpgsql grammar and doesn't assign an expression parameter to the sql construct if the scalar follows the AS keyword. Would it be possible to also support = as well as as?  I believe that SQL Server uses =

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Pavel Stehule
2009/5/21 Pavel Stehule pavel.steh...@gmail.com: 2009/5/21 Josh Berkus j...@agliodbs.com: The patch adds the AS keyword to the plpgsql grammar and doesn't assign an expression parameter to the sql construct if the scalar follows the AS keyword. Would it be possible to also support = as well

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Steve Prentice
= is more common than as for sure, but this has been talked about before starting at about this message: http://archives.postgresql.org/message-id/14319.1228833...@sss.pgh.pa.us -Steve On May 21, 2009, at 11:51 AM, Josh Berkus wrote: The patch adds the AS keyword to the plpgsql grammar

Re: [HACKERS] [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2

2009-05-21 Thread Alvaro Herrera
Josh Berkus wrote: The patch adds the AS keyword to the plpgsql grammar and doesn't assign an expression parameter to the sql construct if the scalar follows the AS keyword. Would it be possible to also support = as well as as? I believe that SQL Server uses = exclusively, and supporting