Re: mssql migration and boolean to integer problems

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: mssql migration and boolean to integer problems
Дата
Msg-id 87y7bx2mli.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: mssql migration and boolean to integer problems  (robert <robertlazarski@gmail.com>)
Ответы Re: mssql migration and boolean to integer problems  ("robert lazarski" <robertlazarski@gmail.com>)
Список pgsql-general
"robert" <robertlazarski@gmail.com> writes:

> So it has two 'bool' - "includeScenario"  and "deleted" . I have an
> insert like...
>
> INSERT INTO "ASSETSCENARIO"
>
("assetScenarioID",OBJ_VERSION,"includeScenario","scenarioName","probability","occurenceDate","notes","priceTarget","assetID","created","modified","createdUserID","modifiedUserID","deleted")
> VALUES
> (197,0,1,'2007-12-13 11:31:00.000','2007-12-13 11:31:00.000',2,2,NULL);

There's an SQL standard syntax too, but the Postgres-specific syntax is:

postgres=# select 1::bool;
 bool
------
 t
(1 row)

postgres=# select 0::bool;
 bool
------
 f
(1 row)


Alternatively you could just quote the inputs. If you insert '0' and '1'
they'll be parsed as boolean values. It's just because you used 0 and 1
without quotes that they're parsed as integers first then don't match the
boolean type.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's PostGIS support!

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: postgres writer process growing up too much
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: size cost for null fields