Re: npgsql and postgres enum type - Mailing list pgsql-general

From William Temperley
Subject Re: npgsql and postgres enum type
Date
Msg-id 439dc11e0910151152p63a31635u3c8bd221791dddbc@mail.gmail.com
Whole thread Raw
In response to Re: npgsql and postgres enum type  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: npgsql and postgres enum type
List pgsql-general
2009/10/15 Merlin Moncure <mmoncure@gmail.com>:
> On Thu, Oct 15, 2009 at 12:31 PM, danclemson <danclemson@gmail.com> wrote:
>>
>> Hi,
>>
>> As postgres now has enum type, does npgsql driver support the enum type?
>>
>> I use c# and npgsql as databse driver.  One of the database stored procedure
>> takes enum as its parameter.
>>
>> What will be the DbType for postgres enum type?
>
> that's really a npgsql question, but as long as you have access to the
> sql being used, you should be able to work around it by altering the
> sql like this:
>
> select some_function('abc'::the_enum);
>
> merlin
>

I recently stopped using enums after reading this:
http://www.commandprompt.com/blogs/joshua_drake/2009/01/fk_check_enum_or_domain_that_is_the_question/
Using a foreign key to a single column table is pretty much as fast as
an enum, is supported by most (all?) third party libraries, and avoids
all the problems associated with enums.
I guess the downside is the foreign key will take up more disk space,
but that isn't an issue for me.

Cheers, Will Temperley.

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: npgsql and postgres enum type
Next
From: Merlin Moncure
Date:
Subject: Re: npgsql and postgres enum type