Re: [GENERAL] CAST function for user defined type

2007-01-22 Thread Ron Peterson
On Mon, Jan 22, 2007 at 11:40:08AM -0500, Tom Lane wrote: > Ron Peterson <[EMAIL PROTECTED]> writes: > > That cleared one hurdle, but I'm still not there yet. > > > % select 'fe43d07c0c624786bebfcb3357a2a13a'::y_octet_16; > > y_octet_16 > > -- > > fe43d

Re: [GENERAL] CAST function for user defined type

2007-01-22 Thread Tom Lane
Ron Peterson <[EMAIL PROTECTED]> writes: > That cleared one hurdle, but I'm still not there yet. > % select 'fe43d07c0c624786bebfcb3357a2a13a'::y_octet_16; > y_octet_16 > -- > fe43d07c0c624786bebfcb3357a2a13a That's not invoking any cast function, but

Re: [GENERAL] CAST function for user defined type

2007-01-22 Thread Ron Peterson
On Mon, Jan 22, 2007 at 04:36:20PM +0100, Martijn van Oosterhout wrote: > On Mon, Jan 22, 2007 at 09:44:52AM -0500, Ron Peterson wrote: > > I've created my own type: y_octet_16. Now I'm trying to create a CAST > > function for this type, but I'm not quite getting it. > > Quick question: do you me

Re: [GENERAL] CAST function for user defined type

2007-01-22 Thread Tom Lane
Ron Peterson <[EMAIL PROTECTED]> writes: > I've created my own type: y_octet_16. Now I'm trying to create a CAST ^^ > % INSERT INTO bt( name, val ) VALUES > ( 'aaa', encode( y_uuid_generate(), 'hex' )::y_byte_16 ); > ERROR: type "y_byte_16" does not exist

Re: [GENERAL] CAST function for user defined type

2007-01-22 Thread Martijn van Oosterhout
On Mon, Jan 22, 2007 at 09:44:52AM -0500, Ron Peterson wrote: > I've created my own type: y_octet_16. Now I'm trying to create a CAST > function for this type, but I'm not quite getting it. Quick question: do you mean: > val > y_octet_16 ^^ > VALUES > ( 'aaa', encode( y_uui

[GENERAL] CAST function for user defined type

2007-01-22 Thread Ron Peterson
I've created my own type: y_octet_16. Now I'm trying to create a CAST function for this type, but I'm not quite getting it. The input function for my type takes a 32 char hex string as input. CREATE TABLE bt ( name TEXT NOT NULL, val y_octet_16 NOT NULL ); CREATE INDEX bt_