Monday, 15 July 2013

sql - Converting an Integer to Enum in PostgreSQL -


I have created a custom data type enum such as:

  type "bnfunctionstype" In the form ('normal', 'library', 'import', 'thumb', 'adjuster_stone');  

From the external data source I get the integer in the range [0,4]. I want to convert these integers into their respective value values.

How can I do this?

I am using PostgreSQL 8.4. Select

  (ENUM_RANGE NULL :: bnfunctionstype) [S] Generation_series (1, 5) to  

No comments:

Post a Comment