Re: Regarding BITs vs. INTs

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: Regarding BITs vs. INTs
Дата
Msg-id 403FF278.5090108@potentialtech.com
обсуждение исходный текст
Ответ на Re: Regarding BITs vs. INTs  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
Stephan Szabo wrote:
> On Fri, 27 Feb 2004, Bill Moran wrote:
>
>>Stephan Szabo wrote:
>>
>>>On Fri, 27 Feb 2004, Bill Moran wrote:
>>>
>>>>I hadn't really looked at this until I started having problems with it.
>>>>
>>>>For those who haven't been following along, I'm converting an application
>>>>originally written in MSSQL to Postgres.
>>>>
>>>>I'm a little startled by how BIT fields are handled differently.  Apparently,
>>>>MSSQL converts freely between BIT and INT.  Those who know, already know that
>>>>Postgres doesn't do this.
>>>
>>>No, but IIRC, it does allow casts between them, it just requires that you
>>>explicitly mark that you want to cast the value.  If you really want to,
>>>you could consider changing those casts into implicit casts and see if
>>>that does what you want.
>>
>>True, and originally that's what I was doing to fix it.  For example:
>
> No, I meant change the rows in pg_cast for the casts to mark the cast as
> implicit rather than explicit (castcontext='i' rather than
> castcontext='e').  Then the cast should happen automatically when
> appropriate rather than requiring an explicit cast.

OH!  This is really neat, I didn't know this could be done!

I'll look into this, but it sure looks like this is going to be REALLY
helpful.  If this works out, Stephan, you'll go on my list of people who,
"If you're ever in the Pittsburgh area, the beer's on me!"

--
Bill Moran
Potential Technologies
http://www.potentialtech.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Regarding BITs vs. INTs
Следующее
От: Mike Nolan
Дата:
Сообщение: Re: Restoring a table with a different name