pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedrejecting characters in a field
6+ messages / 5 participants
[nested] [flat]
* rejecting characters in a field
@ 2005-06-09 07:06 Kenneth Gonsalves <lawgon@thenilgiris.com>
0 siblings, 2 replies; 6+ messages in thread
From: Kenneth Gonsalves @ 2005-06-09 07:06 UTC (permalink / raw)
To: pgsql-sql
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
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: rejecting characters in a field
@ 2005-06-09 07:15 Gnanavel Shanmugam <s.gnanavel@inbox.com>
parent: Kenneth Gonsalves <lawgon@thenilgiris.com>
1 sibling, 0 replies; 6+ messages in thread
From: Gnanavel Shanmugam @ 2005-06-09 07:15 UTC (permalink / raw)
To: Kenneth Gonsalves <lawgon@thenilgiris.com>; +Cc: pgsql-sql
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)
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [despammed] rejecting characters in a field
@ 2005-06-09 07:18 Andreas Kretschmer <akretschmer@despammed.com>
parent: Kenneth Gonsalves <lawgon@thenilgiris.com>
1 sibling, 2 replies; 6+ messages in thread
From: Andreas Kretschmer @ 2005-06-09 07:18 UTC (permalink / raw)
To: pgsql-sql
am 09.06.2005, um 12:36:31 +0530 mailte Kenneth Gonsalves folgendes:
> 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?
With a RULE or a TRIGGER.
Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [despammed] rejecting characters in a field
@ 2005-06-09 07:23 Michael Glaesemann <grzm@myrealbox.com>
parent: Andreas Kretschmer <akretschmer@despammed.com>
1 sibling, 0 replies; 6+ messages in thread
From: Michael Glaesemann @ 2005-06-09 07:23 UTC (permalink / raw)
To: Andreas Kretschmer <akretschmer@despammed.com>; +Cc: pgsql-sql
On Jun 9, 2005, at 4:18 PM, Andreas Kretschmer wrote:
> am 09.06.2005, um 12:36:31 +0530 mailte Kenneth Gonsalves folgendes:
>
>> 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?
>>
>
> With a RULE or a TRIGGER.
Or a CHECK constraint on the column.
Michael Glaesemann
grzm myrealbox com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [despammed] rejecting characters in a field
@ 2005-06-09 08:29 Bruno Wolff III <bruno@wolff.to>
parent: Andreas Kretschmer <akretschmer@despammed.com>
1 sibling, 1 reply; 6+ messages in thread
From: Bruno Wolff III @ 2005-06-09 08:29 UTC (permalink / raw)
To: Andreas Kretschmer <akretschmer@despammed.com>; pgsql-sql
On Thu, Jun 09, 2005 at 09:18:09 +0200,
Andreas Kretschmer <akretschmer@despammed.com> wrote:
> am 09.06.2005, um 12:36:31 +0530 mailte Kenneth Gonsalves folgendes:
> > 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?
>
> With a RULE or a TRIGGER.
Using a check constraint would be better a better way to do this.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [despammed] rejecting characters in a field
@ 2005-06-09 08:39 Andreas Kretschmer <akretschmer@despammed.com>
parent: Bruno Wolff III <bruno@wolff.to>
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Kretschmer @ 2005-06-09 08:39 UTC (permalink / raw)
To: pgsql-sql; +Cc: Bruno Wolff III <bruno@wolff.to>; Andreas Kretschmer <akretschmer@despammed.com>
am 09.06.2005, um 3:29:15 -0500 mailte Bruno Wolff III folgendes:
> On Thu, Jun 09, 2005 at 09:18:09 +0200,
> Andreas Kretschmer <akretschmer@despammed.com> wrote:
> > am 09.06.2005, um 12:36:31 +0530 mailte Kenneth Gonsalves folgendes:
> > > 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?
> >
> > With a RULE or a TRIGGER.
>
> Using a check constraint would be better a better way to do this.
Yes, okay.
Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2005-06-09 08:39 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-09 07:06 rejecting characters in a field Kenneth Gonsalves <lawgon@thenilgiris.com>
2005-06-09 07:15 ` Gnanavel Shanmugam <s.gnanavel@inbox.com>
2005-06-09 07:18 ` Andreas Kretschmer <akretschmer@despammed.com>
2005-06-09 07:23 ` Michael Glaesemann <grzm@myrealbox.com>
2005-06-09 08:29 ` Bruno Wolff III <bruno@wolff.to>
2005-06-09 08:39 ` Andreas Kretschmer <akretschmer@despammed.com>
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