Re: Cast INTEGER to BIT confusion - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: Cast INTEGER to BIT confusion
Date
Msg-id CAKAnmmK4hp3t9XKjWBWm05SS-mTqnTp1gWiXo1PTrTOP1nd+hg@mail.gmail.com
Whole thread Raw
In response to Cast INTEGER to BIT confusion  ("[Quipsy] Markus Karg" <karg@quipsy.de>)
List 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 by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: Converting sql anywhere to postgres
Next
From: Ron
Date:
Subject: Re: PostgreSQL and local HDD