Search Postgresql Archives

Re: Namespace issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 16, 2006 at 10:53:10AM -0700, Don Y wrote:
> But what *binds* my C declaration to the corresponding SQL
> "CREATE CAST"?
> 
> E.g.,
> 
> CREATE FUNCTION foo_from_baz(baz)
> RETURNS foo
> AS '...'
> LANGUAGE 'C' IMMUTABLE STRICT;

Your create functions would look like:

CREATE FUNCTION foo(baz)
RETURNS foo
AS '$libdir/yourlib','cast_foo_from_baz'
LANGUAGE 'C' IMMUTABLE STRICT;

CREATE FUNCTION foo(baz2)
RETURNS foo
AS '$libdir/yourlib','cast_foo_from_baz2'
LANGUAGE 'C' IMMUTABLE STRICT;

> yet, to support the foo(baz) syntax, I would then need (?)
> to continue with:
> 
> CREATE CAST (baz AS foo)
> WITH FUNCTION foo(baz);

Indeed, and also:

CREATE CAST (baz2 TO foo)
WITH FUNCTION foo(baz2)

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux