postgresql/src/backend/commands
Tom Lane d01f03a495 Preserve integer and float values accurately in (de)serialize_deflist.
Previously, this code just smashed all types of DefElem values to
strings, cavalierly reasoning that nobody would care.  But in point of
fact, most of the defGetFoo functions do distinguish among different
input syntaxes; for instance defGetBoolean will accept 1 as an integer
but not "1" as a string.  This led to CREATE/ALTER TEXT SEARCH
DICTIONARY accepting 0 and 1 as values for boolean dictionary
properties, only to have the dictionary fail at runtime.

We can upgrade this behavior by teaching serialize_deflist that it
does not need to quote T_Integer or T_Float nodes' values on output,
and then teaching deserialize_deflist to restore unquoted integer or
float values as the appropriate node type.  This should not break
anything using pg_ts_dict.dictinitoption, since that field is just
defined as being something valid to include in CREATE TEXT SEARCH
DICTIONARY.

deserialize_deflist is also used to parse the options arguments
for the ts_headline family of functions, but so far as I can see
this won't cause any problems there either: the only consumer of
that output is prsd_headline which always uses defGetString.
(Really that's a bad idea, but I won't risk changing it here.)

This is surely a bug fix, but given the lack of field complaints
I don't think it's necessary to back-patch.

Discussion: https://postgr.es/m/CAMkU=1xRcs_BUPzR0+V3WndaCAv0E_m3h6aUEJ8NF-sY1nnHsw@mail.gmail.com
2020-03-10 12:30:02 -04:00
..
aggregatecmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
alter.c Fix priv checks for ALTER <object> DEPENDS ON EXTENSION 2020-02-10 11:47:09 -03:00
amcmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
analyze.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
async.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
cluster.c Update obsolete comment. 2020-02-15 15:22:40 -05:00
collationcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
comment.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
constraint.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
conversioncmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
copy.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
createas.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
dbcommands.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
define.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
discard.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dropcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
event_trigger.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
explain.c Fix handling of "Subplans Removed" field in EXPLAIN output. 2020-02-04 13:07:13 -05:00
extension.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
foreigncmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
functioncmds.c Split out CreateCast into src/backend/catalog/pg_cast.c 2020-03-10 11:28:23 -03:00
indexcmds.c Prevent reindex of invalid indexes on TOAST tables 2020-03-10 15:38:17 +09:00
lockcmds.c Make inherited LOCK TABLE perform access permission checks on parent table only. 2020-02-18 13:13:15 +09:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
matview.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
opclasscmds.c Add equalimage B-Tree support functions. 2020-02-26 11:28:25 -08:00
operatorcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
policy.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
portalcmds.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
prepare.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
proclang.c Remove the "opaque" pseudo-type and associated compatibility hacks. 2020-03-05 15:48:56 -05:00
publicationcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
schemacmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
seclabel.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sequence.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statscmds.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
subscriptioncmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
tablecmds.c Code simplification 2020-03-09 09:34:55 +01:00
tablespace.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
trigger.c Add tg_updatedcols to TriggerData 2020-03-09 09:34:55 +01:00
tsearchcmds.c Preserve integer and float values accurately in (de)serialize_deflist. 2020-03-10 12:30:02 -04:00
typecmds.c Split out CreateCast into src/backend/catalog/pg_cast.c 2020-03-10 11:28:23 -03:00
user.c Remove long-dead comments. 2020-02-12 14:33:49 -05:00
vacuum.c Allow vacuum command to process indexes in parallel. 2020-01-20 07:57:49 +05:30
variable.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
view.c Restructure ALTER TABLE execution to fix assorted bugs. 2020-01-15 18:49:24 -05:00