Pat M. wrote:
On 8/5/06, Francis C. [email protected] wrote:
So why not stick to the standard in this case?
That’s precisely why you should use a boolean. The standard defines
it, Postgres implements it.
I may be wrong about this but BOOLEAN is optional in ANSI SQL, and only
Postgres implements it in a compliant way. This is a really tiny point
in the context of what the OP was asking, but I am curious whether you
think one should code to standards because they are standard, or because
they are widely-adopted? Oracle is far more interested in adding
up-stack features to their product line, and they probably won’t be
adding BOOLEAN any time soon.
It often happens that you have to migrate databases, and I’ve found that
migrating away from Postgres is generally painful, because it’s full of
great features that aren’t widely available (Postgres to Oracle is
especially painful, and especially common). The lack of BOOLEAN is easy
to work around, but other often-used Postgres features are not.
I love Postgres and I use it whenever possible. But if you’re going to
use Postgres features, you need to know what’s not available elsewhere,
isolate the dependencies in your code, and document them carefully (and
grep-ably). And of course you can use AR to wrap most of this up, but
only if performance doesn’t matter in your application.