Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Trigger to force fields to lowercase at insert/update



Suppose I have a bunch of fields in different tables which I'd like to
always force to lowercase (since they represent case-insensitive data).
Suppose I want to do it at SQL level, not application level.  If the
user say "INSERT INTO foo VALUES ('Abc')", I want to really insert
'abc'.  Is there an elegant way of doing this? Some kind of trigger,
maybe? I have no experience with triggers or pl/sql, but I couldn't
come up with a solution general enough to be reused in multiple places.
Or is the premise a bad idea?


-- 
Leonardo Boiko
http://namakajiri.net

Attachment: signature.asc
Description: Digital signature



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group