From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Ines(dot)Klimann(at)liafa(dot)jussieu(dot)fr |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: How to create a type ? |
Date: | 2001-02-14 16:00:22 |
Message-ID: | 13870.982166422@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Ines Klimann <Ines(dot)Klimann(at)liafa(dot)jussieu(dot)fr> writes:
> I have tried this :
> ----------------------------------
> create function personne_in(text)
> returns personne
> as 'select $1;'
> language 'sql';
> create function personne_out(text)
> returns text
> as 'select $1;'
> language 'sql';
> create type personne (
> internallength = variable,
> input = personne_in,
> output = personne_out
> );
> ---------------------------------
> but it is full of mistakes.
Can't do it that way, because SQL functions can't produce or consume
the plain C strings that input/output conversion functions have to
deal with. There's really no way to write an input or output function
except in C.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2001-02-14 16:33:21 | Re: how to select * from database1 table,database2 table |
Previous Message | Oliver Elphick | 2001-02-14 15:19:47 | Re: createuser problem |