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

Re: How to convert a binary filed to an integer field?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: wei725(at)lycos(dot)com
Cc: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to convert a binary filed to an integer field?
Date: 2010-08-26 11:37:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Thu, Aug 26, 2010 at 12:28 AM,  <wei725(at)lycos(dot)com> wrote:
> You are right. I typed the message in hurry before I left home this morning. It is the boolean type. Thanks for your suggestion. The NULL value may not work for jdbc. On the application level, a fixed set of constants is used to represent the three status, which are converted into an integer.

TBH, you are probably best off taking those constants and writing them
directly into the database (unless they happen to be dictionary
pages), and applying a check constraint or using referential integrity
to match against the known list.


In response to


pgsql-general by date

Next:From: Vick KheraDate: 2010-08-26 11:51:23
Subject: Re: Feature proposal
Previous:From: Sam MasonDate: 2010-08-26 10:27:34
Subject: Re: Feature proposal

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