Re: How to create a type ? - Mailing list pgsql-sql

From Tom Lane
Subject Re: How to create a type ?
Date
Msg-id 13870.982166422@sss.pgh.pa.us
Whole thread Raw
In response to How to create a type ?  (Ines Klimann <Ines.Klimann@liafa.jussieu.fr>)
List pgsql-sql
Ines Klimann <Ines.Klimann@liafa.jussieu.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


pgsql-sql by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: createuser problem
Next
From: Josh Berkus
Date:
Subject: Re: how to select * from database1 table,database2 table