self defined data type "with limit"?

Поиск
Список
Период
Сортировка
От Michael Enke
Тема self defined data type "with limit"?
Дата
Msg-id 4682534B.3060202@wincor-nixdorf.com
обсуждение исходный текст
Ответы Re: self defined data type "with limit"?  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Hello everyone,
I have created a new data type "mychar". How can I specify a limit for it?

This (unlimited version) works fine:
create table table_a(col_a mychar);

This gives an error:
create table table_a(col_a mychar(10));
ERROR:  syntax error at or near "(" bei Zeichen 34
ZEILE 1: create table table_a(col_a mychar(10));

Background: I need a varchar(10) but with quasi numeric sort order
so that "2" appears before "10".
Therefore I thought I create a new type and a new operator class.
Any better way to perform this?

Regards,
Michael


-- 
WINCOR NIXDORF International GmbH
Retail Store Solutions
Wernerwerkdamm 16
13629 Berlin, Germany
Phone +49 (0) 30 5017-1386
Fax +49 (0) 30 5017-1305
E-Mail Michael.Enke@wincor-nixdorf.com

WINCOR NIXDORF International GmbH
Sitz der Gesellschaft: 33106 Paderborn, Heinz-Nixdorf-Ring 1
Registergericht Paderborn HRB 3507
Geschäftsführer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Jürgen Wilde, Dr. Jürgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0031
Ust-ID Nr.: DE812927716
WEEE-Reg.-Nr. DE44477193

Diese E-Mail enthält vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential information. If you are not the intended recipient or
have received this e-mail in error, please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: Frustrating issue with PGXS
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Frustrating issue with PGXS