Re: [HACKERS] casting & type comments - Mailing list pgsql-hackers

From dg@illustra.com (David Gould)
Subject Re: [HACKERS] casting & type comments
Date
Msg-id 9803132319.AA04631@hawk.illustra.com
Whole thread Raw
In response to casting & type comments  (Brett McCormick <brett@work.chicken.org>)
Responses Re: [HACKERS] casting & type comments  (Brett McCormick <brett@work.chicken.org>)
List pgsql-hackers
> What do you all think about the fact that cast(anytype as varchar)
> results in a call to a procedure that is not creatable with 'create
> function'?

Not too nice...

> Perhaps we should re-think our casting implementation,
> maybe one that isn't based on just rewriting itself into a function
> call :) If I wanted to call a function, I would :)

But, this is the real strength of Postgres, everything is treated uniformly
and everything can be extended by defining functions. To hardcode certain
types would be to lose the one of the most creative and desireable aspects
of the system.

> I can, however, do a create function with a different name, then
> update that to varchar.  the reason I can't, of course, is because the
> grammar expects varchar(number), not varchar(argument types)..

Perhaps the grammar could be fixed to allow this?

-dg

David Gould            dg@illustra.com           510.628.3783 or 510.305.9468
Informix Software  (No, really)         300 Lakeside Drive  Oakland, CA 94612
 - I realize now that irony has no place in business communications.


pgsql-hackers by date:

Previous
From: Brett McCormick
Date:
Subject: Re: [HACKERS] suspected problem with cache updates
Next
From: Brett McCormick
Date:
Subject: Re: [HACKERS] Postgresql v6.3 for Alpha Digital Unix