How Postgres stores enum values is an implementation detail that should be ignored. You always use them using string syntax, that is proper. The SQL syntax for comparisons is the same =, <, > etc for all types, there is no distinct "string comparison". See http://www.postgresql.org/docs/9.4/static/datatype-enum.html . Do what Simon says. I don't see a problem here. -- Darren Duncan
On 2015-11-24 3:24 PM, Domingo Alvarez Duarte wrote: > If we do that we'll be repeating the same string on every column and need a > string comparison, with postgres enum types or foreign keys it's an integer > and no repetition. > > Cheers ! >> Tue Nov 24 2015 11:01:35 pm CET CET from "Simon Slavin" >> <slavins at bigfraud.org> Subject: Re: [sqlite] Dont Repeat Yourself (DRY) >> and >> SQLite >> >> On 24 Nov 2015, at 7:09pm, Domingo Alvarez Duarte >> <sqlite-mail at dev.dadbiz.es> wrote: >> >> >>> one_type INTEGER NOT NULL REFERENCES mytype(id) NOT NULL, --how to use >>> a default here ? >>> > >> Include "DEFAULT 'tuple'" just like you would in PostgreSQL. >> >> Otherwise I'm with Igor. I don't see why you're using TRIGGERs and I don't >> see what problem you're having. Can you point out a specific section of your >> PostgreSQL code you can't translate into SQLite ?

