On Wed, Nov 25, 2015 at 1:14 PM, Simon Slavin <slavins at bigfraud.org> wrote:
>
> CREATE TABLE use_mytype (...
>    ...
>    one_type TEXT REFERENCES enum_type(theID) DEFAULT 2
> )
>
> It is now harder to know which value to insert for one_type.
>
> Simon.
>

I know this works, but I would suggest using INTEGER instead of text
for one_type. It seems like better design.

Simon S., DRY makes a lot of sense (and is pretty awesome) *in
application code*. You may have been doing it a lot and just didn't
know the name. Data models may be more referential than replicated
(point to where the text is instead of copying it), but I don't think
that this brings huge advantages.

-- 
Bernardo Sulzbach

Reply via email to