Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > Re: Resolving p...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 9 Topic 9618 of 10114
Post > Topic >>

Re: Resolving polymorphic functions with relateddatatypes

by simon@[EMAIL PROTECTED] (Simon Riggs) Jul 3, 2008 at 02:24 PM

On Thu, 2008-07-03 at 13:54 +0100, Gregory Stark wrote:
> "Simon Riggs" <simon@[EMAIL PROTECTED]
> writes:
> 
> > On Thu, 2008-07-03 at 14:11 +0300, Heikki Lin****angas wrote:
> >
> >> > What I'd like it to do is to recognise that the 0 should be cast
> >> > implicitly to another datatype within the same family. I want and
expect
> >> >  nvl(char_column, 0)
> >> > to fail, but I expect the various numeric/integer types we have to
play
> >> > nicely together without tears.
> >> 
> >> So, it would be analogous to the 'unknown' type, but for numeric 
> >> literals instead of text literals. Seems reasonable. It still
wouldn't 
> >> allow nvl(1::bigint, 2::int4), though, just as the unknown type
doesn't 
> >> help with nvl('foo'::text, 'bar'::varchar).
> >
> > Well, it would be nice if we could work with the unknown type also,
but
> > I don't expect that's meaningful.
> 
> Postgres's way of spelling constants of unknown type is to put them in
single
> quotes. That is, 'foo' isn't a character string in Postgres, it's *any*
kind
> of constant with an unknown type. So this would work:
> 
> nvl(numeric_column, '0')
> 
> I think what you're suggesting is making integer and floating point
constants
> like 0 and 0.1 be treated as "unknown" or perhaps a different kind of
unknown,
> "unknown integral type" and "unknown numeric type".
> 
> Personally I think the way it works now is weird too, but it's been that
way
> forever and changing it would be a pretty massive behaviour change.

Well, I can workaround the problem, it just seems like there shouldn't
be one.

I'm OK with massive behaviour change (like 8.3) as long as its a
controllable option.

By far the biggest behaviour change is to get the rest of the world to
work the way we do. People write (and *have written*) SQL that doesn't
work this way.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Sup****t


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 9 Posts in Topic:
Resolving polymorphic functions with related datatypes
simon@[EMAIL PROTECTED]   2008-07-03 10:36:09 
Re: Resolving polymorphic functions with related datatypes
pavel.stehule@[EMAIL PROT  2008-07-03 12:22:21 
Re: Resolving polymorphic functions with related
simon@[EMAIL PROTECTED]   2008-07-03 11:51:38 
Re: Resolving polymorphic functions with related datatypes
heikki@[EMAIL PROTECTED]   2008-07-03 14:11:34 
Re: Resolving polymorphic functions with related
simon@[EMAIL PROTECTED]   2008-07-03 13:34:05 
Re: Resolving polymorphic functions with relateddatatypes
stark@[EMAIL PROTECTED]   2008-07-03 13:54:29 
Re: Resolving polymorphic functions with relateddatatypes
tgl@[EMAIL PROTECTED] (T  2008-07-03 12:01:25 
Re: Resolving polymorphic functions with relateddatatypes
simon@[EMAIL PROTECTED]   2008-07-03 14:24:06 
Re: Resolving polymorphic functions with relateddatatypes
pavel.stehule@[EMAIL PROT  2008-07-03 19:42:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 2:00:22 CDT 2008.