How to restrict

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: How to restrict
Date: 2019-02-26 15:11:32
Message-ID: 6C004315-7728-4909-BCCD-2DE8F5DA3920@illinois.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PostgreSQL 10.x

What is the best way to restrict the values on a text field to make sure they only contain particular values: Example: The field “type” can only contain the values of “X”, “Y” and “Z”. Would a trigger be the best strategy? Or is there a special SQL type I should use in this particular case?

Thanks,

LANCE CAMPBELL<https://directory.illinois.edu/person/lance>
Software Architect

Web Services<https://webtools.illinois.edu/>
Public Affairs<https://publicaffairs.illinois.edu/>
Contact the Webtools Team<https://go.illinois.edu/contactUs>
217.333.0382
lance(at)illinois(dot)edu<mailto:lance(at)illinois(dot)edu>

[/var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/signature_logo.png]<http://illinois.edu/>

Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Achilleas Mantzios 2019-02-26 15:18:21 Re: How to restrict
Previous Message Tomáš Uko 2019-02-26 15:01:53 RE: streaming vs wal shipping issue