pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Add constraint for number of chars
2+ messages / 2 participants
[nested] [flat]

* Add constraint for number of chars
@ 2007-04-26 04:41  PostgreSQL Admin <postgres@productivitymedia.com>
  0 siblings, 1 reply; 2+ messages in thread

From: PostgreSQL Admin @ 2007-04-26 04:41 UTC (permalink / raw)
  To: pgsql-sql

Hi,

This is seemly simple, but I'm @ a loss this early in the morning.  It's
best explained this way

SAMPLE
-----------------------------------
id                  | serial            |
username   | varchar(100)| constraint username >=8 and username <=100

The problem is that it's characters not integers or numeric.  It my
constraint correct?

Thanks for the help,
J



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Add constraint for number of chars
@ 2007-04-26 05:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PostgreSQL Admin <postgres@productivitymedia.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2007-04-26 05:25 UTC (permalink / raw)
  To: PostgreSQL Admin <postgres@productivitymedia.com>; +Cc: pgsql-sql

PostgreSQL Admin <postgres@productivitymedia.com> writes:
> username   | varchar(100)| constraint username >=8 and username <=100

Perhaps you mean "length(username) >= 8" and so on?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-04-26 05:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-26 04:41 Add constraint for number of chars PostgreSQL Admin <postgres@productivitymedia.com>
2007-04-26 05:25 ` Tom Lane <tgl@sss.pgh.pa.us>

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