Re: PK/FK impacts using text data type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux