Can I create a TYPE (or DOMAIN) with arguments?

Поиск
Список
Период
Сортировка
От R.A.
Тема Can I create a TYPE (or DOMAIN) with arguments?
Дата
Msg-id 1199872380.4784997c65ec5@mail.bluebottle.com
обсуждение исходный текст
Ответы Re: Can I create a TYPE (or DOMAIN) with arguments?  (Erik Jones <erik@myemma.com>)
Re: Can I create a TYPE (or DOMAIN) with arguments?  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
Hello,

I'm trying to create a composite type with an argument, to create one field of this type like character varying(x), but
Idon't know if this can be done with PostgreSQL. I want something like: 
CREATE TYPE mytype AS (
    tx       character varying(x),
    t2nd       integer
);
I need to limit the number of chars in this field tx. And different lengths will be used when creating tables with this
type(so a Domain will suffer the same problem). I'm not looking for a solution like a separate column with maxChars and
aCheck, because lots of columns will be required (and others design reasons). 

Any suggestions?

Thanks.

----------------------------------------------------------------------
Free pop3 email with a spam filter.
http://www.bluebottle.com/tag/5


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

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Query to get column-names in table via PG tables?
Следующее
От: "Ewing, Chris"
Дата:
Сообщение: Importing PostgreSQL data from another database