CREATE TYPE

I want to create a data type that have tow arguments in the defenition,
like the varchar type:
create table mytmp(name varchar(10));

I like to do it like this:
create table mytmp(name myvarchar(10,"en_US"));

whow can it be done by "CREATE TYPE"
I want to implement the internal functions (compare, ...).
I faunded the documentation but I can't see any thing that help me to
create a type same as varchar( with argument)

Notice: I don't mean using "CREATE TYPE myvarchar AS( lenght integer,
collate char(10))

Thanks

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
eetemadi [ Mi, 03 November 2004 16:56 ] [ ID #463582 ]

Re: CREATE TYPE

On Nov 3, 2004, at 10:56 AM, Ameen - Etemady wrote:
>
> I like to do it like this:
> create table mytmp(name myvarchar(10,"en_US"));
>
you can't unless you modify the parser.
It has special cases to support varchar (and numeric) syntax.

--
Jeff Trout <jeff [at] jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
threshar [ Mi, 03 November 2004 17:23 ] [ ID #463583 ]

Re: CREATE TYPE

Hello

i note something related to this discussion

> create table mytmp(name myvarchar(10,"en_US"));

i meant that "en_US" is a locale name, then it means natural language and
also character encoding -- those both things are not a matter of SQL-TYPE at
all. It is wrong to represent application specific data in SQL-TYPE itself.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Sad [ Do, 04 November 2004 07:30 ] [ ID #465064 ]
Datenbanken » comp.databases.postgresql.sql » CREATE TYPE

Vorheriges Thema: CREATE TRIGGER ... FOR EACH STATEMENT
Nächstes Thema: Re: vacuum analyze slows sql query