From: | Chander Ganesan <chander(at)otg-nc(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | Brandon Aiken <BAiken(at)winemantech(dot)com> |
Subject: | Re: Character fields and length |
Date: | 2006-09-21 18:35:36 |
Message-ID: | 4512DB78.8090907@otg-nc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Brandon Aiken wrote:
>
> I know that in PostgreSQL, there is no performance difference between
> character and character varying.
>
>
>
> Is there any penalty in either performance or disk space for not
> specifying a length on char and varchar fields? Is it really just
> there only as a basic check constraint for the logical model?
>
If you omit the length on a char field it will be char(1) .
Varchar without a length is basically a text type - it will accept
strings of up to 1gb in size.
varchar, text, and char fields have no performance differences (aside
from the space padding stored in a char field - which takes up extra space).
Keep in mind that by limiting the size you can also prevent things like
TOAST from being used (alternately, you could set the storage type on
the column to prevent TOAST).
Chander Ganesan
Open Technology Group, Inc. - Expert PostgreSQL Training
One Copley Parkway, Suite 210
Morrisville, NC 27560
Phone: 877-258-8987/919-463-0999
http://www.otg-nc.com
>
>
> --
>
> Brandon Aiken
>
> CS/IT Systems Engineer
>
>
>
> _Confidentiality Notice_
>
> This email, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
> to which it is addressed. If the reader of this email is not the
> intended recipient or his/her authorized agent, the reader is hereby
> notified that any dissemination, distribution or copying of this email
> is prohibited. If you have received this email in error, please
> notify the sender by replying to this message and deleting this email
> immediately.
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Chander Ganesan | 2006-09-21 18:43:32 | Re: Replication and PITR |
Previous Message | Brandon Aiken | 2006-09-21 17:52:29 | Character fields and length |