Re: [pgsql-advocacy] MySQL to PostgreSQL, was ENUM type - Mailing list pgsql-general

From Tom Lane
Subject Re: [pgsql-advocacy] MySQL to PostgreSQL, was ENUM type
Date
Msg-id 18607.1122667068@sss.pgh.pa.us
Whole thread Raw
In response to Re: [pgsql-advocacy] MySQL to PostgreSQL, was ENUM type  ("Jim C. Nasby" <decibel@decibel.org>)
Responses Re: [pgsql-advocacy] MySQL to PostgreSQL, was ENUM type
List pgsql-general
"Jim C. Nasby" <decibel@decibel.org> writes:
> Is there any serious impediment to adding unsigned types to PostgreSQL?

Quick, what's the datatype of 12345?  And why?

My guess is that transparent support for such a thing would require some
tricky and fragile compromises in the numeric hierarchy's promotion
rules.  The handling of smallint is already pretty unsatisfactory
because "12345" is considered int not smallint; adding three or four
unsigned types would make that problem many times worse.

> I don't think these would even have to be in core, if that's a
> concern.

Sure, if you don't need it to work reasonably nicely --- although the
promotion rules are now embedded in pg_cast and hence modifiable, the
initial determination of a datatype for a numeric literal is still
hard-wired in the grammar.

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [pgsql-advocacy] MySQL to PostgreSQL, was ENUM type
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [pgsql-advocacy] MySQL to PostgreSQL, was ENUM type