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

replacing mysql enum

From: Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: replacing mysql enum
Date: 2004-12-11 05:00:55
Message-ID: 04121110305520.21547@thenilgiris.com (view raw or flat)
Thread:
Lists: pgsql-sql
hi,

from mysql:

field enum('a','b','c') default null,

i translated this as:

field varchar(2) check (field in (null,'a','b','c')),

is it necessary to put the 'null' in the check condition? if not will pg 
permit you to enter a null value in the field?

regards
kg

Responses

pgsql-sql by date

Next:From: Josh BerkusDate: 2004-12-11 05:11:28
Subject: Re: Cast NULL into Timestamp?
Previous:From: Michael FuhrDate: 2004-12-11 04:11:52
Subject: Re: Create Calendar

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group