Re: PK/FK impacts using text data type

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: PK/FK impacts using text data type
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B34E5C673@ntex2010a.host.magwien.gv.at
обсуждение исходный текст
Ответ на PK/FK impacts using text data type  ("Ferrell, Denise CTR NSWCDD, Z11" <denise.ferrell.ctr@navy.mil>)
Ответы Re: PK/FK impacts using text data type  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PK/FK impacts using text data type  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-admin
Denise Ferrell wrote:
> We have been discussing whether or not to change all of our varchar (character varying)
> data types to text for ease of use in procedures/functions/triggers...
>
> Are there any impacts on keys by using text data type vs. character varying or character varying(n)?

The only useful thing about varchar is that it imposes a length constraint on a database field.

Values used for indexing have a length limit, so if you change an indexed column to text
somebody could try to insert values that will cause errors because the limit has been exceeded.

Also you application code cannot rely on a certain size limit any more.

If you are ok with that, go ahead and use text.

Yours,
Laurenz Albe

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

Предыдущее
От: John Scalia
Дата:
Сообщение: Re: pg_upgrade from V9.3.3 to V9.4.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PK/FK impacts using text data type