Re: [HACKERS] DEFAULT fixed - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] DEFAULT fixed
Date
Msg-id 7378.927384351@sss.pgh.pa.us
Whole thread Raw
In response to DEFAULT fixed  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] DEFAULT fixed
Re: [HACKERS] DEFAULT fixed
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Does anyone have an opinion on this?  Why does only DEFAULT have this
> problem?  Does anyone know how inserts of '' into char() fields get
> padded with the proper atttypmod value?  Do I need to pass atttypmod to
> all the functions that call parse_coerce, so I can pass a value for all
> cases?

Possibly DEFAULT is the only case where the constant value created by
the parser will get shoved directly into a tuple with no run-time
coercion?  That's strictly a guess.  I agree this issue needs to be
looked at more closely.

Now that we know the problem comes from missing atttypmod info, it
seems likely that related failures can occur for NUMERIC and other
types that depend on atttypmod.  (Are there any such types?  Even
if there aren't now, there will probably be more and more in future.)
It might be best to just bite the bullet and make the parser carry
around both the type's OID and typmod at all times.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] strange behavior of UPDATE
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] GEQO optimizer (was Re: Backend message type 0x44 arrived while idle)