create type- similar char

Поиск
Список
Период
Сортировка
От Mohsen SM
Тема create type- similar char
Дата
Msg-id CAGT6x6eaw0bPKOxN87zGjXQrjmrANbq+FEbJub1jrDVp4T_7eA@mail.gmail.com
обсуждение исходный текст
Ответы Re: create type- similar char  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: create type- similar char  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I create one new type with CREATE TYPE command.
for my type its INTERNALLENGTH is VARIABLE .
but I want to my type behavior  similar to char and when I type this query:
CREATE TABLE tbl (col1 NEWTYPE);
then when I write this query, so it get an error for it's length:
insert into tbl values('dd');
its error is :
ERROR:  value too long for type character(1)
but my NEWTYPE don't get this error and work similar to varchar.
how I can do it?
I check for char type the bpchar() function. when I work with char type and want to insert one word longest one character so, bpchar() called.
but for my NEWTYPE don't call the newtype() function.
how can I correct this problem?

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: requested shared memory size overflows size_t
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: create type- similar char