Re: [HACKERS] Name column

2010-09-24 Thread Pavel Stehule
2010/9/24 Tom Lane : > Robert Haas writes: >> On Fri, Sep 24, 2010 at 11:43 AM, Tom Lane wrote: >>> -1.  There's nothing wrong with the function-as-a-computed-column >>> feature, and it seems likely that taking it away will break applications. > >> ... What evidence do we have that anyone is rely

Re: [HACKERS] Name column

2010-09-24 Thread Tom Lane
Pavel Stehule writes: > I dislike this feature too. It is breaking other ANSI SQL feature - > constructors, because it has same syntax tablename(field1, field2, > ). Uh, that's nonsense. What we're talking about is tablename.functionname. regards, tom lane -- Sent

Re: [HACKERS] Name column

2010-09-24 Thread Tom Lane
Robert Haas writes: > On Fri, Sep 24, 2010 at 11:55 AM, Tom Lane wrote: >> So?  There are lots of surprising things in SQL.  And *of course* the >> only complaints come from people who didn't know about it, not from >> satisfied users. > I guess that's true, but is this behavior specified in or

Re: [HACKERS] Name column

2010-09-24 Thread Robert Haas
On Fri, Sep 24, 2010 at 11:55 AM, Tom Lane wrote: > Robert Haas writes: >> On Fri, Sep 24, 2010 at 11:43 AM, Tom Lane wrote: >>> -1.  There's nothing wrong with the function-as-a-computed-column >>> feature, and it seems likely that taking it away will break applications. > >> ... What evidence

Re: [HACKERS] Name column

2010-09-24 Thread Pavel Stehule
2010/9/24 André Fernandes : > > >> Date: Fri, 24 Sep 2010 08:01:35 -0400 >> Subject: Re: [HACKERS] Name column >> From: robertmh...@gmail.com >> To: heikki.linnakan...@enterprisedb.com >> CC: arhi...@dc.baikal.ru; pgsql-hackers@postgresql.org >>

Re: [HACKERS] Name column

2010-09-24 Thread Tom Lane
Robert Haas writes: > On Fri, Sep 24, 2010 at 11:43 AM, Tom Lane wrote: >> -1.  There's nothing wrong with the function-as-a-computed-column >> feature, and it seems likely that taking it away will break applications. > ... What evidence do we have that anyone is relying on this > behavior in ap

Re: [HACKERS] Name column

2010-09-24 Thread Robert Haas
On Fri, Sep 24, 2010 at 11:43 AM, Tom Lane wrote: > =?iso-8859-1?B?QW5kcukgRmVybmFuZGVz?= > writes: >>> On Fri, Sep 24, 2010 at 6:35 AM, Heikki Linnakangas >>> wrote: >>> I'm starting to wonder if we should think about deprecating this >>> behavior.  It is awfully confusing and unintuitive. > >

Re: [HACKERS] Name column

2010-09-24 Thread Tom Lane
=?iso-8859-1?B?QW5kcukgRmVybmFuZGVz?= writes: >> On Fri, Sep 24, 2010 at 6:35 AM, Heikki Linnakangas >> wrote: >> I'm starting to wonder if we should think about deprecating this >> behavior. It is awfully confusing and unintuitive. > I agree, it is very unintuitive. > +1 for deprecating thi

Re: [HACKERS] Name column

2010-09-24 Thread André Fernandes
> Date: Fri, 24 Sep 2010 08:01:35 -0400 > Subject: Re: [HACKERS] Name column > From: robertmh...@gmail.com > To: heikki.linnakan...@enterprisedb.com > CC: arhi...@dc.baikal.ru; pgsql-hackers@postgresql.org > > On Fri, Sep 24, 2010 at 6:35 AM, Heikki Linnakangas > w

Re: [HACKERS] Name column

2010-09-24 Thread Robert Haas
On Fri, Sep 24, 2010 at 6:35 AM, Heikki Linnakangas wrote: > For historical reasons PostgreSQL supports calling a function with a single > argument like "column.function", in addition to "function(column)". There is > a function "name(text)" that casts the input to the 'name' datatype, so your > e

Re: [HACKERS] Name column

2010-09-24 Thread Heikki Linnakangas
On 24/09/10 13:02, Vlad Arkhipov wrote: I have just come across a weird thing. It works for any table and seems to be not documented. SELECT c.name FROM (VALUES(1, 'A', true)) c; SELECT c.name FROM pg_class c; And it does not work in these cases: SELECT name FROM (VALUES(1, 'A', true)); SELECT

[HACKERS] Name column

2010-09-24 Thread Vlad Arkhipov
I have just come across a weird thing. It works for any table and seems to be not documented. SELECT c.name FROM (VALUES(1, 'A', true)) c; SELECT c.name FROM pg_class c; And it does not work in these cases: SELECT name FROM (VALUES(1, 'A', true)); SELECT name FROM pg_class; PostgreSQL 8.4.2 o