Re: src/backend/parser/parse_expr.c:exprTypmod() question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: src/backend/parser/parse_expr.c:exprTypmod() question
Date
Msg-id 26252.1159890502@sss.pgh.pa.us
Whole thread Raw
In response to Re: src/backend/parser/parse_expr.c:exprTypmod() question  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> Teodor Sigaev <teodor@sigaev.ru> writes:
>> I'm working on user-defined typmod and try to move all typmod calculations into
>> type-specific functions. But there is a strange place:

> Note that unlike most of the built-in types bpchar doesn't actually make much
> sense without a typmod.

You may be reading too much into it.  Looking at the patch that
introduced exprTypmod(), I think I may have just been interested
in avoiding an unnecessary length-coercion function call when assigning
a constant that was already of the correct length to a CHAR(N) column.
I concur with Teodor that embedding this type-specific knowledge into
exprTypmod probably isn't all that great an idea.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: timestamptz alias
Next
From: Tom Lane
Date:
Subject: Re: src/tools/msvc usage instructions