mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
fedc97cdfd
Up to now, get_const_expr() insisted on prefixing BIT and VARBIT
literals with 'B'. That's not really necessary, because we always
append explicit-cast syntax to identify the constant's type.
Moreover, it's subtly wrong for VARBIT, because the parser will
interpret B'...' as '...'::"bit"; see make_const() which explicitly
assigns type BITOID for a T_BitString literal. So what had been
a simple VARBIT literal is reconstructed as ('...'::"bit")::varbit,
which is not the same thing, at least not before constant folding.
This results in odd differences after dump/restore, as complained
of by the patch submitter, and it could result in actual failures in
partitioning or inheritance DDL operations (see commit
|
||
---|---|---|
.. | ||
bit.out | ||
bytea.out | ||
cash.out | ||
char_1.out | ||
char.out | ||
cidr.out | ||
date.out | ||
enum.out | ||
float4.out | ||
float8.out | ||
inet.out | ||
init.out | ||
int2.out | ||
int4.out | ||
int8.out | ||
interval.out | ||
macaddr8.out | ||
macaddr.out | ||
not_equal.out | ||
numeric.out | ||
oid.out | ||
text_1.out | ||
text.out | ||
time.out | ||
timestamp.out | ||
timestamptz.out | ||
timetz.out | ||
uuid.out | ||
varbit.out | ||
varchar_1.out | ||
varchar.out |