From: Gnanavel Shanmugam <s.gnanavel@inbox.com>
To: Kenneth Gonsalves <lawgon@thenilgiris.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: rejecting characters in a field
Date: Wed, 8 Jun 2005 23:15:56 -0800
Message-ID: <A9728DAE1B0.000008DFs.gnanavel@inbox.com> (raw)
In-Reply-To: <200506091236.31790.lawgon@thenilgiris.com>
add check constraint with following pattern
check(name !~ '[*/^#]')
with regards,
S.Gnanavel
> -----Original Message-----
> From: lawgon@thenilgiris.com
> Sent: Thu, 9 Jun 2005 12:36:31 +0530
> To: pgsql-sql@postgresql.org
> Subject: [SQL] rejecting characters in a field
>
> hi
> i have a table with a varchar field called 'name'. I want postgres to
> reject any insert with characters defined as illegal characters, for
> example '*/^#'. How do i do this?
> --
> regards
> kg
>
> http://www.livejournal.com/users/lawgon
> tally ho! http://avsap.sourceforge.net
> ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: s.gnanavel@inbox.com, lawgon@thenilgiris.com
Subject: Re: rejecting characters in a field
In-Reply-To: <A9728DAE1B0.000008DFs.gnanavel@inbox.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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