Re: Cast INTEGER to BIT confusion

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: Cast INTEGER to BIT confusion
Дата
Msg-id CAKAnmmK4hp3t9XKjWBWm05SS-mTqnTp1gWiXo1PTrTOP1nd+hg@mail.gmail.com
обсуждение исходный текст
Ответ на Cast INTEGER to BIT confusion  ("[Quipsy] Markus Karg" <karg@quipsy.de>)
Список pgsql-general
On Tue, Aug 15, 2023 at 4:49 AM [Quipsy] Markus Karg <karg@quipsy.de> wrote:


CREATE TABLE T (c BIT);

INSERT INTO T VALUES (1);

-- I MUST NOT change both lines in any way as these are part of a third-party application!


That is quite the requirement! I hope that the rest of the application is more flexible, or you might be fighting an uphill battle for a long time.

However, if the application will drive forward even after an error, you could pre-create the table "T" the way you want (esp. "c INT"), let the application's "CREATE TABLE" call fail, and then the subsequent insert(s) will succeed. Other than that, there is not much that can be easily done, as the error that is thrown happens pretty early in the process.

Cheers,
Greg 

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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Converting sql anywhere to postgres
Следующее
От: Ron
Дата:
Сообщение: Re: PostgreSQL and local HDD