On Fri, Feb/ 2/07 11:37:13AM -0500, Tom Lane wrote:
> Kate F <[EMAIL PROTECTED]> writes:
> > So, to conclude, we still have a valid use-case (which you explained a
> > little more explicitly than I did). Shall I attempt to implement it?
> > (that is, type_name_of() which returns TEXT)
>
> I think
Kate F <[EMAIL PROTECTED]> writes:
> So, to conclude, we still have a valid use-case (which you explained a
> little more explicitly than I did). Shall I attempt to implement it?
> (that is, type_name_of() which returns TEXT)
I think I'd suggest pg_type_name ... or maybe pg_type_name_of ...
also,
On Fri, Feb/ 2/07 11:17:46AM -0500, Tom Lane wrote:
> Kate F <[EMAIL PROTECTED]> writes:
> > (And whatever the decision regarding ANYELEMENT of, I believe this
> > should behave the same as IS OF)
>
> In the light of morning I think it may be a non-problem. The way that a
> plpgsql function with
Kate F <[EMAIL PROTECTED]> writes:
> (And whatever the decision regarding ANYELEMENT of, I believe this
> should behave the same as IS OF)
In the light of morning I think it may be a non-problem. The way that a
plpgsql function with an ANYELEMENT parameter really works is that on
first invocation
On Fri, Feb/ 2/07 09:52:08AM -0500, Tom Lane wrote:
> Kate F <[EMAIL PROTECTED]> writes:
> > In my case, I am constructing a query (to be exexecuted dynamically)
> > wherein I pass along some of the arguments I am given. This query calls
> > a function specified by an argument passed to me. If that
On Fri, Feb/ 2/07 10:09:24AM +, Richard Huxton wrote:
> Kate F wrote:
> >I see my misunderstanding: '2' IS OF (INTEGER) yields false: fine.
> >However I was expecting that pg_type_of('2') would return 'INTEGER': it
> >wouldn't, of course. So, I understand you here: there would be no
> >differen
Kate F <[EMAIL PROTECTED]> writes:
> In my case, I am constructing a query (to be exexecuted dynamically)
> wherein I pass along some of the arguments I am given. This query calls
> a function specified by an argument passed to me. If that function is
> overloaded, I need to be able to cast its arg
Kate F wrote:
I see my misunderstanding: '2' IS OF (INTEGER) yields false: fine.
However I was expecting that pg_type_of('2') would return 'INTEGER': it
wouldn't, of course. So, I understand you here: there would be no
difference between this and IS OF in the way I had imagined.
It's not even p
On Fri, Feb/ 2/07 03:06:19AM -0500, Tom Lane wrote:
> Kate F <[EMAIL PROTECTED]> writes:
> > The difference between OF and this function is that this function is
> > pulling the type from the datum, rather than explicitly testing it
> > against types the user suggests. If I wanted to find the type
Kate F <[EMAIL PROTECTED]> writes:
> The difference between OF and this function is that this function is
> pulling the type from the datum, rather than explicitly testing it
> against types the user suggests. If I wanted to find the type of x
> using OF, I would have to check it for all types whic
On Fri, Feb/ 2/07 02:41:15AM -0500, Tom Lane wrote:
>
> > Meanwhile, I still think the function David proposed is a worthy
> > addition (and I still have a user-case for it!), as using just the OF
> > operator for something similar, one would have to explictly test
> > against every type required.
Kate F <[EMAIL PROTECTED]> writes:
> ... OF takes a list of types; it needs parentheses:
> IF a IS OF (INTEGER) THEN
Oh, right, minor detail.
> Meanwhile, I still think the function David proposed is a worthy
> addition (and I still have a user-case for it!), as using just the OF
> operator f
On Fri, Feb/ 2/07 02:17:51AM -0500, Tom Lane wrote:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
> > you can identify type via operator OF.
>
> > IF a IS OF INTEGER THEN
> > RAISE NOTICE 'Parametr a is numeric';
>
> Yeah, that is the SQL-standard syntax, but I think our implementation
> do
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> you can identify type via operator OF.
> IF a IS OF INTEGER THEN
> RAISE NOTICE 'Parametr a is numeric';
Yeah, that is the SQL-standard syntax, but I think our implementation
doesn't work the way Kate would like: if "a" is an ANYELEMENT function
Hello,
you can identify type via operator OF.
like:
IF a IS OF INTEGER THEN
RAISE NOTICE 'Parametr a is numeric';
ELSIF a IS OF varchar THEN
RAISE NOTICE 'Parametr a is string';
END IF;
Regards
Pavel Stehule
_
Citite se
Hi all,
I found the need to determine the type of a datum at runtime. David
Fetter and Elein have already written about this:
http://www.varlena.com/varlena/GeneralBits/117.php
(My scenario is similar to the article there; I was writing a
procedure which unit-tests other procedures. It needs to k
16 matches
Mail list logo