Handling case variatiions on a user defined type?

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Handling case variatiions on a user defined type?
Date: 2019-09-15 12:37:31
Message-ID: 20190915123731.GA26465@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have several enumerated types that look like:

CREATE TYPE confidence_level AS ENUM ('HIGH' ,
'MEDIUM' ,
'LOW' ,
'WAG');

I have someone creating data for this project in spreadsheets, and then am
importing the data using \copy.

Problem is the data in the spreadsheets is entered in mixed case.

Is there a way that I can use the type itself, to enforce something like a
to_upper(). Or is there a better way to "human proof" this?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Olivier Gautherot 2019-09-15 12:58:45 Re: Handling case variatiions on a user defined type?
Previous Message Adrian Klaver 2019-09-14 19:51:29 Re: Can I wrtie a function that has a BEFORE trigger that is not column name dpendent?