Re: Handling case variatiions on a user defined type? - Mailing list pgsql-general

From Olivier Gautherot
Subject Re: Handling case variatiions on a user defined type?
Date
Msg-id CAJ7S9TUCF332G2frcmCay-ayFPX-sOo8hz6-Cqkx16sZiG0P9g@mail.gmail.com
Whole thread Raw
In response to Handling case variatiions on a user defined type?  (stan <stanb@panix.com>)
Responses Re: Handling case variatiions on a user defined type?
List pgsql-general


El dom., 15 de septiembre de 2019 09:37, stan <stanb@panix.com> escribió:
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

What about a trigger on INSERT, which would enforce the case?

pgsql-general by date:

Previous
From: stan
Date:
Subject: Handling case variatiions on a user defined type?
Next
From: stan
Date:
Subject: Re: Handling case variatiions on a user defined type?