Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-17 Thread Tom Lane
I wrote: > In the meantime I'm more convinced than ever that we should throw an > error for attempting such a cast. If people are imagining that it will > do something like that, we need to disillusion them. BTW, I wrote up what I thought was a trivial patch to make this happen, and promptly got

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-17 Thread Pavel Stehule
2009/2/17 Tom Lane : > I wrote: >> ITAGAKI Takahiro writes: >>> I hope anyelement could be used in cast because casts are supported by >>> almost programming languages where template or generics are available. > >> I think what you're suggesting is that inside a polymorphic function, >> anyelement

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-17 Thread Tom Lane
Brendan Jurd writes: > On Wed, Feb 18, 2009 at 2:40 AM, Tom Lane wrote: >> After thinking about it for awhile, I don't like the notation anyway >> --- it's not immediately obvious that a cast to anyelement should mean >> something like that. What seems more sensible to me is to introduce >> a fu

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-17 Thread Brendan Jurd
On Wed, Feb 18, 2009 at 2:40 AM, Tom Lane wrote: > After thinking about it for awhile, I don't like the notation anyway > --- it's not immediately obvious that a cast to anyelement should mean > something like that. What seems more sensible to me is to introduce > a function to get the type of an

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-17 Thread Tom Lane
I wrote: > ITAGAKI Takahiro writes: >> I hope anyelement could be used in cast because casts are supported by >> almost programming languages where template or generics are available. > I think what you're suggesting is that inside a polymorphic function, > anyelement would somehow be a macro for

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-17 Thread Sam Mason
On Mon, Feb 16, 2009 at 08:03:33PM -0500, Tom Lane wrote: > ITAGAKI Takahiro writes: > > I hope anyelement could be used in cast because casts are supported by > > almost programming languages where template or generics are available. Programming languages with "generics" (aka, parametric polymor

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-16 Thread Tom Lane
ITAGAKI Takahiro writes: > Tom Lane wrote: >> ITAGAKI Takahiro writes: >>> - Are there any limitations in casting to anyelement? >> >> It's a no-op ... probably we shouldn't even let you do it, if the >> lack of an error leaves room for such misinterpretation as this. >> anyelement and friends

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-16 Thread ITAGAKI Takahiro
Tom Lane wrote: > ITAGAKI Takahiro writes: > > - Are there any limitations in casting to anyelement? > > It's a no-op ... probably we shouldn't even let you do it, if the > lack of an error leaves room for such misinterpretation as this. > anyelement and friends are placeholders for use in f

Re: [HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-16 Thread Tom Lane
ITAGAKI Takahiro writes: > - Are there any limitations in casting to anyelement? It's a no-op ... probably we shouldn't even let you do it, if the lack of an error leaves room for such misinterpretation as this. anyelement and friends are placeholders for use in function declarations, not real

[HACKERS] Questions about parsing boolean and casting to anyelement

2009-02-15 Thread ITAGAKI Takahiro
The pg_autovacuum system catalog will be deprecated in 8.4, but my customers use them to control autovacuum to emulate maintenance window. So, I'm trying to re-implement the catalog using a VIEW and RULEs in 8.4. The attached is a WIP script, but I have some questions around it: (XXX: I don't mean