pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedTripping over (my own) stupidity - VARCHAR declaration minus specificity
5+ messages / 3 participants
[nested] [flat]
* Tripping over (my own) stupidity - VARCHAR declaration minus specificity
@ 2011-10-14 17:27 Good, Thomas <TGood@svwsjmc.org>
0 siblings, 1 reply; 5+ messages in thread
From: Good, Thomas @ 2011-10-14 17:27 UTC (permalink / raw)
To: pgsql-sql
I created a table in a hurry and forgot to specify the max capacity for a varchar() data type.
Can it be said what the max would be in a case like this (just curious)?
thanks much
--
Thomas A. Good, Senior Database Administrator
Saint Vincent's Hospital Westchester
A Division of Saint Joseph's Medical Center
Residential Services
1216 Bay Street, Room L-8
Staten Island, NY 10305
718.982.4752
"Wir leben, wir sind Glücksmaschinen." - Peter Hein
This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to who they are addressed. This communication may contain protected health information and/or material protected by the attorney-client privilege. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying for this e-mail is strictly prohibited. if you have received this e-mail in error, please delete the message and attachments and notify the sender immediately.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Tripping over (my own) stupidity - VARCHAR declaration minus specificity
@ 2011-10-14 17:51 Adam Cornett <adam.cornett@gmail.com>
parent: Good, Thomas <TGood@svwsjmc.org>
0 siblings, 1 reply; 5+ messages in thread
From: Adam Cornett @ 2011-10-14 17:51 UTC (permalink / raw)
To: Good, Thomas <TGood@svwsjmc.org>; +Cc: pgsql-sql
On Fri, Oct 14, 2011 at 1:27 PM, Good, Thomas <TGood@svwsjmc.org> wrote:
> I created a table in a hurry and forgot to specify the max capacity for a
> varchar() data type.
> Can it be said what the max would be in a case like this (just curious)?
>
> thanks much
>
> --
> Thomas A. Good, Senior Database Administrator
> Saint Vincent's Hospital Westchester
> A Division of Saint Joseph's Medical Center
> Residential Services
> 1216 Bay Street, Room L-8
> Staten Island, NY 10305
> 718.982.4752
>
> "Wir leben, wir sind Glücksmaschinen." - Peter Hein
>
> This e-mail and any files transmitted with it are confidential and are
> intended solely for the use of the individual or entity to who they are
> addressed. This communication may contain protected health information
> and/or material protected by the attorney-client privilege. If you are not
> the intended recipient or the person responsible for delivering the e-mail
> to the intended recipient, be advised that you have received this e-mail in
> error and that any use, dissemination, forwarding, printing, or copying for
> this e-mail is strictly prohibited. if you have received this e-mail in
> error, please delete the message and attachments and notify the sender
> immediately.
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
According to
http://www.postgresql.org/docs/current/static/datatype-character.html,
"If character varying is used without length specifier, the type accepts
strings of any size. The latter is a PostgreSQL extension."
-Adam Cornett
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Tripping over (my own) stupidity - VARCHAR declaration minus specificity
@ 2011-10-14 18:09 ktm@rice.edu <ktm@rice.edu>
parent: Adam Cornett <adam.cornett@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: ktm@rice.edu @ 2011-10-14 18:09 UTC (permalink / raw)
To: Adam Cornett <adam.cornett@gmail.com>; +Cc: Good, Thomas <TGood@svwsjmc.org>; pgsql-sql
On Fri, Oct 14, 2011 at 01:51:04PM -0400, Adam Cornett wrote:
> On Fri, Oct 14, 2011 at 1:27 PM, Good, Thomas <TGood@svwsjmc.org> wrote:
>
> > I created a table in a hurry and forgot to specify the max capacity for a
> > varchar() data type.
> > Can it be said what the max would be in a case like this (just curious)?
> >
> > thanks much
> >
>
> According to
> http://www.postgresql.org/docs/current/static/datatype-character.html,
> "If character varying is used without length specifier, the type accepts
> strings of any size. The latter is a PostgreSQL extension."
>
> -Adam Cornett
And according to the documentation, the maximum size of a varchar is
1GB.
Regards,
Ken
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Tripping over (my own) stupidity - VARCHAR declaration minus specificity
@ 2011-10-14 18:24 Adam Cornett <adam.cornett@gmail.com>
parent: ktm@rice.edu <ktm@rice.edu>
0 siblings, 1 reply; 5+ messages in thread
From: Adam Cornett @ 2011-10-14 18:24 UTC (permalink / raw)
To: ktm@rice.edu <ktm@rice.edu>; +Cc: Good, Thomas <TGood@svwsjmc.org>; pgsql-sql
On Fri, Oct 14, 2011 at 2:09 PM, ktm@rice.edu <ktm@rice.edu> wrote:
> On Fri, Oct 14, 2011 at 01:51:04PM -0400, Adam Cornett wrote:
> > On Fri, Oct 14, 2011 at 1:27 PM, Good, Thomas <TGood@svwsjmc.org> wrote:
> >
> > > I created a table in a hurry and forgot to specify the max capacity for
> a
> > > varchar() data type.
> > > Can it be said what the max would be in a case like this (just
> curious)?
> > >
> > > thanks much
> > >
> >
> > According to
> > http://www.postgresql.org/docs/current/static/datatype-character.html,
> > "If character varying is used without length specifier, the type accepts
> > strings of any size. The latter is a PostgreSQL extension."
> >
> > -Adam Cornett
>
> And according to the documentation, the maximum size of a varchar is
> 1GB.
>
> Regards,
> Ken
>
Yes, 1GB is the limit for any column size. From what I can tell a varchar
without a size specified acts just like text.
-Adam
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Tripping over (my own) stupidity - VARCHAR declaration minus specificity
@ 2011-10-14 18:28 Good, Thomas <TGood@svwsjmc.org>
parent: Adam Cornett <adam.cornett@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Good, Thomas @ 2011-10-14 18:28 UTC (permalink / raw)
To: Adam Cornett <adam.cornett@gmail.com>; ktm@rice.edu <ktm@rice.edu>; +Cc: pgsql-sql
Thanks guys - yes Adam it seems to behave exactly like text, at least in my experience.
________________________________________
From: Adam Cornett [adam.cornett@gmail.com]
Sent: Friday, October 14, 2011 2:24 PM
To: ktm@rice.edu
Cc: Good, Thomas; pgsql-sql@postgresql.org
Subject: Re: [SQL] Tripping over (my own) stupidity - VARCHAR declaration minus specificity
On Fri, Oct 14, 2011 at 2:09 PM, ktm@rice.edu<mailto:ktm@rice.edu> <ktm@rice.edu<mailto:ktm@rice.edu>> wrote:
On Fri, Oct 14, 2011 at 01:51:04PM -0400, Adam Cornett wrote:
> On Fri, Oct 14, 2011 at 1:27 PM, Good, Thomas <TGood@svwsjmc.org<mailto:TGood@svwsjmc.org>> wrote:
>
> > I created a table in a hurry and forgot to specify the max capacity for a
> > varchar() data type.
> > Can it be said what the max would be in a case like this (just curious)?
> >
> > thanks much
> >
>
> According to
> http://www.postgresql.org/docs/current/static/datatype-character.html,
> "If character varying is used without length specifier, the type accepts
> strings of any size. The latter is a PostgreSQL extension."
>
> -Adam Cornett
And according to the documentation, the maximum size of a varchar is
1GB.
Regards,
Ken
Yes, 1GB is the limit for any column size. From what I can tell a varchar without a size specified acts just like text.
-Adam
This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to who they are addressed. This communication may contain protected health information and/or material protected by the attorney-client privilege. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying for this e-mail is strictly prohibited. if you have received this e-mail in error, please delete the message and attachments and notify the sender immediately.
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2011-10-14 18:28 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14 17:27 Tripping over (my own) stupidity - VARCHAR declaration minus specificity Good, Thomas <TGood@svwsjmc.org>
2011-10-14 17:51 ` Adam Cornett <adam.cornett@gmail.com>
2011-10-14 18:09 ` ktm@rice.edu <ktm@rice.edu>
2011-10-14 18:24 ` Adam Cornett <adam.cornett@gmail.com>
2011-10-14 18:28 ` Good, Thomas <TGood@svwsjmc.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox