pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Muhyiddin A.M Hayat <middink@indo.net.id>
Cc: pgsql-sql@postgresql.org
Subject: Re: Column Types
Date: Sun, 14 Sep 2003 08:53:38 +0100
Message-ID: <1063526018.18284.21.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <008d01c37a8c$a17d0100$1f00a8c0@middinkcomp>
References: <008d01c37a8c$a17d0100$1f00a8c0@middinkcomp>

On Sun, 2003-09-14 at 07:49, Muhyiddin A.M Hayat wrote:
> If in MySQL i'm using type EMUN what type in Postgres?

Use a CHECK constraint:

CREATE TABLE xxx (
   ...
   colour    TEXT   CHECK (colour IN ('red', 'green', 'blue')),
   ...
);

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "But without faith it is impossible to please him; for 
      he that cometh to God must believe that he is, and 
      that he is a rewarder of them that diligently seek 
      him."        Hebrews 11:6 




view thread (2+ messages)

Message-ID: <1063526018.18284.21.camel@linda.lfix.co.uk>
Permalink:  ../1063526018.18284.21.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1063526018.18284.21.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: olly@lfix.co.uk, middink@indo.net.id
  Subject: Re: Column Types
  In-Reply-To: <1063526018.18284.21.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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