summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPavan Deolasee2017-06-14 05:42:18 +0000
committerPavan Deolasee2017-06-14 05:42:18 +0000
commit15dd5274c323fb93e4e3ea9ad2185aaaec10f79c (patch)
tree9dafb4c7f735d9429ea461dc792933af87493c33 /src/include
parentdfbb88e3bbb526dcb204b456b9e5cfd9d10d0d0a (diff)
parentd5cb3bab564e0927ffac7c8729eacf181a12dd40 (diff)
Merge from PG master upto d5cb3bab564e0927ffac7c8729eacf181a12dd40
This is the result of the "git merge remotes/PGSQL/master" upto the said commit point. We have done some basic analysis, fixed compilation problems etc, but bulk of the logical problems in conflict resolution etc will be handled by subsequent commits.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Makefile3
-rw-r--r--src/include/access/amapi.h29
-rw-r--r--src/include/access/amvalidate.h2
-rw-r--r--src/include/access/attnum.h2
-rw-r--r--src/include/access/brin.h27
-rw-r--r--src/include/access/brin_internal.h5
-rw-r--r--src/include/access/brin_page.h2
-rw-r--r--src/include/access/brin_pageops.h2
-rw-r--r--src/include/access/brin_revmap.h3
-rw-r--r--src/include/access/brin_tuple.h14
-rw-r--r--src/include/access/brin_xlog.h23
-rw-r--r--src/include/access/bufmask.h32
-rw-r--r--src/include/access/clog.h10
-rw-r--r--src/include/access/commit_ts.h10
-rw-r--r--src/include/access/genam.h17
-rw-r--r--src/include/access/generic_xlog.h3
-rw-r--r--src/include/access/gin.h9
-rw-r--r--src/include/access/gin_private.h527
-rw-r--r--src/include/access/ginblock.h336
-rw-r--r--src/include/access/ginxlog.h217
-rw-r--r--src/include/access/gist.h2
-rw-r--r--src/include/access/gist_private.h82
-rw-r--r--src/include/access/gistscan.h2
-rw-r--r--src/include/access/gistxlog.h69
-rw-r--r--src/include/access/hash.h217
-rw-r--r--src/include/access/hash_xlog.h282
-rw-r--r--src/include/access/heapam.h6
-rw-r--r--src/include/access/heapam_xlog.h3
-rw-r--r--src/include/access/hio.h2
-rw-r--r--src/include/access/htup.h2
-rw-r--r--src/include/access/htup_details.h22
-rw-r--r--src/include/access/itup.h4
-rw-r--r--src/include/access/multixact.h5
-rw-r--r--src/include/access/nbtree.h260
-rw-r--r--src/include/access/nbtxlog.h255
-rw-r--r--src/include/access/parallel.h8
-rw-r--r--src/include/access/printsimple.h23
-rw-r--r--src/include/access/printtup.h2
-rw-r--r--src/include/access/reloptions.h5
-rw-r--r--src/include/access/relscan.h25
-rw-r--r--src/include/access/rewriteheap.h2
-rw-r--r--src/include/access/rmgr.h2
-rw-r--r--src/include/access/rmgrlist.h48
-rw-r--r--src/include/access/sdir.h2
-rw-r--r--src/include/access/skey.h2
-rw-r--r--src/include/access/slru.h7
-rw-r--r--src/include/access/spgist.h25
-rw-r--r--src/include/access/spgist_private.h234
-rw-r--r--src/include/access/spgxlog.h257
-rw-r--r--src/include/access/stratnum.h2
-rw-r--r--src/include/access/subtrans.h4
-rw-r--r--src/include/access/sysattr.h2
-rw-r--r--src/include/access/timeline.h4
-rw-r--r--src/include/access/transam.h9
-rw-r--r--src/include/access/tsmapi.h2
-rw-r--r--src/include/access/tupconvert.h6
-rw-r--r--src/include/access/tupdesc.h9
-rw-r--r--src/include/access/tupmacs.h2
-rw-r--r--src/include/access/tuptoaster.h15
-rw-r--r--src/include/access/twophase.h11
-rw-r--r--src/include/access/twophase_rmgr.h2
-rw-r--r--src/include/access/valid.h2
-rw-r--r--src/include/access/visibilitymap.h4
-rw-r--r--src/include/access/xact.h32
-rw-r--r--src/include/access/xlog.h45
-rw-r--r--src/include/access/xlog_fn.h37
-rw-r--r--src/include/access/xlog_internal.h20
-rw-r--r--src/include/access/xlogdefs.h4
-rw-r--r--src/include/access/xloginsert.h4
-rw-r--r--src/include/access/xlogreader.h25
-rw-r--r--src/include/access/xlogrecord.h16
-rw-r--r--src/include/access/xlogutils.h5
-rw-r--r--src/include/bootstrap/bootstrap.h2
-rw-r--r--src/include/c.h50
-rw-r--r--src/include/catalog/binary_upgrade.h2
-rw-r--r--src/include/catalog/catalog.h2
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/dependency.h31
-rw-r--r--src/include/catalog/genbki.h2
-rw-r--r--src/include/catalog/heap.h13
-rw-r--r--src/include/catalog/index.h2
-rw-r--r--src/include/catalog/indexing.h48
-rw-r--r--src/include/catalog/namespace.h6
-rw-r--r--src/include/catalog/objectaccess.h2
-rw-r--r--src/include/catalog/objectaddress.h10
-rw-r--r--src/include/catalog/opfam_internal.h2
-rw-r--r--src/include/catalog/partition.h101
-rw-r--r--src/include/catalog/pg_aggregate.h2
-rw-r--r--src/include/catalog/pg_am.h2
-rw-r--r--src/include/catalog/pg_amop.h40
-rw-r--r--src/include/catalog/pg_amproc.h170
-rw-r--r--src/include/catalog/pg_attrdef.h2
-rw-r--r--src/include/catalog/pg_attribute.h26
-rw-r--r--src/include/catalog/pg_auth_members.h2
-rw-r--r--src/include/catalog/pg_authid.h18
-rw-r--r--src/include/catalog/pg_cast.h18
-rw-r--r--src/include/catalog/pg_class.h34
-rw-r--r--src/include/catalog/pg_collation.h28
-rw-r--r--src/include/catalog/pg_collation_fn.h7
-rw-r--r--src/include/catalog/pg_constraint.h2
-rw-r--r--src/include/catalog/pg_constraint_fn.h2
-rw-r--r--src/include/catalog/pg_control.h16
-rw-r--r--src/include/catalog/pg_conversion.h2
-rw-r--r--src/include/catalog/pg_conversion_fn.h2
-rw-r--r--src/include/catalog/pg_database.h2
-rw-r--r--src/include/catalog/pg_db_role_setting.h2
-rw-r--r--src/include/catalog/pg_default_acl.h3
-rw-r--r--src/include/catalog/pg_depend.h2
-rw-r--r--src/include/catalog/pg_description.h2
-rw-r--r--src/include/catalog/pg_enum.h4
-rw-r--r--src/include/catalog/pg_event_trigger.h2
-rw-r--r--src/include/catalog/pg_extension.h2
-rw-r--r--src/include/catalog/pg_foreign_data_wrapper.h2
-rw-r--r--src/include/catalog/pg_foreign_server.h2
-rw-r--r--src/include/catalog/pg_foreign_table.h4
-rw-r--r--src/include/catalog/pg_index.h2
-rw-r--r--src/include/catalog/pg_inherits.h2
-rw-r--r--src/include/catalog/pg_inherits_fn.h2
-rw-r--r--src/include/catalog/pg_init_privs.h2
-rw-r--r--src/include/catalog/pg_language.h2
-rw-r--r--src/include/catalog/pg_largeobject.h2
-rw-r--r--src/include/catalog/pg_largeobject_metadata.h2
-rw-r--r--src/include/catalog/pg_namespace.h2
-rw-r--r--src/include/catalog/pg_opclass.h38
-rw-r--r--src/include/catalog/pg_operator.h35
-rw-r--r--src/include/catalog/pg_operator_fn.h2
-rw-r--r--src/include/catalog/pg_opfamily.h7
-rw-r--r--src/include/catalog/pg_partitioned_table.h74
-rw-r--r--src/include/catalog/pg_pltemplate.h2
-rw-r--r--src/include/catalog/pg_policy.h18
-rw-r--r--src/include/catalog/pg_proc.h317
-rw-r--r--src/include/catalog/pg_proc_fn.h2
-rw-r--r--src/include/catalog/pg_publication.h104
-rw-r--r--src/include/catalog/pg_publication_rel.h52
-rw-r--r--src/include/catalog/pg_range.h2
-rw-r--r--src/include/catalog/pg_replication_origin.h2
-rw-r--r--src/include/catalog/pg_rewrite.h2
-rw-r--r--src/include/catalog/pg_seclabel.h2
-rw-r--r--src/include/catalog/pg_sequence.h32
-rw-r--r--src/include/catalog/pg_shdepend.h2
-rw-r--r--src/include/catalog/pg_shdescription.h2
-rw-r--r--src/include/catalog/pg_shseclabel.h2
-rw-r--r--src/include/catalog/pg_statistic.h4
-rw-r--r--src/include/catalog/pg_statistic_ext.h80
-rw-r--r--src/include/catalog/pg_subscription.h96
-rw-r--r--src/include/catalog/pg_subscription_rel.h82
-rw-r--r--src/include/catalog/pg_tablespace.h2
-rw-r--r--src/include/catalog/pg_transform.h2
-rw-r--r--src/include/catalog/pg_trigger.h15
-rw-r--r--src/include/catalog/pg_ts_config.h2
-rw-r--r--src/include/catalog/pg_ts_config_map.h2
-rw-r--r--src/include/catalog/pg_ts_dict.h2
-rw-r--r--src/include/catalog/pg_ts_parser.h2
-rw-r--r--src/include/catalog/pg_ts_template.h2
-rw-r--r--src/include/catalog/pg_type.h16
-rw-r--r--src/include/catalog/pg_type_fn.h2
-rw-r--r--src/include/catalog/pg_user_mapping.h2
-rw-r--r--src/include/catalog/storage.h2
-rw-r--r--src/include/catalog/storage_xlog.h2
-rw-r--r--src/include/catalog/toasting.h3
-rw-r--r--src/include/commands/alter.h2
-rw-r--r--src/include/commands/async.h7
-rw-r--r--src/include/commands/cluster.h2
-rw-r--r--src/include/commands/collationcmds.h5
-rw-r--r--src/include/commands/comment.h2
-rw-r--r--src/include/commands/conversioncmds.h2
-rw-r--r--src/include/commands/copy.h15
-rw-r--r--src/include/commands/createas.h5
-rw-r--r--src/include/commands/dbcommands.h6
-rw-r--r--src/include/commands/dbcommands_xlog.h2
-rw-r--r--src/include/commands/defrem.h25
-rw-r--r--src/include/commands/discard.h2
-rw-r--r--src/include/commands/event_trigger.h2
-rw-r--r--src/include/commands/explain.h15
-rw-r--r--src/include/commands/extension.h19
-rw-r--r--src/include/commands/lockcmds.h2
-rw-r--r--src/include/commands/matview.h2
-rw-r--r--src/include/commands/policy.h2
-rw-r--r--src/include/commands/portalcmds.h4
-rw-r--r--src/include/commands/prepare.h9
-rw-r--r--src/include/commands/progress.h2
-rw-r--r--src/include/commands/publicationcmds.h29
-rw-r--r--src/include/commands/schemacmds.h12
-rw-r--r--src/include/commands/seclabel.h2
-rw-r--r--src/include/commands/sequence.h46
-rw-r--r--src/include/commands/subscriptioncmds.h29
-rw-r--r--src/include/commands/tablecmds.h4
-rw-r--r--src/include/commands/tablespace.h2
-rw-r--r--src/include/commands/trigger.h6
-rw-r--r--src/include/commands/typecmds.h6
-rw-r--r--src/include/commands/user.h11
-rw-r--r--src/include/commands/vacuum.h2
-rw-r--r--src/include/commands/variable.h2
-rw-r--r--src/include/commands/view.h5
-rw-r--r--src/include/common/base64.h19
-rw-r--r--src/include/common/config_info.h2
-rw-r--r--src/include/common/controldata_utils.h4
-rw-r--r--src/include/common/fe_memutils.h2
-rw-r--r--src/include/common/file_utils.h27
-rw-r--r--src/include/common/int128.h276
-rw-r--r--src/include/common/ip.h (renamed from src/include/libpq/ip.h)20
-rw-r--r--src/include/common/keywords.h2
-rw-r--r--src/include/common/md5.h (renamed from src/include/libpq/md5.h)8
-rw-r--r--src/include/common/relpath.h2
-rw-r--r--src/include/common/restricted_token.h2
-rw-r--r--src/include/common/saslprep.h30
-rw-r--r--src/include/common/scram-common.h59
-rw-r--r--src/include/common/sha2.h115
-rw-r--r--src/include/common/string.h2
-rw-r--r--src/include/common/unicode_norm.h21
-rw-r--r--src/include/common/unicode_norm_table.h8859
-rw-r--r--src/include/common/username.h2
-rw-r--r--src/include/datatype/timestamp.h57
-rw-r--r--src/include/executor/execExpr.h650
-rw-r--r--src/include/executor/execParallel.h6
-rw-r--r--src/include/executor/execdebug.h25
-rw-r--r--src/include/executor/execdesc.h15
-rw-r--r--src/include/executor/executor.h229
-rw-r--r--src/include/executor/functions.h2
-rw-r--r--src/include/executor/hashjoin.h2
-rw-r--r--src/include/executor/instrument.h2
-rw-r--r--src/include/executor/nodeAgg.h2
-rw-r--r--src/include/executor/nodeAppend.h2
-rw-r--r--src/include/executor/nodeBitmapAnd.h2
-rw-r--r--src/include/executor/nodeBitmapHeapscan.h9
-rw-r--r--src/include/executor/nodeBitmapIndexscan.h2
-rw-r--r--src/include/executor/nodeBitmapOr.h2
-rw-r--r--src/include/executor/nodeCtescan.h2
-rw-r--r--src/include/executor/nodeCustom.h3
-rw-r--r--src/include/executor/nodeForeignscan.h3
-rw-r--r--src/include/executor/nodeFunctionscan.h2
-rw-r--r--src/include/executor/nodeGather.h2
-rw-r--r--src/include/executor/nodeGatherMerge.h27
-rw-r--r--src/include/executor/nodeGroup.h2
-rw-r--r--src/include/executor/nodeHash.h2
-rw-r--r--src/include/executor/nodeHashjoin.h2
-rw-r--r--src/include/executor/nodeIndexonlyscan.h11
-rw-r--r--src/include/executor/nodeIndexscan.h6
-rw-r--r--src/include/executor/nodeLimit.h2
-rw-r--r--src/include/executor/nodeLockRows.h2
-rw-r--r--src/include/executor/nodeMaterial.h2
-rw-r--r--src/include/executor/nodeMergeAppend.h2
-rw-r--r--src/include/executor/nodeMergejoin.h2
-rw-r--r--src/include/executor/nodeModifyTable.h2
-rw-r--r--src/include/executor/nodeNamedtuplestorescan.h24
-rw-r--r--src/include/executor/nodeNestloop.h2
-rw-r--r--src/include/executor/nodeProjectSet.h24
-rw-r--r--src/include/executor/nodeRecursiveunion.h2
-rw-r--r--src/include/executor/nodeResult.h2
-rw-r--r--src/include/executor/nodeSamplescan.h2
-rw-r--r--src/include/executor/nodeSeqscan.h2
-rw-r--r--src/include/executor/nodeSetOp.h2
-rw-r--r--src/include/executor/nodeSort.h2
-rw-r--r--src/include/executor/nodeSubplan.h6
-rw-r--r--src/include/executor/nodeSubqueryscan.h2
-rw-r--r--src/include/executor/nodeTableFuncscan.h24
-rw-r--r--src/include/executor/nodeTidscan.h2
-rw-r--r--src/include/executor/nodeUnique.h2
-rw-r--r--src/include/executor/nodeValuesscan.h2
-rw-r--r--src/include/executor/nodeWindowAgg.h2
-rw-r--r--src/include/executor/nodeWorktablescan.h2
-rw-r--r--src/include/executor/spi.h24
-rw-r--r--src/include/executor/spi_priv.h4
-rw-r--r--src/include/executor/tablefunc.h67
-rw-r--r--src/include/executor/tqueue.h2
-rw-r--r--src/include/executor/tstoreReceiver.h2
-rw-r--r--src/include/executor/tuptable.h2
-rw-r--r--src/include/fe_utils/mbprint.h2
-rw-r--r--src/include/fe_utils/print.h2
-rw-r--r--src/include/fe_utils/psqlscan.h18
-rw-r--r--src/include/fe_utils/psqlscan_int.h8
-rw-r--r--src/include/fe_utils/simple_list.h2
-rw-r--r--src/include/fe_utils/string_utils.h8
-rw-r--r--src/include/fmgr.h84
-rw-r--r--src/include/foreign/fdwapi.h4
-rw-r--r--src/include/foreign/foreign.h4
-rw-r--r--src/include/funcapi.h2
-rw-r--r--src/include/getaddrinfo.h6
-rw-r--r--src/include/getopt_long.h2
-rw-r--r--src/include/lib/binaryheap.h2
-rw-r--r--src/include/lib/bipartite_match.h2
-rw-r--r--src/include/lib/hyperloglog.h2
-rw-r--r--src/include/lib/ilist.h2
-rw-r--r--src/include/lib/knapsack.h17
-rw-r--r--src/include/lib/pairingheap.h2
-rw-r--r--src/include/lib/rbtree.h24
-rw-r--r--src/include/lib/simplehash.h956
-rw-r--r--src/include/lib/stringinfo.h2
-rw-r--r--src/include/libpq/auth.h2
-rw-r--r--src/include/libpq/be-fsstubs.h33
-rw-r--r--src/include/libpq/crypt.h33
-rw-r--r--src/include/libpq/hba.h22
-rw-r--r--src/include/libpq/ifaddr.h30
-rw-r--r--src/include/libpq/libpq-be.h15
-rw-r--r--src/include/libpq/libpq-fs.h2
-rw-r--r--src/include/libpq/libpq.h8
-rw-r--r--src/include/libpq/pqcomm.h7
-rw-r--r--src/include/libpq/pqformat.h2
-rw-r--r--src/include/libpq/pqmq.h2
-rw-r--r--src/include/libpq/pqsignal.h2
-rw-r--r--src/include/libpq/scram.h34
-rw-r--r--src/include/mb/pg_wchar.h92
-rw-r--r--src/include/miscadmin.h9
-rw-r--r--src/include/nodes/bitmapset.h8
-rw-r--r--src/include/nodes/execnodes.h776
-rw-r--r--src/include/nodes/extensible.h3
-rw-r--r--src/include/nodes/lockoptions.h2
-rw-r--r--src/include/nodes/makefuncs.h6
-rw-r--r--src/include/nodes/memnodes.h4
-rw-r--r--src/include/nodes/nodeFuncs.h2
-rw-r--r--src/include/nodes/nodes.h136
-rw-r--r--src/include/nodes/params.h2
-rw-r--r--src/include/nodes/parsenodes.h447
-rw-r--r--src/include/nodes/pg_list.h23
-rw-r--r--src/include/nodes/plannodes.h118
-rw-r--r--src/include/nodes/primnodes.h90
-rw-r--r--src/include/nodes/print.h2
-rw-r--r--src/include/nodes/readfuncs.h2
-rw-r--r--src/include/nodes/relation.h199
-rw-r--r--src/include/nodes/replnodes.h14
-rw-r--r--src/include/nodes/tidbitmap.h12
-rw-r--r--src/include/nodes/value.h2
-rw-r--r--src/include/optimizer/clauses.h6
-rw-r--r--src/include/optimizer/cost.h38
-rw-r--r--src/include/optimizer/geqo.h2
-rw-r--r--src/include/optimizer/geqo_copy.h2
-rw-r--r--src/include/optimizer/geqo_gene.h2
-rw-r--r--src/include/optimizer/geqo_misc.h2
-rw-r--r--src/include/optimizer/geqo_mutation.h2
-rw-r--r--src/include/optimizer/geqo_pool.h2
-rw-r--r--src/include/optimizer/geqo_random.h2
-rw-r--r--src/include/optimizer/geqo_recombination.h2
-rw-r--r--src/include/optimizer/geqo_selection.h2
-rw-r--r--src/include/optimizer/joininfo.h2
-rw-r--r--src/include/optimizer/orclauses.h2
-rw-r--r--src/include/optimizer/pathnode.h48
-rw-r--r--src/include/optimizer/paths.h15
-rw-r--r--src/include/optimizer/placeholder.h2
-rw-r--r--src/include/optimizer/plancat.h2
-rw-r--r--src/include/optimizer/planmain.h10
-rw-r--r--src/include/optimizer/planner.h4
-rw-r--r--src/include/optimizer/predtest.h2
-rw-r--r--src/include/optimizer/prep.h7
-rw-r--r--src/include/optimizer/restrictinfo.h10
-rw-r--r--src/include/optimizer/subselect.h2
-rw-r--r--src/include/optimizer/tlist.h9
-rw-r--r--src/include/optimizer/var.h2
-rw-r--r--src/include/parser/analyze.h15
-rw-r--r--src/include/parser/gramparse.h2
-rw-r--r--src/include/parser/kwlist.h15
-rw-r--r--src/include/parser/parse_agg.h2
-rw-r--r--src/include/parser/parse_clause.h8
-rw-r--r--src/include/parser/parse_coerce.h6
-rw-r--r--src/include/parser/parse_collate.h2
-rw-r--r--src/include/parser/parse_cte.h2
-rw-r--r--src/include/parser/parse_enr.h22
-rw-r--r--src/include/parser/parse_expr.h2
-rw-r--r--src/include/parser/parse_func.h12
-rw-r--r--src/include/parser/parse_node.h58
-rw-r--r--src/include/parser/parse_oper.h7
-rw-r--r--src/include/parser/parse_param.h2
-rw-r--r--src/include/parser/parse_relation.h15
-rw-r--r--src/include/parser/parse_target.h5
-rw-r--r--src/include/parser/parse_type.h2
-rw-r--r--src/include/parser/parse_utilcmd.h4
-rw-r--r--src/include/parser/parser.h2
-rw-r--r--src/include/parser/parsetree.h2
-rw-r--r--src/include/parser/scanner.h4
-rw-r--r--src/include/parser/scansup.h2
-rw-r--r--src/include/pg_config.h.in68
-rw-r--r--src/include/pg_config.h.win3249
-rw-r--r--src/include/pg_config_manual.h25
-rw-r--r--src/include/pg_getopt.h2
-rw-r--r--src/include/pg_trace.h2
-rw-r--r--src/include/pgstat.h223
-rw-r--r--src/include/pgtar.h3
-rw-r--r--src/include/pgtime.h4
-rw-r--r--src/include/port.h22
-rw-r--r--src/include/port/atomics.h71
-rw-r--r--src/include/port/atomics/arch-arm.h9
-rw-r--r--src/include/port/atomics/arch-hppa.h2
-rw-r--r--src/include/port/atomics/arch-ia64.h5
-rw-r--r--src/include/port/atomics/arch-ppc.h5
-rw-r--r--src/include/port/atomics/arch-x86.h16
-rw-r--r--src/include/port/atomics/fallback.h38
-rw-r--r--src/include/port/atomics/generic-acc.h2
-rw-r--r--src/include/port/atomics/generic-gcc.h15
-rw-r--r--src/include/port/atomics/generic-msvc.h4
-rw-r--r--src/include/port/atomics/generic-sunpro.h2
-rw-r--r--src/include/port/atomics/generic-xlc.h2
-rw-r--r--src/include/port/atomics/generic.h58
-rw-r--r--src/include/port/darwin.h2
-rw-r--r--src/include/port/pg_bswap.h27
-rw-r--r--src/include/port/pg_crc32c.h2
-rw-r--r--src/include/port/sco.h7
-rw-r--r--src/include/port/unixware.h11
-rw-r--r--src/include/port/win32.h43
-rw-r--r--src/include/portability/instr_time.h104
-rw-r--r--src/include/portability/mem.h2
-rw-r--r--src/include/postgres.h89
-rw-r--r--src/include/postgres_ext.h5
-rw-r--r--src/include/postgres_fe.h2
-rw-r--r--src/include/postmaster/autovacuum.h16
-rw-r--r--src/include/postmaster/bgworker.h16
-rw-r--r--src/include/postmaster/bgworker_internals.h10
-rw-r--r--src/include/postmaster/bgwriter.h2
-rw-r--r--src/include/postmaster/fork_process.h2
-rw-r--r--src/include/postmaster/pgarch.h4
-rw-r--r--src/include/postmaster/postmaster.h2
-rw-r--r--src/include/postmaster/startup.h2
-rw-r--r--src/include/postmaster/syslogger.h9
-rw-r--r--src/include/postmaster/walwriter.h2
-rw-r--r--src/include/regex/regcustom.h23
-rw-r--r--src/include/regex/regex.h1
-rw-r--r--src/include/regex/regexport.h2
-rw-r--r--src/include/regex/regguts.h142
-rw-r--r--src/include/replication/basebackup.h2
-rw-r--r--src/include/replication/decode.h2
-rw-r--r--src/include/replication/logical.h23
-rw-r--r--src/include/replication/logicalfuncs.h9
-rw-r--r--src/include/replication/logicallauncher.h27
-rw-r--r--src/include/replication/logicalproto.h106
-rw-r--r--src/include/replication/logicalrelation.h42
-rw-r--r--src/include/replication/logicalworker.h17
-rw-r--r--src/include/replication/message.h2
-rw-r--r--src/include/replication/origin.h16
-rw-r--r--src/include/replication/output_plugin.h36
-rw-r--r--src/include/replication/pgoutput.h30
-rw-r--r--src/include/replication/reorderbuffer.h16
-rw-r--r--src/include/replication/slot.h13
-rw-r--r--src/include/replication/snapbuild.h31
-rw-r--r--src/include/replication/syncrep.h9
-rw-r--r--src/include/replication/walreceiver.h164
-rw-r--r--src/include/replication/walsender.h17
-rw-r--r--src/include/replication/walsender_private.h10
-rw-r--r--src/include/replication/worker_internal.h97
-rw-r--r--src/include/rewrite/prs2lock.h2
-rw-r--r--src/include/rewrite/rewriteDefine.h2
-rw-r--r--src/include/rewrite/rewriteHandler.h2
-rw-r--r--src/include/rewrite/rewriteManip.h2
-rw-r--r--src/include/rewrite/rewriteRemove.h2
-rw-r--r--src/include/rewrite/rewriteSupport.h4
-rw-r--r--src/include/rewrite/rowsecurity.h3
-rw-r--r--src/include/rusagestub.h2
-rw-r--r--src/include/snowball/header.h7
-rw-r--r--src/include/statistics/extended_stats_internal.h69
-rw-r--r--src/include/statistics/statistics.h98
-rw-r--r--src/include/storage/backendid.h2
-rw-r--r--src/include/storage/barrier.h23
-rw-r--r--src/include/storage/block.h2
-rw-r--r--src/include/storage/buf.h2
-rw-r--r--src/include/storage/buf_internals.h9
-rw-r--r--src/include/storage/buffile.h2
-rw-r--r--src/include/storage/bufmgr.h17
-rw-r--r--src/include/storage/bufpage.h16
-rw-r--r--src/include/storage/checksum.h2
-rw-r--r--src/include/storage/checksum_impl.h2
-rw-r--r--src/include/storage/condition_variable.h59
-rw-r--r--src/include/storage/copydir.h2
-rw-r--r--src/include/storage/dsm.h6
-rw-r--r--src/include/storage/dsm_impl.h6
-rw-r--r--src/include/storage/fd.h15
-rw-r--r--src/include/storage/freespace.h2
-rw-r--r--src/include/storage/fsm_internals.h2
-rw-r--r--src/include/storage/indexfsm.h2
-rw-r--r--src/include/storage/ipc.h2
-rw-r--r--src/include/storage/item.h2
-rw-r--r--src/include/storage/itemid.h2
-rw-r--r--src/include/storage/itemptr.h36
-rw-r--r--src/include/storage/large_object.h2
-rw-r--r--src/include/storage/latch.h14
-rw-r--r--src/include/storage/lmgr.h2
-rw-r--r--src/include/storage/lock.h2
-rw-r--r--src/include/storage/lockdefs.h2
-rw-r--r--src/include/storage/lwlock.h73
-rw-r--r--src/include/storage/off.h2
-rw-r--r--src/include/storage/pg_sema.h54
-rw-r--r--src/include/storage/pg_shmem.h2
-rw-r--r--src/include/storage/pmsignal.h2
-rw-r--r--src/include/storage/pos.h64
-rw-r--r--src/include/storage/predicate.h4
-rw-r--r--src/include/storage/predicate_internals.h4
-rw-r--r--src/include/storage/proc.h32
-rw-r--r--src/include/storage/procarray.h45
-rw-r--r--src/include/storage/proclist.h208
-rw-r--r--src/include/storage/proclist_types.h45
-rw-r--r--src/include/storage/procsignal.h2
-rw-r--r--src/include/storage/reinit.h2
-rw-r--r--src/include/storage/relfilenode.h2
-rw-r--r--src/include/storage/s_lock.h29
-rw-r--r--src/include/storage/shm_mq.h2
-rw-r--r--src/include/storage/shm_toc.h2
-rw-r--r--src/include/storage/shmem.h4
-rw-r--r--src/include/storage/sinval.h5
-rw-r--r--src/include/storage/sinvaladt.h2
-rw-r--r--src/include/storage/smgr.h16
-rw-r--r--src/include/storage/spin.h6
-rw-r--r--src/include/storage/standby.h2
-rw-r--r--src/include/storage/standbydefs.h2
-rw-r--r--src/include/tcop/deparse_utility.h2
-rw-r--r--src/include/tcop/dest.h3
-rw-r--r--src/include/tcop/fastpath.h4
-rw-r--r--src/include/tcop/pquery.h4
-rw-r--r--src/include/tcop/tcopprot.h14
-rw-r--r--src/include/tcop/utility.h19
-rw-r--r--src/include/tsearch/dicts/regis.h2
-rw-r--r--src/include/tsearch/dicts/spell.h4
-rw-r--r--src/include/tsearch/ts_cache.h2
-rw-r--r--src/include/tsearch/ts_locale.h2
-rw-r--r--src/include/tsearch/ts_public.h2
-rw-r--r--src/include/tsearch/ts_type.h100
-rw-r--r--src/include/tsearch/ts_utils.h197
-rw-r--r--src/include/utils/.gitignore1
-rw-r--r--src/include/utils/acl.h37
-rw-r--r--src/include/utils/aclchk_internal.h2
-rw-r--r--src/include/utils/array.h63
-rw-r--r--src/include/utils/arrayaccess.h2
-rw-r--r--src/include/utils/ascii.h8
-rw-r--r--src/include/utils/attoptcache.h2
-rw-r--r--src/include/utils/backend_random.h19
-rw-r--r--src/include/utils/builtins.h1218
-rw-r--r--src/include/utils/bytea.h27
-rw-r--r--src/include/utils/cash.h48
-rw-r--r--src/include/utils/catcache.h11
-rw-r--r--src/include/utils/combocid.h2
-rw-r--r--src/include/utils/date.h145
-rw-r--r--src/include/utils/datetime.h15
-rw-r--r--src/include/utils/datum.h2
-rw-r--r--src/include/utils/dsa.h125
-rw-r--r--src/include/utils/dynahash.h2
-rw-r--r--src/include/utils/dynamic_loader.h2
-rw-r--r--src/include/utils/elog.h13
-rw-r--r--src/include/utils/evtcache.h2
-rw-r--r--src/include/utils/expandeddatum.h2
-rw-r--r--src/include/utils/fmgrtab.h2
-rw-r--r--src/include/utils/formatting.h14
-rw-r--r--src/include/utils/freepage.h99
-rw-r--r--src/include/utils/geo_decls.h264
-rw-r--r--src/include/utils/guc.h9
-rw-r--r--src/include/utils/guc_tables.h3
-rw-r--r--src/include/utils/help_config.h2
-rw-r--r--src/include/utils/hsearch.h2
-rw-r--r--src/include/utils/index_selfuncs.h20
-rw-r--r--src/include/utils/inet.h52
-rw-r--r--src/include/utils/int8.h106
-rw-r--r--src/include/utils/inval.h4
-rw-r--r--src/include/utils/json.h66
-rw-r--r--src/include/utils/jsonapi.h20
-rw-r--r--src/include/utils/jsonb.h111
-rw-r--r--src/include/utils/logtape.h10
-rw-r--r--src/include/utils/lsyscache.h38
-rw-r--r--src/include/utils/memdebug.h50
-rw-r--r--src/include/utils/memutils.h83
-rw-r--r--src/include/utils/nabstime.h65
-rw-r--r--src/include/utils/numeric.h2
-rw-r--r--src/include/utils/palloc.h4
-rw-r--r--src/include/utils/pg_crc.h2
-rw-r--r--src/include/utils/pg_locale.h37
-rw-r--r--src/include/utils/pg_lsn.h18
-rw-r--r--src/include/utils/pg_rusage.h2
-rw-r--r--src/include/utils/plancache.h21
-rw-r--r--src/include/utils/portal.h9
-rw-r--r--src/include/utils/queryenvironment.h74
-rw-r--r--src/include/utils/rangetypes.h82
-rw-r--r--src/include/utils/regproc.h28
-rw-r--r--src/include/utils/rel.h105
-rw-r--r--src/include/utils/relcache.h9
-rw-r--r--src/include/utils/relfilenodemap.h2
-rw-r--r--src/include/utils/relmapper.h2
-rw-r--r--src/include/utils/relptr.h77
-rw-r--r--src/include/utils/reltrigger.h9
-rw-r--r--src/include/utils/resowner.h2
-rw-r--r--src/include/utils/resowner_private.h2
-rw-r--r--src/include/utils/rls.h2
-rw-r--r--src/include/utils/ruleutils.h4
-rw-r--r--src/include/utils/sampling.h2
-rw-r--r--src/include/utils/selfuncs.h36
-rw-r--r--src/include/utils/snapmgr.h15
-rw-r--r--src/include/utils/snapshot.h5
-rw-r--r--src/include/utils/sortsupport.h2
-rw-r--r--src/include/utils/spccache.h2
-rw-r--r--src/include/utils/syscache.h17
-rw-r--r--src/include/utils/timeout.h2
-rw-r--r--src/include/utils/timestamp.h175
-rw-r--r--src/include/utils/tqual.h2
-rw-r--r--src/include/utils/tuplesort.h14
-rw-r--r--src/include/utils/tuplestore.h4
-rw-r--r--src/include/utils/typcache.h7
-rw-r--r--src/include/utils/tzparser.h2
-rw-r--r--src/include/utils/uuid.h10
-rw-r--r--src/include/utils/varbit.h48
-rw-r--r--src/include/utils/varlena.h37
-rw-r--r--src/include/utils/xml.h42
-rw-r--r--src/include/windowapi.h2
594 files changed, 20110 insertions, 6578 deletions
diff --git a/src/include/Makefile b/src/include/Makefile
index e4f1fc38bf..6afa3cfe25 100644
--- a/src/include/Makefile
+++ b/src/include/Makefile
@@ -45,6 +45,7 @@ install: all installdirs
$(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)'
$(INSTALL_DATA) utils/errcodes.h '$(DESTDIR)$(includedir_server)/utils'
$(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils'
+ $(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils'
# We don't use INSTALL_DATA for performance reasons --- there are a lot of files
cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ || exit; \
chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/*.h || exit; \
@@ -72,7 +73,7 @@ uninstall:
clean:
- rm -f utils/fmgroids.h utils/errcodes.h parser/gram.h utils/probes.h catalog/schemapg.h
+ rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h parser/gram.h utils/probes.h catalog/schemapg.h
distclean maintainer-clean: clean
rm -f pg_config.h pg_config_ext.h pg_config_os.h dynloader.h stamp-h stamp-ext-h
diff --git a/src/include/access/amapi.h b/src/include/access/amapi.h
index 1036cca99c..f919cf8b87 100644
--- a/src/include/access/amapi.h
+++ b/src/include/access/amapi.h
@@ -3,7 +3,7 @@
* amapi.h
* API for Postgres index access methods.
*
- * Copyright (c) 2015-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2015-2017, PostgreSQL Global Development Group
*
* src/include/access/amapi.h
*
@@ -72,7 +72,8 @@ typedef bool (*aminsert_function) (Relation indexRelation,
bool *isnull,
ItemPointer heap_tid,
Relation heapRelation,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
/* bulk delete */
typedef IndexBulkDeleteResult *(*ambulkdelete_function) (IndexVacuumInfo *info,
@@ -94,7 +95,8 @@ typedef void (*amcostestimate_function) (struct PlannerInfo *root,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
/* parse index reloptions */
typedef bytea *(*amoptions_function) (Datum reloptions,
@@ -137,6 +139,18 @@ typedef void (*ammarkpos_function) (IndexScanDesc scan);
/* restore marked scan position */
typedef void (*amrestrpos_function) (IndexScanDesc scan);
+/*
+ * Callback function signatures - for parallel index scans.
+ */
+
+/* estimate size of parallel scan descriptor */
+typedef Size (*amestimateparallelscan_function) (void);
+
+/* prepare for parallel index scan */
+typedef void (*aminitparallelscan_function) (void *target);
+
+/* (re)start parallel index scan */
+typedef void (*amparallelrescan_function) (IndexScanDesc scan);
/*
* API struct for an index AM. Note this must be stored in a single palloc'd
@@ -175,6 +189,8 @@ typedef struct IndexAmRoutine
bool amclusterable;
/* does AM handle predicate locks? */
bool ampredlocks;
+ /* does AM support parallel scan? */
+ bool amcanparallel;
/* type of data stored in index, or InvalidOid if variable */
Oid amkeytype;
@@ -196,6 +212,11 @@ typedef struct IndexAmRoutine
amendscan_function amendscan;
ammarkpos_function ammarkpos; /* can be NULL */
amrestrpos_function amrestrpos; /* can be NULL */
+
+ /* interface functions to support parallel index scans */
+ amestimateparallelscan_function amestimateparallelscan; /* can be NULL */
+ aminitparallelscan_function aminitparallelscan; /* can be NULL */
+ amparallelrescan_function amparallelrescan; /* can be NULL */
} IndexAmRoutine;
@@ -203,6 +224,4 @@ typedef struct IndexAmRoutine
extern IndexAmRoutine *GetIndexAmRoutine(Oid amhandler);
extern IndexAmRoutine *GetIndexAmRoutineByAmId(Oid amoid, bool noerror);
-extern Datum amvalidate(PG_FUNCTION_ARGS);
-
#endif /* AMAPI_H */
diff --git a/src/include/access/amvalidate.h b/src/include/access/amvalidate.h
index 7f4289a996..742c25a78d 100644
--- a/src/include/access/amvalidate.h
+++ b/src/include/access/amvalidate.h
@@ -3,7 +3,7 @@
* amvalidate.h
* Support routines for index access methods' amvalidate functions.
*
- * Copyright (c) 2016, PostgreSQL Global Development Group
+ * Copyright (c) 2016-2017, PostgreSQL Global Development Group
*
* src/include/access/amvalidate.h
*
diff --git a/src/include/access/attnum.h b/src/include/access/attnum.h
index 849634c145..7fa459fc8c 100644
--- a/src/include/access/attnum.h
+++ b/src/include/access/attnum.h
@@ -4,7 +4,7 @@
* POSTGRES attribute number definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/attnum.h
diff --git a/src/include/access/brin.h b/src/include/access/brin.h
index 99bf5330bb..45d55a9733 100644
--- a/src/include/access/brin.h
+++ b/src/include/access/brin.h
@@ -1,7 +1,7 @@
/*
* AM-callable functions for BRIN indexes
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -16,24 +16,37 @@
/*
- * prototypes for functions in brin.c (external entry points for BRIN)
- */
-extern Datum brinhandler(PG_FUNCTION_ARGS);
-extern Datum brin_summarize_new_values(PG_FUNCTION_ARGS);
-
-/*
* Storage type for BRIN's reloptions
*/
typedef struct BrinOptions
{
int32 vl_len_; /* varlena header (do not touch directly!) */
BlockNumber pagesPerRange;
+ bool autosummarize;
} BrinOptions;
+
+/*
+ * BrinStatsData represents stats data for planner use
+ */
+typedef struct BrinStatsData
+{
+ BlockNumber pagesPerRange;
+ BlockNumber revmapNumPages;
+} BrinStatsData;
+
+
#define BRIN_DEFAULT_PAGES_PER_RANGE 128
#define BrinGetPagesPerRange(relation) \
((relation)->rd_options ? \
((BrinOptions *) (relation)->rd_options)->pagesPerRange : \
BRIN_DEFAULT_PAGES_PER_RANGE)
+#define BrinGetAutoSummarize(relation) \
+ ((relation)->rd_options ? \
+ ((BrinOptions *) (relation)->rd_options)->autosummarize : \
+ false)
+
+
+extern void brinGetStats(Relation index, BrinStatsData *stats);
#endif /* BRIN_H */
diff --git a/src/include/access/brin_internal.h b/src/include/access/brin_internal.h
index 47317af43c..abe887788b 100644
--- a/src/include/access/brin_internal.h
+++ b/src/include/access/brin_internal.h
@@ -2,7 +2,7 @@
* brin_internal.h
* internal declarations for BRIN indexes
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -89,7 +89,8 @@ extern IndexBuildResult *brinbuild(Relation heap, Relation index,
extern void brinbuildempty(Relation index);
extern bool brininsert(Relation idxRel, Datum *values, bool *nulls,
ItemPointer heaptid, Relation heapRel,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
extern IndexScanDesc brinbeginscan(Relation r, int nkeys, int norderbys);
extern int64 bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
extern void brinrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
diff --git a/src/include/access/brin_page.h b/src/include/access/brin_page.h
index b48f8f5597..e2b3b92fac 100644
--- a/src/include/access/brin_page.h
+++ b/src/include/access/brin_page.h
@@ -2,7 +2,7 @@
* brin_page.h
* Prototypes and definitions for BRIN page layouts
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
diff --git a/src/include/access/brin_pageops.h b/src/include/access/brin_pageops.h
index af86cc86e7..ab38093a23 100644
--- a/src/include/access/brin_pageops.h
+++ b/src/include/access/brin_pageops.h
@@ -2,7 +2,7 @@
* brin_pageops.h
* Prototypes for operating on BRIN pages.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
diff --git a/src/include/access/brin_revmap.h b/src/include/access/brin_revmap.h
index 89054e0128..7fdcf877f4 100644
--- a/src/include/access/brin_revmap.h
+++ b/src/include/access/brin_revmap.h
@@ -2,7 +2,7 @@
* brin_revmap.h
* Prototypes for BRIN reverse range maps
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -36,5 +36,6 @@ extern void brinSetHeapBlockItemptr(Buffer rmbuf, BlockNumber pagesPerRange,
extern BrinTuple *brinGetTupleForHeapBlock(BrinRevmap *revmap,
BlockNumber heapBlk, Buffer *buf, OffsetNumber *off,
Size *size, int mode, Snapshot snapshot);
+extern bool brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk);
#endif /* BRIN_REVMAP_H */
diff --git a/src/include/access/brin_tuple.h b/src/include/access/brin_tuple.h
index 2af05123aa..3f4a7b6d3c 100644
--- a/src/include/access/brin_tuple.h
+++ b/src/include/access/brin_tuple.h
@@ -2,7 +2,7 @@
* brin_tuple.h
* Declarations for dealing with BRIN-specific tuples.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -38,6 +38,11 @@ typedef struct BrinMemTuple
bool bt_placeholder; /* this is a placeholder tuple */
BlockNumber bt_blkno; /* heap blkno that the tuple is for */
MemoryContext bt_context; /* memcxt holding the bt_columns values */
+ /* output arrays for brin_deform_tuple: */
+ Datum *bt_values; /* values array */
+ bool *bt_allnulls; /* allnulls array */
+ bool *bt_hasnulls; /* hasnulls array */
+ /* not an output array, but must be last */
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER];
} BrinMemTuple;
@@ -83,14 +88,15 @@ extern BrinTuple *brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno,
extern BrinTuple *brin_form_placeholder_tuple(BrinDesc *brdesc,
BlockNumber blkno, Size *size);
extern void brin_free_tuple(BrinTuple *tuple);
-extern BrinTuple *brin_copy_tuple(BrinTuple *tuple, Size len);
+extern BrinTuple *brin_copy_tuple(BrinTuple *tuple, Size len,
+ BrinTuple *dest, Size *destsz);
extern bool brin_tuples_equal(const BrinTuple *a, Size alen,
const BrinTuple *b, Size blen);
extern BrinMemTuple *brin_new_memtuple(BrinDesc *brdesc);
-extern void brin_memtuple_initialize(BrinMemTuple *dtuple,
+extern BrinMemTuple *brin_memtuple_initialize(BrinMemTuple *dtuple,
BrinDesc *brdesc);
extern BrinMemTuple *brin_deform_tuple(BrinDesc *brdesc,
- BrinTuple *tuple);
+ BrinTuple *tuple, BrinMemTuple *dMemtuple);
#endif /* BRIN_TUPLE_H */
diff --git a/src/include/access/brin_xlog.h b/src/include/access/brin_xlog.h
index f6148053b4..38e6dcccf2 100644
--- a/src/include/access/brin_xlog.h
+++ b/src/include/access/brin_xlog.h
@@ -4,7 +4,7 @@
* POSTGRES BRIN access XLOG definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/brin_xlog.h
@@ -33,7 +33,7 @@
#define XLOG_BRIN_UPDATE 0x20
#define XLOG_BRIN_SAMEPAGE_UPDATE 0x30
#define XLOG_BRIN_REVMAP_EXTEND 0x40
-#define XLOG_BRIN_REVMAP_VACUUM 0x50
+#define XLOG_BRIN_DESUMMARIZE 0x50
#define XLOG_BRIN_OPMASK 0x70
/*
@@ -124,9 +124,28 @@ typedef struct xl_brin_revmap_extend
#define SizeOfBrinRevmapExtend (offsetof(xl_brin_revmap_extend, targetBlk) + \
sizeof(BlockNumber))
+/*
+ * This is what we need to know about a range de-summarization
+ *
+ * Backup block 0: revmap page
+ * Backup block 1: regular page
+ */
+typedef struct xl_brin_desummarize
+{
+ BlockNumber pagesPerRange;
+ /* page number location to set to invalid */
+ BlockNumber heapBlk;
+ /* offset of item to delete in regular index page */
+ OffsetNumber regOffset;
+} xl_brin_desummarize;
+
+#define SizeOfBrinDesummarize (offsetof(xl_brin_desummarize, regOffset) + \
+ sizeof(OffsetNumber))
+
extern void brin_redo(XLogReaderState *record);
extern void brin_desc(StringInfo buf, XLogReaderState *record);
extern const char *brin_identify(uint8 info);
+extern void brin_mask(char *pagedata, BlockNumber blkno);
#endif /* BRIN_XLOG_H */
diff --git a/src/include/access/bufmask.h b/src/include/access/bufmask.h
new file mode 100644
index 0000000000..95c6c3ae02
--- /dev/null
+++ b/src/include/access/bufmask.h
@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ *
+ * bufmask.h
+ * Definitions for buffer masking routines, used to mask certain bits
+ * in a page which can be different when the WAL is generated
+ * and when the WAL is applied. This is really the job of each
+ * individual rmgr, but we make things easier by providing some
+ * common routines to handle cases which occur in multiple rmgrs.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * src/include/access/bufmask.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef BUFMASK_H
+#define BUFMASK_H
+
+#include "storage/block.h"
+#include "storage/bufmgr.h"
+
+/* Marker used to mask pages consistently */
+#define MASK_MARKER 0
+
+extern void mask_page_lsn(Page page);
+extern void mask_page_hint_bits(Page page);
+extern void mask_unused_space(Page page);
+extern void mask_lp_flags(Page page);
+extern void mask_page_content(Page page);
+
+#endif
diff --git a/src/include/access/clog.h b/src/include/access/clog.h
index 06c069ae3a..5ac7cdd618 100644
--- a/src/include/access/clog.h
+++ b/src/include/access/clog.h
@@ -3,7 +3,7 @@
*
* PostgreSQL transaction-commit-log manager
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/clog.h
@@ -28,6 +28,12 @@ typedef int XidStatus;
#define TRANSACTION_STATUS_ABORTED 0x02
#define TRANSACTION_STATUS_SUB_COMMITTED 0x03
+typedef struct xl_clog_truncate
+{
+ int pageno;
+ TransactionId oldestXact;
+ Oid oldestXactDb;
+} xl_clog_truncate;
extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
@@ -42,7 +48,7 @@ extern void TrimCLOG(void);
extern void ShutdownCLOG(void);
extern void CheckPointCLOG(void);
extern void ExtendCLOG(TransactionId newestXact);
-extern void TruncateCLOG(TransactionId oldestXact);
+extern void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid);
/* XLOG stuff */
#define CLOG_ZEROPAGE 0x00
diff --git a/src/include/access/commit_ts.h b/src/include/access/commit_ts.h
index cf343ca8ea..f172c91d8f 100644
--- a/src/include/access/commit_ts.h
+++ b/src/include/access/commit_ts.h
@@ -3,7 +3,7 @@
*
* PostgreSQL commit timestamp manager
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/commit_ts.h
@@ -61,6 +61,14 @@ typedef struct xl_commit_ts_set
#define SizeOfCommitTsSet (offsetof(xl_commit_ts_set, mainxid) + \
sizeof(TransactionId))
+typedef struct xl_commit_ts_truncate
+{
+ int pageno;
+ TransactionId oldestXid;
+} xl_commit_ts_truncate;
+
+#define SizeOfCommitTsTruncate (offsetof(xl_commit_ts_truncate, oldestXid) + \
+ sizeof(TransactionId))
extern void commit_ts_redo(XLogReaderState *record);
extern void commit_ts_desc(StringInfo buf, XLogReaderState *record);
diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index 81907d5566..f467b18a9c 100644
--- a/src/include/access/genam.h
+++ b/src/include/access/genam.h
@@ -4,7 +4,7 @@
* POSTGRES generalized index access method definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/genam.h
@@ -21,6 +21,9 @@
#include "utils/relcache.h"
#include "utils/snapshot.h"
+/* We don't want this file to depend on execnodes.h. */
+struct IndexInfo;
+
/*
* Struct for statistics returned by ambuild
*/
@@ -83,6 +86,8 @@ typedef bool (*IndexBulkDeleteCallback) (ItemPointer itemptr, void *state);
typedef struct IndexScanDescData *IndexScanDesc;
typedef struct SysScanDescData *SysScanDesc;
+typedef struct ParallelIndexScanDescData *ParallelIndexScanDesc;
+
/*
* Enumeration specifying the type of uniqueness check to perform in
* index_insert().
@@ -129,7 +134,8 @@ extern bool index_insert(Relation indexRelation,
Datum *values, bool *isnull,
ItemPointer heap_t_ctid,
Relation heapRelation,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
extern IndexScanDesc index_beginscan(Relation heapRelation,
Relation indexRelation,
@@ -144,6 +150,13 @@ extern void index_rescan(IndexScanDesc scan,
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
+extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot);
+extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel,
+ Snapshot snapshot, ParallelIndexScanDesc target);
+extern void index_parallelrescan(IndexScanDesc scan);
+extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
+ Relation indexrel, int nkeys, int norderbys,
+ ParallelIndexScanDesc pscan);
extern ItemPointer index_getnext_tid(IndexScanDesc scan,
ScanDirection direction);
extern HeapTuple index_fetch_heap(IndexScanDesc scan);
diff --git a/src/include/access/generic_xlog.h b/src/include/access/generic_xlog.h
index 63f2120633..0dc17f55f2 100644
--- a/src/include/access/generic_xlog.h
+++ b/src/include/access/generic_xlog.h
@@ -4,7 +4,7 @@
* Generic xlog API definition.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/generic_xlog.h
@@ -40,5 +40,6 @@ extern void GenericXLogAbort(GenericXLogState *state);
extern void generic_redo(XLogReaderState *record);
extern const char *generic_identify(uint8 info);
extern void generic_desc(StringInfo buf, XLogReaderState *record);
+extern void generic_mask(char *pagedata, BlockNumber blkno);
#endif /* GENERIC_XLOG_H */
diff --git a/src/include/access/gin.h b/src/include/access/gin.h
index e5b2e10a27..bd9e8833de 100644
--- a/src/include/access/gin.h
+++ b/src/include/access/gin.h
@@ -2,7 +2,7 @@
* gin.h
* Public header file for Generalized Inverted Index access method.
*
- * Copyright (c) 2006-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2006-2017, PostgreSQL Global Development Group
*
* src/include/access/gin.h
*--------------------------------------------------------------------------
@@ -73,11 +73,4 @@ extern int gin_pending_list_limit;
extern void ginGetStats(Relation index, GinStatsData *stats);
extern void ginUpdateStats(Relation index, const GinStatsData *stats);
-/* ginxlog.c */
-extern void gin_redo(XLogReaderState *record);
-extern void gin_desc(StringInfo buf, XLogReaderState *record);
-extern const char *gin_identify(uint8 info);
-extern void gin_xlog_startup(void);
-extern void gin_xlog_cleanup(void);
-
#endif /* GIN_H */
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index 68cfe0c1ac..986fe6e041 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -2,7 +2,7 @@
* gin_private.h
* header file for postgres inverted index access method implementation.
*
- * Copyright (c) 2006-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2006-2017, PostgreSQL Global Development Group
*
* src/include/access/gin_private.h
*--------------------------------------------------------------------------
@@ -12,309 +12,12 @@
#include "access/amapi.h"
#include "access/gin.h"
+#include "access/ginblock.h"
#include "access/itup.h"
#include "fmgr.h"
#include "storage/bufmgr.h"
#include "lib/rbtree.h"
-
-/*
- * Page opaque data in an inverted index page.
- *
- * Note: GIN does not include a page ID word as do the other index types.
- * This is OK because the opaque data is only 8 bytes and so can be reliably
- * distinguished by size. Revisit this if the size ever increases.
- * Further note: as of 9.2, SP-GiST also uses 8-byte special space, as does
- * BRIN as of 9.5. This is still OK, as long as GIN isn't using all of the
- * high-order bits in its flags word, because that way the flags word cannot
- * match the page IDs used by SP-GiST and BRIN.
- */
-typedef struct GinPageOpaqueData
-{
- BlockNumber rightlink; /* next page if any */
- OffsetNumber maxoff; /* number of PostingItems on GIN_DATA &
- * ~GIN_LEAF page. On GIN_LIST page, number of
- * heap tuples. */
- uint16 flags; /* see bit definitions below */
-} GinPageOpaqueData;
-
-typedef GinPageOpaqueData *GinPageOpaque;
-
-#define GIN_DATA (1 << 0)
-#define GIN_LEAF (1 << 1)
-#define GIN_DELETED (1 << 2)
-#define GIN_META (1 << 3)
-#define GIN_LIST (1 << 4)
-#define GIN_LIST_FULLROW (1 << 5) /* makes sense only on GIN_LIST page */
-#define GIN_INCOMPLETE_SPLIT (1 << 6) /* page was split, but parent not
- * updated */
-#define GIN_COMPRESSED (1 << 7)
-
-/* Page numbers of fixed-location pages */
-#define GIN_METAPAGE_BLKNO (0)
-#define GIN_ROOT_BLKNO (1)
-
-typedef struct GinMetaPageData
-{
- /*
- * Pointers to head and tail of pending list, which consists of GIN_LIST
- * pages. These store fast-inserted entries that haven't yet been moved
- * into the regular GIN structure.
- */
- BlockNumber head;
- BlockNumber tail;
-
- /*
- * Free space in bytes in the pending list's tail page.
- */
- uint32 tailFreeSize;
-
- /*
- * We store both number of pages and number of heap tuples that are in the
- * pending list.
- */
- BlockNumber nPendingPages;
- int64 nPendingHeapTuples;
-
- /*
- * Statistics for planner use (accurate as of last VACUUM)
- */
- BlockNumber nTotalPages;
- BlockNumber nEntryPages;
- BlockNumber nDataPages;
- int64 nEntries;
-
- /*
- * GIN version number (ideally this should have been at the front, but too
- * late now. Don't move it!)
- *
- * Currently 2 (for indexes initialized in 9.4 or later)
- *
- * Version 1 (indexes initialized in version 9.1, 9.2 or 9.3), is
- * compatible, but may contain uncompressed posting tree (leaf) pages and
- * posting lists. They will be converted to compressed format when
- * modified.
- *
- * Version 0 (indexes initialized in 9.0 or before) is compatible but may
- * be missing null entries, including both null keys and placeholders.
- * Reject full-index-scan attempts on such indexes.
- */
- int32 ginVersion;
-} GinMetaPageData;
-
-#define GIN_CURRENT_VERSION 2
-
-#define GinPageGetMeta(p) \
- ((GinMetaPageData *) PageGetContents(p))
-
-/*
- * Macros for accessing a GIN index page's opaque data
- */
-#define GinPageGetOpaque(page) ( (GinPageOpaque) PageGetSpecialPointer(page) )
-
-#define GinPageIsLeaf(page) ( (GinPageGetOpaque(page)->flags & GIN_LEAF) != 0 )
-#define GinPageSetLeaf(page) ( GinPageGetOpaque(page)->flags |= GIN_LEAF )
-#define GinPageSetNonLeaf(page) ( GinPageGetOpaque(page)->flags &= ~GIN_LEAF )
-#define GinPageIsData(page) ( (GinPageGetOpaque(page)->flags & GIN_DATA) != 0 )
-#define GinPageSetData(page) ( GinPageGetOpaque(page)->flags |= GIN_DATA )
-#define GinPageIsList(page) ( (GinPageGetOpaque(page)->flags & GIN_LIST) != 0 )
-#define GinPageSetList(page) ( GinPageGetOpaque(page)->flags |= GIN_LIST )
-#define GinPageHasFullRow(page) ( (GinPageGetOpaque(page)->flags & GIN_LIST_FULLROW) != 0 )
-#define GinPageSetFullRow(page) ( GinPageGetOpaque(page)->flags |= GIN_LIST_FULLROW )
-#define GinPageIsCompressed(page) ( (GinPageGetOpaque(page)->flags & GIN_COMPRESSED) != 0 )
-#define GinPageSetCompressed(page) ( GinPageGetOpaque(page)->flags |= GIN_COMPRESSED )
-
-#define GinPageIsDeleted(page) ( (GinPageGetOpaque(page)->flags & GIN_DELETED) != 0 )
-#define GinPageSetDeleted(page) ( GinPageGetOpaque(page)->flags |= GIN_DELETED)
-#define GinPageSetNonDeleted(page) ( GinPageGetOpaque(page)->flags &= ~GIN_DELETED)
-#define GinPageIsIncompleteSplit(page) ( (GinPageGetOpaque(page)->flags & GIN_INCOMPLETE_SPLIT) != 0 )
-
-#define GinPageRightMost(page) ( GinPageGetOpaque(page)->rightlink == InvalidBlockNumber)
-
-/*
- * We use our own ItemPointerGet(BlockNumber|OffsetNumber)
- * to avoid Asserts, since sometimes the ip_posid isn't "valid"
- */
-#define GinItemPointerGetBlockNumber(pointer) \
- BlockIdGetBlockNumber(&(pointer)->ip_blkid)
-
-#define GinItemPointerGetOffsetNumber(pointer) \
- ((pointer)->ip_posid)
-
-/*
- * Special-case item pointer values needed by the GIN search logic.
- * MIN: sorts less than any valid item pointer
- * MAX: sorts greater than any valid item pointer
- * LOSSY PAGE: indicates a whole heap page, sorts after normal item
- * pointers for that page
- * Note that these are all distinguishable from an "invalid" item pointer
- * (which is InvalidBlockNumber/0) as well as from all normal item
- * pointers (which have item numbers in the range 1..MaxHeapTuplesPerPage).
- */
-#define ItemPointerSetMin(p) \
- ItemPointerSet((p), (BlockNumber)0, (OffsetNumber)0)
-#define ItemPointerIsMin(p) \
- (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0 && \
- GinItemPointerGetBlockNumber(p) == (BlockNumber)0)
-#define ItemPointerSetMax(p) \
- ItemPointerSet((p), InvalidBlockNumber, (OffsetNumber)0xffff)
-#define ItemPointerIsMax(p) \
- (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \
- GinItemPointerGetBlockNumber(p) == InvalidBlockNumber)
-#define ItemPointerSetLossyPage(p, b) \
- ItemPointerSet((p), (b), (OffsetNumber)0xffff)
-#define ItemPointerIsLossyPage(p) \
- (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \
- GinItemPointerGetBlockNumber(p) != InvalidBlockNumber)
-
-/*
- * Posting item in a non-leaf posting-tree page
- */
-typedef struct
-{
- /* We use BlockIdData not BlockNumber to avoid padding space wastage */
- BlockIdData child_blkno;
- ItemPointerData key;
-} PostingItem;
-
-#define PostingItemGetBlockNumber(pointer) \
- BlockIdGetBlockNumber(&(pointer)->child_blkno)
-
-#define PostingItemSetBlockNumber(pointer, blockNumber) \
- BlockIdSet(&((pointer)->child_blkno), (blockNumber))
-
-/*
- * Category codes to distinguish placeholder nulls from ordinary NULL keys.
- * Note that the datatype size and the first two code values are chosen to be
- * compatible with the usual usage of bool isNull flags.
- *
- * GIN_CAT_EMPTY_QUERY is never stored in the index; and notice that it is
- * chosen to sort before not after regular key values.
- */
-typedef signed char GinNullCategory;
-
-#define GIN_CAT_NORM_KEY 0 /* normal, non-null key value */
-#define GIN_CAT_NULL_KEY 1 /* null key value */
-#define GIN_CAT_EMPTY_ITEM 2 /* placeholder for zero-key item */
-#define GIN_CAT_NULL_ITEM 3 /* placeholder for null item */
-#define GIN_CAT_EMPTY_QUERY (-1) /* placeholder for full-scan query */
-
-/*
- * Access macros for null category byte in entry tuples
- */
-#define GinCategoryOffset(itup,ginstate) \
- (IndexInfoFindDataOffset((itup)->t_info) + \
- ((ginstate)->oneCol ? 0 : sizeof(int16)))
-#define GinGetNullCategory(itup,ginstate) \
- (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))))
-#define GinSetNullCategory(itup,ginstate,c) \
- (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))) = (c))
-
-/*
- * Access macros for leaf-page entry tuples (see discussion in README)
- */
-#define GinGetNPosting(itup) GinItemPointerGetOffsetNumber(&(itup)->t_tid)
-#define GinSetNPosting(itup,n) ItemPointerSetOffsetNumber(&(itup)->t_tid,n)
-#define GIN_TREE_POSTING ((OffsetNumber)0xffff)
-#define GinIsPostingTree(itup) (GinGetNPosting(itup) == GIN_TREE_POSTING)
-#define GinSetPostingTree(itup, blkno) ( GinSetNPosting((itup),GIN_TREE_POSTING), ItemPointerSetBlockNumber(&(itup)->t_tid, blkno) )
-#define GinGetPostingTree(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid)
-
-#define GIN_ITUP_COMPRESSED (1U << 31)
-#define GinGetPostingOffset(itup) (GinItemPointerGetBlockNumber(&(itup)->t_tid) & (~GIN_ITUP_COMPRESSED))
-#define GinSetPostingOffset(itup,n) ItemPointerSetBlockNumber(&(itup)->t_tid,(n)|GIN_ITUP_COMPRESSED)
-#define GinGetPosting(itup) ((Pointer) ((char*)(itup) + GinGetPostingOffset(itup)))
-#define GinItupIsCompressed(itup) ((GinItemPointerGetBlockNumber(&(itup)->t_tid) & GIN_ITUP_COMPRESSED) != 0)
-
-/*
- * Maximum size of an item on entry tree page. Make sure that we fit at least
- * three items on each page. (On regular B-tree indexes, we must fit at least
- * three items: two data items and the "high key". In GIN entry tree, we don't
- * currently store the high key explicitly, we just use the rightmost item on
- * the page, so it would actually be enough to fit two items.)
- */
-#define GinMaxItemSize \
- Min(INDEX_SIZE_MASK, \
- MAXALIGN_DOWN(((BLCKSZ - \
- MAXALIGN(SizeOfPageHeaderData + 3 * sizeof(ItemIdData)) - \
- MAXALIGN(sizeof(GinPageOpaqueData))) / 3)))
-
-/*
- * Access macros for non-leaf entry tuples
- */
-#define GinGetDownlink(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid)
-#define GinSetDownlink(itup,blkno) ItemPointerSet(&(itup)->t_tid, blkno, InvalidOffsetNumber)
-
-
-/*
- * Data (posting tree) pages
- *
- * Posting tree pages don't store regular tuples. Non-leaf pages contain
- * PostingItems, which are pairs of ItemPointers and child block numbers.
- * Leaf pages contain GinPostingLists and an uncompressed array of item
- * pointers.
- *
- * In a leaf page, the compressed posting lists are stored after the regular
- * page header, one after each other. Although we don't store regular tuples,
- * pd_lower is used to indicate the end of the posting lists. After that, free
- * space follows. This layout is compatible with the "standard" heap and
- * index page layout described in bufpage.h, so that we can e.g set buffer_std
- * when writing WAL records.
- *
- * In the special space is the GinPageOpaque struct.
- */
-#define GinDataLeafPageGetPostingList(page) \
- (GinPostingList *) ((PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData))))
-#define GinDataLeafPageGetPostingListSize(page) \
- (((PageHeader) page)->pd_lower - MAXALIGN(SizeOfPageHeaderData) - MAXALIGN(sizeof(ItemPointerData)))
-
-#define GinDataLeafPageIsEmpty(page) \
- (GinPageIsCompressed(page) ? (GinDataLeafPageGetPostingListSize(page) == 0) : (GinPageGetOpaque(page)->maxoff < FirstOffsetNumber))
-
-#define GinDataLeafPageGetFreeSpace(page) PageGetExactFreeSpace(page)
-
-#define GinDataPageGetRightBound(page) ((ItemPointer) PageGetContents(page))
-/*
- * Pointer to the data portion of a posting tree page. For internal pages,
- * that's the beginning of the array of PostingItems. For compressed leaf
- * pages, the first compressed posting list. For uncompressed (pre-9.4) leaf
- * pages, it's the beginning of the ItemPointer array.
- */
-#define GinDataPageGetData(page) \
- (PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData)))
-/* non-leaf pages contain PostingItems */
-#define GinDataPageGetPostingItem(page, i) \
- ((PostingItem *) (GinDataPageGetData(page) + ((i)-1) * sizeof(PostingItem)))
-
-/*
- * Note: there is no GinDataPageGetDataSize macro, because before version
- * 9.4, we didn't set pd_lower on data pages. There can be pages in the index
- * that were binary-upgraded from earlier versions and still have an invalid
- * pd_lower, so we cannot trust it in general. Compressed posting tree leaf
- * pages are new in 9.4, however, so we can trust them; see
- * GinDataLeafPageGetPostingListSize.
- */
-#define GinDataPageSetDataSize(page, size) \
- { \
- Assert(size <= GinDataPageMaxDataSize); \
- ((PageHeader) page)->pd_lower = (size) + MAXALIGN(SizeOfPageHeaderData) + MAXALIGN(sizeof(ItemPointerData)); \
- }
-
-#define GinNonLeafDataPageGetFreeSpace(page) \
- (GinDataPageMaxDataSize - \
- GinPageGetOpaque(page)->maxoff * sizeof(PostingItem))
-
-#define GinDataPageMaxDataSize \
- (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
- - MAXALIGN(sizeof(ItemPointerData)) \
- - MAXALIGN(sizeof(GinPageOpaqueData)))
-
-/*
- * List pages
- */
-#define GinListPageSize \
- ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GinPageOpaqueData)) )
-
/*
* Storage type for GIN's reloptions
*/
@@ -380,218 +83,7 @@ typedef struct GinState
} GinState;
-/*
- * A compressed posting list.
- *
- * Note: This requires 2-byte alignment.
- */
-typedef struct
-{
- ItemPointerData first; /* first item in this posting list (unpacked) */
- uint16 nbytes; /* number of bytes that follow */
- unsigned char bytes[FLEXIBLE_ARRAY_MEMBER]; /* varbyte encoded items */
-} GinPostingList;
-
-#define SizeOfGinPostingList(plist) (offsetof(GinPostingList, bytes) + SHORTALIGN((plist)->nbytes) )
-#define GinNextPostingListSegment(cur) ((GinPostingList *) (((char *) (cur)) + SizeOfGinPostingList((cur))))
-
-
-/* XLog stuff */
-
-#define XLOG_GIN_CREATE_INDEX 0x00
-
-#define XLOG_GIN_CREATE_PTREE 0x10
-
-typedef struct ginxlogCreatePostingTree
-{
- uint32 size;
- /* A compressed posting list follows */
-} ginxlogCreatePostingTree;
-
-/*
- * The format of the insertion record varies depending on the page type.
- * ginxlogInsert is the common part between all variants.
- *
- * Backup Blk 0: target page
- * Backup Blk 1: left child, if this insertion finishes an incomplete split
- */
-
-#define XLOG_GIN_INSERT 0x20
-
-typedef struct
-{
- uint16 flags; /* GIN_INSERT_ISLEAF and/or GIN_INSERT_ISDATA */
-
- /*
- * FOLLOWS:
- *
- * 1. if not leaf page, block numbers of the left and right child pages
- * whose split this insertion finishes, as BlockIdData[2] (beware of
- * adding fields in this struct that would make them not 16-bit aligned)
- *
- * 2. a ginxlogInsertEntry or ginxlogRecompressDataLeaf struct, depending
- * on tree type.
- *
- * NB: the below structs are only 16-bit aligned when appended to a
- * ginxlogInsert struct! Beware of adding fields to them that require
- * stricter alignment.
- */
-} ginxlogInsert;
-
-typedef struct
-{
- OffsetNumber offset;
- bool isDelete;
- IndexTupleData tuple; /* variable length */
-} ginxlogInsertEntry;
-
-
-typedef struct
-{
- uint16 nactions;
-
- /* Variable number of 'actions' follow */
-} ginxlogRecompressDataLeaf;
-
-/*
- * Note: this struct is currently not used in code, and only acts as
- * documentation. The WAL record format is as specified here, but the code
- * uses straight access through a Pointer and memcpy to read/write these.
- */
-typedef struct
-{
- uint8 segno; /* segment this action applies to */
- char type; /* action type (see below) */
-
- /*
- * Action-specific data follows. For INSERT and REPLACE actions that is a
- * GinPostingList struct. For ADDITEMS, a uint16 for the number of items
- * added, followed by the items themselves as ItemPointers. DELETE actions
- * have no further data.
- */
-} ginxlogSegmentAction;
-
-/* Action types */
-#define GIN_SEGMENT_UNMODIFIED 0 /* no action (not used in WAL records) */
-#define GIN_SEGMENT_DELETE 1 /* a whole segment is removed */
-#define GIN_SEGMENT_INSERT 2 /* a whole segment is added */
-#define GIN_SEGMENT_REPLACE 3 /* a segment is replaced */
-#define GIN_SEGMENT_ADDITEMS 4 /* items are added to existing segment */
-
-typedef struct
-{
- OffsetNumber offset;
- PostingItem newitem;
-} ginxlogInsertDataInternal;
-
-/*
- * Backup Blk 0: new left page (= original page, if not root split)
- * Backup Blk 1: new right page
- * Backup Blk 2: original page / new root page, if root split
- * Backup Blk 3: left child, if this insertion completes an earlier split
- */
-#define XLOG_GIN_SPLIT 0x30
-
-typedef struct ginxlogSplit
-{
- RelFileNode node;
- BlockNumber rrlink; /* right link, or root's blocknumber if root
- * split */
- BlockNumber leftChildBlkno; /* valid on a non-leaf split */
- BlockNumber rightChildBlkno;
- uint16 flags; /* see below */
-} ginxlogSplit;
-
-/*
- * Flags used in ginxlogInsert and ginxlogSplit records
- */
-#define GIN_INSERT_ISDATA 0x01 /* for both insert and split records */
-#define GIN_INSERT_ISLEAF 0x02 /* ditto */
-#define GIN_SPLIT_ROOT 0x04 /* only for split records */
-
-/*
- * Vacuum simply WAL-logs the whole page, when anything is modified. This
- * is functionally identical to heap_newpage records, but is kept separate for
- * debugging purposes. (When inspecting the WAL stream, it's easier to see
- * what's going on when GIN vacuum records are marked as such, not as heap
- * records.) This is currently only used for entry tree leaf pages.
- */
-#define XLOG_GIN_VACUUM_PAGE 0x40
-
-/*
- * Vacuuming posting tree leaf page is WAL-logged like recompression caused
- * by insertion.
- */
-#define XLOG_GIN_VACUUM_DATA_LEAF_PAGE 0x90
-
-typedef struct ginxlogVacuumDataLeafPage
-{
- ginxlogRecompressDataLeaf data;
-} ginxlogVacuumDataLeafPage;
-
-/*
- * Backup Blk 0: deleted page
- * Backup Blk 1: parent
- * Backup Blk 2: left sibling
- */
-#define XLOG_GIN_DELETE_PAGE 0x50
-
-typedef struct ginxlogDeletePage
-{
- OffsetNumber parentOffset;
- BlockNumber rightLink;
-} ginxlogDeletePage;
-
-#define XLOG_GIN_UPDATE_META_PAGE 0x60
-
-/*
- * Backup Blk 0: metapage
- * Backup Blk 1: tail page
- */
-typedef struct ginxlogUpdateMeta
-{
- RelFileNode node;
- GinMetaPageData metadata;
- BlockNumber prevTail;
- BlockNumber newRightlink;
- int32 ntuples; /* if ntuples > 0 then metadata.tail was
- * updated with that many tuples; else new sub
- * list was inserted */
- /* array of inserted tuples follows */
-} ginxlogUpdateMeta;
-
-#define XLOG_GIN_INSERT_LISTPAGE 0x70
-
-typedef struct ginxlogInsertListPage
-{
- BlockNumber rightlink;
- int32 ntuples;
- /* array of inserted tuples follows */
-} ginxlogInsertListPage;
-
-/*
- * Backup Blk 0: metapage
- * Backup Blk 1 to (ndeleted + 1): deleted pages
- */
-
-#define XLOG_GIN_DELETE_LISTPAGE 0x80
-
-/*
- * The WAL record for deleting list pages must contain a block reference to
- * all the deleted pages, so the number of pages that can be deleted in one
- * record is limited by XLR_MAX_BLOCK_ID. (block_id 0 is used for the
- * metapage.)
- */
-#define GIN_NDELETE_AT_ONCE Min(16, XLR_MAX_BLOCK_ID - 1)
-typedef struct ginxlogDeleteListPages
-{
- GinMetaPageData metadata;
- int32 ndeleted;
-} ginxlogDeleteListPages;
-
-
/* ginutil.c */
-extern Datum ginhandler(PG_FUNCTION_ARGS);
extern bytea *ginoptions(Datum reloptions, bool validate);
extern void initGinState(GinState *state, Relation index);
extern Buffer GinNewBuffer(Relation index);
@@ -618,7 +110,8 @@ extern IndexBuildResult *ginbuild(Relation heap, Relation index,
extern void ginbuildempty(Relation index);
extern bool gininsert(Relation index, Datum *values, bool *isnull,
ItemPointer ht_ctid, Relation heapRel,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
extern void ginEntryInsert(GinState *ginstate,
OffsetNumber attnum, Datum key, GinNullCategory category,
ItemPointerData *items, uint32 nitem,
@@ -788,7 +281,7 @@ typedef struct GinScanKeyData
int nadditional;
/* array of check flags, reported to consistentFn */
- bool *entryRes;
+ GinTernaryValue *entryRes;
bool (*boolConsistentFn) (GinScanKey key);
GinTernaryValue (*triConsistentFn) (GinScanKey key);
FmgrInfo *consistentFmgrInfo;
@@ -880,9 +373,6 @@ extern void ginFreeScanKeys(GinScanOpaque so);
/* ginget.c */
extern int64 gingetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
-/* ginfast.c */
-extern Datum gin_clean_pending_list(PG_FUNCTION_ARGS);
-
/* ginlogic.c */
extern void ginInitConsistentFunction(GinState *ginstate, GinScanKey key);
@@ -919,6 +409,7 @@ typedef struct
GinEntryAccumulator *entryallocator;
uint32 eas_used;
RBTree *tree;
+ RBTreeIterator tree_walk;
} BuildAccumulator;
extern void ginInitBA(BuildAccumulator *accum);
@@ -969,8 +460,8 @@ extern ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na,
static inline int
ginCompareItemPointers(ItemPointer a, ItemPointer b)
{
- uint64 ia = (uint64) a->ip_blkid.bi_hi << 32 | (uint64) a->ip_blkid.bi_lo << 16 | a->ip_posid;
- uint64 ib = (uint64) b->ip_blkid.bi_hi << 32 | (uint64) b->ip_blkid.bi_lo << 16 | b->ip_posid;
+ uint64 ia = (uint64) GinItemPointerGetBlockNumber(a) << 32 | GinItemPointerGetOffsetNumber(a);
+ uint64 ib = (uint64) GinItemPointerGetBlockNumber(b) << 32 | GinItemPointerGetOffsetNumber(b);
if (ia == ib)
return 0;
@@ -980,4 +471,6 @@ ginCompareItemPointers(ItemPointer a, ItemPointer b)
return -1;
}
+extern int ginTraverseLock(Buffer buffer, bool searchMode);
+
#endif /* GIN_PRIVATE_H */
diff --git a/src/include/access/ginblock.h b/src/include/access/ginblock.h
new file mode 100644
index 0000000000..438912c6a0
--- /dev/null
+++ b/src/include/access/ginblock.h
@@ -0,0 +1,336 @@
+/*--------------------------------------------------------------------------
+ * ginblock.h
+ * details of structures stored in GIN index blocks
+ *
+ * Copyright (c) 2006-2017, PostgreSQL Global Development Group
+ *
+ * src/include/access/ginblock.h
+ *--------------------------------------------------------------------------
+ */
+#ifndef GINBLOCK_H
+#define GINBLOCK_H
+
+#include "storage/block.h"
+#include "storage/itemptr.h"
+#include "storage/off.h"
+
+/*
+ * Page opaque data in an inverted index page.
+ *
+ * Note: GIN does not include a page ID word as do the other index types.
+ * This is OK because the opaque data is only 8 bytes and so can be reliably
+ * distinguished by size. Revisit this if the size ever increases.
+ * Further note: as of 9.2, SP-GiST also uses 8-byte special space, as does
+ * BRIN as of 9.5. This is still OK, as long as GIN isn't using all of the
+ * high-order bits in its flags word, because that way the flags word cannot
+ * match the page IDs used by SP-GiST and BRIN.
+ */
+typedef struct GinPageOpaqueData
+{
+ BlockNumber rightlink; /* next page if any */
+ OffsetNumber maxoff; /* number of PostingItems on GIN_DATA &
+ * ~GIN_LEAF page. On GIN_LIST page, number of
+ * heap tuples. */
+ uint16 flags; /* see bit definitions below */
+} GinPageOpaqueData;
+
+typedef GinPageOpaqueData *GinPageOpaque;
+
+#define GIN_DATA (1 << 0)
+#define GIN_LEAF (1 << 1)
+#define GIN_DELETED (1 << 2)
+#define GIN_META (1 << 3)
+#define GIN_LIST (1 << 4)
+#define GIN_LIST_FULLROW (1 << 5) /* makes sense only on GIN_LIST page */
+#define GIN_INCOMPLETE_SPLIT (1 << 6) /* page was split, but parent not
+ * updated */
+#define GIN_COMPRESSED (1 << 7)
+
+/* Page numbers of fixed-location pages */
+#define GIN_METAPAGE_BLKNO (0)
+#define GIN_ROOT_BLKNO (1)
+
+typedef struct GinMetaPageData
+{
+ /*
+ * Pointers to head and tail of pending list, which consists of GIN_LIST
+ * pages. These store fast-inserted entries that haven't yet been moved
+ * into the regular GIN structure.
+ */
+ BlockNumber head;
+ BlockNumber tail;
+
+ /*
+ * Free space in bytes in the pending list's tail page.
+ */
+ uint32 tailFreeSize;
+
+ /*
+ * We store both number of pages and number of heap tuples that are in the
+ * pending list.
+ */
+ BlockNumber nPendingPages;
+ int64 nPendingHeapTuples;
+
+ /*
+ * Statistics for planner use (accurate as of last VACUUM)
+ */
+ BlockNumber nTotalPages;
+ BlockNumber nEntryPages;
+ BlockNumber nDataPages;
+ int64 nEntries;
+
+ /*
+ * GIN version number (ideally this should have been at the front, but too
+ * late now. Don't move it!)
+ *
+ * Currently 2 (for indexes initialized in 9.4 or later)
+ *
+ * Version 1 (indexes initialized in version 9.1, 9.2 or 9.3), is
+ * compatible, but may contain uncompressed posting tree (leaf) pages and
+ * posting lists. They will be converted to compressed format when
+ * modified.
+ *
+ * Version 0 (indexes initialized in 9.0 or before) is compatible but may
+ * be missing null entries, including both null keys and placeholders.
+ * Reject full-index-scan attempts on such indexes.
+ */
+ int32 ginVersion;
+} GinMetaPageData;
+
+#define GIN_CURRENT_VERSION 2
+
+#define GinPageGetMeta(p) \
+ ((GinMetaPageData *) PageGetContents(p))
+
+/*
+ * Macros for accessing a GIN index page's opaque data
+ */
+#define GinPageGetOpaque(page) ( (GinPageOpaque) PageGetSpecialPointer(page) )
+
+#define GinPageIsLeaf(page) ( (GinPageGetOpaque(page)->flags & GIN_LEAF) != 0 )
+#define GinPageSetLeaf(page) ( GinPageGetOpaque(page)->flags |= GIN_LEAF )
+#define GinPageSetNonLeaf(page) ( GinPageGetOpaque(page)->flags &= ~GIN_LEAF )
+#define GinPageIsData(page) ( (GinPageGetOpaque(page)->flags & GIN_DATA) != 0 )
+#define GinPageSetData(page) ( GinPageGetOpaque(page)->flags |= GIN_DATA )
+#define GinPageIsList(page) ( (GinPageGetOpaque(page)->flags & GIN_LIST) != 0 )
+#define GinPageSetList(page) ( GinPageGetOpaque(page)->flags |= GIN_LIST )
+#define GinPageHasFullRow(page) ( (GinPageGetOpaque(page)->flags & GIN_LIST_FULLROW) != 0 )
+#define GinPageSetFullRow(page) ( GinPageGetOpaque(page)->flags |= GIN_LIST_FULLROW )
+#define GinPageIsCompressed(page) ( (GinPageGetOpaque(page)->flags & GIN_COMPRESSED) != 0 )
+#define GinPageSetCompressed(page) ( GinPageGetOpaque(page)->flags |= GIN_COMPRESSED )
+
+#define GinPageIsDeleted(page) ( (GinPageGetOpaque(page)->flags & GIN_DELETED) != 0 )
+#define GinPageSetDeleted(page) ( GinPageGetOpaque(page)->flags |= GIN_DELETED)
+#define GinPageSetNonDeleted(page) ( GinPageGetOpaque(page)->flags &= ~GIN_DELETED)
+#define GinPageIsIncompleteSplit(page) ( (GinPageGetOpaque(page)->flags & GIN_INCOMPLETE_SPLIT) != 0 )
+
+#define GinPageRightMost(page) ( GinPageGetOpaque(page)->rightlink == InvalidBlockNumber)
+
+/*
+ * We use our own ItemPointerGet(BlockNumber|OffsetNumber)
+ * to avoid Asserts, since sometimes the ip_posid isn't "valid"
+ */
+#define GinItemPointerGetBlockNumber(pointer) \
+ (ItemPointerGetBlockNumberNoCheck(pointer))
+
+#define GinItemPointerGetOffsetNumber(pointer) \
+ (ItemPointerGetOffsetNumberNoCheck(pointer))
+
+#define GinItemPointerSetBlockNumber(pointer, blkno) \
+ (ItemPointerSetBlockNumber((pointer), (blkno)))
+
+#define GinItemPointerSetOffsetNumber(pointer, offnum) \
+ (ItemPointerSetOffsetNumber((pointer), (offnum)))
+
+
+/*
+ * Special-case item pointer values needed by the GIN search logic.
+ * MIN: sorts less than any valid item pointer
+ * MAX: sorts greater than any valid item pointer
+ * LOSSY PAGE: indicates a whole heap page, sorts after normal item
+ * pointers for that page
+ * Note that these are all distinguishable from an "invalid" item pointer
+ * (which is InvalidBlockNumber/0) as well as from all normal item
+ * pointers (which have item numbers in the range 1..MaxHeapTuplesPerPage).
+ */
+#define ItemPointerSetMin(p) \
+ ItemPointerSet((p), (BlockNumber)0, (OffsetNumber)0)
+#define ItemPointerIsMin(p) \
+ (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0 && \
+ GinItemPointerGetBlockNumber(p) == (BlockNumber)0)
+#define ItemPointerSetMax(p) \
+ ItemPointerSet((p), InvalidBlockNumber, (OffsetNumber)0xffff)
+#define ItemPointerIsMax(p) \
+ (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \
+ GinItemPointerGetBlockNumber(p) == InvalidBlockNumber)
+#define ItemPointerSetLossyPage(p, b) \
+ ItemPointerSet((p), (b), (OffsetNumber)0xffff)
+#define ItemPointerIsLossyPage(p) \
+ (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \
+ GinItemPointerGetBlockNumber(p) != InvalidBlockNumber)
+
+/*
+ * Posting item in a non-leaf posting-tree page
+ */
+typedef struct
+{
+ /* We use BlockIdData not BlockNumber to avoid padding space wastage */
+ BlockIdData child_blkno;
+ ItemPointerData key;
+} PostingItem;
+
+#define PostingItemGetBlockNumber(pointer) \
+ BlockIdGetBlockNumber(&(pointer)->child_blkno)
+
+#define PostingItemSetBlockNumber(pointer, blockNumber) \
+ BlockIdSet(&((pointer)->child_blkno), (blockNumber))
+
+/*
+ * Category codes to distinguish placeholder nulls from ordinary NULL keys.
+ * Note that the datatype size and the first two code values are chosen to be
+ * compatible with the usual usage of bool isNull flags.
+ *
+ * GIN_CAT_EMPTY_QUERY is never stored in the index; and notice that it is
+ * chosen to sort before not after regular key values.
+ */
+typedef signed char GinNullCategory;
+
+#define GIN_CAT_NORM_KEY 0 /* normal, non-null key value */
+#define GIN_CAT_NULL_KEY 1 /* null key value */
+#define GIN_CAT_EMPTY_ITEM 2 /* placeholder for zero-key item */
+#define GIN_CAT_NULL_ITEM 3 /* placeholder for null item */
+#define GIN_CAT_EMPTY_QUERY (-1) /* placeholder for full-scan query */
+
+/*
+ * Access macros for null category byte in entry tuples
+ */
+#define GinCategoryOffset(itup,ginstate) \
+ (IndexInfoFindDataOffset((itup)->t_info) + \
+ ((ginstate)->oneCol ? 0 : sizeof(int16)))
+#define GinGetNullCategory(itup,ginstate) \
+ (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))))
+#define GinSetNullCategory(itup,ginstate,c) \
+ (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))) = (c))
+
+/*
+ * Access macros for leaf-page entry tuples (see discussion in README)
+ */
+#define GinGetNPosting(itup) GinItemPointerGetOffsetNumber(&(itup)->t_tid)
+#define GinSetNPosting(itup,n) ItemPointerSetOffsetNumber(&(itup)->t_tid,n)
+#define GIN_TREE_POSTING ((OffsetNumber)0xffff)
+#define GinIsPostingTree(itup) (GinGetNPosting(itup) == GIN_TREE_POSTING)
+#define GinSetPostingTree(itup, blkno) ( GinSetNPosting((itup),GIN_TREE_POSTING), ItemPointerSetBlockNumber(&(itup)->t_tid, blkno) )
+#define GinGetPostingTree(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid)
+
+#define GIN_ITUP_COMPRESSED (1U << 31)
+#define GinGetPostingOffset(itup) (GinItemPointerGetBlockNumber(&(itup)->t_tid) & (~GIN_ITUP_COMPRESSED))
+#define GinSetPostingOffset(itup,n) ItemPointerSetBlockNumber(&(itup)->t_tid,(n)|GIN_ITUP_COMPRESSED)
+#define GinGetPosting(itup) ((Pointer) ((char*)(itup) + GinGetPostingOffset(itup)))
+#define GinItupIsCompressed(itup) ((GinItemPointerGetBlockNumber(&(itup)->t_tid) & GIN_ITUP_COMPRESSED) != 0)
+
+/*
+ * Maximum size of an item on entry tree page. Make sure that we fit at least
+ * three items on each page. (On regular B-tree indexes, we must fit at least
+ * three items: two data items and the "high key". In GIN entry tree, we don't
+ * currently store the high key explicitly, we just use the rightmost item on
+ * the page, so it would actually be enough to fit two items.)
+ */
+#define GinMaxItemSize \
+ Min(INDEX_SIZE_MASK, \
+ MAXALIGN_DOWN(((BLCKSZ - \
+ MAXALIGN(SizeOfPageHeaderData + 3 * sizeof(ItemIdData)) - \
+ MAXALIGN(sizeof(GinPageOpaqueData))) / 3)))
+
+/*
+ * Access macros for non-leaf entry tuples
+ */
+#define GinGetDownlink(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid)
+#define GinSetDownlink(itup,blkno) ItemPointerSet(&(itup)->t_tid, blkno, InvalidOffsetNumber)
+
+
+/*
+ * Data (posting tree) pages
+ *
+ * Posting tree pages don't store regular tuples. Non-leaf pages contain
+ * PostingItems, which are pairs of ItemPointers and child block numbers.
+ * Leaf pages contain GinPostingLists and an uncompressed array of item
+ * pointers.
+ *
+ * In a leaf page, the compressed posting lists are stored after the regular
+ * page header, one after each other. Although we don't store regular tuples,
+ * pd_lower is used to indicate the end of the posting lists. After that, free
+ * space follows. This layout is compatible with the "standard" heap and
+ * index page layout described in bufpage.h, so that we can e.g set buffer_std
+ * when writing WAL records.
+ *
+ * In the special space is the GinPageOpaque struct.
+ */
+#define GinDataLeafPageGetPostingList(page) \
+ (GinPostingList *) ((PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData))))
+#define GinDataLeafPageGetPostingListSize(page) \
+ (((PageHeader) page)->pd_lower - MAXALIGN(SizeOfPageHeaderData) - MAXALIGN(sizeof(ItemPointerData)))
+
+#define GinDataLeafPageIsEmpty(page) \
+ (GinPageIsCompressed(page) ? (GinDataLeafPageGetPostingListSize(page) == 0) : (GinPageGetOpaque(page)->maxoff < FirstOffsetNumber))
+
+#define GinDataLeafPageGetFreeSpace(page) PageGetExactFreeSpace(page)
+
+#define GinDataPageGetRightBound(page) ((ItemPointer) PageGetContents(page))
+/*
+ * Pointer to the data portion of a posting tree page. For internal pages,
+ * that's the beginning of the array of PostingItems. For compressed leaf
+ * pages, the first compressed posting list. For uncompressed (pre-9.4) leaf
+ * pages, it's the beginning of the ItemPointer array.
+ */
+#define GinDataPageGetData(page) \
+ (PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData)))
+/* non-leaf pages contain PostingItems */
+#define GinDataPageGetPostingItem(page, i) \
+ ((PostingItem *) (GinDataPageGetData(page) + ((i)-1) * sizeof(PostingItem)))
+
+/*
+ * Note: there is no GinDataPageGetDataSize macro, because before version
+ * 9.4, we didn't set pd_lower on data pages. There can be pages in the index
+ * that were binary-upgraded from earlier versions and still have an invalid
+ * pd_lower, so we cannot trust it in general. Compressed posting tree leaf
+ * pages are new in 9.4, however, so we can trust them; see
+ * GinDataLeafPageGetPostingListSize.
+ */
+#define GinDataPageSetDataSize(page, size) \
+ { \
+ Assert(size <= GinDataPageMaxDataSize); \
+ ((PageHeader) page)->pd_lower = (size) + MAXALIGN(SizeOfPageHeaderData) + MAXALIGN(sizeof(ItemPointerData)); \
+ }
+
+#define GinNonLeafDataPageGetFreeSpace(page) \
+ (GinDataPageMaxDataSize - \
+ GinPageGetOpaque(page)->maxoff * sizeof(PostingItem))
+
+#define GinDataPageMaxDataSize \
+ (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
+ - MAXALIGN(sizeof(ItemPointerData)) \
+ - MAXALIGN(sizeof(GinPageOpaqueData)))
+
+/*
+ * List pages
+ */
+#define GinListPageSize \
+ ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GinPageOpaqueData)) )
+
+/*
+ * A compressed posting list.
+ *
+ * Note: This requires 2-byte alignment.
+ */
+typedef struct
+{
+ ItemPointerData first; /* first item in this posting list (unpacked) */
+ uint16 nbytes; /* number of bytes that follow */
+ unsigned char bytes[FLEXIBLE_ARRAY_MEMBER]; /* varbyte encoded items */
+} GinPostingList;
+
+#define SizeOfGinPostingList(plist) (offsetof(GinPostingList, bytes) + SHORTALIGN((plist)->nbytes) )
+#define GinNextPostingListSegment(cur) ((GinPostingList *) (((char *) (cur)) + SizeOfGinPostingList((cur))))
+
+#endif /* GINBLOCK_H */
diff --git a/src/include/access/ginxlog.h b/src/include/access/ginxlog.h
new file mode 100644
index 0000000000..8decc42cdb
--- /dev/null
+++ b/src/include/access/ginxlog.h
@@ -0,0 +1,217 @@
+/*--------------------------------------------------------------------------
+ * ginxlog.h
+ * header file for postgres inverted index xlog implementation.
+ *
+ * Copyright (c) 2006-2017, PostgreSQL Global Development Group
+ *
+ * src/include/access/ginxlog.h
+ *--------------------------------------------------------------------------
+ */
+#ifndef GINXLOG_H
+#define GINXLOG_H
+
+#include "access/ginblock.h"
+#include "access/itup.h"
+#include "access/xlogreader.h"
+#include "lib/stringinfo.h"
+#include "storage/off.h"
+
+#define XLOG_GIN_CREATE_INDEX 0x00
+
+#define XLOG_GIN_CREATE_PTREE 0x10
+
+typedef struct ginxlogCreatePostingTree
+{
+ uint32 size;
+ /* A compressed posting list follows */
+} ginxlogCreatePostingTree;
+
+/*
+ * The format of the insertion record varies depending on the page type.
+ * ginxlogInsert is the common part between all variants.
+ *
+ * Backup Blk 0: target page
+ * Backup Blk 1: left child, if this insertion finishes an incomplete split
+ */
+
+#define XLOG_GIN_INSERT 0x20
+
+typedef struct
+{
+ uint16 flags; /* GIN_INSERT_ISLEAF and/or GIN_INSERT_ISDATA */
+
+ /*
+ * FOLLOWS:
+ *
+ * 1. if not leaf page, block numbers of the left and right child pages
+ * whose split this insertion finishes, as BlockIdData[2] (beware of
+ * adding fields in this struct that would make them not 16-bit aligned)
+ *
+ * 2. a ginxlogInsertEntry or ginxlogRecompressDataLeaf struct, depending
+ * on tree type.
+ *
+ * NB: the below structs are only 16-bit aligned when appended to a
+ * ginxlogInsert struct! Beware of adding fields to them that require
+ * stricter alignment.
+ */
+} ginxlogInsert;
+
+typedef struct
+{
+ OffsetNumber offset;
+ bool isDelete;
+ IndexTupleData tuple; /* variable length */
+} ginxlogInsertEntry;
+
+
+typedef struct
+{
+ uint16 nactions;
+
+ /* Variable number of 'actions' follow */
+} ginxlogRecompressDataLeaf;
+
+/*
+ * Note: this struct is currently not used in code, and only acts as
+ * documentation. The WAL record format is as specified here, but the code
+ * uses straight access through a Pointer and memcpy to read/write these.
+ */
+typedef struct
+{
+ uint8 segno; /* segment this action applies to */
+ char type; /* action type (see below) */
+
+ /*
+ * Action-specific data follows. For INSERT and REPLACE actions that is a
+ * GinPostingList struct. For ADDITEMS, a uint16 for the number of items
+ * added, followed by the items themselves as ItemPointers. DELETE actions
+ * have no further data.
+ */
+} ginxlogSegmentAction;
+
+/* Action types */
+#define GIN_SEGMENT_UNMODIFIED 0 /* no action (not used in WAL records) */
+#define GIN_SEGMENT_DELETE 1 /* a whole segment is removed */
+#define GIN_SEGMENT_INSERT 2 /* a whole segment is added */
+#define GIN_SEGMENT_REPLACE 3 /* a segment is replaced */
+#define GIN_SEGMENT_ADDITEMS 4 /* items are added to existing segment */
+
+typedef struct
+{
+ OffsetNumber offset;
+ PostingItem newitem;
+} ginxlogInsertDataInternal;
+
+/*
+ * Backup Blk 0: new left page (= original page, if not root split)
+ * Backup Blk 1: new right page
+ * Backup Blk 2: original page / new root page, if root split
+ * Backup Blk 3: left child, if this insertion completes an earlier split
+ */
+#define XLOG_GIN_SPLIT 0x30
+
+typedef struct ginxlogSplit
+{
+ RelFileNode node;
+ BlockNumber rrlink; /* right link, or root's blocknumber if root
+ * split */
+ BlockNumber leftChildBlkno; /* valid on a non-leaf split */
+ BlockNumber rightChildBlkno;
+ uint16 flags; /* see below */
+} ginxlogSplit;
+
+/*
+ * Flags used in ginxlogInsert and ginxlogSplit records
+ */
+#define GIN_INSERT_ISDATA 0x01 /* for both insert and split records */
+#define GIN_INSERT_ISLEAF 0x02 /* ditto */
+#define GIN_SPLIT_ROOT 0x04 /* only for split records */
+
+/*
+ * Vacuum simply WAL-logs the whole page, when anything is modified. This
+ * is functionally identical to heap_newpage records, but is kept separate for
+ * debugging purposes. (When inspecting the WAL stream, it's easier to see
+ * what's going on when GIN vacuum records are marked as such, not as heap
+ * records.) This is currently only used for entry tree leaf pages.
+ */
+#define XLOG_GIN_VACUUM_PAGE 0x40
+
+/*
+ * Vacuuming posting tree leaf page is WAL-logged like recompression caused
+ * by insertion.
+ */
+#define XLOG_GIN_VACUUM_DATA_LEAF_PAGE 0x90
+
+typedef struct ginxlogVacuumDataLeafPage
+{
+ ginxlogRecompressDataLeaf data;
+} ginxlogVacuumDataLeafPage;
+
+/*
+ * Backup Blk 0: deleted page
+ * Backup Blk 1: parent
+ * Backup Blk 2: left sibling
+ */
+#define XLOG_GIN_DELETE_PAGE 0x50
+
+typedef struct ginxlogDeletePage
+{
+ OffsetNumber parentOffset;
+ BlockNumber rightLink;
+} ginxlogDeletePage;
+
+#define XLOG_GIN_UPDATE_META_PAGE 0x60
+
+/*
+ * Backup Blk 0: metapage
+ * Backup Blk 1: tail page
+ */
+typedef struct ginxlogUpdateMeta
+{
+ RelFileNode node;
+ GinMetaPageData metadata;
+ BlockNumber prevTail;
+ BlockNumber newRightlink;
+ int32 ntuples; /* if ntuples > 0 then metadata.tail was
+ * updated with that many tuples; else new sub
+ * list was inserted */
+ /* array of inserted tuples follows */
+} ginxlogUpdateMeta;
+
+#define XLOG_GIN_INSERT_LISTPAGE 0x70
+
+typedef struct ginxlogInsertListPage
+{
+ BlockNumber rightlink;
+ int32 ntuples;
+ /* array of inserted tuples follows */
+} ginxlogInsertListPage;
+
+/*
+ * Backup Blk 0: metapage
+ * Backup Blk 1 to (ndeleted + 1): deleted pages
+ */
+
+#define XLOG_GIN_DELETE_LISTPAGE 0x80
+
+/*
+ * The WAL record for deleting list pages must contain a block reference to
+ * all the deleted pages, so the number of pages that can be deleted in one
+ * record is limited by XLR_MAX_BLOCK_ID. (block_id 0 is used for the
+ * metapage.)
+ */
+#define GIN_NDELETE_AT_ONCE Min(16, XLR_MAX_BLOCK_ID - 1)
+typedef struct ginxlogDeleteListPages
+{
+ GinMetaPageData metadata;
+ int32 ndeleted;
+} ginxlogDeleteListPages;
+
+extern void gin_redo(XLogReaderState *record);
+extern void gin_desc(StringInfo buf, XLogReaderState *record);
+extern const char *gin_identify(uint8 info);
+extern void gin_xlog_startup(void);
+extern void gin_xlog_cleanup(void);
+extern void gin_mask(char *pagedata, BlockNumber blkno);
+
+#endif /* GINXLOG_H */
diff --git a/src/include/access/gist.h b/src/include/access/gist.h
index 4343d6f74f..5824e90bda 100644
--- a/src/include/access/gist.h
+++ b/src/include/access/gist.h
@@ -6,7 +6,7 @@
* changes should be made with care.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/gist.h
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 1231585017..1ad4ed6da7 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -4,7 +4,7 @@
* private declarations for GiST -- declarations related to the
* internal implementation of GiST, not the public API
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/gist_private.h
@@ -17,7 +17,6 @@
#include "access/amapi.h"
#include "access/gist.h"
#include "access/itup.h"
-#include "access/xlogreader.h"
#include "fmgr.h"
#include "lib/pairingheap.h"
#include "storage/bufmgr.h"
@@ -107,15 +106,11 @@ typedef struct GISTSTATE
* upper index pages; this rule avoids doing extra work during a search that
* ends early due to LIMIT.
*
- * To perform an ordered search, we use an RBTree to manage the distance-order
- * queue. Each GISTSearchTreeItem stores all unvisited items of the same
- * distance; they are GISTSearchItems chained together via their next fields.
- *
- * In a non-ordered search (no order-by operators), the RBTree degenerates
- * to a single item, which we use as a queue of unvisited index pages only.
- * In this case matched heap items from the current index leaf page are
- * remembered in GISTScanOpaqueData.pageData[] and returned directly from
- * there, instead of building a separate GISTSearchItem for each one.
+ * To perform an ordered search, we use a pairing heap to manage the
+ * distance-order queue. In a non-ordered search (no order-by operators),
+ * we use it to return heap tuples before unvisited index pages, to
+ * ensure depth-first order, but all entries are otherwise considered
+ * equal.
*/
/* Individual heap tuple to be visited */
@@ -124,7 +119,7 @@ typedef struct GISTSearchHeapItem
ItemPointerData heapPtr;
bool recheck; /* T if quals must be rechecked */
bool recheckDistances; /* T if distances must be rechecked */
- IndexTuple ftup; /* data fetched back from the index, used in
+ HeapTuple recontup; /* data reconstructed from the index, used in
* index-only scans */
OffsetNumber offnum; /* track offset in page to mark tuple as
* LP_DEAD */
@@ -181,51 +176,7 @@ typedef struct GISTScanOpaqueData
typedef GISTScanOpaqueData *GISTScanOpaque;
-
-/* XLog stuff */
-
-#define XLOG_GIST_PAGE_UPDATE 0x00
- /* #define XLOG_GIST_NEW_ROOT 0x20 */ /* not used anymore */
-#define XLOG_GIST_PAGE_SPLIT 0x30
- /* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */
-#define XLOG_GIST_CREATE_INDEX 0x50
- /* #define XLOG_GIST_PAGE_DELETE 0x60 */ /* not used anymore */
-
-/*
- * Backup Blk 0: updated page.
- * Backup Blk 1: If this operation completes a page split, by inserting a
- * downlink for the split page, the left half of the split
- */
-typedef struct gistxlogPageUpdate
-{
- /* number of deleted offsets */
- uint16 ntodelete;
- uint16 ntoinsert;
-
- /*
- * In payload of blk 0 : 1. todelete OffsetNumbers 2. tuples to insert
- */
-} gistxlogPageUpdate;
-
-/*
- * Backup Blk 0: If this operation completes a page split, by inserting a
- * downlink for the split page, the left half of the split
- * Backup Blk 1 - npage: split pages (1 is the original page)
- */
-typedef struct gistxlogPageSplit
-{
- BlockNumber origrlink; /* rightlink of the page before split */
- GistNSN orignsn; /* NSN of the page before split */
- bool origleaf; /* was splitted page a leaf page? */
-
- uint16 npage; /* # of pages in the split */
- bool markfollowright; /* set F_FOLLOW_RIGHT flags */
-
- /*
- * follow: 1. gistxlogPage and array of IndexTupleData per page
- */
-} gistxlogPageSplit;
-
+/* despite the name, gistxlogPage is not part of any xlog record */
typedef struct gistxlogPage
{
BlockNumber blkno;
@@ -298,8 +249,8 @@ typedef struct
#define GIST_ROOT_BLKNO 0
/*
- * Before PostgreSQL 9.1, we used rely on so-called "invalid tuples" on inner
- * pages to finish crash recovery of incomplete page splits. If a crash
+ * Before PostgreSQL 9.1, we used to rely on so-called "invalid tuples" on
+ * inner pages to finish crash recovery of incomplete page splits. If a crash
* happened in the middle of a page split, so that the downlink pointers were
* not yet inserted, crash recovery inserted a special downlink pointer. The
* semantics of an invalid tuple was that it if you encounter one in a scan,
@@ -427,11 +378,11 @@ typedef struct GiSTOptions
} GiSTOptions;
/* gist.c */
-extern Datum gisthandler(PG_FUNCTION_ARGS);
extern void gistbuildempty(Relation index);
extern bool gistinsert(Relation r, Datum *values, bool *isnull,
ItemPointer ht_ctid, Relation heapRel,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
extern MemoryContext createTempGistContext(void);
extern GISTSTATE *initGISTstate(Relation index);
extern void freeGISTstate(GISTSTATE *giststate);
@@ -458,13 +409,6 @@ extern bool gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
extern SplitedPageLayout *gistSplit(Relation r, Page page, IndexTuple *itup,
int len, GISTSTATE *giststate);
-/* gistxlog.c */
-extern void gist_redo(XLogReaderState *record);
-extern void gist_desc(StringInfo buf, XLogReaderState *record);
-extern const char *gist_identify(uint8 info);
-extern void gist_xlog_startup(void);
-extern void gist_xlog_cleanup(void);
-
extern XLogRecPtr gistXLogUpdate(Buffer buffer,
OffsetNumber *todelete, int ntodelete,
IndexTuple *itup, int ntup,
@@ -533,7 +477,7 @@ extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len,
extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b);
extern void gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p,
OffsetNumber o, GISTENTRY *attdata, bool *isnull);
-extern IndexTuple gistFetchTuple(GISTSTATE *giststate, Relation r,
+extern HeapTuple gistFetchTuple(GISTSTATE *giststate, Relation r,
IndexTuple tuple);
extern void gistMakeUnionKey(GISTSTATE *giststate, int attno,
GISTENTRY *entry1, bool isnull1,
diff --git a/src/include/access/gistscan.h b/src/include/access/gistscan.h
index 4acaebdc9e..017740d14a 100644
--- a/src/include/access/gistscan.h
+++ b/src/include/access/gistscan.h
@@ -4,7 +4,7 @@
* routines defined in access/gist/gistscan.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/gistscan.h
diff --git a/src/include/access/gistxlog.h b/src/include/access/gistxlog.h
new file mode 100644
index 0000000000..3b126eca2a
--- /dev/null
+++ b/src/include/access/gistxlog.h
@@ -0,0 +1,69 @@
+/*-------------------------------------------------------------------------
+ *
+ * gistxlog.h
+ * gist xlog routines
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/access/gistxlog.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef GIST_XLOG_H
+#define GIST_XLOG_H
+
+#include "access/gist.h"
+#include "access/xlogreader.h"
+#include "lib/stringinfo.h"
+
+#define XLOG_GIST_PAGE_UPDATE 0x00
+ /* #define XLOG_GIST_NEW_ROOT 0x20 */ /* not used anymore */
+#define XLOG_GIST_PAGE_SPLIT 0x30
+ /* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */
+#define XLOG_GIST_CREATE_INDEX 0x50
+ /* #define XLOG_GIST_PAGE_DELETE 0x60 */ /* not used anymore */
+
+/*
+ * Backup Blk 0: updated page.
+ * Backup Blk 1: If this operation completes a page split, by inserting a
+ * downlink for the split page, the left half of the split
+ */
+typedef struct gistxlogPageUpdate
+{
+ /* number of deleted offsets */
+ uint16 ntodelete;
+ uint16 ntoinsert;
+
+ /*
+ * In payload of blk 0 : 1. todelete OffsetNumbers 2. tuples to insert
+ */
+} gistxlogPageUpdate;
+
+/*
+ * Backup Blk 0: If this operation completes a page split, by inserting a
+ * downlink for the split page, the left half of the split
+ * Backup Blk 1 - npage: split pages (1 is the original page)
+ */
+typedef struct gistxlogPageSplit
+{
+ BlockNumber origrlink; /* rightlink of the page before split */
+ GistNSN orignsn; /* NSN of the page before split */
+ bool origleaf; /* was splitted page a leaf page? */
+
+ uint16 npage; /* # of pages in the split */
+ bool markfollowright; /* set F_FOLLOW_RIGHT flags */
+
+ /*
+ * follow: 1. gistxlogPage and array of IndexTupleData per page
+ */
+} gistxlogPageSplit;
+
+extern void gist_redo(XLogReaderState *record);
+extern void gist_desc(StringInfo buf, XLogReaderState *record);
+extern const char *gist_identify(uint8 info);
+extern void gist_xlog_startup(void);
+extern void gist_xlog_cleanup(void);
+extern void gist_mask(char *pagedata, BlockNumber blkno);
+
+#endif
diff --git a/src/include/access/hash.h b/src/include/access/hash.h
index ce6a70687e..c608b03bb0 100644
--- a/src/include/access/hash.h
+++ b/src/include/access/hash.h
@@ -4,7 +4,7 @@
* header file for postgres hash access method implementation
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/hash.h
@@ -20,11 +20,11 @@
#include "access/amapi.h"
#include "access/itup.h"
#include "access/sdir.h"
-#include "access/xlogreader.h"
#include "fmgr.h"
#include "lib/stringinfo.h"
#include "storage/bufmgr.h"
#include "storage/lockdefs.h"
+#include "utils/hsearch.h"
#include "utils/relcache.h"
/*
@@ -33,37 +33,62 @@
*/
typedef uint32 Bucket;
+#define InvalidBucket ((Bucket) 0xFFFFFFFF)
+
#define BUCKET_TO_BLKNO(metap,B) \
- ((BlockNumber) ((B) + ((B) ? (metap)->hashm_spares[_hash_log2((B)+1)-1] : 0)) + 1)
+ ((BlockNumber) ((B) + ((B) ? (metap)->hashm_spares[_hash_spareindex((B)+1)-1] : 0)) + 1)
/*
* Special space for hash index pages.
*
- * hasho_flag tells us which type of page we're looking at. For
- * example, knowing overflow pages from bucket pages is necessary
- * information when you're deleting tuples from a page. If all the
- * tuples are deleted from an overflow page, the overflow is made
- * available to other buckets by calling _hash_freeovflpage(). If all
- * the tuples are deleted from a bucket page, no additional action is
- * necessary.
+ * hasho_flag's LH_PAGE_TYPE bits tell us which type of page we're looking at.
+ * Additional bits in the flag word are used for more transient purposes.
+ *
+ * To test a page's type, do (hasho_flag & LH_PAGE_TYPE) == LH_xxx_PAGE.
+ * However, we ensure that each used page type has a distinct bit so that
+ * we can OR together page types for uses such as the allowable-page-types
+ * argument of _hash_checkpage().
*/
#define LH_UNUSED_PAGE (0)
#define LH_OVERFLOW_PAGE (1 << 0)
#define LH_BUCKET_PAGE (1 << 1)
#define LH_BITMAP_PAGE (1 << 2)
#define LH_META_PAGE (1 << 3)
+#define LH_BUCKET_BEING_POPULATED (1 << 4)
+#define LH_BUCKET_BEING_SPLIT (1 << 5)
+#define LH_BUCKET_NEEDS_SPLIT_CLEANUP (1 << 6)
+#define LH_PAGE_HAS_DEAD_TUPLES (1 << 7)
+
+#define LH_PAGE_TYPE \
+ (LH_OVERFLOW_PAGE | LH_BUCKET_PAGE | LH_BITMAP_PAGE | LH_META_PAGE)
+/*
+ * In an overflow page, hasho_prevblkno stores the block number of the previous
+ * page in the bucket chain; in a bucket page, hasho_prevblkno stores the
+ * hashm_maxbucket value as of the last time the bucket was last split, or
+ * else as of the time the bucket was created. The latter convention is used
+ * to determine whether a cached copy of the metapage is too stale to be used
+ * without needing to lock or pin the metapage.
+ *
+ * hasho_nextblkno is always the block number of the next page in the
+ * bucket chain, or InvalidBlockNumber if there are no more such pages.
+ */
typedef struct HashPageOpaqueData
{
- BlockNumber hasho_prevblkno; /* previous ovfl (or bucket) blkno */
- BlockNumber hasho_nextblkno; /* next ovfl blkno */
+ BlockNumber hasho_prevblkno; /* see above */
+ BlockNumber hasho_nextblkno; /* see above */
Bucket hasho_bucket; /* bucket number this pg belongs to */
- uint16 hasho_flag; /* page type code, see above */
+ uint16 hasho_flag; /* page type code + flag bits, see above */
uint16 hasho_page_id; /* for identification of hash indexes */
} HashPageOpaqueData;
typedef HashPageOpaqueData *HashPageOpaque;
+#define H_NEEDS_SPLIT_CLEANUP(opaque) (((opaque)->hasho_flag & LH_BUCKET_NEEDS_SPLIT_CLEANUP) != 0)
+#define H_BUCKET_BEING_SPLIT(opaque) (((opaque)->hasho_flag & LH_BUCKET_BEING_SPLIT) != 0)
+#define H_BUCKET_BEING_POPULATED(opaque) (((opaque)->hasho_flag & LH_BUCKET_BEING_POPULATED) != 0)
+#define H_HAS_DEAD_TUPLES(opaque) (((opaque)->hasho_flag & LH_PAGE_HAS_DEAD_TUPLES) != 0)
+
/*
* The page ID is for the convenience of pg_filedump and similar utilities,
* which otherwise would have a hard time telling pages of different index
@@ -72,6 +97,13 @@ typedef HashPageOpaqueData *HashPageOpaque;
*/
#define HASHO_PAGE_ID 0xFF80
+typedef struct HashScanPosItem /* what we remember about each match */
+{
+ ItemPointerData heapTid; /* TID of referenced heap item */
+ OffsetNumber indexOffset; /* index item's location within page */
+} HashScanPosItem;
+
+
/*
* HashScanOpaqueData is private state for a hash index scan.
*/
@@ -81,19 +113,6 @@ typedef struct HashScanOpaqueData
uint32 hashso_sk_hash;
/*
- * By definition, a hash scan should be examining only one bucket. We
- * record the bucket number here as soon as it is known.
- */
- Bucket hashso_bucket;
- bool hashso_bucket_valid;
-
- /*
- * If we have a share lock on the bucket, we record it here. When
- * hashso_bucket_blkno is zero, we have no such lock.
- */
- BlockNumber hashso_bucket_blkno;
-
- /*
* We also want to remember which buffer we're currently examining in the
* scan. We keep the buffer pinned (but not locked) across hashgettuple
* calls, in order to avoid doing a ReadBuffer() for every tuple in the
@@ -101,11 +120,34 @@ typedef struct HashScanOpaqueData
*/
Buffer hashso_curbuf;
+ /* remember the buffer associated with primary bucket */
+ Buffer hashso_bucket_buf;
+
+ /*
+ * remember the buffer associated with primary bucket page of bucket being
+ * split. it is required during the scan of the bucket which is being
+ * populated during split operation.
+ */
+ Buffer hashso_split_bucket_buf;
+
/* Current position of the scan, as an index TID */
ItemPointerData hashso_curpos;
/* Current position of the scan, as a heap TID */
ItemPointerData hashso_heappos;
+
+ /* Whether scan starts on bucket being populated due to split */
+ bool hashso_buc_populated;
+
+ /*
+ * Whether scanning bucket being split? The value of this parameter is
+ * referred only when hashso_buc_populated is true.
+ */
+ bool hashso_buc_split;
+ /* info about killed items if any (killedItems is NULL if never used) */
+ HashScanPosItem *killedItems; /* tids and offset numbers of killed
+ * items */
+ int numKilled; /* number of currently stored items */
} HashScanOpaqueData;
typedef HashScanOpaqueData *HashScanOpaque;
@@ -117,10 +159,11 @@ typedef HashScanOpaqueData *HashScanOpaque;
#define HASH_METAPAGE 0 /* metapage is always block 0 */
#define HASH_MAGIC 0x6440640
-#define HASH_VERSION 2 /* 2 signifies only hash key value is stored */
+#define HASH_VERSION 3 /* 3 signifies multi-phased bucket allocation
+ * to reduce doubling */
/*
- * Spares[] holds the number of overflow pages currently allocated at or
+ * spares[] holds the number of overflow pages currently allocated at or
* before a certain splitpoint. For example, if spares[3] = 7 then there are
* 7 ovflpages before splitpoint 3 (compare BUCKET_TO_BLKNO macro). The
* value in spares[ovflpoint] increases as overflow pages are added at the
@@ -130,18 +173,33 @@ typedef HashScanOpaqueData *HashScanOpaque;
*
* ovflpages that have been recycled for reuse can be found by looking at
* bitmaps that are stored within ovflpages dedicated for the purpose.
- * The blknos of these bitmap pages are kept in bitmaps[]; nmaps is the
+ * The blknos of these bitmap pages are kept in mapp[]; nmaps is the
* number of currently existing bitmaps.
*
* The limitation on the size of spares[] comes from the fact that there's
* no point in having more than 2^32 buckets with only uint32 hashcodes.
+ * (Note: The value of HASH_MAX_SPLITPOINTS which is the size of spares[] is
+ * adjusted in such a way to accommodate multi phased allocation of buckets
+ * after HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE).
+ *
* There is no particular upper limit on the size of mapp[], other than
* needing to fit into the metapage. (With 8K block size, 128 bitmaps
- * limit us to 64 Gb of overflow space...)
+ * limit us to 64 GB of overflow space...)
*/
-#define HASH_MAX_SPLITPOINTS 32
#define HASH_MAX_BITMAPS 128
+#define HASH_SPLITPOINT_PHASE_BITS 2
+#define HASH_SPLITPOINT_PHASES_PER_GRP (1 << HASH_SPLITPOINT_PHASE_BITS)
+#define HASH_SPLITPOINT_PHASE_MASK (HASH_SPLITPOINT_PHASES_PER_GRP - 1)
+#define HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE 10
+
+/* defines max number of splitpoit phases a hash index can have */
+#define HASH_MAX_SPLITPOINT_GROUP 32
+#define HASH_MAX_SPLITPOINTS \
+ (((HASH_MAX_SPLITPOINT_GROUP - HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE) * \
+ HASH_SPLITPOINT_PHASES_PER_GRP) + \
+ HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE)
+
typedef struct HashMetaPageData
{
uint32 hashm_magic; /* magic no. for hash tables */
@@ -176,6 +234,8 @@ typedef HashMetaPageData *HashMetaPage;
sizeof(ItemIdData) - \
MAXALIGN(sizeof(HashPageOpaqueData)))
+#define INDEX_MOVED_BY_SPLIT_MASK 0x2000
+
#define HASH_MIN_FILLFACTOR 10
#define HASH_DEFAULT_FILLFACTOR 75
@@ -224,9 +284,6 @@ typedef HashMetaPageData *HashMetaPage;
#define HASH_WRITE BUFFER_LOCK_EXCLUSIVE
#define HASH_NOLOCK (-1)
-#define HASH_SHARE ShareLock
-#define HASH_EXCLUSIVE ExclusiveLock
-
/*
* Strategy number. There's only one valid strategy for hashing: equality.
*/
@@ -244,13 +301,13 @@ typedef HashMetaPageData *HashMetaPage;
/* public routines */
-extern Datum hashhandler(PG_FUNCTION_ARGS);
extern IndexBuildResult *hashbuild(Relation heap, Relation index,
struct IndexInfo *indexInfo);
extern void hashbuildempty(Relation index);
extern bool hashinsert(Relation rel, Datum *values, bool *isnull,
ItemPointer ht_ctid, Relation heapRel,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
extern bool hashgettuple(IndexScanDesc scan, ScanDirection dir);
extern int64 hashgetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
extern IndexScanDesc hashbeginscan(Relation rel, int nkeys, int norderbys);
@@ -266,55 +323,43 @@ extern IndexBulkDeleteResult *hashvacuumcleanup(IndexVacuumInfo *info,
extern bytea *hashoptions(Datum reloptions, bool validate);
extern bool hashvalidate(Oid opclassoid);
-/*
- * Datatype-specific hash functions in hashfunc.c.
- *
- * These support both hash indexes and hash joins.
- *
- * NOTE: some of these are also used by catcache operations, without
- * any direct connection to hash indexes. Also, the common hash_any
- * routine is also used by dynahash tables.
- */
-extern Datum hashchar(PG_FUNCTION_ARGS);
-extern Datum hashint2(PG_FUNCTION_ARGS);
-extern Datum hashint4(PG_FUNCTION_ARGS);
-extern Datum hashint8(PG_FUNCTION_ARGS);
-extern Datum hashoid(PG_FUNCTION_ARGS);
-extern Datum hashenum(PG_FUNCTION_ARGS);
-extern Datum hashfloat4(PG_FUNCTION_ARGS);
-extern Datum hashfloat8(PG_FUNCTION_ARGS);
-extern Datum hashoidvector(PG_FUNCTION_ARGS);
-extern Datum hashint2vector(PG_FUNCTION_ARGS);
-extern Datum hashname(PG_FUNCTION_ARGS);
-extern Datum hashtext(PG_FUNCTION_ARGS);
-extern Datum hashvarlena(PG_FUNCTION_ARGS);
extern Datum hash_any(register const unsigned char *k, register int keylen);
extern Datum hash_uint32(uint32 k);
/* private routines */
/* hashinsert.c */
-extern void _hash_doinsert(Relation rel, IndexTuple itup);
+extern void _hash_doinsert(Relation rel, IndexTuple itup, Relation heapRel);
extern OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf,
Size itemsize, IndexTuple itup);
+extern void _hash_pgaddmultitup(Relation rel, Buffer buf, IndexTuple *itups,
+ OffsetNumber *itup_offsets, uint16 nitups);
/* hashovfl.c */
-extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf);
-extern BlockNumber _hash_freeovflpage(Relation rel, Buffer ovflbuf,
- BufferAccessStrategy bstrategy);
-extern void _hash_initbitmap(Relation rel, HashMetaPage metap,
- BlockNumber blkno, ForkNumber forkNum);
+extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf, bool retain_pin);
+extern BlockNumber _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf,
+ Buffer wbuf, IndexTuple *itups, OffsetNumber *itup_offsets,
+ Size *tups_size, uint16 nitups, BufferAccessStrategy bstrategy);
+extern void _hash_initbitmapbuffer(Buffer buf, uint16 bmsize, bool initpage);
extern void _hash_squeezebucket(Relation rel,
Bucket bucket, BlockNumber bucket_blkno,
+ Buffer bucket_buf,
BufferAccessStrategy bstrategy);
+extern uint32 _hash_ovflblkno_to_bitno(HashMetaPage metap, BlockNumber ovflblkno);
/* hashpage.c */
-extern void _hash_getlock(Relation rel, BlockNumber whichlock, int access);
-extern bool _hash_try_getlock(Relation rel, BlockNumber whichlock, int access);
-extern void _hash_droplock(Relation rel, BlockNumber whichlock, int access);
extern Buffer _hash_getbuf(Relation rel, BlockNumber blkno,
int access, int flags);
+extern Buffer _hash_getbuf_with_condlock_cleanup(Relation rel,
+ BlockNumber blkno, int flags);
+extern HashMetaPage _hash_getcachedmetap(Relation rel, Buffer *metabuf,
+ bool force_refresh);
+extern Buffer _hash_getbucketbuf_from_hashkey(Relation rel, uint32 hashkey,
+ int access,
+ HashMetaPage *cachedmetap);
extern Buffer _hash_getinitbuf(Relation rel, BlockNumber blkno);
+extern void _hash_initbuf(Buffer buf, uint32 max_bucket, uint32 num_bucket,
+ uint32 flag, bool initpage);
extern Buffer _hash_getnewbuf(Relation rel, BlockNumber blkno,
ForkNumber forkNum);
extern Buffer _hash_getbuf_with_strategy(Relation rel, BlockNumber blkno,
@@ -322,19 +367,16 @@ extern Buffer _hash_getbuf_with_strategy(Relation rel, BlockNumber blkno,
BufferAccessStrategy bstrategy);
extern void _hash_relbuf(Relation rel, Buffer buf);
extern void _hash_dropbuf(Relation rel, Buffer buf);
-extern void _hash_wrtbuf(Relation rel, Buffer buf);
-extern void _hash_chgbufaccess(Relation rel, Buffer buf, int from_access,
- int to_access);
-extern uint32 _hash_metapinit(Relation rel, double num_tuples,
- ForkNumber forkNum);
+extern void _hash_dropscanbuf(Relation rel, HashScanOpaque so);
+extern uint32 _hash_init(Relation rel, double num_tuples,
+ ForkNumber forkNum);
+extern void _hash_init_metabuffer(Buffer buf, double num_tuples,
+ RegProcedure procid, uint16 ffactor, bool initpage);
extern void _hash_pageinit(Page page, Size size);
extern void _hash_expandtable(Relation rel, Buffer metabuf);
-
-/* hashscan.c */
-extern void _hash_regscan(IndexScanDesc scan);
-extern void _hash_dropscan(IndexScanDesc scan);
-extern bool _hash_has_active_scan(Relation rel, Bucket bucket);
-extern void ReleaseResources_hash(void);
+extern void _hash_finish_split(Relation rel, Buffer metabuf, Buffer obuf,
+ Bucket obucket, uint32 maxbucket, uint32 highmask,
+ uint32 lowmask);
/* hashsearch.c */
extern bool _hash_next(IndexScanDesc scan, ScanDirection dir);
@@ -348,7 +390,7 @@ extern HSpool *_h_spoolinit(Relation heap, Relation index, uint32 num_buckets);
extern void _h_spooldestroy(HSpool *hspool);
extern void _h_spool(HSpool *hspool, ItemPointer self,
Datum *values, bool *isnull);
-extern void _h_indexbuild(HSpool *hspool);
+extern void _h_indexbuild(HSpool *hspool, Relation heapRel);
/* hashutil.c */
extern bool _hash_checkqual(IndexScanDesc scan, IndexTuple itup);
@@ -357,6 +399,8 @@ extern uint32 _hash_datum2hashkey_type(Relation rel, Datum key, Oid keytype);
extern Bucket _hash_hashkey2bucket(uint32 hashkey, uint32 maxbucket,
uint32 highmask, uint32 lowmask);
extern uint32 _hash_log2(uint32 num);
+extern uint32 _hash_spareindex(uint32 num_bucket);
+extern uint32 _hash_get_totalbuckets(uint32 splitpoint_phase);
extern void _hash_checkpage(Relation rel, Buffer buf, int flags);
extern uint32 _hash_get_indextuple_hashkey(IndexTuple itup);
extern bool _hash_convert_tuple(Relation index,
@@ -364,11 +408,20 @@ extern bool _hash_convert_tuple(Relation index,
Datum *index_values, bool *index_isnull);
extern OffsetNumber _hash_binsearch(Page page, uint32 hash_value);
extern OffsetNumber _hash_binsearch_last(Page page, uint32 hash_value);
+extern BlockNumber _hash_get_oldblock_from_newbucket(Relation rel, Bucket new_bucket);
+extern BlockNumber _hash_get_newblock_from_oldbucket(Relation rel, Bucket old_bucket);
+extern Bucket _hash_get_newbucket_from_oldbucket(Relation rel, Bucket old_bucket,
+ uint32 lowmask, uint32 maxbucket);
+extern void _hash_kill_items(IndexScanDesc scan);
/* hash.c */
-extern void hash_redo(XLogReaderState *record);
-extern void hash_desc(StringInfo buf, XLogReaderState *record);
-extern const char *hash_identify(uint8 info);
+extern void hashbucketcleanup(Relation rel, Bucket cur_bucket,
+ Buffer bucket_buf, BlockNumber bucket_blkno,
+ BufferAccessStrategy bstrategy,
+ uint32 maxbucket, uint32 highmask, uint32 lowmask,
+ double *tuples_removed, double *num_index_tuples,
+ bool bucket_has_garbage,
+ IndexBulkDeleteCallback callback, void *callback_state);
#ifdef PGXC
extern Datum compute_hash(Oid type, Datum value, char locator);
diff --git a/src/include/access/hash_xlog.h b/src/include/access/hash_xlog.h
new file mode 100644
index 0000000000..d4a6a71ca7
--- /dev/null
+++ b/src/include/access/hash_xlog.h
@@ -0,0 +1,282 @@
+/*-------------------------------------------------------------------------
+ *
+ * hash_xlog.h
+ * header file for Postgres hash AM implementation
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/access/hash_xlog.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef HASH_XLOG_H
+#define HASH_XLOG_H
+
+#include "access/xlogreader.h"
+#include "lib/stringinfo.h"
+#include "storage/off.h"
+
+/* Number of buffers required for XLOG_HASH_SQUEEZE_PAGE operation */
+#define HASH_XLOG_FREE_OVFL_BUFS 6
+
+/*
+ * XLOG records for hash operations
+ */
+#define XLOG_HASH_INIT_META_PAGE 0x00 /* initialize the meta page */
+#define XLOG_HASH_INIT_BITMAP_PAGE 0x10 /* initialize the bitmap page */
+#define XLOG_HASH_INSERT 0x20 /* add index tuple without split */
+#define XLOG_HASH_ADD_OVFL_PAGE 0x30 /* add overflow page */
+#define XLOG_HASH_SPLIT_ALLOCATE_PAGE 0x40 /* allocate new page for split */
+#define XLOG_HASH_SPLIT_PAGE 0x50 /* split page */
+#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split
+ * operation */
+#define XLOG_HASH_MOVE_PAGE_CONTENTS 0x70 /* remove tuples from one page
+ * and add to another page */
+#define XLOG_HASH_SQUEEZE_PAGE 0x80 /* add tuples to one of the previous
+ * pages in chain and free the ovfl
+ * page */
+#define XLOG_HASH_DELETE 0x90 /* delete index tuples from a page */
+#define XLOG_HASH_SPLIT_CLEANUP 0xA0 /* clear split-cleanup flag in primary
+ * bucket page after deleting tuples
+ * that are moved due to split */
+#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after
+ * vacuum */
+
+#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from
+ * index page */
+
+/*
+ * xl_hash_split_allocate_page flag values, 8 bits are available.
+ */
+#define XLH_SPLIT_META_UPDATE_MASKS (1<<0)
+#define XLH_SPLIT_META_UPDATE_SPLITPOINT (1<<1)
+
+/*
+ * This is what we need to know about a HASH index create.
+ *
+ * Backup block 0: metapage
+ */
+typedef struct xl_hash_createidx
+{
+ double num_tuples;
+ RegProcedure procid;
+ uint16 ffactor;
+} xl_hash_createidx;
+#define SizeOfHashCreateIdx (offsetof(xl_hash_createidx, ffactor) + sizeof(uint16))
+
+/*
+ * This is what we need to know about simple (without split) insert.
+ *
+ * This data record is used for XLOG_HASH_INSERT
+ *
+ * Backup Blk 0: original page (data contains the inserted tuple)
+ * Backup Blk 1: metapage (HashMetaPageData)
+ */
+typedef struct xl_hash_insert
+{
+ OffsetNumber offnum;
+} xl_hash_insert;
+
+#define SizeOfHashInsert (offsetof(xl_hash_insert, offnum) + sizeof(OffsetNumber))
+
+/*
+ * This is what we need to know about addition of overflow page.
+ *
+ * This data record is used for XLOG_HASH_ADD_OVFL_PAGE
+ *
+ * Backup Blk 0: newly allocated overflow page
+ * Backup Blk 1: page before new overflow page in the bucket chain
+ * Backup Blk 2: bitmap page
+ * Backup Blk 3: new bitmap page
+ * Backup Blk 4: metapage
+ */
+typedef struct xl_hash_add_ovfl_page
+{
+ uint16 bmsize;
+ bool bmpage_found;
+} xl_hash_add_ovfl_page;
+
+#define SizeOfHashAddOvflPage \
+ (offsetof(xl_hash_add_ovfl_page, bmpage_found) + sizeof(bool))
+
+/*
+ * This is what we need to know about allocating a page for split.
+ *
+ * This data record is used for XLOG_HASH_SPLIT_ALLOCATE_PAGE
+ *
+ * Backup Blk 0: page for old bucket
+ * Backup Blk 1: page for new bucket
+ * Backup Blk 2: metapage
+ */
+typedef struct xl_hash_split_allocate_page
+{
+ uint32 new_bucket;
+ uint16 old_bucket_flag;
+ uint16 new_bucket_flag;
+ uint8 flags;
+} xl_hash_split_allocate_page;
+
+#define SizeOfHashSplitAllocPage \
+ (offsetof(xl_hash_split_allocate_page, flags) + sizeof(uint8))
+
+/*
+ * This is what we need to know about completing the split operation.
+ *
+ * This data record is used for XLOG_HASH_SPLIT_COMPLETE
+ *
+ * Backup Blk 0: page for old bucket
+ * Backup Blk 1: page for new bucket
+ */
+typedef struct xl_hash_split_complete
+{
+ uint16 old_bucket_flag;
+ uint16 new_bucket_flag;
+} xl_hash_split_complete;
+
+#define SizeOfHashSplitComplete \
+ (offsetof(xl_hash_split_complete, new_bucket_flag) + sizeof(uint16))
+
+/*
+ * This is what we need to know about move page contents required during
+ * squeeze operation.
+ *
+ * This data record is used for XLOG_HASH_MOVE_PAGE_CONTENTS
+ *
+ * Backup Blk 0: bucket page
+ * Backup Blk 1: page containing moved tuples
+ * Backup Blk 2: page from which tuples will be removed
+ */
+typedef struct xl_hash_move_page_contents
+{
+ uint16 ntups;
+ bool is_prim_bucket_same_wrt; /* TRUE if the page to which
+ * tuples are moved is same as
+ * primary bucket page */
+} xl_hash_move_page_contents;
+
+#define SizeOfHashMovePageContents \
+ (offsetof(xl_hash_move_page_contents, is_prim_bucket_same_wrt) + sizeof(bool))
+
+/*
+ * This is what we need to know about the squeeze page operation.
+ *
+ * This data record is used for XLOG_HASH_SQUEEZE_PAGE
+ *
+ * Backup Blk 0: page containing tuples moved from freed overflow page
+ * Backup Blk 1: freed overflow page
+ * Backup Blk 2: page previous to the freed overflow page
+ * Backup Blk 3: page next to the freed overflow page
+ * Backup Blk 4: bitmap page containing info of freed overflow page
+ * Backup Blk 5: meta page
+ */
+typedef struct xl_hash_squeeze_page
+{
+ BlockNumber prevblkno;
+ BlockNumber nextblkno;
+ uint16 ntups;
+ bool is_prim_bucket_same_wrt; /* TRUE if the page to which
+ * tuples are moved is same as
+ * primary bucket page */
+ bool is_prev_bucket_same_wrt; /* TRUE if the page to which
+ * tuples are moved is the
+ * page previous to the freed
+ * overflow page */
+} xl_hash_squeeze_page;
+
+#define SizeOfHashSqueezePage \
+ (offsetof(xl_hash_squeeze_page, is_prev_bucket_same_wrt) + sizeof(bool))
+
+/*
+ * This is what we need to know about the deletion of index tuples from a page.
+ *
+ * This data record is used for XLOG_HASH_DELETE
+ *
+ * Backup Blk 0: primary bucket page
+ * Backup Blk 1: page from which tuples are deleted
+ */
+typedef struct xl_hash_delete
+{
+ bool clear_dead_marking; /* TRUE if this operation clears
+ * LH_PAGE_HAS_DEAD_TUPLES flag */
+ bool is_primary_bucket_page; /* TRUE if the operation is for
+ * primary bucket page */
+} xl_hash_delete;
+
+#define SizeOfHashDelete (offsetof(xl_hash_delete, is_primary_bucket_page) + sizeof(bool))
+
+/*
+ * This is what we need for metapage update operation.
+ *
+ * This data record is used for XLOG_HASH_UPDATE_META_PAGE
+ *
+ * Backup Blk 0: meta page
+ */
+typedef struct xl_hash_update_meta_page
+{
+ double ntuples;
+} xl_hash_update_meta_page;
+
+#define SizeOfHashUpdateMetaPage \
+ (offsetof(xl_hash_update_meta_page, ntuples) + sizeof(double))
+
+/*
+ * This is what we need to initialize metapage.
+ *
+ * This data record is used for XLOG_HASH_INIT_META_PAGE
+ *
+ * Backup Blk 0: meta page
+ */
+typedef struct xl_hash_init_meta_page
+{
+ double num_tuples;
+ RegProcedure procid;
+ uint16 ffactor;
+} xl_hash_init_meta_page;
+
+#define SizeOfHashInitMetaPage \
+ (offsetof(xl_hash_init_meta_page, ffactor) + sizeof(uint16))
+
+/*
+ * This is what we need to initialize bitmap page.
+ *
+ * This data record is used for XLOG_HASH_INIT_BITMAP_PAGE
+ *
+ * Backup Blk 0: bitmap page
+ * Backup Blk 1: meta page
+ */
+typedef struct xl_hash_init_bitmap_page
+{
+ uint16 bmsize;
+} xl_hash_init_bitmap_page;
+
+#define SizeOfHashInitBitmapPage \
+ (offsetof(xl_hash_init_bitmap_page, bmsize) + sizeof(uint16))
+
+/*
+ * This is what we need for index tuple deletion and to
+ * update the meta page.
+ *
+ * This data record is used for XLOG_HASH_VACUUM_ONE_PAGE
+ *
+ * Backup Blk 0: bucket page
+ * Backup Blk 1: meta page
+ */
+typedef struct xl_hash_vacuum_one_page
+{
+ RelFileNode hnode;
+ int ntuples;
+
+ /* TARGET OFFSET NUMBERS FOLLOW AT THE END */
+} xl_hash_vacuum_one_page;
+
+#define SizeOfHashVacuumOnePage \
+ (offsetof(xl_hash_vacuum_one_page, ntuples) + sizeof(int))
+
+extern void hash_redo(XLogReaderState *record);
+extern void hash_desc(StringInfo buf, XLogReaderState *record);
+extern const char *hash_identify(uint8 info);
+extern void hash_mask(char *pagedata, BlockNumber blkno);
+
+#endif /* HASH_XLOG_H */
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index b3a595c67e..7e85510d2f 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -4,7 +4,7 @@
* POSTGRES heap access method definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/heapam.h
@@ -19,7 +19,7 @@
#include "nodes/lockoptions.h"
#include "nodes/primnodes.h"
#include "storage/bufpage.h"
-#include "storage/lock.h"
+#include "storage/lockdefs.h"
#include "utils/relcache.h"
#include "utils/snapshot.h"
@@ -147,6 +147,7 @@ extern void setLastTid(const ItemPointer tid);
extern BulkInsertState GetBulkInsertState(void);
extern void FreeBulkInsertState(BulkInsertState);
+extern void ReleaseBulkInsertStatePin(BulkInsertState bistate);
extern Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid,
int options, BulkInsertState bistate);
@@ -178,6 +179,7 @@ extern void simple_heap_update(Relation relation, ItemPointer otid,
HeapTuple tup);
extern void heap_sync(Relation relation);
+extern void heap_update_snapshot(HeapScanDesc scan, Snapshot snapshot);
/* in heap/pruneheap.c */
extern void heap_page_prune_opt(Relation relation, Buffer buffer);
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index 06a82426bb..b285f172aa 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -4,7 +4,7 @@
* POSTGRES heap access XLOG definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/heapam_xlog.h
@@ -373,6 +373,7 @@ extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple,
extern void heap_redo(XLogReaderState *record);
extern void heap_desc(StringInfo buf, XLogReaderState *record);
extern const char *heap_identify(uint8 info);
+extern void heap_mask(char *pagedata, BlockNumber blkno);
extern void heap2_redo(XLogReaderState *record);
extern void heap2_desc(StringInfo buf, XLogReaderState *record);
extern const char *heap2_identify(uint8 info);
diff --git a/src/include/access/hio.h b/src/include/access/hio.h
index a174b34c96..2824f23218 100644
--- a/src/include/access/hio.h
+++ b/src/include/access/hio.h
@@ -4,7 +4,7 @@
* POSTGRES heap access method input/output definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/hio.h
diff --git a/src/include/access/htup.h b/src/include/access/htup.h
index 01d5a6f926..1d31b5f1c2 100644
--- a/src/include/access/htup.h
+++ b/src/include/access/htup.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/htup.h
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h
index d7e5fad11e..e365f4f2b4 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -4,7 +4,7 @@
* POSTGRES heap tuple header definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/htup_details.h
@@ -165,7 +165,7 @@ struct HeapTupleHeaderData
/* MORE DATA FOLLOWS AT END OF STRUCT */
};
-/* typedef appears in tupbasics.h */
+/* typedef appears in htup.h */
#define SizeofHeapTupleHeader offsetof(HeapTupleHeaderData, t_bits)
@@ -237,8 +237,8 @@ struct HeapTupleHeaderData
*/
#define HEAP_LOCKED_UPGRADED(infomask) \
( \
- ((infomask) & HEAP_XMAX_IS_MULTI) && \
- ((infomask) & HEAP_XMAX_LOCK_ONLY) && \
+ ((infomask) & HEAP_XMAX_IS_MULTI) != 0 && \
+ ((infomask) & HEAP_XMAX_LOCK_ONLY) != 0 && \
(((infomask) & (HEAP_XMAX_EXCL_LOCK | HEAP_XMAX_KEYSHR_LOCK)) == 0) \
)
@@ -317,7 +317,7 @@ struct HeapTupleHeaderData
#define HeapTupleHeaderXminCommitted(tup) \
( \
- (tup)->t_infomask & HEAP_XMIN_COMMITTED \
+ ((tup)->t_infomask & HEAP_XMIN_COMMITTED) != 0 \
)
#define HeapTupleHeaderXminInvalid(tup) \
@@ -422,7 +422,7 @@ do { \
#define HeapTupleHeaderIsSpeculative(tup) \
( \
- (tup)->t_ctid.ip_posid == SpecTokenOffsetNumber \
+ (ItemPointerGetOffsetNumberNoCheck(&(tup)->t_ctid) == SpecTokenOffsetNumber) \
)
#define HeapTupleHeaderGetSpeculativeToken(tup) \
@@ -501,7 +501,7 @@ do { \
#define HeapTupleHeaderIsHeapOnly(tup) \
( \
- (tup)->t_infomask2 & HEAP_ONLY_TUPLE \
+ ((tup)->t_infomask2 & HEAP_ONLY_TUPLE) != 0 \
)
#define HeapTupleHeaderSetHeapOnly(tup) \
@@ -516,7 +516,7 @@ do { \
#define HeapTupleHeaderHasMatch(tup) \
( \
- (tup)->t_infomask2 & HEAP_TUPLE_HAS_MATCH \
+ ((tup)->t_infomask2 & HEAP_TUPLE_HAS_MATCH) != 0 \
)
#define HeapTupleHeaderSetMatch(tup) \
@@ -805,6 +805,12 @@ extern HeapTuple heap_modify_tuple(HeapTuple tuple,
Datum *replValues,
bool *replIsnull,
bool *doReplace);
+extern HeapTuple heap_modify_tuple_by_cols(HeapTuple tuple,
+ TupleDesc tupleDesc,
+ int nCols,
+ int *replCols,
+ Datum *replValues,
+ bool *replIsnull);
extern void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc,
Datum *values, bool *isnull);
extern void heap_freetuple(HeapTuple htup);
diff --git a/src/include/access/itup.h b/src/include/access/itup.h
index 8350fa0084..e9ec8e27e2 100644
--- a/src/include/access/itup.h
+++ b/src/include/access/itup.h
@@ -4,7 +4,7 @@
* POSTGRES index tuple definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/itup.h
@@ -63,7 +63,7 @@ typedef IndexAttributeBitMapData *IndexAttributeBitMap;
* t_info manipulation macros
*/
#define INDEX_SIZE_MASK 0x1FFF
-/* bit 0x2000 is not used at present */
+/* bit 0x2000 is reserved for index-AM specific usage */
#define INDEX_VAR_MASK 0x4000
#define INDEX_NULL_MASK 0x8000
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index ab5de627d2..85997a41fa 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -3,7 +3,7 @@
*
* PostgreSQL multi-transaction-log manager
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/multixact.h
@@ -127,7 +127,8 @@ extern void StartupMultiXact(void);
extern void TrimMultiXact(void);
extern void ShutdownMultiXact(void);
extern void SetMultiXactIdLimit(MultiXactId oldest_datminmxid,
- Oid oldest_datoid);
+ Oid oldest_datoid,
+ bool is_startup);
extern void MultiXactGetCheckptMulti(bool is_shutdown,
MultiXactId *nextMulti,
MultiXactOffset *nextMultiOffset,
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index c580f51f7f..15771ce9e0 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -4,7 +4,7 @@
* header file for postgres btree access method implementation.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/nbtree.h
@@ -151,9 +151,8 @@ typedef struct BTMetaPageData
* within a level). - vadim 04/09/97
*/
#define BTTidSame(i1, i2) \
- ( (i1).ip_blkid.bi_hi == (i2).ip_blkid.bi_hi && \
- (i1).ip_blkid.bi_lo == (i2).ip_blkid.bi_lo && \
- (i1).ip_posid == (i2).ip_posid )
+ ((ItemPointerGetBlockNumber(&(i1)) == ItemPointerGetBlockNumber(&(i2))) && \
+ (ItemPointerGetOffsetNumber(&(i1)) == ItemPointerGetOffsetNumber(&(i2))))
#define BTEntrySame(i1, i2) \
BTTidSame((i1)->t_tid, (i2)->t_tid)
@@ -177,6 +176,7 @@ typedef struct BTMetaPageData
#define P_ISLEAF(opaque) ((opaque)->btpo_flags & BTP_LEAF)
#define P_ISROOT(opaque) ((opaque)->btpo_flags & BTP_ROOT)
#define P_ISDELETED(opaque) ((opaque)->btpo_flags & BTP_DELETED)
+#define P_ISMETA(opaque) ((opaque)->btpo_flags & BTP_META)
#define P_ISHALFDEAD(opaque) ((opaque)->btpo_flags & BTP_HALF_DEAD)
#define P_IGNORE(opaque) ((opaque)->btpo_flags & (BTP_DELETED|BTP_HALF_DEAD))
#define P_HAS_GARBAGE(opaque) ((opaque)->btpo_flags & BTP_HAS_GARBAGE)
@@ -204,232 +204,6 @@ typedef struct BTMetaPageData
#define P_FIRSTKEY ((OffsetNumber) 2)
#define P_FIRSTDATAKEY(opaque) (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY)
-/*
- * XLOG records for btree operations
- *
- * XLOG allows to store some information in high 4 bits of log
- * record xl_info field
- */
-#define XLOG_BTREE_INSERT_LEAF 0x00 /* add index tuple without split */
-#define XLOG_BTREE_INSERT_UPPER 0x10 /* same, on a non-leaf page */
-#define XLOG_BTREE_INSERT_META 0x20 /* same, plus update metapage */
-#define XLOG_BTREE_SPLIT_L 0x30 /* add index tuple with split */
-#define XLOG_BTREE_SPLIT_R 0x40 /* as above, new item on right */
-#define XLOG_BTREE_SPLIT_L_ROOT 0x50 /* add tuple with split of root */
-#define XLOG_BTREE_SPLIT_R_ROOT 0x60 /* as above, new item on right */
-#define XLOG_BTREE_DELETE 0x70 /* delete leaf index tuples for a page */
-#define XLOG_BTREE_UNLINK_PAGE 0x80 /* delete a half-dead page */
-#define XLOG_BTREE_UNLINK_PAGE_META 0x90 /* same, and update metapage */
-#define XLOG_BTREE_NEWROOT 0xA0 /* new root page */
-#define XLOG_BTREE_MARK_PAGE_HALFDEAD 0xB0 /* mark a leaf as half-dead */
-#define XLOG_BTREE_VACUUM 0xC0 /* delete entries on a page during
- * vacuum */
-#define XLOG_BTREE_REUSE_PAGE 0xD0 /* old page is about to be reused from
- * FSM */
-
-/*
- * All that we need to regenerate the meta-data page
- */
-typedef struct xl_btree_metadata
-{
- BlockNumber root;
- uint32 level;
- BlockNumber fastroot;
- uint32 fastlevel;
-} xl_btree_metadata;
-
-/*
- * This is what we need to know about simple (without split) insert.
- *
- * This data record is used for INSERT_LEAF, INSERT_UPPER, INSERT_META.
- * Note that INSERT_META implies it's not a leaf page.
- *
- * Backup Blk 0: original page (data contains the inserted tuple)
- * Backup Blk 1: child's left sibling, if INSERT_UPPER or INSERT_META
- * Backup Blk 2: xl_btree_metadata, if INSERT_META
- */
-typedef struct xl_btree_insert
-{
- OffsetNumber offnum;
-} xl_btree_insert;
-
-#define SizeOfBtreeInsert (offsetof(xl_btree_insert, offnum) + sizeof(OffsetNumber))
-
-/*
- * On insert with split, we save all the items going into the right sibling
- * so that we can restore it completely from the log record. This way takes
- * less xlog space than the normal approach, because if we did it standardly,
- * XLogInsert would almost always think the right page is new and store its
- * whole page image. The left page, however, is handled in the normal
- * incremental-update fashion.
- *
- * Note: the four XLOG_BTREE_SPLIT xl_info codes all use this data record.
- * The _L and _R variants indicate whether the inserted tuple went into the
- * left or right split page (and thus, whether newitemoff and the new item
- * are stored or not). The _ROOT variants indicate that we are splitting
- * the root page, and thus that a newroot record rather than an insert or
- * split record should follow. Note that a split record never carries a
- * metapage update --- we'll do that in the parent-level update.
- *
- * Backup Blk 0: original page / new left page
- *
- * The left page's data portion contains the new item, if it's the _L variant.
- * (In the _R variants, the new item is one of the right page's tuples.)
- * If level > 0, an IndexTuple representing the HIKEY of the left page
- * follows. We don't need this on leaf pages, because it's the same as the
- * leftmost key in the new right page.
- *
- * Backup Blk 1: new right page
- *
- * The right page's data portion contains the right page's tuples in the
- * form used by _bt_restore_page.
- *
- * Backup Blk 2: next block (orig page's rightlink), if any
- * Backup Blk 3: child's left sibling, if non-leaf split
- */
-typedef struct xl_btree_split
-{
- uint32 level; /* tree level of page being split */
- OffsetNumber firstright; /* first item moved to right page */
- OffsetNumber newitemoff; /* new item's offset (if placed on left page) */
-} xl_btree_split;
-
-#define SizeOfBtreeSplit (offsetof(xl_btree_split, newitemoff) + sizeof(OffsetNumber))
-
-/*
- * This is what we need to know about delete of individual leaf index tuples.
- * The WAL record can represent deletion of any number of index tuples on a
- * single index page when *not* executed by VACUUM.
- *
- * Backup Blk 0: index page
- */
-typedef struct xl_btree_delete
-{
- RelFileNode hnode; /* RelFileNode of the heap the index currently
- * points at */
- int nitems;
-
- /* TARGET OFFSET NUMBERS FOLLOW AT THE END */
-} xl_btree_delete;
-
-#define SizeOfBtreeDelete (offsetof(xl_btree_delete, nitems) + sizeof(int))
-
-/*
- * This is what we need to know about page reuse within btree.
- */
-typedef struct xl_btree_reuse_page
-{
- RelFileNode node;
- BlockNumber block;
- TransactionId latestRemovedXid;
-} xl_btree_reuse_page;
-
-#define SizeOfBtreeReusePage (sizeof(xl_btree_reuse_page))
-
-/*
- * This is what we need to know about vacuum of individual leaf index tuples.
- * The WAL record can represent deletion of any number of index tuples on a
- * single index page when executed by VACUUM.
- *
- * For MVCC scans, lastBlockVacuumed will be set to InvalidBlockNumber.
- * For a non-MVCC index scans there is an additional correctness requirement
- * for applying these changes during recovery, which is that we must do one
- * of these two things for every block in the index:
- * * lock the block for cleanup and apply any required changes
- * * EnsureBlockUnpinned()
- * The purpose of this is to ensure that no index scans started before we
- * finish scanning the index are still running by the time we begin to remove
- * heap tuples.
- *
- * Any changes to any one block are registered on just one WAL record. All
- * blocks that we need to run EnsureBlockUnpinned() are listed as a block range
- * starting from the last block vacuumed through until this one. Individual
- * block numbers aren't given.
- *
- * Note that the *last* WAL record in any vacuum of an index is allowed to
- * have a zero length array of offsets. Earlier records must have at least one.
- */
-typedef struct xl_btree_vacuum
-{
- BlockNumber lastBlockVacuumed;
-
- /* TARGET OFFSET NUMBERS FOLLOW */
-} xl_btree_vacuum;
-
-#define SizeOfBtreeVacuum (offsetof(xl_btree_vacuum, lastBlockVacuumed) + sizeof(BlockNumber))
-
-/*
- * This is what we need to know about marking an empty branch for deletion.
- * The target identifies the tuple removed from the parent page (note that we
- * remove this tuple's downlink and the *following* tuple's key). Note that
- * the leaf page is empty, so we don't need to store its content --- it is
- * just reinitialized during recovery using the rest of the fields.
- *
- * Backup Blk 0: leaf block
- * Backup Blk 1: top parent
- */
-typedef struct xl_btree_mark_page_halfdead
-{
- OffsetNumber poffset; /* deleted tuple id in parent page */
-
- /* information needed to recreate the leaf page: */
- BlockNumber leafblk; /* leaf block ultimately being deleted */
- BlockNumber leftblk; /* leaf block's left sibling, if any */
- BlockNumber rightblk; /* leaf block's right sibling */
- BlockNumber topparent; /* topmost internal page in the branch */
-} xl_btree_mark_page_halfdead;
-
-#define SizeOfBtreeMarkPageHalfDead (offsetof(xl_btree_mark_page_halfdead, topparent) + sizeof(BlockNumber))
-
-/*
- * This is what we need to know about deletion of a btree page. Note we do
- * not store any content for the deleted page --- it is just rewritten as empty
- * during recovery, apart from resetting the btpo.xact.
- *
- * Backup Blk 0: target block being deleted
- * Backup Blk 1: target block's left sibling, if any
- * Backup Blk 2: target block's right sibling
- * Backup Blk 3: leaf block (if different from target)
- * Backup Blk 4: metapage (if rightsib becomes new fast root)
- */
-typedef struct xl_btree_unlink_page
-{
- BlockNumber leftsib; /* target block's left sibling, if any */
- BlockNumber rightsib; /* target block's right sibling */
-
- /*
- * Information needed to recreate the leaf page, when target is an
- * internal page.
- */
- BlockNumber leafleftsib;
- BlockNumber leafrightsib;
- BlockNumber topparent; /* next child down in the branch */
-
- TransactionId btpo_xact; /* value of btpo.xact for use in recovery */
- /* xl_btree_metadata FOLLOWS IF XLOG_BTREE_UNLINK_PAGE_META */
-} xl_btree_unlink_page;
-
-#define SizeOfBtreeUnlinkPage (offsetof(xl_btree_unlink_page, btpo_xact) + sizeof(TransactionId))
-
-/*
- * New root log record. There are zero tuples if this is to establish an
- * empty root, or two if it is the result of splitting an old root.
- *
- * Note that although this implies rewriting the metadata page, we don't need
- * an xl_btree_metadata record --- the rootblk and level are sufficient.
- *
- * Backup Blk 0: new root page (2 tuples as payload, if splitting old root)
- * Backup Blk 1: left child (if splitting an old root)
- * Backup Blk 2: metapage
- */
-typedef struct xl_btree_newroot
-{
- BlockNumber rootblk; /* location of new root (redundant with blk 0) */
- uint32 level; /* its tree level */
-} xl_btree_newroot;
-
-#define SizeOfBtreeNewroot (offsetof(xl_btree_newroot, level) + sizeof(uint32))
-
/*
* Operator strategy numbers for B-tree have been moved to access/stratnum.h,
@@ -609,6 +383,8 @@ typedef struct BTScanOpaqueData
ScanKey arrayKeyData; /* modified copy of scan->keyData */
int numArrayKeys; /* number of equality-type array keys (-1 if
* there are any unsatisfiable array keys) */
+ int arrayKeyCount; /* count indicating number of array scan keys
+ * processed */
BTArrayKeyInfo *arrayKeys; /* info about each equality-type array key */
MemoryContext arrayContext; /* scan-lifespan context for array data */
@@ -652,20 +428,23 @@ typedef BTScanOpaqueData *BTScanOpaque;
#define SK_BT_NULLS_FIRST (INDOPTION_NULLS_FIRST << SK_BT_INDOPTION_SHIFT)
/*
- * prototypes for functions in nbtree.c (external entry points for btree)
+ * external entry points for btree, in nbtree.c
*/
-extern Datum bthandler(PG_FUNCTION_ARGS);
extern IndexBuildResult *btbuild(Relation heap, Relation index,
struct IndexInfo *indexInfo);
extern void btbuildempty(Relation index);
extern bool btinsert(Relation rel, Datum *values, bool *isnull,
ItemPointer ht_ctid, Relation heapRel,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
extern IndexScanDesc btbeginscan(Relation rel, int nkeys, int norderbys);
+extern Size btestimateparallelscan(void);
+extern void btinitparallelscan(void *target);
extern bool btgettuple(IndexScanDesc scan, ScanDirection dir);
extern int64 btgetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
extern void btrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
ScanKey orderbys, int norderbys);
+extern void btparallelrescan(IndexScanDesc scan);
extern void btendscan(IndexScanDesc scan);
extern void btmarkpos(IndexScanDesc scan);
extern void btrestrpos(IndexScanDesc scan);
@@ -678,6 +457,14 @@ extern IndexBulkDeleteResult *btvacuumcleanup(IndexVacuumInfo *info,
extern bool btcanreturn(Relation index, int attno);
/*
+ * prototypes for internal functions in nbtree.c
+ */
+extern bool _bt_parallel_seize(IndexScanDesc scan, BlockNumber *pageno);
+extern void _bt_parallel_release(IndexScanDesc scan, BlockNumber scan_page);
+extern void _bt_parallel_done(IndexScanDesc scan);
+extern void _bt_parallel_advance_array_keys(IndexScanDesc scan);
+
+/*
* prototypes for functions in nbtinsert.c
*/
extern bool _bt_doinsert(Relation rel, IndexTuple itup,
@@ -769,11 +556,4 @@ extern void _bt_spool(BTSpool *btspool, ItemPointer self,
Datum *values, bool *isnull);
extern void _bt_leafbuild(BTSpool *btspool, BTSpool *spool2);
-/*
- * prototypes for functions in nbtxlog.c
- */
-extern void btree_redo(XLogReaderState *record);
-extern void btree_desc(StringInfo buf, XLogReaderState *record);
-extern const char *btree_identify(uint8 info);
-
#endif /* NBTREE_H */
diff --git a/src/include/access/nbtxlog.h b/src/include/access/nbtxlog.h
new file mode 100644
index 0000000000..d6a3085923
--- /dev/null
+++ b/src/include/access/nbtxlog.h
@@ -0,0 +1,255 @@
+/*-------------------------------------------------------------------------
+ *
+ * nbtxlog.h
+ * header file for postgres btree xlog routines
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/access/nbtxlog.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NBTXLOG_H
+#define NBTXLOG_H
+
+#include "access/xlogreader.h"
+#include "lib/stringinfo.h"
+#include "storage/off.h"
+
+/*
+ * XLOG records for btree operations
+ *
+ * XLOG allows to store some information in high 4 bits of log
+ * record xl_info field
+ */
+#define XLOG_BTREE_INSERT_LEAF 0x00 /* add index tuple without split */
+#define XLOG_BTREE_INSERT_UPPER 0x10 /* same, on a non-leaf page */
+#define XLOG_BTREE_INSERT_META 0x20 /* same, plus update metapage */
+#define XLOG_BTREE_SPLIT_L 0x30 /* add index tuple with split */
+#define XLOG_BTREE_SPLIT_R 0x40 /* as above, new item on right */
+#define XLOG_BTREE_SPLIT_L_ROOT 0x50 /* add tuple with split of root */
+#define XLOG_BTREE_SPLIT_R_ROOT 0x60 /* as above, new item on right */
+#define XLOG_BTREE_DELETE 0x70 /* delete leaf index tuples for a page */
+#define XLOG_BTREE_UNLINK_PAGE 0x80 /* delete a half-dead page */
+#define XLOG_BTREE_UNLINK_PAGE_META 0x90 /* same, and update metapage */
+#define XLOG_BTREE_NEWROOT 0xA0 /* new root page */
+#define XLOG_BTREE_MARK_PAGE_HALFDEAD 0xB0 /* mark a leaf as half-dead */
+#define XLOG_BTREE_VACUUM 0xC0 /* delete entries on a page during
+ * vacuum */
+#define XLOG_BTREE_REUSE_PAGE 0xD0 /* old page is about to be reused from
+ * FSM */
+
+/*
+ * All that we need to regenerate the meta-data page
+ */
+typedef struct xl_btree_metadata
+{
+ BlockNumber root;
+ uint32 level;
+ BlockNumber fastroot;
+ uint32 fastlevel;
+} xl_btree_metadata;
+
+/*
+ * This is what we need to know about simple (without split) insert.
+ *
+ * This data record is used for INSERT_LEAF, INSERT_UPPER, INSERT_META.
+ * Note that INSERT_META implies it's not a leaf page.
+ *
+ * Backup Blk 0: original page (data contains the inserted tuple)
+ * Backup Blk 1: child's left sibling, if INSERT_UPPER or INSERT_META
+ * Backup Blk 2: xl_btree_metadata, if INSERT_META
+ */
+typedef struct xl_btree_insert
+{
+ OffsetNumber offnum;
+} xl_btree_insert;
+
+#define SizeOfBtreeInsert (offsetof(xl_btree_insert, offnum) + sizeof(OffsetNumber))
+
+/*
+ * On insert with split, we save all the items going into the right sibling
+ * so that we can restore it completely from the log record. This way takes
+ * less xlog space than the normal approach, because if we did it standardly,
+ * XLogInsert would almost always think the right page is new and store its
+ * whole page image. The left page, however, is handled in the normal
+ * incremental-update fashion.
+ *
+ * Note: the four XLOG_BTREE_SPLIT xl_info codes all use this data record.
+ * The _L and _R variants indicate whether the inserted tuple went into the
+ * left or right split page (and thus, whether newitemoff and the new item
+ * are stored or not). The _ROOT variants indicate that we are splitting
+ * the root page, and thus that a newroot record rather than an insert or
+ * split record should follow. Note that a split record never carries a
+ * metapage update --- we'll do that in the parent-level update.
+ *
+ * Backup Blk 0: original page / new left page
+ *
+ * The left page's data portion contains the new item, if it's the _L variant.
+ * (In the _R variants, the new item is one of the right page's tuples.)
+ * If level > 0, an IndexTuple representing the HIKEY of the left page
+ * follows. We don't need this on leaf pages, because it's the same as the
+ * leftmost key in the new right page.
+ *
+ * Backup Blk 1: new right page
+ *
+ * The right page's data portion contains the right page's tuples in the
+ * form used by _bt_restore_page.
+ *
+ * Backup Blk 2: next block (orig page's rightlink), if any
+ * Backup Blk 3: child's left sibling, if non-leaf split
+ */
+typedef struct xl_btree_split
+{
+ uint32 level; /* tree level of page being split */
+ OffsetNumber firstright; /* first item moved to right page */
+ OffsetNumber newitemoff; /* new item's offset (if placed on left page) */
+} xl_btree_split;
+
+#define SizeOfBtreeSplit (offsetof(xl_btree_split, newitemoff) + sizeof(OffsetNumber))
+
+/*
+ * This is what we need to know about delete of individual leaf index tuples.
+ * The WAL record can represent deletion of any number of index tuples on a
+ * single index page when *not* executed by VACUUM.
+ *
+ * Backup Blk 0: index page
+ */
+typedef struct xl_btree_delete
+{
+ RelFileNode hnode; /* RelFileNode of the heap the index currently
+ * points at */
+ int nitems;
+
+ /* TARGET OFFSET NUMBERS FOLLOW AT THE END */
+} xl_btree_delete;
+
+#define SizeOfBtreeDelete (offsetof(xl_btree_delete, nitems) + sizeof(int))
+
+/*
+ * This is what we need to know about page reuse within btree.
+ */
+typedef struct xl_btree_reuse_page
+{
+ RelFileNode node;
+ BlockNumber block;
+ TransactionId latestRemovedXid;
+} xl_btree_reuse_page;
+
+#define SizeOfBtreeReusePage (sizeof(xl_btree_reuse_page))
+
+/*
+ * This is what we need to know about vacuum of individual leaf index tuples.
+ * The WAL record can represent deletion of any number of index tuples on a
+ * single index page when executed by VACUUM.
+ *
+ * For MVCC scans, lastBlockVacuumed will be set to InvalidBlockNumber.
+ * For a non-MVCC index scans there is an additional correctness requirement
+ * for applying these changes during recovery, which is that we must do one
+ * of these two things for every block in the index:
+ * * lock the block for cleanup and apply any required changes
+ * * EnsureBlockUnpinned()
+ * The purpose of this is to ensure that no index scans started before we
+ * finish scanning the index are still running by the time we begin to remove
+ * heap tuples.
+ *
+ * Any changes to any one block are registered on just one WAL record. All
+ * blocks that we need to run EnsureBlockUnpinned() are listed as a block range
+ * starting from the last block vacuumed through until this one. Individual
+ * block numbers aren't given.
+ *
+ * Note that the *last* WAL record in any vacuum of an index is allowed to
+ * have a zero length array of offsets. Earlier records must have at least one.
+ */
+typedef struct xl_btree_vacuum
+{
+ BlockNumber lastBlockVacuumed;
+
+ /* TARGET OFFSET NUMBERS FOLLOW */
+} xl_btree_vacuum;
+
+#define SizeOfBtreeVacuum (offsetof(xl_btree_vacuum, lastBlockVacuumed) + sizeof(BlockNumber))
+
+/*
+ * This is what we need to know about marking an empty branch for deletion.
+ * The target identifies the tuple removed from the parent page (note that we
+ * remove this tuple's downlink and the *following* tuple's key). Note that
+ * the leaf page is empty, so we don't need to store its content --- it is
+ * just reinitialized during recovery using the rest of the fields.
+ *
+ * Backup Blk 0: leaf block
+ * Backup Blk 1: top parent
+ */
+typedef struct xl_btree_mark_page_halfdead
+{
+ OffsetNumber poffset; /* deleted tuple id in parent page */
+
+ /* information needed to recreate the leaf page: */
+ BlockNumber leafblk; /* leaf block ultimately being deleted */
+ BlockNumber leftblk; /* leaf block's left sibling, if any */
+ BlockNumber rightblk; /* leaf block's right sibling */
+ BlockNumber topparent; /* topmost internal page in the branch */
+} xl_btree_mark_page_halfdead;
+
+#define SizeOfBtreeMarkPageHalfDead (offsetof(xl_btree_mark_page_halfdead, topparent) + sizeof(BlockNumber))
+
+/*
+ * This is what we need to know about deletion of a btree page. Note we do
+ * not store any content for the deleted page --- it is just rewritten as empty
+ * during recovery, apart from resetting the btpo.xact.
+ *
+ * Backup Blk 0: target block being deleted
+ * Backup Blk 1: target block's left sibling, if any
+ * Backup Blk 2: target block's right sibling
+ * Backup Blk 3: leaf block (if different from target)
+ * Backup Blk 4: metapage (if rightsib becomes new fast root)
+ */
+typedef struct xl_btree_unlink_page
+{
+ BlockNumber leftsib; /* target block's left sibling, if any */
+ BlockNumber rightsib; /* target block's right sibling */
+
+ /*
+ * Information needed to recreate the leaf page, when target is an
+ * internal page.
+ */
+ BlockNumber leafleftsib;
+ BlockNumber leafrightsib;
+ BlockNumber topparent; /* next child down in the branch */
+
+ TransactionId btpo_xact; /* value of btpo.xact for use in recovery */
+ /* xl_btree_metadata FOLLOWS IF XLOG_BTREE_UNLINK_PAGE_META */
+} xl_btree_unlink_page;
+
+#define SizeOfBtreeUnlinkPage (offsetof(xl_btree_unlink_page, btpo_xact) + sizeof(TransactionId))
+
+/*
+ * New root log record. There are zero tuples if this is to establish an
+ * empty root, or two if it is the result of splitting an old root.
+ *
+ * Note that although this implies rewriting the metadata page, we don't need
+ * an xl_btree_metadata record --- the rootblk and level are sufficient.
+ *
+ * Backup Blk 0: new root page (2 tuples as payload, if splitting old root)
+ * Backup Blk 1: left child (if splitting an old root)
+ * Backup Blk 2: metapage
+ */
+typedef struct xl_btree_newroot
+{
+ BlockNumber rootblk; /* location of new root (redundant with blk 0) */
+ uint32 level; /* its tree level */
+} xl_btree_newroot;
+
+#define SizeOfBtreeNewroot (offsetof(xl_btree_newroot, level) + sizeof(uint32))
+
+
+/*
+ * prototypes for functions in nbtxlog.c
+ */
+extern void btree_redo(XLogReaderState *record);
+extern void btree_desc(StringInfo buf, XLogReaderState *record);
+extern const char *btree_identify(uint8 info);
+extern void btree_mask(char *pagedata, BlockNumber blkno);
+
+#endif /* NBXLOG_H */
diff --git a/src/include/access/parallel.h b/src/include/access/parallel.h
index 2f8f36fea4..590e27a484 100644
--- a/src/include/access/parallel.h
+++ b/src/include/access/parallel.h
@@ -3,7 +3,7 @@
* parallel.h
* Infrastructure for launching parallel workers
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/parallel.h
@@ -35,7 +35,6 @@ typedef struct ParallelContext
SubTransactionId subid;
int nworkers;
int nworkers_launched;
- parallel_worker_main_type entrypoint;
char *library_name;
char *function_name;
ErrorContextCallback *error_context_stack;
@@ -52,8 +51,7 @@ extern bool InitializingParallelWorker;
#define IsParallelWorker() (ParallelWorkerNumber >= 0)
-extern ParallelContext *CreateParallelContext(parallel_worker_main_type entrypoint, int nworkers);
-extern ParallelContext *CreateParallelContextForExternalFunction(char *library_name, char *function_name, int nworkers);
+extern ParallelContext *CreateParallelContext(const char *library_name, const char *function_name, int nworkers);
extern void InitializeParallelDSM(ParallelContext *pcxt);
extern void ReinitializeParallelDSM(ParallelContext *pcxt);
extern void LaunchParallelWorkers(ParallelContext *pcxt);
@@ -67,4 +65,6 @@ extern void AtEOXact_Parallel(bool isCommit);
extern void AtEOSubXact_Parallel(bool isCommit, SubTransactionId mySubId);
extern void ParallelWorkerReportLastRecEnd(XLogRecPtr last_xlog_end);
+extern void ParallelWorkerMain(Datum main_arg);
+
#endif /* PARALLEL_H */
diff --git a/src/include/access/printsimple.h b/src/include/access/printsimple.h
new file mode 100644
index 0000000000..3f3e7a3840
--- /dev/null
+++ b/src/include/access/printsimple.h
@@ -0,0 +1,23 @@
+/*-------------------------------------------------------------------------
+ *
+ * printsimple.h
+ * print simple tuples without catalog access
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/access/printsimple.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef PRINTSIMPLE_H
+#define PRINTSIMPLE_H
+
+#include "tcop/dest.h"
+
+extern bool printsimple(TupleTableSlot *slot, DestReceiver *self);
+extern void printsimple_startup(DestReceiver *self, int operation,
+ TupleDesc tupdesc);
+
+#endif /* PRINTSIMPLE_H */
diff --git a/src/include/access/printtup.h b/src/include/access/printtup.h
index 608c564287..a828889c4f 100644
--- a/src/include/access/printtup.h
+++ b/src/include/access/printtup.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/printtup.h
diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h
index 469ac677e3..91b2cd7bb2 100644
--- a/src/include/access/reloptions.h
+++ b/src/include/access/reloptions.h
@@ -9,7 +9,7 @@
* into a lot of low-level code.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/reloptions.h
@@ -48,8 +48,9 @@ typedef enum relopt_kind
RELOPT_KIND_SPGIST = (1 << 8),
RELOPT_KIND_VIEW = (1 << 9),
RELOPT_KIND_BRIN = (1 << 10),
+ RELOPT_KIND_PARTITIONED = (1 << 11),
/* if you add a new kind, make sure you update "last_default" too */
- RELOPT_KIND_LAST_DEFAULT = RELOPT_KIND_BRIN,
+ RELOPT_KIND_LAST_DEFAULT = RELOPT_KIND_PARTITIONED,
/* some compilers treat enums as signed ints, so we can't use 1 << 31 */
RELOPT_KIND_MAX = (1 << 30)
} relopt_kind;
diff --git a/src/include/access/relscan.h b/src/include/access/relscan.h
index 49c2a6f2ce..f4d4f1ee71 100644
--- a/src/include/access/relscan.h
+++ b/src/include/access/relscan.h
@@ -4,7 +4,7 @@
* POSTGRES relation scan descriptor definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/relscan.h
@@ -19,6 +19,7 @@
#include "access/htup_details.h"
#include "access/itup.h"
#include "access/tupdesc.h"
+#include "storage/spin.h"
/*
* Shared state for parallel heap scan.
@@ -92,6 +93,7 @@ typedef struct IndexScanDescData
ScanKey keyData; /* array of index qualifier descriptors */
ScanKey orderByData; /* array of ordering op descriptors */
bool xs_want_itup; /* caller requests index tuples */
+ bool xs_temp_snap; /* unregister snapshot at scan end? */
/* signaling to index AM about killing index tuples */
bool kill_prior_tuple; /* last-returned tuple is dead */
@@ -102,9 +104,16 @@ typedef struct IndexScanDescData
/* index access method's private state */
void *opaque; /* access-method-specific info */
- /* in an index-only scan, this is valid after a successful amgettuple */
+ /*
+ * In an index-only scan, a successful amgettuple call must fill either
+ * xs_itup (and xs_itupdesc) or xs_hitup (and xs_hitupdesc) to provide the
+ * data returned by the scan. It can fill both, in which case the heap
+ * format will be used.
+ */
IndexTuple xs_itup; /* index tuple returned by AM */
TupleDesc xs_itupdesc; /* rowtype descriptor of xs_itup */
+ HeapTuple xs_hitup; /* index data returned by AM, as HeapTuple */
+ TupleDesc xs_hitupdesc; /* rowtype descriptor of xs_hitup */
/* xs_ctup/xs_cbuf/xs_recheck are valid after a successful index_getnext */
HeapTupleData xs_ctup; /* current heap tuple, if any */
@@ -125,8 +134,20 @@ typedef struct IndexScanDescData
/* state data for traversing HOT chains in index_getnext */
bool xs_continue_hot; /* T if must keep walking HOT chain */
+
+ /* parallel index scan information, in shared memory */
+ ParallelIndexScanDesc parallel_scan;
} IndexScanDescData;
+/* Generic structure for parallel scans */
+typedef struct ParallelIndexScanDescData
+{
+ Oid ps_relid;
+ Oid ps_indexid;
+ Size ps_offset; /* Offset in bytes of am specific structure */
+ char ps_snapshot_data[FLEXIBLE_ARRAY_MEMBER];
+} ParallelIndexScanDescData;
+
/* Struct for heap-or-index scans of system tables */
typedef struct SysScanDescData
{
diff --git a/src/include/access/rewriteheap.h b/src/include/access/rewriteheap.h
index 4b87f25f4b..564c2ad0f5 100644
--- a/src/include/access/rewriteheap.h
+++ b/src/include/access/rewriteheap.h
@@ -3,7 +3,7 @@
* rewriteheap.h
* Declarations for heap rewrite support functions
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* src/include/access/rewriteheap.h
diff --git a/src/include/access/rmgr.h b/src/include/access/rmgr.h
index ff7fe62c05..64b92ff33a 100644
--- a/src/include/access/rmgr.h
+++ b/src/include/access/rmgr.h
@@ -19,7 +19,7 @@ typedef uint8 RmgrId;
* Note: RM_MAX_ID must fit in RmgrId; widening that type will affect the XLOG
* file format.
*/
-#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup) \
+#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask) \
symname,
typedef enum RmgrIds
diff --git a/src/include/access/rmgrlist.h b/src/include/access/rmgrlist.h
index 77920395c1..0988cb4103 100644
--- a/src/include/access/rmgrlist.h
+++ b/src/include/access/rmgrlist.h
@@ -6,7 +6,7 @@
* by the PG_RMGR macro, which is not defined in this file; it can be
* defined by the caller for special purposes.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/rmgrlist.h
@@ -25,28 +25,28 @@
*/
/* symbol name, textual name, redo, desc, identify, startup, cleanup */
-PG_RMGR(RM_XLOG_ID, "XLOG", xlog_redo, xlog_desc, xlog_identify, NULL, NULL)
-PG_RMGR(RM_XACT_ID, "Transaction", xact_redo, xact_desc, xact_identify, NULL, NULL)
-PG_RMGR(RM_SMGR_ID, "Storage", smgr_redo, smgr_desc, smgr_identify, NULL, NULL)
-PG_RMGR(RM_CLOG_ID, "CLOG", clog_redo, clog_desc, clog_identify, NULL, NULL)
-PG_RMGR(RM_DBASE_ID, "Database", dbase_redo, dbase_desc, dbase_identify, NULL, NULL)
-PG_RMGR(RM_TBLSPC_ID, "Tablespace", tblspc_redo, tblspc_desc, tblspc_identify, NULL, NULL)
-PG_RMGR(RM_MULTIXACT_ID, "MultiXact", multixact_redo, multixact_desc, multixact_identify, NULL, NULL)
-PG_RMGR(RM_RELMAP_ID, "RelMap", relmap_redo, relmap_desc, relmap_identify, NULL, NULL)
-PG_RMGR(RM_STANDBY_ID, "Standby", standby_redo, standby_desc, standby_identify, NULL, NULL)
-PG_RMGR(RM_HEAP2_ID, "Heap2", heap2_redo, heap2_desc, heap2_identify, NULL, NULL)
-PG_RMGR(RM_HEAP_ID, "Heap", heap_redo, heap_desc, heap_identify, NULL, NULL)
-PG_RMGR(RM_BTREE_ID, "Btree", btree_redo, btree_desc, btree_identify, NULL, NULL)
-PG_RMGR(RM_HASH_ID, "Hash", hash_redo, hash_desc, hash_identify, NULL, NULL)
-PG_RMGR(RM_GIN_ID, "Gin", gin_redo, gin_desc, gin_identify, gin_xlog_startup, gin_xlog_cleanup)
-PG_RMGR(RM_GIST_ID, "Gist", gist_redo, gist_desc, gist_identify, gist_xlog_startup, gist_xlog_cleanup)
-PG_RMGR(RM_SEQ_ID, "Sequence", seq_redo, seq_desc, seq_identify, NULL, NULL)
-PG_RMGR(RM_SPGIST_ID, "SPGist", spg_redo, spg_desc, spg_identify, spg_xlog_startup, spg_xlog_cleanup)
-PG_RMGR(RM_BRIN_ID, "BRIN", brin_redo, brin_desc, brin_identify, NULL, NULL)
-PG_RMGR(RM_COMMIT_TS_ID, "CommitTs", commit_ts_redo, commit_ts_desc, commit_ts_identify, NULL, NULL)
-PG_RMGR(RM_REPLORIGIN_ID, "ReplicationOrigin", replorigin_redo, replorigin_desc, replorigin_identify, NULL, NULL)
+PG_RMGR(RM_XLOG_ID, "XLOG", xlog_redo, xlog_desc, xlog_identify, NULL, NULL, NULL)
+PG_RMGR(RM_XACT_ID, "Transaction", xact_redo, xact_desc, xact_identify, NULL, NULL, NULL)
+PG_RMGR(RM_SMGR_ID, "Storage", smgr_redo, smgr_desc, smgr_identify, NULL, NULL, NULL)
+PG_RMGR(RM_CLOG_ID, "CLOG", clog_redo, clog_desc, clog_identify, NULL, NULL, NULL)
+PG_RMGR(RM_DBASE_ID, "Database", dbase_redo, dbase_desc, dbase_identify, NULL, NULL, NULL)
+PG_RMGR(RM_TBLSPC_ID, "Tablespace", tblspc_redo, tblspc_desc, tblspc_identify, NULL, NULL, NULL)
+PG_RMGR(RM_MULTIXACT_ID, "MultiXact", multixact_redo, multixact_desc, multixact_identify, NULL, NULL, NULL)
+PG_RMGR(RM_RELMAP_ID, "RelMap", relmap_redo, relmap_desc, relmap_identify, NULL, NULL, NULL)
+PG_RMGR(RM_STANDBY_ID, "Standby", standby_redo, standby_desc, standby_identify, NULL, NULL, NULL)
+PG_RMGR(RM_HEAP2_ID, "Heap2", heap2_redo, heap2_desc, heap2_identify, NULL, NULL, heap_mask)
+PG_RMGR(RM_HEAP_ID, "Heap", heap_redo, heap_desc, heap_identify, NULL, NULL, heap_mask)
+PG_RMGR(RM_BTREE_ID, "Btree", btree_redo, btree_desc, btree_identify, NULL, NULL, btree_mask)
+PG_RMGR(RM_HASH_ID, "Hash", hash_redo, hash_desc, hash_identify, NULL, NULL, hash_mask)
+PG_RMGR(RM_GIN_ID, "Gin", gin_redo, gin_desc, gin_identify, gin_xlog_startup, gin_xlog_cleanup, gin_mask)
+PG_RMGR(RM_GIST_ID, "Gist", gist_redo, gist_desc, gist_identify, gist_xlog_startup, gist_xlog_cleanup, gist_mask)
+PG_RMGR(RM_SEQ_ID, "Sequence", seq_redo, seq_desc, seq_identify, NULL, NULL, seq_mask)
+PG_RMGR(RM_SPGIST_ID, "SPGist", spg_redo, spg_desc, spg_identify, spg_xlog_startup, spg_xlog_cleanup, spg_mask)
+PG_RMGR(RM_BRIN_ID, "BRIN", brin_redo, brin_desc, brin_identify, NULL, NULL, brin_mask)
+PG_RMGR(RM_COMMIT_TS_ID, "CommitTs", commit_ts_redo, commit_ts_desc, commit_ts_identify, NULL, NULL, NULL)
+PG_RMGR(RM_REPLORIGIN_ID, "ReplicationOrigin", replorigin_redo, replorigin_desc, replorigin_identify, NULL, NULL, NULL)
#ifdef PGXC
-PG_RMGR(RM_BARRIER_ID, "Barrier", barrier_redo, barrier_desc, NULL, NULL, NULL)
+PG_RMGR(RM_BARRIER_ID, "Barrier", barrier_redo, barrier_desc, barrier_identify, NULL, NULL, NULL)
#endif
-PG_RMGR(RM_GENERIC_ID, "Generic", generic_redo, generic_desc, generic_identify, NULL, NULL)
-PG_RMGR(RM_LOGICALMSG_ID, "LogicalMessage", logicalmsg_redo, logicalmsg_desc, logicalmsg_identify, NULL, NULL)
+PG_RMGR(RM_GENERIC_ID, "Generic", generic_redo, generic_desc, generic_identify, NULL, NULL, generic_mask)
+PG_RMGR(RM_LOGICALMSG_ID, "LogicalMessage", logicalmsg_redo, logicalmsg_desc, logicalmsg_identify, NULL, NULL, NULL)
diff --git a/src/include/access/sdir.h b/src/include/access/sdir.h
index fc9d939209..347e910a41 100644
--- a/src/include/access/sdir.h
+++ b/src/include/access/sdir.h
@@ -4,7 +4,7 @@
* POSTGRES scan direction definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/sdir.h
diff --git a/src/include/access/skey.h b/src/include/access/skey.h
index c8ac001974..01cc940363 100644
--- a/src/include/access/skey.h
+++ b/src/include/access/skey.h
@@ -4,7 +4,7 @@
* POSTGRES scan key definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/skey.h
diff --git a/src/include/access/slru.h b/src/include/access/slru.h
index 5fcebc52fb..722867d5d2 100644
--- a/src/include/access/slru.h
+++ b/src/include/access/slru.h
@@ -3,7 +3,7 @@
* slru.h
* Simple LRU buffering for transaction status logfiles
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/slru.h
@@ -76,7 +76,7 @@ typedef struct SlruSharedData
/*
* Optional array of WAL flush LSNs associated with entries in the SLRU
* pages. If not zero/NULL, we must flush WAL before writing pages (true
- * for pg_clog, false for multixact, pg_subtrans, pg_notify). group_lsn[]
+ * for pg_xact, false for multixact, pg_subtrans, pg_notify). group_lsn[]
* has lsn_groups_per_page entries per buffer slot, each containing the
* highest LSN known for a contiguous group of SLRU entries on that slot's
* page.
@@ -104,7 +104,6 @@ typedef struct SlruSharedData
/* LWLocks */
int lwlock_tranche_id;
- LWLockTranche lwlock_tranche;
char lwlock_tranche_name[SLRU_MAX_NAME_LENGTH];
LWLockPadded *buffer_locks;
} SlruSharedData;
@@ -120,7 +119,7 @@ typedef struct SlruCtlData
SlruShared shared;
/*
- * This flag tells whether to fsync writes (true for pg_clog and multixact
+ * This flag tells whether to fsync writes (true for pg_xact and multixact
* stuff, false for pg_subtrans and pg_notify).
*/
bool do_fsync;
diff --git a/src/include/access/spgist.h b/src/include/access/spgist.h
index f39a2d6938..9dca8fde7d 100644
--- a/src/include/access/spgist.h
+++ b/src/include/access/spgist.h
@@ -4,7 +4,7 @@
* Public header file for SP-GiST access method.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/spgist.h
@@ -90,10 +90,13 @@ typedef struct spgChooseOut
} addNode;
struct /* results for spgSplitTuple */
{
- /* Info to form new inner tuple with one node */
+ /* Info to form new upper-level inner tuple with one child tuple */
bool prefixHasPrefix; /* tuple should have a prefix? */
Datum prefixPrefixDatum; /* if so, its value */
- Datum nodeLabel; /* node's label */
+ int prefixNNodes; /* number of nodes */
+ Datum *prefixNodeLabels; /* their labels (or NULL for
+ * no labels) */
+ int childNodeN; /* which node gets child tuple */
/* Info to form new lower-level inner tuple with all old nodes */
bool postfixHasPrefix; /* tuple should have a prefix? */
@@ -134,7 +137,8 @@ typedef struct spgInnerConsistentIn
Datum reconstructedValue; /* value reconstructed at parent */
void *traversalValue; /* opclass-specific traverse value */
- MemoryContext traversalMemoryContext;
+ MemoryContext traversalMemoryContext; /* put new traverse values
+ * here */
int level; /* current level (counting from zero) */
bool returnData; /* original data must be returned? */
@@ -163,8 +167,8 @@ typedef struct spgLeafConsistentIn
ScanKey scankeys; /* array of operators and comparison values */
int nkeys; /* length of array */
- void *traversalValue; /* opclass-specific traverse value */
Datum reconstructedValue; /* value reconstructed at parent */
+ void *traversalValue; /* opclass-specific traverse value */
int level; /* current level (counting from zero) */
bool returnData; /* original data must be returned? */
@@ -179,7 +183,6 @@ typedef struct spgLeafConsistentOut
/* spgutils.c */
-extern Datum spghandler(PG_FUNCTION_ARGS);
extern bytea *spgoptions(Datum reloptions, bool validate);
/* spginsert.c */
@@ -188,7 +191,8 @@ extern IndexBuildResult *spgbuild(Relation heap, Relation index,
extern void spgbuildempty(Relation index);
extern bool spginsert(Relation index, Datum *values, bool *isnull,
ItemPointer ht_ctid, Relation heapRel,
- IndexUniqueCheck checkUnique);
+ IndexUniqueCheck checkUnique,
+ struct IndexInfo *indexInfo);
/* spgscan.c */
extern IndexScanDesc spgbeginscan(Relation rel, int keysz, int orderbysz);
@@ -210,11 +214,4 @@ extern IndexBulkDeleteResult *spgvacuumcleanup(IndexVacuumInfo *info,
/* spgvalidate.c */
extern bool spgvalidate(Oid opclassoid);
-/* spgxlog.c */
-extern void spg_redo(XLogReaderState *record);
-extern void spg_desc(StringInfo buf, XLogReaderState *record);
-extern const char *spg_identify(uint8 info);
-extern void spg_xlog_startup(void);
-extern void spg_xlog_cleanup(void);
-
#endif /* SPGIST_H */
diff --git a/src/include/access/spgist_private.h b/src/include/access/spgist_private.h
index cb8fa9c0b5..4072c050de 100644
--- a/src/include/access/spgist_private.h
+++ b/src/include/access/spgist_private.h
@@ -4,7 +4,7 @@
* Private declarations for SP-GiST access method.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/spgist_private.h
@@ -159,7 +159,7 @@ typedef struct SpGistScanOpaqueData
int iPtr; /* index for scanning through same */
ItemPointerData heapPtrs[MaxIndexTuplesPerPage]; /* TIDs from cur page */
bool recheck[MaxIndexTuplesPerPage]; /* their recheck flags */
- IndexTuple indexTups[MaxIndexTuplesPerPage]; /* reconstructed tuples */
+ HeapTuple reconTups[MaxIndexTuplesPerPage]; /* reconstructed tuples */
/*
* Note: using MaxIndexTuplesPerPage above is a bit hokey since
@@ -354,28 +354,6 @@ typedef SpGistDeadTupleData *SpGistDeadTuple;
* XLOG stuff
*/
-/* XLOG record types for SPGiST */
-#define XLOG_SPGIST_CREATE_INDEX 0x00
-#define XLOG_SPGIST_ADD_LEAF 0x10
-#define XLOG_SPGIST_MOVE_LEAFS 0x20
-#define XLOG_SPGIST_ADD_NODE 0x30
-#define XLOG_SPGIST_SPLIT_TUPLE 0x40
-#define XLOG_SPGIST_PICKSPLIT 0x50
-#define XLOG_SPGIST_VACUUM_LEAF 0x60
-#define XLOG_SPGIST_VACUUM_ROOT 0x70
-#define XLOG_SPGIST_VACUUM_REDIRECT 0x80
-
-/*
- * Some redo functions need an SpGistState, although only a few of its fields
- * need to be valid. spgxlogState carries the required info in xlog records.
- * (See fillFakeState in spgxlog.c for more comments.)
- */
-typedef struct spgxlogState
-{
- TransactionId myXid;
- bool isBuild;
-} spgxlogState;
-
#define STORE_STATE(s, d) \
do { \
(d).myXid = (s)->myXid; \
@@ -383,214 +361,6 @@ typedef struct spgxlogState
} while(0)
/*
- * Backup Blk 0: destination page for leaf tuple
- * Backup Blk 1: parent page (if any)
- */
-typedef struct spgxlogAddLeaf
-{
- bool newPage; /* init dest page? */
- bool storesNulls; /* page is in the nulls tree? */
- OffsetNumber offnumLeaf; /* offset where leaf tuple gets placed */
- OffsetNumber offnumHeadLeaf; /* offset of head tuple in chain, if any */
-
- OffsetNumber offnumParent; /* where the parent downlink is, if any */
- uint16 nodeI;
-
- /* new leaf tuple follows (unaligned!) */
-} spgxlogAddLeaf;
-
-/*
- * Backup Blk 0: source leaf page
- * Backup Blk 1: destination leaf page
- * Backup Blk 2: parent page
- */
-typedef struct spgxlogMoveLeafs
-{
- uint16 nMoves; /* number of tuples moved from source page */
- bool newPage; /* init dest page? */
- bool replaceDead; /* are we replacing a DEAD source tuple? */
- bool storesNulls; /* pages are in the nulls tree? */
-
- /* where the parent downlink is */
- OffsetNumber offnumParent;
- uint16 nodeI;
-
- spgxlogState stateSrc;
-
- /*----------
- * data follows:
- * array of deleted tuple numbers, length nMoves
- * array of inserted tuple numbers, length nMoves + 1 or 1
- * list of leaf tuples, length nMoves + 1 or 1 (unaligned!)
- *
- * Note: if replaceDead is true then there is only one inserted tuple
- * number and only one leaf tuple in the data, because we are not copying
- * the dead tuple from the source
- *----------
- */
- OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
-} spgxlogMoveLeafs;
-
-#define SizeOfSpgxlogMoveLeafs offsetof(spgxlogMoveLeafs, offsets)
-
-/*
- * Backup Blk 0: original page
- * Backup Blk 1: where new tuple goes, if not same place
- * Backup Blk 2: where parent downlink is, if updated and different from
- * the old and new
- */
-typedef struct spgxlogAddNode
-{
- /*
- * Offset of the original inner tuple, in the original page (on backup
- * block 0).
- */
- OffsetNumber offnum;
-
- /*
- * Offset of the new tuple, on the new page (on backup block 1). Invalid,
- * if we overwrote the old tuple in the original page).
- */
- OffsetNumber offnumNew;
- bool newPage; /* init new page? */
-
- /*----
- * Where is the parent downlink? parentBlk indicates which page it's on,
- * and offnumParent is the offset within the page. The possible values for
- * parentBlk are:
- *
- * 0: parent == original page
- * 1: parent == new page
- * 2: parent == different page (blk ref 2)
- * -1: parent not updated
- *----
- */
- int8 parentBlk;
- OffsetNumber offnumParent; /* offset within the parent page */
-
- uint16 nodeI;
-
- spgxlogState stateSrc;
-
- /*
- * updated inner tuple follows (unaligned!)
- */
-} spgxlogAddNode;
-
-/*
- * Backup Blk 0: where the prefix tuple goes
- * Backup Blk 1: where the postfix tuple goes (if different page)
- */
-typedef struct spgxlogSplitTuple
-{
- /* where the prefix tuple goes */
- OffsetNumber offnumPrefix;
-
- /* where the postfix tuple goes */
- OffsetNumber offnumPostfix;
- bool newPage; /* need to init that page? */
- bool postfixBlkSame; /* was postfix tuple put on same page as
- * prefix? */
-
- /*
- * new prefix inner tuple follows, then new postfix inner tuple (both are
- * unaligned!)
- */
-} spgxlogSplitTuple;
-
-/*
- * Buffer references in the rdata array are:
- * Backup Blk 0: Src page (only if not root)
- * Backup Blk 1: Dest page (if used)
- * Backup Blk 2: Inner page
- * Backup Blk 3: Parent page (if any, and different from Inner)
- */
-typedef struct spgxlogPickSplit
-{
- bool isRootSplit;
-
- uint16 nDelete; /* n to delete from Src */
- uint16 nInsert; /* n to insert on Src and/or Dest */
- bool initSrc; /* re-init the Src page? */
- bool initDest; /* re-init the Dest page? */
-
- /* where to put new inner tuple */
- OffsetNumber offnumInner;
- bool initInner; /* re-init the Inner page? */
-
- bool storesNulls; /* pages are in the nulls tree? */
-
- /* where the parent downlink is, if any */
- bool innerIsParent; /* is parent the same as inner page? */
- OffsetNumber offnumParent;
- uint16 nodeI;
-
- spgxlogState stateSrc;
-
- /*----------
- * data follows:
- * array of deleted tuple numbers, length nDelete
- * array of inserted tuple numbers, length nInsert
- * array of page selector bytes for inserted tuples, length nInsert
- * new inner tuple (unaligned!)
- * list of leaf tuples, length nInsert (unaligned!)
- *----------
- */
- OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
-} spgxlogPickSplit;
-
-#define SizeOfSpgxlogPickSplit offsetof(spgxlogPickSplit, offsets)
-
-typedef struct spgxlogVacuumLeaf
-{
- uint16 nDead; /* number of tuples to become DEAD */
- uint16 nPlaceholder; /* number of tuples to become PLACEHOLDER */
- uint16 nMove; /* number of tuples to move */
- uint16 nChain; /* number of tuples to re-chain */
-
- spgxlogState stateSrc;
-
- /*----------
- * data follows:
- * tuple numbers to become DEAD
- * tuple numbers to become PLACEHOLDER
- * tuple numbers to move from (and replace with PLACEHOLDER)
- * tuple numbers to move to (replacing what is there)
- * tuple numbers to update nextOffset links of
- * tuple numbers to insert in nextOffset links
- *----------
- */
- OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
-} spgxlogVacuumLeaf;
-
-#define SizeOfSpgxlogVacuumLeaf offsetof(spgxlogVacuumLeaf, offsets)
-
-typedef struct spgxlogVacuumRoot
-{
- /* vacuum a root page when it is also a leaf */
- uint16 nDelete; /* number of tuples to delete */
-
- spgxlogState stateSrc;
-
- /* offsets of tuples to delete follow */
- OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
-} spgxlogVacuumRoot;
-
-#define SizeOfSpgxlogVacuumRoot offsetof(spgxlogVacuumRoot, offsets)
-
-typedef struct spgxlogVacuumRedirect
-{
- uint16 nToPlaceholder; /* number of redirects to make placeholders */
- OffsetNumber firstPlaceholder; /* first placeholder tuple to remove */
- TransactionId newestRedirectXid; /* newest XID of removed redirects */
-
- /* offsets of redirect tuples to make placeholders follow */
- OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
-} spgxlogVacuumRedirect;
-
-#define SizeOfSpgxlogVacuumRedirect offsetof(spgxlogVacuumRedirect, offsets)
-
-/*
* The "flags" argument for SpGistGetBuffer should be either GBUF_LEAF to
* get a leaf page, or GBUF_INNER_PARITY(blockNumber) to get an inner
* page in the same triple-parity group as the specified block number.
diff --git a/src/include/access/spgxlog.h b/src/include/access/spgxlog.h
new file mode 100644
index 0000000000..ff597f75db
--- /dev/null
+++ b/src/include/access/spgxlog.h
@@ -0,0 +1,257 @@
+/*-------------------------------------------------------------------------
+ *
+ * spgxlog.h
+ * xlog declarations for SP-GiST access method.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/access/spgxlog.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef SPGXLOG_H
+#define SPGXLOG_H
+
+#include "access/xlogreader.h"
+#include "lib/stringinfo.h"
+#include "storage/off.h"
+
+/* XLOG record types for SPGiST */
+#define XLOG_SPGIST_CREATE_INDEX 0x00
+#define XLOG_SPGIST_ADD_LEAF 0x10
+#define XLOG_SPGIST_MOVE_LEAFS 0x20
+#define XLOG_SPGIST_ADD_NODE 0x30
+#define XLOG_SPGIST_SPLIT_TUPLE 0x40
+#define XLOG_SPGIST_PICKSPLIT 0x50
+#define XLOG_SPGIST_VACUUM_LEAF 0x60
+#define XLOG_SPGIST_VACUUM_ROOT 0x70
+#define XLOG_SPGIST_VACUUM_REDIRECT 0x80
+
+/*
+ * Some redo functions need an SpGistState, although only a few of its fields
+ * need to be valid. spgxlogState carries the required info in xlog records.
+ * (See fillFakeState in spgxlog.c for more comments.)
+ */
+typedef struct spgxlogState
+{
+ TransactionId myXid;
+ bool isBuild;
+} spgxlogState;
+
+/*
+ * Backup Blk 0: destination page for leaf tuple
+ * Backup Blk 1: parent page (if any)
+ */
+typedef struct spgxlogAddLeaf
+{
+ bool newPage; /* init dest page? */
+ bool storesNulls; /* page is in the nulls tree? */
+ OffsetNumber offnumLeaf; /* offset where leaf tuple gets placed */
+ OffsetNumber offnumHeadLeaf; /* offset of head tuple in chain, if any */
+
+ OffsetNumber offnumParent; /* where the parent downlink is, if any */
+ uint16 nodeI;
+
+ /* new leaf tuple follows (unaligned!) */
+} spgxlogAddLeaf;
+
+/*
+ * Backup Blk 0: source leaf page
+ * Backup Blk 1: destination leaf page
+ * Backup Blk 2: parent page
+ */
+typedef struct spgxlogMoveLeafs
+{
+ uint16 nMoves; /* number of tuples moved from source page */
+ bool newPage; /* init dest page? */
+ bool replaceDead; /* are we replacing a DEAD source tuple? */
+ bool storesNulls; /* pages are in the nulls tree? */
+
+ /* where the parent downlink is */
+ OffsetNumber offnumParent;
+ uint16 nodeI;
+
+ spgxlogState stateSrc;
+
+ /*----------
+ * data follows:
+ * array of deleted tuple numbers, length nMoves
+ * array of inserted tuple numbers, length nMoves + 1 or 1
+ * list of leaf tuples, length nMoves + 1 or 1 (unaligned!)
+ *
+ * Note: if replaceDead is true then there is only one inserted tuple
+ * number and only one leaf tuple in the data, because we are not copying
+ * the dead tuple from the source
+ *----------
+ */
+ OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
+} spgxlogMoveLeafs;
+
+#define SizeOfSpgxlogMoveLeafs offsetof(spgxlogMoveLeafs, offsets)
+
+/*
+ * Backup Blk 0: original page
+ * Backup Blk 1: where new tuple goes, if not same place
+ * Backup Blk 2: where parent downlink is, if updated and different from
+ * the old and new
+ */
+typedef struct spgxlogAddNode
+{
+ /*
+ * Offset of the original inner tuple, in the original page (on backup
+ * block 0).
+ */
+ OffsetNumber offnum;
+
+ /*
+ * Offset of the new tuple, on the new page (on backup block 1). Invalid,
+ * if we overwrote the old tuple in the original page).
+ */
+ OffsetNumber offnumNew;
+ bool newPage; /* init new page? */
+
+ /*----
+ * Where is the parent downlink? parentBlk indicates which page it's on,
+ * and offnumParent is the offset within the page. The possible values for
+ * parentBlk are:
+ *
+ * 0: parent == original page
+ * 1: parent == new page
+ * 2: parent == different page (blk ref 2)
+ * -1: parent not updated
+ *----
+ */
+ int8 parentBlk;
+ OffsetNumber offnumParent; /* offset within the parent page */
+
+ uint16 nodeI;
+
+ spgxlogState stateSrc;
+
+ /*
+ * updated inner tuple follows (unaligned!)
+ */
+} spgxlogAddNode;
+
+/*
+ * Backup Blk 0: where the prefix tuple goes
+ * Backup Blk 1: where the postfix tuple goes (if different page)
+ */
+typedef struct spgxlogSplitTuple
+{
+ /* where the prefix tuple goes */
+ OffsetNumber offnumPrefix;
+
+ /* where the postfix tuple goes */
+ OffsetNumber offnumPostfix;
+ bool newPage; /* need to init that page? */
+ bool postfixBlkSame; /* was postfix tuple put on same page as
+ * prefix? */
+
+ /*
+ * new prefix inner tuple follows, then new postfix inner tuple (both are
+ * unaligned!)
+ */
+} spgxlogSplitTuple;
+
+/*
+ * Buffer references in the rdata array are:
+ * Backup Blk 0: Src page (only if not root)
+ * Backup Blk 1: Dest page (if used)
+ * Backup Blk 2: Inner page
+ * Backup Blk 3: Parent page (if any, and different from Inner)
+ */
+typedef struct spgxlogPickSplit
+{
+ bool isRootSplit;
+
+ uint16 nDelete; /* n to delete from Src */
+ uint16 nInsert; /* n to insert on Src and/or Dest */
+ bool initSrc; /* re-init the Src page? */
+ bool initDest; /* re-init the Dest page? */
+
+ /* where to put new inner tuple */
+ OffsetNumber offnumInner;
+ bool initInner; /* re-init the Inner page? */
+
+ bool storesNulls; /* pages are in the nulls tree? */
+
+ /* where the parent downlink is, if any */
+ bool innerIsParent; /* is parent the same as inner page? */
+ OffsetNumber offnumParent;
+ uint16 nodeI;
+
+ spgxlogState stateSrc;
+
+ /*----------
+ * data follows:
+ * array of deleted tuple numbers, length nDelete
+ * array of inserted tuple numbers, length nInsert
+ * array of page selector bytes for inserted tuples, length nInsert
+ * new inner tuple (unaligned!)
+ * list of leaf tuples, length nInsert (unaligned!)
+ *----------
+ */
+ OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
+} spgxlogPickSplit;
+
+#define SizeOfSpgxlogPickSplit offsetof(spgxlogPickSplit, offsets)
+
+typedef struct spgxlogVacuumLeaf
+{
+ uint16 nDead; /* number of tuples to become DEAD */
+ uint16 nPlaceholder; /* number of tuples to become PLACEHOLDER */
+ uint16 nMove; /* number of tuples to move */
+ uint16 nChain; /* number of tuples to re-chain */
+
+ spgxlogState stateSrc;
+
+ /*----------
+ * data follows:
+ * tuple numbers to become DEAD
+ * tuple numbers to become PLACEHOLDER
+ * tuple numbers to move from (and replace with PLACEHOLDER)
+ * tuple numbers to move to (replacing what is there)
+ * tuple numbers to update nextOffset links of
+ * tuple numbers to insert in nextOffset links
+ *----------
+ */
+ OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
+} spgxlogVacuumLeaf;
+
+#define SizeOfSpgxlogVacuumLeaf offsetof(spgxlogVacuumLeaf, offsets)
+
+typedef struct spgxlogVacuumRoot
+{
+ /* vacuum a root page when it is also a leaf */
+ uint16 nDelete; /* number of tuples to delete */
+
+ spgxlogState stateSrc;
+
+ /* offsets of tuples to delete follow */
+ OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
+} spgxlogVacuumRoot;
+
+#define SizeOfSpgxlogVacuumRoot offsetof(spgxlogVacuumRoot, offsets)
+
+typedef struct spgxlogVacuumRedirect
+{
+ uint16 nToPlaceholder; /* number of redirects to make placeholders */
+ OffsetNumber firstPlaceholder; /* first placeholder tuple to remove */
+ TransactionId newestRedirectXid; /* newest XID of removed redirects */
+
+ /* offsets of redirect tuples to make placeholders follow */
+ OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER];
+} spgxlogVacuumRedirect;
+
+#define SizeOfSpgxlogVacuumRedirect offsetof(spgxlogVacuumRedirect, offsets)
+
+extern void spg_redo(XLogReaderState *record);
+extern void spg_desc(StringInfo buf, XLogReaderState *record);
+extern const char *spg_identify(uint8 info);
+extern void spg_xlog_startup(void);
+extern void spg_xlog_cleanup(void);
+extern void spg_mask(char *pagedata, BlockNumber blkno);
+
+#endif /* SPGXLOG_H */
diff --git a/src/include/access/stratnum.h b/src/include/access/stratnum.h
index eabced569c..489e5c595e 100644
--- a/src/include/access/stratnum.h
+++ b/src/include/access/stratnum.h
@@ -4,7 +4,7 @@
* POSTGRES strategy number definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/stratnum.h
diff --git a/src/include/access/subtrans.h b/src/include/access/subtrans.h
index f39c6d388f..847359873a 100644
--- a/src/include/access/subtrans.h
+++ b/src/include/access/subtrans.h
@@ -3,7 +3,7 @@
*
* PostgreSQL subtransaction-log manager
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/subtrans.h
@@ -14,7 +14,7 @@
/* Number of SLRU buffers to use for subtrans */
#define NUM_SUBTRANS_BUFFERS 32
-extern void SubTransSetParent(TransactionId xid, TransactionId parent, bool overwriteOK);
+extern void SubTransSetParent(TransactionId xid, TransactionId parent);
extern TransactionId SubTransGetParent(TransactionId xid);
extern TransactionId SubTransGetTopmostTransaction(TransactionId xid);
diff --git a/src/include/access/sysattr.h b/src/include/access/sysattr.h
index 1d74d51ab7..348c67ed86 100644
--- a/src/include/access/sysattr.h
+++ b/src/include/access/sysattr.h
@@ -4,7 +4,7 @@
* POSTGRES system attribute definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/sysattr.h
diff --git a/src/include/access/timeline.h b/src/include/access/timeline.h
index 2b333bc10e..c1911feb16 100644
--- a/src/include/access/timeline.h
+++ b/src/include/access/timeline.h
@@ -3,7 +3,7 @@
*
* Functions for reading and writing timeline history files.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/timeline.h
@@ -17,7 +17,7 @@
/*
* A list of these structs describes the timeline history of the server. Each
* TimeLineHistoryEntry represents a piece of WAL belonging to the history,
- * from newest to oldest. All WAL positions between 'begin' and 'end' belong to
+ * from newest to oldest. All WAL locations between 'begin' and 'end' belong to
* the timeline represented by the entry. Together the 'begin' and 'end'
* pointers of all the entries form a contiguous line from beginning of time
* to infinity.
diff --git a/src/include/access/transam.h b/src/include/access/transam.h
index 395953a6f1..e357d5dea8 100644
--- a/src/include/access/transam.h
+++ b/src/include/access/transam.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -138,6 +138,12 @@ typedef struct VariableCacheData
*/
TransactionId latestCompletedXid; /* newest XID that has committed or
* aborted */
+
+ /*
+ * These fields are protected by CLogTruncationLock
+ */
+ TransactionId oldestClogXid; /* oldest it's safe to look up in clog */
+
} VariableCacheData;
typedef VariableCacheData *VariableCache;
@@ -189,6 +195,7 @@ extern void ExtendLogs(TransactionId xid);
extern TransactionId ReadNewTransactionId(void);
extern void SetTransactionIdLimit(TransactionId oldest_datfrozenxid,
Oid oldest_datoid);
+extern void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid);
extern bool ForceTransactionIdLimitUpdate(void);
extern Oid GetNewObjectId(void);
diff --git a/src/include/access/tsmapi.h b/src/include/access/tsmapi.h
index 2e605c3406..d07b3f25a9 100644
--- a/src/include/access/tsmapi.h
+++ b/src/include/access/tsmapi.h
@@ -3,7 +3,7 @@
* tsmapi.h
* API for tablesample methods
*
- * Copyright (c) 2015-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2015-2017, PostgreSQL Global Development Group
*
* src/include/access/tsmapi.h
*
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h
index 10556eec7e..e86cfd56c8 100644
--- a/src/include/access/tupconvert.h
+++ b/src/include/access/tupconvert.h
@@ -4,7 +4,7 @@
* Tuple conversion support.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/tupconvert.h
@@ -38,6 +38,10 @@ extern TupleConversionMap *convert_tuples_by_name(TupleDesc indesc,
TupleDesc outdesc,
const char *msg);
+extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
+ TupleDesc outdesc,
+ const char *msg);
+
extern HeapTuple do_convert_tuple(HeapTuple tuple, TupleConversionMap *map);
extern void free_conversion_map(TupleConversionMap *map);
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h
index de18f7488c..b48f839028 100644
--- a/src/include/access/tupdesc.h
+++ b/src/include/access/tupdesc.h
@@ -4,7 +4,7 @@
* POSTGRES tuple descriptor definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/tupdesc.h
@@ -119,6 +119,13 @@ extern void TupleDescInitEntry(TupleDesc desc,
int32 typmod,
int attdim);
+extern void TupleDescInitBuiltinEntry(TupleDesc desc,
+ AttrNumber attributeNumber,
+ const char *attributeName,
+ Oid oidtypeid,
+ int32 typmod,
+ int attdim);
+
extern void TupleDescInitEntryCollation(TupleDesc desc,
AttrNumber attributeNumber,
Oid collationid);
diff --git a/src/include/access/tupmacs.h b/src/include/access/tupmacs.h
index a24f1dda30..b5369108cc 100644
--- a/src/include/access/tupmacs.h
+++ b/src/include/access/tupmacs.h
@@ -4,7 +4,7 @@
* Tuple macros used by both index tuples and heap tuples.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/tupmacs.h
diff --git a/src/include/access/tuptoaster.h b/src/include/access/tuptoaster.h
index 7b5ae6245e..c7abeed812 100644
--- a/src/include/access/tuptoaster.h
+++ b/src/include/access/tuptoaster.h
@@ -4,7 +4,7 @@
* POSTGRES definitions for external and compressed storage
* of variable size attributes.
*
- * Copyright (c) 2000-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2000-2017, PostgreSQL Global Development Group
*
* src/include/access/tuptoaster.h
*
@@ -142,7 +142,7 @@ extern HeapTuple toast_insert_or_update(Relation rel,
* Called by heap_delete().
* ----------
*/
-extern void toast_delete(Relation rel, HeapTuple oldtup);
+extern void toast_delete(Relation rel, HeapTuple oldtup, bool is_speculative);
/* ----------
* heap_tuple_fetch_attr() -
@@ -194,6 +194,17 @@ extern Datum toast_flatten_tuple_to_datum(HeapTupleHeader tup,
TupleDesc tupleDesc);
/* ----------
+ * toast_build_flattened_tuple -
+ *
+ * Build a tuple containing no out-of-line toasted fields.
+ * (This does not eliminate compressed or short-header datums.)
+ * ----------
+ */
+extern HeapTuple toast_build_flattened_tuple(TupleDesc tupleDesc,
+ Datum *values,
+ bool *isnull);
+
+/* ----------
* toast_compress_datum -
*
* Create a compressed version of a varlena datum, if possible
diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h
index 4d63bbd5dc..d03af5f2c2 100644
--- a/src/include/access/twophase.h
+++ b/src/include/access/twophase.h
@@ -4,7 +4,7 @@
* Two-phase-commit related declarations.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/twophase.h
@@ -46,14 +46,15 @@ extern bool StandbyTransactionIdIsPrepared(TransactionId xid);
extern TransactionId PrescanPreparedTransactions(TransactionId **xids_p,
int *nxids_p);
-extern void StandbyRecoverPreparedTransactions(bool overwriteOK);
+extern void StandbyRecoverPreparedTransactions(void);
extern void RecoverPreparedTransactions(void);
-extern void RecreateTwoPhaseFile(TransactionId xid, void *content, int len);
-extern void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning);
-
extern void CheckPointTwoPhase(XLogRecPtr redo_horizon);
extern void FinishPreparedTransaction(const char *gid, bool isCommit);
+extern void PrepareRedoAdd(char *buf, XLogRecPtr start_lsn,
+ XLogRecPtr end_lsn);
+extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
+extern void restoreTwoPhaseData(void);
#endif /* TWOPHASE_H */
diff --git a/src/include/access/twophase_rmgr.h b/src/include/access/twophase_rmgr.h
index 55627bfcc4..32b6475dd9 100644
--- a/src/include/access/twophase_rmgr.h
+++ b/src/include/access/twophase_rmgr.h
@@ -4,7 +4,7 @@
* Two-phase-commit resource managers definition
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/twophase_rmgr.h
diff --git a/src/include/access/valid.h b/src/include/access/valid.h
index 30af9df429..72f2bb6ac2 100644
--- a/src/include/access/valid.h
+++ b/src/include/access/valid.h
@@ -4,7 +4,7 @@
* POSTGRES tuple qualification validity definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/valid.h
diff --git a/src/include/access/visibilitymap.h b/src/include/access/visibilitymap.h
index 00bbd4c2d9..a3796f2902 100644
--- a/src/include/access/visibilitymap.h
+++ b/src/include/access/visibilitymap.h
@@ -4,7 +4,7 @@
* visibility map interface
*
*
- * Portions Copyright (c) 2007-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2007-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/visibilitymap.h
@@ -26,7 +26,7 @@
#define VISIBILITYMAP_ALL_VISIBLE 0x01
#define VISIBILITYMAP_ALL_FROZEN 0x02
#define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid
- * visiblitymap flags bits */
+ * visibilitymap flags bits */
/* Macros for visibilitymap test */
#define VM_ALL_VISIBLE(r, b, v) \
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index 063c8c2af3..2186e706a6 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -70,14 +70,33 @@ typedef enum
* apply */
} SyncCommitLevel;
-/* Define the default setting for synchonous_commit */
+/* Define the default setting for synchronous_commit */
#define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH
/* Synchronous commit level */
extern int synchronous_commit;
-/* Kluge for 2PC support */
-extern bool MyXactAccessedTempRel;
+/*
+ * Miscellaneous flag bits to record events which occur on the top level
+ * transaction. These flags are only persisted in MyXactFlags and are intended
+ * so we remember to do certain things later in the transaction. This is
+ * globally accessible, so can be set from anywhere in the code which requires
+ * recording flags.
+ */
+extern int MyXactFlags;
+
+/*
+ * XACT_FLAGS_ACCESSEDTEMPREL - set when a temporary relation is accessed. We
+ * don't allow PREPARE TRANSACTION in that case.
+ */
+#define XACT_FLAGS_ACCESSEDTEMPREL (1U << 0)
+
+/*
+ * XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK - records whether the top level xact
+ * logged any Access Exclusive Locks.
+ */
+#define XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK (1U << 1)
+
/*
* start- and end-of-transaction callbacks for dynamically loaded modules
@@ -155,6 +174,7 @@ typedef void (*GTMCallback) (GTMEvent event, void *arg);
#define XACT_XINFO_HAS_INVALS (1U << 3)
#define XACT_XINFO_HAS_TWOPHASE (1U << 4)
#define XACT_XINFO_HAS_ORIGIN (1U << 5)
+#define XACT_XINFO_HAS_AE_LOCKS (1U << 6)
/*
* Also stored in xinfo, these indicating a variety of additional actions that
@@ -243,7 +263,6 @@ typedef struct xl_xact_twophase
{
TransactionId xid;
} xl_xact_twophase;
-#define MinSizeOfXactInvals offsetof(xl_xact_invals, msgs)
typedef struct xl_xact_origin
{
@@ -420,12 +439,13 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
int nrels, RelFileNode *rels,
int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval, bool forceSync,
+ int xactflags,
TransactionId twophase_xid);
extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileNode *rels,
- TransactionId twophase_xid);
+ int xactflags, TransactionId twophase_xid);
extern void xact_redo(XLogReaderState *record);
/* xactdesc.c */
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 0f5a0a3720..4a633a7fad 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -1,9 +1,9 @@
/*
* xlog.h
*
- * PostgreSQL transaction log manager
+ * PostgreSQL write-ahead log manager
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/xlog.h
@@ -86,6 +86,7 @@ typedef enum
#ifdef PGXC
RECOVERY_TARGET_BARRIER,
#endif
+ RECOVERY_TARGET_LSN,
RECOVERY_TARGET_IMMEDIATE
} RecoveryTargetType;
@@ -96,8 +97,8 @@ extern PGDLLIMPORT XLogRecPtr XactLastCommitEnd;
extern bool reachedConsistency;
/* these variables are GUC parameters related to XLOG */
-extern int min_wal_size;
-extern int max_wal_size;
+extern int min_wal_size_mb;
+extern int max_wal_size_mb;
extern int wal_keep_segments;
extern int XLOGbuffers;
extern int XLogArchiveTimeout;
@@ -107,6 +108,8 @@ extern bool EnableHotStandby;
extern bool fullPageWrites;
extern bool wal_log_hints;
extern bool wal_compression;
+extern bool *wal_consistency_checking;
+extern char *wal_consistency_checking_string;
extern bool log_checkpoints;
extern int CheckPointSegments;
@@ -186,6 +189,13 @@ extern bool XLOG_DEBUG;
#define CHECKPOINT_CAUSE_XLOG 0x0040 /* XLOG consumption */
#define CHECKPOINT_CAUSE_TIME 0x0080 /* Elapsed time */
+/*
+ * Flag bits for the record being inserted, set using XLogSetRecordFlags().
+ */
+#define XLOG_INCLUDE_ORIGIN 0x01 /* include the replication origin */
+#define XLOG_MARK_UNIMPORTANT 0x02 /* record not important for durability */
+
+
/* Checkpoint statistics */
typedef struct CheckpointStatsData
{
@@ -213,7 +223,9 @@ extern CheckpointStatsData CheckpointStats;
struct XLogRecData;
-extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata, XLogRecPtr fpw_lsn);
+extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
+ XLogRecPtr fpw_lsn,
+ uint8 flags);
extern void XLogFlush(XLogRecPtr RecPtr);
extern bool XLogBackgroundFlush(void);
extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
@@ -247,6 +259,7 @@ extern char *XLogFileNameP(TimeLineID tli, XLogSegNo segno);
extern void UpdateControlFile(void);
extern uint64 GetSystemIdentifier(void);
+extern char *GetMockAuthenticationNonce(void);
extern bool DataChecksumsEnabled(void);
extern XLogRecPtr GetFakeLSNForUnloggedRel(void);
extern Size XLOGShmemSize(void);
@@ -264,6 +277,7 @@ extern void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p)
extern XLogRecPtr GetRedoRecPtr(void);
extern XLogRecPtr GetInsertRecPtr(void);
extern XLogRecPtr GetFlushRecPtr(void);
+extern XLogRecPtr GetLastImportantRecPtr(void);
extern void GetNextXidAndEpoch(TransactionId *xid, uint32 *epoch);
extern void RemovePromoteSignalFiles(void);
@@ -277,8 +291,26 @@ extern void assign_max_wal_size(int newval, void *extra);
extern void assign_checkpoint_completion_target(double newval, void *extra);
/*
- * Starting/stopping a base backup
+ * Routines to start, stop, and get status of a base backup.
+ */
+
+/*
+ * Session-level status of base backups
+ *
+ * This is used in parallel with the shared memory status to control parallel
+ * execution of base backup functions for a given session, be it a backend
+ * dedicated to replication or a normal backend connected to a database. The
+ * update of the session-level status happens at the same time as the shared
+ * memory counters to keep a consistent global and local state of the backups
+ * running.
*/
+typedef enum SessionBackupState
+{
+ SESSION_BACKUP_NONE,
+ SESSION_BACKUP_EXCLUSIVE,
+ SESSION_BACKUP_NON_EXCLUSIVE
+} SessionBackupState;
+
extern XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast,
TimeLineID *starttli_p, StringInfo labelfile, DIR *tblspcdir,
List **tablespaces, StringInfo tblspcmapfile, bool infotbssize,
@@ -286,6 +318,7 @@ extern XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast,
extern XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive,
TimeLineID *stoptli_p);
extern void do_pg_abort_backup(void);
+extern SessionBackupState get_backup_status(void);
/* File path names (all relative to $PGDATA) */
#define BACKUP_LABEL_FILE "backup_label"
diff --git a/src/include/access/xlog_fn.h b/src/include/access/xlog_fn.h
deleted file mode 100644
index 576a4dc741..0000000000
--- a/src/include/access/xlog_fn.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * xlog_fn.h
- *
- * PostgreSQL transaction log SQL-callable function declarations
- *
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/access/xlog_fn.h
- */
-#ifndef XLOG_FN_H
-#define XLOG_FN_H
-
-#include "fmgr.h"
-
-extern Datum pg_start_backup(PG_FUNCTION_ARGS);
-extern Datum pg_stop_backup(PG_FUNCTION_ARGS);
-extern Datum pg_stop_backup_v2(PG_FUNCTION_ARGS);
-extern Datum pg_switch_xlog(PG_FUNCTION_ARGS);
-extern Datum pg_create_restore_point(PG_FUNCTION_ARGS);
-extern Datum pg_current_xlog_location(PG_FUNCTION_ARGS);
-extern Datum pg_current_xlog_insert_location(PG_FUNCTION_ARGS);
-extern Datum pg_current_xlog_flush_location(PG_FUNCTION_ARGS);
-extern Datum pg_last_xlog_receive_location(PG_FUNCTION_ARGS);
-extern Datum pg_last_xlog_replay_location(PG_FUNCTION_ARGS);
-extern Datum pg_last_xact_replay_timestamp(PG_FUNCTION_ARGS);
-extern Datum pg_xlogfile_name_offset(PG_FUNCTION_ARGS);
-extern Datum pg_xlogfile_name(PG_FUNCTION_ARGS);
-extern Datum pg_is_in_recovery(PG_FUNCTION_ARGS);
-extern Datum pg_xlog_replay_pause(PG_FUNCTION_ARGS);
-extern Datum pg_xlog_replay_resume(PG_FUNCTION_ARGS);
-extern Datum pg_is_xlog_replay_paused(PG_FUNCTION_ARGS);
-extern Datum pg_xlog_location_diff(PG_FUNCTION_ARGS);
-extern Datum pg_is_in_backup(PG_FUNCTION_ARGS);
-extern Datum pg_backup_start_time(PG_FUNCTION_ARGS);
-
-#endif /* XLOG_FN_H */
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 0a595ccc48..6e2bfd0ad0 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -1,7 +1,7 @@
/*
* xlog_internal.h
*
- * PostgreSQL transaction log internal declarations
+ * PostgreSQL write-ahead log internal declarations
*
* NOTE: this file is intended to contain declarations useful for
* manipulating the XLOG files directly, but it is not supposed to be
@@ -9,9 +9,9 @@
* So the XLogRecord typedef and associated stuff appear in xlogrecord.h.
*
* Note: This file must be includable in both frontend and backend contexts,
- * to allow stand-alone tools like pg_receivexlog to deal with WAL files.
+ * to allow stand-alone tools like pg_receivewal to deal with WAL files.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/xlog_internal.h
@@ -31,7 +31,7 @@
/*
* Each page of XLOG file has a header like this:
*/
-#define XLOG_PAGE_MAGIC 0xD093 /* can be used as WAL version indicator */
+#define XLOG_PAGE_MAGIC 0xD097 /* can be used as WAL version indicator */
typedef struct XLogPageHeaderData
{
@@ -128,7 +128,7 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
/*
* The XLog directory and control file (relative to $PGDATA)
*/
-#define XLOGDIR "pg_xlog"
+#define XLOGDIR "pg_wal"
#define XLOG_CONTROL_FILE "global/pg_control"
/*
@@ -153,7 +153,7 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN)
/*
- * XLOG segment with .partial suffix. Used by pg_receivexlog and at end of
+ * XLOG segment with .partial suffix. Used by pg_receivewal and at end of
* archive recovery, when we want to archive a WAL segment but it might not
* be complete yet.
*/
@@ -266,6 +266,9 @@ typedef enum
* "VACUUM". rm_desc can then be called to obtain additional detail for the
* record, if available (e.g. the last block).
*
+ * rm_mask takes as input a page modified by the resource manager and masks
+ * out bits that shouldn't be flagged by wal_consistency_checking.
+ *
* RmgrTable[] is indexed by RmgrId values (see rmgrlist.h).
*/
typedef struct RmgrData
@@ -276,6 +279,7 @@ typedef struct RmgrData
const char *(*rm_identify) (uint8 info);
void (*rm_startup) (void);
void (*rm_cleanup) (void);
+ void (*rm_mask) (char *pagedata, BlockNumber blkno);
} RmgrData;
extern const RmgrData RmgrTable[];
@@ -283,8 +287,8 @@ extern const RmgrData RmgrTable[];
/*
* Exported to support xlog switching from checkpointer
*/
-extern pg_time_t GetLastSegSwitchTime(void);
-extern XLogRecPtr RequestXLogSwitch(void);
+extern pg_time_t GetLastSegSwitchData(XLogRecPtr *lastSwitchLSN);
+extern XLogRecPtr RequestXLogSwitch(bool mark_unimportant);
extern void GetOldestRestartPoint(XLogRecPtr *oldrecptr, TimeLineID *oldtli);
diff --git a/src/include/access/xlogdefs.h b/src/include/access/xlogdefs.h
index c2c6632e63..0f07bb2674 100644
--- a/src/include/access/xlogdefs.h
+++ b/src/include/access/xlogdefs.h
@@ -1,10 +1,10 @@
/*
* xlogdefs.h
*
- * Postgres transaction log manager record pointer and
+ * Postgres write-ahead log manager record pointer and
* timeline number definitions
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/xlogdefs.h
diff --git a/src/include/access/xloginsert.h b/src/include/access/xloginsert.h
index cc0177ef4e..d30786fa0d 100644
--- a/src/include/access/xloginsert.h
+++ b/src/include/access/xloginsert.h
@@ -3,7 +3,7 @@
*
* Functions for generating WAL records
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/xloginsert.h
@@ -40,7 +40,7 @@
/* prototypes for public functions in xloginsert.c: */
extern void XLogBeginInsert(void);
-extern void XLogIncludeOrigin(void);
+extern void XLogSetRecordFlags(uint8 flags);
extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info);
extern void XLogEnsureRecordSpace(int nbuffers, int ndatas);
extern void XLogRegisterData(char *data, int len);
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index deaa7f5128..956c9bd3a8 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -3,7 +3,7 @@
* xlogreader.h
* Definitions for the generic XLog reading facility
*
- * Portions Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/include/access/xlogreader.h
@@ -51,7 +51,8 @@ typedef struct
uint8 flags;
/* Information on full-page image, if any */
- bool has_image;
+ bool has_image; /* has image, even for consistency checking */
+ bool apply_image; /* has image that should be restored */
char *bkp_image;
uint16 hole_offset;
uint16 hole_length;
@@ -160,6 +161,24 @@ struct XLogReaderState
/* beginning of the WAL record being read. */
XLogRecPtr currRecPtr;
+ /* timeline to read it from, 0 if a lookup is required */
+ TimeLineID currTLI;
+
+ /*
+ * Safe point to read to in currTLI if current TLI is historical
+ * (tliSwitchPoint) or InvalidXLogRecPtr if on current timeline.
+ *
+ * Actually set to the start of the segment containing the timeline switch
+ * that ends currTLI's validity, not the LSN of the switch its self, since
+ * we can't assume the old segment will be present.
+ */
+ XLogRecPtr currTLIValidUntil;
+
+ /*
+ * If currTLI is not the most recent known timeline, the next timeline to
+ * read from when currTLIValidUntil is reached.
+ */
+ TimeLineID nextTLI;
/* Buffer for current ReadRecord result (expandable) */
char *readRecordBuf;
@@ -205,6 +224,8 @@ extern bool DecodeXLogRecord(XLogReaderState *state, XLogRecord *record,
((decoder)->blocks[block_id].in_use)
#define XLogRecHasBlockImage(decoder, block_id) \
((decoder)->blocks[block_id].has_image)
+#define XLogRecBlockImageApply(decoder, block_id) \
+ ((decoder)->blocks[block_id].apply_image)
extern bool RestoreBlockImage(XLogReaderState *recoder, uint8 block_id, char *dst);
extern char *XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len);
diff --git a/src/include/access/xlogrecord.h b/src/include/access/xlogrecord.h
index 3dfcb494f7..eeb6a30c1c 100644
--- a/src/include/access/xlogrecord.h
+++ b/src/include/access/xlogrecord.h
@@ -3,7 +3,7 @@
*
* Definitions for the WAL record format.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/xlogrecord.h
@@ -56,8 +56,8 @@ typedef struct XLogRecord
/*
* The high 4 bits in xl_info may be used freely by rmgr. The
- * XLR_SPECIAL_REL_UPDATE bit can be passed by XLogInsert caller. The rest
- * are set internally by XLogInsert.
+ * XLR_SPECIAL_REL_UPDATE and XLR_CHECK_CONSISTENCY bits can be passed by
+ * XLogInsert caller. The rest are set internally by XLogInsert.
*/
#define XLR_INFO_MASK 0x0F
#define XLR_RMGR_INFO_MASK 0xF0
@@ -71,6 +71,15 @@ typedef struct XLogRecord
#define XLR_SPECIAL_REL_UPDATE 0x01
/*
+ * Enforces consistency checks of replayed WAL at recovery. If enabled,
+ * each record will log a full-page write for each block modified by the
+ * record and will reuse it afterwards for consistency checks. The caller
+ * of XLogInsert can use this value if necessary, but if
+ * wal_consistency_checking is enabled for a rmgr this is set unconditionally.
+ */
+#define XLR_CHECK_CONSISTENCY 0x02
+
+/*
* Header info for block data appended to an XLOG record.
*
* 'data_length' is the length of the rmgr-specific payload data associated
@@ -137,6 +146,7 @@ typedef struct XLogRecordBlockImageHeader
/* Information stored in bimg_info */
#define BKPIMAGE_HAS_HOLE 0x01 /* page image has "hole" */
#define BKPIMAGE_IS_COMPRESSED 0x02 /* page image is compressed */
+#define BKPIMAGE_APPLY 0x04 /* page image should be restored during replay */
/*
* Extra header information used when page image has "hole" and
diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h
index d027ea173b..114ffbcc53 100644
--- a/src/include/access/xlogutils.h
+++ b/src/include/access/xlogutils.h
@@ -3,7 +3,7 @@
*
* Utilities for replaying WAL records.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/xlogutils.h
@@ -52,4 +52,7 @@ extern int read_local_xlog_page(XLogReaderState *state,
XLogRecPtr targetRecPtr, char *cur_page,
TimeLineID *pageTLI);
+extern void XLogReadDetermineTimeline(XLogReaderState *state,
+ XLogRecPtr wantPage, uint32 wantLength);
+
#endif
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h
index 0daf681a22..51a0ba925f 100644
--- a/src/include/bootstrap/bootstrap.h
+++ b/src/include/bootstrap/bootstrap.h
@@ -4,7 +4,7 @@
* include file for the bootstrapping code
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
diff --git a/src/include/c.h b/src/include/c.h
index ca12c048a0..5e91b64305 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -9,7 +9,7 @@
* polluting the namespace with lots of stuff...
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/c.h
@@ -149,6 +149,8 @@
/*
* CppAsString
* Convert the argument to a string, using the C preprocessor.
+ * CppAsString2
+ * Convert the argument to a string, after one round of macro expansion.
* CppConcat
* Concatenate two arguments together, using the C preprocessor.
*
@@ -157,6 +159,7 @@
* backward compatibility with existing PostgreSQL code.
*/
#define CppAsString(identifier) #identifier
+#define CppAsString2(x) CppAsString(x)
#define CppConcat(x, y) x##y
/*
@@ -340,10 +343,11 @@ typedef unsigned PG_INT128_TYPE uint128;
#define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF)
#define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF)
-/* Select timestamp representation (float8 or int64) */
-#ifdef USE_INTEGER_DATETIMES
+/*
+ * We now always use int64 timestamps, but keep this symbol defined for the
+ * benefit of external code that might test it.
+ */
#define HAVE_INT64_TIMESTAMP
-#endif
/*
* Size
@@ -416,7 +420,7 @@ typedef uint32 CommandId;
typedef struct
{
int indx[MAXDIM];
-} IntArray;
+} IntArray;
/* ----------------
* Variable-length datatypes all share the 'struct varlena' header.
@@ -425,10 +429,11 @@ typedef struct
* may be compressed or moved out-of-line. However datatype-specific routines
* are mostly content to deal with de-TOASTed values only, and of course
* client-side routines should never see a TOASTed value. But even in a
- * de-TOASTed value, beware of touching vl_len_ directly, as its representation
- * is no longer convenient. It's recommended that code always use the VARDATA,
- * VARSIZE, and SET_VARSIZE macros instead of relying on direct mentions of
- * the struct fields. See postgres.h for details of the TOASTed form.
+ * de-TOASTed value, beware of touching vl_len_ directly, as its
+ * representation is no longer convenient. It's recommended that code always
+ * use macros VARDATA_ANY, VARSIZE_ANY, VARSIZE_ANY_EXHDR, VARDATA, VARSIZE,
+ * and SET_VARSIZE instead of relying on direct mentions of the struct fields.
+ * See postgres.h for details of the TOASTed form.
* ----------------
*/
struct varlena
@@ -442,7 +447,7 @@ struct varlena
/*
* These widely-used datatypes are just a varlena header and the data bytes.
* There is no terminating null or anything like that --- the data length is
- * always VARSIZE(ptr) - VARHDRSZ.
+ * always VARSIZE_ANY_EXHDR(ptr).
*/
typedef struct varlena bytea;
typedef struct varlena text;
@@ -527,6 +532,9 @@ typedef NameData *Name;
#define PointerIsAligned(pointer, type) \
(((uintptr_t)(pointer) % (sizeof (type))) == 0)
+#define OffsetToPointer(base, offset) \
+ ((void *)((char *) base + offset))
+
#define OidIsValid(objectId) ((bool) ((objectId) != InvalidOid))
#define RegProcedureIsValid(p) OidIsValid(p)
@@ -939,6 +947,22 @@ typedef NameData *Name;
#endif
+/*
+ * Hints to the compiler about the likelihood of a branch. Both likely() and
+ * unlikely() return the boolean value of the contained expression.
+ *
+ * These should only be used sparingly, in very hot code paths. It's very easy
+ * to mis-estimate likelihoods.
+ */
+#if __GNUC__ >= 3
+#define likely(x) __builtin_expect((x) != 0, 1)
+#define unlikely(x) __builtin_expect((x) != 0, 0)
+#else
+#define likely(x) ((x) != 0)
+#define unlikely(x) ((x) != 0)
+#endif
+
+
/* ----------------------------------------------------------------
* Section 8: random stuff
* ----------------------------------------------------------------
@@ -972,7 +996,7 @@ typedef NameData *Name;
/* gettext domain name mangling */
/*
- * To better support parallel installations of major PostgeSQL
+ * To better support parallel installations of major PostgreSQL
* versions as well as parallel installations of major library soname
* versions, we mangle the gettext domain name by appending those
* version numbers. The coding rule ought to be that wherever the
@@ -984,10 +1008,6 @@ typedef NameData *Name;
*
* Make sure this matches the installation rules in nls-global.mk.
*/
-
-/* need a second indirection because we want to stringize the macro value, not the name */
-#define CppAsString2(x) CppAsString(x)
-
#ifdef SO_MAJOR_VERSION
#define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION)
#else
diff --git a/src/include/catalog/binary_upgrade.h b/src/include/catalog/binary_upgrade.h
index 373498441f..98089e3c1a 100644
--- a/src/include/catalog/binary_upgrade.h
+++ b/src/include/catalog/binary_upgrade.h
@@ -4,7 +4,7 @@
* variables used for binary upgrades
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/binary_upgrade.h
diff --git a/src/include/catalog/catalog.h b/src/include/catalog/catalog.h
index b90ffa1c83..7062d7ed2f 100644
--- a/src/include/catalog/catalog.h
+++ b/src/include/catalog/catalog.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/catalog.h
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 2ca3cd911a..06fff799af 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -34,7 +34,7 @@
* database contents or layout, such as altering tuple headers.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201608131
+#define CATALOG_VERSION_NO 201705141
#endif
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index 2aff496881..c4d0c694f4 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -4,7 +4,7 @@
* Routines to support inter-object dependencies.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -148,6 +148,7 @@ typedef enum ObjectClass
OCLASS_REWRITE, /* pg_rewrite */
OCLASS_TRIGGER, /* pg_trigger */
OCLASS_SCHEMA, /* pg_namespace */
+ OCLASS_STATISTIC_EXT, /* pg_statistic_ext */
OCLASS_TSPARSER, /* pg_ts_parser */
OCLASS_TSDICT, /* pg_ts_dict */
OCLASS_TSTEMPLATE, /* pg_ts_template */
@@ -167,16 +168,23 @@ typedef enum ObjectClass
OCLASS_EXTENSION, /* pg_extension */
OCLASS_EVENT_TRIGGER, /* pg_event_trigger */
OCLASS_POLICY, /* pg_policy */
+ OCLASS_PUBLICATION, /* pg_publication */
+ OCLASS_PUBLICATION_REL, /* pg_publication_rel */
+ OCLASS_SUBSCRIPTION, /* pg_subscription */
OCLASS_TRANSFORM /* pg_transform */
} ObjectClass;
#define LAST_OCLASS OCLASS_TRANSFORM
+/* flag bits for performDeletion/performMultipleDeletions: */
+#define PERFORM_DELETION_INTERNAL 0x0001 /* internal action */
+#define PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */
+#define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */
+#define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */
+#define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */
-/* in dependency.c */
-#define PERFORM_DELETION_INTERNAL 0x0001
-#define PERFORM_DELETION_CONCURRENTLY 0x0002
+/* in dependency.c */
extern void performDeletion(const ObjectAddress *object,
DropBehavior behavior, int flags);
@@ -189,10 +197,6 @@ extern void performRename(const ObjectAddress *object,
const char *oldname,
const char *newname);
#endif
-
-extern void deleteWhatDependsOn(const ObjectAddress *object,
- bool showNotices);
-
extern void recordDependencyOnExpr(const ObjectAddress *depender,
Node *expr, List *rtable,
DependencyType behavior);
@@ -200,7 +204,8 @@ extern void recordDependencyOnExpr(const ObjectAddress *depender,
extern void recordDependencyOnSingleRelExpr(const ObjectAddress *depender,
Node *expr, Oid relId,
DependencyType behavior,
- DependencyType self_behavior);
+ DependencyType self_behavior,
+ bool ignore_self);
extern ObjectClass getObjectClass(const ObjectAddress *object);
@@ -244,11 +249,9 @@ extern long changeDependencyFor(Oid classId, Oid objectId,
extern Oid getExtensionOfObject(Oid classId, Oid objectId);
-extern bool sequenceIsOwned(Oid seqId, Oid *tableId, int32 *colId);
-
-extern void markSequenceUnowned(Oid seqId);
-
-extern List *getOwnedSequences(Oid relid);
+extern bool sequenceIsOwned(Oid seqId, char deptype, Oid *tableId, int32 *colId);
+extern List *getOwnedSequences(Oid relid, AttrNumber attnum);
+extern Oid getOwnedSequence(Oid relid, AttrNumber attnum);
extern Oid get_constraint_index(Oid constraintId);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index 8e81de5f6d..a522b4cd82 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -9,7 +9,7 @@
* bootstrap file from these header files.)
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/genbki.h
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index a5f053fc52..12ad62532b 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -4,7 +4,7 @@
* prototypes for functions in backend/catalog/heap.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -154,5 +154,16 @@ extern Oid *GetRelationDistributionNodes(PGXCSubCluster *subcluster,
extern Oid *BuildRelationDistributionNodes(List *nodes, int *numnodes);
extern Oid *SortRelationDistributionNodes(Oid *nodeoids, int numnodes);
#endif
+/* pg_partitioned_table catalog manipulation functions */
+extern void StorePartitionKey(Relation rel,
+ char strategy,
+ int16 partnatts,
+ AttrNumber *partattrs,
+ List *partexprs,
+ Oid *partopclass,
+ Oid *partcollation);
+extern void RemovePartitionKeyByRelId(Oid relid);
+extern void StorePartitionBound(Relation rel, Relation parent,
+ PartitionBoundSpec *bound);
#endif /* HEAP_H */
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 37e6ef3fa9..20bec90b9d 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -4,7 +4,7 @@
* prototypes for catalog/index.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/index.h
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
index f2d8be7856..35f50b69a5 100644
--- a/src/include/catalog/indexing.h
+++ b/src/include/catalog/indexing.h
@@ -5,7 +5,7 @@
* on system catalogs
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -31,9 +31,15 @@ typedef struct ResultRelInfo *CatalogIndexState;
*/
extern CatalogIndexState CatalogOpenIndexes(Relation heapRel);
extern void CatalogCloseIndexes(CatalogIndexState indstate);
-extern void CatalogIndexInsert(CatalogIndexState indstate,
- HeapTuple heapTuple);
-extern void CatalogUpdateIndexes(Relation heapRel, HeapTuple heapTuple);
+extern Oid CatalogTupleInsert(Relation heapRel, HeapTuple tup);
+extern Oid CatalogTupleInsertWithInfo(Relation heapRel, HeapTuple tup,
+ CatalogIndexState indstate);
+extern void CatalogTupleUpdate(Relation heapRel, ItemPointer otid,
+ HeapTuple tup);
+extern void CatalogTupleUpdateWithInfo(Relation heapRel,
+ ItemPointer otid, HeapTuple tup,
+ CatalogIndexState indstate);
+extern void CatalogTupleDelete(Relation heapRel, ItemPointer tid);
/*
@@ -177,6 +183,13 @@ DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index, 2683, on pg_largeobject using
DECLARE_UNIQUE_INDEX(pg_largeobject_metadata_oid_index, 2996, on pg_largeobject_metadata using btree(oid oid_ops));
#define LargeObjectMetadataOidIndexId 2996
+DECLARE_UNIQUE_INDEX(pg_statistic_ext_oid_index, 3380, on pg_statistic_ext using btree(oid oid_ops));
+#define StatisticExtOidIndexId 3380
+DECLARE_UNIQUE_INDEX(pg_statistic_ext_name_index, 3997, on pg_statistic_ext using btree(stxname name_ops, stxnamespace oid_ops));
+#define StatisticExtNameIndexId 3997
+DECLARE_INDEX(pg_statistic_ext_relid_index, 3379, on pg_statistic_ext using btree(stxrelid oid_ops));
+#define StatisticExtRelidIndexId 3379
+
DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, on pg_namespace using btree(nspname name_ops));
#define NamespaceNameIndexId 2684
DECLARE_UNIQUE_INDEX(pg_namespace_oid_index, 2685, on pg_namespace using btree(oid oid_ops));
@@ -210,6 +223,9 @@ DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index, 2692, on pg_rewrite using btree(oid o
DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, on pg_rewrite using btree(ev_class oid_ops, rulename name_ops));
#define RewriteRelRulenameIndexId 2693
+DECLARE_UNIQUE_INDEX(pg_sequence_seqrelid_index, 5002, on pg_sequence using btree(seqrelid oid_ops));
+#define SequenceRelidIndexId 5002
+
DECLARE_INDEX(pg_shdepend_depender_index, 1232, on pg_shdepend using btree(dbid oid_ops, classid oid_ops, objid oid_ops, objsubid int4_ops));
#define SharedDependDependerIndexId 1232
DECLARE_INDEX(pg_shdepend_reference_index, 1233, on pg_shdepend using btree(refclassid oid_ops, refobjid oid_ops));
@@ -341,6 +357,30 @@ DECLARE_UNIQUE_INDEX(pg_replication_origin_roiident_index, 6001, on pg_replicati
DECLARE_UNIQUE_INDEX(pg_replication_origin_roname_index, 6002, on pg_replication_origin using btree(roname text_pattern_ops));
#define ReplicationOriginNameIndex 6002
+DECLARE_UNIQUE_INDEX(pg_partitioned_table_partrelid_index, 3351, on pg_partitioned_table using btree(partrelid oid_ops));
+#define PartitionedRelidIndexId 3351
+
+DECLARE_UNIQUE_INDEX(pg_publication_oid_index, 6110, on pg_publication using btree(oid oid_ops));
+#define PublicationObjectIndexId 6110
+
+DECLARE_UNIQUE_INDEX(pg_publication_pubname_index, 6111, on pg_publication using btree(pubname name_ops));
+#define PublicationNameIndexId 6111
+
+DECLARE_UNIQUE_INDEX(pg_publication_rel_oid_index, 6112, on pg_publication_rel using btree(oid oid_ops));
+#define PublicationRelObjectIndexId 6112
+
+DECLARE_UNIQUE_INDEX(pg_publication_rel_prrelid_prpubid_index, 6113, on pg_publication_rel using btree(prrelid oid_ops, prpubid oid_ops));
+#define PublicationRelPrrelidPrpubidIndexId 6113
+
+DECLARE_UNIQUE_INDEX(pg_subscription_oid_index, 6114, on pg_subscription using btree(oid oid_ops));
+#define SubscriptionObjectIndexId 6114
+
+DECLARE_UNIQUE_INDEX(pg_subscription_subname_index, 6115, on pg_subscription using btree(subdbid oid_ops, subname name_ops));
+#define SubscriptionNameIndexId 6115
+
+DECLARE_UNIQUE_INDEX(pg_subscription_rel_srrelid_srsubid_index, 6117, on pg_subscription_rel using btree(srrelid oid_ops, srsubid oid_ops));
+#define SubscriptionRelSrrelidSrsubidIndexId 6117
+
/* last step of initialization script: build the indexes declared above */
BUILD_INDICES
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h
index 3c31dafa9d..14df88290a 100644
--- a/src/include/catalog/namespace.h
+++ b/src/include/catalog/namespace.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/namespace.h
@@ -93,6 +93,9 @@ extern bool CollationIsVisible(Oid collid);
extern Oid ConversionGetConid(const char *conname);
extern bool ConversionIsVisible(Oid conid);
+extern Oid get_statistics_object_oid(List *names, bool missing_ok);
+extern bool StatisticsObjIsVisible(Oid stxid);
+
extern Oid get_ts_parser_oid(List *names, bool missing_ok);
extern bool TSParserIsVisible(Oid prsId);
@@ -145,6 +148,7 @@ extern Oid get_collation_oid(List *collname, bool missing_ok);
extern Oid get_conversion_oid(List *conname, bool missing_ok);
extern Oid FindDefaultConversionProc(int32 for_encoding, int32 to_encoding);
+
/* initialization & transaction cleanup code */
extern void InitializeSearchPath(void);
extern void AtEOXact_Namespace(bool isCommit, bool parallel);
diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h
index 1ef7f1f16c..3a6dd596ce 100644
--- a/src/include/catalog/objectaccess.h
+++ b/src/include/catalog/objectaccess.h
@@ -3,7 +3,7 @@
*
* Object access hooks.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*/
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
index 583a1206f3..406c38bc73 100644
--- a/src/include/catalog/objectaddress.h
+++ b/src/include/catalog/objectaddress.h
@@ -3,7 +3,7 @@
* objectaddress.h
* functions for working with object addresses
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/objectaddress.h
@@ -40,17 +40,17 @@ extern const ObjectAddress InvalidObjectAddress;
#define ObjectAddressSet(addr, class_id, object_id) \
ObjectAddressSubSet(addr, class_id, object_id, 0)
-extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
- List *objargs, Relation *relp,
+extern ObjectAddress get_object_address(ObjectType objtype, Node *object,
+ Relation *relp,
LOCKMODE lockmode, bool missing_ok);
extern ObjectAddress get_object_address_rv(ObjectType objtype, RangeVar *rel,
- List *objname, List *objargs, Relation *relp,
+ List *object, Relation *relp,
LOCKMODE lockmode, bool missing_ok);
extern void check_object_ownership(Oid roleid,
ObjectType objtype, ObjectAddress address,
- List *objname, List *objargs, Relation relation);
+ Node *object, Relation relation);
extern Oid get_object_namespace(const ObjectAddress *address);
diff --git a/src/include/catalog/opfam_internal.h b/src/include/catalog/opfam_internal.h
index 7eb882fd12..448ad9708b 100644
--- a/src/include/catalog/opfam_internal.h
+++ b/src/include/catalog/opfam_internal.h
@@ -2,7 +2,7 @@
*
* opfam_internal.h
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/opfam_internal.h
diff --git a/src/include/catalog/partition.h b/src/include/catalog/partition.h
new file mode 100644
index 0000000000..0a1e468898
--- /dev/null
+++ b/src/include/catalog/partition.h
@@ -0,0 +1,101 @@
+/*-------------------------------------------------------------------------
+ *
+ * partition.h
+ * Header file for structures and utility functions related to
+ * partitioning
+ *
+ * Copyright (c) 2007-2017, PostgreSQL Global Development Group
+ *
+ * src/include/catalog/partition.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PARTITION_H
+#define PARTITION_H
+
+#include "fmgr.h"
+#include "executor/tuptable.h"
+#include "nodes/execnodes.h"
+#include "parser/parse_node.h"
+#include "utils/rel.h"
+
+/*
+ * PartitionBoundInfo encapsulates a set of partition bounds. It is usually
+ * associated with partitioned tables as part of its partition descriptor.
+ *
+ * The internal structure is opaque outside partition.c.
+ */
+typedef struct PartitionBoundInfoData *PartitionBoundInfo;
+
+/*
+ * Information about partitions of a partitioned table.
+ */
+typedef struct PartitionDescData
+{
+ int nparts; /* Number of partitions */
+ Oid *oids; /* OIDs of partitions */
+ PartitionBoundInfo boundinfo; /* collection of partition bounds */
+} PartitionDescData;
+
+typedef struct PartitionDescData *PartitionDesc;
+
+/*-----------------------
+ * PartitionDispatch - information about one partitioned table in a partition
+ * hierarchy required to route a tuple to one of its partitions
+ *
+ * reldesc Relation descriptor of the table
+ * key Partition key information of the table
+ * keystate Execution state required for expressions in the partition key
+ * partdesc Partition descriptor of the table
+ * tupslot A standalone TupleTableSlot initialized with this table's tuple
+ * descriptor
+ * tupmap TupleConversionMap to convert from the parent's rowtype to
+ * this table's rowtype (when extracting the partition key of a
+ * tuple just before routing it through this table)
+ * indexes Array with partdesc->nparts members (for details on what
+ * individual members represent, see how they are set in
+ * RelationGetPartitionDispatchInfo())
+ *-----------------------
+ */
+typedef struct PartitionDispatchData
+{
+ Relation reldesc;
+ PartitionKey key;
+ List *keystate; /* list of ExprState */
+ PartitionDesc partdesc;
+ TupleTableSlot *tupslot;
+ TupleConversionMap *tupmap;
+ int *indexes;
+} PartitionDispatchData;
+
+typedef struct PartitionDispatchData *PartitionDispatch;
+
+extern void RelationBuildPartitionDesc(Relation relation);
+extern bool partition_bounds_equal(PartitionKey key,
+ PartitionBoundInfo p1, PartitionBoundInfo p2);
+
+extern void check_new_partition_bound(char *relname, Relation parent,
+ PartitionBoundSpec *spec);
+extern Oid get_partition_parent(Oid relid);
+extern List *get_qual_from_partbound(Relation rel, Relation parent,
+ PartitionBoundSpec *spec);
+extern List *map_partition_varattnos(List *expr, int target_varno,
+ Relation partrel, Relation parent);
+extern List *RelationGetPartitionQual(Relation rel);
+extern Expr *get_partition_qual_relid(Oid relid);
+
+/* For tuple routing */
+extern PartitionDispatch *RelationGetPartitionDispatchInfo(Relation rel,
+ int lockmode, int *num_parted,
+ List **leaf_part_oids);
+extern void FormPartitionKeyDatum(PartitionDispatch pd,
+ TupleTableSlot *slot,
+ EState *estate,
+ Datum *values,
+ bool *isnull);
+extern int get_partition_for_tuple(PartitionDispatch *pd,
+ TupleTableSlot *slot,
+ EState *estate,
+ PartitionDispatchData **failed_at,
+ TupleTableSlot **failed_slot);
+#endif /* PARTITION_H */
diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h
index 8865bba010..1ffde6cdc5 100644
--- a/src/include/catalog/pg_aggregate.h
+++ b/src/include/catalog/pg_aggregate.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_aggregate.h
diff --git a/src/include/catalog/pg_am.h b/src/include/catalog/pg_am.h
index 1116923799..9b6dc38f64 100644
--- a/src/include/catalog/pg_am.h
+++ b/src/include/catalog/pg_am.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_am.h
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index a15b0ec309..da0228de6b 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -30,7 +30,7 @@
* intentional denormalization of the catalogs to buy lookup speed.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_amop.h
@@ -373,6 +373,16 @@ DATA(insert ( 1984 829 829 4 s 1225 403 0 ));
DATA(insert ( 1984 829 829 5 s 1224 403 0 ));
/*
+ * btree macaddr8
+ */
+
+DATA(insert ( 3371 774 774 1 s 3364 403 0 ));
+DATA(insert ( 3371 774 774 2 s 3365 403 0 ));
+DATA(insert ( 3371 774 774 3 s 3362 403 0 ));
+DATA(insert ( 3371 774 774 4 s 3367 403 0 ));
+DATA(insert ( 3371 774 774 5 s 3366 403 0 ));
+
+/*
* btree network
*/
@@ -553,6 +563,8 @@ DATA(insert ( 1977 20 23 1 s 416 405 0 ));
DATA(insert ( 1983 1186 1186 1 s 1330 405 0 ));
/* macaddr_ops */
DATA(insert ( 1985 829 829 1 s 1220 405 0 ));
+/* macaddr8_ops */
+DATA(insert ( 3372 774 774 1 s 3362 405 0 ));
/* name_ops */
DATA(insert ( 1987 19 19 1 s 93 405 0 ));
/* oid_ops */
@@ -573,8 +585,6 @@ DATA(insert ( 2040 1114 1114 1 s 2060 405 0 ));
DATA(insert ( 2222 16 16 1 s 91 405 0 ));
/* bytea_ops */
DATA(insert ( 2223 17 17 1 s 1955 405 0 ));
-/* int2vector_ops */
-DATA(insert ( 2224 22 22 1 s 386 405 0 ));
/* xid_ops */
DATA(insert ( 2225 28 28 1 s 352 405 0 ));
/* cid_ops */
@@ -673,8 +683,7 @@ DATA(insert ( 2595 718 718 14 s 2864 783 0 ));
DATA(insert ( 2595 718 600 15 o 3291 783 1970 ));
/*
- * gin array_ops (these anyarray operators are used with all the opclasses
- * of the family)
+ * gin array_ops
*/
DATA(insert ( 2745 2277 2277 1 s 2750 2742 0 ));
DATA(insert ( 2745 2277 2277 2 s 2751 2742 0 ));
@@ -863,6 +872,21 @@ DATA(insert ( 3550 869 869 25 s 932 783 0 ));
DATA(insert ( 3550 869 869 26 s 933 783 0 ));
DATA(insert ( 3550 869 869 27 s 934 783 0 ));
+/*
+ * SP-GiST inet_ops
+ */
+DATA(insert ( 3794 869 869 3 s 3552 4000 0 ));
+DATA(insert ( 3794 869 869 18 s 1201 4000 0 ));
+DATA(insert ( 3794 869 869 19 s 1202 4000 0 ));
+DATA(insert ( 3794 869 869 20 s 1203 4000 0 ));
+DATA(insert ( 3794 869 869 21 s 1204 4000 0 ));
+DATA(insert ( 3794 869 869 22 s 1205 4000 0 ));
+DATA(insert ( 3794 869 869 23 s 1206 4000 0 ));
+DATA(insert ( 3794 869 869 24 s 931 4000 0 ));
+DATA(insert ( 3794 869 869 25 s 932 4000 0 ));
+DATA(insert ( 3794 869 869 26 s 933 4000 0 ));
+DATA(insert ( 3794 869 869 27 s 934 4000 0 ));
+
/* BRIN opclasses */
/* minmax bytea */
DATA(insert ( 4064 17 17 1 s 1957 3580 0 ));
@@ -987,6 +1011,12 @@ DATA(insert ( 4074 829 829 2 s 1223 3580 0 ));
DATA(insert ( 4074 829 829 3 s 1220 3580 0 ));
DATA(insert ( 4074 829 829 4 s 1225 3580 0 ));
DATA(insert ( 4074 829 829 5 s 1224 3580 0 ));
+/* minmax macaddr8 */
+DATA(insert ( 4109 774 774 1 s 3364 3580 0 ));
+DATA(insert ( 4109 774 774 2 s 3365 3580 0 ));
+DATA(insert ( 4109 774 774 3 s 3362 3580 0 ));
+DATA(insert ( 4109 774 774 4 s 3367 3580 0 ));
+DATA(insert ( 4109 774 774 5 s 3366 3580 0 ));
/* minmax inet */
DATA(insert ( 4075 869 869 1 s 1203 3580 0 ));
DATA(insert ( 4075 869 869 2 s 1204 3580 0 ));
diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h
index 00320b4c33..bcbb7a1617 100644
--- a/src/include/catalog/pg_amproc.h
+++ b/src/include/catalog/pg_amproc.h
@@ -19,7 +19,7 @@
* some don't pay attention to non-default functions at all.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_amproc.h
@@ -117,6 +117,7 @@ DATA(insert ( 1976 20 23 1 2189 ));
DATA(insert ( 1976 20 21 1 2193 ));
DATA(insert ( 1982 1186 1186 1 1315 ));
DATA(insert ( 1984 829 829 1 836 ));
+DATA(insert ( 1984 829 829 2 3359 ));
DATA(insert ( 1986 19 19 1 359 ));
DATA(insert ( 1986 19 19 2 3135 ));
DATA(insert ( 1988 1700 1700 1 1769 ));
@@ -142,6 +143,7 @@ DATA(insert ( 2968 2950 2950 2 3300 ));
DATA(insert ( 2994 2249 2249 1 2987 ));
DATA(insert ( 3194 2249 2249 1 3187 ));
DATA(insert ( 3253 3220 3220 1 3251 ));
+DATA(insert ( 3371 774 774 1 4119 ));
DATA(insert ( 3522 3500 3500 1 3514 ));
DATA(insert ( 3626 3614 3614 1 3622 ));
DATA(insert ( 3683 3615 3615 1 3668 ));
@@ -173,7 +175,6 @@ DATA(insert ( 2001 1266 1266 1 1696 ));
DATA(insert ( 2040 1114 1114 1 2039 ));
DATA(insert ( 2222 16 16 1 454 ));
DATA(insert ( 2223 17 17 1 456 ));
-DATA(insert ( 2224 22 22 1 398 ));
DATA(insert ( 2225 28 28 1 450 ));
DATA(insert ( 2226 29 29 1 450 ));
DATA(insert ( 2227 702 702 1 450 ));
@@ -183,6 +184,7 @@ DATA(insert ( 2231 1042 1042 1 1080 ));
DATA(insert ( 2235 1033 1033 1 329 ));
DATA(insert ( 2969 2950 2950 1 2963 ));
DATA(insert ( 3254 3220 3220 1 3252 ));
+DATA(insert ( 3372 774 774 1 328 ));
DATA(insert ( 3523 3500 3500 1 3515 ));
DATA(insert ( 3903 3831 3831 1 3902 ));
DATA(insert ( 4034 3802 3802 1 4045 ));
@@ -255,156 +257,10 @@ DATA(insert ( 3550 869 869 9 3573 ));
/* gin */
-DATA(insert ( 2745 1007 1007 1 351 ));
-DATA(insert ( 2745 1007 1007 2 2743 ));
-DATA(insert ( 2745 1007 1007 3 2774 ));
-DATA(insert ( 2745 1007 1007 4 2744 ));
-DATA(insert ( 2745 1007 1007 6 3920 ));
-DATA(insert ( 2745 1009 1009 1 360 ));
-DATA(insert ( 2745 1009 1009 2 2743 ));
-DATA(insert ( 2745 1009 1009 3 2774 ));
-DATA(insert ( 2745 1009 1009 4 2744 ));
-DATA(insert ( 2745 1009 1009 6 3920 ));
-DATA(insert ( 2745 1015 1015 1 360 ));
-DATA(insert ( 2745 1015 1015 2 2743 ));
-DATA(insert ( 2745 1015 1015 3 2774 ));
-DATA(insert ( 2745 1015 1015 4 2744 ));
-DATA(insert ( 2745 1015 1015 6 3920 ));
-DATA(insert ( 2745 1023 1023 1 357 ));
-DATA(insert ( 2745 1023 1023 2 2743 ));
-DATA(insert ( 2745 1023 1023 3 2774 ));
-DATA(insert ( 2745 1023 1023 4 2744 ));
-DATA(insert ( 2745 1023 1023 6 3920 ));
-DATA(insert ( 2745 1561 1561 1 1596 ));
-DATA(insert ( 2745 1561 1561 2 2743 ));
-DATA(insert ( 2745 1561 1561 3 2774 ));
-DATA(insert ( 2745 1561 1561 4 2744 ));
-DATA(insert ( 2745 1561 1561 6 3920 ));
-DATA(insert ( 2745 1000 1000 1 1693 ));
-DATA(insert ( 2745 1000 1000 2 2743 ));
-DATA(insert ( 2745 1000 1000 3 2774 ));
-DATA(insert ( 2745 1000 1000 4 2744 ));
-DATA(insert ( 2745 1000 1000 6 3920 ));
-DATA(insert ( 2745 1014 1014 1 1078 ));
-DATA(insert ( 2745 1014 1014 2 2743 ));
-DATA(insert ( 2745 1014 1014 3 2774 ));
-DATA(insert ( 2745 1014 1014 4 2744 ));
-DATA(insert ( 2745 1014 1014 6 3920 ));
-DATA(insert ( 2745 1001 1001 1 1954 ));
-DATA(insert ( 2745 1001 1001 2 2743 ));
-DATA(insert ( 2745 1001 1001 3 2774 ));
-DATA(insert ( 2745 1001 1001 4 2744 ));
-DATA(insert ( 2745 1001 1001 6 3920 ));
-DATA(insert ( 2745 1002 1002 1 358 ));
-DATA(insert ( 2745 1002 1002 2 2743 ));
-DATA(insert ( 2745 1002 1002 3 2774 ));
-DATA(insert ( 2745 1002 1002 4 2744 ));
-DATA(insert ( 2745 1002 1002 6 3920 ));
-DATA(insert ( 2745 1182 1182 1 1092 ));
-DATA(insert ( 2745 1182 1182 2 2743 ));
-DATA(insert ( 2745 1182 1182 3 2774 ));
-DATA(insert ( 2745 1182 1182 4 2744 ));
-DATA(insert ( 2745 1182 1182 6 3920 ));
-DATA(insert ( 2745 1021 1021 1 354 ));
-DATA(insert ( 2745 1021 1021 2 2743 ));
-DATA(insert ( 2745 1021 1021 3 2774 ));
-DATA(insert ( 2745 1021 1021 4 2744 ));
-DATA(insert ( 2745 1021 1021 6 3920 ));
-DATA(insert ( 2745 1022 1022 1 355 ));
-DATA(insert ( 2745 1022 1022 2 2743 ));
-DATA(insert ( 2745 1022 1022 3 2774 ));
-DATA(insert ( 2745 1022 1022 4 2744 ));
-DATA(insert ( 2745 1022 1022 6 3920 ));
-DATA(insert ( 2745 1041 1041 1 926 ));
-DATA(insert ( 2745 1041 1041 2 2743 ));
-DATA(insert ( 2745 1041 1041 3 2774 ));
-DATA(insert ( 2745 1041 1041 4 2744 ));
-DATA(insert ( 2745 1041 1041 6 3920 ));
-DATA(insert ( 2745 651 651 1 926 ));
-DATA(insert ( 2745 651 651 2 2743 ));
-DATA(insert ( 2745 651 651 3 2774 ));
-DATA(insert ( 2745 651 651 4 2744 ));
-DATA(insert ( 2745 651 651 6 3920 ));
-DATA(insert ( 2745 1005 1005 1 350 ));
-DATA(insert ( 2745 1005 1005 2 2743 ));
-DATA(insert ( 2745 1005 1005 3 2774 ));
-DATA(insert ( 2745 1005 1005 4 2744 ));
-DATA(insert ( 2745 1005 1005 6 3920 ));
-DATA(insert ( 2745 1016 1016 1 842 ));
-DATA(insert ( 2745 1016 1016 2 2743 ));
-DATA(insert ( 2745 1016 1016 3 2774 ));
-DATA(insert ( 2745 1016 1016 4 2744 ));
-DATA(insert ( 2745 1016 1016 6 3920 ));
-DATA(insert ( 2745 1187 1187 1 1315 ));
-DATA(insert ( 2745 1187 1187 2 2743 ));
-DATA(insert ( 2745 1187 1187 3 2774 ));
-DATA(insert ( 2745 1187 1187 4 2744 ));
-DATA(insert ( 2745 1187 1187 6 3920 ));
-DATA(insert ( 2745 1040 1040 1 836 ));
-DATA(insert ( 2745 1040 1040 2 2743 ));
-DATA(insert ( 2745 1040 1040 3 2774 ));
-DATA(insert ( 2745 1040 1040 4 2744 ));
-DATA(insert ( 2745 1040 1040 6 3920 ));
-DATA(insert ( 2745 1003 1003 1 359 ));
-DATA(insert ( 2745 1003 1003 2 2743 ));
-DATA(insert ( 2745 1003 1003 3 2774 ));
-DATA(insert ( 2745 1003 1003 4 2744 ));
-DATA(insert ( 2745 1003 1003 6 3920 ));
-DATA(insert ( 2745 1231 1231 1 1769 ));
-DATA(insert ( 2745 1231 1231 2 2743 ));
-DATA(insert ( 2745 1231 1231 3 2774 ));
-DATA(insert ( 2745 1231 1231 4 2744 ));
-DATA(insert ( 2745 1231 1231 6 3920 ));
-DATA(insert ( 2745 1028 1028 1 356 ));
-DATA(insert ( 2745 1028 1028 2 2743 ));
-DATA(insert ( 2745 1028 1028 3 2774 ));
-DATA(insert ( 2745 1028 1028 4 2744 ));
-DATA(insert ( 2745 1028 1028 6 3920 ));
-DATA(insert ( 2745 1013 1013 1 404 ));
-DATA(insert ( 2745 1013 1013 2 2743 ));
-DATA(insert ( 2745 1013 1013 3 2774 ));
-DATA(insert ( 2745 1013 1013 4 2744 ));
-DATA(insert ( 2745 1013 1013 6 3920 ));
-DATA(insert ( 2745 1183 1183 1 1107 ));
-DATA(insert ( 2745 1183 1183 2 2743 ));
-DATA(insert ( 2745 1183 1183 3 2774 ));
-DATA(insert ( 2745 1183 1183 4 2744 ));
-DATA(insert ( 2745 1183 1183 6 3920 ));
-DATA(insert ( 2745 1185 1185 1 1314 ));
-DATA(insert ( 2745 1185 1185 2 2743 ));
-DATA(insert ( 2745 1185 1185 3 2774 ));
-DATA(insert ( 2745 1185 1185 4 2744 ));
-DATA(insert ( 2745 1185 1185 6 3920 ));
-DATA(insert ( 2745 1270 1270 1 1358 ));
-DATA(insert ( 2745 1270 1270 2 2743 ));
-DATA(insert ( 2745 1270 1270 3 2774 ));
-DATA(insert ( 2745 1270 1270 4 2744 ));
-DATA(insert ( 2745 1270 1270 6 3920 ));
-DATA(insert ( 2745 1563 1563 1 1672 ));
-DATA(insert ( 2745 1563 1563 2 2743 ));
-DATA(insert ( 2745 1563 1563 3 2774 ));
-DATA(insert ( 2745 1563 1563 4 2744 ));
-DATA(insert ( 2745 1563 1563 6 3920 ));
-DATA(insert ( 2745 1115 1115 1 2045 ));
-DATA(insert ( 2745 1115 1115 2 2743 ));
-DATA(insert ( 2745 1115 1115 3 2774 ));
-DATA(insert ( 2745 1115 1115 4 2744 ));
-DATA(insert ( 2745 1115 1115 6 3920 ));
-DATA(insert ( 2745 791 791 1 377 ));
-DATA(insert ( 2745 791 791 2 2743 ));
-DATA(insert ( 2745 791 791 3 2774 ));
-DATA(insert ( 2745 791 791 4 2744 ));
-DATA(insert ( 2745 791 791 6 3920 ));
-DATA(insert ( 2745 1024 1024 1 380 ));
-DATA(insert ( 2745 1024 1024 2 2743 ));
-DATA(insert ( 2745 1024 1024 3 2774 ));
-DATA(insert ( 2745 1024 1024 4 2744 ));
-DATA(insert ( 2745 1024 1024 6 3920 ));
-DATA(insert ( 2745 1025 1025 1 381 ));
-DATA(insert ( 2745 1025 1025 2 2743 ));
-DATA(insert ( 2745 1025 1025 3 2774 ));
-DATA(insert ( 2745 1025 1025 4 2744 ));
-DATA(insert ( 2745 1025 1025 6 3920 ));
+DATA(insert ( 2745 2277 2277 2 2743 ));
+DATA(insert ( 2745 2277 2277 3 2774 ));
+DATA(insert ( 2745 2277 2277 4 2744 ));
+DATA(insert ( 2745 2277 2277 6 3920 ));
DATA(insert ( 3659 3614 3614 1 3724 ));
DATA(insert ( 3659 3614 3614 2 3656 ));
DATA(insert ( 3659 3614 3614 3 3657 ));
@@ -428,6 +284,11 @@ DATA(insert ( 3474 3831 3831 2 3470 ));
DATA(insert ( 3474 3831 3831 3 3471 ));
DATA(insert ( 3474 3831 3831 4 3472 ));
DATA(insert ( 3474 3831 3831 5 3473 ));
+DATA(insert ( 3794 869 869 1 3795 ));
+DATA(insert ( 3794 869 869 2 3796 ));
+DATA(insert ( 3794 869 869 3 3797 ));
+DATA(insert ( 3794 869 869 4 3798 ));
+DATA(insert ( 3794 869 869 5 3799 ));
DATA(insert ( 4015 600 600 1 4018 ));
DATA(insert ( 4015 600 600 2 4019 ));
DATA(insert ( 4015 600 600 3 4020 ));
@@ -556,6 +417,11 @@ DATA(insert ( 4074 829 829 1 3383 ));
DATA(insert ( 4074 829 829 2 3384 ));
DATA(insert ( 4074 829 829 3 3385 ));
DATA(insert ( 4074 829 829 4 3386 ));
+/* minmax macaddr8 */
+DATA(insert ( 4109 774 774 1 3383 ));
+DATA(insert ( 4109 774 774 2 3384 ));
+DATA(insert ( 4109 774 774 3 3385 ));
+DATA(insert ( 4109 774 774 4 3386 ));
/* minmax inet */
DATA(insert ( 4075 869 869 1 3383 ));
DATA(insert ( 4075 869 869 2 3384 ));
diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h
index 59be88f7af..ff1842f53c 100644
--- a/src/include/catalog/pg_attrdef.h
+++ b/src/include/catalog/pg_attrdef.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_attrdef.h
diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h
index 39d8eedb4e..753d45f2d1 100644
--- a/src/include/catalog/pg_attribute.h
+++ b/src/include/catalog/pg_attribute.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_attribute.h
@@ -133,6 +133,9 @@ CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BK
/* Has DEFAULT value or not */
bool atthasdef;
+ /* One of the ATTRIBUTE_IDENTITY_* constants below, or '\0' */
+ char attidentity;
+
/* Is dropped (ie, logically invisible) or not */
bool attisdropped;
@@ -188,7 +191,7 @@ typedef FormData_pg_attribute *Form_pg_attribute;
* ----------------
*/
-#define Natts_pg_attribute 21
+#define Natts_pg_attribute 22
#define Anum_pg_attribute_attrelid 1
#define Anum_pg_attribute_attname 2
#define Anum_pg_attribute_atttypid 3
@@ -203,13 +206,14 @@ typedef FormData_pg_attribute *Form_pg_attribute;
#define Anum_pg_attribute_attalign 12
#define Anum_pg_attribute_attnotnull 13
#define Anum_pg_attribute_atthasdef 14
-#define Anum_pg_attribute_attisdropped 15
-#define Anum_pg_attribute_attislocal 16
-#define Anum_pg_attribute_attinhcount 17
-#define Anum_pg_attribute_attcollation 18
-#define Anum_pg_attribute_attacl 19
-#define Anum_pg_attribute_attoptions 20
-#define Anum_pg_attribute_attfdwoptions 21
+#define Anum_pg_attribute_attidentity 15
+#define Anum_pg_attribute_attisdropped 16
+#define Anum_pg_attribute_attislocal 17
+#define Anum_pg_attribute_attinhcount 18
+#define Anum_pg_attribute_attcollation 19
+#define Anum_pg_attribute_attacl 20
+#define Anum_pg_attribute_attoptions 21
+#define Anum_pg_attribute_attfdwoptions 22
/* ----------------
@@ -220,4 +224,8 @@ typedef FormData_pg_attribute *Form_pg_attribute;
* ----------------
*/
+
+#define ATTRIBUTE_IDENTITY_ALWAYS 'a'
+#define ATTRIBUTE_IDENTITY_BY_DEFAULT 'd'
+
#endif /* PG_ATTRIBUTE_H */
diff --git a/src/include/catalog/pg_auth_members.h b/src/include/catalog/pg_auth_members.h
index 7257541e5b..e34a4e80a4 100644
--- a/src/include/catalog/pg_auth_members.h
+++ b/src/include/catalog/pg_auth_members.h
@@ -5,7 +5,7 @@
* (pg_auth_members) along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_auth_members.h
diff --git a/src/include/catalog/pg_authid.h b/src/include/catalog/pg_authid.h
index 533081def6..39fea9f41a 100644
--- a/src/include/catalog/pg_authid.h
+++ b/src/include/catalog/pg_authid.h
@@ -7,7 +7,7 @@
* pg_shadow and pg_group are now publicly accessible views on pg_authid.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_authid.h
@@ -94,15 +94,21 @@ typedef FormData_pg_authid *Form_pg_authid;
* The uppercase quantities will be replaced at initdb time with
* user choices.
*
- * If adding new default roles or changing the OIDs below, be sure to add or
- * update the #defines which follow as appropriate.
+ * The C code typically refers to these roles using the #define symbols,
+ * so be sure to keep those in sync with the DATA lines.
* ----------------
*/
DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_));
-DATA(insert OID = 4200 ( "pg_signal_backend" f t f f f f f -1 _null_ _null_));
-
#define BOOTSTRAP_SUPERUSERID 10
-
+DATA(insert OID = 3373 ( "pg_monitor" f t f f f f f -1 _null_ _null_));
+#define DEFAULT_ROLE_MONITOR 3373
+DATA(insert OID = 3374 ( "pg_read_all_settings" f t f f f f f -1 _null_ _null_));
+#define DEFAULT_ROLE_READ_ALL_SETTINGS 3374
+DATA(insert OID = 3375 ( "pg_read_all_stats" f t f f f f f -1 _null_ _null_));
+#define DEFAULT_ROLE_READ_ALL_STATS 3375
+DATA(insert OID = 3377 ( "pg_stat_scan_tables" f t f f f f f -1 _null_ _null_));
+#define DEFAULT_ROLE_STAT_SCAN_TABLES 3377
+DATA(insert OID = 4200 ( "pg_signal_backend" f t f f f f f -1 _null_ _null_));
#define DEFAULT_ROLE_SIGNAL_BACKENDID 4200
#endif /* PG_AUTHID_H */
diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h
index ee568d836a..ccc6fb35a8 100644
--- a/src/include/catalog/pg_cast.h
+++ b/src/include/catalog/pg_cast.h
@@ -8,7 +8,7 @@
* but also length coercion functions.
*
*
- * Copyright (c) 2002-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2002-2017, PostgreSQL Global Development Group
*
* src/include/catalog/pg_cast.h
*
@@ -59,7 +59,7 @@ typedef enum CoercionCodes
/*
* The allowable values for pg_cast.castmethod are specified by this enum.
- * Since castcontext is stored as a "char", we use ASCII codes for human
+ * Since castmethod is stored as a "char", we use ASCII codes for human
* convenience in reading the table.
*/
typedef enum CoercionMethod
@@ -254,6 +254,14 @@ DATA(insert ( 23 18 78 e f ));
/* pg_node_tree can be coerced to, but not from, text */
DATA(insert ( 194 25 0 i b ));
+/* pg_ndistinct can be coerced to, but not from, bytea and text */
+DATA(insert ( 3361 17 0 i b ));
+DATA(insert ( 3361 25 0 i i ));
+
+/* pg_dependencies can be coerced to, but not from, bytea and text */
+DATA(insert ( 3402 17 0 i b ));
+DATA(insert ( 3402 25 0 i i ));
+
/*
* Datetime category
*/
@@ -304,6 +312,12 @@ DATA(insert ( 718 603 1480 e f ));
DATA(insert ( 718 604 1544 e f ));
/*
+ * MAC address category
+ */
+DATA(insert ( 829 774 4123 i f ));
+DATA(insert ( 774 829 4124 i f ));
+
+/*
* INET category
*/
DATA(insert ( 650 869 0 i b ));
diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h
index 7b3b058d89..3657201317 100644
--- a/src/include/catalog/pg_class.h
+++ b/src/include/catalog/pg_class.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_class.h
@@ -70,6 +70,7 @@ CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO
* not */
bool relispopulated; /* matview currently holds query results */
char relreplident; /* see REPLICA_IDENTITY_xxx constants */
+ bool relispartition; /* is relation a partition? */
TransactionId relfrozenxid; /* all Xids < this are frozen in this rel */
TransactionId relminmxid; /* all multixacts in this rel are >= this.
* this is really a MultiXactId */
@@ -78,6 +79,7 @@ CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO
/* NOTE: These fields are not present in a relcache entry's rd_rel field. */
aclitem relacl[1]; /* access permissions */
text reloptions[1]; /* access-method-specific options */
+ pg_node_tree relpartbound; /* partition bound node tree */
#endif
} FormData_pg_class;
@@ -97,7 +99,7 @@ typedef FormData_pg_class *Form_pg_class;
* ----------------
*/
-#define Natts_pg_class 31
+#define Natts_pg_class 33
#define Anum_pg_class_relname 1
#define Anum_pg_class_relnamespace 2
#define Anum_pg_class_reltype 3
@@ -125,10 +127,12 @@ typedef FormData_pg_class *Form_pg_class;
#define Anum_pg_class_relforcerowsecurity 25
#define Anum_pg_class_relispopulated 26
#define Anum_pg_class_relreplident 27
-#define Anum_pg_class_relfrozenxid 28
-#define Anum_pg_class_relminmxid 29
-#define Anum_pg_class_relacl 30
-#define Anum_pg_class_reloptions 31
+#define Anum_pg_class_relispartition 28
+#define Anum_pg_class_relfrozenxid 29
+#define Anum_pg_class_relminmxid 30
+#define Anum_pg_class_relacl 31
+#define Anum_pg_class_reloptions 32
+#define Anum_pg_class_relpartbound 33
/* ----------------
* initial contents of pg_class
@@ -143,13 +147,13 @@ typedef FormData_pg_class *Form_pg_class;
* Note: "3" in the relfrozenxid column stands for FirstNormalTransactionId;
* similarly, "1" in relminmxid stands for FirstMultiXactId
*/
-DATA(insert OID = 1247 ( pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 f f p r 30 0 t f f f f f f t n 3 1 _null_ _null_ ));
+DATA(insert OID = 1247 ( pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 f f p r 30 0 t f f f f f f t n f 3 1 _null_ _null_ _null_));
DESCR("");
-DATA(insert OID = 1249 ( pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 f f p r 21 0 f f f f f f f t n 3 1 _null_ _null_ ));
+DATA(insert OID = 1249 ( pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 f f p r 22 0 f f f f f f f t n f 3 1 _null_ _null_ _null_));
DESCR("");
-DATA(insert OID = 1255 ( pg_proc PGNSP 81 0 PGUID 0 0 0 0 0 0 0 f f p r 29 0 t f f f f f f t n 3 1 _null_ _null_ ));
+DATA(insert OID = 1255 ( pg_proc PGNSP 81 0 PGUID 0 0 0 0 0 0 0 f f p r 29 0 t f f f f f f t n f 3 1 _null_ _null_ _null_));
DESCR("");
-DATA(insert OID = 1259 ( pg_class PGNSP 83 0 PGUID 0 0 0 0 0 0 0 f f p r 31 0 t f f f f f f t n 3 1 _null_ _null_ ));
+DATA(insert OID = 1259 ( pg_class PGNSP 83 0 PGUID 0 0 0 0 0 0 0 f f p r 33 0 t f f f f f f t n f 3 1 _null_ _null_ _null_));
DESCR("");
@@ -158,9 +162,10 @@ DESCR("");
#define RELKIND_SEQUENCE 'S' /* sequence object */
#define RELKIND_TOASTVALUE 't' /* for out-of-line values */
#define RELKIND_VIEW 'v' /* view */
+#define RELKIND_MATVIEW 'm' /* materialized view */
#define RELKIND_COMPOSITE_TYPE 'c' /* composite type */
#define RELKIND_FOREIGN_TABLE 'f' /* foreign table */
-#define RELKIND_MATVIEW 'm' /* materialized view */
+#define RELKIND_PARTITIONED_TABLE 'p' /* partitioned table */
#define RELPERSISTENCE_PERMANENT 'p' /* regular table */
#define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */
@@ -177,9 +182,10 @@ DESCR("");
/* all columns are logged as replica identity */
#define REPLICA_IDENTITY_FULL 'f'
/*
- * an explicitly chosen candidate key's columns are used as identity;
- * will still be set if the index has been dropped, in that case it
- * has the same meaning as 'd'
+ * an explicitly chosen candidate key's columns are used as replica identity.
+ * Note this will still be set if the index has been dropped; in that case it
+ * has the same meaning as 'd'.
*/
#define REPLICA_IDENTITY_INDEX 'i'
+
#endif /* PG_CLASS_H */
diff --git a/src/include/catalog/pg_collation.h b/src/include/catalog/pg_collation.h
index 636771202e..1e44ce0949 100644
--- a/src/include/catalog/pg_collation.h
+++ b/src/include/catalog/pg_collation.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -34,9 +34,14 @@ CATALOG(pg_collation,3456)
NameData collname; /* collation name */
Oid collnamespace; /* OID of namespace containing collation */
Oid collowner; /* owner of collation */
+ char collprovider; /* see constants below */
int32 collencoding; /* encoding for this collation; -1 = "all" */
NameData collcollate; /* LC_COLLATE setting */
NameData collctype; /* LC_CTYPE setting */
+#ifdef CATALOG_VARLEN /* variable-length fields start here */
+ text collversion; /* provider-dependent version of collation
+ * data */
+#endif
} FormData_pg_collation;
/* ----------------
@@ -50,27 +55,34 @@ typedef FormData_pg_collation *Form_pg_collation;
* compiler constants for pg_collation
* ----------------
*/
-#define Natts_pg_collation 6
+#define Natts_pg_collation 8
#define Anum_pg_collation_collname 1
#define Anum_pg_collation_collnamespace 2
#define Anum_pg_collation_collowner 3
-#define Anum_pg_collation_collencoding 4
-#define Anum_pg_collation_collcollate 5
-#define Anum_pg_collation_collctype 6
+#define Anum_pg_collation_collprovider 4
+#define Anum_pg_collation_collencoding 5
+#define Anum_pg_collation_collcollate 6
+#define Anum_pg_collation_collctype 7
+#define Anum_pg_collation_collversion 8
/* ----------------
* initial contents of pg_collation
* ----------------
*/
-DATA(insert OID = 100 ( default PGNSP PGUID -1 "" "" ));
+DATA(insert OID = 100 ( default PGNSP PGUID d -1 "" "" 0 ));
DESCR("database's default collation");
#define DEFAULT_COLLATION_OID 100
-DATA(insert OID = 950 ( C PGNSP PGUID -1 "C" "C" ));
+DATA(insert OID = 950 ( C PGNSP PGUID c -1 "C" "C" 0 ));
DESCR("standard C collation");
#define C_COLLATION_OID 950
-DATA(insert OID = 951 ( POSIX PGNSP PGUID -1 "POSIX" "POSIX" ));
+DATA(insert OID = 951 ( POSIX PGNSP PGUID c -1 "POSIX" "POSIX" 0 ));
DESCR("standard POSIX collation");
#define POSIX_COLLATION_OID 951
+
+#define COLLPROVIDER_DEFAULT 'd'
+#define COLLPROVIDER_ICU 'i'
+#define COLLPROVIDER_LIBC 'c'
+
#endif /* PG_COLLATION_H */
diff --git a/src/include/catalog/pg_collation_fn.h b/src/include/catalog/pg_collation_fn.h
index 574b288acc..dfebdbaa0b 100644
--- a/src/include/catalog/pg_collation_fn.h
+++ b/src/include/catalog/pg_collation_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_collation.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_collation_fn.h
@@ -16,8 +16,11 @@
extern Oid CollationCreate(const char *collname, Oid collnamespace,
Oid collowner,
+ char collprovider,
int32 collencoding,
- const char *collcollate, const char *collctype);
+ const char *collcollate, const char *collctype,
+ const char *collversion,
+ bool if_not_exists);
extern void RemoveCollationById(Oid collationOid);
#endif /* PG_COLLATION_FN_H */
diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h
index 666b2304bf..e959583364 100644
--- a/src/include/catalog/pg_constraint.h
+++ b/src/include/catalog/pg_constraint.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_constraint.h
diff --git a/src/include/catalog/pg_constraint_fn.h b/src/include/catalog/pg_constraint_fn.h
index 1f11174210..d2acb3a053 100644
--- a/src/include/catalog/pg_constraint_fn.h
+++ b/src/include/catalog/pg_constraint_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_constraint.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_constraint_fn.h
diff --git a/src/include/catalog/pg_control.h b/src/include/catalog/pg_control.h
index 0bc41abee5..3a25cc84b2 100644
--- a/src/include/catalog/pg_control.h
+++ b/src/include/catalog/pg_control.h
@@ -5,7 +5,7 @@
* However, we define it here so that the format is documented.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_control.h
@@ -20,8 +20,10 @@
#include "port/pg_crc32c.h"
+#define MOCK_AUTH_NONCE_LEN 32
+
/* Version identifier for this pg_control format */
-#define PG_CONTROL_VERSION 960
+#define PG_CONTROL_VERSION 1002
/*
* Body of CheckPoint XLOG records. This is declared here because we keep
@@ -215,9 +217,6 @@ typedef struct ControlFileData
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
uint32 loblksize; /* chunk size in pg_largeobject */
- /* flag indicating internal format of timestamp, interval, time */
- bool enableIntTimes; /* int64 storage enabled? */
-
/* flags indicating pass-by-value status of various types */
bool float4ByVal; /* float4 pass-by-value? */
bool float8ByVal; /* float8, int8, etc pass-by-value? */
@@ -225,6 +224,13 @@ typedef struct ControlFileData
/* Are data pages protected by checksums? Zero if no checksum version */
uint32 data_checksum_version;
+ /*
+ * Random nonce, used in authentication requests that need to proceed
+ * based on values that are cluster-unique, like a SASL exchange that
+ * failed at an early stage.
+ */
+ char mock_authentication_nonce[MOCK_AUTH_NONCE_LEN];
+
/* CRC of all above ... MUST BE LAST! */
pg_crc32c crc;
} ControlFileData;
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 1cfe57ce19..88174a620a 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_conversion.h
diff --git a/src/include/catalog/pg_conversion_fn.h b/src/include/catalog/pg_conversion_fn.h
index 9fcdde6d5b..a2c1345f01 100644
--- a/src/include/catalog/pg_conversion_fn.h
+++ b/src/include/catalog/pg_conversion_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_conversion.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_conversion_fn.h
diff --git a/src/include/catalog/pg_database.h b/src/include/catalog/pg_database.h
index 6ae1b40559..55a1f6edab 100644
--- a/src/include/catalog/pg_database.h
+++ b/src/include/catalog/pg_database.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_database.h
diff --git a/src/include/catalog/pg_db_role_setting.h b/src/include/catalog/pg_db_role_setting.h
index a1f0150d39..311258fd7b 100644
--- a/src/include/catalog/pg_db_role_setting.h
+++ b/src/include/catalog/pg_db_role_setting.h
@@ -4,7 +4,7 @@
* definition of configuration settings
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_db_role_setting.h
diff --git a/src/include/catalog/pg_default_acl.h b/src/include/catalog/pg_default_acl.h
index 06aaaba0da..78bbeb64fe 100644
--- a/src/include/catalog/pg_default_acl.h
+++ b/src/include/catalog/pg_default_acl.h
@@ -4,7 +4,7 @@
* definition of default ACLs for new objects.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_default_acl.h
@@ -70,5 +70,6 @@ typedef FormData_pg_default_acl *Form_pg_default_acl;
#define DEFACLOBJ_SEQUENCE 'S' /* sequence */
#define DEFACLOBJ_FUNCTION 'f' /* function */
#define DEFACLOBJ_TYPE 'T' /* type */
+#define DEFACLOBJ_NAMESPACE 'n' /* namespace */
#endif /* PG_DEFAULT_ACL_H */
diff --git a/src/include/catalog/pg_depend.h b/src/include/catalog/pg_depend.h
index 3796206fa8..6c480dd7dc 100644
--- a/src/include/catalog/pg_depend.h
+++ b/src/include/catalog/pg_depend.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_depend.h
diff --git a/src/include/catalog/pg_description.h b/src/include/catalog/pg_description.h
index c960d0e198..2f51ac33f3 100644
--- a/src/include/catalog/pg_description.h
+++ b/src/include/catalog/pg_description.h
@@ -19,7 +19,7 @@
* for example).
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_description.h
diff --git a/src/include/catalog/pg_enum.h b/src/include/catalog/pg_enum.h
index dd32443b91..faee5e6c3c 100644
--- a/src/include/catalog/pg_enum.h
+++ b/src/include/catalog/pg_enum.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Copyright (c) 2006-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2006-2017, PostgreSQL Global Development Group
*
* src/include/catalog/pg_enum.h
*
@@ -67,5 +67,7 @@ extern void EnumValuesDelete(Oid enumTypeOid);
extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
const char *neighbor, bool newValIsAfter,
bool skipIfExists);
+extern void RenameEnumLabel(Oid enumTypeOid,
+ const char *oldVal, const char *newVal);
#endif /* PG_ENUM_H */
diff --git a/src/include/catalog/pg_event_trigger.h b/src/include/catalog/pg_event_trigger.h
index 8884ef4a3e..b41cc12602 100644
--- a/src/include/catalog/pg_event_trigger.h
+++ b/src/include/catalog/pg_event_trigger.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_event_trigger.h
diff --git a/src/include/catalog/pg_extension.h b/src/include/catalog/pg_extension.h
index e823f7b79a..41b087d8b9 100644
--- a/src/include/catalog/pg_extension.h
+++ b/src/include/catalog/pg_extension.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_extension.h
diff --git a/src/include/catalog/pg_foreign_data_wrapper.h b/src/include/catalog/pg_foreign_data_wrapper.h
index 1e9b4775ce..47df6799c9 100644
--- a/src/include/catalog/pg_foreign_data_wrapper.h
+++ b/src/include/catalog/pg_foreign_data_wrapper.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_foreign_data_wrapper.h
diff --git a/src/include/catalog/pg_foreign_server.h b/src/include/catalog/pg_foreign_server.h
index 06b4f6afe8..629bfc389d 100644
--- a/src/include/catalog/pg_foreign_server.h
+++ b/src/include/catalog/pg_foreign_server.h
@@ -3,7 +3,7 @@
* pg_foreign_server.h
* definition of the system "foreign server" relation (pg_foreign_server)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_foreign_server.h
diff --git a/src/include/catalog/pg_foreign_table.h b/src/include/catalog/pg_foreign_table.h
index e7b925b7c9..b62d5e948b 100644
--- a/src/include/catalog/pg_foreign_table.h
+++ b/src/include/catalog/pg_foreign_table.h
@@ -3,13 +3,13 @@
* pg_foreign_table.h
* definition of the system "foreign table" relation (pg_foreign_table)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_foreign_table.h
*
* NOTES
- * the genbki.sh script reads this file and generates .bki
+ * the genbki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h
index ee97c5dec8..7ca0fae707 100644
--- a/src/include/catalog/pg_index.h
+++ b/src/include/catalog/pg_index.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_index.h
diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h
index a117f7816a..434fa7c864 100644
--- a/src/include/catalog/pg_inherits.h
+++ b/src/include/catalog/pg_inherits.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_inherits.h
diff --git a/src/include/catalog/pg_inherits_fn.h b/src/include/catalog/pg_inherits_fn.h
index a717108481..e33b39e71e 100644
--- a/src/include/catalog/pg_inherits_fn.h
+++ b/src/include/catalog/pg_inherits_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_inherits.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_inherits_fn.h
diff --git a/src/include/catalog/pg_init_privs.h b/src/include/catalog/pg_init_privs.h
index e13edd3ff5..0d241b8a40 100644
--- a/src/include/catalog/pg_init_privs.h
+++ b/src/include/catalog/pg_init_privs.h
@@ -15,7 +15,7 @@
* for a table itself, so that it is distinct from any column privilege.
* Currently, objsubid is unused and zero for all other kinds of objects.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_init_privs.h
diff --git a/src/include/catalog/pg_language.h b/src/include/catalog/pg_language.h
index 5203dfd721..46e4099485 100644
--- a/src/include/catalog/pg_language.h
+++ b/src/include/catalog/pg_language.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_language.h
diff --git a/src/include/catalog/pg_largeobject.h b/src/include/catalog/pg_largeobject.h
index 8dae408eae..93c8c6af6e 100644
--- a/src/include/catalog/pg_largeobject.h
+++ b/src/include/catalog/pg_largeobject.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_largeobject.h
diff --git a/src/include/catalog/pg_largeobject_metadata.h b/src/include/catalog/pg_largeobject_metadata.h
index b8e47f60f6..16cb602a6c 100644
--- a/src/include/catalog/pg_largeobject_metadata.h
+++ b/src/include/catalog/pg_largeobject_metadata.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_largeobject_metadata.h
diff --git a/src/include/catalog/pg_namespace.h b/src/include/catalog/pg_namespace.h
index 308af49812..010190e35c 100644
--- a/src/include/catalog/pg_namespace.h
+++ b/src/include/catalog/pg_namespace.h
@@ -6,7 +6,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_namespace.h
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 6c82d94600..5819d5309f 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -25,7 +25,7 @@
* AMs support this.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_opclass.h
@@ -113,6 +113,7 @@ DATA(insert ( 405 float8_ops PGNSP PGUID 1971 701 t 0 ));
DATA(insert ( 403 inet_ops PGNSP PGUID 1974 869 t 0 ));
DATA(insert ( 405 inet_ops PGNSP PGUID 1975 869 t 0 ));
DATA(insert ( 783 inet_ops PGNSP PGUID 3550 869 f 0 ));
+DATA(insert ( 4000 inet_ops PGNSP PGUID 3794 869 t 0 ));
DATA(insert OID = 1979 ( 403 int2_ops PGNSP PGUID 1976 21 t 0 ));
#define INT2_BTREE_OPS_OID 1979
DATA(insert ( 405 int2_ops PGNSP PGUID 1977 21 t 0 ));
@@ -126,6 +127,8 @@ DATA(insert ( 403 interval_ops PGNSP PGUID 1982 1186 t 0 ));
DATA(insert ( 405 interval_ops PGNSP PGUID 1983 1186 t 0 ));
DATA(insert ( 403 macaddr_ops PGNSP PGUID 1984 829 t 0 ));
DATA(insert ( 405 macaddr_ops PGNSP PGUID 1985 829 t 0 ));
+DATA(insert ( 403 macaddr8_ops PGNSP PGUID 3371 774 t 0 ));
+DATA(insert ( 405 macaddr8_ops PGNSP PGUID 3372 774 t 0 ));
/*
* Here's an ugly little hack to save space in the system catalog indexes.
* btree doesn't ordinarily allow a storage type different from input type;
@@ -167,7 +170,6 @@ DATA(insert ( 403 bpchar_pattern_ops PGNSP PGUID 2097 1042 f 0 ));
DATA(insert ( 403 money_ops PGNSP PGUID 2099 790 t 0 ));
DATA(insert ( 405 bool_ops PGNSP PGUID 2222 16 t 0 ));
DATA(insert ( 405 bytea_ops PGNSP PGUID 2223 17 t 0 ));
-DATA(insert ( 405 int2vector_ops PGNSP PGUID 2224 22 t 0 ));
DATA(insert ( 403 tid_ops PGNSP PGUID 2789 27 t 0 ));
DATA(insert ( 405 xid_ops PGNSP PGUID 2225 28 t 0 ));
DATA(insert ( 405 cid_ops PGNSP PGUID 2226 29 t 0 ));
@@ -183,36 +185,7 @@ DATA(insert ( 783 box_ops PGNSP PGUID 2593 603 t 0 ));
DATA(insert ( 783 point_ops PGNSP PGUID 1029 600 t 603 ));
DATA(insert ( 783 poly_ops PGNSP PGUID 2594 604 t 603 ));
DATA(insert ( 783 circle_ops PGNSP PGUID 2595 718 t 603 ));
-DATA(insert ( 2742 _int4_ops PGNSP PGUID 2745 1007 t 23 ));
-DATA(insert ( 2742 _text_ops PGNSP PGUID 2745 1009 t 25 ));
-DATA(insert ( 2742 _abstime_ops PGNSP PGUID 2745 1023 t 702 ));
-DATA(insert ( 2742 _bit_ops PGNSP PGUID 2745 1561 t 1560 ));
-DATA(insert ( 2742 _bool_ops PGNSP PGUID 2745 1000 t 16 ));
-DATA(insert ( 2742 _bpchar_ops PGNSP PGUID 2745 1014 t 1042 ));
-DATA(insert ( 2742 _bytea_ops PGNSP PGUID 2745 1001 t 17 ));
-DATA(insert ( 2742 _char_ops PGNSP PGUID 2745 1002 t 18 ));
-DATA(insert ( 2742 _cidr_ops PGNSP PGUID 2745 651 t 650 ));
-DATA(insert ( 2742 _date_ops PGNSP PGUID 2745 1182 t 1082 ));
-DATA(insert ( 2742 _float4_ops PGNSP PGUID 2745 1021 t 700 ));
-DATA(insert ( 2742 _float8_ops PGNSP PGUID 2745 1022 t 701 ));
-DATA(insert ( 2742 _inet_ops PGNSP PGUID 2745 1041 t 869 ));
-DATA(insert ( 2742 _int2_ops PGNSP PGUID 2745 1005 t 21 ));
-DATA(insert ( 2742 _int8_ops PGNSP PGUID 2745 1016 t 20 ));
-DATA(insert ( 2742 _interval_ops PGNSP PGUID 2745 1187 t 1186 ));
-DATA(insert ( 2742 _macaddr_ops PGNSP PGUID 2745 1040 t 829 ));
-DATA(insert ( 2742 _name_ops PGNSP PGUID 2745 1003 t 19 ));
-DATA(insert ( 2742 _numeric_ops PGNSP PGUID 2745 1231 t 1700 ));
-DATA(insert ( 2742 _oid_ops PGNSP PGUID 2745 1028 t 26 ));
-DATA(insert ( 2742 _oidvector_ops PGNSP PGUID 2745 1013 t 30 ));
-DATA(insert ( 2742 _time_ops PGNSP PGUID 2745 1183 t 1083 ));
-DATA(insert ( 2742 _timestamptz_ops PGNSP PGUID 2745 1185 t 1184 ));
-DATA(insert ( 2742 _timetz_ops PGNSP PGUID 2745 1270 t 1266 ));
-DATA(insert ( 2742 _varbit_ops PGNSP PGUID 2745 1563 t 1562 ));
-DATA(insert ( 2742 _varchar_ops PGNSP PGUID 2745 1015 t 1043 ));
-DATA(insert ( 2742 _timestamp_ops PGNSP PGUID 2745 1115 t 1114 ));
-DATA(insert ( 2742 _money_ops PGNSP PGUID 2745 791 t 790 ));
-DATA(insert ( 2742 _reltime_ops PGNSP PGUID 2745 1024 t 703 ));
-DATA(insert ( 2742 _tinterval_ops PGNSP PGUID 2745 1025 t 704 ));
+DATA(insert ( 2742 array_ops PGNSP PGUID 2745 2277 t 2283 ));
DATA(insert ( 403 uuid_ops PGNSP PGUID 2968 2950 t 0 ));
DATA(insert ( 405 uuid_ops PGNSP PGUID 2969 2950 t 0 ));
DATA(insert ( 403 pg_lsn_ops PGNSP PGUID 3253 3220 t 0 ));
@@ -253,6 +226,7 @@ DATA(insert ( 3580 float8_minmax_ops PGNSP PGUID 4070 701 t 701 ));
DATA(insert ( 3580 abstime_minmax_ops PGNSP PGUID 4072 702 t 702 ));
DATA(insert ( 3580 reltime_minmax_ops PGNSP PGUID 4073 703 t 703 ));
DATA(insert ( 3580 macaddr_minmax_ops PGNSP PGUID 4074 829 t 829 ));
+DATA(insert ( 3580 macaddr8_minmax_ops PGNSP PGUID 4109 774 t 774 ));
DATA(insert ( 3580 inet_minmax_ops PGNSP PGUID 4075 869 f 869 ));
DATA(insert ( 3580 inet_inclusion_ops PGNSP PGUID 4102 869 t 869 ));
DATA(insert ( 3580 bpchar_minmax_ops PGNSP PGUID 4076 1042 t 1042 ));
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index b8f06b3500..ccbb17efec 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_operator.h
@@ -156,8 +156,6 @@ DATA(insert OID = 389 ( "!!" PGNSP PGUID l f f 0 20 1700 0 0 numeric_fac
DESCR("deprecated, use ! instead");
DATA(insert OID = 385 ( "=" PGNSP PGUID b f t 29 29 16 385 0 cideq eqsel eqjoinsel ));
DESCR("equal");
-DATA(insert OID = 386 ( "=" PGNSP PGUID b f t 22 22 16 386 0 int2vectoreq eqsel eqjoinsel ));
-DESCR("equal");
DATA(insert OID = 387 ( "=" PGNSP PGUID b t f 27 27 16 387 402 tideq eqsel eqjoinsel ));
DESCR("equal");
@@ -711,6 +709,10 @@ DATA(insert OID = 908 ( "*" PGNSP PGUID b f f 790 701 790 916 0 cash_mul_
DESCR("multiply");
DATA(insert OID = 909 ( "/" PGNSP PGUID b f f 790 701 790 0 0 cash_div_flt8 - - ));
DESCR("divide");
+DATA(insert OID = 3346 ( "*" PGNSP PGUID b f f 790 20 790 3349 0 cash_mul_int8 - - ));
+DESCR("multiply");
+DATA(insert OID = 3347 ( "/" PGNSP PGUID b f f 790 20 790 0 0 cash_div_int8 - - ));
+DESCR("divide");
DATA(insert OID = 912 ( "*" PGNSP PGUID b f f 790 23 790 917 0 cash_mul_int4 - - ));
DESCR("multiply");
DATA(insert OID = 913 ( "/" PGNSP PGUID b f f 790 23 790 0 0 cash_div_int4 - - ));
@@ -721,6 +723,8 @@ DATA(insert OID = 915 ( "/" PGNSP PGUID b f f 790 21 790 0 0 cash_div_
DESCR("divide");
DATA(insert OID = 916 ( "*" PGNSP PGUID b f f 701 790 790 908 0 flt8_mul_cash - - ));
DESCR("multiply");
+DATA(insert OID = 3349 ( "*" PGNSP PGUID b f f 20 790 790 3346 0 int8_mul_cash - - ));
+DESCR("multiply");
DATA(insert OID = 917 ( "*" PGNSP PGUID b f f 23 790 790 912 0 int4_mul_cash - - ));
DESCR("multiply");
DATA(insert OID = 918 ( "*" PGNSP PGUID b f f 21 790 790 914 0 int2_mul_cash - - ));
@@ -1115,7 +1119,7 @@ DESCR("equal");
DATA(insert OID = 1617 ( "#" PGNSP PGUID b f f 628 628 600 1617 0 line_interpt - - ));
DESCR("intersection point");
-/* MAC type */
+/* MACADDR type */
DATA(insert OID = 1220 ( "=" PGNSP PGUID b t t 829 829 16 1220 1221 macaddr_eq eqsel eqjoinsel ));
DESCR("equal");
DATA(insert OID = 1221 ( "<>" PGNSP PGUID b f f 829 829 16 1221 1220 macaddr_ne neqsel neqjoinsel ));
@@ -1136,6 +1140,27 @@ DESCR("bitwise and");
DATA(insert OID = 3149 ( "|" PGNSP PGUID b f f 829 829 829 0 0 macaddr_or - - ));
DESCR("bitwise or");
+/* MACADDR8 type */
+DATA(insert OID = 3362 ( "=" PGNSP PGUID b t t 774 774 16 3362 3363 macaddr8_eq eqsel eqjoinsel ));
+DESCR("equal");
+DATA(insert OID = 3363 ( "<>" PGNSP PGUID b f f 774 774 16 3363 3362 macaddr8_ne neqsel neqjoinsel ));
+DESCR("not equal");
+DATA(insert OID = 3364 ( "<" PGNSP PGUID b f f 774 774 16 3366 3367 macaddr8_lt scalarltsel scalarltjoinsel ));
+DESCR("less than");
+DATA(insert OID = 3365 ( "<=" PGNSP PGUID b f f 774 774 16 3367 3366 macaddr8_le scalarltsel scalarltjoinsel ));
+DESCR("less than or equal");
+DATA(insert OID = 3366 ( ">" PGNSP PGUID b f f 774 774 16 3364 3365 macaddr8_gt scalargtsel scalargtjoinsel ));
+DESCR("greater than");
+DATA(insert OID = 3367 ( ">=" PGNSP PGUID b f f 774 774 16 3365 3364 macaddr8_ge scalargtsel scalargtjoinsel ));
+DESCR("greater than or equal");
+
+DATA(insert OID = 3368 ( "~" PGNSP PGUID l f f 0 774 774 0 0 macaddr8_not - - ));
+DESCR("bitwise not");
+DATA(insert OID = 3369 ( "&" PGNSP PGUID b f f 774 774 774 0 0 macaddr8_and - - ));
+DESCR("bitwise and");
+DATA(insert OID = 3370 ( "|" PGNSP PGUID b f f 774 774 774 0 0 macaddr8_or - - ));
+DESCR("bitwise or");
+
/* INET type (these also support CIDR via implicit cast) */
DATA(insert OID = 1201 ( "=" PGNSP PGUID b t t 869 869 16 1201 1202 network_eq eqsel eqjoinsel ));
DESCR("equal");
@@ -1822,6 +1847,8 @@ DATA(insert OID = 3284 ( "||" PGNSP PGUID b f f 3802 3802 3802 0 0 jsonb_con
DESCR("concatenate");
DATA(insert OID = 3285 ( "-" PGNSP PGUID b f f 3802 25 3802 0 0 3302 - - ));
DESCR("delete object field");
+DATA(insert OID = 3398 ( "-" PGNSP PGUID b f f 3802 1009 3802 0 0 3343 - -));
+DESCR("delete object fields");
DATA(insert OID = 3286 ( "-" PGNSP PGUID b f f 3802 23 3802 0 0 3303 - - ));
DESCR("delete array element");
DATA(insert OID = 3287 ( "#-" PGNSP PGUID b f f 3802 1009 3802 0 0 jsonb_delete_path - - ));
diff --git a/src/include/catalog/pg_operator_fn.h b/src/include/catalog/pg_operator_fn.h
index 58814e2111..d8ea390fdf 100644
--- a/src/include/catalog/pg_operator_fn.h
+++ b/src/include/catalog/pg_operator_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_operator.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_operator_fn.h
diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h
index 1499a502f3..546527aa8e 100644
--- a/src/include/catalog/pg_opfamily.h
+++ b/src/include/catalog/pg_opfamily.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_opfamily.h
@@ -79,6 +79,7 @@ DATA(insert OID = 1974 ( 403 network_ops PGNSP PGUID ));
#define NETWORK_BTREE_FAM_OID 1974
DATA(insert OID = 1975 ( 405 network_ops PGNSP PGUID ));
DATA(insert OID = 3550 ( 783 network_ops PGNSP PGUID ));
+DATA(insert OID = 3794 ( 4000 network_ops PGNSP PGUID ));
DATA(insert OID = 1976 ( 403 integer_ops PGNSP PGUID ));
#define INTEGER_BTREE_FAM_OID 1976
DATA(insert OID = 1977 ( 405 integer_ops PGNSP PGUID ));
@@ -86,6 +87,8 @@ DATA(insert OID = 1982 ( 403 interval_ops PGNSP PGUID ));
DATA(insert OID = 1983 ( 405 interval_ops PGNSP PGUID ));
DATA(insert OID = 1984 ( 403 macaddr_ops PGNSP PGUID ));
DATA(insert OID = 1985 ( 405 macaddr_ops PGNSP PGUID ));
+DATA(insert OID = 3371 ( 403 macaddr8_ops PGNSP PGUID ));
+DATA(insert OID = 3372 ( 405 macaddr8_ops PGNSP PGUID ));
DATA(insert OID = 1986 ( 403 name_ops PGNSP PGUID ));
#define NAME_BTREE_FAM_OID 1986
DATA(insert OID = 1987 ( 405 name_ops PGNSP PGUID ));
@@ -116,7 +119,6 @@ DATA(insert OID = 2099 ( 403 money_ops PGNSP PGUID ));
DATA(insert OID = 2222 ( 405 bool_ops PGNSP PGUID ));
#define BOOL_HASH_FAM_OID 2222
DATA(insert OID = 2223 ( 405 bytea_ops PGNSP PGUID ));
-DATA(insert OID = 2224 ( 405 int2vector_ops PGNSP PGUID ));
DATA(insert OID = 2789 ( 403 tid_ops PGNSP PGUID ));
DATA(insert OID = 2225 ( 405 xid_ops PGNSP PGUID ));
DATA(insert OID = 2226 ( 405 cid_ops PGNSP PGUID ));
@@ -171,6 +173,7 @@ DATA(insert OID = 4070 ( 3580 float_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4072 ( 3580 abstime_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4073 ( 3580 reltime_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4074 ( 3580 macaddr_minmax_ops PGNSP PGUID ));
+DATA(insert OID = 4109 ( 3580 macaddr8_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4075 ( 3580 network_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4102 ( 3580 network_inclusion_ops PGNSP PGUID ));
DATA(insert OID = 4076 ( 3580 bpchar_minmax_ops PGNSP PGUID ));
diff --git a/src/include/catalog/pg_partitioned_table.h b/src/include/catalog/pg_partitioned_table.h
new file mode 100644
index 0000000000..bdff36a04b
--- /dev/null
+++ b/src/include/catalog/pg_partitioned_table.h
@@ -0,0 +1,74 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_partitioned_table.h
+ * definition of the system "partitioned table" relation
+ * along with the relation's initial contents.
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ *
+ * src/include/catalog/pg_partitioned_table.h
+ *
+ * NOTES
+ * the genbki.sh script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_PARTITIONED_TABLE_H
+#define PG_PARTITIONED_TABLE_H
+
+#include "catalog/genbki.h"
+
+/* ----------------
+ * pg_partitioned_table definition. cpp turns this into
+ * typedef struct FormData_pg_partitioned_table
+ * ----------------
+ */
+#define PartitionedRelationId 3350
+
+CATALOG(pg_partitioned_table,3350) BKI_WITHOUT_OIDS
+{
+ Oid partrelid; /* partitioned table oid */
+ char partstrat; /* partitioning strategy */
+ int16 partnatts; /* number of partition key columns */
+
+ /*
+ * variable-length fields start here, but we allow direct access to
+ * partattrs via the C struct. That's because the first variable-length
+ * field of a heap tuple can be reliably accessed using its C struct
+ * offset, as previous fields are all non-nullable fixed-length fields.
+ */
+ int2vector partattrs; /* each member of the array is the attribute
+ * number of a partition key column, or 0 if
+ * the column is actually an expression */
+
+#ifdef CATALOG_VARLEN
+ oidvector partclass; /* operator class to compare keys */
+ oidvector partcollation; /* user-specified collation for keys */
+ pg_node_tree partexprs; /* list of expressions in the partition key;
+ * one item for each zero entry in partattrs[] */
+#endif
+} FormData_pg_partitioned_table;
+
+/* ----------------
+ * Form_pg_partitioned_table corresponds to a pointer to a tuple with
+ * the format of pg_partitioned_table relation.
+ * ----------------
+ */
+typedef FormData_pg_partitioned_table *Form_pg_partitioned_table;
+
+/* ----------------
+ * compiler constants for pg_partitioned_table
+ * ----------------
+ */
+#define Natts_pg_partitioned_table 7
+#define Anum_pg_partitioned_table_partrelid 1
+#define Anum_pg_partitioned_table_partstrat 2
+#define Anum_pg_partitioned_table_partnatts 3
+#define Anum_pg_partitioned_table_partattrs 4
+#define Anum_pg_partitioned_table_partclass 5
+#define Anum_pg_partitioned_table_partcollation 6
+#define Anum_pg_partitioned_table_partexprs 7
+
+#endif /* PG_PARTITIONED_TABLE_H */
diff --git a/src/include/catalog/pg_pltemplate.h b/src/include/catalog/pg_pltemplate.h
index 3c7388de55..6d770fbb3c 100644
--- a/src/include/catalog/pg_pltemplate.h
+++ b/src/include/catalog/pg_pltemplate.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_pltemplate.h
diff --git a/src/include/catalog/pg_policy.h b/src/include/catalog/pg_policy.h
index d73e9c2c1a..331584f5e0 100644
--- a/src/include/catalog/pg_policy.h
+++ b/src/include/catalog/pg_policy.h
@@ -2,7 +2,7 @@
* pg_policy.h
* definition of the system "policy" relation (pg_policy)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*/
@@ -23,6 +23,7 @@ CATALOG(pg_policy,3256)
NameData polname; /* Policy name. */
Oid polrelid; /* Oid of the relation with policy. */
char polcmd; /* One of ACL_*_CHR, or '*' for all */
+ bool polpermissive; /* restrictive or permissive policy */
#ifdef CATALOG_VARLEN
Oid polroles[1]; /* Roles associated with policy, not-NULL */
@@ -42,12 +43,13 @@ typedef FormData_pg_policy *Form_pg_policy;
* compiler constants for pg_policy
* ----------------
*/
-#define Natts_pg_policy 6
-#define Anum_pg_policy_polname 1
-#define Anum_pg_policy_polrelid 2
-#define Anum_pg_policy_polcmd 3
-#define Anum_pg_policy_polroles 4
-#define Anum_pg_policy_polqual 5
-#define Anum_pg_policy_polwithcheck 6
+#define Natts_pg_policy 7
+#define Anum_pg_policy_polname 1
+#define Anum_pg_policy_polrelid 2
+#define Anum_pg_policy_polcmd 3
+#define Anum_pg_policy_polpermissive 4
+#define Anum_pg_policy_polroles 5
+#define Anum_pg_policy_polqual 6
+#define Anum_pg_policy_polwithcheck 7
#endif /* PG_POLICY_H */
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 7fccccf2a4..e06ed6cc77 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_proc.h
@@ -541,7 +541,6 @@ DATA(insert OID = 313 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23
DESCR("convert int2 to int4");
DATA(insert OID = 314 ( int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 21 "23" _null_ _null_ _null_ _null_ _null_ i4toi2 _null_ _null_ _null_ ));
DESCR("convert int4 to int2");
-DATA(insert OID = 315 ( int2vectoreq PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "22 22" _null_ _null_ _null_ _null_ _null_ int2vectoreq _null_ _null_ _null_ ));
DATA(insert OID = 316 ( float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 701 "23" _null_ _null_ _null_ _null_ _null_ i4tod _null_ _null_ _null_ ));
DESCR("convert int4 to float8");
DATA(insert OID = 317 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "701" _null_ _null_ _null_ _null_ _null_ dtoi4 _null_ _null_ _null_ ));
@@ -566,6 +565,10 @@ DATA(insert OID = 335 ( brinhandler PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0
DESCR("brin index access method handler");
DATA(insert OID = 3952 ( brin_summarize_new_values PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 23 "2205" _null_ _null_ _null_ _null_ _null_ brin_summarize_new_values _null_ _null_ _null_ ));
DESCR("brin: standalone scan new table pages");
+DATA(insert OID = 3999 ( brin_summarize_range PGNSP PGUID 12 1 0 0 0 f f f f t f v s 2 0 23 "2205 20" _null_ _null_ _null_ _null_ _null_ brin_summarize_range _null_ _null_ _null_ ));
+DESCR("brin: standalone scan new table pages");
+DATA(insert OID = 4014 ( brin_desummarize_range PGNSP PGUID 12 1 0 0 0 f f f f t f v s 2 0 2278 "2205 20" _null_ _null_ _null_ _null_ _null_ brin_desummarize_range _null_ _null_ _null_ ));
+DESCR("brin: desummarize page range");
DATA(insert OID = 338 ( amvalidate PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ amvalidate _null_ _null_ _null_ ));
DESCR("validate an operator class");
@@ -688,14 +691,14 @@ DATA(insert OID = 457 ( hashoidvector PGNSP PGUID 12 1 0 0 0 f f f f t f i s
DESCR("hash");
DATA(insert OID = 329 ( hash_aclitem PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "1033" _null_ _null_ _null_ _null_ _null_ hash_aclitem _null_ _null_ _null_ ));
DESCR("hash");
-DATA(insert OID = 398 ( hashint2vector PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "22" _null_ _null_ _null_ _null_ _null_ hashint2vector _null_ _null_ _null_ ));
-DESCR("hash");
DATA(insert OID = 399 ( hashmacaddr PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "829" _null_ _null_ _null_ _null_ _null_ hashmacaddr _null_ _null_ _null_ ));
DESCR("hash");
DATA(insert OID = 422 ( hashinet PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "869" _null_ _null_ _null_ _null_ _null_ hashinet _null_ _null_ _null_ ));
DESCR("hash");
DATA(insert OID = 432 ( hash_numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "1700" _null_ _null_ _null_ _null_ _null_ hash_numeric _null_ _null_ _null_ ));
DESCR("hash");
+DATA(insert OID = 328 ( hashmacaddr8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "774" _null_ _null_ _null_ _null_ _null_ hashmacaddr8 _null_ _null_ _null_ ));
+DESCR("hash");
DATA(insert OID = 438 ( num_nulls PGNSP PGUID 12 1 0 2276 0 f f f f f f i s 1 0 23 "2276" "{2276}" "{v}" _null_ _null_ _null_ pg_num_nulls _null_ _null_ _null_ ));
DESCR("count the number of NULL arguments");
@@ -907,11 +910,11 @@ DESCR("storage manager");
DATA(insert OID = 763 ( smgrne PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "210 210" _null_ _null_ _null_ _null_ _null_ smgrne _null_ _null_ _null_ ));
DESCR("storage manager");
-DATA(insert OID = 764 ( lo_import PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 26 "25" _null_ _null_ _null_ _null_ _null_ lo_import _null_ _null_ _null_ ));
+DATA(insert OID = 764 ( lo_import PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 26 "25" _null_ _null_ _null_ _null_ _null_ be_lo_import _null_ _null_ _null_ ));
DESCR("large object import");
-DATA(insert OID = 767 ( lo_import PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 26 "25 26" _null_ _null_ _null_ _null_ _null_ lo_import_with_oid _null_ _null_ _null_ ));
+DATA(insert OID = 767 ( lo_import PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 26 "25 26" _null_ _null_ _null_ _null_ _null_ be_lo_import_with_oid _null_ _null_ _null_ ));
DESCR("large object import");
-DATA(insert OID = 765 ( lo_export PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "26 25" _null_ _null_ _null_ _null_ _null_ lo_export _null_ _null_ _null_ ));
+DATA(insert OID = 765 ( lo_export PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "26 25" _null_ _null_ _null_ _null_ _null_ be_lo_export _null_ _null_ _null_ ));
DESCR("large object export");
DATA(insert OID = 766 ( int4inc PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "23" _null_ _null_ _null_ _null_ _null_ int4inc _null_ _null_ _null_ ));
@@ -961,8 +964,11 @@ DESCR("name of the current database");
DATA(insert OID = 817 ( current_query PGNSP PGUID 12 1 0 0 0 f f f f f f v r 0 0 25 "" _null_ _null_ _null_ _null_ _null_ current_query _null_ _null_ _null_ ));
DESCR("get the currently executing query");
+DATA(insert OID = 3399 ( int8_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "20 790" _null_ _null_ _null_ _null_ _null_ int8_mul_cash _null_ _null_ _null_ ));
DATA(insert OID = 862 ( int4_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "23 790" _null_ _null_ _null_ _null_ _null_ int4_mul_cash _null_ _null_ _null_ ));
DATA(insert OID = 863 ( int2_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "21 790" _null_ _null_ _null_ _null_ _null_ int2_mul_cash _null_ _null_ _null_ ));
+DATA(insert OID = 3344 ( cash_mul_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 20" _null_ _null_ _null_ _null_ _null_ cash_mul_int8 _null_ _null_ _null_ ));
+DATA(insert OID = 3345 ( cash_div_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 20" _null_ _null_ _null_ _null_ _null_ cash_div_int8 _null_ _null_ _null_ ));
DATA(insert OID = 864 ( cash_mul_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 23" _null_ _null_ _null_ _null_ _null_ cash_mul_int4 _null_ _null_ _null_ ));
DATA(insert OID = 865 ( cash_div_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 23" _null_ _null_ _null_ _null_ _null_ cash_div_int4 _null_ _null_ _null_ ));
DATA(insert OID = 866 ( cash_mul_int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 21" _null_ _null_ _null_ _null_ _null_ cash_mul_int2 _null_ _null_ _null_ ));
@@ -1015,38 +1021,38 @@ DESCR("convert text to char");
DATA(insert OID = 946 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "18" _null_ _null_ _null_ _null_ _null_ char_text _null_ _null_ _null_ ));
DESCR("convert char to text");
-DATA(insert OID = 952 ( lo_open PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "26 23" _null_ _null_ _null_ _null_ _null_ lo_open _null_ _null_ _null_ ));
+DATA(insert OID = 952 ( lo_open PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "26 23" _null_ _null_ _null_ _null_ _null_ be_lo_open _null_ _null_ _null_ ));
DESCR("large object open");
-DATA(insert OID = 953 ( lo_close PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 23 "23" _null_ _null_ _null_ _null_ _null_ lo_close _null_ _null_ _null_ ));
+DATA(insert OID = 953 ( lo_close PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 23 "23" _null_ _null_ _null_ _null_ _null_ be_lo_close _null_ _null_ _null_ ));
DESCR("large object close");
-DATA(insert OID = 954 ( loread PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 17 "23 23" _null_ _null_ _null_ _null_ _null_ loread _null_ _null_ _null_ ));
+DATA(insert OID = 954 ( loread PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 17 "23 23" _null_ _null_ _null_ _null_ _null_ be_loread _null_ _null_ _null_ ));
DESCR("large object read");
-DATA(insert OID = 955 ( lowrite PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "23 17" _null_ _null_ _null_ _null_ _null_ lowrite _null_ _null_ _null_ ));
+DATA(insert OID = 955 ( lowrite PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "23 17" _null_ _null_ _null_ _null_ _null_ be_lowrite _null_ _null_ _null_ ));
DESCR("large object write");
-DATA(insert OID = 956 ( lo_lseek PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 23 "23 23 23" _null_ _null_ _null_ _null_ _null_ lo_lseek _null_ _null_ _null_ ));
+DATA(insert OID = 956 ( lo_lseek PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 23 "23 23 23" _null_ _null_ _null_ _null_ _null_ be_lo_lseek _null_ _null_ _null_ ));
DESCR("large object seek");
-DATA(insert OID = 3170 ( lo_lseek64 PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 20 "23 20 23" _null_ _null_ _null_ _null_ _null_ lo_lseek64 _null_ _null_ _null_ ));
+DATA(insert OID = 3170 ( lo_lseek64 PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 20 "23 20 23" _null_ _null_ _null_ _null_ _null_ be_lo_lseek64 _null_ _null_ _null_ ));
DESCR("large object seek (64 bit)");
-DATA(insert OID = 957 ( lo_creat PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 26 "23" _null_ _null_ _null_ _null_ _null_ lo_creat _null_ _null_ _null_ ));
+DATA(insert OID = 957 ( lo_creat PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 26 "23" _null_ _null_ _null_ _null_ _null_ be_lo_creat _null_ _null_ _null_ ));
DESCR("large object create");
-DATA(insert OID = 715 ( lo_create PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 26 "26" _null_ _null_ _null_ _null_ _null_ lo_create _null_ _null_ _null_ ));
+DATA(insert OID = 715 ( lo_create PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 26 "26" _null_ _null_ _null_ _null_ _null_ be_lo_create _null_ _null_ _null_ ));
DESCR("large object create");
-DATA(insert OID = 958 ( lo_tell PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 23 "23" _null_ _null_ _null_ _null_ _null_ lo_tell _null_ _null_ _null_ ));
+DATA(insert OID = 958 ( lo_tell PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 23 "23" _null_ _null_ _null_ _null_ _null_ be_lo_tell _null_ _null_ _null_ ));
DESCR("large object position");
-DATA(insert OID = 3171 ( lo_tell64 PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 20 "23" _null_ _null_ _null_ _null_ _null_ lo_tell64 _null_ _null_ _null_ ));
+DATA(insert OID = 3171 ( lo_tell64 PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 20 "23" _null_ _null_ _null_ _null_ _null_ be_lo_tell64 _null_ _null_ _null_ ));
DESCR("large object position (64 bit)");
-DATA(insert OID = 1004 ( lo_truncate PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "23 23" _null_ _null_ _null_ _null_ _null_ lo_truncate _null_ _null_ _null_ ));
+DATA(insert OID = 1004 ( lo_truncate PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "23 23" _null_ _null_ _null_ _null_ _null_ be_lo_truncate _null_ _null_ _null_ ));
DESCR("truncate large object");
-DATA(insert OID = 3172 ( lo_truncate64 PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "23 20" _null_ _null_ _null_ _null_ _null_ lo_truncate64 _null_ _null_ _null_ ));
+DATA(insert OID = 3172 ( lo_truncate64 PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 23 "23 20" _null_ _null_ _null_ _null_ _null_ be_lo_truncate64 _null_ _null_ _null_ ));
DESCR("truncate large object (64 bit)");
-DATA(insert OID = 3457 ( lo_from_bytea PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 26 "26 17" _null_ _null_ _null_ _null_ _null_ lo_from_bytea _null_ _null_ _null_ ));
+DATA(insert OID = 3457 ( lo_from_bytea PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 26 "26 17" _null_ _null_ _null_ _null_ _null_ be_lo_from_bytea _null_ _null_ _null_ ));
DESCR("create new large object with given content");
-DATA(insert OID = 3458 ( lo_get PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 17 "26" _null_ _null_ _null_ _null_ _null_ lo_get _null_ _null_ _null_ ));
+DATA(insert OID = 3458 ( lo_get PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 17 "26" _null_ _null_ _null_ _null_ _null_ be_lo_get _null_ _null_ _null_ ));
DESCR("read entire large object");
-DATA(insert OID = 3459 ( lo_get PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 17 "26 20 23" _null_ _null_ _null_ _null_ _null_ lo_get_fragment _null_ _null_ _null_ ));
+DATA(insert OID = 3459 ( lo_get PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 17 "26 20 23" _null_ _null_ _null_ _null_ _null_ be_lo_get_fragment _null_ _null_ _null_ ));
DESCR("read large object from offset for length");
-DATA(insert OID = 3460 ( lo_put PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2278 "26 20 17" _null_ _null_ _null_ _null_ _null_ lo_put _null_ _null_ _null_ ));
+DATA(insert OID = 3460 ( lo_put PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2278 "26 20 17" _null_ _null_ _null_ _null_ _null_ be_lo_put _null_ _null_ _null_ ));
DESCR("write data at offset");
DATA(insert OID = 959 ( on_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "600 628" _null_ _null_ _null_ _null_ _null_ on_pl _null_ _null_ _null_ ));
@@ -1055,7 +1061,7 @@ DATA(insert OID = 961 ( close_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0
DATA(insert OID = 962 ( close_sl PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 600 "601 628" _null_ _null_ _null_ _null_ _null_ close_sl _null_ _null_ _null_ ));
DATA(insert OID = 963 ( close_lb PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 600 "628 603" _null_ _null_ _null_ _null_ _null_ close_lb _null_ _null_ _null_ ));
-DATA(insert OID = 964 ( lo_unlink PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 23 "26" _null_ _null_ _null_ _null_ _null_ lo_unlink _null_ _null_ _null_ ));
+DATA(insert OID = 964 ( lo_unlink PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 23 "26" _null_ _null_ _null_ _null_ _null_ be_lo_unlink _null_ _null_ _null_ ));
DESCR("large object unlink (delete)");
DATA(insert OID = 973 ( path_inter PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "602 602" _null_ _null_ _null_ _null_ _null_ path_inter _null_ _null_ _null_ ));
@@ -1767,8 +1773,10 @@ DATA(insert OID = 1576 ( setval PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 20
DESCR("set sequence value");
DATA(insert OID = 1765 ( setval PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 20 "2205 20 16" _null_ _null_ _null_ _null_ _null_ setval3_oid _null_ _null_ _null_ ));
DESCR("set sequence value and is_called status");
-DATA(insert OID = 3078 ( pg_sequence_parameters PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2249 "26" "{26,20,20,20,20,16}" "{i,o,o,o,o,o}" "{sequence_oid,start_value,minimum_value,maximum_value,increment,cycle_option}" _null_ _null_ pg_sequence_parameters _null_ _null_ _null_));
+DATA(insert OID = 3078 ( pg_sequence_parameters PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2249 "26" "{26,20,20,20,20,16,20,26}" "{i,o,o,o,o,o,o,o}" "{sequence_oid,start_value,minimum_value,maximum_value,increment,cycle_option,cache_size,data_type}" _null_ _null_ pg_sequence_parameters _null_ _null_ _null_));
DESCR("sequence parameters, for use by information schema");
+DATA(insert OID = 4032 ( pg_sequence_last_value PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 20 "2205" _null_ _null_ _null_ _null_ _null_ pg_sequence_last_value _null_ _null_ _null_ ));
+DESCR("sequence last value");
DATA(insert OID = 1579 ( varbit_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 1562 "2275 26 23" _null_ _null_ _null_ _null_ _null_ varbit_in _null_ _null_ _null_ ));
DESCR("I/O");
@@ -1913,10 +1921,14 @@ DATA(insert OID = 2284 ( regexp_replace PGNSP PGUID 12 1 0 0 0 f f f f t f i
DESCR("replace text using regexp");
DATA(insert OID = 2285 ( regexp_replace PGNSP PGUID 12 1 0 0 0 f f f f t f i s 4 0 25 "25 25 25 25" _null_ _null_ _null_ _null_ _null_ textregexreplace _null_ _null_ _null_ ));
DESCR("replace text using regexp");
+DATA(insert OID = 3396 ( regexp_match PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1009 "25 25" _null_ _null_ _null_ _null_ _null_ regexp_match_no_flags _null_ _null_ _null_ ));
+DESCR("find first match for regexp");
+DATA(insert OID = 3397 ( regexp_match PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 1009 "25 25 25" _null_ _null_ _null_ _null_ _null_ regexp_match _null_ _null_ _null_ ));
+DESCR("find first match for regexp");
DATA(insert OID = 2763 ( regexp_matches PGNSP PGUID 12 1 1 0 0 f f f f t t i s 2 0 1009 "25 25" _null_ _null_ _null_ _null_ _null_ regexp_matches_no_flags _null_ _null_ _null_ ));
-DESCR("find all match groups for regexp");
+DESCR("find match(es) for regexp");
DATA(insert OID = 2764 ( regexp_matches PGNSP PGUID 12 1 10 0 0 f f f f t t i s 3 0 1009 "25 25 25" _null_ _null_ _null_ _null_ _null_ regexp_matches _null_ _null_ _null_ ));
-DESCR("find all match groups for regexp");
+DESCR("find match(es) for regexp");
DATA(insert OID = 2088 ( split_part PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 25 "25 25 23" _null_ _null_ _null_ _null_ _null_ split_text _null_ _null_ _null_ ));
DESCR("split string by field_sep and return field_num");
DATA(insert OID = 2765 ( regexp_split_to_table PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 2 0 25 "25 25" _null_ _null_ _null_ _null_ _null_ regexp_split_to_table_no_flags _null_ _null_ _null_ ));
@@ -1977,6 +1989,12 @@ DATA(insert OID = 1642 ( pg_get_userbyid PGNSP PGUID 12 1 0 0 0 f f f f t f
DESCR("role name by OID (with fallback)");
DATA(insert OID = 1643 ( pg_get_indexdef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_get_indexdef _null_ _null_ _null_ ));
DESCR("index description");
+DATA(insert OID = 3415 ( pg_get_statisticsobjdef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_get_statisticsobjdef _null_ _null_ _null_ ));
+DESCR("extended statistics object description");
+DATA(insert OID = 3352 ( pg_get_partkeydef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_get_partkeydef _null_ _null_ _null_ ));
+DESCR("partition key description");
+DATA(insert OID = 3408 ( pg_get_partition_constraintdef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_get_partition_constraintdef _null_ _null_ _null_ ));
+DESCR("partition constraint description");
DATA(insert OID = 1662 ( pg_get_triggerdef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_get_triggerdef _null_ _null_ _null_ ));
DESCR("trigger description");
DATA(insert OID = 1387 ( pg_get_constraintdef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_get_constraintdef _null_ _null_ _null_ ));
@@ -2012,6 +2030,9 @@ DESCR("is a relation insertable/updatable/deletable");
DATA(insert OID = 3843 ( pg_column_is_updatable PGNSP PGUID 12 10 0 0 0 f f f f t f s s 3 0 16 "2205 21 16" _null_ _null_ _null_ _null_ _null_ pg_column_is_updatable _null_ _null_ _null_ ));
DESCR("is a column updatable");
+DATA(insert OID = 6120 ( pg_get_replica_identity_index PGNSP PGUID 12 10 0 0 0 f f f f t f s s 1 0 2205 "2205" _null_ _null_ _null_ _null_ _null_ pg_get_replica_identity_index _null_ _null_ _null_ ));
+DESCR("oid of replica identity index if any");
+
/* Deferrable unique constraint trigger */
DATA(insert OID = 1250 ( unique_key_recheck PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2279 "" _null_ _null_ _null_ _null_ _null_ unique_key_recheck _null_ _null_ _null_ ));
DESCR("deferred UNIQUE constraint check");
@@ -2051,6 +2072,7 @@ DATA(insert OID = 1671 ( varbitlt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0
DATA(insert OID = 1672 ( varbitcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "1562 1562" _null_ _null_ _null_ _null_ _null_ bitcmp _null_ _null_ _null_ ));
DESCR("less-equal-greater");
+/* avoid the C names bitand and bitor, since they are C++ keywords */
DATA(insert OID = 1673 ( bitand PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ _null_ bit_and _null_ _null_ _null_ ));
DATA(insert OID = 1674 ( bitor PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ _null_ bit_or _null_ _null_ _null_ ));
DATA(insert OID = 1675 ( bitxor PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ _null_ bitxor _null_ _null_ _null_ ));
@@ -2090,14 +2112,14 @@ DESCR("get bit");
DATA(insert OID = 3033 ( set_bit PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 1560 "1560 23 23" _null_ _null_ _null_ _null_ _null_ bitsetbit _null_ _null_ _null_ ));
DESCR("set bit");
-/* for mac type support */
+/* for macaddr type support */
DATA(insert OID = 436 ( macaddr_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 829 "2275" _null_ _null_ _null_ _null_ _null_ macaddr_in _null_ _null_ _null_ ));
DESCR("I/O");
DATA(insert OID = 437 ( macaddr_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "829" _null_ _null_ _null_ _null_ _null_ macaddr_out _null_ _null_ _null_ ));
DESCR("I/O");
DATA(insert OID = 753 ( trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 829 "829" _null_ _null_ _null_ _null_ _null_ macaddr_trunc _null_ _null_ _null_ ));
-DESCR("MAC manufacturer fields");
+DESCR("MACADDR manufacturer fields");
DATA(insert OID = 830 ( macaddr_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "829 829" _null_ _null_ _null_ _null_ _null_ macaddr_eq _null_ _null_ _null_ ));
DATA(insert OID = 831 ( macaddr_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "829 829" _null_ _null_ _null_ _null_ _null_ macaddr_lt _null_ _null_ _null_ ));
@@ -2110,6 +2132,35 @@ DESCR("less-equal-greater");
DATA(insert OID = 3144 ( macaddr_not PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 829 "829" _null_ _null_ _null_ _null_ _null_ macaddr_not _null_ _null_ _null_ ));
DATA(insert OID = 3145 ( macaddr_and PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 829 "829 829" _null_ _null_ _null_ _null_ _null_ macaddr_and _null_ _null_ _null_ ));
DATA(insert OID = 3146 ( macaddr_or PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 829 "829 829" _null_ _null_ _null_ _null_ _null_ macaddr_or _null_ _null_ _null_ ));
+DATA(insert OID = 3359 ( macaddr_sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2278 "2281" _null_ _null_ _null_ _null_ _null_ macaddr_sortsupport _null_ _null_ _null_ ));
+DESCR("sort support");
+
+/* for macaddr8 type support */
+DATA(insert OID = 4110 ( macaddr8_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 774 "2275" _null_ _null_ _null_ _null_ _null_ macaddr8_in _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 4111 ( macaddr8_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "774" _null_ _null_ _null_ _null_ _null_ macaddr8_out _null_ _null_ _null_ ));
+DESCR("I/O");
+
+DATA(insert OID = 4112 ( trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 774 "774" _null_ _null_ _null_ _null_ _null_ macaddr8_trunc _null_ _null_ _null_ ));
+DESCR("MACADDR8 manufacturer fields");
+
+DATA(insert OID = 4113 ( macaddr8_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_eq _null_ _null_ _null_ ));
+DATA(insert OID = 4114 ( macaddr8_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_lt _null_ _null_ _null_ ));
+DATA(insert OID = 4115 ( macaddr8_le PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_le _null_ _null_ _null_ ));
+DATA(insert OID = 4116 ( macaddr8_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_gt _null_ _null_ _null_ ));
+DATA(insert OID = 4117 ( macaddr8_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_ge _null_ _null_ _null_ ));
+DATA(insert OID = 4118 ( macaddr8_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_ne _null_ _null_ _null_ ));
+DATA(insert OID = 4119 ( macaddr8_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_cmp _null_ _null_ _null_ ));
+DESCR("less-equal-greater");
+DATA(insert OID = 4120 ( macaddr8_not PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 774 "774" _null_ _null_ _null_ _null_ _null_ macaddr8_not _null_ _null_ _null_ ));
+DATA(insert OID = 4121 ( macaddr8_and PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 774 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_and _null_ _null_ _null_ ));
+DATA(insert OID = 4122 ( macaddr8_or PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 774 "774 774" _null_ _null_ _null_ _null_ _null_ macaddr8_or _null_ _null_ _null_ ));
+DATA(insert OID = 4123 ( macaddr8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 774 "829" _null_ _null_ _null_ _null_ _null_ macaddrtomacaddr8 _null_ _null_ _null_ ));
+DESCR("convert macaddr to macaddr8");
+DATA(insert OID = 4124 ( macaddr PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 829 "774" _null_ _null_ _null_ _null_ _null_ macaddr8tomacaddr _null_ _null_ _null_ ));
+DESCR("convert macaddr8 to macaddr");
+DATA(insert OID = 4125 ( macaddr8_set7bit PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 774 "774" _null_ _null_ _null_ _null_ _null_ macaddr8_set7bit _null_ _null_ _null_ ));
+DESCR("set 7th bit in macaddr8");
/* for inet type support */
DATA(insert OID = 910 ( inet_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 869 "2275" _null_ _null_ _null_ _null_ _null_ inet_in _null_ _null_ _null_ ));
@@ -2209,6 +2260,18 @@ DESCR("GiST support");
DATA(insert OID = 3559 ( inet_gist_same PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 2281 "869 869 2281" _null_ _null_ _null_ _null_ _null_ inet_gist_same _null_ _null_ _null_ ));
DESCR("GiST support");
+/* SP-GiST support for inet and cidr */
+DATA(insert OID = 3795 ( inet_spg_config PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ _null_ inet_spg_config _null_ _null_ _null_ ));
+DESCR("SP-GiST support");
+DATA(insert OID = 3796 ( inet_spg_choose PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ _null_ inet_spg_choose _null_ _null_ _null_ ));
+DESCR("SP-GiST support");
+DATA(insert OID = 3797 ( inet_spg_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ _null_ inet_spg_picksplit _null_ _null_ _null_ ));
+DESCR("SP-GiST support");
+DATA(insert OID = 3798 ( inet_spg_inner_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ _null_ inet_spg_inner_consistent _null_ _null_ _null_ ));
+DESCR("SP-GiST support");
+DATA(insert OID = 3799 ( inet_spg_leaf_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ _null_ inet_spg_leaf_consistent _null_ _null_ _null_ ));
+DESCR("SP-GiST support");
+
/* Selectivity estimation for inet and cidr */
DATA(insert OID = 3560 ( networksel PGNSP PGUID 12 1 0 0 0 f f f f t f s s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ _null_ networksel _null_ _null_ _null_ ));
DESCR("restriction selectivity for network operators");
@@ -2706,6 +2769,24 @@ DESCR("current user privilege on any column by rel name");
DATA(insert OID = 3029 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s s 2 0 16 "26 25" _null_ _null_ _null_ _null_ _null_ has_any_column_privilege_id _null_ _null_ _null_ ));
DESCR("current user privilege on any column by rel oid");
+DATA(insert OID = 3355 ( pg_ndistinct_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 3361 "2275" _null_ _null_ _null_ _null_ _null_ pg_ndistinct_in _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3356 ( pg_ndistinct_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "3361" _null_ _null_ _null_ _null_ _null_ pg_ndistinct_out _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3357 ( pg_ndistinct_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 3361 "2281" _null_ _null_ _null_ _null_ _null_ pg_ndistinct_recv _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3358 ( pg_ndistinct_send PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 17 "3361" _null_ _null_ _null_ _null_ _null_ pg_ndistinct_send _null_ _null_ _null_ ));
+DESCR("I/O");
+
+DATA(insert OID = 3404 ( pg_dependencies_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 3402 "2275" _null_ _null_ _null_ _null_ _null_ pg_dependencies_in _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3405 ( pg_dependencies_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "3402" _null_ _null_ _null_ _null_ _null_ pg_dependencies_out _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3406 ( pg_dependencies_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 3402 "2281" _null_ _null_ _null_ _null_ _null_ pg_dependencies_recv _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3407 ( pg_dependencies_send PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 17 "3402" _null_ _null_ _null_ _null_ _null_ pg_dependencies_send _null_ _null_ _null_ ));
+DESCR("I/O");
+
DATA(insert OID = 1928 ( pg_stat_get_numscans PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 20 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_numscans _null_ _null_ _null_ ));
DESCR("statistics: number of scans done for table/index");
DATA(insert OID = 1929 ( pg_stat_get_tuples_returned PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 20 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_tuples_returned _null_ _null_ _null_ ));
@@ -2748,14 +2829,16 @@ DATA(insert OID = 3057 ( pg_stat_get_autoanalyze_count PGNSP PGUID 12 1 0 0 0 f
DESCR("statistics: number of auto analyzes for a table");
DATA(insert OID = 1936 ( pg_stat_get_backend_idset PGNSP PGUID 12 1 100 0 0 f f f f t t s r 0 0 23 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_backend_idset _null_ _null_ _null_ ));
DESCR("statistics: currently active backend IDs");
-DATA(insert OID = 2022 ( pg_stat_get_activity PGNSP PGUID 12 1 100 0 0 f f f f f t s r 1 0 2249 "23" "{23,26,23,26,25,25,25,25,25,1184,1184,1184,1184,869,25,23,28,28,16,25,25,23,16,25}" "{i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{pid,datid,pid,usesysid,application_name,state,query,wait_event_type,wait_event,xact_start,query_start,backend_start,state_change,client_addr,client_hostname,client_port,backend_xid,backend_xmin,ssl,sslversion,sslcipher,sslbits,sslcompression,sslclientdn}" _null_ _null_ pg_stat_get_activity _null_ _null_ _null_ ));
+DATA(insert OID = 2022 ( pg_stat_get_activity PGNSP PGUID 12 1 100 0 0 f f f f f t s r 1 0 2249 "23" "{23,26,23,26,25,25,25,25,25,1184,1184,1184,1184,869,25,23,28,28,25,16,25,25,23,16,25}" "{i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{pid,datid,pid,usesysid,application_name,state,query,wait_event_type,wait_event,xact_start,query_start,backend_start,state_change,client_addr,client_hostname,client_port,backend_xid,backend_xmin,backend_type,ssl,sslversion,sslcipher,sslbits,sslcompression,sslclientdn}" _null_ _null_ pg_stat_get_activity _null_ _null_ _null_ ));
DESCR("statistics: information about currently active backends");
DATA(insert OID = 3318 ( pg_stat_get_progress_info PGNSP PGUID 12 1 100 0 0 f f f f t t s r 1 0 2249 "25" "{25,23,26,26,20,20,20,20,20,20,20,20,20,20}" "{i,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{cmdtype,pid,datid,relid,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10}" _null_ _null_ pg_stat_get_progress_info _null_ _null_ _null_ ));
DESCR("statistics: information about progress of backends running maintenance command");
-DATA(insert OID = 3099 ( pg_stat_get_wal_senders PGNSP PGUID 12 1 10 0 0 f f f f f t s r 0 0 2249 "" "{23,25,3220,3220,3220,3220,23,25}" "{o,o,o,o,o,o,o,o}" "{pid,state,sent_location,write_location,flush_location,replay_location,sync_priority,sync_state}" _null_ _null_ pg_stat_get_wal_senders _null_ _null_ _null_ ));
+DATA(insert OID = 3099 ( pg_stat_get_wal_senders PGNSP PGUID 12 1 10 0 0 f f f f f t s r 0 0 2249 "" "{23,25,3220,3220,3220,3220,1186,1186,1186,23,25}" "{o,o,o,o,o,o,o,o,o,o,o}" "{pid,state,sent_lsn,write_lsn,flush_lsn,replay_lsn,write_lag,flush_lag,replay_lag,sync_priority,sync_state}" _null_ _null_ pg_stat_get_wal_senders _null_ _null_ _null_ ));
DESCR("statistics: information about currently active replication");
DATA(insert OID = 3317 ( pg_stat_get_wal_receiver PGNSP PGUID 12 1 0 0 0 f f f f f f s r 0 0 2249 "" "{23,25,3220,23,3220,23,1184,1184,3220,1184,25,25}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{pid,status,receive_start_lsn,receive_start_tli,received_lsn,received_tli,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time,slot_name,conninfo}" _null_ _null_ pg_stat_get_wal_receiver _null_ _null_ _null_ ));
DESCR("statistics: information about WAL receiver");
+DATA(insert OID = 6118 ( pg_stat_get_subscription PGNSP PGUID 12 1 0 0 0 f f f f f f s r 1 0 2249 "26" "{26,26,26,23,3220,1184,1184,3220,1184}" "{i,o,o,o,o,o,o,o,o}" "{subid,subid,relid,pid,received_lsn,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time}" _null_ _null_ pg_stat_get_subscription _null_ _null_ _null_ ));
+DESCR("statistics: information about subscription");
DATA(insert OID = 2026 ( pg_backend_pid PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 23 "" _null_ _null_ _null_ _null_ _null_ pg_backend_pid _null_ _null_ _null_ ));
DESCR("statistics: current backend PID");
DATA(insert OID = 1937 ( pg_stat_get_backend_pid PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 23 "23" _null_ _null_ _null_ _null_ _null_ pg_stat_get_backend_pid _null_ _null_ _null_ ));
@@ -2821,9 +2904,9 @@ DESCR("statistics: number of temporary files written");
DATA(insert OID = 3151 ( pg_stat_get_db_temp_bytes PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 20 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_db_temp_bytes _null_ _null_ _null_ ));
DESCR("statistics: number of bytes in temporary files written");
DATA(insert OID = 2844 ( pg_stat_get_db_blk_read_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 701 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_db_blk_read_time _null_ _null_ _null_ ));
-DESCR("statistics: block read time, in msec");
+DESCR("statistics: block read time, in milliseconds");
DATA(insert OID = 2845 ( pg_stat_get_db_blk_write_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 701 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_db_blk_write_time _null_ _null_ _null_ ));
-DESCR("statistics: block write time, in msec");
+DESCR("statistics: block write time, in milliseconds");
DATA(insert OID = 3195 ( pg_stat_get_archiver PGNSP PGUID 12 1 0 0 0 f f f f f f s r 0 0 2249 "" "{20,25,1184,20,25,1184,1184}" "{o,o,o,o,o,o,o}" "{archived_count,last_archived_wal,last_archived_time,failed_count,last_failed_wal,last_failed_time,stats_reset}" _null_ _null_ pg_stat_get_archiver _null_ _null_ _null_ ));
DESCR("statistics: information about WAL archiver");
DATA(insert OID = 2769 ( pg_stat_get_bgwriter_timed_checkpoints PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 20 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_timed_checkpoints _null_ _null_ _null_ ));
@@ -2839,9 +2922,9 @@ DESCR("statistics: number of times the bgwriter stopped processing when it had w
DATA(insert OID = 3075 ( pg_stat_get_bgwriter_stat_reset_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_stat_reset_time _null_ _null_ _null_ ));
DESCR("statistics: last reset for the bgwriter");
DATA(insert OID = 3160 ( pg_stat_get_checkpoint_write_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 701 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_checkpoint_write_time _null_ _null_ _null_ ));
-DESCR("statistics: checkpoint time spent writing buffers to disk, in msec");
+DESCR("statistics: checkpoint time spent writing buffers to disk, in milliseconds");
DATA(insert OID = 3161 ( pg_stat_get_checkpoint_sync_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 701 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_checkpoint_sync_time _null_ _null_ _null_ ));
-DESCR("statistics: checkpoint time spent synchronizing buffers to disk, in msec");
+DESCR("statistics: checkpoint time spent synchronizing buffers to disk, in milliseconds");
DATA(insert OID = 2775 ( pg_stat_get_buf_written_backend PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 20 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_buf_written_backend _null_ _null_ _null_ ));
DESCR("statistics: number of buffers written by backends");
DATA(insert OID = 3063 ( pg_stat_get_buf_fsync_backend PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 20 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_buf_fsync_backend _null_ _null_ _null_ ));
@@ -2852,9 +2935,9 @@ DESCR("statistics: number of buffer allocations");
DATA(insert OID = 2978 ( pg_stat_get_function_calls PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 20 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_function_calls _null_ _null_ _null_ ));
DESCR("statistics: number of function calls");
DATA(insert OID = 2979 ( pg_stat_get_function_total_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 701 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_function_total_time _null_ _null_ _null_ ));
-DESCR("statistics: total execution time of function, in msec");
+DESCR("statistics: total execution time of function, in milliseconds");
DATA(insert OID = 2980 ( pg_stat_get_function_self_time PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 701 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_function_self_time _null_ _null_ _null_ ));
-DESCR("statistics: self execution time of function, in msec");
+DESCR("statistics: self execution time of function, in milliseconds");
DATA(insert OID = 3037 ( pg_stat_get_xact_numscans PGNSP PGUID 12 1 0 0 0 f f f f t f v r 1 0 20 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_xact_numscans _null_ _null_ _null_ ));
DESCR("statistics: number of scans done for table/index in current transaction");
@@ -2877,9 +2960,9 @@ DESCR("statistics: number of blocks found in cache in current transaction");
DATA(insert OID = 3046 ( pg_stat_get_xact_function_calls PGNSP PGUID 12 1 0 0 0 f f f f t f v r 1 0 20 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_xact_function_calls _null_ _null_ _null_ ));
DESCR("statistics: number of function calls in current transaction");
DATA(insert OID = 3047 ( pg_stat_get_xact_function_total_time PGNSP PGUID 12 1 0 0 0 f f f f t f v r 1 0 701 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_xact_function_total_time _null_ _null_ _null_ ));
-DESCR("statistics: total execution time of function in current transaction, in msec");
+DESCR("statistics: total execution time of function in current transaction, in milliseconds");
DATA(insert OID = 3048 ( pg_stat_get_xact_function_self_time PGNSP PGUID 12 1 0 0 0 f f f f t f v r 1 0 701 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_get_xact_function_self_time _null_ _null_ _null_ ));
-DESCR("statistics: self execution time of function in current transaction, in msec");
+DESCR("statistics: self execution time of function in current transaction, in milliseconds");
DATA(insert OID = 3788 ( pg_stat_get_snapshot_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_stat_get_snapshot_timestamp _null_ _null_ _null_ ));
DESCR("statistics: timestamp of the current statistics snapshot");
@@ -2894,7 +2977,7 @@ DESCR("statistics: reset collected statistics for a single table or index in the
DATA(insert OID = 3777 ( pg_stat_reset_single_function_counters PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 2278 "26" _null_ _null_ _null_ _null_ _null_ pg_stat_reset_single_function_counters _null_ _null_ _null_ ));
DESCR("statistics: reset collected statistics for a single function in the current database");
-DATA(insert OID = 3163 ( pg_trigger_depth PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 23 "" _null_ _null_ _null_ _null_ _null_ pg_trigger_depth _null_ _null_ _null_ ));
+DATA(insert OID = 3163 ( pg_trigger_depth PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 23 "" _null_ _null_ _null_ _null_ _null_ pg_trigger_depth _null_ _null_ _null_ ));
DESCR("current trigger depth");
DATA(insert OID = 3778 ( pg_tablespace_location PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_tablespace_location _null_ _null_ _null_ ));
@@ -3054,10 +3137,16 @@ DATA(insert OID = 2084 ( pg_show_all_settings PGNSP PGUID 12 1 1000 0 0 f f f f
DESCR("SHOW ALL as a function");
DATA(insert OID = 3329 ( pg_show_all_file_settings PGNSP PGUID 12 1 1000 0 0 f f f f t t v s 0 0 2249 "" "{25,23,23,25,25,16,25}" "{o,o,o,o,o,o,o}" "{sourcefile,sourceline,seqno,name,setting,applied,error}" _null_ _null_ show_all_file_settings _null_ _null_ _null_ ));
DESCR("show config file settings");
+DATA(insert OID = 3401 ( pg_hba_file_rules PGNSP PGUID 12 1 1000 0 0 f f f f t t v s 0 0 2249 "" "{23,25,1009,1009,25,25,25,1009,25}" "{o,o,o,o,o,o,o,o,o}" "{line_number,type,database,user_name,address,netmask,auth_method,options,error}" _null_ _null_ pg_hba_file_rules _null_ _null_ _null_ ));
+DESCR("show pg_hba.conf rules");
DATA(insert OID = 1371 ( pg_lock_status PGNSP PGUID 12 1 1000 0 0 f f f f t t v s 0 0 2249 "" "{25,26,26,23,21,25,28,26,26,21,25,23,25,16,16}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{locktype,database,relation,page,tuple,virtualxid,transactionid,classid,objid,objsubid,virtualtransaction,pid,mode,granted,fastpath}" _null_ _null_ pg_lock_status _null_ _null_ _null_ ));
DESCR("view system lock information");
DATA(insert OID = 2561 ( pg_blocking_pids PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 1007 "23" _null_ _null_ _null_ _null_ _null_ pg_blocking_pids _null_ _null_ _null_ ));
-DESCR("get array of PIDs of sessions blocking specified backend PID");
+DESCR("get array of PIDs of sessions blocking specified backend PID from acquiring a heavyweight lock");
+DATA(insert OID = 3376 ( pg_safe_snapshot_blocking_pids PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 1007 "23" _null_ _null_ _null_ _null_ _null_ pg_safe_snapshot_blocking_pids _null_ _null_ _null_ ));
+DESCR("get array of PIDs of sessions blocking specified backend PID from acquiring a safe snapshot");
+DATA(insert OID = 3378 ( pg_isolation_test_session_is_blocked PGNSP PGUID 12 1 0 0 0 f f f f t f v s 2 0 16 "23 1007" _null_ _null_ _null_ _null_ _null_ pg_isolation_test_session_is_blocked _null_ _null_ _null_ ));
+DESCR("isolationtester support function");
DATA(insert OID = 1065 ( pg_prepared_xact PGNSP PGUID 12 1 1000 0 0 f f f f t t v s 0 0 2249 "" "{28,25,1184,26,26}" "{o,o,o,o,o}" "{transaction,gid,prepared,ownerid,dbid}" _null_ _null_ pg_prepared_xact _null_ _null_ _null_ ));
DESCR("view two-phase transactions");
DATA(insert OID = 3819 ( pg_get_multixact_members PGNSP PGUID 12 1 1000 0 0 f f f f t t v s 1 0 2249 "28" "{28,28,25}" "{i,o,o}" "{multixid,xid,mode}" _null_ _null_ pg_get_multixact_members _null_ _null_ _null_ ));
@@ -3072,13 +3161,13 @@ DESCR("get transaction Id and commit timestamp of latest transaction commit");
DATA(insert OID = 3537 ( pg_describe_object PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 25 "26 26 23" _null_ _null_ _null_ _null_ _null_ pg_describe_object _null_ _null_ _null_ ));
DESCR("get identification of SQL object");
-DATA(insert OID = 3839 ( pg_identify_object PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 2249 "26 26 23" "{26,26,23,25,25,25,25}" "{i,i,i,o,o,o,o}" "{classid,objid,subobjid,type,schema,name,identity}" _null_ _null_ pg_identify_object _null_ _null_ _null_ ));
+DATA(insert OID = 3839 ( pg_identify_object PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 2249 "26 26 23" "{26,26,23,25,25,25,25}" "{i,i,i,o,o,o,o}" "{classid,objid,objsubid,type,schema,name,identity}" _null_ _null_ pg_identify_object _null_ _null_ _null_ ));
DESCR("get machine-parseable identification of SQL object");
-DATA(insert OID = 3382 ( pg_identify_object_as_address PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 2249 "26 26 23" "{26,26,23,25,1009,1009}" "{i,i,i,o,o,o}" "{classid,objid,subobjid,type,object_names,object_args}" _null_ _null_ pg_identify_object_as_address _null_ _null_ _null_ ));
+DATA(insert OID = 3382 ( pg_identify_object_as_address PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 2249 "26 26 23" "{26,26,23,25,1009,1009}" "{i,i,i,o,o,o}" "{classid,objid,objsubid,type,object_names,object_args}" _null_ _null_ pg_identify_object_as_address _null_ _null_ _null_ ));
DESCR("get identification of SQL object for pg_get_object_address()");
-DATA(insert OID = 3954 ( pg_get_object_address PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 2249 "25 1009 1009" "{25,1009,1009,26,26,23}" "{i,i,i,o,o,o}" "{type,name,args,classid,objid,subobjid}" _null_ _null_ pg_get_object_address _null_ _null_ _null_ ));
+DATA(insert OID = 3954 ( pg_get_object_address PGNSP PGUID 12 1 0 0 0 f f f f t f s s 3 0 2249 "25 1009 1009" "{25,1009,1009,26,26,23}" "{i,i,i,o,o,o}" "{type,name,args,classid,objid,objsubid}" _null_ _null_ pg_get_object_address _null_ _null_ _null_ ));
DESCR("get OID-based object address from name/args arrays");
DATA(insert OID = 2079 ( pg_table_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ pg_table_is_visible _null_ _null_ _null_ ));
@@ -3095,6 +3184,8 @@ DATA(insert OID = 3829 ( pg_opfamily_is_visible PGNSP PGUID 12 10 0 0 0 f f f f
DESCR("is opfamily visible in search path?");
DATA(insert OID = 2093 ( pg_conversion_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ pg_conversion_is_visible _null_ _null_ _null_ ));
DESCR("is conversion visible in search path?");
+DATA(insert OID = 3403 ( pg_statistics_obj_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ pg_statistics_obj_is_visible _null_ _null_ _null_ ));
+DESCR("is statistics object visible in search path?");
DATA(insert OID = 3756 ( pg_ts_parser_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ pg_ts_parser_is_visible _null_ _null_ _null_ ));
DESCR("is text search parser visible in search path?");
DATA(insert OID = 3757 ( pg_ts_dict_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ pg_ts_dict_is_visible _null_ _null_ _null_ ));
@@ -3117,31 +3208,31 @@ DATA(insert OID = 2096 ( pg_terminate_backend PGNSP PGUID 12 1 0 0 0 f f f f t
DESCR("terminate a server process");
DATA(insert OID = 2172 ( pg_start_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v r 3 0 3220 "25 16 16" _null_ _null_ _null_ _null_ _null_ pg_start_backup _null_ _null_ _null_ ));
DESCR("prepare for taking an online backup");
-DATA(insert OID = 2173 ( pg_stop_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_stop_backup _null_ _null_ _null_ ));
+DATA(insert OID = 2173 ( pg_stop_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v r 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_stop_backup _null_ _null_ _null_ ));
DESCR("finish taking an online backup");
-DATA(insert OID = 2739 ( pg_stop_backup PGNSP PGUID 12 1 1 0 0 f f f f t t v s 1 0 2249 "16" "{16,3220,25,25}" "{i,o,o,o}" "{exclusive,lsn,labelfile,spcmapfile}" _null_ _null_ pg_stop_backup_v2 _null_ _null_ _null_ ));
+DATA(insert OID = 2739 ( pg_stop_backup PGNSP PGUID 12 1 1 0 0 f f f f t t v r 2 0 2249 "16 16" "{16,16,3220,25,25}" "{i,i,o,o,o}" "{exclusive,wait_for_archive,lsn,labelfile,spcmapfile}" _null_ _null_ pg_stop_backup_v2 _null_ _null_ _null_ ));
DESCR("finish taking an online backup");
DATA(insert OID = 3813 ( pg_is_in_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_in_backup _null_ _null_ _null_ ));
DESCR("true if server is in online backup");
DATA(insert OID = 3814 ( pg_backup_start_time PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_backup_start_time _null_ _null_ _null_ ));
DESCR("start time of an online backup");
-DATA(insert OID = 2848 ( pg_switch_xlog PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_switch_xlog _null_ _null_ _null_ ));
-DESCR("switch to new xlog file");
+DATA(insert OID = 2848 ( pg_switch_wal PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_switch_wal _null_ _null_ _null_ ));
+DESCR("switch to new wal file");
DATA(insert OID = 3098 ( pg_create_restore_point PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 3220 "25" _null_ _null_ _null_ _null_ _null_ pg_create_restore_point _null_ _null_ _null_ ));
DESCR("create a named restore point");
-DATA(insert OID = 2849 ( pg_current_xlog_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_xlog_location _null_ _null_ _null_ ));
-DESCR("current xlog write location");
-DATA(insert OID = 2852 ( pg_current_xlog_insert_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_xlog_insert_location _null_ _null_ _null_ ));
-DESCR("current xlog insert location");
-DATA(insert OID = 3330 ( pg_current_xlog_flush_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_xlog_flush_location _null_ _null_ _null_ ));
-DESCR("current xlog flush location");
-DATA(insert OID = 2850 ( pg_xlogfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{wal_location,file_name,file_offset}" _null_ _null_ pg_xlogfile_name_offset _null_ _null_ _null_ ));
-DESCR("xlog filename and byte offset, given an xlog location");
-DATA(insert OID = 2851 ( pg_xlogfile_name PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "3220" _null_ _null_ _null_ _null_ _null_ pg_xlogfile_name _null_ _null_ _null_ ));
-DESCR("xlog filename, given an xlog location");
-
-DATA(insert OID = 3165 ( pg_xlog_location_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_xlog_location_diff _null_ _null_ _null_ ));
-DESCR("difference in bytes, given two xlog locations");
+DATA(insert OID = 2849 ( pg_current_wal_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_lsn _null_ _null_ _null_ ));
+DESCR("current wal write location");
+DATA(insert OID = 2852 ( pg_current_wal_insert_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_insert_lsn _null_ _null_ _null_ ));
+DESCR("current wal insert location");
+DATA(insert OID = 3330 ( pg_current_wal_flush_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_flush_lsn _null_ _null_ _null_ ));
+DESCR("current wal flush location");
+DATA(insert OID = 2850 ( pg_walfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{lsn,file_name,file_offset}" _null_ _null_ pg_walfile_name_offset _null_ _null_ _null_ ));
+DESCR("wal filename and byte offset, given a wal location");
+DATA(insert OID = 2851 ( pg_walfile_name PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "3220" _null_ _null_ _null_ _null_ _null_ pg_walfile_name _null_ _null_ _null_ ));
+DESCR("wal filename, given a wal location");
+
+DATA(insert OID = 3165 ( pg_wal_lsn_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_wal_lsn_diff _null_ _null_ _null_ ));
+DESCR("difference in bytes, given two wal locations");
DATA(insert OID = 3809 ( pg_export_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 0 0 25 "" _null_ _null_ _null_ _null_ _null_ pg_export_snapshot _null_ _null_ _null_ ));
DESCR("export a snapshot");
@@ -3149,24 +3240,28 @@ DESCR("export a snapshot");
DATA(insert OID = 3810 ( pg_is_in_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_in_recovery _null_ _null_ _null_ ));
DESCR("true if server is in recovery");
-DATA(insert OID = 3820 ( pg_last_xlog_receive_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_xlog_receive_location _null_ _null_ _null_ ));
-DESCR("current xlog flush location");
-DATA(insert OID = 3821 ( pg_last_xlog_replay_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_xlog_replay_location _null_ _null_ _null_ ));
-DESCR("last xlog replay location");
+DATA(insert OID = 3820 ( pg_last_wal_receive_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_receive_lsn _null_ _null_ _null_ ));
+DESCR("current wal flush location");
+DATA(insert OID = 3821 ( pg_last_wal_replay_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_replay_lsn _null_ _null_ _null_ ));
+DESCR("last wal replay location");
DATA(insert OID = 3830 ( pg_last_xact_replay_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_last_xact_replay_timestamp _null_ _null_ _null_ ));
DESCR("timestamp of last replay xact");
-DATA(insert OID = 3071 ( pg_xlog_replay_pause PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_xlog_replay_pause _null_ _null_ _null_ ));
-DESCR("pause xlog replay");
-DATA(insert OID = 3072 ( pg_xlog_replay_resume PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_xlog_replay_resume _null_ _null_ _null_ ));
-DESCR("resume xlog replay, if it was paused");
-DATA(insert OID = 3073 ( pg_is_xlog_replay_paused PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_xlog_replay_paused _null_ _null_ _null_ ));
-DESCR("true if xlog replay is paused");
+DATA(insert OID = 3071 ( pg_wal_replay_pause PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_wal_replay_pause _null_ _null_ _null_ ));
+DESCR("pause wal replay");
+DATA(insert OID = 3072 ( pg_wal_replay_resume PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_wal_replay_resume _null_ _null_ _null_ ));
+DESCR("resume wal replay, if it was paused");
+DATA(insert OID = 3073 ( pg_is_wal_replay_paused PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_wal_replay_paused _null_ _null_ _null_ ));
+DESCR("true if wal replay is paused");
DATA(insert OID = 2621 ( pg_reload_conf PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_reload_conf _null_ _null_ _null_ ));
DESCR("reload configuration files");
DATA(insert OID = 2622 ( pg_rotate_logfile PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_rotate_logfile _null_ _null_ _null_ ));
DESCR("rotate log file");
+DATA(insert OID = 3800 ( pg_current_logfile PGNSP PGUID 12 1 0 0 0 f f f f f f v s 0 0 25 "" _null_ _null_ _null_ _null_ _null_ pg_current_logfile _null_ _null_ _null_ ));
+DESCR("current logging collector file location");
+DATA(insert OID = 3801 ( pg_current_logfile PGNSP PGUID 12 1 0 0 0 f f f f f f v s 1 0 25 "25" _null_ _null_ _null_ _null_ _null_ pg_current_logfile_1arg _null_ _null_ _null_ ));
+DESCR("current logging collector file location");
DATA(insert OID = 2623 ( pg_stat_file PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 2249 "25" "{25,20,1184,1184,1184,1184,16}" "{i,o,o,o,o,o,o}" "{filename,size,access,modification,change,creation,isdir}" _null_ _null_ pg_stat_file_1arg _null_ _null_ _null_ ));
DESCR("get information about file");
@@ -4028,6 +4123,10 @@ DATA(insert OID = 3120 ( void_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i s
DESCR("I/O");
DATA(insert OID = 3121 ( void_send PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "2278" _null_ _null_ _null_ _null_ _null_ void_send _null_ _null_ _null_ ));
DESCR("I/O");
+DATA(insert OID = 3446 ( macaddr8_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 774 "2281" _null_ _null_ _null_ _null_ _null_ macaddr8_recv _null_ _null_ _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3447 ( macaddr8_send PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "774" _null_ _null_ _null_ _null_ _null_ macaddr8_send _null_ _null_ _null_ ));
+DESCR("I/O");
/* System-view support functions with pretty-print option */
DATA(insert OID = 2504 ( pg_get_ruledef PGNSP PGUID 12 1 0 0 0 f f f f t f s s 2 0 25 "26 16" _null_ _null_ _null_ _null_ _null_ pg_get_ruledef_ext _null_ _null_ _null_ ));
@@ -4735,6 +4834,24 @@ DESCR("generate headline");
DATA(insert OID = 3755 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f s s 2 0 25 "25 3615" _null_ _null_ _null_ _null_ _null_ ts_headline _null_ _null_ _null_ ));
DESCR("generate headline");
+DATA(insert OID = 4201 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f i s 4 0 3802 "3734 3802 3615 25" _null_ _null_ _null_ _null_ _null_ ts_headline_jsonb_byid_opt _null_ _null_ _null_ ));
+DESCR("generate headline from jsonb");
+DATA(insert OID = 4202 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f i s 3 0 3802 "3734 3802 3615" _null_ _null_ _null_ _null_ _null_ ts_headline_jsonb_byid _null_ _null_ _null_ ));
+DESCR("generate headline from jsonb");
+DATA(insert OID = 4203 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f s s 3 0 3802 "3802 3615 25" _null_ _null_ _null_ _null_ _null_ ts_headline_jsonb_opt _null_ _null_ _null_ ));
+DESCR("generate headline from jsonb");
+DATA(insert OID = 4204 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f s s 2 0 3802 "3802 3615" _null_ _null_ _null_ _null_ _null_ ts_headline_jsonb _null_ _null_ _null_ ));
+DESCR("generate headline from jsonb");
+
+DATA(insert OID = 4205 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f i s 4 0 114 "3734 114 3615 25" _null_ _null_ _null_ _null_ _null_ ts_headline_json_byid_opt _null_ _null_ _null_ ));
+DESCR("generate headline from json");
+DATA(insert OID = 4206 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f i s 3 0 114 "3734 114 3615" _null_ _null_ _null_ _null_ _null_ ts_headline_json_byid _null_ _null_ _null_ ));
+DESCR("generate headline from json");
+DATA(insert OID = 4207 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f s s 3 0 114 "114 3615 25" _null_ _null_ _null_ _null_ _null_ ts_headline_json_opt _null_ _null_ _null_ ));
+DESCR("generate headline from json");
+DATA(insert OID = 4208 ( ts_headline PGNSP PGUID 12 100 0 0 0 f f f f t f s s 2 0 114 "114 3615" _null_ _null_ _null_ _null_ _null_ ts_headline_json _null_ _null_ _null_ ));
+DESCR("generate headline from json");
+
DATA(insert OID = 3745 ( to_tsvector PGNSP PGUID 12 100 0 0 0 f f f f t f i s 2 0 3614 "3734 25" _null_ _null_ _null_ _null_ _null_ to_tsvector_byid _null_ _null_ _null_ ));
DESCR("transform to tsvector");
DATA(insert OID = 3746 ( to_tsquery PGNSP PGUID 12 100 0 0 0 f f f f t f i s 2 0 3615 "3734 25" _null_ _null_ _null_ _null_ _null_ to_tsquery_byid _null_ _null_ _null_ ));
@@ -4751,6 +4868,14 @@ DATA(insert OID = 3751 ( plainto_tsquery PGNSP PGUID 12 100 0 0 0 f f f f t f s
DESCR("transform to tsquery");
DATA(insert OID = 5001 ( phraseto_tsquery PGNSP PGUID 12 100 0 0 0 f f f f t f s s 1 0 3615 "25" _null_ _null_ _null_ _null_ _null_ phraseto_tsquery _null_ _null_ _null_ ));
DESCR("transform to tsquery");
+DATA(insert OID = 4209 ( to_tsvector PGNSP PGUID 12 100 0 0 0 f f f f t f s s 1 0 3614 "3802" _null_ _null_ _null_ _null_ _null_ jsonb_to_tsvector _null_ _null_ _null_ ));
+DESCR("transform jsonb to tsvector");
+DATA(insert OID = 4210 ( to_tsvector PGNSP PGUID 12 100 0 0 0 f f f f t f s s 1 0 3614 "114" _null_ _null_ _null_ _null_ _null_ json_to_tsvector _null_ _null_ _null_ ));
+DESCR("transform json to tsvector");
+DATA(insert OID = 4211 ( to_tsvector PGNSP PGUID 12 100 0 0 0 f f f f t f s s 2 0 3614 "3734 3802" _null_ _null_ _null_ _null_ _null_ jsonb_to_tsvector_byid _null_ _null_ _null_ ));
+DESCR("transform jsonb to tsvector");
+DATA(insert OID = 4212 ( to_tsvector PGNSP PGUID 12 100 0 0 0 f f f f t f s s 2 0 3614 "3734 114" _null_ _null_ _null_ _null_ _null_ json_to_tsvector_byid _null_ _null_ _null_ ));
+DESCR("transform json to tsvector");
DATA(insert OID = 3752 ( tsvector_update_trigger PGNSP PGUID 12 1 0 0 0 f f f f f f v s 0 0 2279 "" _null_ _null_ _null_ _null_ _null_ tsvector_update_trigger_byid _null_ _null_ _null_ ));
DESCR("trigger for automatic update of tsvector column");
@@ -4883,6 +5008,7 @@ DESCR("GIN support");
DATA(insert OID = 3301 ( jsonb_concat PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 3802 "3802 3802" _null_ _null_ _null_ _null_ _null_ jsonb_concat _null_ _null_ _null_ ));
DATA(insert OID = 3302 ( jsonb_delete PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 3802 "3802 25" _null_ _null_ _null_ _null_ _null_ jsonb_delete _null_ _null_ _null_ ));
DATA(insert OID = 3303 ( jsonb_delete PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 3802 "3802 23" _null_ _null_ _null_ _null_ _null_ jsonb_delete_idx _null_ _null_ _null_ ));
+DATA(insert OID = 3343 ( jsonb_delete PGNSP PGUID 12 1 0 25 0 f f f f t f i s 2 0 3802 "3802 1009" "{3802,1009}" "{i,v}" "{from_json,path_elems}" _null_ _null_ jsonb_delete_array _null_ _null_ _null_ ));
DATA(insert OID = 3304 ( jsonb_delete_path PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 3802 "3802 1009" _null_ _null_ _null_ _null_ _null_ jsonb_delete_path _null_ _null_ _null_ ));
DATA(insert OID = 3305 ( jsonb_set PGNSP PGUID 12 1 0 0 0 f f f f t f i s 4 0 3802 "3802 1009 3802 16" _null_ _null_ _null_ _null_ _null_ jsonb_set _null_ _null_ _null_ ));
DESCR("Set part of a jsonb");
@@ -4901,6 +5027,8 @@ DATA(insert OID = 2942 ( txid_snapshot_send PGNSP PGUID 12 1 0 0 0 f f f f t
DESCR("I/O");
DATA(insert OID = 2943 ( txid_current PGNSP PGUID 12 1 0 0 0 f f f f t f s u 0 0 20 "" _null_ _null_ _null_ _null_ _null_ txid_current _null_ _null_ _null_ ));
DESCR("get current transaction ID");
+DATA(insert OID = 3348 ( txid_current_if_assigned PGNSP PGUID 12 1 0 0 0 f f f f t f s u 0 0 20 "" _null_ _null_ _null_ _null_ _null_ txid_current_if_assigned _null_ _null_ _null_ ));
+DESCR("get current transaction ID");
DATA(insert OID = 2944 ( txid_current_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 2970 "" _null_ _null_ _null_ _null_ _null_ txid_current_snapshot _null_ _null_ _null_ ));
DESCR("get current snapshot");
DATA(insert OID = 2945 ( txid_snapshot_xmin PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 20 "2970" _null_ _null_ _null_ _null_ _null_ txid_snapshot_xmin _null_ _null_ _null_ ));
@@ -4911,6 +5039,8 @@ DATA(insert OID = 2947 ( txid_snapshot_xip PGNSP PGUID 12 1 50 0 0 f f f f t
DESCR("get set of in-progress txids in snapshot");
DATA(insert OID = 2948 ( txid_visible_in_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "20 2970" _null_ _null_ _null_ _null_ _null_ txid_visible_in_snapshot _null_ _null_ _null_ ));
DESCR("is txid visible in snapshot?");
+DATA(insert OID = 3360 ( txid_status PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 25 "20" _null_ _null_ _null_ _null_ _null_ txid_status _null_ _null_ _null_ ));
+DESCR("commit status of transaction");
/* record comparison using normal comparison rules */
DATA(insert OID = 2981 ( record_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ _null_ record_eq _null_ _null_ _null_ ));
@@ -5160,21 +5290,21 @@ DATA(insert OID = 5016 ( spg_box_quad_leaf_consistent PGNSP PGUID 12 1 0 0 0 f
DESCR("SP-GiST support for quad tree over box");
/* replication slots */
-DATA(insert OID = 3779 ( pg_create_physical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 2249 "19 16" "{19,16,19,3220}" "{i,i,o,o}" "{slot_name,immediately_reserve,slot_name,xlog_position}" _null_ _null_ pg_create_physical_replication_slot _null_ _null_ _null_ ));
+DATA(insert OID = 3779 ( pg_create_physical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2249 "19 16 16" "{19,16,16,19,3220}" "{i,i,i,o,o}" "{slot_name,immediately_reserve,temporary,slot_name,lsn}" _null_ _null_ pg_create_physical_replication_slot _null_ _null_ _null_ ));
DESCR("create a physical replication slot");
DATA(insert OID = 3780 ( pg_drop_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 2278 "19" _null_ _null_ _null_ _null_ _null_ pg_drop_replication_slot _null_ _null_ _null_ ));
DESCR("drop a replication slot");
-DATA(insert OID = 3781 ( pg_get_replication_slots PGNSP PGUID 12 1 10 0 0 f f f f f t s s 0 0 2249 "" "{19,19,25,26,16,23,28,28,3220,3220}" "{o,o,o,o,o,o,o,o,o,o}" "{slot_name,plugin,slot_type,datoid,active,active_pid,xmin,catalog_xmin,restart_lsn,confirmed_flush_lsn}" _null_ _null_ pg_get_replication_slots _null_ _null_ _null_ ));
+DATA(insert OID = 3781 ( pg_get_replication_slots PGNSP PGUID 12 1 10 0 0 f f f f f t s s 0 0 2249 "" "{19,19,25,26,16,16,23,28,28,3220,3220}" "{o,o,o,o,o,o,o,o,o,o,o}" "{slot_name,plugin,slot_type,datoid,temporary,active,active_pid,xmin,catalog_xmin,restart_lsn,confirmed_flush_lsn}" _null_ _null_ pg_get_replication_slots _null_ _null_ _null_ ));
DESCR("information about replication slots currently in use");
-DATA(insert OID = 3786 ( pg_create_logical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 2249 "19 19" "{19,19,25,3220}" "{i,i,o,o}" "{slot_name,plugin,slot_name,xlog_position}" _null_ _null_ pg_create_logical_replication_slot _null_ _null_ _null_ ));
+DATA(insert OID = 3786 ( pg_create_logical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2249 "19 19 16" "{19,19,16,25,3220}" "{i,i,i,o,o}" "{slot_name,plugin,temporary,slot_name,lsn}" _null_ _null_ pg_create_logical_replication_slot _null_ _null_ _null_ ));
DESCR("set up a logical replication slot");
-DATA(insert OID = 3782 ( pg_logical_slot_get_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_get_changes _null_ _null_ _null_ ));
+DATA(insert OID = 3782 ( pg_logical_slot_get_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_get_changes _null_ _null_ _null_ ));
DESCR("get changes from replication slot");
-DATA(insert OID = 3783 ( pg_logical_slot_get_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_get_binary_changes _null_ _null_ _null_ ));
+DATA(insert OID = 3783 ( pg_logical_slot_get_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_get_binary_changes _null_ _null_ _null_ ));
DESCR("get binary changes from replication slot");
-DATA(insert OID = 3784 ( pg_logical_slot_peek_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_peek_changes _null_ _null_ _null_ ));
+DATA(insert OID = 3784 ( pg_logical_slot_peek_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_peek_changes _null_ _null_ _null_ ));
DESCR("peek at changes from replication slot");
-DATA(insert OID = 3785 ( pg_logical_slot_peek_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_peek_binary_changes _null_ _null_ _null_ ));
+DATA(insert OID = 3785 ( pg_logical_slot_peek_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_peek_binary_changes _null_ _null_ _null_ ));
DESCR("peek at binary changes from replication slot");
DATA(insert OID = 3577 ( pg_logical_emit_message PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 3220 "16 25 25" _null_ _null_ _null_ _null_ _null_ pg_logical_emit_message_text _null_ _null_ _null_ ));
DESCR("emit a textual logical decoding message");
@@ -5182,13 +5312,13 @@ DATA(insert OID = 3578 ( pg_logical_emit_message PGNSP PGUID 12 1 0 0 0 f f f f
DESCR("emit a binary logical decoding message");
/* event triggers */
-DATA(insert OID = 3566 ( pg_event_trigger_dropped_objects PGNSP PGUID 12 10 100 0 0 f f f f t t s s 0 0 2249 "" "{26,26,23,16,16,16,25,25,25,25,1009,1009}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{classid, objid, objsubid, original, normal, is_temporary, object_type, schema_name, object_name, object_identity, address_names, address_args}" _null_ _null_ pg_event_trigger_dropped_objects _null_ _null_ _null_ ));
+DATA(insert OID = 3566 ( pg_event_trigger_dropped_objects PGNSP PGUID 12 10 100 0 0 f f f f t t s r 0 0 2249 "" "{26,26,23,16,16,16,25,25,25,25,1009,1009}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{classid, objid, objsubid, original, normal, is_temporary, object_type, schema_name, object_name, object_identity, address_names, address_args}" _null_ _null_ pg_event_trigger_dropped_objects _null_ _null_ _null_ ));
DESCR("list objects dropped by the current command");
-DATA(insert OID = 4566 ( pg_event_trigger_table_rewrite_oid PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 26 "" "{26}" "{o}" "{oid}" _null_ _null_ pg_event_trigger_table_rewrite_oid _null_ _null_ _null_ ));
+DATA(insert OID = 4566 ( pg_event_trigger_table_rewrite_oid PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 26 "" "{26}" "{o}" "{oid}" _null_ _null_ pg_event_trigger_table_rewrite_oid _null_ _null_ _null_ ));
DESCR("return Oid of the table getting rewritten");
-DATA(insert OID = 4567 ( pg_event_trigger_table_rewrite_reason PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 23 "" _null_ _null_ _null_ _null_ _null_ pg_event_trigger_table_rewrite_reason _null_ _null_ _null_ ));
+DATA(insert OID = 4567 ( pg_event_trigger_table_rewrite_reason PGNSP PGUID 12 1 0 0 0 f f f f t f s r 0 0 23 "" _null_ _null_ _null_ _null_ _null_ pg_event_trigger_table_rewrite_reason _null_ _null_ _null_ ));
DESCR("return reason code for table getting rewritten");
-DATA(insert OID = 4568 ( pg_event_trigger_ddl_commands PGNSP PGUID 12 10 100 0 0 f f f f t t s s 0 0 2249 "" "{26,26,23,25,25,25,25,16,32}" "{o,o,o,o,o,o,o,o,o}" "{classid, objid, objsubid, command_tag, object_type, schema_name, object_identity, in_extension, command}" _null_ _null_ pg_event_trigger_ddl_commands _null_ _null_ _null_ ));
+DATA(insert OID = 4568 ( pg_event_trigger_ddl_commands PGNSP PGUID 12 10 100 0 0 f f f f t t s r 0 0 2249 "" "{26,26,23,25,25,25,25,16,32}" "{o,o,o,o,o,o,o,o,o}" "{classid, objid, objsubid, command_tag, object_type, schema_name, object_identity, in_extension, command}" _null_ _null_ pg_event_trigger_ddl_commands _null_ _null_ _null_ ));
DESCR("list DDL actions being executed by the current command");
/* generic transition functions for ordered-set aggregates */
@@ -5311,7 +5441,7 @@ DATA(insert OID = 6011 ( pg_replication_origin_xact_reset PGNSP PGUID 12 1 0 0 0
DESCR("reset the transaction's origin lsn and timestamp");
DATA(insert OID = 6012 ( pg_replication_origin_advance PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 2278 "25 3220" _null_ _null_ _null_ _null_ _null_ pg_replication_origin_advance _null_ _null_ _null_ ));
-DESCR("advance replication itentifier to specific location");
+DESCR("advance replication identifier to specific location");
DATA(insert OID = 6013 ( pg_replication_origin_progress PGNSP PGUID 12 1 0 0 0 f f f f t f v u 2 0 3220 "25 16" _null_ _null_ _null_ _null_ _null_ pg_replication_origin_progress _null_ _null_ _null_ ));
DESCR("get an individual replication origin's replication progress");
@@ -5333,6 +5463,9 @@ DESCR("all current/future processes to honour overriden log levels");
DATA(insert OID = 6020 ( pg_msgmodule_disable_all PGNSP PGUID 12 1 1 0 0 f f f f t t i s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_msgmodule_disable_all _null_ _null_ _null_ ));
DESCR("all processes to ignore overriden log levels");
#endif
+/* publications */
+DATA(insert OID = 6119 ( pg_get_publication_tables PGNSP PGUID 12 1 1000 0 0 f f t f t t s s 1 0 26 "25" "{25,26}" "{i,o}" "{pubname,relid}" _null_ _null_ pg_get_publication_tables _null_ _null_ _null_ ));
+DESCR("get OIDs of tables in a publication");
/* rls */
DATA(insert OID = 3298 ( row_security_active PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ row_security_active _null_ _null_ _null_ ));
@@ -5348,15 +5481,27 @@ DESCR("pg_config binary as a function");
DATA(insert OID = 3441 ( pg_control_system PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,20,1184}" "{o,o,o,o}" "{pg_control_version,catalog_version_no,system_identifier,pg_control_last_modified}" _null_ _null_ pg_control_system _null_ _null_ _null_ ));
DESCR("pg_controldata general state information as a function");
-DATA(insert OID = 3442 ( pg_control_checkpoint PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,3220,3220,25,23,23,16,25,26,28,28,28,26,28,28,26,28,28,1184}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{checkpoint_location,prior_location,redo_location,redo_wal_file,timeline_id,prev_timeline_id,full_page_writes,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,checkpoint_time}" _null_ _null_ pg_control_checkpoint _null_ _null_ _null_ ));
+DATA(insert OID = 3442 ( pg_control_checkpoint PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,3220,3220,25,23,23,16,25,26,28,28,28,26,28,28,26,28,28,1184}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{checkpoint_lsn,prior_lsn,redo_lsn,redo_wal_file,timeline_id,prev_timeline_id,full_page_writes,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,checkpoint_time}" _null_ _null_ pg_control_checkpoint _null_ _null_ _null_ ));
DESCR("pg_controldata checkpoint state information as a function");
-DATA(insert OID = 3443 ( pg_control_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,23,3220,3220,16}" "{o,o,o,o,o}" "{min_recovery_end_location,min_recovery_end_timeline,backup_start_location,backup_end_location,end_of_backup_record_required}" _null_ _null_ pg_control_recovery _null_ _null_ _null_ ));
+DATA(insert OID = 3443 ( pg_control_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,23,3220,3220,16}" "{o,o,o,o,o}" "{min_recovery_end_lsn,min_recovery_end_timeline,backup_start_lsn,backup_end_lsn,end_of_backup_record_required}" _null_ _null_ pg_control_recovery _null_ _null_ _null_ ));
DESCR("pg_controldata recovery state information as a function");
-DATA(insert OID = 3444 ( pg_control_init PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,23,23,23,23,23,23,23,16,16,16,23}" "{o,o,o,o,o,o,o,o,o,o,o,o,o}" "{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,bigint_timestamps,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}" _null_ _null_ pg_control_init _null_ _null_ _null_ ));
+DATA(insert OID = 3444 ( pg_control_init PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,23,23,23,23,23,23,23,16,16,23}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}" _null_ _null_ pg_control_init _null_ _null_ _null_ ));
DESCR("pg_controldata init state information as a function");
+DATA(insert OID = 3445 ( pg_import_system_collations PGNSP PGUID 12 100 0 0 0 f f f f t f v r 2 0 2278 "16 4089" _null_ _null_ "{if_not_exists,schema}" _null_ _null_ pg_import_system_collations _null_ _null_ _null_ ));
+DESCR("import collations from operating system");
+
+DATA(insert OID = 3448 ( pg_collation_actual_version PGNSP PGUID 12 100 0 0 0 f f f f t f v s 1 0 25 "26" _null_ _null_ _null_ _null_ _null_ pg_collation_actual_version _null_ _null_ _null_ ));
+DESCR("import collations from operating system");
+
+/* system management/monitoring related functions */
+DATA(insert OID = 3353 ( pg_ls_logdir PGNSP PGUID 12 10 20 0 0 f f f f t t v s 0 0 2249 "" "{25,20,1184}" "{o,o,o}" "{name,size,modification}" _null_ _null_ pg_ls_logdir _null_ _null_ _null_ ));
+DESCR("list files in the log directory");
+DATA(insert OID = 3354 ( pg_ls_waldir PGNSP PGUID 12 10 20 0 0 f f f f t t v s 0 0 2249 "" "{25,20,1184}" "{o,o,o}" "{name,size,modification}" _null_ _null_ pg_ls_waldir _null_ _null_ _null_ ));
+DESCR("list of files in the WAL directory");
+
/*
* Symbolic values for provolatile column: these indicate whether the result
* of a function is dependent *only* on the values of its explicit arguments,
diff --git a/src/include/catalog/pg_proc_fn.h b/src/include/catalog/pg_proc_fn.h
index 8d666d8e79..993278a91a 100644
--- a/src/include/catalog/pg_proc_fn.h
+++ b/src/include/catalog/pg_proc_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_proc.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_proc_fn.h
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
new file mode 100644
index 0000000000..c2086c1f42
--- /dev/null
+++ b/src/include/catalog/pg_publication.h
@@ -0,0 +1,104 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_publication.h
+ * definition of the relation sets relation (pg_publication)
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/catalog/pg_publication.h
+ *
+ * NOTES
+ * the genbki.pl script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_PUBLICATION_H
+#define PG_PUBLICATION_H
+
+#include "catalog/genbki.h"
+#include "catalog/objectaddress.h"
+
+/* ----------------
+ * pg_publication definition. cpp turns this into
+ * typedef struct FormData_pg_publication
+ *
+ * ----------------
+ */
+#define PublicationRelationId 6104
+
+CATALOG(pg_publication,6104)
+{
+ NameData pubname; /* name of the publication */
+
+ Oid pubowner; /* publication owner */
+
+ /*
+ * indicates that this is special publication which should encompass all
+ * tables in the database (except for the unlogged and temp ones)
+ */
+ bool puballtables;
+
+ /* true if inserts are published */
+ bool pubinsert;
+
+ /* true if updates are published */
+ bool pubupdate;
+
+ /* true if deletes are published */
+ bool pubdelete;
+
+} FormData_pg_publication;
+
+/* ----------------
+ * Form_pg_publication corresponds to a pointer to a tuple with
+ * the format of pg_publication relation.
+ * ----------------
+ */
+typedef FormData_pg_publication *Form_pg_publication;
+
+/* ----------------
+ * compiler constants for pg_publication
+ * ----------------
+ */
+
+#define Natts_pg_publication 6
+#define Anum_pg_publication_pubname 1
+#define Anum_pg_publication_pubowner 2
+#define Anum_pg_publication_puballtables 3
+#define Anum_pg_publication_pubinsert 4
+#define Anum_pg_publication_pubupdate 5
+#define Anum_pg_publication_pubdelete 6
+
+typedef struct PublicationActions
+{
+ bool pubinsert;
+ bool pubupdate;
+ bool pubdelete;
+} PublicationActions;
+
+typedef struct Publication
+{
+ Oid oid;
+ char *name;
+ bool alltables;
+ PublicationActions pubactions;
+} Publication;
+
+extern Publication *GetPublication(Oid pubid);
+extern Publication *GetPublicationByName(const char *pubname, bool missing_ok);
+extern List *GetRelationPublications(Oid relid);
+extern List *GetPublicationRelations(Oid pubid);
+extern List *GetAllTablesPublications(void);
+extern List *GetAllTablesPublicationRelations(void);
+
+extern ObjectAddress publication_add_relation(Oid pubid, Relation targetrel,
+ bool if_not_exists);
+
+extern Oid get_publication_oid(const char *pubname, bool missing_ok);
+extern char *get_publication_name(Oid pubid);
+
+extern Datum pg_get_publication_tables(PG_FUNCTION_ARGS);
+
+#endif /* PG_PUBLICATION_H */
diff --git a/src/include/catalog/pg_publication_rel.h b/src/include/catalog/pg_publication_rel.h
new file mode 100644
index 0000000000..f889b6f4db
--- /dev/null
+++ b/src/include/catalog/pg_publication_rel.h
@@ -0,0 +1,52 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_publication_rel.h
+ * definition of the publication to relation map (pg_publication_rel)
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/catalog/pg_publication_rel.h
+ *
+ * NOTES
+ * the genbki.pl script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_PUBLICATION_REL_H
+#define PG_PUBLICATION_REL_H
+
+#include "catalog/genbki.h"
+
+/* ----------------
+ * pg_publication_rel definition. cpp turns this into
+ * typedef struct FormData_pg_publication_rel
+ *
+ * ----------------
+ */
+#define PublicationRelRelationId 6106
+
+CATALOG(pg_publication_rel,6106)
+{
+ Oid prpubid; /* Oid of the publication */
+ Oid prrelid; /* Oid of the relation */
+} FormData_pg_publication_rel;
+
+/* ----------------
+ * Form_pg_publication_rel corresponds to a pointer to a tuple with
+ * the format of pg_publication_rel relation.
+ * ----------------
+ */
+typedef FormData_pg_publication_rel *Form_pg_publication_rel;
+
+/* ----------------
+ * compiler constants for pg_publication_rel
+ * ----------------
+ */
+
+#define Natts_pg_publication_rel 2
+#define Anum_pg_publication_rel_prpubid 1
+#define Anum_pg_publication_rel_prrelid 2
+
+#endif /* PG_PUBLICATION_REL_H */
diff --git a/src/include/catalog/pg_range.h b/src/include/catalog/pg_range.h
index 14d3b12315..4ed57fe2e9 100644
--- a/src/include/catalog/pg_range.h
+++ b/src/include/catalog/pg_range.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_range.h
diff --git a/src/include/catalog/pg_replication_origin.h b/src/include/catalog/pg_replication_origin.h
index 5f0538edb2..c22831f517 100644
--- a/src/include/catalog/pg_replication_origin.h
+++ b/src/include/catalog/pg_replication_origin.h
@@ -3,7 +3,7 @@
* pg_replication_origin.h
* Persistent replication origin registry
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_replication_origin.h
diff --git a/src/include/catalog/pg_rewrite.h b/src/include/catalog/pg_rewrite.h
index c6c87f6adb..425a336755 100644
--- a/src/include/catalog/pg_rewrite.h
+++ b/src/include/catalog/pg_rewrite.h
@@ -8,7 +8,7 @@
* --- ie, rule names are only unique among the rules of a given table.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_rewrite.h
diff --git a/src/include/catalog/pg_seclabel.h b/src/include/catalog/pg_seclabel.h
index 11cda559b3..01e14e77c0 100644
--- a/src/include/catalog/pg_seclabel.h
+++ b/src/include/catalog/pg_seclabel.h
@@ -3,7 +3,7 @@
* pg_seclabel.h
* definition of the system "security label" relation (pg_seclabel)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* -------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_sequence.h b/src/include/catalog/pg_sequence.h
new file mode 100644
index 0000000000..26d2993674
--- /dev/null
+++ b/src/include/catalog/pg_sequence.h
@@ -0,0 +1,32 @@
+#ifndef PG_SEQUENCE_H
+#define PG_SEQUENCE_H
+
+#include "catalog/genbki.h"
+
+#define SequenceRelationId 2224
+
+CATALOG(pg_sequence,2224) BKI_WITHOUT_OIDS
+{
+ Oid seqrelid;
+ Oid seqtypid;
+ int64 seqstart;
+ int64 seqincrement;
+ int64 seqmax;
+ int64 seqmin;
+ int64 seqcache;
+ bool seqcycle;
+} FormData_pg_sequence;
+
+typedef FormData_pg_sequence *Form_pg_sequence;
+
+#define Natts_pg_sequence 8
+#define Anum_pg_sequence_seqrelid 1
+#define Anum_pg_sequence_seqtypid 2
+#define Anum_pg_sequence_seqstart 3
+#define Anum_pg_sequence_seqincrement 4
+#define Anum_pg_sequence_seqmax 5
+#define Anum_pg_sequence_seqmin 6
+#define Anum_pg_sequence_seqcache 7
+#define Anum_pg_sequence_seqcycle 8
+
+#endif /* PG_SEQUENCE_H */
diff --git a/src/include/catalog/pg_shdepend.h b/src/include/catalog/pg_shdepend.h
index 92c492b296..ae1aa4f952 100644
--- a/src/include/catalog/pg_shdepend.h
+++ b/src/include/catalog/pg_shdepend.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_shdepend.h
diff --git a/src/include/catalog/pg_shdescription.h b/src/include/catalog/pg_shdescription.h
index bf79d4a908..21086447fa 100644
--- a/src/include/catalog/pg_shdescription.h
+++ b/src/include/catalog/pg_shdescription.h
@@ -12,7 +12,7 @@
* across tables.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_shdescription.h
diff --git a/src/include/catalog/pg_shseclabel.h b/src/include/catalog/pg_shseclabel.h
index c39e11df34..a88f65c169 100644
--- a/src/include/catalog/pg_shseclabel.h
+++ b/src/include/catalog/pg_shseclabel.h
@@ -3,7 +3,7 @@
* pg_shseclabel.h
* definition of the system "security label" relation (pg_shseclabel)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* -------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_statistic.h b/src/include/catalog/pg_statistic.h
index c1a624d979..3576419a2f 100644
--- a/src/include/catalog/pg_statistic.h
+++ b/src/include/catalog/pg_statistic.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_statistic.h
@@ -275,7 +275,7 @@ typedef FormData_pg_statistic *Form_pg_statistic;
* fraction of empty ranges. stavalues is a histogram of non-empty lengths, in
* a format similar to STATISTIC_KIND_HISTOGRAM: it contains M (>=2) range
* values that divide the column data values into M-1 bins of approximately
- * equal population. The lengths are stores as float8s, as measured by the
+ * equal population. The lengths are stored as float8s, as measured by the
* range type's subdiff function. Only non-null rows are considered.
*/
#define STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM 6
diff --git a/src/include/catalog/pg_statistic_ext.h b/src/include/catalog/pg_statistic_ext.h
new file mode 100644
index 0000000000..d302b7fc01
--- /dev/null
+++ b/src/include/catalog/pg_statistic_ext.h
@@ -0,0 +1,80 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_statistic_ext.h
+ * definition of the system "extended statistic" relation (pg_statistic_ext)
+ * along with the relation's initial contents.
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/catalog/pg_statistic_ext.h
+ *
+ * NOTES
+ * the genbki.pl script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_STATISTIC_EXT_H
+#define PG_STATISTIC_EXT_H
+
+#include "catalog/genbki.h"
+
+/* ----------------
+ * pg_statistic_ext definition. cpp turns this into
+ * typedef struct FormData_pg_statistic_ext
+ * ----------------
+ */
+#define StatisticExtRelationId 3381
+
+CATALOG(pg_statistic_ext,3381)
+{
+ Oid stxrelid; /* relation containing attributes */
+
+ /* These two fields form the unique key for the entry: */
+ NameData stxname; /* statistics object name */
+ Oid stxnamespace; /* OID of statistics object's namespace */
+
+ Oid stxowner; /* statistics object's owner */
+
+ /*
+ * variable-length fields start here, but we allow direct access to
+ * stxkeys
+ */
+ int2vector stxkeys; /* array of column keys */
+
+#ifdef CATALOG_VARLEN
+ char stxkind[1] BKI_FORCE_NOT_NULL; /* statistic types requested
+ * to build */
+ pg_ndistinct stxndistinct; /* ndistinct coefficients (serialized) */
+ pg_dependencies stxdependencies; /* dependencies (serialized) */
+#endif
+
+} FormData_pg_statistic_ext;
+
+/* ----------------
+ * Form_pg_statistic_ext corresponds to a pointer to a tuple with
+ * the format of pg_statistic_ext relation.
+ * ----------------
+ */
+typedef FormData_pg_statistic_ext *Form_pg_statistic_ext;
+
+/* ----------------
+ * compiler constants for pg_statistic_ext
+ * ----------------
+ */
+#define Natts_pg_statistic_ext 8
+#define Anum_pg_statistic_ext_stxrelid 1
+#define Anum_pg_statistic_ext_stxname 2
+#define Anum_pg_statistic_ext_stxnamespace 3
+#define Anum_pg_statistic_ext_stxowner 4
+#define Anum_pg_statistic_ext_stxkeys 5
+#define Anum_pg_statistic_ext_stxkind 6
+#define Anum_pg_statistic_ext_stxndistinct 7
+#define Anum_pg_statistic_ext_stxdependencies 8
+
+#define STATS_EXT_NDISTINCT 'd'
+#define STATS_EXT_DEPENDENCIES 'f'
+
+#endif /* PG_STATISTIC_EXT_H */
diff --git a/src/include/catalog/pg_subscription.h b/src/include/catalog/pg_subscription.h
new file mode 100644
index 0000000000..b2cebd4a4b
--- /dev/null
+++ b/src/include/catalog/pg_subscription.h
@@ -0,0 +1,96 @@
+/* -------------------------------------------------------------------------
+ *
+ * pg_subscription.h
+ * Definition of the subscription catalog (pg_subscription).
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * -------------------------------------------------------------------------
+ */
+#ifndef PG_SUBSCRIPTION_H
+#define PG_SUBSCRIPTION_H
+
+#include "catalog/genbki.h"
+#include "nodes/pg_list.h"
+
+/* ----------------
+ * pg_subscription definition. cpp turns this into
+ * typedef struct FormData_pg_subscription
+ * ----------------
+ */
+#define SubscriptionRelationId 6100
+#define SubscriptionRelation_Rowtype_Id 6101
+
+/*
+ * Technically, the subscriptions live inside the database, so a shared catalog
+ * seems weird, but the replication launcher process needs to access all of
+ * them to be able to start the workers, so we have to put them in a shared,
+ * nailed catalog.
+ *
+ * NOTE: When adding a column, also update system_views.sql.
+ */
+CATALOG(pg_subscription,6100) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6101) BKI_SCHEMA_MACRO
+{
+ Oid subdbid; /* Database the subscription is in. */
+ NameData subname; /* Name of the subscription */
+
+ Oid subowner; /* Owner of the subscription */
+
+ bool subenabled; /* True if the subscription is enabled (the
+ * worker should be running) */
+
+#ifdef CATALOG_VARLEN /* variable-length fields start here */
+ /* Connection string to the publisher */
+ text subconninfo BKI_FORCE_NOT_NULL;
+
+ /* Slot name on publisher */
+ NameData subslotname;
+
+ /* Synchronous commit setting for worker */
+ text subsynccommit BKI_FORCE_NOT_NULL;
+
+ /* List of publications subscribed to */
+ text subpublications[1] BKI_FORCE_NOT_NULL;
+#endif
+} FormData_pg_subscription;
+
+typedef FormData_pg_subscription *Form_pg_subscription;
+
+/* ----------------
+ * compiler constants for pg_subscription
+ * ----------------
+ */
+#define Natts_pg_subscription 8
+#define Anum_pg_subscription_subdbid 1
+#define Anum_pg_subscription_subname 2
+#define Anum_pg_subscription_subowner 3
+#define Anum_pg_subscription_subenabled 4
+#define Anum_pg_subscription_subconninfo 5
+#define Anum_pg_subscription_subslotname 6
+#define Anum_pg_subscription_subsynccommit 7
+#define Anum_pg_subscription_subpublications 8
+
+
+typedef struct Subscription
+{
+ Oid oid; /* Oid of the subscription */
+ Oid dbid; /* Oid of the database which subscription is
+ * in */
+ char *name; /* Name of the subscription */
+ Oid owner; /* Oid of the subscription owner */
+ bool enabled; /* Indicates if the subscription is enabled */
+ char *conninfo; /* Connection string to the publisher */
+ char *slotname; /* Name of the replication slot */
+ char *synccommit; /* Synchronous commit setting for worker */
+ List *publications; /* List of publication names to subscribe to */
+} Subscription;
+
+extern Subscription *GetSubscription(Oid subid, bool missing_ok);
+extern void FreeSubscription(Subscription *sub);
+extern Oid get_subscription_oid(const char *subname, bool missing_ok);
+extern char *get_subscription_name(Oid subid);
+
+extern int CountDBSubscriptions(Oid dbid);
+
+#endif /* PG_SUBSCRIPTION_H */
diff --git a/src/include/catalog/pg_subscription_rel.h b/src/include/catalog/pg_subscription_rel.h
new file mode 100644
index 0000000000..391f96b76e
--- /dev/null
+++ b/src/include/catalog/pg_subscription_rel.h
@@ -0,0 +1,82 @@
+/* -------------------------------------------------------------------------
+ *
+ * pg_subscription_rel.h
+ * Local info about tables that come from the publisher of a
+ * subscription (pg_subscription_rel).
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * -------------------------------------------------------------------------
+ */
+#ifndef PG_SUBSCRIPTION_REL_H
+#define PG_SUBSCRIPTION_REL_H
+
+#include "access/xlogdefs.h"
+#include "catalog/genbki.h"
+#include "nodes/pg_list.h"
+
+/* ----------------
+ * pg_subscription_rel definition. cpp turns this into
+ * typedef struct FormData_pg_subscription_rel
+ * ----------------
+ */
+#define SubscriptionRelRelationId 6102
+
+/* Workaround for genbki not knowing about XLogRecPtr */
+#define pg_lsn XLogRecPtr
+
+CATALOG(pg_subscription_rel,6102) BKI_WITHOUT_OIDS
+{
+ Oid srsubid; /* Oid of subscription */
+ Oid srrelid; /* Oid of relation */
+ char srsubstate; /* state of the relation in subscription */
+ pg_lsn srsublsn; /* remote lsn of the state change used for
+ * synchronization coordination */
+} FormData_pg_subscription_rel;
+
+typedef FormData_pg_subscription_rel *Form_pg_subscription_rel;
+
+/* ----------------
+ * compiler constants for pg_subscription_rel
+ * ----------------
+ */
+#define Natts_pg_subscription_rel 4
+#define Anum_pg_subscription_rel_srsubid 1
+#define Anum_pg_subscription_rel_srrelid 2
+#define Anum_pg_subscription_rel_srsubstate 3
+#define Anum_pg_subscription_rel_srsublsn 4
+
+/* ----------------
+ * substate constants
+ * ----------------
+ */
+#define SUBREL_STATE_INIT 'i' /* initializing (sublsn NULL) */
+#define SUBREL_STATE_DATASYNC 'd' /* data is being synchronized (sublsn
+ * NULL) */
+#define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front
+ * of apply (sublsn set) */
+#define SUBREL_STATE_READY 'r' /* ready (sublsn set) */
+
+/* These are never stored in the catalog, we only use them for IPC. */
+#define SUBREL_STATE_UNKNOWN '\0' /* unknown state */
+#define SUBREL_STATE_SYNCWAIT 'w' /* waiting for sync */
+#define SUBREL_STATE_CATCHUP 'c' /* catching up with apply */
+
+typedef struct SubscriptionRelState
+{
+ Oid relid;
+ XLogRecPtr lsn;
+ char state;
+} SubscriptionRelState;
+
+extern Oid SetSubscriptionRelState(Oid subid, Oid relid, char state,
+ XLogRecPtr sublsn);
+extern char GetSubscriptionRelState(Oid subid, Oid relid,
+ XLogRecPtr *sublsn, bool missing_ok);
+extern void RemoveSubscriptionRel(Oid subid, Oid relid);
+
+extern List *GetSubscriptionRelations(Oid subid);
+extern List *GetSubscriptionNotReadyRelations(Oid subid);
+
+#endif /* PG_SUBSCRIPTION_REL_H */
diff --git a/src/include/catalog/pg_tablespace.h b/src/include/catalog/pg_tablespace.h
index 61b8020b8e..d9ea4b7d63 100644
--- a/src/include/catalog/pg_tablespace.h
+++ b/src/include/catalog/pg_tablespace.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_tablespace.h
diff --git a/src/include/catalog/pg_transform.h b/src/include/catalog/pg_transform.h
index e55c3e1bc2..3415db3bd6 100644
--- a/src/include/catalog/pg_transform.h
+++ b/src/include/catalog/pg_transform.h
@@ -2,7 +2,7 @@
*
* pg_transform.h
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
* src/include/catalog/pg_transform.h
*
diff --git a/src/include/catalog/pg_trigger.h b/src/include/catalog/pg_trigger.h
index eb39c50e63..547332fe65 100644
--- a/src/include/catalog/pg_trigger.h
+++ b/src/include/catalog/pg_trigger.h
@@ -5,7 +5,7 @@
* along with the relation's initial contents.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_trigger.h
@@ -59,6 +59,8 @@ CATALOG(pg_trigger,2620)
#ifdef CATALOG_VARLEN
bytea tgargs BKI_FORCE_NOT_NULL; /* first\000second\000tgnargs\000 */
pg_node_tree tgqual; /* WHEN expression, or NULL if none */
+ NameData tgoldtable; /* old transition table, or NULL if none */
+ NameData tgnewtable; /* new transition table, or NULL if none */
#endif
} FormData_pg_trigger;
@@ -73,7 +75,7 @@ typedef FormData_pg_trigger *Form_pg_trigger;
* compiler constants for pg_trigger
* ----------------
*/
-#define Natts_pg_trigger 15
+#define Natts_pg_trigger 17
#define Anum_pg_trigger_tgrelid 1
#define Anum_pg_trigger_tgname 2
#define Anum_pg_trigger_tgfoid 3
@@ -89,6 +91,8 @@ typedef FormData_pg_trigger *Form_pg_trigger;
#define Anum_pg_trigger_tgattr 13
#define Anum_pg_trigger_tgargs 14
#define Anum_pg_trigger_tgqual 15
+#define Anum_pg_trigger_tgoldtable 16
+#define Anum_pg_trigger_tgnewtable 17
/* Bits within tgtype */
#define TRIGGER_TYPE_ROW (1 << 0)
@@ -142,4 +146,11 @@ typedef FormData_pg_trigger *Form_pg_trigger;
#define TRIGGER_TYPE_MATCHES(type, level, timing, event) \
(((type) & (TRIGGER_TYPE_LEVEL_MASK | TRIGGER_TYPE_TIMING_MASK | (event))) == ((level) | (timing) | (event)))
+/*
+ * Macro to determine whether tgnewtable or tgoldtable has been specified for
+ * a trigger.
+ */
+#define TRIGGER_USES_TRANSITION_TABLE(namepointer) \
+ ((namepointer) != (char *) NULL)
+
#endif /* PG_TRIGGER_H */
diff --git a/src/include/catalog/pg_ts_config.h b/src/include/catalog/pg_ts_config.h
index ad450c34de..b61cf857d9 100644
--- a/src/include/catalog/pg_ts_config.h
+++ b/src/include/catalog/pg_ts_config.h
@@ -4,7 +4,7 @@
* definition of configuration of tsearch
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_ts_config.h
diff --git a/src/include/catalog/pg_ts_config_map.h b/src/include/catalog/pg_ts_config_map.h
index c1753a346e..fc9467fd9c 100644
--- a/src/include/catalog/pg_ts_config_map.h
+++ b/src/include/catalog/pg_ts_config_map.h
@@ -4,7 +4,7 @@
* definition of token mappings for configurations of tsearch
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_ts_config_map.h
diff --git a/src/include/catalog/pg_ts_dict.h b/src/include/catalog/pg_ts_dict.h
index e3c00f9175..28b7bb7c0d 100644
--- a/src/include/catalog/pg_ts_dict.h
+++ b/src/include/catalog/pg_ts_dict.h
@@ -4,7 +4,7 @@
* definition of dictionaries for tsearch
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_ts_dict.h
diff --git a/src/include/catalog/pg_ts_parser.h b/src/include/catalog/pg_ts_parser.h
index 016ef14d12..cfb87b4d56 100644
--- a/src/include/catalog/pg_ts_parser.h
+++ b/src/include/catalog/pg_ts_parser.h
@@ -4,7 +4,7 @@
* definition of parsers for tsearch
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_ts_parser.h
diff --git a/src/include/catalog/pg_ts_template.h b/src/include/catalog/pg_ts_template.h
index 39191a2a82..5fc6eea243 100644
--- a/src/include/catalog/pg_ts_template.h
+++ b/src/include/catalog/pg_ts_template.h
@@ -4,7 +4,7 @@
* definition of dictionary templates for tsearch
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_ts_template.h
diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h
index 439a22605e..8dfbc8a15f 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -6,7 +6,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_type.h
@@ -365,6 +365,14 @@ DATA(insert OID = 194 ( pg_node_tree PGNSP PGUID -1 f b S f t \054 0 0 0 pg_node
DESCR("string representing an internal node tree");
#define PGNODETREEOID 194
+DATA(insert OID = 3361 ( pg_ndistinct PGNSP PGUID -1 f b S f t \054 0 0 0 pg_ndistinct_in pg_ndistinct_out pg_ndistinct_recv pg_ndistinct_send - - - i x f 0 -1 0 100 _null_ _null_ _null_ ));
+DESCR("multivariate ndistinct coefficients");
+#define PGNDISTINCTOID 3361
+
+DATA(insert OID = 3402 ( pg_dependencies PGNSP PGUID -1 f b S f t \054 0 0 0 pg_dependencies_in pg_dependencies_out pg_dependencies_recv pg_dependencies_send - - - i x f 0 -1 0 100 _null_ _null_ _null_ ));
+DESCR("multivariate dependencies");
+#define PGDEPENDENCIESOID 3402
+
DATA(insert OID = 32 ( pg_ddl_command PGNSP PGUID SIZEOF_POINTER t p P f t \054 0 0 0 pg_ddl_command_in pg_ddl_command_out pg_ddl_command_recv pg_ddl_command_send - - - ALIGNOF_POINTER p f 0 -1 0 0 _null_ _null_ _null_ ));
DESCR("internal type for passing CollectedCommand");
#define PGDDLCOMMANDOID 32
@@ -419,7 +427,7 @@ DESCR("relative, limited-range time interval (Unix delta time)");
DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b T f t \054 0 0 1025 tintervalin tintervalout tintervalrecv tintervalsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ ));
DESCR("(abstime,abstime), time interval");
#define TINTERVALOID 704
-DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f b X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ ));
+DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f p X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ ));
DESCR("");
#define UNKNOWNOID 705
@@ -442,6 +450,9 @@ DESCR("IP address/netmask, host address, netmask optional");
DATA(insert OID = 650 ( cidr PGNSP PGUID -1 f b I f t \054 0 0 651 cidr_in cidr_out cidr_recv cidr_send - - - i m f 0 -1 0 0 _null_ _null_ _null_ ));
DESCR("network IP address/netmask, network address");
#define CIDROID 650
+DATA(insert OID = 774 ( macaddr8 PGNSP PGUID 8 f b U f t \054 0 0 775 macaddr8_in macaddr8_out macaddr8_recv macaddr8_send - - - i p f 0 -1 0 0 _null_ _null_ _null_ ));
+DESCR("XX:XX:XX:XX:XX:XX:XX:XX, MAC address");
+#define MACADDR8OID 774
/* OIDS 900 - 999 */
@@ -483,6 +494,7 @@ DESCR("access control list");
#define ACLITEMOID 1033
DATA(insert OID = 1034 ( _aclitem PGNSP PGUID -1 f b A f t \054 0 1033 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
DATA(insert OID = 1040 ( _macaddr PGNSP PGUID -1 f b A f t \054 0 829 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
+DATA(insert OID = 775 ( _macaddr8 PGNSP PGUID -1 f b A f t \054 0 774 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
DATA(insert OID = 1041 ( _inet PGNSP PGUID -1 f b A f t \054 0 869 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
DATA(insert OID = 651 ( _cidr PGNSP PGUID -1 f b A f t \054 0 650 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
DATA(insert OID = 1263 ( _cstring PGNSP PGUID -1 f b A f t \054 0 2275 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
diff --git a/src/include/catalog/pg_type_fn.h b/src/include/catalog/pg_type_fn.h
index d7bbfdb012..01f095612d 100644
--- a/src/include/catalog/pg_type_fn.h
+++ b/src/include/catalog/pg_type_fn.h
@@ -4,7 +4,7 @@
* prototypes for functions in catalog/pg_type.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_type_fn.h
diff --git a/src/include/catalog/pg_user_mapping.h b/src/include/catalog/pg_user_mapping.h
index a8bb9d9005..1ebf4611df 100644
--- a/src/include/catalog/pg_user_mapping.h
+++ b/src/include/catalog/pg_user_mapping.h
@@ -3,7 +3,7 @@
* pg_user_mapping.h
* definition of the system "user mapping" relation (pg_user_mapping)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_user_mapping.h
diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h
index ef960da921..fea96deba3 100644
--- a/src/include/catalog/storage.h
+++ b/src/include/catalog/storage.h
@@ -4,7 +4,7 @@
* prototypes for functions in backend/catalog/storage.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/storage.h
diff --git a/src/include/catalog/storage_xlog.h b/src/include/catalog/storage_xlog.h
index 500e663b5f..fcdd0233b1 100644
--- a/src/include/catalog/storage_xlog.h
+++ b/src/include/catalog/storage_xlog.h
@@ -4,7 +4,7 @@
* prototypes for XLog support for backend/catalog/storage.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/storage_xlog.h
diff --git a/src/include/catalog/toasting.h b/src/include/catalog/toasting.h
index b7a38ced3d..00d0a8326f 100644
--- a/src/include/catalog/toasting.h
+++ b/src/include/catalog/toasting.h
@@ -4,7 +4,7 @@
* This file provides some definitions to support creation of toast tables
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/toasting.h
@@ -53,6 +53,7 @@ DECLARE_TOAST(pg_proc, 2836, 2837);
DECLARE_TOAST(pg_rewrite, 2838, 2839);
DECLARE_TOAST(pg_seclabel, 3598, 3599);
DECLARE_TOAST(pg_statistic, 2840, 2841);
+DECLARE_TOAST(pg_statistic_ext, 3439, 3440);
DECLARE_TOAST(pg_trigger, 2336, 2337);
/* shared catalogs */
diff --git a/src/include/commands/alter.h b/src/include/commands/alter.h
index e116bc73b7..b7aa86cb57 100644
--- a/src/include/commands/alter.h
+++ b/src/include/commands/alter.h
@@ -4,7 +4,7 @@
* prototypes for commands/alter.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/alter.h
diff --git a/src/include/commands/async.h b/src/include/commands/async.h
index 93cb92aea6..b7842d1a0f 100644
--- a/src/include/commands/async.h
+++ b/src/include/commands/async.h
@@ -3,7 +3,7 @@
* async.h
* Asynchronous notification: NOTIFY, LISTEN, UNLISTEN
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/async.h
@@ -38,11 +38,6 @@ extern void Async_Listen(const char *channel);
extern void Async_Unlisten(const char *channel);
extern void Async_UnlistenAll(void);
-/* notify-related SQL functions */
-extern Datum pg_listening_channels(PG_FUNCTION_ARGS);
-extern Datum pg_notify(PG_FUNCTION_ARGS);
-extern Datum pg_notification_queue_usage(PG_FUNCTION_ARGS);
-
/* perform (or cancel) outbound notify processing at transaction commit */
extern void PreCommit_Notify(void);
extern void AtCommit_Notify(void);
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h
index e9222fe999..7c9d4746d9 100644
--- a/src/include/commands/cluster.h
+++ b/src/include/commands/cluster.h
@@ -3,7 +3,7 @@
* cluster.h
* header file for postgres cluster command stuff
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* src/include/commands/cluster.h
diff --git a/src/include/commands/collationcmds.h b/src/include/commands/collationcmds.h
index d1e5e0ad84..df5623ccb6 100644
--- a/src/include/commands/collationcmds.h
+++ b/src/include/commands/collationcmds.h
@@ -4,7 +4,7 @@
* prototypes for collationcmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/collationcmds.h
@@ -18,7 +18,8 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern ObjectAddress DefineCollation(List *names, List *parameters);
+extern ObjectAddress DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_exists);
extern void IsThereCollationInNamespace(const char *collname, Oid nspOid);
+extern ObjectAddress AlterCollation(AlterCollationStmt *stmt);
#endif /* COLLATIONCMDS_H */
diff --git a/src/include/commands/comment.h b/src/include/commands/comment.h
index 0790d9ff79..684ea8b697 100644
--- a/src/include/commands/comment.h
+++ b/src/include/commands/comment.h
@@ -7,7 +7,7 @@
*
* Prototypes for functions in commands/comment.c
*
- * Copyright (c) 1999-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1999-2017, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
diff --git a/src/include/commands/conversioncmds.h b/src/include/commands/conversioncmds.h
index e1498ad888..20d7f0e9b1 100644
--- a/src/include/commands/conversioncmds.h
+++ b/src/include/commands/conversioncmds.h
@@ -4,7 +4,7 @@
* prototypes for conversioncmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/conversioncmds.h
diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h
index 314d1f7e27..f081f2219f 100644
--- a/src/include/commands/copy.h
+++ b/src/include/commands/copy.h
@@ -4,7 +4,7 @@
* Definitions for using the POSTGRES copy command.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/copy.h
@@ -16,17 +16,20 @@
#include "nodes/execnodes.h"
#include "nodes/parsenodes.h"
+#include "parser/parse_node.h"
#include "tcop/dest.h"
/* CopyStateData is private in commands/copy.c */
typedef struct CopyStateData *CopyState;
+typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread);
-extern Oid DoCopy(const CopyStmt *stmt, const char *queryString,
+extern void DoCopy(ParseState *state, const CopyStmt *stmt,
+ int stmt_location, int stmt_len,
uint64 *processed);
-extern void ProcessCopyOptions(CopyState cstate, bool is_from, List *options);
-extern CopyState BeginCopyFrom(Relation rel, const char *filename,
- bool is_program, List *attnamelist, List *options);
+extern void ProcessCopyOptions(ParseState *pstate, CopyState cstate, bool is_from, List *options);
+extern CopyState BeginCopyFrom(ParseState *pstate, Relation rel, const char *filename,
+ bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options);
extern void EndCopyFrom(CopyState cstate);
extern bool NextCopyFrom(CopyState cstate, ExprContext *econtext,
Datum *values, bool *nulls, Oid *tupleOid);
@@ -34,6 +37,8 @@ extern bool NextCopyFromRawFields(CopyState cstate,
char ***fields, int *nfields);
extern void CopyFromErrorCallback(void *arg);
+extern uint64 CopyFrom(CopyState cstate);
+
extern DestReceiver *CreateCopyDestReceiver(void);
#endif /* COPY_H */
diff --git a/src/include/commands/createas.h b/src/include/commands/createas.h
index 3c4286417a..c3c43f6b36 100644
--- a/src/include/commands/createas.h
+++ b/src/include/commands/createas.h
@@ -4,7 +4,7 @@
* prototypes for createas.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/createas.h
@@ -18,10 +18,11 @@
#include "nodes/params.h"
#include "nodes/parsenodes.h"
#include "tcop/dest.h"
+#include "utils/queryenvironment.h"
extern ObjectAddress ExecCreateTableAs(CreateTableAsStmt *stmt, const char *queryString,
- ParamListInfo params, char *completionTag);
+ ParamListInfo params, QueryEnvironment *queryEnv, char *completionTag);
extern int GetIntoRelEFlags(IntoClause *intoClause);
diff --git a/src/include/commands/dbcommands.h b/src/include/commands/dbcommands.h
index 023af52242..5a74a02a5d 100644
--- a/src/include/commands/dbcommands.h
+++ b/src/include/commands/dbcommands.h
@@ -4,7 +4,7 @@
* Database management commands (create/drop database).
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/dbcommands.h
@@ -19,10 +19,10 @@
#include "lib/stringinfo.h"
#include "nodes/parsenodes.h"
-extern Oid createdb(const CreatedbStmt *stmt);
+extern Oid createdb(ParseState *pstate, const CreatedbStmt *stmt);
extern void dropdb(const char *dbname, bool missing_ok);
extern ObjectAddress RenameDatabase(const char *oldname, const char *newname);
-extern Oid AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel);
+extern Oid AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel);
extern Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
extern ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
diff --git a/src/include/commands/dbcommands_xlog.h b/src/include/commands/dbcommands_xlog.h
index 62ed5120a0..6583d0d5bd 100644
--- a/src/include/commands/dbcommands_xlog.h
+++ b/src/include/commands/dbcommands_xlog.h
@@ -4,7 +4,7 @@
* Database resource manager XLOG definitions (create/drop database).
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/dbcommands_xlog.h
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h
index b064eb4836..79f3be36e4 100644
--- a/src/include/commands/defrem.h
+++ b/src/include/commands/defrem.h
@@ -4,7 +4,7 @@
* POSTGRES define and remove utility definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/defrem.h
@@ -42,13 +42,15 @@ extern bool CheckIndexCompatible(Oid oldId,
List *attributeList,
List *exclusionOpNames);
extern Oid GetDefaultOpClass(Oid type_id, Oid am_id);
+extern Oid ResolveOpClass(List *opclass, Oid attrType,
+ char *accessMethodName, Oid accessMethodId);
/* commands/functioncmds.c */
-extern ObjectAddress CreateFunction(CreateFunctionStmt *stmt, const char *queryString);
+extern ObjectAddress CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt);
extern void RemoveFunctionById(Oid funcOid);
extern void SetFunctionReturnType(Oid funcOid, Oid newRetType);
extern void SetFunctionArgType(Oid funcOid, int argIndex, Oid newArgType);
-extern ObjectAddress AlterFunction(AlterFunctionStmt *stmt);
+extern ObjectAddress AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt);
extern ObjectAddress CreateCast(CreateCastStmt *stmt);
extern void DropCastById(Oid castOid);
extern ObjectAddress CreateTransform(CreateTransformStmt *stmt);
@@ -58,10 +60,10 @@ extern void IsThereFunctionInNamespace(const char *proname, int pronargs,
extern void ExecuteDoStmt(DoStmt *stmt);
extern Oid get_cast_oid(Oid sourcetypeid, Oid targettypeid, bool missing_ok);
extern Oid get_transform_oid(Oid type_id, Oid lang_id, bool missing_ok);
-extern void interpret_function_parameter_list(List *parameters,
+extern void interpret_function_parameter_list(ParseState *pstate,
+ List *parameters,
Oid languageOid,
bool is_aggregate,
- const char *queryString,
oidvector **parameterTypes,
ArrayType **allParameterTypes,
ArrayType **parameterModes,
@@ -75,9 +77,16 @@ extern ObjectAddress DefineOperator(List *names, List *parameters);
extern void RemoveOperatorById(Oid operOid);
extern ObjectAddress AlterOperator(AlterOperatorStmt *stmt);
+/* commands/statscmds.c */
+extern ObjectAddress CreateStatistics(CreateStatsStmt *stmt);
+extern void RemoveStatisticsById(Oid statsOid);
+extern void UpdateStatisticsForTypeChange(Oid statsOid,
+ Oid relationOid, int attnum,
+ Oid oldColumnType, Oid newColumnType);
+
/* commands/aggregatecmds.c */
-extern ObjectAddress DefineAggregate(List *name, List *args, bool oldstyle,
- List *parameters, const char *queryString);
+extern ObjectAddress DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle,
+ List *parameters);
/* commands/opclasscmds.c */
extern ObjectAddress DefineOpClass(CreateOpClassStmt *stmt);
@@ -152,6 +161,6 @@ extern int64 defGetInt64(DefElem *def);
extern List *defGetQualifiedName(DefElem *def);
extern TypeName *defGetTypeName(DefElem *def);
extern int defGetTypeLength(DefElem *def);
-extern DefElem *defWithOids(bool value);
+extern List *defGetStringList(DefElem *def);
#endif /* DEFREM_H */
diff --git a/src/include/commands/discard.h b/src/include/commands/discard.h
index 24ea786f97..b960cab51f 100644
--- a/src/include/commands/discard.h
+++ b/src/include/commands/discard.h
@@ -4,7 +4,7 @@
* prototypes for discard.c.
*
*
- * Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/commands/discard.h
*
diff --git a/src/include/commands/event_trigger.h b/src/include/commands/event_trigger.h
index 0e91bf6ada..0017bd0cd4 100644
--- a/src/include/commands/event_trigger.h
+++ b/src/include/commands/event_trigger.h
@@ -3,7 +3,7 @@
* event_trigger.h
* Declarations for command trigger handling.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/event_trigger.h
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
index bd9fc84ad9..5882aff24d 100644
--- a/src/include/commands/explain.h
+++ b/src/include/commands/explain.h
@@ -3,7 +3,7 @@
* explain.h
* prototypes for explain.c
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* src/include/commands/explain.h
@@ -15,6 +15,7 @@
#include "executor/executor.h"
#include "lib/stringinfo.h"
+#include "parser/parse_node.h"
typedef enum ExplainFormat
{
@@ -52,6 +53,7 @@ typedef struct ExplainState
/* Hook for plugins to get control in ExplainOneQuery() */
typedef void (*ExplainOneQuery_hook_type) (Query *query,
+ int cursorOptions,
IntoClause *into,
ExplainState *es,
const char *queryString,
@@ -63,20 +65,21 @@ typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);
extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
-extern void ExplainQuery(ExplainStmt *stmt, const char *queryString,
- ParamListInfo params, DestReceiver *dest);
+extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt, const char *queryString,
+ ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest);
extern ExplainState *NewExplainState(void);
extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into,
- ExplainState *es,
- const char *queryString, ParamListInfo params);
+ ExplainState *es, const char *queryString,
+ ParamListInfo params, QueryEnvironment *queryEnv);
extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into,
ExplainState *es, const char *queryString,
- ParamListInfo params, const instr_time *planduration);
+ ParamListInfo params, QueryEnvironment *queryEnv,
+ const instr_time *planduration);
extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
extern void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc);
diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h
index 94354ab04d..7f027d9dc7 100644
--- a/src/include/commands/extension.h
+++ b/src/include/commands/extension.h
@@ -4,7 +4,7 @@
* Extension management commands (create/drop extension).
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/extension.h
@@ -19,16 +19,19 @@
/*
- * creating_extension is only true while running a CREATE EXTENSION command.
- * It instructs recordDependencyOnCurrentExtension() to register a dependency
- * on the current pg_extension object for each SQL object created by its
- * installation script.
+ * creating_extension is only true while running a CREATE EXTENSION or ALTER
+ * EXTENSION UPDATE command. It instructs recordDependencyOnCurrentExtension()
+ * to register a dependency on the current pg_extension object for each SQL
+ * object created by an extension script. It also instructs performDeletion()
+ * to remove such dependencies without following them, so that extension
+ * scripts can drop member objects without having to explicitly dissociate
+ * them from the extension first.
*/
extern PGDLLIMPORT bool creating_extension;
extern Oid CurrentExtensionObject;
-extern ObjectAddress CreateExtension(CreateExtensionStmt *stmt);
+extern ObjectAddress CreateExtension(ParseState *pstate, CreateExtensionStmt *stmt);
extern void RemoveExtensionById(Oid extId);
@@ -37,7 +40,7 @@ extern ObjectAddress InsertExtensionTuple(const char *extName, Oid extOwner,
Datum extConfig, Datum extCondition,
List *requiredExtensions);
-extern ObjectAddress ExecAlterExtensionStmt(AlterExtensionStmt *stmt);
+extern ObjectAddress ExecAlterExtensionStmt(ParseState *pstate, AlterExtensionStmt *stmt);
extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
ObjectAddress *objAddress);
@@ -45,7 +48,7 @@ extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *
extern Oid get_extension_oid(const char *extname, bool missing_ok);
extern char *get_extension_name(Oid ext_oid);
-extern ObjectAddress AlterExtensionNamespace(List *names, const char *newschema,
+extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema,
Oid *oldschema);
extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
diff --git a/src/include/commands/lockcmds.h b/src/include/commands/lockcmds.h
index 8881352dd7..45ed96d4d1 100644
--- a/src/include/commands/lockcmds.h
+++ b/src/include/commands/lockcmds.h
@@ -4,7 +4,7 @@
* prototypes for lockcmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/lockcmds.h
diff --git a/src/include/commands/matview.h b/src/include/commands/matview.h
index 82e06c2460..129fb92f59 100644
--- a/src/include/commands/matview.h
+++ b/src/include/commands/matview.h
@@ -4,7 +4,7 @@
* prototypes for matview.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/matview.h
diff --git a/src/include/commands/policy.h b/src/include/commands/policy.h
index dbf782464b..cff93a6cb0 100644
--- a/src/include/commands/policy.h
+++ b/src/include/commands/policy.h
@@ -4,7 +4,7 @@
* prototypes for policy.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/policy.h
diff --git a/src/include/commands/portalcmds.h b/src/include/commands/portalcmds.h
index 8abd3e72bf..8f0e6c48f4 100644
--- a/src/include/commands/portalcmds.h
+++ b/src/include/commands/portalcmds.h
@@ -4,7 +4,7 @@
* prototypes for portalcmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/portalcmds.h
@@ -18,7 +18,7 @@
#include "utils/portal.h"
-extern void PerformCursorOpen(PlannedStmt *stmt, ParamListInfo params,
+extern void PerformCursorOpen(DeclareCursorStmt *cstmt, ParamListInfo params,
const char *queryString, bool isTopLevel);
extern void PerformPortalFetch(FetchStmt *stmt, DestReceiver *dest,
diff --git a/src/include/commands/prepare.h b/src/include/commands/prepare.h
index 072ce78580..147f22b870 100644
--- a/src/include/commands/prepare.h
+++ b/src/include/commands/prepare.h
@@ -4,7 +4,7 @@
* PREPARE, EXECUTE and DEALLOCATE commands, and prepared-stmt storage
*
*
- * Copyright (c) 2002-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2002-2017, PostgreSQL Global Development Group
*
* src/include/commands/prepare.h
*
@@ -47,14 +47,15 @@ typedef struct
#endif
/* Utility statements PREPARE, EXECUTE, DEALLOCATE, EXPLAIN EXECUTE */
-extern void PrepareQuery(PrepareStmt *stmt, const char *queryString);
+extern void PrepareQuery(PrepareStmt *stmt, const char *queryString,
+ int stmt_location, int stmt_len);
extern void ExecuteQuery(ExecuteStmt *stmt, IntoClause *intoClause,
const char *queryString, ParamListInfo params,
DestReceiver *dest, char *completionTag);
extern void DeallocateQuery(DeallocateStmt *stmt);
extern void ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into,
- ExplainState *es,
- const char *queryString, ParamListInfo params);
+ ExplainState *es, const char *queryString,
+ ParamListInfo params, QueryEnvironment *queryEnv);
/* Low-level access to stored prepared statements */
extern void StorePreparedStatement(const char *stmt_name,
diff --git a/src/include/commands/progress.h b/src/include/commands/progress.h
index c48d23be2b..9472ecca63 100644
--- a/src/include/commands/progress.h
+++ b/src/include/commands/progress.h
@@ -7,7 +7,7 @@
* constants, you probably also need to update the views based on them
* in system_views.sql.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/progress.h
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
new file mode 100644
index 0000000000..7f12ff0a1b
--- /dev/null
+++ b/src/include/commands/publicationcmds.h
@@ -0,0 +1,29 @@
+/*-------------------------------------------------------------------------
+ *
+ * publicationcmds.h
+ * prototypes for publicationcmds.c.
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/commands/publicationcmds.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef PUBLICATIONCMDS_H
+#define PUBLICATIONCMDS_H
+
+#include "catalog/objectaddress.h"
+#include "nodes/parsenodes.h"
+
+extern ObjectAddress CreatePublication(CreatePublicationStmt *stmt);
+extern void AlterPublication(AlterPublicationStmt *stmt);
+extern void RemovePublicationById(Oid pubid);
+extern void RemovePublicationRelById(Oid proid);
+
+extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
+
+#endif /* PUBLICATIONCMDS_H */
diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h
index b87a10dd40..7079bfbf5a 100644
--- a/src/include/commands/schemacmds.h
+++ b/src/include/commands/schemacmds.h
@@ -4,7 +4,7 @@
* prototypes for schemacmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/schemacmds.h
@@ -18,13 +18,11 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-#ifdef PGXC
extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
- const char *queryString, bool is_top_level);
-#else
-extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
- const char *queryString);
-#endif
+ const char *queryString,
+ bool is_top_level,
+ int stmt_location, int stmt_len);
+
extern void RemoveSchemaById(Oid schemaOid);
extern ObjectAddress RenameSchema(const char *oldname, const char *newname);
diff --git a/src/include/commands/seclabel.h b/src/include/commands/seclabel.h
index 6671bfdfee..d317f39485 100644
--- a/src/include/commands/seclabel.h
+++ b/src/include/commands/seclabel.h
@@ -3,7 +3,7 @@
*
* Prototypes for functions in commands/seclabel.c
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*/
#ifndef SECLABEL_H
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index 0f82def1f1..0e9533cc2d 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -4,7 +4,7 @@
* prototypes for sequence.c.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/sequence.h
@@ -19,6 +19,7 @@
#include "fmgr.h"
#include "lib/stringinfo.h"
#include "nodes/parsenodes.h"
+#include "parser/parse_node.h"
#include "storage/relfilenode.h"
#ifdef PGXC
@@ -27,38 +28,24 @@
#include "access/xact.h"
#endif
-typedef struct FormData_pg_sequence
+typedef struct FormData_pg_sequence_data
{
- NameData sequence_name;
int64 last_value;
- int64 start_value;
- int64 increment_by;
- int64 max_value;
- int64 min_value;
- int64 cache_value;
int64 log_cnt;
- bool is_cycled;
bool is_called;
-} FormData_pg_sequence;
+} FormData_pg_sequence_data;
-typedef FormData_pg_sequence *Form_pg_sequence;
+typedef FormData_pg_sequence_data *Form_pg_sequence_data;
/*
* Columns of a sequence relation
*/
-#define SEQ_COL_NAME 1
-#define SEQ_COL_LASTVAL 2
-#define SEQ_COL_STARTVAL 3
-#define SEQ_COL_INCBY 4
-#define SEQ_COL_MAXVALUE 5
-#define SEQ_COL_MINVALUE 6
-#define SEQ_COL_CACHE 7
-#define SEQ_COL_LOG 8
-#define SEQ_COL_CYCLE 9
-#define SEQ_COL_CALLED 10
+#define SEQ_COL_LASTVAL 1
+#define SEQ_COL_LOG 2
+#define SEQ_COL_CALLED 3
-#define SEQ_COL_FIRSTCOL SEQ_COL_NAME
+#define SEQ_COL_FIRSTCOL SEQ_COL_LASTVAL
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
/* XLOG stuff */
@@ -70,23 +57,20 @@ typedef struct xl_seq_rec
/* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
} xl_seq_rec;
+extern int64 nextval_internal(Oid relid, bool check_permissions);
extern Datum nextval(PG_FUNCTION_ARGS);
-extern Datum nextval_oid(PG_FUNCTION_ARGS);
-extern Datum currval_oid(PG_FUNCTION_ARGS);
-extern Datum setval_oid(PG_FUNCTION_ARGS);
-extern Datum setval3_oid(PG_FUNCTION_ARGS);
-extern Datum lastval(PG_FUNCTION_ARGS);
+extern List *sequence_options(Oid relid);
-extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS);
-
-extern ObjectAddress DefineSequence(CreateSeqStmt *stmt);
-extern ObjectAddress AlterSequence(AlterSeqStmt *stmt);
+extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
+extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
+extern void DeleteSequenceTuple(Oid relid);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
extern void seq_redo(XLogReaderState *rptr);
extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
extern const char *seq_identify(uint8 info);
+extern void seq_mask(char *pagedata, BlockNumber blkno);
#ifdef XCP
#define DEFAULT_CACHEVAL 1
diff --git a/src/include/commands/subscriptioncmds.h b/src/include/commands/subscriptioncmds.h
new file mode 100644
index 0000000000..1e4428e617
--- /dev/null
+++ b/src/include/commands/subscriptioncmds.h
@@ -0,0 +1,29 @@
+/*-------------------------------------------------------------------------
+ *
+ * subscriptioncmds.h
+ * prototypes for subscriptioncmds.c.
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/commands/subscriptioncmds.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef SUBSCRIPTIONCMDS_H
+#define SUBSCRIPTIONCMDS_H
+
+#include "catalog/objectaddress.h"
+#include "nodes/parsenodes.h"
+
+extern ObjectAddress CreateSubscription(CreateSubscriptionStmt *stmt,
+ bool isTopLevel);
+extern ObjectAddress AlterSubscription(AlterSubscriptionStmt *stmt);
+extern void DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel);
+
+extern ObjectAddress AlterSubscriptionOwner(const char *name, Oid newOwnerId);
+extern void AlterSubscriptionOwner_oid(Oid subid, Oid newOwnerId);
+
+#endif /* SUBSCRIPTIONCMDS_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 0296651a87..a27fdfbfce 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -4,7 +4,7 @@
* prototypes for tablecmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/tablecmds.h
@@ -23,7 +23,7 @@
extern ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
- ObjectAddress *typaddress);
+ ObjectAddress *typaddress, const char *queryString);
extern void RemoveRelations(DropStmt *drop);
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 9e59da24a4..3ea13bdf14 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -4,7 +4,7 @@
* Tablespace management commands (create/drop tablespace).
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/tablespace.h
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index fc32d2cf54..de9462d402 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -3,7 +3,7 @@
* trigger.h
* Declarations for trigger handling.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/trigger.h
@@ -37,6 +37,8 @@ typedef struct TriggerData
Trigger *tg_trigger;
Buffer tg_trigtuplebuf;
Buffer tg_newtuplebuf;
+ Tuplestorestate *tg_oldtable;
+ Tuplestorestate *tg_newtable;
} TriggerData;
/*
@@ -217,6 +219,4 @@ extern bool RI_Initial_Check(Trigger *trigger,
extern int RI_FKey_trigger_type(Oid tgfoid);
-extern Datum pg_trigger_depth(PG_FUNCTION_ARGS);
-
#endif /* TRIGGER_H */
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h
index e4c86f1b1d..c18f93adb2 100644
--- a/src/include/commands/typecmds.h
+++ b/src/include/commands/typecmds.h
@@ -4,7 +4,7 @@
* prototypes for typecmds.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/typecmds.h
@@ -21,12 +21,12 @@
#define DEFAULT_TYPDELIM ','
-extern ObjectAddress DefineType(List *names, List *parameters);
+extern ObjectAddress DefineType(ParseState *pstate, List *names, List *parameters);
extern void RemoveTypeById(Oid typeOid);
extern ObjectAddress DefineDomain(CreateDomainStmt *stmt);
extern ObjectAddress DefineEnum(CreateEnumStmt *stmt);
extern ObjectAddress DefineRange(CreateRangeStmt *stmt);
-extern ObjectAddress AlterEnum(AlterEnumStmt *stmt, bool isTopLevel);
+extern ObjectAddress AlterEnum(AlterEnumStmt *stmt);
extern ObjectAddress DefineCompositeType(RangeVar *typevar, List *coldeflist);
extern Oid AssignTypeArrayOid(void);
diff --git a/src/include/commands/user.h b/src/include/commands/user.h
index d35cb0c90d..08037e0f81 100644
--- a/src/include/commands/user.h
+++ b/src/include/commands/user.h
@@ -12,18 +12,19 @@
#define USER_H
#include "catalog/objectaddress.h"
+#include "libpq/crypt.h"
#include "nodes/parsenodes.h"
+#include "parser/parse_node.h"
+/* GUC. Is actually of type PasswordType. */
+extern int Password_encryption;
/* Hook to check passwords in CreateRole() and AlterRole() */
-#define PASSWORD_TYPE_PLAINTEXT 0
-#define PASSWORD_TYPE_MD5 1
-
-typedef void (*check_password_hook_type) (const char *username, const char *password, int password_type, Datum validuntil_time, bool validuntil_null);
+typedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null);
extern PGDLLIMPORT check_password_hook_type check_password_hook;
-extern Oid CreateRole(CreateRoleStmt *stmt);
+extern Oid CreateRole(ParseState *pstate, CreateRoleStmt *stmt);
extern Oid AlterRole(AlterRoleStmt *stmt);
extern Oid AlterRoleSet(AlterRoleSetStmt *stmt);
extern void DropRole(DropRoleStmt *stmt);
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h
index b87bf2ace9..fd2dc860dd 100644
--- a/src/include/commands/vacuum.h
+++ b/src/include/commands/vacuum.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/vacuum.h
diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h
index 4997e1e166..e0fb3332df 100644
--- a/src/include/commands/variable.h
+++ b/src/include/commands/variable.h
@@ -3,7 +3,7 @@
* Routines for handling specialized SET variables.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/variable.h
diff --git a/src/include/commands/view.h b/src/include/commands/view.h
index 99e456449d..39763913c8 100644
--- a/src/include/commands/view.h
+++ b/src/include/commands/view.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/view.h
@@ -19,7 +19,8 @@
extern void validateWithCheckOption(char *value);
-extern ObjectAddress DefineView(ViewStmt *stmt, const char *queryString);
+extern ObjectAddress DefineView(ViewStmt *stmt, const char *queryString,
+ int stmt_location, int stmt_len);
extern void StoreViewQuery(Oid viewOid, Query *viewParse, bool replace);
diff --git a/src/include/common/base64.h b/src/include/common/base64.h
new file mode 100644
index 0000000000..09b69b1656
--- /dev/null
+++ b/src/include/common/base64.h
@@ -0,0 +1,19 @@
+/*
+ * base64.h
+ * Encoding and decoding routines for base64 without whitespace
+ * support.
+ *
+ * Portions Copyright (c) 2001-2017, PostgreSQL Global Development Group
+ *
+ * src/include/common/base64.h
+ */
+#ifndef BASE64_H
+#define BASE64_H
+
+/* base 64 */
+extern int pg_b64_encode(const char *src, int len, char *dst);
+extern int pg_b64_decode(const char *src, int len, char *dst);
+extern int pg_b64_enc_len(int srclen);
+extern int pg_b64_dec_len(int srclen);
+
+#endif /* BASE64_H */
diff --git a/src/include/common/config_info.h b/src/include/common/config_info.h
index a695a42c0a..656e26fdb0 100644
--- a/src/include/common/config_info.h
+++ b/src/include/common/config_info.h
@@ -2,7 +2,7 @@
* config_info.h
* Common code for pg_config output
*
- * Copyright (c) 2016, PostgreSQL Global Development Group
+ * Copyright (c) 2016-2017, PostgreSQL Global Development Group
*
* src/include/common/config_info.h
*/
diff --git a/src/include/common/controldata_utils.h b/src/include/common/controldata_utils.h
index a355d2252d..82ea426afe 100644
--- a/src/include/common/controldata_utils.h
+++ b/src/include/common/controldata_utils.h
@@ -2,7 +2,7 @@
* controldata_utils.h
* Common code for pg_controldata output
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/common/controldata_utils.h
@@ -12,6 +12,6 @@
#include "catalog/pg_control.h"
-extern ControlFileData *get_controlfile(char *DataDir, const char *progname);
+extern ControlFileData *get_controlfile(const char *DataDir, const char *progname, bool *crc_ok_p);
#endif /* COMMON_CONTROLDATA_UTILS_H */
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index b4ce3d41ef..cb381bd9f5 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -2,7 +2,7 @@
* fe_memutils.h
* memory management support for frontend code
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/common/fe_memutils.h
*/
diff --git a/src/include/common/file_utils.h b/src/include/common/file_utils.h
new file mode 100644
index 0000000000..95c001905d
--- /dev/null
+++ b/src/include/common/file_utils.h
@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ *
+ * File-processing utility routines for frontend code
+ *
+ * Assorted utility functions to work on files.
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/common/file_utils.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef FILE_UTILS_H
+#define FILE_UTILS_H
+
+extern int fsync_fname(const char *fname, bool isdir,
+ const char *progname);
+extern void fsync_pgdata(const char *pg_data, const char *progname,
+ int serverVersion);
+extern void fsync_dir_recurse(const char *dir, const char *progname);
+extern int durable_rename(const char *oldfile, const char *newfile,
+ const char *progname);
+extern int fsync_parent_path(const char *fname, const char *progname);
+
+#endif /* FILE_UTILS_H */
diff --git a/src/include/common/int128.h b/src/include/common/int128.h
new file mode 100644
index 0000000000..4c46e26f40
--- /dev/null
+++ b/src/include/common/int128.h
@@ -0,0 +1,276 @@
+/*-------------------------------------------------------------------------
+ *
+ * int128.h
+ * Roll-our-own 128-bit integer arithmetic.
+ *
+ * We make use of the native int128 type if there is one, otherwise
+ * implement things the hard way based on two int64 halves.
+ *
+ * See src/tools/testint128.c for a simple test harness for this file.
+ *
+ * Copyright (c) 2017, PostgreSQL Global Development Group
+ *
+ * src/include/common/int128.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef INT128_H
+#define INT128_H
+
+/*
+ * For testing purposes, use of native int128 can be switched on/off by
+ * predefining USE_NATIVE_INT128.
+ */
+#ifndef USE_NATIVE_INT128
+#ifdef HAVE_INT128
+#define USE_NATIVE_INT128 1
+#else
+#define USE_NATIVE_INT128 0
+#endif
+#endif
+
+
+#if USE_NATIVE_INT128
+
+typedef int128 INT128;
+
+/*
+ * Add an unsigned int64 value into an INT128 variable.
+ */
+static inline void
+int128_add_uint64(INT128 *i128, uint64 v)
+{
+ *i128 += v;
+}
+
+/*
+ * Add a signed int64 value into an INT128 variable.
+ */
+static inline void
+int128_add_int64(INT128 *i128, int64 v)
+{
+ *i128 += v;
+}
+
+/*
+ * Add the 128-bit product of two int64 values into an INT128 variable.
+ *
+ * XXX with a stupid compiler, this could actually be less efficient than
+ * the other implementation; maybe we should do it by hand always?
+ */
+static inline void
+int128_add_int64_mul_int64(INT128 *i128, int64 x, int64 y)
+{
+ *i128 += (int128) x *(int128) y;
+}
+
+/*
+ * Compare two INT128 values, return -1, 0, or +1.
+ */
+static inline int
+int128_compare(INT128 x, INT128 y)
+{
+ if (x < y)
+ return -1;
+ if (x > y)
+ return 1;
+ return 0;
+}
+
+/*
+ * Widen int64 to INT128.
+ */
+static inline INT128
+int64_to_int128(int64 v)
+{
+ return (INT128) v;
+}
+
+/*
+ * Convert INT128 to int64 (losing any high-order bits).
+ * This also works fine for casting down to uint64.
+ */
+static inline int64
+int128_to_int64(INT128 val)
+{
+ return (int64) val;
+}
+
+#else /* !USE_NATIVE_INT128 */
+
+/*
+ * We lay out the INT128 structure with the same content and byte ordering
+ * that a native int128 type would (probably) have. This makes no difference
+ * for ordinary use of INT128, but allows union'ing INT128 with int128 for
+ * testing purposes.
+ */
+typedef struct
+{
+#ifdef WORDS_BIGENDIAN
+ int64 hi; /* most significant 64 bits, including sign */
+ uint64 lo; /* least significant 64 bits, without sign */
+#else
+ uint64 lo; /* least significant 64 bits, without sign */
+ int64 hi; /* most significant 64 bits, including sign */
+#endif
+} INT128;
+
+/*
+ * Add an unsigned int64 value into an INT128 variable.
+ */
+static inline void
+int128_add_uint64(INT128 *i128, uint64 v)
+{
+ /*
+ * First add the value to the .lo part, then check to see if a carry needs
+ * to be propagated into the .hi part. A carry is needed if both inputs
+ * have high bits set, or if just one input has high bit set while the new
+ * .lo part doesn't. Remember that .lo part is unsigned; we cast to
+ * signed here just as a cheap way to check the high bit.
+ */
+ uint64 oldlo = i128->lo;
+
+ i128->lo += v;
+ if (((int64) v < 0 && (int64) oldlo < 0) ||
+ (((int64) v < 0 || (int64) oldlo < 0) && (int64) i128->lo >= 0))
+ i128->hi++;
+}
+
+/*
+ * Add a signed int64 value into an INT128 variable.
+ */
+static inline void
+int128_add_int64(INT128 *i128, int64 v)
+{
+ /*
+ * This is much like the above except that the carry logic differs for
+ * negative v. Ordinarily we'd need to subtract 1 from the .hi part
+ * (corresponding to adding the sign-extended bits of v to it); but if
+ * there is a carry out of the .lo part, that cancels and we do nothing.
+ */
+ uint64 oldlo = i128->lo;
+
+ i128->lo += v;
+ if (v >= 0)
+ {
+ if ((int64) oldlo < 0 && (int64) i128->lo >= 0)
+ i128->hi++;
+ }
+ else
+ {
+ if (!((int64) oldlo < 0 || (int64) i128->lo >= 0))
+ i128->hi--;
+ }
+}
+
+/*
+ * INT64_AU32 extracts the most significant 32 bits of int64 as int64, while
+ * INT64_AL32 extracts the least significant 32 bits as uint64.
+ */
+#define INT64_AU32(i64) ((i64) >> 32)
+#define INT64_AL32(i64) ((i64) & UINT64CONST(0xFFFFFFFF))
+
+/*
+ * Add the 128-bit product of two int64 values into an INT128 variable.
+ */
+static inline void
+int128_add_int64_mul_int64(INT128 *i128, int64 x, int64 y)
+{
+ /* INT64_AU32 must use arithmetic right shift */
+ StaticAssertStmt(((int64) -1 >> 1) == (int64) -1,
+ "arithmetic right shift is needed");
+
+ /*----------
+ * Form the 128-bit product x * y using 64-bit arithmetic.
+ * Considering each 64-bit input as having 32-bit high and low parts,
+ * we can compute
+ *
+ * x * y = ((x.hi << 32) + x.lo) * (((y.hi << 32) + y.lo)
+ * = (x.hi * y.hi) << 64 +
+ * (x.hi * y.lo) << 32 +
+ * (x.lo * y.hi) << 32 +
+ * x.lo * y.lo
+ *
+ * Each individual product is of 32-bit terms so it won't overflow when
+ * computed in 64-bit arithmetic. Then we just have to shift it to the
+ * correct position while adding into the 128-bit result. We must also
+ * keep in mind that the "lo" parts must be treated as unsigned.
+ *----------
+ */
+
+ /* No need to work hard if product must be zero */
+ if (x != 0 && y != 0)
+ {
+ int64 x_u32 = INT64_AU32(x);
+ uint64 x_l32 = INT64_AL32(x);
+ int64 y_u32 = INT64_AU32(y);
+ uint64 y_l32 = INT64_AL32(y);
+ int64 tmp;
+
+ /* the first term */
+ i128->hi += x_u32 * y_u32;
+
+ /* the second term: sign-extend it only if x is negative */
+ tmp = x_u32 * y_l32;
+ if (x < 0)
+ i128->hi += INT64_AU32(tmp);
+ else
+ i128->hi += ((uint64) tmp) >> 32;
+ int128_add_uint64(i128, ((uint64) INT64_AL32(tmp)) << 32);
+
+ /* the third term: sign-extend it only if y is negative */
+ tmp = x_l32 * y_u32;
+ if (y < 0)
+ i128->hi += INT64_AU32(tmp);
+ else
+ i128->hi += ((uint64) tmp) >> 32;
+ int128_add_uint64(i128, ((uint64) INT64_AL32(tmp)) << 32);
+
+ /* the fourth term: always unsigned */
+ int128_add_uint64(i128, x_l32 * y_l32);
+ }
+}
+
+/*
+ * Compare two INT128 values, return -1, 0, or +1.
+ */
+static inline int
+int128_compare(INT128 x, INT128 y)
+{
+ if (x.hi < y.hi)
+ return -1;
+ if (x.hi > y.hi)
+ return 1;
+ if (x.lo < y.lo)
+ return -1;
+ if (x.lo > y.lo)
+ return 1;
+ return 0;
+}
+
+/*
+ * Widen int64 to INT128.
+ */
+static inline INT128
+int64_to_int128(int64 v)
+{
+ INT128 val;
+
+ val.lo = (uint64) v;
+ val.hi = (v < 0) ? -INT64CONST(1) : INT64CONST(0);
+ return val;
+}
+
+/*
+ * Convert INT128 to int64 (losing any high-order bits).
+ * This also works fine for casting down to uint64.
+ */
+static inline int64
+int128_to_int64(INT128 val)
+{
+ return (int64) val.lo;
+}
+
+#endif /* USE_NATIVE_INT128 */
+
+#endif /* INT128_H */
diff --git a/src/include/libpq/ip.h b/src/include/common/ip.h
index ce9bc6e225..815e6ccad3 100644
--- a/src/include/libpq/ip.h
+++ b/src/include/common/ip.h
@@ -3,12 +3,11 @@
* ip.h
* Definitions for IPv6-aware network access.
*
- * These definitions are used by both frontend and backend code. Be careful
- * what you include here!
+ * These definitions are used by both frontend and backend code.
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
- * src/include/libpq/ip.h
+ * src/include/common/ip.h
*
*-------------------------------------------------------------------------
*/
@@ -25,10 +24,6 @@
#define IS_AF_UNIX(fam) (0)
#endif
-typedef void (*PgIfAddrCallback) (struct sockaddr * addr,
- struct sockaddr * netmask,
- void *cb_data);
-
extern int pg_getaddrinfo_all(const char *hostname, const char *servname,
const struct addrinfo * hintp,
struct addrinfo ** result);
@@ -39,13 +34,4 @@ extern int pg_getnameinfo_all(const struct sockaddr_storage * addr, int salen,
char *service, int servicelen,
int flags);
-extern int pg_range_sockaddr(const struct sockaddr_storage * addr,
- const struct sockaddr_storage * netaddr,
- const struct sockaddr_storage * netmask);
-
-extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask,
- char *numbits, int family);
-
-extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data);
-
#endif /* IP_H */
diff --git a/src/include/common/keywords.h b/src/include/common/keywords.h
index 97c830521c..34e066be6b 100644
--- a/src/include/common/keywords.h
+++ b/src/include/common/keywords.h
@@ -4,7 +4,7 @@
* lexical token lookup for key words in PostgreSQL
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/common/keywords.h
diff --git a/src/include/libpq/md5.h b/src/include/common/md5.h
index f3eec8b4f4..ccaaeddbf4 100644
--- a/src/include/libpq/md5.h
+++ b/src/include/common/md5.h
@@ -6,10 +6,10 @@
* These definitions are needed by both frontend and backend code to work
* with MD5-encrypted passwords.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * src/include/libpq/md5.h
+ * src/include/common/md5.h
*
*-------------------------------------------------------------------------
*/
@@ -18,10 +18,6 @@
#define MD5_PASSWD_LEN 35
-#define isMD5(passwd) (strncmp(passwd, "md5", 3) == 0 && \
- strlen(passwd) == MD5_PASSWD_LEN)
-
-
extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum);
extern bool pg_md5_binary(const void *buff, size_t len, void *outbuf);
extern bool pg_md5_encrypt(const char *passwd, const char *salt,
diff --git a/src/include/common/relpath.h b/src/include/common/relpath.h
index ed357ae93d..8468c0c6f6 100644
--- a/src/include/common/relpath.h
+++ b/src/include/common/relpath.h
@@ -3,7 +3,7 @@
* relpath.h
* Declarations for GetRelationPath() and friends
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/common/relpath.h
diff --git a/src/include/common/restricted_token.h b/src/include/common/restricted_token.h
index fb4ebd4cad..7441a55119 100644
--- a/src/include/common/restricted_token.h
+++ b/src/include/common/restricted_token.h
@@ -2,7 +2,7 @@
* restricted_token.h
* helper routine to ensure restricted token on Windows
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/common/restricted_token.h
diff --git a/src/include/common/saslprep.h b/src/include/common/saslprep.h
new file mode 100644
index 0000000000..ec5c8ce361
--- /dev/null
+++ b/src/include/common/saslprep.h
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * saslprep.h
+ * SASLprep normalization, for SCRAM authentication
+ *
+ * These definitions are used by both frontend and backend code.
+ *
+ * Copyright (c) 2017, PostgreSQL Global Development Group
+ *
+ * src/include/common/saslprep.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef SASLPREP_H
+#define SASLPREP_H
+
+/*
+ * Return codes for pg_saslprep() function.
+ */
+typedef enum
+{
+ SASLPREP_SUCCESS = 0,
+ SASLPREP_OOM = -1, /* out of memory (only in frontend) */
+ SASLPREP_INVALID_UTF8 = -2, /* input is not a valid UTF-8 string */
+ SASLPREP_PROHIBITED = -3 /* output would contain prohibited characters */
+} pg_saslprep_rc;
+
+extern pg_saslprep_rc pg_saslprep(const char *input, char **output);
+
+#endif /* SASLPREP_H */
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
new file mode 100644
index 0000000000..2ee51fbaec
--- /dev/null
+++ b/src/include/common/scram-common.h
@@ -0,0 +1,59 @@
+/*-------------------------------------------------------------------------
+ *
+ * scram-common.h
+ * Declarations for helper functions used for SCRAM authentication
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/common/scram-common.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef SCRAM_COMMON_H
+#define SCRAM_COMMON_H
+
+#include "common/sha2.h"
+
+/* Length of SCRAM keys (client and server) */
+#define SCRAM_KEY_LEN PG_SHA256_DIGEST_LENGTH
+
+/* length of HMAC */
+#define SHA256_HMAC_B PG_SHA256_BLOCK_LENGTH
+
+/*
+ * Size of random nonce generated in the authentication exchange. This
+ * is in "raw" number of bytes, the actual nonces sent over the wire are
+ * encoded using only ASCII-printable characters.
+ */
+#define SCRAM_RAW_NONCE_LEN 18
+
+/* length of salt when generating new verifiers */
+#define SCRAM_DEFAULT_SALT_LEN 12
+
+/* default number of iterations when generating verifier */
+#define SCRAM_DEFAULT_ITERATIONS 4096
+
+/*
+ * Context data for HMAC used in SCRAM authentication.
+ */
+typedef struct
+{
+ pg_sha256_ctx sha256ctx;
+ uint8 k_opad[SHA256_HMAC_B];
+} scram_HMAC_ctx;
+
+extern void scram_HMAC_init(scram_HMAC_ctx *ctx, const uint8 *key, int keylen);
+extern void scram_HMAC_update(scram_HMAC_ctx *ctx, const char *str, int slen);
+extern void scram_HMAC_final(uint8 *result, scram_HMAC_ctx *ctx);
+
+extern void scram_SaltedPassword(const char *password, const char *salt,
+ int saltlen, int iterations, uint8 *result);
+extern void scram_H(const uint8 *str, int len, uint8 *result);
+extern void scram_ClientKey(const uint8 *salted_password, uint8 *result);
+extern void scram_ServerKey(const uint8 *salted_password, uint8 *result);
+
+extern char *scram_build_verifier(const char *salt, int saltlen, int iterations,
+ const char *password);
+
+#endif /* SCRAM_COMMON_H */
diff --git a/src/include/common/sha2.h b/src/include/common/sha2.h
new file mode 100644
index 0000000000..09107cfc3b
--- /dev/null
+++ b/src/include/common/sha2.h
@@ -0,0 +1,115 @@
+/*-------------------------------------------------------------------------
+ *
+ * sha2.h
+ * Generic headers for SHA224, 256, 384 AND 512 functions of PostgreSQL.
+ *
+ * Portions Copyright (c) 2016, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * src/include/common/sha2.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* $OpenBSD: sha2.h,v 1.2 2004/04/28 23:11:57 millert Exp $ */
+
+/*
+ * FILE: sha2.h
+ * AUTHOR: Aaron D. Gifford <me@aarongifford.com>
+ *
+ * Copyright (c) 2000-2001, Aaron D. Gifford
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $From: sha2.h,v 1.1 2001/11/08 00:02:01 adg Exp adg $
+ */
+
+#ifndef _PG_SHA2_H_
+#define _PG_SHA2_H_
+
+#ifdef USE_SSL
+#include <openssl/sha.h>
+#endif
+
+/*** SHA224/256/384/512 Various Length Definitions ***********************/
+#define PG_SHA224_BLOCK_LENGTH 64
+#define PG_SHA224_DIGEST_LENGTH 28
+#define PG_SHA224_DIGEST_STRING_LENGTH (PG_SHA224_DIGEST_LENGTH * 2 + 1)
+#define PG_SHA256_BLOCK_LENGTH 64
+#define PG_SHA256_DIGEST_LENGTH 32
+#define PG_SHA256_DIGEST_STRING_LENGTH (PG_SHA256_DIGEST_LENGTH * 2 + 1)
+#define PG_SHA384_BLOCK_LENGTH 128
+#define PG_SHA384_DIGEST_LENGTH 48
+#define PG_SHA384_DIGEST_STRING_LENGTH (PG_SHA384_DIGEST_LENGTH * 2 + 1)
+#define PG_SHA512_BLOCK_LENGTH 128
+#define PG_SHA512_DIGEST_LENGTH 64
+#define PG_SHA512_DIGEST_STRING_LENGTH (PG_SHA512_DIGEST_LENGTH * 2 + 1)
+
+/* Context Structures for SHA-1/224/256/384/512 */
+#ifdef USE_SSL
+typedef SHA256_CTX pg_sha256_ctx;
+typedef SHA512_CTX pg_sha512_ctx;
+typedef SHA256_CTX pg_sha224_ctx;
+typedef SHA512_CTX pg_sha384_ctx;
+#else
+typedef struct pg_sha256_ctx
+{
+ uint32 state[8];
+ uint64 bitcount;
+ uint8 buffer[PG_SHA256_BLOCK_LENGTH];
+} pg_sha256_ctx;
+typedef struct pg_sha512_ctx
+{
+ uint64 state[8];
+ uint64 bitcount[2];
+ uint8 buffer[PG_SHA512_BLOCK_LENGTH];
+} pg_sha512_ctx;
+typedef struct pg_sha256_ctx pg_sha224_ctx;
+typedef struct pg_sha512_ctx pg_sha384_ctx;
+#endif /* USE_SSL */
+
+/* Interface routines for SHA224/256/384/512 */
+extern void pg_sha224_init(pg_sha224_ctx *ctx);
+extern void pg_sha224_update(pg_sha224_ctx *ctx, const uint8 *input0,
+ size_t len);
+extern void pg_sha224_final(pg_sha224_ctx *ctx, uint8 *dest);
+
+extern void pg_sha256_init(pg_sha256_ctx *ctx);
+extern void pg_sha256_update(pg_sha256_ctx *ctx, const uint8 *input0,
+ size_t len);
+extern void pg_sha256_final(pg_sha256_ctx *ctx, uint8 *dest);
+
+extern void pg_sha384_init(pg_sha384_ctx *ctx);
+extern void pg_sha384_update(pg_sha384_ctx *ctx,
+ const uint8 *, size_t len);
+extern void pg_sha384_final(pg_sha384_ctx *ctx, uint8 *dest);
+
+extern void pg_sha512_init(pg_sha512_ctx *ctx);
+extern void pg_sha512_update(pg_sha512_ctx *ctx, const uint8 *input0,
+ size_t len);
+extern void pg_sha512_final(pg_sha512_ctx *ctx, uint8 *dest);
+
+#endif /* _PG_SHA2_H_ */
diff --git a/src/include/common/string.h b/src/include/common/string.h
index bb54d28fcb..ec9ee9a740 100644
--- a/src/include/common/string.h
+++ b/src/include/common/string.h
@@ -2,7 +2,7 @@
* string.h
* string handling helpers
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/common/string.h
diff --git a/src/include/common/unicode_norm.h b/src/include/common/unicode_norm.h
new file mode 100644
index 0000000000..488f964d2c
--- /dev/null
+++ b/src/include/common/unicode_norm.h
@@ -0,0 +1,21 @@
+/*-------------------------------------------------------------------------
+ *
+ * unicode_norm.h
+ * Routines for normalizing Unicode strings
+ *
+ * These definitions are used by both frontend and backend code.
+ *
+ * Copyright (c) 2017, PostgreSQL Global Development Group
+ *
+ * src/include/common/unicode_norm.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef UNICODE_NORM_H
+#define UNICODE_NORM_H
+
+#include "mb/pg_wchar.h"
+
+extern pg_wchar *unicode_normalize_kc(const pg_wchar *input);
+
+#endif /* UNICODE_NORM_H */
diff --git a/src/include/common/unicode_norm_table.h b/src/include/common/unicode_norm_table.h
new file mode 100644
index 0000000000..3bcf05e5ee
--- /dev/null
+++ b/src/include/common/unicode_norm_table.h
@@ -0,0 +1,8859 @@
+/*-------------------------------------------------------------------------
+ *
+ * unicode_norm_table.h
+ * Composition table used for Unicode normalization
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/common/unicode_norm_table.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/*
+ * File auto-generated by src/common/unicode/generate-unicode_norm_table.pl,
+ * do not edit. There is deliberately not an #ifndef PG_UNICODE_NORM_TABLE_H
+ * here.
+ */
+typedef struct
+{
+ uint32 codepoint; /* Unicode codepoint */
+ uint8 comb_class; /* combining class of character */
+ uint8 dec_size_flags; /* size and flags of decomposition code list */
+ uint16 dec_index; /* index into UnicodeDecomp_codepoints, or the
+ * decomposition itself if DECOMP_INLINE */
+} pg_unicode_decomposition;
+
+#define DECOMP_NO_COMPOSE 0x80 /* don't use for re-composition */
+#define DECOMP_INLINE 0x40 /* decomposition is stored inline in dec_index */
+
+#define DECOMPOSITION_SIZE(x) ((x)->dec_size_flags & 0x3F)
+#define DECOMPOSITION_NO_COMPOSE(x) (((x)->dec_size_flags & DECOMP_NO_COMPOSE) != 0)
+#define DECOMPOSITION_IS_INLINE(x) (((x)->dec_size_flags & DECOMP_INLINE) != 0)
+
+/* Table of Unicode codepoints and their decompositions */
+static const pg_unicode_decomposition UnicodeDecompMain[6532] =
+{
+ {0x00A0, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x00A8, 0, 2 | DECOMP_NO_COMPOSE, 0}, /* compatibility mapping */
+ {0x00AA, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x00AF, 0, 2 | DECOMP_NO_COMPOSE, 2}, /* compatibility mapping */
+ {0x00B2, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x00B3, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x00B4, 0, 2 | DECOMP_NO_COMPOSE, 4}, /* compatibility mapping */
+ {0x00B5, 0, 1 | DECOMP_INLINE, 0x03BC},
+ {0x00B8, 0, 2 | DECOMP_NO_COMPOSE, 6}, /* compatibility mapping */
+ {0x00B9, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x00BA, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x00BC, 0, 3, 8},
+ {0x00BD, 0, 3, 11},
+ {0x00BE, 0, 3, 14},
+ {0x00C0, 0, 2, 17},
+ {0x00C1, 0, 2, 19},
+ {0x00C2, 0, 2, 21},
+ {0x00C3, 0, 2, 23},
+ {0x00C4, 0, 2, 25},
+ {0x00C5, 0, 2, 27},
+ {0x00C7, 0, 2, 29},
+ {0x00C8, 0, 2, 31},
+ {0x00C9, 0, 2, 33},
+ {0x00CA, 0, 2, 35},
+ {0x00CB, 0, 2, 37},
+ {0x00CC, 0, 2, 39},
+ {0x00CD, 0, 2, 41},
+ {0x00CE, 0, 2, 43},
+ {0x00CF, 0, 2, 45},
+ {0x00D1, 0, 2, 47},
+ {0x00D2, 0, 2, 49},
+ {0x00D3, 0, 2, 51},
+ {0x00D4, 0, 2, 53},
+ {0x00D5, 0, 2, 55},
+ {0x00D6, 0, 2, 57},
+ {0x00D9, 0, 2, 59},
+ {0x00DA, 0, 2, 61},
+ {0x00DB, 0, 2, 63},
+ {0x00DC, 0, 2, 65},
+ {0x00DD, 0, 2, 67},
+ {0x00E0, 0, 2, 69},
+ {0x00E1, 0, 2, 71},
+ {0x00E2, 0, 2, 73},
+ {0x00E3, 0, 2, 75},
+ {0x00E4, 0, 2, 77},
+ {0x00E5, 0, 2, 79},
+ {0x00E7, 0, 2, 81},
+ {0x00E8, 0, 2, 83},
+ {0x00E9, 0, 2, 85},
+ {0x00EA, 0, 2, 87},
+ {0x00EB, 0, 2, 89},
+ {0x00EC, 0, 2, 91},
+ {0x00ED, 0, 2, 93},
+ {0x00EE, 0, 2, 95},
+ {0x00EF, 0, 2, 97},
+ {0x00F1, 0, 2, 99},
+ {0x00F2, 0, 2, 101},
+ {0x00F3, 0, 2, 103},
+ {0x00F4, 0, 2, 105},
+ {0x00F5, 0, 2, 107},
+ {0x00F6, 0, 2, 109},
+ {0x00F9, 0, 2, 111},
+ {0x00FA, 0, 2, 113},
+ {0x00FB, 0, 2, 115},
+ {0x00FC, 0, 2, 117},
+ {0x00FD, 0, 2, 119},
+ {0x00FF, 0, 2, 121},
+ {0x0100, 0, 2, 123},
+ {0x0101, 0, 2, 125},
+ {0x0102, 0, 2, 127},
+ {0x0103, 0, 2, 129},
+ {0x0104, 0, 2, 131},
+ {0x0105, 0, 2, 133},
+ {0x0106, 0, 2, 135},
+ {0x0107, 0, 2, 137},
+ {0x0108, 0, 2, 139},
+ {0x0109, 0, 2, 141},
+ {0x010A, 0, 2, 143},
+ {0x010B, 0, 2, 145},
+ {0x010C, 0, 2, 147},
+ {0x010D, 0, 2, 149},
+ {0x010E, 0, 2, 151},
+ {0x010F, 0, 2, 153},
+ {0x0112, 0, 2, 155},
+ {0x0113, 0, 2, 157},
+ {0x0114, 0, 2, 159},
+ {0x0115, 0, 2, 161},
+ {0x0116, 0, 2, 163},
+ {0x0117, 0, 2, 165},
+ {0x0118, 0, 2, 167},
+ {0x0119, 0, 2, 169},
+ {0x011A, 0, 2, 171},
+ {0x011B, 0, 2, 173},
+ {0x011C, 0, 2, 175},
+ {0x011D, 0, 2, 177},
+ {0x011E, 0, 2, 179},
+ {0x011F, 0, 2, 181},
+ {0x0120, 0, 2, 183},
+ {0x0121, 0, 2, 185},
+ {0x0122, 0, 2, 187},
+ {0x0123, 0, 2, 189},
+ {0x0124, 0, 2, 191},
+ {0x0125, 0, 2, 193},
+ {0x0128, 0, 2, 195},
+ {0x0129, 0, 2, 197},
+ {0x012A, 0, 2, 199},
+ {0x012B, 0, 2, 201},
+ {0x012C, 0, 2, 203},
+ {0x012D, 0, 2, 205},
+ {0x012E, 0, 2, 207},
+ {0x012F, 0, 2, 209},
+ {0x0130, 0, 2, 211},
+ {0x0132, 0, 2 | DECOMP_NO_COMPOSE, 213}, /* compatibility mapping */
+ {0x0133, 0, 2 | DECOMP_NO_COMPOSE, 215}, /* compatibility mapping */
+ {0x0134, 0, 2, 217},
+ {0x0135, 0, 2, 219},
+ {0x0136, 0, 2, 221},
+ {0x0137, 0, 2, 223},
+ {0x0139, 0, 2, 225},
+ {0x013A, 0, 2, 227},
+ {0x013B, 0, 2, 229},
+ {0x013C, 0, 2, 231},
+ {0x013D, 0, 2, 233},
+ {0x013E, 0, 2, 235},
+ {0x013F, 0, 2 | DECOMP_NO_COMPOSE, 237}, /* compatibility mapping */
+ {0x0140, 0, 2 | DECOMP_NO_COMPOSE, 239}, /* compatibility mapping */
+ {0x0143, 0, 2, 241},
+ {0x0144, 0, 2, 243},
+ {0x0145, 0, 2, 245},
+ {0x0146, 0, 2, 247},
+ {0x0147, 0, 2, 249},
+ {0x0148, 0, 2, 251},
+ {0x0149, 0, 2 | DECOMP_NO_COMPOSE, 253}, /* compatibility mapping */
+ {0x014C, 0, 2, 255},
+ {0x014D, 0, 2, 257},
+ {0x014E, 0, 2, 259},
+ {0x014F, 0, 2, 261},
+ {0x0150, 0, 2, 263},
+ {0x0151, 0, 2, 265},
+ {0x0154, 0, 2, 267},
+ {0x0155, 0, 2, 269},
+ {0x0156, 0, 2, 271},
+ {0x0157, 0, 2, 273},
+ {0x0158, 0, 2, 275},
+ {0x0159, 0, 2, 277},
+ {0x015A, 0, 2, 279},
+ {0x015B, 0, 2, 281},
+ {0x015C, 0, 2, 283},
+ {0x015D, 0, 2, 285},
+ {0x015E, 0, 2, 287},
+ {0x015F, 0, 2, 289},
+ {0x0160, 0, 2, 291},
+ {0x0161, 0, 2, 293},
+ {0x0162, 0, 2, 295},
+ {0x0163, 0, 2, 297},
+ {0x0164, 0, 2, 299},
+ {0x0165, 0, 2, 301},
+ {0x0168, 0, 2, 303},
+ {0x0169, 0, 2, 305},
+ {0x016A, 0, 2, 307},
+ {0x016B, 0, 2, 309},
+ {0x016C, 0, 2, 311},
+ {0x016D, 0, 2, 313},
+ {0x016E, 0, 2, 315},
+ {0x016F, 0, 2, 317},
+ {0x0170, 0, 2, 319},
+ {0x0171, 0, 2, 321},
+ {0x0172, 0, 2, 323},
+ {0x0173, 0, 2, 325},
+ {0x0174, 0, 2, 327},
+ {0x0175, 0, 2, 329},
+ {0x0176, 0, 2, 331},
+ {0x0177, 0, 2, 333},
+ {0x0178, 0, 2, 335},
+ {0x0179, 0, 2, 337},
+ {0x017A, 0, 2, 339},
+ {0x017B, 0, 2, 341},
+ {0x017C, 0, 2, 343},
+ {0x017D, 0, 2, 345},
+ {0x017E, 0, 2, 347},
+ {0x017F, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x01A0, 0, 2, 349},
+ {0x01A1, 0, 2, 351},
+ {0x01AF, 0, 2, 353},
+ {0x01B0, 0, 2, 355},
+ {0x01C4, 0, 2 | DECOMP_NO_COMPOSE, 357}, /* compatibility mapping */
+ {0x01C5, 0, 2 | DECOMP_NO_COMPOSE, 359}, /* compatibility mapping */
+ {0x01C6, 0, 2 | DECOMP_NO_COMPOSE, 361}, /* compatibility mapping */
+ {0x01C7, 0, 2 | DECOMP_NO_COMPOSE, 363}, /* compatibility mapping */
+ {0x01C8, 0, 2 | DECOMP_NO_COMPOSE, 365}, /* compatibility mapping */
+ {0x01C9, 0, 2 | DECOMP_NO_COMPOSE, 367}, /* compatibility mapping */
+ {0x01CA, 0, 2 | DECOMP_NO_COMPOSE, 369}, /* compatibility mapping */
+ {0x01CB, 0, 2 | DECOMP_NO_COMPOSE, 371}, /* compatibility mapping */
+ {0x01CC, 0, 2 | DECOMP_NO_COMPOSE, 373}, /* compatibility mapping */
+ {0x01CD, 0, 2, 375},
+ {0x01CE, 0, 2, 377},
+ {0x01CF, 0, 2, 379},
+ {0x01D0, 0, 2, 381},
+ {0x01D1, 0, 2, 383},
+ {0x01D2, 0, 2, 385},
+ {0x01D3, 0, 2, 387},
+ {0x01D4, 0, 2, 389},
+ {0x01D5, 0, 2, 391},
+ {0x01D6, 0, 2, 393},
+ {0x01D7, 0, 2, 395},
+ {0x01D8, 0, 2, 397},
+ {0x01D9, 0, 2, 399},
+ {0x01DA, 0, 2, 401},
+ {0x01DB, 0, 2, 403},
+ {0x01DC, 0, 2, 405},
+ {0x01DE, 0, 2, 407},
+ {0x01DF, 0, 2, 409},
+ {0x01E0, 0, 2, 411},
+ {0x01E1, 0, 2, 413},
+ {0x01E2, 0, 2, 415},
+ {0x01E3, 0, 2, 417},
+ {0x01E6, 0, 2, 419},
+ {0x01E7, 0, 2, 421},
+ {0x01E8, 0, 2, 423},
+ {0x01E9, 0, 2, 425},
+ {0x01EA, 0, 2, 427},
+ {0x01EB, 0, 2, 429},
+ {0x01EC, 0, 2, 431},
+ {0x01ED, 0, 2, 433},
+ {0x01EE, 0, 2, 435},
+ {0x01EF, 0, 2, 437},
+ {0x01F0, 0, 2, 439},
+ {0x01F1, 0, 2 | DECOMP_NO_COMPOSE, 441}, /* compatibility mapping */
+ {0x01F2, 0, 2 | DECOMP_NO_COMPOSE, 443}, /* compatibility mapping */
+ {0x01F3, 0, 2 | DECOMP_NO_COMPOSE, 445}, /* compatibility mapping */
+ {0x01F4, 0, 2, 447},
+ {0x01F5, 0, 2, 449},
+ {0x01F8, 0, 2, 451},
+ {0x01F9, 0, 2, 453},
+ {0x01FA, 0, 2, 455},
+ {0x01FB, 0, 2, 457},
+ {0x01FC, 0, 2, 459},
+ {0x01FD, 0, 2, 461},
+ {0x01FE, 0, 2, 463},
+ {0x01FF, 0, 2, 465},
+ {0x0200, 0, 2, 467},
+ {0x0201, 0, 2, 469},
+ {0x0202, 0, 2, 471},
+ {0x0203, 0, 2, 473},
+ {0x0204, 0, 2, 475},
+ {0x0205, 0, 2, 477},
+ {0x0206, 0, 2, 479},
+ {0x0207, 0, 2, 481},
+ {0x0208, 0, 2, 483},
+ {0x0209, 0, 2, 485},
+ {0x020A, 0, 2, 487},
+ {0x020B, 0, 2, 489},
+ {0x020C, 0, 2, 491},
+ {0x020D, 0, 2, 493},
+ {0x020E, 0, 2, 495},
+ {0x020F, 0, 2, 497},
+ {0x0210, 0, 2, 499},
+ {0x0211, 0, 2, 501},
+ {0x0212, 0, 2, 503},
+ {0x0213, 0, 2, 505},
+ {0x0214, 0, 2, 507},
+ {0x0215, 0, 2, 509},
+ {0x0216, 0, 2, 511},
+ {0x0217, 0, 2, 513},
+ {0x0218, 0, 2, 515},
+ {0x0219, 0, 2, 517},
+ {0x021A, 0, 2, 519},
+ {0x021B, 0, 2, 521},
+ {0x021E, 0, 2, 523},
+ {0x021F, 0, 2, 525},
+ {0x0226, 0, 2, 527},
+ {0x0227, 0, 2, 529},
+ {0x0228, 0, 2, 531},
+ {0x0229, 0, 2, 533},
+ {0x022A, 0, 2, 535},
+ {0x022B, 0, 2, 537},
+ {0x022C, 0, 2, 539},
+ {0x022D, 0, 2, 541},
+ {0x022E, 0, 2, 543},
+ {0x022F, 0, 2, 545},
+ {0x0230, 0, 2, 547},
+ {0x0231, 0, 2, 549},
+ {0x0232, 0, 2, 551},
+ {0x0233, 0, 2, 553},
+ {0x02B0, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x02B1, 0, 1 | DECOMP_INLINE, 0x0266},
+ {0x02B2, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x02B3, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x02B4, 0, 1 | DECOMP_INLINE, 0x0279},
+ {0x02B5, 0, 1 | DECOMP_INLINE, 0x027B},
+ {0x02B6, 0, 1 | DECOMP_INLINE, 0x0281},
+ {0x02B7, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x02B8, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x02D8, 0, 2 | DECOMP_NO_COMPOSE, 555}, /* compatibility mapping */
+ {0x02D9, 0, 2 | DECOMP_NO_COMPOSE, 557}, /* compatibility mapping */
+ {0x02DA, 0, 2 | DECOMP_NO_COMPOSE, 559}, /* compatibility mapping */
+ {0x02DB, 0, 2 | DECOMP_NO_COMPOSE, 561}, /* compatibility mapping */
+ {0x02DC, 0, 2 | DECOMP_NO_COMPOSE, 563}, /* compatibility mapping */
+ {0x02DD, 0, 2 | DECOMP_NO_COMPOSE, 565}, /* compatibility mapping */
+ {0x02E0, 0, 1 | DECOMP_INLINE, 0x0263},
+ {0x02E1, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x02E2, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x02E3, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x02E4, 0, 1 | DECOMP_INLINE, 0x0295},
+ {0x0300, 230, 0, 0},
+ {0x0301, 230, 0, 0},
+ {0x0302, 230, 0, 0},
+ {0x0303, 230, 0, 0},
+ {0x0304, 230, 0, 0},
+ {0x0305, 230, 0, 0},
+ {0x0306, 230, 0, 0},
+ {0x0307, 230, 0, 0},
+ {0x0308, 230, 0, 0},
+ {0x0309, 230, 0, 0},
+ {0x030A, 230, 0, 0},
+ {0x030B, 230, 0, 0},
+ {0x030C, 230, 0, 0},
+ {0x030D, 230, 0, 0},
+ {0x030E, 230, 0, 0},
+ {0x030F, 230, 0, 0},
+ {0x0310, 230, 0, 0},
+ {0x0311, 230, 0, 0},
+ {0x0312, 230, 0, 0},
+ {0x0313, 230, 0, 0},
+ {0x0314, 230, 0, 0},
+ {0x0315, 232, 0, 0},
+ {0x0316, 220, 0, 0},
+ {0x0317, 220, 0, 0},
+ {0x0318, 220, 0, 0},
+ {0x0319, 220, 0, 0},
+ {0x031A, 232, 0, 0},
+ {0x031B, 216, 0, 0},
+ {0x031C, 220, 0, 0},
+ {0x031D, 220, 0, 0},
+ {0x031E, 220, 0, 0},
+ {0x031F, 220, 0, 0},
+ {0x0320, 220, 0, 0},
+ {0x0321, 202, 0, 0},
+ {0x0322, 202, 0, 0},
+ {0x0323, 220, 0, 0},
+ {0x0324, 220, 0, 0},
+ {0x0325, 220, 0, 0},
+ {0x0326, 220, 0, 0},
+ {0x0327, 202, 0, 0},
+ {0x0328, 202, 0, 0},
+ {0x0329, 220, 0, 0},
+ {0x032A, 220, 0, 0},
+ {0x032B, 220, 0, 0},
+ {0x032C, 220, 0, 0},
+ {0x032D, 220, 0, 0},
+ {0x032E, 220, 0, 0},
+ {0x032F, 220, 0, 0},
+ {0x0330, 220, 0, 0},
+ {0x0331, 220, 0, 0},
+ {0x0332, 220, 0, 0},
+ {0x0333, 220, 0, 0},
+ {0x0334, 1, 0, 0},
+ {0x0335, 1, 0, 0},
+ {0x0336, 1, 0, 0},
+ {0x0337, 1, 0, 0},
+ {0x0338, 1, 0, 0},
+ {0x0339, 220, 0, 0},
+ {0x033A, 220, 0, 0},
+ {0x033B, 220, 0, 0},
+ {0x033C, 220, 0, 0},
+ {0x033D, 230, 0, 0},
+ {0x033E, 230, 0, 0},
+ {0x033F, 230, 0, 0},
+ {0x0340, 230, 1 | DECOMP_INLINE, 0x0300},
+ {0x0341, 230, 1 | DECOMP_INLINE, 0x0301},
+ {0x0342, 230, 0, 0},
+ {0x0343, 230, 1 | DECOMP_INLINE, 0x0313},
+ {0x0344, 230, 2 | DECOMP_NO_COMPOSE, 567}, /* non-starter decomposition */
+ {0x0345, 240, 0, 0},
+ {0x0346, 230, 0, 0},
+ {0x0347, 220, 0, 0},
+ {0x0348, 220, 0, 0},
+ {0x0349, 220, 0, 0},
+ {0x034A, 230, 0, 0},
+ {0x034B, 230, 0, 0},
+ {0x034C, 230, 0, 0},
+ {0x034D, 220, 0, 0},
+ {0x034E, 220, 0, 0},
+ {0x0350, 230, 0, 0},
+ {0x0351, 230, 0, 0},
+ {0x0352, 230, 0, 0},
+ {0x0353, 220, 0, 0},
+ {0x0354, 220, 0, 0},
+ {0x0355, 220, 0, 0},
+ {0x0356, 220, 0, 0},
+ {0x0357, 230, 0, 0},
+ {0x0358, 232, 0, 0},
+ {0x0359, 220, 0, 0},
+ {0x035A, 220, 0, 0},
+ {0x035B, 230, 0, 0},
+ {0x035C, 233, 0, 0},
+ {0x035D, 234, 0, 0},
+ {0x035E, 234, 0, 0},
+ {0x035F, 233, 0, 0},
+ {0x0360, 234, 0, 0},
+ {0x0361, 234, 0, 0},
+ {0x0362, 233, 0, 0},
+ {0x0363, 230, 0, 0},
+ {0x0364, 230, 0, 0},
+ {0x0365, 230, 0, 0},
+ {0x0366, 230, 0, 0},
+ {0x0367, 230, 0, 0},
+ {0x0368, 230, 0, 0},
+ {0x0369, 230, 0, 0},
+ {0x036A, 230, 0, 0},
+ {0x036B, 230, 0, 0},
+ {0x036C, 230, 0, 0},
+ {0x036D, 230, 0, 0},
+ {0x036E, 230, 0, 0},
+ {0x036F, 230, 0, 0},
+ {0x0374, 0, 1 | DECOMP_INLINE, 0x02B9},
+ {0x037A, 0, 2 | DECOMP_NO_COMPOSE, 569}, /* compatibility mapping */
+ {0x037E, 0, 1 | DECOMP_INLINE, 0x003B},
+ {0x0384, 0, 2 | DECOMP_NO_COMPOSE, 571}, /* compatibility mapping */
+ {0x0385, 0, 2, 573},
+ {0x0386, 0, 2, 575},
+ {0x0387, 0, 1 | DECOMP_INLINE, 0x00B7},
+ {0x0388, 0, 2, 577},
+ {0x0389, 0, 2, 579},
+ {0x038A, 0, 2, 581},
+ {0x038C, 0, 2, 583},
+ {0x038E, 0, 2, 585},
+ {0x038F, 0, 2, 587},
+ {0x0390, 0, 2, 589},
+ {0x03AA, 0, 2, 591},
+ {0x03AB, 0, 2, 593},
+ {0x03AC, 0, 2, 595},
+ {0x03AD, 0, 2, 597},
+ {0x03AE, 0, 2, 599},
+ {0x03AF, 0, 2, 601},
+ {0x03B0, 0, 2, 603},
+ {0x03CA, 0, 2, 605},
+ {0x03CB, 0, 2, 607},
+ {0x03CC, 0, 2, 609},
+ {0x03CD, 0, 2, 611},
+ {0x03CE, 0, 2, 613},
+ {0x03D0, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x03D1, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x03D2, 0, 1 | DECOMP_INLINE, 0x03A5},
+ {0x03D3, 0, 2, 615},
+ {0x03D4, 0, 2, 617},
+ {0x03D5, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x03D6, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x03F0, 0, 1 | DECOMP_INLINE, 0x03BA},
+ {0x03F1, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x03F2, 0, 1 | DECOMP_INLINE, 0x03C2},
+ {0x03F4, 0, 1 | DECOMP_INLINE, 0x0398},
+ {0x03F5, 0, 1 | DECOMP_INLINE, 0x03B5},
+ {0x03F9, 0, 1 | DECOMP_INLINE, 0x03A3},
+ {0x0400, 0, 2, 619},
+ {0x0401, 0, 2, 621},
+ {0x0403, 0, 2, 623},
+ {0x0407, 0, 2, 625},
+ {0x040C, 0, 2, 627},
+ {0x040D, 0, 2, 629},
+ {0x040E, 0, 2, 631},
+ {0x0419, 0, 2, 633},
+ {0x0439, 0, 2, 635},
+ {0x0450, 0, 2, 637},
+ {0x0451, 0, 2, 639},
+ {0x0453, 0, 2, 641},
+ {0x0457, 0, 2, 643},
+ {0x045C, 0, 2, 645},
+ {0x045D, 0, 2, 647},
+ {0x045E, 0, 2, 649},
+ {0x0476, 0, 2, 651},
+ {0x0477, 0, 2, 653},
+ {0x0483, 230, 0, 0},
+ {0x0484, 230, 0, 0},
+ {0x0485, 230, 0, 0},
+ {0x0486, 230, 0, 0},
+ {0x0487, 230, 0, 0},
+ {0x04C1, 0, 2, 655},
+ {0x04C2, 0, 2, 657},
+ {0x04D0, 0, 2, 659},
+ {0x04D1, 0, 2, 661},
+ {0x04D2, 0, 2, 663},
+ {0x04D3, 0, 2, 665},
+ {0x04D6, 0, 2, 667},
+ {0x04D7, 0, 2, 669},
+ {0x04DA, 0, 2, 671},
+ {0x04DB, 0, 2, 673},
+ {0x04DC, 0, 2, 675},
+ {0x04DD, 0, 2, 677},
+ {0x04DE, 0, 2, 679},
+ {0x04DF, 0, 2, 681},
+ {0x04E2, 0, 2, 683},
+ {0x04E3, 0, 2, 685},
+ {0x04E4, 0, 2, 687},
+ {0x04E5, 0, 2, 689},
+ {0x04E6, 0, 2, 691},
+ {0x04E7, 0, 2, 693},
+ {0x04EA, 0, 2, 695},
+ {0x04EB, 0, 2, 697},
+ {0x04EC, 0, 2, 699},
+ {0x04ED, 0, 2, 701},
+ {0x04EE, 0, 2, 703},
+ {0x04EF, 0, 2, 705},
+ {0x04F0, 0, 2, 707},
+ {0x04F1, 0, 2, 709},
+ {0x04F2, 0, 2, 711},
+ {0x04F3, 0, 2, 713},
+ {0x04F4, 0, 2, 715},
+ {0x04F5, 0, 2, 717},
+ {0x04F8, 0, 2, 719},
+ {0x04F9, 0, 2, 721},
+ {0x0587, 0, 2 | DECOMP_NO_COMPOSE, 723}, /* compatibility mapping */
+ {0x0591, 220, 0, 0},
+ {0x0592, 230, 0, 0},
+ {0x0593, 230, 0, 0},
+ {0x0594, 230, 0, 0},
+ {0x0595, 230, 0, 0},
+ {0x0596, 220, 0, 0},
+ {0x0597, 230, 0, 0},
+ {0x0598, 230, 0, 0},
+ {0x0599, 230, 0, 0},
+ {0x059A, 222, 0, 0},
+ {0x059B, 220, 0, 0},
+ {0x059C, 230, 0, 0},
+ {0x059D, 230, 0, 0},
+ {0x059E, 230, 0, 0},
+ {0x059F, 230, 0, 0},
+ {0x05A0, 230, 0, 0},
+ {0x05A1, 230, 0, 0},
+ {0x05A2, 220, 0, 0},
+ {0x05A3, 220, 0, 0},
+ {0x05A4, 220, 0, 0},
+ {0x05A5, 220, 0, 0},
+ {0x05A6, 220, 0, 0},
+ {0x05A7, 220, 0, 0},
+ {0x05A8, 230, 0, 0},
+ {0x05A9, 230, 0, 0},
+ {0x05AA, 220, 0, 0},
+ {0x05AB, 230, 0, 0},
+ {0x05AC, 230, 0, 0},
+ {0x05AD, 222, 0, 0},
+ {0x05AE, 228, 0, 0},
+ {0x05AF, 230, 0, 0},
+ {0x05B0, 10, 0, 0},
+ {0x05B1, 11, 0, 0},
+ {0x05B2, 12, 0, 0},
+ {0x05B3, 13, 0, 0},
+ {0x05B4, 14, 0, 0},
+ {0x05B5, 15, 0, 0},
+ {0x05B6, 16, 0, 0},
+ {0x05B7, 17, 0, 0},
+ {0x05B8, 18, 0, 0},
+ {0x05B9, 19, 0, 0},
+ {0x05BA, 19, 0, 0},
+ {0x05BB, 20, 0, 0},
+ {0x05BC, 21, 0, 0},
+ {0x05BD, 22, 0, 0},
+ {0x05BF, 23, 0, 0},
+ {0x05C1, 24, 0, 0},
+ {0x05C2, 25, 0, 0},
+ {0x05C4, 230, 0, 0},
+ {0x05C5, 220, 0, 0},
+ {0x05C7, 18, 0, 0},
+ {0x0610, 230, 0, 0},
+ {0x0611, 230, 0, 0},
+ {0x0612, 230, 0, 0},
+ {0x0613, 230, 0, 0},
+ {0x0614, 230, 0, 0},
+ {0x0615, 230, 0, 0},
+ {0x0616, 230, 0, 0},
+ {0x0617, 230, 0, 0},
+ {0x0618, 30, 0, 0},
+ {0x0619, 31, 0, 0},
+ {0x061A, 32, 0, 0},
+ {0x0622, 0, 2, 725},
+ {0x0623, 0, 2, 727},
+ {0x0624, 0, 2, 729},
+ {0x0625, 0, 2, 731},
+ {0x0626, 0, 2, 733},
+ {0x064B, 27, 0, 0},
+ {0x064C, 28, 0, 0},
+ {0x064D, 29, 0, 0},
+ {0x064E, 30, 0, 0},
+ {0x064F, 31, 0, 0},
+ {0x0650, 32, 0, 0},
+ {0x0651, 33, 0, 0},
+ {0x0652, 34, 0, 0},
+ {0x0653, 230, 0, 0},
+ {0x0654, 230, 0, 0},
+ {0x0655, 220, 0, 0},
+ {0x0656, 220, 0, 0},
+ {0x0657, 230, 0, 0},
+ {0x0658, 230, 0, 0},
+ {0x0659, 230, 0, 0},
+ {0x065A, 230, 0, 0},
+ {0x065B, 230, 0, 0},
+ {0x065C, 220, 0, 0},
+ {0x065D, 230, 0, 0},
+ {0x065E, 230, 0, 0},
+ {0x065F, 220, 0, 0},
+ {0x0670, 35, 0, 0},
+ {0x0675, 0, 2 | DECOMP_NO_COMPOSE, 735}, /* compatibility mapping */
+ {0x0676, 0, 2 | DECOMP_NO_COMPOSE, 737}, /* compatibility mapping */
+ {0x0677, 0, 2 | DECOMP_NO_COMPOSE, 739}, /* compatibility mapping */
+ {0x0678, 0, 2 | DECOMP_NO_COMPOSE, 741}, /* compatibility mapping */
+ {0x06C0, 0, 2, 743},
+ {0x06C2, 0, 2, 745},
+ {0x06D3, 0, 2, 747},
+ {0x06D6, 230, 0, 0},
+ {0x06D7, 230, 0, 0},
+ {0x06D8, 230, 0, 0},
+ {0x06D9, 230, 0, 0},
+ {0x06DA, 230, 0, 0},
+ {0x06DB, 230, 0, 0},
+ {0x06DC, 230, 0, 0},
+ {0x06DF, 230, 0, 0},
+ {0x06E0, 230, 0, 0},
+ {0x06E1, 230, 0, 0},
+ {0x06E2, 230, 0, 0},
+ {0x06E3, 220, 0, 0},
+ {0x06E4, 230, 0, 0},
+ {0x06E7, 230, 0, 0},
+ {0x06E8, 230, 0, 0},
+ {0x06EA, 220, 0, 0},
+ {0x06EB, 230, 0, 0},
+ {0x06EC, 230, 0, 0},
+ {0x06ED, 220, 0, 0},
+ {0x0711, 36, 0, 0},
+ {0x0730, 230, 0, 0},
+ {0x0731, 220, 0, 0},
+ {0x0732, 230, 0, 0},
+ {0x0733, 230, 0, 0},
+ {0x0734, 220, 0, 0},
+ {0x0735, 230, 0, 0},
+ {0x0736, 230, 0, 0},
+ {0x0737, 220, 0, 0},
+ {0x0738, 220, 0, 0},
+ {0x0739, 220, 0, 0},
+ {0x073A, 230, 0, 0},
+ {0x073B, 220, 0, 0},
+ {0x073C, 220, 0, 0},
+ {0x073D, 230, 0, 0},
+ {0x073E, 220, 0, 0},
+ {0x073F, 230, 0, 0},
+ {0x0740, 230, 0, 0},
+ {0x0741, 230, 0, 0},
+ {0x0742, 220, 0, 0},
+ {0x0743, 230, 0, 0},
+ {0x0744, 220, 0, 0},
+ {0x0745, 230, 0, 0},
+ {0x0746, 220, 0, 0},
+ {0x0747, 230, 0, 0},
+ {0x0748, 220, 0, 0},
+ {0x0749, 230, 0, 0},
+ {0x074A, 230, 0, 0},
+ {0x07EB, 230, 0, 0},
+ {0x07EC, 230, 0, 0},
+ {0x07ED, 230, 0, 0},
+ {0x07EE, 230, 0, 0},
+ {0x07EF, 230, 0, 0},
+ {0x07F0, 230, 0, 0},
+ {0x07F1, 230, 0, 0},
+ {0x07F2, 220, 0, 0},
+ {0x07F3, 230, 0, 0},
+ {0x0816, 230, 0, 0},
+ {0x0817, 230, 0, 0},
+ {0x0818, 230, 0, 0},
+ {0x0819, 230, 0, 0},
+ {0x081B, 230, 0, 0},
+ {0x081C, 230, 0, 0},
+ {0x081D, 230, 0, 0},
+ {0x081E, 230, 0, 0},
+ {0x081F, 230, 0, 0},
+ {0x0820, 230, 0, 0},
+ {0x0821, 230, 0, 0},
+ {0x0822, 230, 0, 0},
+ {0x0823, 230, 0, 0},
+ {0x0825, 230, 0, 0},
+ {0x0826, 230, 0, 0},
+ {0x0827, 230, 0, 0},
+ {0x0829, 230, 0, 0},
+ {0x082A, 230, 0, 0},
+ {0x082B, 230, 0, 0},
+ {0x082C, 230, 0, 0},
+ {0x082D, 230, 0, 0},
+ {0x0859, 220, 0, 0},
+ {0x085A, 220, 0, 0},
+ {0x085B, 220, 0, 0},
+ {0x08D4, 230, 0, 0},
+ {0x08D5, 230, 0, 0},
+ {0x08D6, 230, 0, 0},
+ {0x08D7, 230, 0, 0},
+ {0x08D8, 230, 0, 0},
+ {0x08D9, 230, 0, 0},
+ {0x08DA, 230, 0, 0},
+ {0x08DB, 230, 0, 0},
+ {0x08DC, 230, 0, 0},
+ {0x08DD, 230, 0, 0},
+ {0x08DE, 230, 0, 0},
+ {0x08DF, 230, 0, 0},
+ {0x08E0, 230, 0, 0},
+ {0x08E1, 230, 0, 0},
+ {0x08E3, 220, 0, 0},
+ {0x08E4, 230, 0, 0},
+ {0x08E5, 230, 0, 0},
+ {0x08E6, 220, 0, 0},
+ {0x08E7, 230, 0, 0},
+ {0x08E8, 230, 0, 0},
+ {0x08E9, 220, 0, 0},
+ {0x08EA, 230, 0, 0},
+ {0x08EB, 230, 0, 0},
+ {0x08EC, 230, 0, 0},
+ {0x08ED, 220, 0, 0},
+ {0x08EE, 220, 0, 0},
+ {0x08EF, 220, 0, 0},
+ {0x08F0, 27, 0, 0},
+ {0x08F1, 28, 0, 0},
+ {0x08F2, 29, 0, 0},
+ {0x08F3, 230, 0, 0},
+ {0x08F4, 230, 0, 0},
+ {0x08F5, 230, 0, 0},
+ {0x08F6, 220, 0, 0},
+ {0x08F7, 230, 0, 0},
+ {0x08F8, 230, 0, 0},
+ {0x08F9, 220, 0, 0},
+ {0x08FA, 220, 0, 0},
+ {0x08FB, 230, 0, 0},
+ {0x08FC, 230, 0, 0},
+ {0x08FD, 230, 0, 0},
+ {0x08FE, 230, 0, 0},
+ {0x08FF, 230, 0, 0},
+ {0x0929, 0, 2, 749},
+ {0x0931, 0, 2, 751},
+ {0x0934, 0, 2, 753},
+ {0x093C, 7, 0, 0},
+ {0x094D, 9, 0, 0},
+ {0x0951, 230, 0, 0},
+ {0x0952, 220, 0, 0},
+ {0x0953, 230, 0, 0},
+ {0x0954, 230, 0, 0},
+ {0x0958, 0, 2 | DECOMP_NO_COMPOSE, 755}, /* in exclusion list */
+ {0x0959, 0, 2 | DECOMP_NO_COMPOSE, 757}, /* in exclusion list */
+ {0x095A, 0, 2 | DECOMP_NO_COMPOSE, 759}, /* in exclusion list */
+ {0x095B, 0, 2 | DECOMP_NO_COMPOSE, 761}, /* in exclusion list */
+ {0x095C, 0, 2 | DECOMP_NO_COMPOSE, 763}, /* in exclusion list */
+ {0x095D, 0, 2 | DECOMP_NO_COMPOSE, 765}, /* in exclusion list */
+ {0x095E, 0, 2 | DECOMP_NO_COMPOSE, 767}, /* in exclusion list */
+ {0x095F, 0, 2 | DECOMP_NO_COMPOSE, 769}, /* in exclusion list */
+ {0x09BC, 7, 0, 0},
+ {0x09CB, 0, 2, 771},
+ {0x09CC, 0, 2, 773},
+ {0x09CD, 9, 0, 0},
+ {0x09DC, 0, 2 | DECOMP_NO_COMPOSE, 775}, /* in exclusion list */
+ {0x09DD, 0, 2 | DECOMP_NO_COMPOSE, 777}, /* in exclusion list */
+ {0x09DF, 0, 2 | DECOMP_NO_COMPOSE, 779}, /* in exclusion list */
+ {0x0A33, 0, 2 | DECOMP_NO_COMPOSE, 781}, /* in exclusion list */
+ {0x0A36, 0, 2 | DECOMP_NO_COMPOSE, 783}, /* in exclusion list */
+ {0x0A3C, 7, 0, 0},
+ {0x0A4D, 9, 0, 0},
+ {0x0A59, 0, 2 | DECOMP_NO_COMPOSE, 785}, /* in exclusion list */
+ {0x0A5A, 0, 2 | DECOMP_NO_COMPOSE, 787}, /* in exclusion list */
+ {0x0A5B, 0, 2 | DECOMP_NO_COMPOSE, 789}, /* in exclusion list */
+ {0x0A5E, 0, 2 | DECOMP_NO_COMPOSE, 791}, /* in exclusion list */
+ {0x0ABC, 7, 0, 0},
+ {0x0ACD, 9, 0, 0},
+ {0x0B3C, 7, 0, 0},
+ {0x0B48, 0, 2, 793},
+ {0x0B4B, 0, 2, 795},
+ {0x0B4C, 0, 2, 797},
+ {0x0B4D, 9, 0, 0},
+ {0x0B5C, 0, 2 | DECOMP_NO_COMPOSE, 799}, /* in exclusion list */
+ {0x0B5D, 0, 2 | DECOMP_NO_COMPOSE, 801}, /* in exclusion list */
+ {0x0B94, 0, 2, 803},
+ {0x0BCA, 0, 2, 805},
+ {0x0BCB, 0, 2, 807},
+ {0x0BCC, 0, 2, 809},
+ {0x0BCD, 9, 0, 0},
+ {0x0C48, 0, 2, 811},
+ {0x0C4D, 9, 0, 0},
+ {0x0C55, 84, 0, 0},
+ {0x0C56, 91, 0, 0},
+ {0x0CBC, 7, 0, 0},
+ {0x0CC0, 0, 2, 813},
+ {0x0CC7, 0, 2, 815},
+ {0x0CC8, 0, 2, 817},
+ {0x0CCA, 0, 2, 819},
+ {0x0CCB, 0, 2, 821},
+ {0x0CCD, 9, 0, 0},
+ {0x0D4A, 0, 2, 823},
+ {0x0D4B, 0, 2, 825},
+ {0x0D4C, 0, 2, 827},
+ {0x0D4D, 9, 0, 0},
+ {0x0DCA, 9, 0, 0},
+ {0x0DDA, 0, 2, 829},
+ {0x0DDC, 0, 2, 831},
+ {0x0DDD, 0, 2, 833},
+ {0x0DDE, 0, 2, 835},
+ {0x0E33, 0, 2 | DECOMP_NO_COMPOSE, 837}, /* compatibility mapping */
+ {0x0E38, 103, 0, 0},
+ {0x0E39, 103, 0, 0},
+ {0x0E3A, 9, 0, 0},
+ {0x0E48, 107, 0, 0},
+ {0x0E49, 107, 0, 0},
+ {0x0E4A, 107, 0, 0},
+ {0x0E4B, 107, 0, 0},
+ {0x0EB3, 0, 2 | DECOMP_NO_COMPOSE, 839}, /* compatibility mapping */
+ {0x0EB8, 118, 0, 0},
+ {0x0EB9, 118, 0, 0},
+ {0x0EC8, 122, 0, 0},
+ {0x0EC9, 122, 0, 0},
+ {0x0ECA, 122, 0, 0},
+ {0x0ECB, 122, 0, 0},
+ {0x0EDC, 0, 2 | DECOMP_NO_COMPOSE, 841}, /* compatibility mapping */
+ {0x0EDD, 0, 2 | DECOMP_NO_COMPOSE, 843}, /* compatibility mapping */
+ {0x0F0C, 0, 1 | DECOMP_INLINE, 0x0F0B},
+ {0x0F18, 220, 0, 0},
+ {0x0F19, 220, 0, 0},
+ {0x0F35, 220, 0, 0},
+ {0x0F37, 220, 0, 0},
+ {0x0F39, 216, 0, 0},
+ {0x0F43, 0, 2 | DECOMP_NO_COMPOSE, 845}, /* in exclusion list */
+ {0x0F4D, 0, 2 | DECOMP_NO_COMPOSE, 847}, /* in exclusion list */
+ {0x0F52, 0, 2 | DECOMP_NO_COMPOSE, 849}, /* in exclusion list */
+ {0x0F57, 0, 2 | DECOMP_NO_COMPOSE, 851}, /* in exclusion list */
+ {0x0F5C, 0, 2 | DECOMP_NO_COMPOSE, 853}, /* in exclusion list */
+ {0x0F69, 0, 2 | DECOMP_NO_COMPOSE, 855}, /* in exclusion list */
+ {0x0F71, 129, 0, 0},
+ {0x0F72, 130, 0, 0},
+ {0x0F73, 0, 2 | DECOMP_NO_COMPOSE, 857}, /* non-starter decomposition */
+ {0x0F74, 132, 0, 0},
+ {0x0F75, 0, 2 | DECOMP_NO_COMPOSE, 859}, /* non-starter decomposition */
+ {0x0F76, 0, 2 | DECOMP_NO_COMPOSE, 861}, /* in exclusion list */
+ {0x0F77, 0, 2 | DECOMP_NO_COMPOSE, 863}, /* compatibility mapping */
+ {0x0F78, 0, 2 | DECOMP_NO_COMPOSE, 865}, /* in exclusion list */
+ {0x0F79, 0, 2 | DECOMP_NO_COMPOSE, 867}, /* compatibility mapping */
+ {0x0F7A, 130, 0, 0},
+ {0x0F7B, 130, 0, 0},
+ {0x0F7C, 130, 0, 0},
+ {0x0F7D, 130, 0, 0},
+ {0x0F80, 130, 0, 0},
+ {0x0F81, 0, 2 | DECOMP_NO_COMPOSE, 869}, /* non-starter decomposition */
+ {0x0F82, 230, 0, 0},
+ {0x0F83, 230, 0, 0},
+ {0x0F84, 9, 0, 0},
+ {0x0F86, 230, 0, 0},
+ {0x0F87, 230, 0, 0},
+ {0x0F93, 0, 2 | DECOMP_NO_COMPOSE, 871}, /* in exclusion list */
+ {0x0F9D, 0, 2 | DECOMP_NO_COMPOSE, 873}, /* in exclusion list */
+ {0x0FA2, 0, 2 | DECOMP_NO_COMPOSE, 875}, /* in exclusion list */
+ {0x0FA7, 0, 2 | DECOMP_NO_COMPOSE, 877}, /* in exclusion list */
+ {0x0FAC, 0, 2 | DECOMP_NO_COMPOSE, 879}, /* in exclusion list */
+ {0x0FB9, 0, 2 | DECOMP_NO_COMPOSE, 881}, /* in exclusion list */
+ {0x0FC6, 220, 0, 0},
+ {0x1026, 0, 2, 883},
+ {0x1037, 7, 0, 0},
+ {0x1039, 9, 0, 0},
+ {0x103A, 9, 0, 0},
+ {0x108D, 220, 0, 0},
+ {0x10FC, 0, 1 | DECOMP_INLINE, 0x10DC},
+ {0x135D, 230, 0, 0},
+ {0x135E, 230, 0, 0},
+ {0x135F, 230, 0, 0},
+ {0x1714, 9, 0, 0},
+ {0x1734, 9, 0, 0},
+ {0x17D2, 9, 0, 0},
+ {0x17DD, 230, 0, 0},
+ {0x18A9, 228, 0, 0},
+ {0x1939, 222, 0, 0},
+ {0x193A, 230, 0, 0},
+ {0x193B, 220, 0, 0},
+ {0x1A17, 230, 0, 0},
+ {0x1A18, 220, 0, 0},
+ {0x1A60, 9, 0, 0},
+ {0x1A75, 230, 0, 0},
+ {0x1A76, 230, 0, 0},
+ {0x1A77, 230, 0, 0},
+ {0x1A78, 230, 0, 0},
+ {0x1A79, 230, 0, 0},
+ {0x1A7A, 230, 0, 0},
+ {0x1A7B, 230, 0, 0},
+ {0x1A7C, 230, 0, 0},
+ {0x1A7F, 220, 0, 0},
+ {0x1AB0, 230, 0, 0},
+ {0x1AB1, 230, 0, 0},
+ {0x1AB2, 230, 0, 0},
+ {0x1AB3, 230, 0, 0},
+ {0x1AB4, 230, 0, 0},
+ {0x1AB5, 220, 0, 0},
+ {0x1AB6, 220, 0, 0},
+ {0x1AB7, 220, 0, 0},
+ {0x1AB8, 220, 0, 0},
+ {0x1AB9, 220, 0, 0},
+ {0x1ABA, 220, 0, 0},
+ {0x1ABB, 230, 0, 0},
+ {0x1ABC, 230, 0, 0},
+ {0x1ABD, 220, 0, 0},
+ {0x1B06, 0, 2, 885},
+ {0x1B08, 0, 2, 887},
+ {0x1B0A, 0, 2, 889},
+ {0x1B0C, 0, 2, 891},
+ {0x1B0E, 0, 2, 893},
+ {0x1B12, 0, 2, 895},
+ {0x1B34, 7, 0, 0},
+ {0x1B3B, 0, 2, 897},
+ {0x1B3D, 0, 2, 899},
+ {0x1B40, 0, 2, 901},
+ {0x1B41, 0, 2, 903},
+ {0x1B43, 0, 2, 905},
+ {0x1B44, 9, 0, 0},
+ {0x1B6B, 230, 0, 0},
+ {0x1B6C, 220, 0, 0},
+ {0x1B6D, 230, 0, 0},
+ {0x1B6E, 230, 0, 0},
+ {0x1B6F, 230, 0, 0},
+ {0x1B70, 230, 0, 0},
+ {0x1B71, 230, 0, 0},
+ {0x1B72, 230, 0, 0},
+ {0x1B73, 230, 0, 0},
+ {0x1BAA, 9, 0, 0},
+ {0x1BAB, 9, 0, 0},
+ {0x1BE6, 7, 0, 0},
+ {0x1BF2, 9, 0, 0},
+ {0x1BF3, 9, 0, 0},
+ {0x1C37, 7, 0, 0},
+ {0x1CD0, 230, 0, 0},
+ {0x1CD1, 230, 0, 0},
+ {0x1CD2, 230, 0, 0},
+ {0x1CD4, 1, 0, 0},
+ {0x1CD5, 220, 0, 0},
+ {0x1CD6, 220, 0, 0},
+ {0x1CD7, 220, 0, 0},
+ {0x1CD8, 220, 0, 0},
+ {0x1CD9, 220, 0, 0},
+ {0x1CDA, 230, 0, 0},
+ {0x1CDB, 230, 0, 0},
+ {0x1CDC, 220, 0, 0},
+ {0x1CDD, 220, 0, 0},
+ {0x1CDE, 220, 0, 0},
+ {0x1CDF, 220, 0, 0},
+ {0x1CE0, 230, 0, 0},
+ {0x1CE2, 1, 0, 0},
+ {0x1CE3, 1, 0, 0},
+ {0x1CE4, 1, 0, 0},
+ {0x1CE5, 1, 0, 0},
+ {0x1CE6, 1, 0, 0},
+ {0x1CE7, 1, 0, 0},
+ {0x1CE8, 1, 0, 0},
+ {0x1CED, 220, 0, 0},
+ {0x1CF4, 230, 0, 0},
+ {0x1CF8, 230, 0, 0},
+ {0x1CF9, 230, 0, 0},
+ {0x1D2C, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D2D, 0, 1 | DECOMP_INLINE, 0x00C6},
+ {0x1D2E, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D30, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D31, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D32, 0, 1 | DECOMP_INLINE, 0x018E},
+ {0x1D33, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D34, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D35, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D36, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D37, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D38, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D39, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D3A, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D3C, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D3D, 0, 1 | DECOMP_INLINE, 0x0222},
+ {0x1D3E, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D3F, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D40, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D41, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D42, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D43, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D44, 0, 1 | DECOMP_INLINE, 0x0250},
+ {0x1D45, 0, 1 | DECOMP_INLINE, 0x0251},
+ {0x1D46, 0, 1 | DECOMP_INLINE, 0x1D02},
+ {0x1D47, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D48, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D49, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D4A, 0, 1 | DECOMP_INLINE, 0x0259},
+ {0x1D4B, 0, 1 | DECOMP_INLINE, 0x025B},
+ {0x1D4C, 0, 1 | DECOMP_INLINE, 0x025C},
+ {0x1D4D, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D4F, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D50, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D51, 0, 1 | DECOMP_INLINE, 0x014B},
+ {0x1D52, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D53, 0, 1 | DECOMP_INLINE, 0x0254},
+ {0x1D54, 0, 1 | DECOMP_INLINE, 0x1D16},
+ {0x1D55, 0, 1 | DECOMP_INLINE, 0x1D17},
+ {0x1D56, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D57, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D58, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D59, 0, 1 | DECOMP_INLINE, 0x1D1D},
+ {0x1D5A, 0, 1 | DECOMP_INLINE, 0x026F},
+ {0x1D5B, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D5C, 0, 1 | DECOMP_INLINE, 0x1D25},
+ {0x1D5D, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D5E, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D5F, 0, 1 | DECOMP_INLINE, 0x03B4},
+ {0x1D60, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D61, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D62, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D63, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D64, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D65, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D66, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D67, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D68, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x1D69, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D6A, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D78, 0, 1 | DECOMP_INLINE, 0x043D},
+ {0x1D9B, 0, 1 | DECOMP_INLINE, 0x0252},
+ {0x1D9C, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D9D, 0, 1 | DECOMP_INLINE, 0x0255},
+ {0x1D9E, 0, 1 | DECOMP_INLINE, 0x00F0},
+ {0x1D9F, 0, 1 | DECOMP_INLINE, 0x025C},
+ {0x1DA0, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1DA1, 0, 1 | DECOMP_INLINE, 0x025F},
+ {0x1DA2, 0, 1 | DECOMP_INLINE, 0x0261},
+ {0x1DA3, 0, 1 | DECOMP_INLINE, 0x0265},
+ {0x1DA4, 0, 1 | DECOMP_INLINE, 0x0268},
+ {0x1DA5, 0, 1 | DECOMP_INLINE, 0x0269},
+ {0x1DA6, 0, 1 | DECOMP_INLINE, 0x026A},
+ {0x1DA7, 0, 1 | DECOMP_INLINE, 0x1D7B},
+ {0x1DA8, 0, 1 | DECOMP_INLINE, 0x029D},
+ {0x1DA9, 0, 1 | DECOMP_INLINE, 0x026D},
+ {0x1DAA, 0, 1 | DECOMP_INLINE, 0x1D85},
+ {0x1DAB, 0, 1 | DECOMP_INLINE, 0x029F},
+ {0x1DAC, 0, 1 | DECOMP_INLINE, 0x0271},
+ {0x1DAD, 0, 1 | DECOMP_INLINE, 0x0270},
+ {0x1DAE, 0, 1 | DECOMP_INLINE, 0x0272},
+ {0x1DAF, 0, 1 | DECOMP_INLINE, 0x0273},
+ {0x1DB0, 0, 1 | DECOMP_INLINE, 0x0274},
+ {0x1DB1, 0, 1 | DECOMP_INLINE, 0x0275},
+ {0x1DB2, 0, 1 | DECOMP_INLINE, 0x0278},
+ {0x1DB3, 0, 1 | DECOMP_INLINE, 0x0282},
+ {0x1DB4, 0, 1 | DECOMP_INLINE, 0x0283},
+ {0x1DB5, 0, 1 | DECOMP_INLINE, 0x01AB},
+ {0x1DB6, 0, 1 | DECOMP_INLINE, 0x0289},
+ {0x1DB7, 0, 1 | DECOMP_INLINE, 0x028A},
+ {0x1DB8, 0, 1 | DECOMP_INLINE, 0x1D1C},
+ {0x1DB9, 0, 1 | DECOMP_INLINE, 0x028B},
+ {0x1DBA, 0, 1 | DECOMP_INLINE, 0x028C},
+ {0x1DBB, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1DBC, 0, 1 | DECOMP_INLINE, 0x0290},
+ {0x1DBD, 0, 1 | DECOMP_INLINE, 0x0291},
+ {0x1DBE, 0, 1 | DECOMP_INLINE, 0x0292},
+ {0x1DBF, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x1DC0, 230, 0, 0},
+ {0x1DC1, 230, 0, 0},
+ {0x1DC2, 220, 0, 0},
+ {0x1DC3, 230, 0, 0},
+ {0x1DC4, 230, 0, 0},
+ {0x1DC5, 230, 0, 0},
+ {0x1DC6, 230, 0, 0},
+ {0x1DC7, 230, 0, 0},
+ {0x1DC8, 230, 0, 0},
+ {0x1DC9, 230, 0, 0},
+ {0x1DCA, 220, 0, 0},
+ {0x1DCB, 230, 0, 0},
+ {0x1DCC, 230, 0, 0},
+ {0x1DCD, 234, 0, 0},
+ {0x1DCE, 214, 0, 0},
+ {0x1DCF, 220, 0, 0},
+ {0x1DD0, 202, 0, 0},
+ {0x1DD1, 230, 0, 0},
+ {0x1DD2, 230, 0, 0},
+ {0x1DD3, 230, 0, 0},
+ {0x1DD4, 230, 0, 0},
+ {0x1DD5, 230, 0, 0},
+ {0x1DD6, 230, 0, 0},
+ {0x1DD7, 230, 0, 0},
+ {0x1DD8, 230, 0, 0},
+ {0x1DD9, 230, 0, 0},
+ {0x1DDA, 230, 0, 0},
+ {0x1DDB, 230, 0, 0},
+ {0x1DDC, 230, 0, 0},
+ {0x1DDD, 230, 0, 0},
+ {0x1DDE, 230, 0, 0},
+ {0x1DDF, 230, 0, 0},
+ {0x1DE0, 230, 0, 0},
+ {0x1DE1, 230, 0, 0},
+ {0x1DE2, 230, 0, 0},
+ {0x1DE3, 230, 0, 0},
+ {0x1DE4, 230, 0, 0},
+ {0x1DE5, 230, 0, 0},
+ {0x1DE6, 230, 0, 0},
+ {0x1DE7, 230, 0, 0},
+ {0x1DE8, 230, 0, 0},
+ {0x1DE9, 230, 0, 0},
+ {0x1DEA, 230, 0, 0},
+ {0x1DEB, 230, 0, 0},
+ {0x1DEC, 230, 0, 0},
+ {0x1DED, 230, 0, 0},
+ {0x1DEE, 230, 0, 0},
+ {0x1DEF, 230, 0, 0},
+ {0x1DF0, 230, 0, 0},
+ {0x1DF1, 230, 0, 0},
+ {0x1DF2, 230, 0, 0},
+ {0x1DF3, 230, 0, 0},
+ {0x1DF4, 230, 0, 0},
+ {0x1DF5, 230, 0, 0},
+ {0x1DFB, 230, 0, 0},
+ {0x1DFC, 233, 0, 0},
+ {0x1DFD, 220, 0, 0},
+ {0x1DFE, 230, 0, 0},
+ {0x1DFF, 220, 0, 0},
+ {0x1E00, 0, 2, 907},
+ {0x1E01, 0, 2, 909},
+ {0x1E02, 0, 2, 911},
+ {0x1E03, 0, 2, 913},
+ {0x1E04, 0, 2, 915},
+ {0x1E05, 0, 2, 917},
+ {0x1E06, 0, 2, 919},
+ {0x1E07, 0, 2, 921},
+ {0x1E08, 0, 2, 923},
+ {0x1E09, 0, 2, 925},
+ {0x1E0A, 0, 2, 927},
+ {0x1E0B, 0, 2, 929},
+ {0x1E0C, 0, 2, 931},
+ {0x1E0D, 0, 2, 933},
+ {0x1E0E, 0, 2, 935},
+ {0x1E0F, 0, 2, 937},
+ {0x1E10, 0, 2, 939},
+ {0x1E11, 0, 2, 941},
+ {0x1E12, 0, 2, 943},
+ {0x1E13, 0, 2, 945},
+ {0x1E14, 0, 2, 947},
+ {0x1E15, 0, 2, 949},
+ {0x1E16, 0, 2, 951},
+ {0x1E17, 0, 2, 953},
+ {0x1E18, 0, 2, 955},
+ {0x1E19, 0, 2, 957},
+ {0x1E1A, 0, 2, 959},
+ {0x1E1B, 0, 2, 961},
+ {0x1E1C, 0, 2, 963},
+ {0x1E1D, 0, 2, 965},
+ {0x1E1E, 0, 2, 967},
+ {0x1E1F, 0, 2, 969},
+ {0x1E20, 0, 2, 971},
+ {0x1E21, 0, 2, 973},
+ {0x1E22, 0, 2, 975},
+ {0x1E23, 0, 2, 977},
+ {0x1E24, 0, 2, 979},
+ {0x1E25, 0, 2, 981},
+ {0x1E26, 0, 2, 983},
+ {0x1E27, 0, 2, 985},
+ {0x1E28, 0, 2, 987},
+ {0x1E29, 0, 2, 989},
+ {0x1E2A, 0, 2, 991},
+ {0x1E2B, 0, 2, 993},
+ {0x1E2C, 0, 2, 995},
+ {0x1E2D, 0, 2, 997},
+ {0x1E2E, 0, 2, 999},
+ {0x1E2F, 0, 2, 1001},
+ {0x1E30, 0, 2, 1003},
+ {0x1E31, 0, 2, 1005},
+ {0x1E32, 0, 2, 1007},
+ {0x1E33, 0, 2, 1009},
+ {0x1E34, 0, 2, 1011},
+ {0x1E35, 0, 2, 1013},
+ {0x1E36, 0, 2, 1015},
+ {0x1E37, 0, 2, 1017},
+ {0x1E38, 0, 2, 1019},
+ {0x1E39, 0, 2, 1021},
+ {0x1E3A, 0, 2, 1023},
+ {0x1E3B, 0, 2, 1025},
+ {0x1E3C, 0, 2, 1027},
+ {0x1E3D, 0, 2, 1029},
+ {0x1E3E, 0, 2, 1031},
+ {0x1E3F, 0, 2, 1033},
+ {0x1E40, 0, 2, 1035},
+ {0x1E41, 0, 2, 1037},
+ {0x1E42, 0, 2, 1039},
+ {0x1E43, 0, 2, 1041},
+ {0x1E44, 0, 2, 1043},
+ {0x1E45, 0, 2, 1045},
+ {0x1E46, 0, 2, 1047},
+ {0x1E47, 0, 2, 1049},
+ {0x1E48, 0, 2, 1051},
+ {0x1E49, 0, 2, 1053},
+ {0x1E4A, 0, 2, 1055},
+ {0x1E4B, 0, 2, 1057},
+ {0x1E4C, 0, 2, 1059},
+ {0x1E4D, 0, 2, 1061},
+ {0x1E4E, 0, 2, 1063},
+ {0x1E4F, 0, 2, 1065},
+ {0x1E50, 0, 2, 1067},
+ {0x1E51, 0, 2, 1069},
+ {0x1E52, 0, 2, 1071},
+ {0x1E53, 0, 2, 1073},
+ {0x1E54, 0, 2, 1075},
+ {0x1E55, 0, 2, 1077},
+ {0x1E56, 0, 2, 1079},
+ {0x1E57, 0, 2, 1081},
+ {0x1E58, 0, 2, 1083},
+ {0x1E59, 0, 2, 1085},
+ {0x1E5A, 0, 2, 1087},
+ {0x1E5B, 0, 2, 1089},
+ {0x1E5C, 0, 2, 1091},
+ {0x1E5D, 0, 2, 1093},
+ {0x1E5E, 0, 2, 1095},
+ {0x1E5F, 0, 2, 1097},
+ {0x1E60, 0, 2, 1099},
+ {0x1E61, 0, 2, 1101},
+ {0x1E62, 0, 2, 1103},
+ {0x1E63, 0, 2, 1105},
+ {0x1E64, 0, 2, 1107},
+ {0x1E65, 0, 2, 1109},
+ {0x1E66, 0, 2, 1111},
+ {0x1E67, 0, 2, 1113},
+ {0x1E68, 0, 2, 1115},
+ {0x1E69, 0, 2, 1117},
+ {0x1E6A, 0, 2, 1119},
+ {0x1E6B, 0, 2, 1121},
+ {0x1E6C, 0, 2, 1123},
+ {0x1E6D, 0, 2, 1125},
+ {0x1E6E, 0, 2, 1127},
+ {0x1E6F, 0, 2, 1129},
+ {0x1E70, 0, 2, 1131},
+ {0x1E71, 0, 2, 1133},
+ {0x1E72, 0, 2, 1135},
+ {0x1E73, 0, 2, 1137},
+ {0x1E74, 0, 2, 1139},
+ {0x1E75, 0, 2, 1141},
+ {0x1E76, 0, 2, 1143},
+ {0x1E77, 0, 2, 1145},
+ {0x1E78, 0, 2, 1147},
+ {0x1E79, 0, 2, 1149},
+ {0x1E7A, 0, 2, 1151},
+ {0x1E7B, 0, 2, 1153},
+ {0x1E7C, 0, 2, 1155},
+ {0x1E7D, 0, 2, 1157},
+ {0x1E7E, 0, 2, 1159},
+ {0x1E7F, 0, 2, 1161},
+ {0x1E80, 0, 2, 1163},
+ {0x1E81, 0, 2, 1165},
+ {0x1E82, 0, 2, 1167},
+ {0x1E83, 0, 2, 1169},
+ {0x1E84, 0, 2, 1171},
+ {0x1E85, 0, 2, 1173},
+ {0x1E86, 0, 2, 1175},
+ {0x1E87, 0, 2, 1177},
+ {0x1E88, 0, 2, 1179},
+ {0x1E89, 0, 2, 1181},
+ {0x1E8A, 0, 2, 1183},
+ {0x1E8B, 0, 2, 1185},
+ {0x1E8C, 0, 2, 1187},
+ {0x1E8D, 0, 2, 1189},
+ {0x1E8E, 0, 2, 1191},
+ {0x1E8F, 0, 2, 1193},
+ {0x1E90, 0, 2, 1195},
+ {0x1E91, 0, 2, 1197},
+ {0x1E92, 0, 2, 1199},
+ {0x1E93, 0, 2, 1201},
+ {0x1E94, 0, 2, 1203},
+ {0x1E95, 0, 2, 1205},
+ {0x1E96, 0, 2, 1207},
+ {0x1E97, 0, 2, 1209},
+ {0x1E98, 0, 2, 1211},
+ {0x1E99, 0, 2, 1213},
+ {0x1E9A, 0, 2 | DECOMP_NO_COMPOSE, 1215}, /* compatibility mapping */
+ {0x1E9B, 0, 2, 1217},
+ {0x1EA0, 0, 2, 1219},
+ {0x1EA1, 0, 2, 1221},
+ {0x1EA2, 0, 2, 1223},
+ {0x1EA3, 0, 2, 1225},
+ {0x1EA4, 0, 2, 1227},
+ {0x1EA5, 0, 2, 1229},
+ {0x1EA6, 0, 2, 1231},
+ {0x1EA7, 0, 2, 1233},
+ {0x1EA8, 0, 2, 1235},
+ {0x1EA9, 0, 2, 1237},
+ {0x1EAA, 0, 2, 1239},
+ {0x1EAB, 0, 2, 1241},
+ {0x1EAC, 0, 2, 1243},
+ {0x1EAD, 0, 2, 1245},
+ {0x1EAE, 0, 2, 1247},
+ {0x1EAF, 0, 2, 1249},
+ {0x1EB0, 0, 2, 1251},
+ {0x1EB1, 0, 2, 1253},
+ {0x1EB2, 0, 2, 1255},
+ {0x1EB3, 0, 2, 1257},
+ {0x1EB4, 0, 2, 1259},
+ {0x1EB5, 0, 2, 1261},
+ {0x1EB6, 0, 2, 1263},
+ {0x1EB7, 0, 2, 1265},
+ {0x1EB8, 0, 2, 1267},
+ {0x1EB9, 0, 2, 1269},
+ {0x1EBA, 0, 2, 1271},
+ {0x1EBB, 0, 2, 1273},
+ {0x1EBC, 0, 2, 1275},
+ {0x1EBD, 0, 2, 1277},
+ {0x1EBE, 0, 2, 1279},
+ {0x1EBF, 0, 2, 1281},
+ {0x1EC0, 0, 2, 1283},
+ {0x1EC1, 0, 2, 1285},
+ {0x1EC2, 0, 2, 1287},
+ {0x1EC3, 0, 2, 1289},
+ {0x1EC4, 0, 2, 1291},
+ {0x1EC5, 0, 2, 1293},
+ {0x1EC6, 0, 2, 1295},
+ {0x1EC7, 0, 2, 1297},
+ {0x1EC8, 0, 2, 1299},
+ {0x1EC9, 0, 2, 1301},
+ {0x1ECA, 0, 2, 1303},
+ {0x1ECB, 0, 2, 1305},
+ {0x1ECC, 0, 2, 1307},
+ {0x1ECD, 0, 2, 1309},
+ {0x1ECE, 0, 2, 1311},
+ {0x1ECF, 0, 2, 1313},
+ {0x1ED0, 0, 2, 1315},
+ {0x1ED1, 0, 2, 1317},
+ {0x1ED2, 0, 2, 1319},
+ {0x1ED3, 0, 2, 1321},
+ {0x1ED4, 0, 2, 1323},
+ {0x1ED5, 0, 2, 1325},
+ {0x1ED6, 0, 2, 1327},
+ {0x1ED7, 0, 2, 1329},
+ {0x1ED8, 0, 2, 1331},
+ {0x1ED9, 0, 2, 1333},
+ {0x1EDA, 0, 2, 1335},
+ {0x1EDB, 0, 2, 1337},
+ {0x1EDC, 0, 2, 1339},
+ {0x1EDD, 0, 2, 1341},
+ {0x1EDE, 0, 2, 1343},
+ {0x1EDF, 0, 2, 1345},
+ {0x1EE0, 0, 2, 1347},
+ {0x1EE1, 0, 2, 1349},
+ {0x1EE2, 0, 2, 1351},
+ {0x1EE3, 0, 2, 1353},
+ {0x1EE4, 0, 2, 1355},
+ {0x1EE5, 0, 2, 1357},
+ {0x1EE6, 0, 2, 1359},
+ {0x1EE7, 0, 2, 1361},
+ {0x1EE8, 0, 2, 1363},
+ {0x1EE9, 0, 2, 1365},
+ {0x1EEA, 0, 2, 1367},
+ {0x1EEB, 0, 2, 1369},
+ {0x1EEC, 0, 2, 1371},
+ {0x1EED, 0, 2, 1373},
+ {0x1EEE, 0, 2, 1375},
+ {0x1EEF, 0, 2, 1377},
+ {0x1EF0, 0, 2, 1379},
+ {0x1EF1, 0, 2, 1381},
+ {0x1EF2, 0, 2, 1383},
+ {0x1EF3, 0, 2, 1385},
+ {0x1EF4, 0, 2, 1387},
+ {0x1EF5, 0, 2, 1389},
+ {0x1EF6, 0, 2, 1391},
+ {0x1EF7, 0, 2, 1393},
+ {0x1EF8, 0, 2, 1395},
+ {0x1EF9, 0, 2, 1397},
+ {0x1F00, 0, 2, 1399},
+ {0x1F01, 0, 2, 1401},
+ {0x1F02, 0, 2, 1403},
+ {0x1F03, 0, 2, 1405},
+ {0x1F04, 0, 2, 1407},
+ {0x1F05, 0, 2, 1409},
+ {0x1F06, 0, 2, 1411},
+ {0x1F07, 0, 2, 1413},
+ {0x1F08, 0, 2, 1415},
+ {0x1F09, 0, 2, 1417},
+ {0x1F0A, 0, 2, 1419},
+ {0x1F0B, 0, 2, 1421},
+ {0x1F0C, 0, 2, 1423},
+ {0x1F0D, 0, 2, 1425},
+ {0x1F0E, 0, 2, 1427},
+ {0x1F0F, 0, 2, 1429},
+ {0x1F10, 0, 2, 1431},
+ {0x1F11, 0, 2, 1433},
+ {0x1F12, 0, 2, 1435},
+ {0x1F13, 0, 2, 1437},
+ {0x1F14, 0, 2, 1439},
+ {0x1F15, 0, 2, 1441},
+ {0x1F18, 0, 2, 1443},
+ {0x1F19, 0, 2, 1445},
+ {0x1F1A, 0, 2, 1447},
+ {0x1F1B, 0, 2, 1449},
+ {0x1F1C, 0, 2, 1451},
+ {0x1F1D, 0, 2, 1453},
+ {0x1F20, 0, 2, 1455},
+ {0x1F21, 0, 2, 1457},
+ {0x1F22, 0, 2, 1459},
+ {0x1F23, 0, 2, 1461},
+ {0x1F24, 0, 2, 1463},
+ {0x1F25, 0, 2, 1465},
+ {0x1F26, 0, 2, 1467},
+ {0x1F27, 0, 2, 1469},
+ {0x1F28, 0, 2, 1471},
+ {0x1F29, 0, 2, 1473},
+ {0x1F2A, 0, 2, 1475},
+ {0x1F2B, 0, 2, 1477},
+ {0x1F2C, 0, 2, 1479},
+ {0x1F2D, 0, 2, 1481},
+ {0x1F2E, 0, 2, 1483},
+ {0x1F2F, 0, 2, 1485},
+ {0x1F30, 0, 2, 1487},
+ {0x1F31, 0, 2, 1489},
+ {0x1F32, 0, 2, 1491},
+ {0x1F33, 0, 2, 1493},
+ {0x1F34, 0, 2, 1495},
+ {0x1F35, 0, 2, 1497},
+ {0x1F36, 0, 2, 1499},
+ {0x1F37, 0, 2, 1501},
+ {0x1F38, 0, 2, 1503},
+ {0x1F39, 0, 2, 1505},
+ {0x1F3A, 0, 2, 1507},
+ {0x1F3B, 0, 2, 1509},
+ {0x1F3C, 0, 2, 1511},
+ {0x1F3D, 0, 2, 1513},
+ {0x1F3E, 0, 2, 1515},
+ {0x1F3F, 0, 2, 1517},
+ {0x1F40, 0, 2, 1519},
+ {0x1F41, 0, 2, 1521},
+ {0x1F42, 0, 2, 1523},
+ {0x1F43, 0, 2, 1525},
+ {0x1F44, 0, 2, 1527},
+ {0x1F45, 0, 2, 1529},
+ {0x1F48, 0, 2, 1531},
+ {0x1F49, 0, 2, 1533},
+ {0x1F4A, 0, 2, 1535},
+ {0x1F4B, 0, 2, 1537},
+ {0x1F4C, 0, 2, 1539},
+ {0x1F4D, 0, 2, 1541},
+ {0x1F50, 0, 2, 1543},
+ {0x1F51, 0, 2, 1545},
+ {0x1F52, 0, 2, 1547},
+ {0x1F53, 0, 2, 1549},
+ {0x1F54, 0, 2, 1551},
+ {0x1F55, 0, 2, 1553},
+ {0x1F56, 0, 2, 1555},
+ {0x1F57, 0, 2, 1557},
+ {0x1F59, 0, 2, 1559},
+ {0x1F5B, 0, 2, 1561},
+ {0x1F5D, 0, 2, 1563},
+ {0x1F5F, 0, 2, 1565},
+ {0x1F60, 0, 2, 1567},
+ {0x1F61, 0, 2, 1569},
+ {0x1F62, 0, 2, 1571},
+ {0x1F63, 0, 2, 1573},
+ {0x1F64, 0, 2, 1575},
+ {0x1F65, 0, 2, 1577},
+ {0x1F66, 0, 2, 1579},
+ {0x1F67, 0, 2, 1581},
+ {0x1F68, 0, 2, 1583},
+ {0x1F69, 0, 2, 1585},
+ {0x1F6A, 0, 2, 1587},
+ {0x1F6B, 0, 2, 1589},
+ {0x1F6C, 0, 2, 1591},
+ {0x1F6D, 0, 2, 1593},
+ {0x1F6E, 0, 2, 1595},
+ {0x1F6F, 0, 2, 1597},
+ {0x1F70, 0, 2, 1599},
+ {0x1F71, 0, 1 | DECOMP_INLINE, 0x03AC},
+ {0x1F72, 0, 2, 1601},
+ {0x1F73, 0, 1 | DECOMP_INLINE, 0x03AD},
+ {0x1F74, 0, 2, 1603},
+ {0x1F75, 0, 1 | DECOMP_INLINE, 0x03AE},
+ {0x1F76, 0, 2, 1605},
+ {0x1F77, 0, 1 | DECOMP_INLINE, 0x03AF},
+ {0x1F78, 0, 2, 1607},
+ {0x1F79, 0, 1 | DECOMP_INLINE, 0x03CC},
+ {0x1F7A, 0, 2, 1609},
+ {0x1F7B, 0, 1 | DECOMP_INLINE, 0x03CD},
+ {0x1F7C, 0, 2, 1611},
+ {0x1F7D, 0, 1 | DECOMP_INLINE, 0x03CE},
+ {0x1F80, 0, 2, 1613},
+ {0x1F81, 0, 2, 1615},
+ {0x1F82, 0, 2, 1617},
+ {0x1F83, 0, 2, 1619},
+ {0x1F84, 0, 2, 1621},
+ {0x1F85, 0, 2, 1623},
+ {0x1F86, 0, 2, 1625},
+ {0x1F87, 0, 2, 1627},
+ {0x1F88, 0, 2, 1629},
+ {0x1F89, 0, 2, 1631},
+ {0x1F8A, 0, 2, 1633},
+ {0x1F8B, 0, 2, 1635},
+ {0x1F8C, 0, 2, 1637},
+ {0x1F8D, 0, 2, 1639},
+ {0x1F8E, 0, 2, 1641},
+ {0x1F8F, 0, 2, 1643},
+ {0x1F90, 0, 2, 1645},
+ {0x1F91, 0, 2, 1647},
+ {0x1F92, 0, 2, 1649},
+ {0x1F93, 0, 2, 1651},
+ {0x1F94, 0, 2, 1653},
+ {0x1F95, 0, 2, 1655},
+ {0x1F96, 0, 2, 1657},
+ {0x1F97, 0, 2, 1659},
+ {0x1F98, 0, 2, 1661},
+ {0x1F99, 0, 2, 1663},
+ {0x1F9A, 0, 2, 1665},
+ {0x1F9B, 0, 2, 1667},
+ {0x1F9C, 0, 2, 1669},
+ {0x1F9D, 0, 2, 1671},
+ {0x1F9E, 0, 2, 1673},
+ {0x1F9F, 0, 2, 1675},
+ {0x1FA0, 0, 2, 1677},
+ {0x1FA1, 0, 2, 1679},
+ {0x1FA2, 0, 2, 1681},
+ {0x1FA3, 0, 2, 1683},
+ {0x1FA4, 0, 2, 1685},
+ {0x1FA5, 0, 2, 1687},
+ {0x1FA6, 0, 2, 1689},
+ {0x1FA7, 0, 2, 1691},
+ {0x1FA8, 0, 2, 1693},
+ {0x1FA9, 0, 2, 1695},
+ {0x1FAA, 0, 2, 1697},
+ {0x1FAB, 0, 2, 1699},
+ {0x1FAC, 0, 2, 1701},
+ {0x1FAD, 0, 2, 1703},
+ {0x1FAE, 0, 2, 1705},
+ {0x1FAF, 0, 2, 1707},
+ {0x1FB0, 0, 2, 1709},
+ {0x1FB1, 0, 2, 1711},
+ {0x1FB2, 0, 2, 1713},
+ {0x1FB3, 0, 2, 1715},
+ {0x1FB4, 0, 2, 1717},
+ {0x1FB6, 0, 2, 1719},
+ {0x1FB7, 0, 2, 1721},
+ {0x1FB8, 0, 2, 1723},
+ {0x1FB9, 0, 2, 1725},
+ {0x1FBA, 0, 2, 1727},
+ {0x1FBB, 0, 1 | DECOMP_INLINE, 0x0386},
+ {0x1FBC, 0, 2, 1729},
+ {0x1FBD, 0, 2 | DECOMP_NO_COMPOSE, 1731}, /* compatibility mapping */
+ {0x1FBE, 0, 1 | DECOMP_INLINE, 0x03B9},
+ {0x1FBF, 0, 2 | DECOMP_NO_COMPOSE, 1733}, /* compatibility mapping */
+ {0x1FC0, 0, 2 | DECOMP_NO_COMPOSE, 1735}, /* compatibility mapping */
+ {0x1FC1, 0, 2, 1737},
+ {0x1FC2, 0, 2, 1739},
+ {0x1FC3, 0, 2, 1741},
+ {0x1FC4, 0, 2, 1743},
+ {0x1FC6, 0, 2, 1745},
+ {0x1FC7, 0, 2, 1747},
+ {0x1FC8, 0, 2, 1749},
+ {0x1FC9, 0, 1 | DECOMP_INLINE, 0x0388},
+ {0x1FCA, 0, 2, 1751},
+ {0x1FCB, 0, 1 | DECOMP_INLINE, 0x0389},
+ {0x1FCC, 0, 2, 1753},
+ {0x1FCD, 0, 2, 1755},
+ {0x1FCE, 0, 2, 1757},
+ {0x1FCF, 0, 2, 1759},
+ {0x1FD0, 0, 2, 1761},
+ {0x1FD1, 0, 2, 1763},
+ {0x1FD2, 0, 2, 1765},
+ {0x1FD3, 0, 1 | DECOMP_INLINE, 0x0390},
+ {0x1FD6, 0, 2, 1767},
+ {0x1FD7, 0, 2, 1769},
+ {0x1FD8, 0, 2, 1771},
+ {0x1FD9, 0, 2, 1773},
+ {0x1FDA, 0, 2, 1775},
+ {0x1FDB, 0, 1 | DECOMP_INLINE, 0x038A},
+ {0x1FDD, 0, 2, 1777},
+ {0x1FDE, 0, 2, 1779},
+ {0x1FDF, 0, 2, 1781},
+ {0x1FE0, 0, 2, 1783},
+ {0x1FE1, 0, 2, 1785},
+ {0x1FE2, 0, 2, 1787},
+ {0x1FE3, 0, 1 | DECOMP_INLINE, 0x03B0},
+ {0x1FE4, 0, 2, 1789},
+ {0x1FE5, 0, 2, 1791},
+ {0x1FE6, 0, 2, 1793},
+ {0x1FE7, 0, 2, 1795},
+ {0x1FE8, 0, 2, 1797},
+ {0x1FE9, 0, 2, 1799},
+ {0x1FEA, 0, 2, 1801},
+ {0x1FEB, 0, 1 | DECOMP_INLINE, 0x038E},
+ {0x1FEC, 0, 2, 1803},
+ {0x1FED, 0, 2, 1805},
+ {0x1FEE, 0, 1 | DECOMP_INLINE, 0x0385},
+ {0x1FEF, 0, 1 | DECOMP_INLINE, 0x0060},
+ {0x1FF2, 0, 2, 1807},
+ {0x1FF3, 0, 2, 1809},
+ {0x1FF4, 0, 2, 1811},
+ {0x1FF6, 0, 2, 1813},
+ {0x1FF7, 0, 2, 1815},
+ {0x1FF8, 0, 2, 1817},
+ {0x1FF9, 0, 1 | DECOMP_INLINE, 0x038C},
+ {0x1FFA, 0, 2, 1819},
+ {0x1FFB, 0, 1 | DECOMP_INLINE, 0x038F},
+ {0x1FFC, 0, 2, 1821},
+ {0x1FFD, 0, 1 | DECOMP_INLINE, 0x00B4},
+ {0x1FFE, 0, 2 | DECOMP_NO_COMPOSE, 1823}, /* compatibility mapping */
+ {0x2000, 0, 1 | DECOMP_INLINE, 0x2002},
+ {0x2001, 0, 1 | DECOMP_INLINE, 0x2003},
+ {0x2002, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2003, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2004, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2005, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2006, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2007, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2008, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2009, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x200A, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2011, 0, 1 | DECOMP_INLINE, 0x2010},
+ {0x2017, 0, 2 | DECOMP_NO_COMPOSE, 1825}, /* compatibility mapping */
+ {0x2024, 0, 1 | DECOMP_INLINE, 0x002E},
+ {0x2025, 0, 2 | DECOMP_NO_COMPOSE, 1827}, /* compatibility mapping */
+ {0x2026, 0, 3, 1829},
+ {0x202F, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2033, 0, 2 | DECOMP_NO_COMPOSE, 1832}, /* compatibility mapping */
+ {0x2034, 0, 3, 1834},
+ {0x2036, 0, 2 | DECOMP_NO_COMPOSE, 1837}, /* compatibility mapping */
+ {0x2037, 0, 3, 1839},
+ {0x203C, 0, 2 | DECOMP_NO_COMPOSE, 1842}, /* compatibility mapping */
+ {0x203E, 0, 2 | DECOMP_NO_COMPOSE, 1844}, /* compatibility mapping */
+ {0x2047, 0, 2 | DECOMP_NO_COMPOSE, 1846}, /* compatibility mapping */
+ {0x2048, 0, 2 | DECOMP_NO_COMPOSE, 1848}, /* compatibility mapping */
+ {0x2049, 0, 2 | DECOMP_NO_COMPOSE, 1850}, /* compatibility mapping */
+ {0x2057, 0, 4, 1852},
+ {0x205F, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x2070, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x2071, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x2074, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x2075, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x2076, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x2077, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x2078, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x2079, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x207A, 0, 1 | DECOMP_INLINE, 0x002B},
+ {0x207B, 0, 1 | DECOMP_INLINE, 0x2212},
+ {0x207C, 0, 1 | DECOMP_INLINE, 0x003D},
+ {0x207D, 0, 1 | DECOMP_INLINE, 0x0028},
+ {0x207E, 0, 1 | DECOMP_INLINE, 0x0029},
+ {0x207F, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x2080, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x2081, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x2082, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x2083, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x2084, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x2085, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x2086, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x2087, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x2088, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x2089, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x208A, 0, 1 | DECOMP_INLINE, 0x002B},
+ {0x208B, 0, 1 | DECOMP_INLINE, 0x2212},
+ {0x208C, 0, 1 | DECOMP_INLINE, 0x003D},
+ {0x208D, 0, 1 | DECOMP_INLINE, 0x0028},
+ {0x208E, 0, 1 | DECOMP_INLINE, 0x0029},
+ {0x2090, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x2091, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x2092, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x2093, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x2094, 0, 1 | DECOMP_INLINE, 0x0259},
+ {0x2095, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x2096, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x2097, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x2098, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x2099, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x209A, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x209B, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x209C, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x20A8, 0, 2 | DECOMP_NO_COMPOSE, 1856}, /* compatibility mapping */
+ {0x20D0, 230, 0, 0},
+ {0x20D1, 230, 0, 0},
+ {0x20D2, 1, 0, 0},
+ {0x20D3, 1, 0, 0},
+ {0x20D4, 230, 0, 0},
+ {0x20D5, 230, 0, 0},
+ {0x20D6, 230, 0, 0},
+ {0x20D7, 230, 0, 0},
+ {0x20D8, 1, 0, 0},
+ {0x20D9, 1, 0, 0},
+ {0x20DA, 1, 0, 0},
+ {0x20DB, 230, 0, 0},
+ {0x20DC, 230, 0, 0},
+ {0x20E1, 230, 0, 0},
+ {0x20E5, 1, 0, 0},
+ {0x20E6, 1, 0, 0},
+ {0x20E7, 230, 0, 0},
+ {0x20E8, 220, 0, 0},
+ {0x20E9, 230, 0, 0},
+ {0x20EA, 1, 0, 0},
+ {0x20EB, 1, 0, 0},
+ {0x20EC, 220, 0, 0},
+ {0x20ED, 220, 0, 0},
+ {0x20EE, 220, 0, 0},
+ {0x20EF, 220, 0, 0},
+ {0x20F0, 230, 0, 0},
+ {0x2100, 0, 3, 1858},
+ {0x2101, 0, 3, 1861},
+ {0x2102, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x2103, 0, 2 | DECOMP_NO_COMPOSE, 1864}, /* compatibility mapping */
+ {0x2105, 0, 3, 1866},
+ {0x2106, 0, 3, 1869},
+ {0x2107, 0, 1 | DECOMP_INLINE, 0x0190},
+ {0x2109, 0, 2 | DECOMP_NO_COMPOSE, 1872}, /* compatibility mapping */
+ {0x210A, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x210B, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x210C, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x210D, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x210E, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x210F, 0, 1 | DECOMP_INLINE, 0x0127},
+ {0x2110, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x2111, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x2112, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x2113, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x2115, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x2116, 0, 2 | DECOMP_NO_COMPOSE, 1874}, /* compatibility mapping */
+ {0x2119, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x211A, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x211B, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x211C, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x211D, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x2120, 0, 2 | DECOMP_NO_COMPOSE, 1876}, /* compatibility mapping */
+ {0x2121, 0, 3, 1878},
+ {0x2122, 0, 2 | DECOMP_NO_COMPOSE, 1881}, /* compatibility mapping */
+ {0x2124, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x2126, 0, 1 | DECOMP_INLINE, 0x03A9},
+ {0x2128, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x212A, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x212B, 0, 1 | DECOMP_INLINE, 0x00C5},
+ {0x212C, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x212D, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x212F, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x2130, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x2131, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x2133, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x2134, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x2135, 0, 1 | DECOMP_INLINE, 0x05D0},
+ {0x2136, 0, 1 | DECOMP_INLINE, 0x05D1},
+ {0x2137, 0, 1 | DECOMP_INLINE, 0x05D2},
+ {0x2138, 0, 1 | DECOMP_INLINE, 0x05D3},
+ {0x2139, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x213B, 0, 3, 1883},
+ {0x213C, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x213D, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x213E, 0, 1 | DECOMP_INLINE, 0x0393},
+ {0x213F, 0, 1 | DECOMP_INLINE, 0x03A0},
+ {0x2140, 0, 1 | DECOMP_INLINE, 0x2211},
+ {0x2145, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x2146, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x2147, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x2148, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x2149, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x2150, 0, 3, 1886},
+ {0x2151, 0, 3, 1889},
+ {0x2152, 0, 4, 1892},
+ {0x2153, 0, 3, 1896},
+ {0x2154, 0, 3, 1899},
+ {0x2155, 0, 3, 1902},
+ {0x2156, 0, 3, 1905},
+ {0x2157, 0, 3, 1908},
+ {0x2158, 0, 3, 1911},
+ {0x2159, 0, 3, 1914},
+ {0x215A, 0, 3, 1917},
+ {0x215B, 0, 3, 1920},
+ {0x215C, 0, 3, 1923},
+ {0x215D, 0, 3, 1926},
+ {0x215E, 0, 3, 1929},
+ {0x215F, 0, 2 | DECOMP_NO_COMPOSE, 1932}, /* compatibility mapping */
+ {0x2160, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x2161, 0, 2 | DECOMP_NO_COMPOSE, 1934}, /* compatibility mapping */
+ {0x2162, 0, 3, 1936},
+ {0x2163, 0, 2 | DECOMP_NO_COMPOSE, 1939}, /* compatibility mapping */
+ {0x2164, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x2165, 0, 2 | DECOMP_NO_COMPOSE, 1941}, /* compatibility mapping */
+ {0x2166, 0, 3, 1943},
+ {0x2167, 0, 4, 1946},
+ {0x2168, 0, 2 | DECOMP_NO_COMPOSE, 1950}, /* compatibility mapping */
+ {0x2169, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x216A, 0, 2 | DECOMP_NO_COMPOSE, 1952}, /* compatibility mapping */
+ {0x216B, 0, 3, 1954},
+ {0x216C, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x216D, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x216E, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x216F, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x2170, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x2171, 0, 2 | DECOMP_NO_COMPOSE, 1957}, /* compatibility mapping */
+ {0x2172, 0, 3, 1959},
+ {0x2173, 0, 2 | DECOMP_NO_COMPOSE, 1962}, /* compatibility mapping */
+ {0x2174, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x2175, 0, 2 | DECOMP_NO_COMPOSE, 1964}, /* compatibility mapping */
+ {0x2176, 0, 3, 1966},
+ {0x2177, 0, 4, 1969},
+ {0x2178, 0, 2 | DECOMP_NO_COMPOSE, 1973}, /* compatibility mapping */
+ {0x2179, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x217A, 0, 2 | DECOMP_NO_COMPOSE, 1975}, /* compatibility mapping */
+ {0x217B, 0, 3, 1977},
+ {0x217C, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x217D, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x217E, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x217F, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x2189, 0, 3, 1980},
+ {0x219A, 0, 2, 1983},
+ {0x219B, 0, 2, 1985},
+ {0x21AE, 0, 2, 1987},
+ {0x21CD, 0, 2, 1989},
+ {0x21CE, 0, 2, 1991},
+ {0x21CF, 0, 2, 1993},
+ {0x2204, 0, 2, 1995},
+ {0x2209, 0, 2, 1997},
+ {0x220C, 0, 2, 1999},
+ {0x2224, 0, 2, 2001},
+ {0x2226, 0, 2, 2003},
+ {0x222C, 0, 2 | DECOMP_NO_COMPOSE, 2005}, /* compatibility mapping */
+ {0x222D, 0, 3, 2007},
+ {0x222F, 0, 2 | DECOMP_NO_COMPOSE, 2010}, /* compatibility mapping */
+ {0x2230, 0, 3, 2012},
+ {0x2241, 0, 2, 2015},
+ {0x2244, 0, 2, 2017},
+ {0x2247, 0, 2, 2019},
+ {0x2249, 0, 2, 2021},
+ {0x2260, 0, 2, 2023},
+ {0x2262, 0, 2, 2025},
+ {0x226D, 0, 2, 2027},
+ {0x226E, 0, 2, 2029},
+ {0x226F, 0, 2, 2031},
+ {0x2270, 0, 2, 2033},
+ {0x2271, 0, 2, 2035},
+ {0x2274, 0, 2, 2037},
+ {0x2275, 0, 2, 2039},
+ {0x2278, 0, 2, 2041},
+ {0x2279, 0, 2, 2043},
+ {0x2280, 0, 2, 2045},
+ {0x2281, 0, 2, 2047},
+ {0x2284, 0, 2, 2049},
+ {0x2285, 0, 2, 2051},
+ {0x2288, 0, 2, 2053},
+ {0x2289, 0, 2, 2055},
+ {0x22AC, 0, 2, 2057},
+ {0x22AD, 0, 2, 2059},
+ {0x22AE, 0, 2, 2061},
+ {0x22AF, 0, 2, 2063},
+ {0x22E0, 0, 2, 2065},
+ {0x22E1, 0, 2, 2067},
+ {0x22E2, 0, 2, 2069},
+ {0x22E3, 0, 2, 2071},
+ {0x22EA, 0, 2, 2073},
+ {0x22EB, 0, 2, 2075},
+ {0x22EC, 0, 2, 2077},
+ {0x22ED, 0, 2, 2079},
+ {0x2329, 0, 1 | DECOMP_INLINE, 0x3008},
+ {0x232A, 0, 1 | DECOMP_INLINE, 0x3009},
+ {0x2460, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x2461, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x2462, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x2463, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x2464, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x2465, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x2466, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x2467, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x2468, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x2469, 0, 2 | DECOMP_NO_COMPOSE, 2081}, /* compatibility mapping */
+ {0x246A, 0, 2 | DECOMP_NO_COMPOSE, 2083}, /* compatibility mapping */
+ {0x246B, 0, 2 | DECOMP_NO_COMPOSE, 2085}, /* compatibility mapping */
+ {0x246C, 0, 2 | DECOMP_NO_COMPOSE, 2087}, /* compatibility mapping */
+ {0x246D, 0, 2 | DECOMP_NO_COMPOSE, 2089}, /* compatibility mapping */
+ {0x246E, 0, 2 | DECOMP_NO_COMPOSE, 2091}, /* compatibility mapping */
+ {0x246F, 0, 2 | DECOMP_NO_COMPOSE, 2093}, /* compatibility mapping */
+ {0x2470, 0, 2 | DECOMP_NO_COMPOSE, 2095}, /* compatibility mapping */
+ {0x2471, 0, 2 | DECOMP_NO_COMPOSE, 2097}, /* compatibility mapping */
+ {0x2472, 0, 2 | DECOMP_NO_COMPOSE, 2099}, /* compatibility mapping */
+ {0x2473, 0, 2 | DECOMP_NO_COMPOSE, 2101}, /* compatibility mapping */
+ {0x2474, 0, 3, 2103},
+ {0x2475, 0, 3, 2106},
+ {0x2476, 0, 3, 2109},
+ {0x2477, 0, 3, 2112},
+ {0x2478, 0, 3, 2115},
+ {0x2479, 0, 3, 2118},
+ {0x247A, 0, 3, 2121},
+ {0x247B, 0, 3, 2124},
+ {0x247C, 0, 3, 2127},
+ {0x247D, 0, 4, 2130},
+ {0x247E, 0, 4, 2134},
+ {0x247F, 0, 4, 2138},
+ {0x2480, 0, 4, 2142},
+ {0x2481, 0, 4, 2146},
+ {0x2482, 0, 4, 2150},
+ {0x2483, 0, 4, 2154},
+ {0x2484, 0, 4, 2158},
+ {0x2485, 0, 4, 2162},
+ {0x2486, 0, 4, 2166},
+ {0x2487, 0, 4, 2170},
+ {0x2488, 0, 2 | DECOMP_NO_COMPOSE, 2174}, /* compatibility mapping */
+ {0x2489, 0, 2 | DECOMP_NO_COMPOSE, 2176}, /* compatibility mapping */
+ {0x248A, 0, 2 | DECOMP_NO_COMPOSE, 2178}, /* compatibility mapping */
+ {0x248B, 0, 2 | DECOMP_NO_COMPOSE, 2180}, /* compatibility mapping */
+ {0x248C, 0, 2 | DECOMP_NO_COMPOSE, 2182}, /* compatibility mapping */
+ {0x248D, 0, 2 | DECOMP_NO_COMPOSE, 2184}, /* compatibility mapping */
+ {0x248E, 0, 2 | DECOMP_NO_COMPOSE, 2186}, /* compatibility mapping */
+ {0x248F, 0, 2 | DECOMP_NO_COMPOSE, 2188}, /* compatibility mapping */
+ {0x2490, 0, 2 | DECOMP_NO_COMPOSE, 2190}, /* compatibility mapping */
+ {0x2491, 0, 3, 2192},
+ {0x2492, 0, 3, 2195},
+ {0x2493, 0, 3, 2198},
+ {0x2494, 0, 3, 2201},
+ {0x2495, 0, 3, 2204},
+ {0x2496, 0, 3, 2207},
+ {0x2497, 0, 3, 2210},
+ {0x2498, 0, 3, 2213},
+ {0x2499, 0, 3, 2216},
+ {0x249A, 0, 3, 2219},
+ {0x249B, 0, 3, 2222},
+ {0x249C, 0, 3, 2225},
+ {0x249D, 0, 3, 2228},
+ {0x249E, 0, 3, 2231},
+ {0x249F, 0, 3, 2234},
+ {0x24A0, 0, 3, 2237},
+ {0x24A1, 0, 3, 2240},
+ {0x24A2, 0, 3, 2243},
+ {0x24A3, 0, 3, 2246},
+ {0x24A4, 0, 3, 2249},
+ {0x24A5, 0, 3, 2252},
+ {0x24A6, 0, 3, 2255},
+ {0x24A7, 0, 3, 2258},
+ {0x24A8, 0, 3, 2261},
+ {0x24A9, 0, 3, 2264},
+ {0x24AA, 0, 3, 2267},
+ {0x24AB, 0, 3, 2270},
+ {0x24AC, 0, 3, 2273},
+ {0x24AD, 0, 3, 2276},
+ {0x24AE, 0, 3, 2279},
+ {0x24AF, 0, 3, 2282},
+ {0x24B0, 0, 3, 2285},
+ {0x24B1, 0, 3, 2288},
+ {0x24B2, 0, 3, 2291},
+ {0x24B3, 0, 3, 2294},
+ {0x24B4, 0, 3, 2297},
+ {0x24B5, 0, 3, 2300},
+ {0x24B6, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x24B7, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x24B8, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x24B9, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x24BA, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x24BB, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x24BC, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x24BD, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x24BE, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x24BF, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x24C0, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x24C1, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x24C2, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x24C3, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x24C4, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x24C5, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x24C6, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x24C7, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x24C8, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x24C9, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x24CA, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x24CB, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x24CC, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x24CD, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x24CE, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x24CF, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x24D0, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x24D1, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x24D2, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x24D3, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x24D4, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x24D5, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x24D6, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x24D7, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x24D8, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x24D9, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x24DA, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x24DB, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x24DC, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x24DD, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x24DE, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x24DF, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x24E0, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x24E1, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x24E2, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x24E3, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x24E4, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x24E5, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x24E6, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x24E7, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x24E8, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x24E9, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x24EA, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x2A0C, 0, 4, 2303},
+ {0x2A74, 0, 3, 2307},
+ {0x2A75, 0, 2 | DECOMP_NO_COMPOSE, 2310}, /* compatibility mapping */
+ {0x2A76, 0, 3, 2312},
+ {0x2ADC, 0, 2 | DECOMP_NO_COMPOSE, 2315}, /* in exclusion list */
+ {0x2C7C, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x2C7D, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x2CEF, 230, 0, 0},
+ {0x2CF0, 230, 0, 0},
+ {0x2CF1, 230, 0, 0},
+ {0x2D6F, 0, 1 | DECOMP_INLINE, 0x2D61},
+ {0x2D7F, 9, 0, 0},
+ {0x2DE0, 230, 0, 0},
+ {0x2DE1, 230, 0, 0},
+ {0x2DE2, 230, 0, 0},
+ {0x2DE3, 230, 0, 0},
+ {0x2DE4, 230, 0, 0},
+ {0x2DE5, 230, 0, 0},
+ {0x2DE6, 230, 0, 0},
+ {0x2DE7, 230, 0, 0},
+ {0x2DE8, 230, 0, 0},
+ {0x2DE9, 230, 0, 0},
+ {0x2DEA, 230, 0, 0},
+ {0x2DEB, 230, 0, 0},
+ {0x2DEC, 230, 0, 0},
+ {0x2DED, 230, 0, 0},
+ {0x2DEE, 230, 0, 0},
+ {0x2DEF, 230, 0, 0},
+ {0x2DF0, 230, 0, 0},
+ {0x2DF1, 230, 0, 0},
+ {0x2DF2, 230, 0, 0},
+ {0x2DF3, 230, 0, 0},
+ {0x2DF4, 230, 0, 0},
+ {0x2DF5, 230, 0, 0},
+ {0x2DF6, 230, 0, 0},
+ {0x2DF7, 230, 0, 0},
+ {0x2DF8, 230, 0, 0},
+ {0x2DF9, 230, 0, 0},
+ {0x2DFA, 230, 0, 0},
+ {0x2DFB, 230, 0, 0},
+ {0x2DFC, 230, 0, 0},
+ {0x2DFD, 230, 0, 0},
+ {0x2DFE, 230, 0, 0},
+ {0x2DFF, 230, 0, 0},
+ {0x2E9F, 0, 1 | DECOMP_INLINE, 0x6BCD},
+ {0x2EF3, 0, 1 | DECOMP_INLINE, 0x9F9F},
+ {0x2F00, 0, 1 | DECOMP_INLINE, 0x4E00},
+ {0x2F01, 0, 1 | DECOMP_INLINE, 0x4E28},
+ {0x2F02, 0, 1 | DECOMP_INLINE, 0x4E36},
+ {0x2F03, 0, 1 | DECOMP_INLINE, 0x4E3F},
+ {0x2F04, 0, 1 | DECOMP_INLINE, 0x4E59},
+ {0x2F05, 0, 1 | DECOMP_INLINE, 0x4E85},
+ {0x2F06, 0, 1 | DECOMP_INLINE, 0x4E8C},
+ {0x2F07, 0, 1 | DECOMP_INLINE, 0x4EA0},
+ {0x2F08, 0, 1 | DECOMP_INLINE, 0x4EBA},
+ {0x2F09, 0, 1 | DECOMP_INLINE, 0x513F},
+ {0x2F0A, 0, 1 | DECOMP_INLINE, 0x5165},
+ {0x2F0B, 0, 1 | DECOMP_INLINE, 0x516B},
+ {0x2F0C, 0, 1 | DECOMP_INLINE, 0x5182},
+ {0x2F0D, 0, 1 | DECOMP_INLINE, 0x5196},
+ {0x2F0E, 0, 1 | DECOMP_INLINE, 0x51AB},
+ {0x2F0F, 0, 1 | DECOMP_INLINE, 0x51E0},
+ {0x2F10, 0, 1 | DECOMP_INLINE, 0x51F5},
+ {0x2F11, 0, 1 | DECOMP_INLINE, 0x5200},
+ {0x2F12, 0, 1 | DECOMP_INLINE, 0x529B},
+ {0x2F13, 0, 1 | DECOMP_INLINE, 0x52F9},
+ {0x2F14, 0, 1 | DECOMP_INLINE, 0x5315},
+ {0x2F15, 0, 1 | DECOMP_INLINE, 0x531A},
+ {0x2F16, 0, 1 | DECOMP_INLINE, 0x5338},
+ {0x2F17, 0, 1 | DECOMP_INLINE, 0x5341},
+ {0x2F18, 0, 1 | DECOMP_INLINE, 0x535C},
+ {0x2F19, 0, 1 | DECOMP_INLINE, 0x5369},
+ {0x2F1A, 0, 1 | DECOMP_INLINE, 0x5382},
+ {0x2F1B, 0, 1 | DECOMP_INLINE, 0x53B6},
+ {0x2F1C, 0, 1 | DECOMP_INLINE, 0x53C8},
+ {0x2F1D, 0, 1 | DECOMP_INLINE, 0x53E3},
+ {0x2F1E, 0, 1 | DECOMP_INLINE, 0x56D7},
+ {0x2F1F, 0, 1 | DECOMP_INLINE, 0x571F},
+ {0x2F20, 0, 1 | DECOMP_INLINE, 0x58EB},
+ {0x2F21, 0, 1 | DECOMP_INLINE, 0x5902},
+ {0x2F22, 0, 1 | DECOMP_INLINE, 0x590A},
+ {0x2F23, 0, 1 | DECOMP_INLINE, 0x5915},
+ {0x2F24, 0, 1 | DECOMP_INLINE, 0x5927},
+ {0x2F25, 0, 1 | DECOMP_INLINE, 0x5973},
+ {0x2F26, 0, 1 | DECOMP_INLINE, 0x5B50},
+ {0x2F27, 0, 1 | DECOMP_INLINE, 0x5B80},
+ {0x2F28, 0, 1 | DECOMP_INLINE, 0x5BF8},
+ {0x2F29, 0, 1 | DECOMP_INLINE, 0x5C0F},
+ {0x2F2A, 0, 1 | DECOMP_INLINE, 0x5C22},
+ {0x2F2B, 0, 1 | DECOMP_INLINE, 0x5C38},
+ {0x2F2C, 0, 1 | DECOMP_INLINE, 0x5C6E},
+ {0x2F2D, 0, 1 | DECOMP_INLINE, 0x5C71},
+ {0x2F2E, 0, 1 | DECOMP_INLINE, 0x5DDB},
+ {0x2F2F, 0, 1 | DECOMP_INLINE, 0x5DE5},
+ {0x2F30, 0, 1 | DECOMP_INLINE, 0x5DF1},
+ {0x2F31, 0, 1 | DECOMP_INLINE, 0x5DFE},
+ {0x2F32, 0, 1 | DECOMP_INLINE, 0x5E72},
+ {0x2F33, 0, 1 | DECOMP_INLINE, 0x5E7A},
+ {0x2F34, 0, 1 | DECOMP_INLINE, 0x5E7F},
+ {0x2F35, 0, 1 | DECOMP_INLINE, 0x5EF4},
+ {0x2F36, 0, 1 | DECOMP_INLINE, 0x5EFE},
+ {0x2F37, 0, 1 | DECOMP_INLINE, 0x5F0B},
+ {0x2F38, 0, 1 | DECOMP_INLINE, 0x5F13},
+ {0x2F39, 0, 1 | DECOMP_INLINE, 0x5F50},
+ {0x2F3A, 0, 1 | DECOMP_INLINE, 0x5F61},
+ {0x2F3B, 0, 1 | DECOMP_INLINE, 0x5F73},
+ {0x2F3C, 0, 1 | DECOMP_INLINE, 0x5FC3},
+ {0x2F3D, 0, 1 | DECOMP_INLINE, 0x6208},
+ {0x2F3E, 0, 1 | DECOMP_INLINE, 0x6236},
+ {0x2F3F, 0, 1 | DECOMP_INLINE, 0x624B},
+ {0x2F40, 0, 1 | DECOMP_INLINE, 0x652F},
+ {0x2F41, 0, 1 | DECOMP_INLINE, 0x6534},
+ {0x2F42, 0, 1 | DECOMP_INLINE, 0x6587},
+ {0x2F43, 0, 1 | DECOMP_INLINE, 0x6597},
+ {0x2F44, 0, 1 | DECOMP_INLINE, 0x65A4},
+ {0x2F45, 0, 1 | DECOMP_INLINE, 0x65B9},
+ {0x2F46, 0, 1 | DECOMP_INLINE, 0x65E0},
+ {0x2F47, 0, 1 | DECOMP_INLINE, 0x65E5},
+ {0x2F48, 0, 1 | DECOMP_INLINE, 0x66F0},
+ {0x2F49, 0, 1 | DECOMP_INLINE, 0x6708},
+ {0x2F4A, 0, 1 | DECOMP_INLINE, 0x6728},
+ {0x2F4B, 0, 1 | DECOMP_INLINE, 0x6B20},
+ {0x2F4C, 0, 1 | DECOMP_INLINE, 0x6B62},
+ {0x2F4D, 0, 1 | DECOMP_INLINE, 0x6B79},
+ {0x2F4E, 0, 1 | DECOMP_INLINE, 0x6BB3},
+ {0x2F4F, 0, 1 | DECOMP_INLINE, 0x6BCB},
+ {0x2F50, 0, 1 | DECOMP_INLINE, 0x6BD4},
+ {0x2F51, 0, 1 | DECOMP_INLINE, 0x6BDB},
+ {0x2F52, 0, 1 | DECOMP_INLINE, 0x6C0F},
+ {0x2F53, 0, 1 | DECOMP_INLINE, 0x6C14},
+ {0x2F54, 0, 1 | DECOMP_INLINE, 0x6C34},
+ {0x2F55, 0, 1 | DECOMP_INLINE, 0x706B},
+ {0x2F56, 0, 1 | DECOMP_INLINE, 0x722A},
+ {0x2F57, 0, 1 | DECOMP_INLINE, 0x7236},
+ {0x2F58, 0, 1 | DECOMP_INLINE, 0x723B},
+ {0x2F59, 0, 1 | DECOMP_INLINE, 0x723F},
+ {0x2F5A, 0, 1 | DECOMP_INLINE, 0x7247},
+ {0x2F5B, 0, 1 | DECOMP_INLINE, 0x7259},
+ {0x2F5C, 0, 1 | DECOMP_INLINE, 0x725B},
+ {0x2F5D, 0, 1 | DECOMP_INLINE, 0x72AC},
+ {0x2F5E, 0, 1 | DECOMP_INLINE, 0x7384},
+ {0x2F5F, 0, 1 | DECOMP_INLINE, 0x7389},
+ {0x2F60, 0, 1 | DECOMP_INLINE, 0x74DC},
+ {0x2F61, 0, 1 | DECOMP_INLINE, 0x74E6},
+ {0x2F62, 0, 1 | DECOMP_INLINE, 0x7518},
+ {0x2F63, 0, 1 | DECOMP_INLINE, 0x751F},
+ {0x2F64, 0, 1 | DECOMP_INLINE, 0x7528},
+ {0x2F65, 0, 1 | DECOMP_INLINE, 0x7530},
+ {0x2F66, 0, 1 | DECOMP_INLINE, 0x758B},
+ {0x2F67, 0, 1 | DECOMP_INLINE, 0x7592},
+ {0x2F68, 0, 1 | DECOMP_INLINE, 0x7676},
+ {0x2F69, 0, 1 | DECOMP_INLINE, 0x767D},
+ {0x2F6A, 0, 1 | DECOMP_INLINE, 0x76AE},
+ {0x2F6B, 0, 1 | DECOMP_INLINE, 0x76BF},
+ {0x2F6C, 0, 1 | DECOMP_INLINE, 0x76EE},
+ {0x2F6D, 0, 1 | DECOMP_INLINE, 0x77DB},
+ {0x2F6E, 0, 1 | DECOMP_INLINE, 0x77E2},
+ {0x2F6F, 0, 1 | DECOMP_INLINE, 0x77F3},
+ {0x2F70, 0, 1 | DECOMP_INLINE, 0x793A},
+ {0x2F71, 0, 1 | DECOMP_INLINE, 0x79B8},
+ {0x2F72, 0, 1 | DECOMP_INLINE, 0x79BE},
+ {0x2F73, 0, 1 | DECOMP_INLINE, 0x7A74},
+ {0x2F74, 0, 1 | DECOMP_INLINE, 0x7ACB},
+ {0x2F75, 0, 1 | DECOMP_INLINE, 0x7AF9},
+ {0x2F76, 0, 1 | DECOMP_INLINE, 0x7C73},
+ {0x2F77, 0, 1 | DECOMP_INLINE, 0x7CF8},
+ {0x2F78, 0, 1 | DECOMP_INLINE, 0x7F36},
+ {0x2F79, 0, 1 | DECOMP_INLINE, 0x7F51},
+ {0x2F7A, 0, 1 | DECOMP_INLINE, 0x7F8A},
+ {0x2F7B, 0, 1 | DECOMP_INLINE, 0x7FBD},
+ {0x2F7C, 0, 1 | DECOMP_INLINE, 0x8001},
+ {0x2F7D, 0, 1 | DECOMP_INLINE, 0x800C},
+ {0x2F7E, 0, 1 | DECOMP_INLINE, 0x8012},
+ {0x2F7F, 0, 1 | DECOMP_INLINE, 0x8033},
+ {0x2F80, 0, 1 | DECOMP_INLINE, 0x807F},
+ {0x2F81, 0, 1 | DECOMP_INLINE, 0x8089},
+ {0x2F82, 0, 1 | DECOMP_INLINE, 0x81E3},
+ {0x2F83, 0, 1 | DECOMP_INLINE, 0x81EA},
+ {0x2F84, 0, 1 | DECOMP_INLINE, 0x81F3},
+ {0x2F85, 0, 1 | DECOMP_INLINE, 0x81FC},
+ {0x2F86, 0, 1 | DECOMP_INLINE, 0x820C},
+ {0x2F87, 0, 1 | DECOMP_INLINE, 0x821B},
+ {0x2F88, 0, 1 | DECOMP_INLINE, 0x821F},
+ {0x2F89, 0, 1 | DECOMP_INLINE, 0x826E},
+ {0x2F8A, 0, 1 | DECOMP_INLINE, 0x8272},
+ {0x2F8B, 0, 1 | DECOMP_INLINE, 0x8278},
+ {0x2F8C, 0, 1 | DECOMP_INLINE, 0x864D},
+ {0x2F8D, 0, 1 | DECOMP_INLINE, 0x866B},
+ {0x2F8E, 0, 1 | DECOMP_INLINE, 0x8840},
+ {0x2F8F, 0, 1 | DECOMP_INLINE, 0x884C},
+ {0x2F90, 0, 1 | DECOMP_INLINE, 0x8863},
+ {0x2F91, 0, 1 | DECOMP_INLINE, 0x897E},
+ {0x2F92, 0, 1 | DECOMP_INLINE, 0x898B},
+ {0x2F93, 0, 1 | DECOMP_INLINE, 0x89D2},
+ {0x2F94, 0, 1 | DECOMP_INLINE, 0x8A00},
+ {0x2F95, 0, 1 | DECOMP_INLINE, 0x8C37},
+ {0x2F96, 0, 1 | DECOMP_INLINE, 0x8C46},
+ {0x2F97, 0, 1 | DECOMP_INLINE, 0x8C55},
+ {0x2F98, 0, 1 | DECOMP_INLINE, 0x8C78},
+ {0x2F99, 0, 1 | DECOMP_INLINE, 0x8C9D},
+ {0x2F9A, 0, 1 | DECOMP_INLINE, 0x8D64},
+ {0x2F9B, 0, 1 | DECOMP_INLINE, 0x8D70},
+ {0x2F9C, 0, 1 | DECOMP_INLINE, 0x8DB3},
+ {0x2F9D, 0, 1 | DECOMP_INLINE, 0x8EAB},
+ {0x2F9E, 0, 1 | DECOMP_INLINE, 0x8ECA},
+ {0x2F9F, 0, 1 | DECOMP_INLINE, 0x8F9B},
+ {0x2FA0, 0, 1 | DECOMP_INLINE, 0x8FB0},
+ {0x2FA1, 0, 1 | DECOMP_INLINE, 0x8FB5},
+ {0x2FA2, 0, 1 | DECOMP_INLINE, 0x9091},
+ {0x2FA3, 0, 1 | DECOMP_INLINE, 0x9149},
+ {0x2FA4, 0, 1 | DECOMP_INLINE, 0x91C6},
+ {0x2FA5, 0, 1 | DECOMP_INLINE, 0x91CC},
+ {0x2FA6, 0, 1 | DECOMP_INLINE, 0x91D1},
+ {0x2FA7, 0, 1 | DECOMP_INLINE, 0x9577},
+ {0x2FA8, 0, 1 | DECOMP_INLINE, 0x9580},
+ {0x2FA9, 0, 1 | DECOMP_INLINE, 0x961C},
+ {0x2FAA, 0, 1 | DECOMP_INLINE, 0x96B6},
+ {0x2FAB, 0, 1 | DECOMP_INLINE, 0x96B9},
+ {0x2FAC, 0, 1 | DECOMP_INLINE, 0x96E8},
+ {0x2FAD, 0, 1 | DECOMP_INLINE, 0x9751},
+ {0x2FAE, 0, 1 | DECOMP_INLINE, 0x975E},
+ {0x2FAF, 0, 1 | DECOMP_INLINE, 0x9762},
+ {0x2FB0, 0, 1 | DECOMP_INLINE, 0x9769},
+ {0x2FB1, 0, 1 | DECOMP_INLINE, 0x97CB},
+ {0x2FB2, 0, 1 | DECOMP_INLINE, 0x97ED},
+ {0x2FB3, 0, 1 | DECOMP_INLINE, 0x97F3},
+ {0x2FB4, 0, 1 | DECOMP_INLINE, 0x9801},
+ {0x2FB5, 0, 1 | DECOMP_INLINE, 0x98A8},
+ {0x2FB6, 0, 1 | DECOMP_INLINE, 0x98DB},
+ {0x2FB7, 0, 1 | DECOMP_INLINE, 0x98DF},
+ {0x2FB8, 0, 1 | DECOMP_INLINE, 0x9996},
+ {0x2FB9, 0, 1 | DECOMP_INLINE, 0x9999},
+ {0x2FBA, 0, 1 | DECOMP_INLINE, 0x99AC},
+ {0x2FBB, 0, 1 | DECOMP_INLINE, 0x9AA8},
+ {0x2FBC, 0, 1 | DECOMP_INLINE, 0x9AD8},
+ {0x2FBD, 0, 1 | DECOMP_INLINE, 0x9ADF},
+ {0x2FBE, 0, 1 | DECOMP_INLINE, 0x9B25},
+ {0x2FBF, 0, 1 | DECOMP_INLINE, 0x9B2F},
+ {0x2FC0, 0, 1 | DECOMP_INLINE, 0x9B32},
+ {0x2FC1, 0, 1 | DECOMP_INLINE, 0x9B3C},
+ {0x2FC2, 0, 1 | DECOMP_INLINE, 0x9B5A},
+ {0x2FC3, 0, 1 | DECOMP_INLINE, 0x9CE5},
+ {0x2FC4, 0, 1 | DECOMP_INLINE, 0x9E75},
+ {0x2FC5, 0, 1 | DECOMP_INLINE, 0x9E7F},
+ {0x2FC6, 0, 1 | DECOMP_INLINE, 0x9EA5},
+ {0x2FC7, 0, 1 | DECOMP_INLINE, 0x9EBB},
+ {0x2FC8, 0, 1 | DECOMP_INLINE, 0x9EC3},
+ {0x2FC9, 0, 1 | DECOMP_INLINE, 0x9ECD},
+ {0x2FCA, 0, 1 | DECOMP_INLINE, 0x9ED1},
+ {0x2FCB, 0, 1 | DECOMP_INLINE, 0x9EF9},
+ {0x2FCC, 0, 1 | DECOMP_INLINE, 0x9EFD},
+ {0x2FCD, 0, 1 | DECOMP_INLINE, 0x9F0E},
+ {0x2FCE, 0, 1 | DECOMP_INLINE, 0x9F13},
+ {0x2FCF, 0, 1 | DECOMP_INLINE, 0x9F20},
+ {0x2FD0, 0, 1 | DECOMP_INLINE, 0x9F3B},
+ {0x2FD1, 0, 1 | DECOMP_INLINE, 0x9F4A},
+ {0x2FD2, 0, 1 | DECOMP_INLINE, 0x9F52},
+ {0x2FD3, 0, 1 | DECOMP_INLINE, 0x9F8D},
+ {0x2FD4, 0, 1 | DECOMP_INLINE, 0x9F9C},
+ {0x2FD5, 0, 1 | DECOMP_INLINE, 0x9FA0},
+ {0x3000, 0, 1 | DECOMP_INLINE, 0x0020},
+ {0x302A, 218, 0, 0},
+ {0x302B, 228, 0, 0},
+ {0x302C, 232, 0, 0},
+ {0x302D, 222, 0, 0},
+ {0x302E, 224, 0, 0},
+ {0x302F, 224, 0, 0},
+ {0x3036, 0, 1 | DECOMP_INLINE, 0x3012},
+ {0x3038, 0, 1 | DECOMP_INLINE, 0x5341},
+ {0x3039, 0, 1 | DECOMP_INLINE, 0x5344},
+ {0x303A, 0, 1 | DECOMP_INLINE, 0x5345},
+ {0x304C, 0, 2, 2317},
+ {0x304E, 0, 2, 2319},
+ {0x3050, 0, 2, 2321},
+ {0x3052, 0, 2, 2323},
+ {0x3054, 0, 2, 2325},
+ {0x3056, 0, 2, 2327},
+ {0x3058, 0, 2, 2329},
+ {0x305A, 0, 2, 2331},
+ {0x305C, 0, 2, 2333},
+ {0x305E, 0, 2, 2335},
+ {0x3060, 0, 2, 2337},
+ {0x3062, 0, 2, 2339},
+ {0x3065, 0, 2, 2341},
+ {0x3067, 0, 2, 2343},
+ {0x3069, 0, 2, 2345},
+ {0x3070, 0, 2, 2347},
+ {0x3071, 0, 2, 2349},
+ {0x3073, 0, 2, 2351},
+ {0x3074, 0, 2, 2353},
+ {0x3076, 0, 2, 2355},
+ {0x3077, 0, 2, 2357},
+ {0x3079, 0, 2, 2359},
+ {0x307A, 0, 2, 2361},
+ {0x307C, 0, 2, 2363},
+ {0x307D, 0, 2, 2365},
+ {0x3094, 0, 2, 2367},
+ {0x3099, 8, 0, 0},
+ {0x309A, 8, 0, 0},
+ {0x309B, 0, 2 | DECOMP_NO_COMPOSE, 2369}, /* compatibility mapping */
+ {0x309C, 0, 2 | DECOMP_NO_COMPOSE, 2371}, /* compatibility mapping */
+ {0x309E, 0, 2, 2373},
+ {0x309F, 0, 2 | DECOMP_NO_COMPOSE, 2375}, /* compatibility mapping */
+ {0x30AC, 0, 2, 2377},
+ {0x30AE, 0, 2, 2379},
+ {0x30B0, 0, 2, 2381},
+ {0x30B2, 0, 2, 2383},
+ {0x30B4, 0, 2, 2385},
+ {0x30B6, 0, 2, 2387},
+ {0x30B8, 0, 2, 2389},
+ {0x30BA, 0, 2, 2391},
+ {0x30BC, 0, 2, 2393},
+ {0x30BE, 0, 2, 2395},
+ {0x30C0, 0, 2, 2397},
+ {0x30C2, 0, 2, 2399},
+ {0x30C5, 0, 2, 2401},
+ {0x30C7, 0, 2, 2403},
+ {0x30C9, 0, 2, 2405},
+ {0x30D0, 0, 2, 2407},
+ {0x30D1, 0, 2, 2409},
+ {0x30D3, 0, 2, 2411},
+ {0x30D4, 0, 2, 2413},
+ {0x30D6, 0, 2, 2415},
+ {0x30D7, 0, 2, 2417},
+ {0x30D9, 0, 2, 2419},
+ {0x30DA, 0, 2, 2421},
+ {0x30DC, 0, 2, 2423},
+ {0x30DD, 0, 2, 2425},
+ {0x30F4, 0, 2, 2427},
+ {0x30F7, 0, 2, 2429},
+ {0x30F8, 0, 2, 2431},
+ {0x30F9, 0, 2, 2433},
+ {0x30FA, 0, 2, 2435},
+ {0x30FE, 0, 2, 2437},
+ {0x30FF, 0, 2 | DECOMP_NO_COMPOSE, 2439}, /* compatibility mapping */
+ {0x3131, 0, 1 | DECOMP_INLINE, 0x1100},
+ {0x3132, 0, 1 | DECOMP_INLINE, 0x1101},
+ {0x3133, 0, 1 | DECOMP_INLINE, 0x11AA},
+ {0x3134, 0, 1 | DECOMP_INLINE, 0x1102},
+ {0x3135, 0, 1 | DECOMP_INLINE, 0x11AC},
+ {0x3136, 0, 1 | DECOMP_INLINE, 0x11AD},
+ {0x3137, 0, 1 | DECOMP_INLINE, 0x1103},
+ {0x3138, 0, 1 | DECOMP_INLINE, 0x1104},
+ {0x3139, 0, 1 | DECOMP_INLINE, 0x1105},
+ {0x313A, 0, 1 | DECOMP_INLINE, 0x11B0},
+ {0x313B, 0, 1 | DECOMP_INLINE, 0x11B1},
+ {0x313C, 0, 1 | DECOMP_INLINE, 0x11B2},
+ {0x313D, 0, 1 | DECOMP_INLINE, 0x11B3},
+ {0x313E, 0, 1 | DECOMP_INLINE, 0x11B4},
+ {0x313F, 0, 1 | DECOMP_INLINE, 0x11B5},
+ {0x3140, 0, 1 | DECOMP_INLINE, 0x111A},
+ {0x3141, 0, 1 | DECOMP_INLINE, 0x1106},
+ {0x3142, 0, 1 | DECOMP_INLINE, 0x1107},
+ {0x3143, 0, 1 | DECOMP_INLINE, 0x1108},
+ {0x3144, 0, 1 | DECOMP_INLINE, 0x1121},
+ {0x3145, 0, 1 | DECOMP_INLINE, 0x1109},
+ {0x3146, 0, 1 | DECOMP_INLINE, 0x110A},
+ {0x3147, 0, 1 | DECOMP_INLINE, 0x110B},
+ {0x3148, 0, 1 | DECOMP_INLINE, 0x110C},
+ {0x3149, 0, 1 | DECOMP_INLINE, 0x110D},
+ {0x314A, 0, 1 | DECOMP_INLINE, 0x110E},
+ {0x314B, 0, 1 | DECOMP_INLINE, 0x110F},
+ {0x314C, 0, 1 | DECOMP_INLINE, 0x1110},
+ {0x314D, 0, 1 | DECOMP_INLINE, 0x1111},
+ {0x314E, 0, 1 | DECOMP_INLINE, 0x1112},
+ {0x314F, 0, 1 | DECOMP_INLINE, 0x1161},
+ {0x3150, 0, 1 | DECOMP_INLINE, 0x1162},
+ {0x3151, 0, 1 | DECOMP_INLINE, 0x1163},
+ {0x3152, 0, 1 | DECOMP_INLINE, 0x1164},
+ {0x3153, 0, 1 | DECOMP_INLINE, 0x1165},
+ {0x3154, 0, 1 | DECOMP_INLINE, 0x1166},
+ {0x3155, 0, 1 | DECOMP_INLINE, 0x1167},
+ {0x3156, 0, 1 | DECOMP_INLINE, 0x1168},
+ {0x3157, 0, 1 | DECOMP_INLINE, 0x1169},
+ {0x3158, 0, 1 | DECOMP_INLINE, 0x116A},
+ {0x3159, 0, 1 | DECOMP_INLINE, 0x116B},
+ {0x315A, 0, 1 | DECOMP_INLINE, 0x116C},
+ {0x315B, 0, 1 | DECOMP_INLINE, 0x116D},
+ {0x315C, 0, 1 | DECOMP_INLINE, 0x116E},
+ {0x315D, 0, 1 | DECOMP_INLINE, 0x116F},
+ {0x315E, 0, 1 | DECOMP_INLINE, 0x1170},
+ {0x315F, 0, 1 | DECOMP_INLINE, 0x1171},
+ {0x3160, 0, 1 | DECOMP_INLINE, 0x1172},
+ {0x3161, 0, 1 | DECOMP_INLINE, 0x1173},
+ {0x3162, 0, 1 | DECOMP_INLINE, 0x1174},
+ {0x3163, 0, 1 | DECOMP_INLINE, 0x1175},
+ {0x3164, 0, 1 | DECOMP_INLINE, 0x1160},
+ {0x3165, 0, 1 | DECOMP_INLINE, 0x1114},
+ {0x3166, 0, 1 | DECOMP_INLINE, 0x1115},
+ {0x3167, 0, 1 | DECOMP_INLINE, 0x11C7},
+ {0x3168, 0, 1 | DECOMP_INLINE, 0x11C8},
+ {0x3169, 0, 1 | DECOMP_INLINE, 0x11CC},
+ {0x316A, 0, 1 | DECOMP_INLINE, 0x11CE},
+ {0x316B, 0, 1 | DECOMP_INLINE, 0x11D3},
+ {0x316C, 0, 1 | DECOMP_INLINE, 0x11D7},
+ {0x316D, 0, 1 | DECOMP_INLINE, 0x11D9},
+ {0x316E, 0, 1 | DECOMP_INLINE, 0x111C},
+ {0x316F, 0, 1 | DECOMP_INLINE, 0x11DD},
+ {0x3170, 0, 1 | DECOMP_INLINE, 0x11DF},
+ {0x3171, 0, 1 | DECOMP_INLINE, 0x111D},
+ {0x3172, 0, 1 | DECOMP_INLINE, 0x111E},
+ {0x3173, 0, 1 | DECOMP_INLINE, 0x1120},
+ {0x3174, 0, 1 | DECOMP_INLINE, 0x1122},
+ {0x3175, 0, 1 | DECOMP_INLINE, 0x1123},
+ {0x3176, 0, 1 | DECOMP_INLINE, 0x1127},
+ {0x3177, 0, 1 | DECOMP_INLINE, 0x1129},
+ {0x3178, 0, 1 | DECOMP_INLINE, 0x112B},
+ {0x3179, 0, 1 | DECOMP_INLINE, 0x112C},
+ {0x317A, 0, 1 | DECOMP_INLINE, 0x112D},
+ {0x317B, 0, 1 | DECOMP_INLINE, 0x112E},
+ {0x317C, 0, 1 | DECOMP_INLINE, 0x112F},
+ {0x317D, 0, 1 | DECOMP_INLINE, 0x1132},
+ {0x317E, 0, 1 | DECOMP_INLINE, 0x1136},
+ {0x317F, 0, 1 | DECOMP_INLINE, 0x1140},
+ {0x3180, 0, 1 | DECOMP_INLINE, 0x1147},
+ {0x3181, 0, 1 | DECOMP_INLINE, 0x114C},
+ {0x3182, 0, 1 | DECOMP_INLINE, 0x11F1},
+ {0x3183, 0, 1 | DECOMP_INLINE, 0x11F2},
+ {0x3184, 0, 1 | DECOMP_INLINE, 0x1157},
+ {0x3185, 0, 1 | DECOMP_INLINE, 0x1158},
+ {0x3186, 0, 1 | DECOMP_INLINE, 0x1159},
+ {0x3187, 0, 1 | DECOMP_INLINE, 0x1184},
+ {0x3188, 0, 1 | DECOMP_INLINE, 0x1185},
+ {0x3189, 0, 1 | DECOMP_INLINE, 0x1188},
+ {0x318A, 0, 1 | DECOMP_INLINE, 0x1191},
+ {0x318B, 0, 1 | DECOMP_INLINE, 0x1192},
+ {0x318C, 0, 1 | DECOMP_INLINE, 0x1194},
+ {0x318D, 0, 1 | DECOMP_INLINE, 0x119E},
+ {0x318E, 0, 1 | DECOMP_INLINE, 0x11A1},
+ {0x3192, 0, 1 | DECOMP_INLINE, 0x4E00},
+ {0x3193, 0, 1 | DECOMP_INLINE, 0x4E8C},
+ {0x3194, 0, 1 | DECOMP_INLINE, 0x4E09},
+ {0x3195, 0, 1 | DECOMP_INLINE, 0x56DB},
+ {0x3196, 0, 1 | DECOMP_INLINE, 0x4E0A},
+ {0x3197, 0, 1 | DECOMP_INLINE, 0x4E2D},
+ {0x3198, 0, 1 | DECOMP_INLINE, 0x4E0B},
+ {0x3199, 0, 1 | DECOMP_INLINE, 0x7532},
+ {0x319A, 0, 1 | DECOMP_INLINE, 0x4E59},
+ {0x319B, 0, 1 | DECOMP_INLINE, 0x4E19},
+ {0x319C, 0, 1 | DECOMP_INLINE, 0x4E01},
+ {0x319D, 0, 1 | DECOMP_INLINE, 0x5929},
+ {0x319E, 0, 1 | DECOMP_INLINE, 0x5730},
+ {0x319F, 0, 1 | DECOMP_INLINE, 0x4EBA},
+ {0x3200, 0, 3, 2441},
+ {0x3201, 0, 3, 2444},
+ {0x3202, 0, 3, 2447},
+ {0x3203, 0, 3, 2450},
+ {0x3204, 0, 3, 2453},
+ {0x3205, 0, 3, 2456},
+ {0x3206, 0, 3, 2459},
+ {0x3207, 0, 3, 2462},
+ {0x3208, 0, 3, 2465},
+ {0x3209, 0, 3, 2468},
+ {0x320A, 0, 3, 2471},
+ {0x320B, 0, 3, 2474},
+ {0x320C, 0, 3, 2477},
+ {0x320D, 0, 3, 2480},
+ {0x320E, 0, 4, 2483},
+ {0x320F, 0, 4, 2487},
+ {0x3210, 0, 4, 2491},
+ {0x3211, 0, 4, 2495},
+ {0x3212, 0, 4, 2499},
+ {0x3213, 0, 4, 2503},
+ {0x3214, 0, 4, 2507},
+ {0x3215, 0, 4, 2511},
+ {0x3216, 0, 4, 2515},
+ {0x3217, 0, 4, 2519},
+ {0x3218, 0, 4, 2523},
+ {0x3219, 0, 4, 2527},
+ {0x321A, 0, 4, 2531},
+ {0x321B, 0, 4, 2535},
+ {0x321C, 0, 4, 2539},
+ {0x321D, 0, 7, 2543},
+ {0x321E, 0, 6, 2550},
+ {0x3220, 0, 3, 2556},
+ {0x3221, 0, 3, 2559},
+ {0x3222, 0, 3, 2562},
+ {0x3223, 0, 3, 2565},
+ {0x3224, 0, 3, 2568},
+ {0x3225, 0, 3, 2571},
+ {0x3226, 0, 3, 2574},
+ {0x3227, 0, 3, 2577},
+ {0x3228, 0, 3, 2580},
+ {0x3229, 0, 3, 2583},
+ {0x322A, 0, 3, 2586},
+ {0x322B, 0, 3, 2589},
+ {0x322C, 0, 3, 2592},
+ {0x322D, 0, 3, 2595},
+ {0x322E, 0, 3, 2598},
+ {0x322F, 0, 3, 2601},
+ {0x3230, 0, 3, 2604},
+ {0x3231, 0, 3, 2607},
+ {0x3232, 0, 3, 2610},
+ {0x3233, 0, 3, 2613},
+ {0x3234, 0, 3, 2616},
+ {0x3235, 0, 3, 2619},
+ {0x3236, 0, 3, 2622},
+ {0x3237, 0, 3, 2625},
+ {0x3238, 0, 3, 2628},
+ {0x3239, 0, 3, 2631},
+ {0x323A, 0, 3, 2634},
+ {0x323B, 0, 3, 2637},
+ {0x323C, 0, 3, 2640},
+ {0x323D, 0, 3, 2643},
+ {0x323E, 0, 3, 2646},
+ {0x323F, 0, 3, 2649},
+ {0x3240, 0, 3, 2652},
+ {0x3241, 0, 3, 2655},
+ {0x3242, 0, 3, 2658},
+ {0x3243, 0, 3, 2661},
+ {0x3244, 0, 1 | DECOMP_INLINE, 0x554F},
+ {0x3245, 0, 1 | DECOMP_INLINE, 0x5E7C},
+ {0x3246, 0, 1 | DECOMP_INLINE, 0x6587},
+ {0x3247, 0, 1 | DECOMP_INLINE, 0x7B8F},
+ {0x3250, 0, 3, 2664},
+ {0x3251, 0, 2 | DECOMP_NO_COMPOSE, 2667}, /* compatibility mapping */
+ {0x3252, 0, 2 | DECOMP_NO_COMPOSE, 2669}, /* compatibility mapping */
+ {0x3253, 0, 2 | DECOMP_NO_COMPOSE, 2671}, /* compatibility mapping */
+ {0x3254, 0, 2 | DECOMP_NO_COMPOSE, 2673}, /* compatibility mapping */
+ {0x3255, 0, 2 | DECOMP_NO_COMPOSE, 2675}, /* compatibility mapping */
+ {0x3256, 0, 2 | DECOMP_NO_COMPOSE, 2677}, /* compatibility mapping */
+ {0x3257, 0, 2 | DECOMP_NO_COMPOSE, 2679}, /* compatibility mapping */
+ {0x3258, 0, 2 | DECOMP_NO_COMPOSE, 2681}, /* compatibility mapping */
+ {0x3259, 0, 2 | DECOMP_NO_COMPOSE, 2683}, /* compatibility mapping */
+ {0x325A, 0, 2 | DECOMP_NO_COMPOSE, 2685}, /* compatibility mapping */
+ {0x325B, 0, 2 | DECOMP_NO_COMPOSE, 2687}, /* compatibility mapping */
+ {0x325C, 0, 2 | DECOMP_NO_COMPOSE, 2689}, /* compatibility mapping */
+ {0x325D, 0, 2 | DECOMP_NO_COMPOSE, 2691}, /* compatibility mapping */
+ {0x325E, 0, 2 | DECOMP_NO_COMPOSE, 2693}, /* compatibility mapping */
+ {0x325F, 0, 2 | DECOMP_NO_COMPOSE, 2695}, /* compatibility mapping */
+ {0x3260, 0, 1 | DECOMP_INLINE, 0x1100},
+ {0x3261, 0, 1 | DECOMP_INLINE, 0x1102},
+ {0x3262, 0, 1 | DECOMP_INLINE, 0x1103},
+ {0x3263, 0, 1 | DECOMP_INLINE, 0x1105},
+ {0x3264, 0, 1 | DECOMP_INLINE, 0x1106},
+ {0x3265, 0, 1 | DECOMP_INLINE, 0x1107},
+ {0x3266, 0, 1 | DECOMP_INLINE, 0x1109},
+ {0x3267, 0, 1 | DECOMP_INLINE, 0x110B},
+ {0x3268, 0, 1 | DECOMP_INLINE, 0x110C},
+ {0x3269, 0, 1 | DECOMP_INLINE, 0x110E},
+ {0x326A, 0, 1 | DECOMP_INLINE, 0x110F},
+ {0x326B, 0, 1 | DECOMP_INLINE, 0x1110},
+ {0x326C, 0, 1 | DECOMP_INLINE, 0x1111},
+ {0x326D, 0, 1 | DECOMP_INLINE, 0x1112},
+ {0x326E, 0, 2 | DECOMP_NO_COMPOSE, 2697}, /* compatibility mapping */
+ {0x326F, 0, 2 | DECOMP_NO_COMPOSE, 2699}, /* compatibility mapping */
+ {0x3270, 0, 2 | DECOMP_NO_COMPOSE, 2701}, /* compatibility mapping */
+ {0x3271, 0, 2 | DECOMP_NO_COMPOSE, 2703}, /* compatibility mapping */
+ {0x3272, 0, 2 | DECOMP_NO_COMPOSE, 2705}, /* compatibility mapping */
+ {0x3273, 0, 2 | DECOMP_NO_COMPOSE, 2707}, /* compatibility mapping */
+ {0x3274, 0, 2 | DECOMP_NO_COMPOSE, 2709}, /* compatibility mapping */
+ {0x3275, 0, 2 | DECOMP_NO_COMPOSE, 2711}, /* compatibility mapping */
+ {0x3276, 0, 2 | DECOMP_NO_COMPOSE, 2713}, /* compatibility mapping */
+ {0x3277, 0, 2 | DECOMP_NO_COMPOSE, 2715}, /* compatibility mapping */
+ {0x3278, 0, 2 | DECOMP_NO_COMPOSE, 2717}, /* compatibility mapping */
+ {0x3279, 0, 2 | DECOMP_NO_COMPOSE, 2719}, /* compatibility mapping */
+ {0x327A, 0, 2 | DECOMP_NO_COMPOSE, 2721}, /* compatibility mapping */
+ {0x327B, 0, 2 | DECOMP_NO_COMPOSE, 2723}, /* compatibility mapping */
+ {0x327C, 0, 5, 2725},
+ {0x327D, 0, 4, 2730},
+ {0x327E, 0, 2 | DECOMP_NO_COMPOSE, 2734}, /* compatibility mapping */
+ {0x3280, 0, 1 | DECOMP_INLINE, 0x4E00},
+ {0x3281, 0, 1 | DECOMP_INLINE, 0x4E8C},
+ {0x3282, 0, 1 | DECOMP_INLINE, 0x4E09},
+ {0x3283, 0, 1 | DECOMP_INLINE, 0x56DB},
+ {0x3284, 0, 1 | DECOMP_INLINE, 0x4E94},
+ {0x3285, 0, 1 | DECOMP_INLINE, 0x516D},
+ {0x3286, 0, 1 | DECOMP_INLINE, 0x4E03},
+ {0x3287, 0, 1 | DECOMP_INLINE, 0x516B},
+ {0x3288, 0, 1 | DECOMP_INLINE, 0x4E5D},
+ {0x3289, 0, 1 | DECOMP_INLINE, 0x5341},
+ {0x328A, 0, 1 | DECOMP_INLINE, 0x6708},
+ {0x328B, 0, 1 | DECOMP_INLINE, 0x706B},
+ {0x328C, 0, 1 | DECOMP_INLINE, 0x6C34},
+ {0x328D, 0, 1 | DECOMP_INLINE, 0x6728},
+ {0x328E, 0, 1 | DECOMP_INLINE, 0x91D1},
+ {0x328F, 0, 1 | DECOMP_INLINE, 0x571F},
+ {0x3290, 0, 1 | DECOMP_INLINE, 0x65E5},
+ {0x3291, 0, 1 | DECOMP_INLINE, 0x682A},
+ {0x3292, 0, 1 | DECOMP_INLINE, 0x6709},
+ {0x3293, 0, 1 | DECOMP_INLINE, 0x793E},
+ {0x3294, 0, 1 | DECOMP_INLINE, 0x540D},
+ {0x3295, 0, 1 | DECOMP_INLINE, 0x7279},
+ {0x3296, 0, 1 | DECOMP_INLINE, 0x8CA1},
+ {0x3297, 0, 1 | DECOMP_INLINE, 0x795D},
+ {0x3298, 0, 1 | DECOMP_INLINE, 0x52B4},
+ {0x3299, 0, 1 | DECOMP_INLINE, 0x79D8},
+ {0x329A, 0, 1 | DECOMP_INLINE, 0x7537},
+ {0x329B, 0, 1 | DECOMP_INLINE, 0x5973},
+ {0x329C, 0, 1 | DECOMP_INLINE, 0x9069},
+ {0x329D, 0, 1 | DECOMP_INLINE, 0x512A},
+ {0x329E, 0, 1 | DECOMP_INLINE, 0x5370},
+ {0x329F, 0, 1 | DECOMP_INLINE, 0x6CE8},
+ {0x32A0, 0, 1 | DECOMP_INLINE, 0x9805},
+ {0x32A1, 0, 1 | DECOMP_INLINE, 0x4F11},
+ {0x32A2, 0, 1 | DECOMP_INLINE, 0x5199},
+ {0x32A3, 0, 1 | DECOMP_INLINE, 0x6B63},
+ {0x32A4, 0, 1 | DECOMP_INLINE, 0x4E0A},
+ {0x32A5, 0, 1 | DECOMP_INLINE, 0x4E2D},
+ {0x32A6, 0, 1 | DECOMP_INLINE, 0x4E0B},
+ {0x32A7, 0, 1 | DECOMP_INLINE, 0x5DE6},
+ {0x32A8, 0, 1 | DECOMP_INLINE, 0x53F3},
+ {0x32A9, 0, 1 | DECOMP_INLINE, 0x533B},
+ {0x32AA, 0, 1 | DECOMP_INLINE, 0x5B97},
+ {0x32AB, 0, 1 | DECOMP_INLINE, 0x5B66},
+ {0x32AC, 0, 1 | DECOMP_INLINE, 0x76E3},
+ {0x32AD, 0, 1 | DECOMP_INLINE, 0x4F01},
+ {0x32AE, 0, 1 | DECOMP_INLINE, 0x8CC7},
+ {0x32AF, 0, 1 | DECOMP_INLINE, 0x5354},
+ {0x32B0, 0, 1 | DECOMP_INLINE, 0x591C},
+ {0x32B1, 0, 2 | DECOMP_NO_COMPOSE, 2736}, /* compatibility mapping */
+ {0x32B2, 0, 2 | DECOMP_NO_COMPOSE, 2738}, /* compatibility mapping */
+ {0x32B3, 0, 2 | DECOMP_NO_COMPOSE, 2740}, /* compatibility mapping */
+ {0x32B4, 0, 2 | DECOMP_NO_COMPOSE, 2742}, /* compatibility mapping */
+ {0x32B5, 0, 2 | DECOMP_NO_COMPOSE, 2744}, /* compatibility mapping */
+ {0x32B6, 0, 2 | DECOMP_NO_COMPOSE, 2746}, /* compatibility mapping */
+ {0x32B7, 0, 2 | DECOMP_NO_COMPOSE, 2748}, /* compatibility mapping */
+ {0x32B8, 0, 2 | DECOMP_NO_COMPOSE, 2750}, /* compatibility mapping */
+ {0x32B9, 0, 2 | DECOMP_NO_COMPOSE, 2752}, /* compatibility mapping */
+ {0x32BA, 0, 2 | DECOMP_NO_COMPOSE, 2754}, /* compatibility mapping */
+ {0x32BB, 0, 2 | DECOMP_NO_COMPOSE, 2756}, /* compatibility mapping */
+ {0x32BC, 0, 2 | DECOMP_NO_COMPOSE, 2758}, /* compatibility mapping */
+ {0x32BD, 0, 2 | DECOMP_NO_COMPOSE, 2760}, /* compatibility mapping */
+ {0x32BE, 0, 2 | DECOMP_NO_COMPOSE, 2762}, /* compatibility mapping */
+ {0x32BF, 0, 2 | DECOMP_NO_COMPOSE, 2764}, /* compatibility mapping */
+ {0x32C0, 0, 2 | DECOMP_NO_COMPOSE, 2766}, /* compatibility mapping */
+ {0x32C1, 0, 2 | DECOMP_NO_COMPOSE, 2768}, /* compatibility mapping */
+ {0x32C2, 0, 2 | DECOMP_NO_COMPOSE, 2770}, /* compatibility mapping */
+ {0x32C3, 0, 2 | DECOMP_NO_COMPOSE, 2772}, /* compatibility mapping */
+ {0x32C4, 0, 2 | DECOMP_NO_COMPOSE, 2774}, /* compatibility mapping */
+ {0x32C5, 0, 2 | DECOMP_NO_COMPOSE, 2776}, /* compatibility mapping */
+ {0x32C6, 0, 2 | DECOMP_NO_COMPOSE, 2778}, /* compatibility mapping */
+ {0x32C7, 0, 2 | DECOMP_NO_COMPOSE, 2780}, /* compatibility mapping */
+ {0x32C8, 0, 2 | DECOMP_NO_COMPOSE, 2782}, /* compatibility mapping */
+ {0x32C9, 0, 3, 2784},
+ {0x32CA, 0, 3, 2787},
+ {0x32CB, 0, 3, 2790},
+ {0x32CC, 0, 2 | DECOMP_NO_COMPOSE, 2793}, /* compatibility mapping */
+ {0x32CD, 0, 3, 2795},
+ {0x32CE, 0, 2 | DECOMP_NO_COMPOSE, 2798}, /* compatibility mapping */
+ {0x32CF, 0, 3, 2800},
+ {0x32D0, 0, 1 | DECOMP_INLINE, 0x30A2},
+ {0x32D1, 0, 1 | DECOMP_INLINE, 0x30A4},
+ {0x32D2, 0, 1 | DECOMP_INLINE, 0x30A6},
+ {0x32D3, 0, 1 | DECOMP_INLINE, 0x30A8},
+ {0x32D4, 0, 1 | DECOMP_INLINE, 0x30AA},
+ {0x32D5, 0, 1 | DECOMP_INLINE, 0x30AB},
+ {0x32D6, 0, 1 | DECOMP_INLINE, 0x30AD},
+ {0x32D7, 0, 1 | DECOMP_INLINE, 0x30AF},
+ {0x32D8, 0, 1 | DECOMP_INLINE, 0x30B1},
+ {0x32D9, 0, 1 | DECOMP_INLINE, 0x30B3},
+ {0x32DA, 0, 1 | DECOMP_INLINE, 0x30B5},
+ {0x32DB, 0, 1 | DECOMP_INLINE, 0x30B7},
+ {0x32DC, 0, 1 | DECOMP_INLINE, 0x30B9},
+ {0x32DD, 0, 1 | DECOMP_INLINE, 0x30BB},
+ {0x32DE, 0, 1 | DECOMP_INLINE, 0x30BD},
+ {0x32DF, 0, 1 | DECOMP_INLINE, 0x30BF},
+ {0x32E0, 0, 1 | DECOMP_INLINE, 0x30C1},
+ {0x32E1, 0, 1 | DECOMP_INLINE, 0x30C4},
+ {0x32E2, 0, 1 | DECOMP_INLINE, 0x30C6},
+ {0x32E3, 0, 1 | DECOMP_INLINE, 0x30C8},
+ {0x32E4, 0, 1 | DECOMP_INLINE, 0x30CA},
+ {0x32E5, 0, 1 | DECOMP_INLINE, 0x30CB},
+ {0x32E6, 0, 1 | DECOMP_INLINE, 0x30CC},
+ {0x32E7, 0, 1 | DECOMP_INLINE, 0x30CD},
+ {0x32E8, 0, 1 | DECOMP_INLINE, 0x30CE},
+ {0x32E9, 0, 1 | DECOMP_INLINE, 0x30CF},
+ {0x32EA, 0, 1 | DECOMP_INLINE, 0x30D2},
+ {0x32EB, 0, 1 | DECOMP_INLINE, 0x30D5},
+ {0x32EC, 0, 1 | DECOMP_INLINE, 0x30D8},
+ {0x32ED, 0, 1 | DECOMP_INLINE, 0x30DB},
+ {0x32EE, 0, 1 | DECOMP_INLINE, 0x30DE},
+ {0x32EF, 0, 1 | DECOMP_INLINE, 0x30DF},
+ {0x32F0, 0, 1 | DECOMP_INLINE, 0x30E0},
+ {0x32F1, 0, 1 | DECOMP_INLINE, 0x30E1},
+ {0x32F2, 0, 1 | DECOMP_INLINE, 0x30E2},
+ {0x32F3, 0, 1 | DECOMP_INLINE, 0x30E4},
+ {0x32F4, 0, 1 | DECOMP_INLINE, 0x30E6},
+ {0x32F5, 0, 1 | DECOMP_INLINE, 0x30E8},
+ {0x32F6, 0, 1 | DECOMP_INLINE, 0x30E9},
+ {0x32F7, 0, 1 | DECOMP_INLINE, 0x30EA},
+ {0x32F8, 0, 1 | DECOMP_INLINE, 0x30EB},
+ {0x32F9, 0, 1 | DECOMP_INLINE, 0x30EC},
+ {0x32FA, 0, 1 | DECOMP_INLINE, 0x30ED},
+ {0x32FB, 0, 1 | DECOMP_INLINE, 0x30EF},
+ {0x32FC, 0, 1 | DECOMP_INLINE, 0x30F0},
+ {0x32FD, 0, 1 | DECOMP_INLINE, 0x30F1},
+ {0x32FE, 0, 1 | DECOMP_INLINE, 0x30F2},
+ {0x3300, 0, 4, 2803},
+ {0x3301, 0, 4, 2807},
+ {0x3302, 0, 4, 2811},
+ {0x3303, 0, 3, 2815},
+ {0x3304, 0, 4, 2818},
+ {0x3305, 0, 3, 2822},
+ {0x3306, 0, 3, 2825},
+ {0x3307, 0, 5, 2828},
+ {0x3308, 0, 4, 2833},
+ {0x3309, 0, 3, 2837},
+ {0x330A, 0, 3, 2840},
+ {0x330B, 0, 3, 2843},
+ {0x330C, 0, 4, 2846},
+ {0x330D, 0, 4, 2850},
+ {0x330E, 0, 3, 2854},
+ {0x330F, 0, 3, 2857},
+ {0x3310, 0, 2 | DECOMP_NO_COMPOSE, 2860}, /* compatibility mapping */
+ {0x3311, 0, 3, 2862},
+ {0x3312, 0, 4, 2865},
+ {0x3313, 0, 4, 2869},
+ {0x3314, 0, 2 | DECOMP_NO_COMPOSE, 2873}, /* compatibility mapping */
+ {0x3315, 0, 5, 2875},
+ {0x3316, 0, 6, 2880},
+ {0x3317, 0, 5, 2886},
+ {0x3318, 0, 3, 2891},
+ {0x3319, 0, 5, 2894},
+ {0x331A, 0, 5, 2899},
+ {0x331B, 0, 4, 2904},
+ {0x331C, 0, 3, 2908},
+ {0x331D, 0, 3, 2911},
+ {0x331E, 0, 3, 2914},
+ {0x331F, 0, 4, 2917},
+ {0x3320, 0, 5, 2921},
+ {0x3321, 0, 4, 2926},
+ {0x3322, 0, 3, 2930},
+ {0x3323, 0, 3, 2933},
+ {0x3324, 0, 3, 2936},
+ {0x3325, 0, 2 | DECOMP_NO_COMPOSE, 2939}, /* compatibility mapping */
+ {0x3326, 0, 2 | DECOMP_NO_COMPOSE, 2941}, /* compatibility mapping */
+ {0x3327, 0, 2 | DECOMP_NO_COMPOSE, 2943}, /* compatibility mapping */
+ {0x3328, 0, 2 | DECOMP_NO_COMPOSE, 2945}, /* compatibility mapping */
+ {0x3329, 0, 3, 2947},
+ {0x332A, 0, 3, 2950},
+ {0x332B, 0, 5, 2953},
+ {0x332C, 0, 3, 2958},
+ {0x332D, 0, 4, 2961},
+ {0x332E, 0, 5, 2965},
+ {0x332F, 0, 3, 2970},
+ {0x3330, 0, 2 | DECOMP_NO_COMPOSE, 2973}, /* compatibility mapping */
+ {0x3331, 0, 2 | DECOMP_NO_COMPOSE, 2975}, /* compatibility mapping */
+ {0x3332, 0, 5, 2977},
+ {0x3333, 0, 4, 2982},
+ {0x3334, 0, 5, 2986},
+ {0x3335, 0, 3, 2991},
+ {0x3336, 0, 5, 2994},
+ {0x3337, 0, 2 | DECOMP_NO_COMPOSE, 2999}, /* compatibility mapping */
+ {0x3338, 0, 3, 3001},
+ {0x3339, 0, 3, 3004},
+ {0x333A, 0, 3, 3007},
+ {0x333B, 0, 3, 3010},
+ {0x333C, 0, 3, 3013},
+ {0x333D, 0, 4, 3016},
+ {0x333E, 0, 3, 3020},
+ {0x333F, 0, 2 | DECOMP_NO_COMPOSE, 3023}, /* compatibility mapping */
+ {0x3340, 0, 3, 3025},
+ {0x3341, 0, 3, 3028},
+ {0x3342, 0, 3, 3031},
+ {0x3343, 0, 4, 3034},
+ {0x3344, 0, 3, 3038},
+ {0x3345, 0, 3, 3041},
+ {0x3346, 0, 3, 3044},
+ {0x3347, 0, 5, 3047},
+ {0x3348, 0, 4, 3052},
+ {0x3349, 0, 2 | DECOMP_NO_COMPOSE, 3056}, /* compatibility mapping */
+ {0x334A, 0, 5, 3058},
+ {0x334B, 0, 2 | DECOMP_NO_COMPOSE, 3063}, /* compatibility mapping */
+ {0x334C, 0, 4, 3065},
+ {0x334D, 0, 4, 3069},
+ {0x334E, 0, 3, 3073},
+ {0x334F, 0, 3, 3076},
+ {0x3350, 0, 3, 3079},
+ {0x3351, 0, 4, 3082},
+ {0x3352, 0, 2 | DECOMP_NO_COMPOSE, 3086}, /* compatibility mapping */
+ {0x3353, 0, 3, 3088},
+ {0x3354, 0, 4, 3091},
+ {0x3355, 0, 2 | DECOMP_NO_COMPOSE, 3095}, /* compatibility mapping */
+ {0x3356, 0, 5, 3097},
+ {0x3357, 0, 3, 3102},
+ {0x3358, 0, 2 | DECOMP_NO_COMPOSE, 3105}, /* compatibility mapping */
+ {0x3359, 0, 2 | DECOMP_NO_COMPOSE, 3107}, /* compatibility mapping */
+ {0x335A, 0, 2 | DECOMP_NO_COMPOSE, 3109}, /* compatibility mapping */
+ {0x335B, 0, 2 | DECOMP_NO_COMPOSE, 3111}, /* compatibility mapping */
+ {0x335C, 0, 2 | DECOMP_NO_COMPOSE, 3113}, /* compatibility mapping */
+ {0x335D, 0, 2 | DECOMP_NO_COMPOSE, 3115}, /* compatibility mapping */
+ {0x335E, 0, 2 | DECOMP_NO_COMPOSE, 3117}, /* compatibility mapping */
+ {0x335F, 0, 2 | DECOMP_NO_COMPOSE, 3119}, /* compatibility mapping */
+ {0x3360, 0, 2 | DECOMP_NO_COMPOSE, 3121}, /* compatibility mapping */
+ {0x3361, 0, 2 | DECOMP_NO_COMPOSE, 3123}, /* compatibility mapping */
+ {0x3362, 0, 3, 3125},
+ {0x3363, 0, 3, 3128},
+ {0x3364, 0, 3, 3131},
+ {0x3365, 0, 3, 3134},
+ {0x3366, 0, 3, 3137},
+ {0x3367, 0, 3, 3140},
+ {0x3368, 0, 3, 3143},
+ {0x3369, 0, 3, 3146},
+ {0x336A, 0, 3, 3149},
+ {0x336B, 0, 3, 3152},
+ {0x336C, 0, 3, 3155},
+ {0x336D, 0, 3, 3158},
+ {0x336E, 0, 3, 3161},
+ {0x336F, 0, 3, 3164},
+ {0x3370, 0, 3, 3167},
+ {0x3371, 0, 3, 3170},
+ {0x3372, 0, 2 | DECOMP_NO_COMPOSE, 3173}, /* compatibility mapping */
+ {0x3373, 0, 2 | DECOMP_NO_COMPOSE, 3175}, /* compatibility mapping */
+ {0x3374, 0, 3, 3177},
+ {0x3375, 0, 2 | DECOMP_NO_COMPOSE, 3180}, /* compatibility mapping */
+ {0x3376, 0, 2 | DECOMP_NO_COMPOSE, 3182}, /* compatibility mapping */
+ {0x3377, 0, 2 | DECOMP_NO_COMPOSE, 3184}, /* compatibility mapping */
+ {0x3378, 0, 3, 3186},
+ {0x3379, 0, 3, 3189},
+ {0x337A, 0, 2 | DECOMP_NO_COMPOSE, 3192}, /* compatibility mapping */
+ {0x337B, 0, 2 | DECOMP_NO_COMPOSE, 3194}, /* compatibility mapping */
+ {0x337C, 0, 2 | DECOMP_NO_COMPOSE, 3196}, /* compatibility mapping */
+ {0x337D, 0, 2 | DECOMP_NO_COMPOSE, 3198}, /* compatibility mapping */
+ {0x337E, 0, 2 | DECOMP_NO_COMPOSE, 3200}, /* compatibility mapping */
+ {0x337F, 0, 4, 3202},
+ {0x3380, 0, 2 | DECOMP_NO_COMPOSE, 3206}, /* compatibility mapping */
+ {0x3381, 0, 2 | DECOMP_NO_COMPOSE, 3208}, /* compatibility mapping */
+ {0x3382, 0, 2 | DECOMP_NO_COMPOSE, 3210}, /* compatibility mapping */
+ {0x3383, 0, 2 | DECOMP_NO_COMPOSE, 3212}, /* compatibility mapping */
+ {0x3384, 0, 2 | DECOMP_NO_COMPOSE, 3214}, /* compatibility mapping */
+ {0x3385, 0, 2 | DECOMP_NO_COMPOSE, 3216}, /* compatibility mapping */
+ {0x3386, 0, 2 | DECOMP_NO_COMPOSE, 3218}, /* compatibility mapping */
+ {0x3387, 0, 2 | DECOMP_NO_COMPOSE, 3220}, /* compatibility mapping */
+ {0x3388, 0, 3, 3222},
+ {0x3389, 0, 4, 3225},
+ {0x338A, 0, 2 | DECOMP_NO_COMPOSE, 3229}, /* compatibility mapping */
+ {0x338B, 0, 2 | DECOMP_NO_COMPOSE, 3231}, /* compatibility mapping */
+ {0x338C, 0, 2 | DECOMP_NO_COMPOSE, 3233}, /* compatibility mapping */
+ {0x338D, 0, 2 | DECOMP_NO_COMPOSE, 3235}, /* compatibility mapping */
+ {0x338E, 0, 2 | DECOMP_NO_COMPOSE, 3237}, /* compatibility mapping */
+ {0x338F, 0, 2 | DECOMP_NO_COMPOSE, 3239}, /* compatibility mapping */
+ {0x3390, 0, 2 | DECOMP_NO_COMPOSE, 3241}, /* compatibility mapping */
+ {0x3391, 0, 3, 3243},
+ {0x3392, 0, 3, 3246},
+ {0x3393, 0, 3, 3249},
+ {0x3394, 0, 3, 3252},
+ {0x3395, 0, 2 | DECOMP_NO_COMPOSE, 3255}, /* compatibility mapping */
+ {0x3396, 0, 2 | DECOMP_NO_COMPOSE, 3257}, /* compatibility mapping */
+ {0x3397, 0, 2 | DECOMP_NO_COMPOSE, 3259}, /* compatibility mapping */
+ {0x3398, 0, 2 | DECOMP_NO_COMPOSE, 3261}, /* compatibility mapping */
+ {0x3399, 0, 2 | DECOMP_NO_COMPOSE, 3263}, /* compatibility mapping */
+ {0x339A, 0, 2 | DECOMP_NO_COMPOSE, 3265}, /* compatibility mapping */
+ {0x339B, 0, 2 | DECOMP_NO_COMPOSE, 3267}, /* compatibility mapping */
+ {0x339C, 0, 2 | DECOMP_NO_COMPOSE, 3269}, /* compatibility mapping */
+ {0x339D, 0, 2 | DECOMP_NO_COMPOSE, 3271}, /* compatibility mapping */
+ {0x339E, 0, 2 | DECOMP_NO_COMPOSE, 3273}, /* compatibility mapping */
+ {0x339F, 0, 3, 3275},
+ {0x33A0, 0, 3, 3278},
+ {0x33A1, 0, 2 | DECOMP_NO_COMPOSE, 3281}, /* compatibility mapping */
+ {0x33A2, 0, 3, 3283},
+ {0x33A3, 0, 3, 3286},
+ {0x33A4, 0, 3, 3289},
+ {0x33A5, 0, 2 | DECOMP_NO_COMPOSE, 3292}, /* compatibility mapping */
+ {0x33A6, 0, 3, 3294},
+ {0x33A7, 0, 3, 3297},
+ {0x33A8, 0, 4, 3300},
+ {0x33A9, 0, 2 | DECOMP_NO_COMPOSE, 3304}, /* compatibility mapping */
+ {0x33AA, 0, 3, 3306},
+ {0x33AB, 0, 3, 3309},
+ {0x33AC, 0, 3, 3312},
+ {0x33AD, 0, 3, 3315},
+ {0x33AE, 0, 5, 3318},
+ {0x33AF, 0, 6, 3323},
+ {0x33B0, 0, 2 | DECOMP_NO_COMPOSE, 3329}, /* compatibility mapping */
+ {0x33B1, 0, 2 | DECOMP_NO_COMPOSE, 3331}, /* compatibility mapping */
+ {0x33B2, 0, 2 | DECOMP_NO_COMPOSE, 3333}, /* compatibility mapping */
+ {0x33B3, 0, 2 | DECOMP_NO_COMPOSE, 3335}, /* compatibility mapping */
+ {0x33B4, 0, 2 | DECOMP_NO_COMPOSE, 3337}, /* compatibility mapping */
+ {0x33B5, 0, 2 | DECOMP_NO_COMPOSE, 3339}, /* compatibility mapping */
+ {0x33B6, 0, 2 | DECOMP_NO_COMPOSE, 3341}, /* compatibility mapping */
+ {0x33B7, 0, 2 | DECOMP_NO_COMPOSE, 3343}, /* compatibility mapping */
+ {0x33B8, 0, 2 | DECOMP_NO_COMPOSE, 3345}, /* compatibility mapping */
+ {0x33B9, 0, 2 | DECOMP_NO_COMPOSE, 3347}, /* compatibility mapping */
+ {0x33BA, 0, 2 | DECOMP_NO_COMPOSE, 3349}, /* compatibility mapping */
+ {0x33BB, 0, 2 | DECOMP_NO_COMPOSE, 3351}, /* compatibility mapping */
+ {0x33BC, 0, 2 | DECOMP_NO_COMPOSE, 3353}, /* compatibility mapping */
+ {0x33BD, 0, 2 | DECOMP_NO_COMPOSE, 3355}, /* compatibility mapping */
+ {0x33BE, 0, 2 | DECOMP_NO_COMPOSE, 3357}, /* compatibility mapping */
+ {0x33BF, 0, 2 | DECOMP_NO_COMPOSE, 3359}, /* compatibility mapping */
+ {0x33C0, 0, 2 | DECOMP_NO_COMPOSE, 3361}, /* compatibility mapping */
+ {0x33C1, 0, 2 | DECOMP_NO_COMPOSE, 3363}, /* compatibility mapping */
+ {0x33C2, 0, 4, 3365},
+ {0x33C3, 0, 2 | DECOMP_NO_COMPOSE, 3369}, /* compatibility mapping */
+ {0x33C4, 0, 2 | DECOMP_NO_COMPOSE, 3371}, /* compatibility mapping */
+ {0x33C5, 0, 2 | DECOMP_NO_COMPOSE, 3373}, /* compatibility mapping */
+ {0x33C6, 0, 4, 3375},
+ {0x33C7, 0, 3, 3379},
+ {0x33C8, 0, 2 | DECOMP_NO_COMPOSE, 3382}, /* compatibility mapping */
+ {0x33C9, 0, 2 | DECOMP_NO_COMPOSE, 3384}, /* compatibility mapping */
+ {0x33CA, 0, 2 | DECOMP_NO_COMPOSE, 3386}, /* compatibility mapping */
+ {0x33CB, 0, 2 | DECOMP_NO_COMPOSE, 3388}, /* compatibility mapping */
+ {0x33CC, 0, 2 | DECOMP_NO_COMPOSE, 3390}, /* compatibility mapping */
+ {0x33CD, 0, 2 | DECOMP_NO_COMPOSE, 3392}, /* compatibility mapping */
+ {0x33CE, 0, 2 | DECOMP_NO_COMPOSE, 3394}, /* compatibility mapping */
+ {0x33CF, 0, 2 | DECOMP_NO_COMPOSE, 3396}, /* compatibility mapping */
+ {0x33D0, 0, 2 | DECOMP_NO_COMPOSE, 3398}, /* compatibility mapping */
+ {0x33D1, 0, 2 | DECOMP_NO_COMPOSE, 3400}, /* compatibility mapping */
+ {0x33D2, 0, 3, 3402},
+ {0x33D3, 0, 2 | DECOMP_NO_COMPOSE, 3405}, /* compatibility mapping */
+ {0x33D4, 0, 2 | DECOMP_NO_COMPOSE, 3407}, /* compatibility mapping */
+ {0x33D5, 0, 3, 3409},
+ {0x33D6, 0, 3, 3412},
+ {0x33D7, 0, 2 | DECOMP_NO_COMPOSE, 3415}, /* compatibility mapping */
+ {0x33D8, 0, 4, 3417},
+ {0x33D9, 0, 3, 3421},
+ {0x33DA, 0, 2 | DECOMP_NO_COMPOSE, 3424}, /* compatibility mapping */
+ {0x33DB, 0, 2 | DECOMP_NO_COMPOSE, 3426}, /* compatibility mapping */
+ {0x33DC, 0, 2 | DECOMP_NO_COMPOSE, 3428}, /* compatibility mapping */
+ {0x33DD, 0, 2 | DECOMP_NO_COMPOSE, 3430}, /* compatibility mapping */
+ {0x33DE, 0, 3, 3432},
+ {0x33DF, 0, 3, 3435},
+ {0x33E0, 0, 2 | DECOMP_NO_COMPOSE, 3438}, /* compatibility mapping */
+ {0x33E1, 0, 2 | DECOMP_NO_COMPOSE, 3440}, /* compatibility mapping */
+ {0x33E2, 0, 2 | DECOMP_NO_COMPOSE, 3442}, /* compatibility mapping */
+ {0x33E3, 0, 2 | DECOMP_NO_COMPOSE, 3444}, /* compatibility mapping */
+ {0x33E4, 0, 2 | DECOMP_NO_COMPOSE, 3446}, /* compatibility mapping */
+ {0x33E5, 0, 2 | DECOMP_NO_COMPOSE, 3448}, /* compatibility mapping */
+ {0x33E6, 0, 2 | DECOMP_NO_COMPOSE, 3450}, /* compatibility mapping */
+ {0x33E7, 0, 2 | DECOMP_NO_COMPOSE, 3452}, /* compatibility mapping */
+ {0x33E8, 0, 2 | DECOMP_NO_COMPOSE, 3454}, /* compatibility mapping */
+ {0x33E9, 0, 3, 3456},
+ {0x33EA, 0, 3, 3459},
+ {0x33EB, 0, 3, 3462},
+ {0x33EC, 0, 3, 3465},
+ {0x33ED, 0, 3, 3468},
+ {0x33EE, 0, 3, 3471},
+ {0x33EF, 0, 3, 3474},
+ {0x33F0, 0, 3, 3477},
+ {0x33F1, 0, 3, 3480},
+ {0x33F2, 0, 3, 3483},
+ {0x33F3, 0, 3, 3486},
+ {0x33F4, 0, 3, 3489},
+ {0x33F5, 0, 3, 3492},
+ {0x33F6, 0, 3, 3495},
+ {0x33F7, 0, 3, 3498},
+ {0x33F8, 0, 3, 3501},
+ {0x33F9, 0, 3, 3504},
+ {0x33FA, 0, 3, 3507},
+ {0x33FB, 0, 3, 3510},
+ {0x33FC, 0, 3, 3513},
+ {0x33FD, 0, 3, 3516},
+ {0x33FE, 0, 3, 3519},
+ {0x33FF, 0, 3, 3522},
+ {0xA66F, 230, 0, 0},
+ {0xA674, 230, 0, 0},
+ {0xA675, 230, 0, 0},
+ {0xA676, 230, 0, 0},
+ {0xA677, 230, 0, 0},
+ {0xA678, 230, 0, 0},
+ {0xA679, 230, 0, 0},
+ {0xA67A, 230, 0, 0},
+ {0xA67B, 230, 0, 0},
+ {0xA67C, 230, 0, 0},
+ {0xA67D, 230, 0, 0},
+ {0xA69C, 0, 1 | DECOMP_INLINE, 0x044A},
+ {0xA69D, 0, 1 | DECOMP_INLINE, 0x044C},
+ {0xA69E, 230, 0, 0},
+ {0xA69F, 230, 0, 0},
+ {0xA6F0, 230, 0, 0},
+ {0xA6F1, 230, 0, 0},
+ {0xA770, 0, 1 | DECOMP_INLINE, 0xA76F},
+ {0xA7F8, 0, 1 | DECOMP_INLINE, 0x0126},
+ {0xA7F9, 0, 1 | DECOMP_INLINE, 0x0153},
+ {0xA806, 9, 0, 0},
+ {0xA8C4, 9, 0, 0},
+ {0xA8E0, 230, 0, 0},
+ {0xA8E1, 230, 0, 0},
+ {0xA8E2, 230, 0, 0},
+ {0xA8E3, 230, 0, 0},
+ {0xA8E4, 230, 0, 0},
+ {0xA8E5, 230, 0, 0},
+ {0xA8E6, 230, 0, 0},
+ {0xA8E7, 230, 0, 0},
+ {0xA8E8, 230, 0, 0},
+ {0xA8E9, 230, 0, 0},
+ {0xA8EA, 230, 0, 0},
+ {0xA8EB, 230, 0, 0},
+ {0xA8EC, 230, 0, 0},
+ {0xA8ED, 230, 0, 0},
+ {0xA8EE, 230, 0, 0},
+ {0xA8EF, 230, 0, 0},
+ {0xA8F0, 230, 0, 0},
+ {0xA8F1, 230, 0, 0},
+ {0xA92B, 220, 0, 0},
+ {0xA92C, 220, 0, 0},
+ {0xA92D, 220, 0, 0},
+ {0xA953, 9, 0, 0},
+ {0xA9B3, 7, 0, 0},
+ {0xA9C0, 9, 0, 0},
+ {0xAAB0, 230, 0, 0},
+ {0xAAB2, 230, 0, 0},
+ {0xAAB3, 230, 0, 0},
+ {0xAAB4, 220, 0, 0},
+ {0xAAB7, 230, 0, 0},
+ {0xAAB8, 230, 0, 0},
+ {0xAABE, 230, 0, 0},
+ {0xAABF, 230, 0, 0},
+ {0xAAC1, 230, 0, 0},
+ {0xAAF6, 9, 0, 0},
+ {0xAB5C, 0, 1 | DECOMP_INLINE, 0xA727},
+ {0xAB5D, 0, 1 | DECOMP_INLINE, 0xAB37},
+ {0xAB5E, 0, 1 | DECOMP_INLINE, 0x026B},
+ {0xAB5F, 0, 1 | DECOMP_INLINE, 0xAB52},
+ {0xABED, 9, 0, 0},
+ {0xF900, 0, 1 | DECOMP_INLINE, 0x8C48},
+ {0xF901, 0, 1 | DECOMP_INLINE, 0x66F4},
+ {0xF902, 0, 1 | DECOMP_INLINE, 0x8ECA},
+ {0xF903, 0, 1 | DECOMP_INLINE, 0x8CC8},
+ {0xF904, 0, 1 | DECOMP_INLINE, 0x6ED1},
+ {0xF905, 0, 1 | DECOMP_INLINE, 0x4E32},
+ {0xF906, 0, 1 | DECOMP_INLINE, 0x53E5},
+ {0xF907, 0, 1 | DECOMP_INLINE, 0x9F9C},
+ {0xF908, 0, 1 | DECOMP_INLINE, 0x9F9C},
+ {0xF909, 0, 1 | DECOMP_INLINE, 0x5951},
+ {0xF90A, 0, 1 | DECOMP_INLINE, 0x91D1},
+ {0xF90B, 0, 1 | DECOMP_INLINE, 0x5587},
+ {0xF90C, 0, 1 | DECOMP_INLINE, 0x5948},
+ {0xF90D, 0, 1 | DECOMP_INLINE, 0x61F6},
+ {0xF90E, 0, 1 | DECOMP_INLINE, 0x7669},
+ {0xF90F, 0, 1 | DECOMP_INLINE, 0x7F85},
+ {0xF910, 0, 1 | DECOMP_INLINE, 0x863F},
+ {0xF911, 0, 1 | DECOMP_INLINE, 0x87BA},
+ {0xF912, 0, 1 | DECOMP_INLINE, 0x88F8},
+ {0xF913, 0, 1 | DECOMP_INLINE, 0x908F},
+ {0xF914, 0, 1 | DECOMP_INLINE, 0x6A02},
+ {0xF915, 0, 1 | DECOMP_INLINE, 0x6D1B},
+ {0xF916, 0, 1 | DECOMP_INLINE, 0x70D9},
+ {0xF917, 0, 1 | DECOMP_INLINE, 0x73DE},
+ {0xF918, 0, 1 | DECOMP_INLINE, 0x843D},
+ {0xF919, 0, 1 | DECOMP_INLINE, 0x916A},
+ {0xF91A, 0, 1 | DECOMP_INLINE, 0x99F1},
+ {0xF91B, 0, 1 | DECOMP_INLINE, 0x4E82},
+ {0xF91C, 0, 1 | DECOMP_INLINE, 0x5375},
+ {0xF91D, 0, 1 | DECOMP_INLINE, 0x6B04},
+ {0xF91E, 0, 1 | DECOMP_INLINE, 0x721B},
+ {0xF91F, 0, 1 | DECOMP_INLINE, 0x862D},
+ {0xF920, 0, 1 | DECOMP_INLINE, 0x9E1E},
+ {0xF921, 0, 1 | DECOMP_INLINE, 0x5D50},
+ {0xF922, 0, 1 | DECOMP_INLINE, 0x6FEB},
+ {0xF923, 0, 1 | DECOMP_INLINE, 0x85CD},
+ {0xF924, 0, 1 | DECOMP_INLINE, 0x8964},
+ {0xF925, 0, 1 | DECOMP_INLINE, 0x62C9},
+ {0xF926, 0, 1 | DECOMP_INLINE, 0x81D8},
+ {0xF927, 0, 1 | DECOMP_INLINE, 0x881F},
+ {0xF928, 0, 1 | DECOMP_INLINE, 0x5ECA},
+ {0xF929, 0, 1 | DECOMP_INLINE, 0x6717},
+ {0xF92A, 0, 1 | DECOMP_INLINE, 0x6D6A},
+ {0xF92B, 0, 1 | DECOMP_INLINE, 0x72FC},
+ {0xF92C, 0, 1 | DECOMP_INLINE, 0x90CE},
+ {0xF92D, 0, 1 | DECOMP_INLINE, 0x4F86},
+ {0xF92E, 0, 1 | DECOMP_INLINE, 0x51B7},
+ {0xF92F, 0, 1 | DECOMP_INLINE, 0x52DE},
+ {0xF930, 0, 1 | DECOMP_INLINE, 0x64C4},
+ {0xF931, 0, 1 | DECOMP_INLINE, 0x6AD3},
+ {0xF932, 0, 1 | DECOMP_INLINE, 0x7210},
+ {0xF933, 0, 1 | DECOMP_INLINE, 0x76E7},
+ {0xF934, 0, 1 | DECOMP_INLINE, 0x8001},
+ {0xF935, 0, 1 | DECOMP_INLINE, 0x8606},
+ {0xF936, 0, 1 | DECOMP_INLINE, 0x865C},
+ {0xF937, 0, 1 | DECOMP_INLINE, 0x8DEF},
+ {0xF938, 0, 1 | DECOMP_INLINE, 0x9732},
+ {0xF939, 0, 1 | DECOMP_INLINE, 0x9B6F},
+ {0xF93A, 0, 1 | DECOMP_INLINE, 0x9DFA},
+ {0xF93B, 0, 1 | DECOMP_INLINE, 0x788C},
+ {0xF93C, 0, 1 | DECOMP_INLINE, 0x797F},
+ {0xF93D, 0, 1 | DECOMP_INLINE, 0x7DA0},
+ {0xF93E, 0, 1 | DECOMP_INLINE, 0x83C9},
+ {0xF93F, 0, 1 | DECOMP_INLINE, 0x9304},
+ {0xF940, 0, 1 | DECOMP_INLINE, 0x9E7F},
+ {0xF941, 0, 1 | DECOMP_INLINE, 0x8AD6},
+ {0xF942, 0, 1 | DECOMP_INLINE, 0x58DF},
+ {0xF943, 0, 1 | DECOMP_INLINE, 0x5F04},
+ {0xF944, 0, 1 | DECOMP_INLINE, 0x7C60},
+ {0xF945, 0, 1 | DECOMP_INLINE, 0x807E},
+ {0xF946, 0, 1 | DECOMP_INLINE, 0x7262},
+ {0xF947, 0, 1 | DECOMP_INLINE, 0x78CA},
+ {0xF948, 0, 1 | DECOMP_INLINE, 0x8CC2},
+ {0xF949, 0, 1 | DECOMP_INLINE, 0x96F7},
+ {0xF94A, 0, 1 | DECOMP_INLINE, 0x58D8},
+ {0xF94B, 0, 1 | DECOMP_INLINE, 0x5C62},
+ {0xF94C, 0, 1 | DECOMP_INLINE, 0x6A13},
+ {0xF94D, 0, 1 | DECOMP_INLINE, 0x6DDA},
+ {0xF94E, 0, 1 | DECOMP_INLINE, 0x6F0F},
+ {0xF94F, 0, 1 | DECOMP_INLINE, 0x7D2F},
+ {0xF950, 0, 1 | DECOMP_INLINE, 0x7E37},
+ {0xF951, 0, 1 | DECOMP_INLINE, 0x964B},
+ {0xF952, 0, 1 | DECOMP_INLINE, 0x52D2},
+ {0xF953, 0, 1 | DECOMP_INLINE, 0x808B},
+ {0xF954, 0, 1 | DECOMP_INLINE, 0x51DC},
+ {0xF955, 0, 1 | DECOMP_INLINE, 0x51CC},
+ {0xF956, 0, 1 | DECOMP_INLINE, 0x7A1C},
+ {0xF957, 0, 1 | DECOMP_INLINE, 0x7DBE},
+ {0xF958, 0, 1 | DECOMP_INLINE, 0x83F1},
+ {0xF959, 0, 1 | DECOMP_INLINE, 0x9675},
+ {0xF95A, 0, 1 | DECOMP_INLINE, 0x8B80},
+ {0xF95B, 0, 1 | DECOMP_INLINE, 0x62CF},
+ {0xF95C, 0, 1 | DECOMP_INLINE, 0x6A02},
+ {0xF95D, 0, 1 | DECOMP_INLINE, 0x8AFE},
+ {0xF95E, 0, 1 | DECOMP_INLINE, 0x4E39},
+ {0xF95F, 0, 1 | DECOMP_INLINE, 0x5BE7},
+ {0xF960, 0, 1 | DECOMP_INLINE, 0x6012},
+ {0xF961, 0, 1 | DECOMP_INLINE, 0x7387},
+ {0xF962, 0, 1 | DECOMP_INLINE, 0x7570},
+ {0xF963, 0, 1 | DECOMP_INLINE, 0x5317},
+ {0xF964, 0, 1 | DECOMP_INLINE, 0x78FB},
+ {0xF965, 0, 1 | DECOMP_INLINE, 0x4FBF},
+ {0xF966, 0, 1 | DECOMP_INLINE, 0x5FA9},
+ {0xF967, 0, 1 | DECOMP_INLINE, 0x4E0D},
+ {0xF968, 0, 1 | DECOMP_INLINE, 0x6CCC},
+ {0xF969, 0, 1 | DECOMP_INLINE, 0x6578},
+ {0xF96A, 0, 1 | DECOMP_INLINE, 0x7D22},
+ {0xF96B, 0, 1 | DECOMP_INLINE, 0x53C3},
+ {0xF96C, 0, 1 | DECOMP_INLINE, 0x585E},
+ {0xF96D, 0, 1 | DECOMP_INLINE, 0x7701},
+ {0xF96E, 0, 1 | DECOMP_INLINE, 0x8449},
+ {0xF96F, 0, 1 | DECOMP_INLINE, 0x8AAA},
+ {0xF970, 0, 1 | DECOMP_INLINE, 0x6BBA},
+ {0xF971, 0, 1 | DECOMP_INLINE, 0x8FB0},
+ {0xF972, 0, 1 | DECOMP_INLINE, 0x6C88},
+ {0xF973, 0, 1 | DECOMP_INLINE, 0x62FE},
+ {0xF974, 0, 1 | DECOMP_INLINE, 0x82E5},
+ {0xF975, 0, 1 | DECOMP_INLINE, 0x63A0},
+ {0xF976, 0, 1 | DECOMP_INLINE, 0x7565},
+ {0xF977, 0, 1 | DECOMP_INLINE, 0x4EAE},
+ {0xF978, 0, 1 | DECOMP_INLINE, 0x5169},
+ {0xF979, 0, 1 | DECOMP_INLINE, 0x51C9},
+ {0xF97A, 0, 1 | DECOMP_INLINE, 0x6881},
+ {0xF97B, 0, 1 | DECOMP_INLINE, 0x7CE7},
+ {0xF97C, 0, 1 | DECOMP_INLINE, 0x826F},
+ {0xF97D, 0, 1 | DECOMP_INLINE, 0x8AD2},
+ {0xF97E, 0, 1 | DECOMP_INLINE, 0x91CF},
+ {0xF97F, 0, 1 | DECOMP_INLINE, 0x52F5},
+ {0xF980, 0, 1 | DECOMP_INLINE, 0x5442},
+ {0xF981, 0, 1 | DECOMP_INLINE, 0x5973},
+ {0xF982, 0, 1 | DECOMP_INLINE, 0x5EEC},
+ {0xF983, 0, 1 | DECOMP_INLINE, 0x65C5},
+ {0xF984, 0, 1 | DECOMP_INLINE, 0x6FFE},
+ {0xF985, 0, 1 | DECOMP_INLINE, 0x792A},
+ {0xF986, 0, 1 | DECOMP_INLINE, 0x95AD},
+ {0xF987, 0, 1 | DECOMP_INLINE, 0x9A6A},
+ {0xF988, 0, 1 | DECOMP_INLINE, 0x9E97},
+ {0xF989, 0, 1 | DECOMP_INLINE, 0x9ECE},
+ {0xF98A, 0, 1 | DECOMP_INLINE, 0x529B},
+ {0xF98B, 0, 1 | DECOMP_INLINE, 0x66C6},
+ {0xF98C, 0, 1 | DECOMP_INLINE, 0x6B77},
+ {0xF98D, 0, 1 | DECOMP_INLINE, 0x8F62},
+ {0xF98E, 0, 1 | DECOMP_INLINE, 0x5E74},
+ {0xF98F, 0, 1 | DECOMP_INLINE, 0x6190},
+ {0xF990, 0, 1 | DECOMP_INLINE, 0x6200},
+ {0xF991, 0, 1 | DECOMP_INLINE, 0x649A},
+ {0xF992, 0, 1 | DECOMP_INLINE, 0x6F23},
+ {0xF993, 0, 1 | DECOMP_INLINE, 0x7149},
+ {0xF994, 0, 1 | DECOMP_INLINE, 0x7489},
+ {0xF995, 0, 1 | DECOMP_INLINE, 0x79CA},
+ {0xF996, 0, 1 | DECOMP_INLINE, 0x7DF4},
+ {0xF997, 0, 1 | DECOMP_INLINE, 0x806F},
+ {0xF998, 0, 1 | DECOMP_INLINE, 0x8F26},
+ {0xF999, 0, 1 | DECOMP_INLINE, 0x84EE},
+ {0xF99A, 0, 1 | DECOMP_INLINE, 0x9023},
+ {0xF99B, 0, 1 | DECOMP_INLINE, 0x934A},
+ {0xF99C, 0, 1 | DECOMP_INLINE, 0x5217},
+ {0xF99D, 0, 1 | DECOMP_INLINE, 0x52A3},
+ {0xF99E, 0, 1 | DECOMP_INLINE, 0x54BD},
+ {0xF99F, 0, 1 | DECOMP_INLINE, 0x70C8},
+ {0xF9A0, 0, 1 | DECOMP_INLINE, 0x88C2},
+ {0xF9A1, 0, 1 | DECOMP_INLINE, 0x8AAA},
+ {0xF9A2, 0, 1 | DECOMP_INLINE, 0x5EC9},
+ {0xF9A3, 0, 1 | DECOMP_INLINE, 0x5FF5},
+ {0xF9A4, 0, 1 | DECOMP_INLINE, 0x637B},
+ {0xF9A5, 0, 1 | DECOMP_INLINE, 0x6BAE},
+ {0xF9A6, 0, 1 | DECOMP_INLINE, 0x7C3E},
+ {0xF9A7, 0, 1 | DECOMP_INLINE, 0x7375},
+ {0xF9A8, 0, 1 | DECOMP_INLINE, 0x4EE4},
+ {0xF9A9, 0, 1 | DECOMP_INLINE, 0x56F9},
+ {0xF9AA, 0, 1 | DECOMP_INLINE, 0x5BE7},
+ {0xF9AB, 0, 1 | DECOMP_INLINE, 0x5DBA},
+ {0xF9AC, 0, 1 | DECOMP_INLINE, 0x601C},
+ {0xF9AD, 0, 1 | DECOMP_INLINE, 0x73B2},
+ {0xF9AE, 0, 1 | DECOMP_INLINE, 0x7469},
+ {0xF9AF, 0, 1 | DECOMP_INLINE, 0x7F9A},
+ {0xF9B0, 0, 1 | DECOMP_INLINE, 0x8046},
+ {0xF9B1, 0, 1 | DECOMP_INLINE, 0x9234},
+ {0xF9B2, 0, 1 | DECOMP_INLINE, 0x96F6},
+ {0xF9B3, 0, 1 | DECOMP_INLINE, 0x9748},
+ {0xF9B4, 0, 1 | DECOMP_INLINE, 0x9818},
+ {0xF9B5, 0, 1 | DECOMP_INLINE, 0x4F8B},
+ {0xF9B6, 0, 1 | DECOMP_INLINE, 0x79AE},
+ {0xF9B7, 0, 1 | DECOMP_INLINE, 0x91B4},
+ {0xF9B8, 0, 1 | DECOMP_INLINE, 0x96B8},
+ {0xF9B9, 0, 1 | DECOMP_INLINE, 0x60E1},
+ {0xF9BA, 0, 1 | DECOMP_INLINE, 0x4E86},
+ {0xF9BB, 0, 1 | DECOMP_INLINE, 0x50DA},
+ {0xF9BC, 0, 1 | DECOMP_INLINE, 0x5BEE},
+ {0xF9BD, 0, 1 | DECOMP_INLINE, 0x5C3F},
+ {0xF9BE, 0, 1 | DECOMP_INLINE, 0x6599},
+ {0xF9BF, 0, 1 | DECOMP_INLINE, 0x6A02},
+ {0xF9C0, 0, 1 | DECOMP_INLINE, 0x71CE},
+ {0xF9C1, 0, 1 | DECOMP_INLINE, 0x7642},
+ {0xF9C2, 0, 1 | DECOMP_INLINE, 0x84FC},
+ {0xF9C3, 0, 1 | DECOMP_INLINE, 0x907C},
+ {0xF9C4, 0, 1 | DECOMP_INLINE, 0x9F8D},
+ {0xF9C5, 0, 1 | DECOMP_INLINE, 0x6688},
+ {0xF9C6, 0, 1 | DECOMP_INLINE, 0x962E},
+ {0xF9C7, 0, 1 | DECOMP_INLINE, 0x5289},
+ {0xF9C8, 0, 1 | DECOMP_INLINE, 0x677B},
+ {0xF9C9, 0, 1 | DECOMP_INLINE, 0x67F3},
+ {0xF9CA, 0, 1 | DECOMP_INLINE, 0x6D41},
+ {0xF9CB, 0, 1 | DECOMP_INLINE, 0x6E9C},
+ {0xF9CC, 0, 1 | DECOMP_INLINE, 0x7409},
+ {0xF9CD, 0, 1 | DECOMP_INLINE, 0x7559},
+ {0xF9CE, 0, 1 | DECOMP_INLINE, 0x786B},
+ {0xF9CF, 0, 1 | DECOMP_INLINE, 0x7D10},
+ {0xF9D0, 0, 1 | DECOMP_INLINE, 0x985E},
+ {0xF9D1, 0, 1 | DECOMP_INLINE, 0x516D},
+ {0xF9D2, 0, 1 | DECOMP_INLINE, 0x622E},
+ {0xF9D3, 0, 1 | DECOMP_INLINE, 0x9678},
+ {0xF9D4, 0, 1 | DECOMP_INLINE, 0x502B},
+ {0xF9D5, 0, 1 | DECOMP_INLINE, 0x5D19},
+ {0xF9D6, 0, 1 | DECOMP_INLINE, 0x6DEA},
+ {0xF9D7, 0, 1 | DECOMP_INLINE, 0x8F2A},
+ {0xF9D8, 0, 1 | DECOMP_INLINE, 0x5F8B},
+ {0xF9D9, 0, 1 | DECOMP_INLINE, 0x6144},
+ {0xF9DA, 0, 1 | DECOMP_INLINE, 0x6817},
+ {0xF9DB, 0, 1 | DECOMP_INLINE, 0x7387},
+ {0xF9DC, 0, 1 | DECOMP_INLINE, 0x9686},
+ {0xF9DD, 0, 1 | DECOMP_INLINE, 0x5229},
+ {0xF9DE, 0, 1 | DECOMP_INLINE, 0x540F},
+ {0xF9DF, 0, 1 | DECOMP_INLINE, 0x5C65},
+ {0xF9E0, 0, 1 | DECOMP_INLINE, 0x6613},
+ {0xF9E1, 0, 1 | DECOMP_INLINE, 0x674E},
+ {0xF9E2, 0, 1 | DECOMP_INLINE, 0x68A8},
+ {0xF9E3, 0, 1 | DECOMP_INLINE, 0x6CE5},
+ {0xF9E4, 0, 1 | DECOMP_INLINE, 0x7406},
+ {0xF9E5, 0, 1 | DECOMP_INLINE, 0x75E2},
+ {0xF9E6, 0, 1 | DECOMP_INLINE, 0x7F79},
+ {0xF9E7, 0, 1 | DECOMP_INLINE, 0x88CF},
+ {0xF9E8, 0, 1 | DECOMP_INLINE, 0x88E1},
+ {0xF9E9, 0, 1 | DECOMP_INLINE, 0x91CC},
+ {0xF9EA, 0, 1 | DECOMP_INLINE, 0x96E2},
+ {0xF9EB, 0, 1 | DECOMP_INLINE, 0x533F},
+ {0xF9EC, 0, 1 | DECOMP_INLINE, 0x6EBA},
+ {0xF9ED, 0, 1 | DECOMP_INLINE, 0x541D},
+ {0xF9EE, 0, 1 | DECOMP_INLINE, 0x71D0},
+ {0xF9EF, 0, 1 | DECOMP_INLINE, 0x7498},
+ {0xF9F0, 0, 1 | DECOMP_INLINE, 0x85FA},
+ {0xF9F1, 0, 1 | DECOMP_INLINE, 0x96A3},
+ {0xF9F2, 0, 1 | DECOMP_INLINE, 0x9C57},
+ {0xF9F3, 0, 1 | DECOMP_INLINE, 0x9E9F},
+ {0xF9F4, 0, 1 | DECOMP_INLINE, 0x6797},
+ {0xF9F5, 0, 1 | DECOMP_INLINE, 0x6DCB},
+ {0xF9F6, 0, 1 | DECOMP_INLINE, 0x81E8},
+ {0xF9F7, 0, 1 | DECOMP_INLINE, 0x7ACB},
+ {0xF9F8, 0, 1 | DECOMP_INLINE, 0x7B20},
+ {0xF9F9, 0, 1 | DECOMP_INLINE, 0x7C92},
+ {0xF9FA, 0, 1 | DECOMP_INLINE, 0x72C0},
+ {0xF9FB, 0, 1 | DECOMP_INLINE, 0x7099},
+ {0xF9FC, 0, 1 | DECOMP_INLINE, 0x8B58},
+ {0xF9FD, 0, 1 | DECOMP_INLINE, 0x4EC0},
+ {0xF9FE, 0, 1 | DECOMP_INLINE, 0x8336},
+ {0xF9FF, 0, 1 | DECOMP_INLINE, 0x523A},
+ {0xFA00, 0, 1 | DECOMP_INLINE, 0x5207},
+ {0xFA01, 0, 1 | DECOMP_INLINE, 0x5EA6},
+ {0xFA02, 0, 1 | DECOMP_INLINE, 0x62D3},
+ {0xFA03, 0, 1 | DECOMP_INLINE, 0x7CD6},
+ {0xFA04, 0, 1 | DECOMP_INLINE, 0x5B85},
+ {0xFA05, 0, 1 | DECOMP_INLINE, 0x6D1E},
+ {0xFA06, 0, 1 | DECOMP_INLINE, 0x66B4},
+ {0xFA07, 0, 1 | DECOMP_INLINE, 0x8F3B},
+ {0xFA08, 0, 1 | DECOMP_INLINE, 0x884C},
+ {0xFA09, 0, 1 | DECOMP_INLINE, 0x964D},
+ {0xFA0A, 0, 1 | DECOMP_INLINE, 0x898B},
+ {0xFA0B, 0, 1 | DECOMP_INLINE, 0x5ED3},
+ {0xFA0C, 0, 1 | DECOMP_INLINE, 0x5140},
+ {0xFA0D, 0, 1 | DECOMP_INLINE, 0x55C0},
+ {0xFA10, 0, 1 | DECOMP_INLINE, 0x585A},
+ {0xFA12, 0, 1 | DECOMP_INLINE, 0x6674},
+ {0xFA15, 0, 1 | DECOMP_INLINE, 0x51DE},
+ {0xFA16, 0, 1 | DECOMP_INLINE, 0x732A},
+ {0xFA17, 0, 1 | DECOMP_INLINE, 0x76CA},
+ {0xFA18, 0, 1 | DECOMP_INLINE, 0x793C},
+ {0xFA19, 0, 1 | DECOMP_INLINE, 0x795E},
+ {0xFA1A, 0, 1 | DECOMP_INLINE, 0x7965},
+ {0xFA1B, 0, 1 | DECOMP_INLINE, 0x798F},
+ {0xFA1C, 0, 1 | DECOMP_INLINE, 0x9756},
+ {0xFA1D, 0, 1 | DECOMP_INLINE, 0x7CBE},
+ {0xFA1E, 0, 1 | DECOMP_INLINE, 0x7FBD},
+ {0xFA20, 0, 1 | DECOMP_INLINE, 0x8612},
+ {0xFA22, 0, 1 | DECOMP_INLINE, 0x8AF8},
+ {0xFA25, 0, 1 | DECOMP_INLINE, 0x9038},
+ {0xFA26, 0, 1 | DECOMP_INLINE, 0x90FD},
+ {0xFA2A, 0, 1 | DECOMP_INLINE, 0x98EF},
+ {0xFA2B, 0, 1 | DECOMP_INLINE, 0x98FC},
+ {0xFA2C, 0, 1 | DECOMP_INLINE, 0x9928},
+ {0xFA2D, 0, 1 | DECOMP_INLINE, 0x9DB4},
+ {0xFA2E, 0, 1 | DECOMP_INLINE, 0x90DE},
+ {0xFA2F, 0, 1 | DECOMP_INLINE, 0x96B7},
+ {0xFA30, 0, 1 | DECOMP_INLINE, 0x4FAE},
+ {0xFA31, 0, 1 | DECOMP_INLINE, 0x50E7},
+ {0xFA32, 0, 1 | DECOMP_INLINE, 0x514D},
+ {0xFA33, 0, 1 | DECOMP_INLINE, 0x52C9},
+ {0xFA34, 0, 1 | DECOMP_INLINE, 0x52E4},
+ {0xFA35, 0, 1 | DECOMP_INLINE, 0x5351},
+ {0xFA36, 0, 1 | DECOMP_INLINE, 0x559D},
+ {0xFA37, 0, 1 | DECOMP_INLINE, 0x5606},
+ {0xFA38, 0, 1 | DECOMP_INLINE, 0x5668},
+ {0xFA39, 0, 1 | DECOMP_INLINE, 0x5840},
+ {0xFA3A, 0, 1 | DECOMP_INLINE, 0x58A8},
+ {0xFA3B, 0, 1 | DECOMP_INLINE, 0x5C64},
+ {0xFA3C, 0, 1 | DECOMP_INLINE, 0x5C6E},
+ {0xFA3D, 0, 1 | DECOMP_INLINE, 0x6094},
+ {0xFA3E, 0, 1 | DECOMP_INLINE, 0x6168},
+ {0xFA3F, 0, 1 | DECOMP_INLINE, 0x618E},
+ {0xFA40, 0, 1 | DECOMP_INLINE, 0x61F2},
+ {0xFA41, 0, 1 | DECOMP_INLINE, 0x654F},
+ {0xFA42, 0, 1 | DECOMP_INLINE, 0x65E2},
+ {0xFA43, 0, 1 | DECOMP_INLINE, 0x6691},
+ {0xFA44, 0, 1 | DECOMP_INLINE, 0x6885},
+ {0xFA45, 0, 1 | DECOMP_INLINE, 0x6D77},
+ {0xFA46, 0, 1 | DECOMP_INLINE, 0x6E1A},
+ {0xFA47, 0, 1 | DECOMP_INLINE, 0x6F22},
+ {0xFA48, 0, 1 | DECOMP_INLINE, 0x716E},
+ {0xFA49, 0, 1 | DECOMP_INLINE, 0x722B},
+ {0xFA4A, 0, 1 | DECOMP_INLINE, 0x7422},
+ {0xFA4B, 0, 1 | DECOMP_INLINE, 0x7891},
+ {0xFA4C, 0, 1 | DECOMP_INLINE, 0x793E},
+ {0xFA4D, 0, 1 | DECOMP_INLINE, 0x7949},
+ {0xFA4E, 0, 1 | DECOMP_INLINE, 0x7948},
+ {0xFA4F, 0, 1 | DECOMP_INLINE, 0x7950},
+ {0xFA50, 0, 1 | DECOMP_INLINE, 0x7956},
+ {0xFA51, 0, 1 | DECOMP_INLINE, 0x795D},
+ {0xFA52, 0, 1 | DECOMP_INLINE, 0x798D},
+ {0xFA53, 0, 1 | DECOMP_INLINE, 0x798E},
+ {0xFA54, 0, 1 | DECOMP_INLINE, 0x7A40},
+ {0xFA55, 0, 1 | DECOMP_INLINE, 0x7A81},
+ {0xFA56, 0, 1 | DECOMP_INLINE, 0x7BC0},
+ {0xFA57, 0, 1 | DECOMP_INLINE, 0x7DF4},
+ {0xFA58, 0, 1 | DECOMP_INLINE, 0x7E09},
+ {0xFA59, 0, 1 | DECOMP_INLINE, 0x7E41},
+ {0xFA5A, 0, 1 | DECOMP_INLINE, 0x7F72},
+ {0xFA5B, 0, 1 | DECOMP_INLINE, 0x8005},
+ {0xFA5C, 0, 1 | DECOMP_INLINE, 0x81ED},
+ {0xFA5D, 0, 1 | DECOMP_INLINE, 0x8279},
+ {0xFA5E, 0, 1 | DECOMP_INLINE, 0x8279},
+ {0xFA5F, 0, 1 | DECOMP_INLINE, 0x8457},
+ {0xFA60, 0, 1 | DECOMP_INLINE, 0x8910},
+ {0xFA61, 0, 1 | DECOMP_INLINE, 0x8996},
+ {0xFA62, 0, 1 | DECOMP_INLINE, 0x8B01},
+ {0xFA63, 0, 1 | DECOMP_INLINE, 0x8B39},
+ {0xFA64, 0, 1 | DECOMP_INLINE, 0x8CD3},
+ {0xFA65, 0, 1 | DECOMP_INLINE, 0x8D08},
+ {0xFA66, 0, 1 | DECOMP_INLINE, 0x8FB6},
+ {0xFA67, 0, 1 | DECOMP_INLINE, 0x9038},
+ {0xFA68, 0, 1 | DECOMP_INLINE, 0x96E3},
+ {0xFA69, 0, 1 | DECOMP_INLINE, 0x97FF},
+ {0xFA6A, 0, 1 | DECOMP_INLINE, 0x983B},
+ {0xFA6B, 0, 1 | DECOMP_INLINE, 0x6075},
+ {0xFA6C, 0, 1, 3525},
+ {0xFA6D, 0, 1 | DECOMP_INLINE, 0x8218},
+ {0xFA70, 0, 1 | DECOMP_INLINE, 0x4E26},
+ {0xFA71, 0, 1 | DECOMP_INLINE, 0x51B5},
+ {0xFA72, 0, 1 | DECOMP_INLINE, 0x5168},
+ {0xFA73, 0, 1 | DECOMP_INLINE, 0x4F80},
+ {0xFA74, 0, 1 | DECOMP_INLINE, 0x5145},
+ {0xFA75, 0, 1 | DECOMP_INLINE, 0x5180},
+ {0xFA76, 0, 1 | DECOMP_INLINE, 0x52C7},
+ {0xFA77, 0, 1 | DECOMP_INLINE, 0x52FA},
+ {0xFA78, 0, 1 | DECOMP_INLINE, 0x559D},
+ {0xFA79, 0, 1 | DECOMP_INLINE, 0x5555},
+ {0xFA7A, 0, 1 | DECOMP_INLINE, 0x5599},
+ {0xFA7B, 0, 1 | DECOMP_INLINE, 0x55E2},
+ {0xFA7C, 0, 1 | DECOMP_INLINE, 0x585A},
+ {0xFA7D, 0, 1 | DECOMP_INLINE, 0x58B3},
+ {0xFA7E, 0, 1 | DECOMP_INLINE, 0x5944},
+ {0xFA7F, 0, 1 | DECOMP_INLINE, 0x5954},
+ {0xFA80, 0, 1 | DECOMP_INLINE, 0x5A62},
+ {0xFA81, 0, 1 | DECOMP_INLINE, 0x5B28},
+ {0xFA82, 0, 1 | DECOMP_INLINE, 0x5ED2},
+ {0xFA83, 0, 1 | DECOMP_INLINE, 0x5ED9},
+ {0xFA84, 0, 1 | DECOMP_INLINE, 0x5F69},
+ {0xFA85, 0, 1 | DECOMP_INLINE, 0x5FAD},
+ {0xFA86, 0, 1 | DECOMP_INLINE, 0x60D8},
+ {0xFA87, 0, 1 | DECOMP_INLINE, 0x614E},
+ {0xFA88, 0, 1 | DECOMP_INLINE, 0x6108},
+ {0xFA89, 0, 1 | DECOMP_INLINE, 0x618E},
+ {0xFA8A, 0, 1 | DECOMP_INLINE, 0x6160},
+ {0xFA8B, 0, 1 | DECOMP_INLINE, 0x61F2},
+ {0xFA8C, 0, 1 | DECOMP_INLINE, 0x6234},
+ {0xFA8D, 0, 1 | DECOMP_INLINE, 0x63C4},
+ {0xFA8E, 0, 1 | DECOMP_INLINE, 0x641C},
+ {0xFA8F, 0, 1 | DECOMP_INLINE, 0x6452},
+ {0xFA90, 0, 1 | DECOMP_INLINE, 0x6556},
+ {0xFA91, 0, 1 | DECOMP_INLINE, 0x6674},
+ {0xFA92, 0, 1 | DECOMP_INLINE, 0x6717},
+ {0xFA93, 0, 1 | DECOMP_INLINE, 0x671B},
+ {0xFA94, 0, 1 | DECOMP_INLINE, 0x6756},
+ {0xFA95, 0, 1 | DECOMP_INLINE, 0x6B79},
+ {0xFA96, 0, 1 | DECOMP_INLINE, 0x6BBA},
+ {0xFA97, 0, 1 | DECOMP_INLINE, 0x6D41},
+ {0xFA98, 0, 1 | DECOMP_INLINE, 0x6EDB},
+ {0xFA99, 0, 1 | DECOMP_INLINE, 0x6ECB},
+ {0xFA9A, 0, 1 | DECOMP_INLINE, 0x6F22},
+ {0xFA9B, 0, 1 | DECOMP_INLINE, 0x701E},
+ {0xFA9C, 0, 1 | DECOMP_INLINE, 0x716E},
+ {0xFA9D, 0, 1 | DECOMP_INLINE, 0x77A7},
+ {0xFA9E, 0, 1 | DECOMP_INLINE, 0x7235},
+ {0xFA9F, 0, 1 | DECOMP_INLINE, 0x72AF},
+ {0xFAA0, 0, 1 | DECOMP_INLINE, 0x732A},
+ {0xFAA1, 0, 1 | DECOMP_INLINE, 0x7471},
+ {0xFAA2, 0, 1 | DECOMP_INLINE, 0x7506},
+ {0xFAA3, 0, 1 | DECOMP_INLINE, 0x753B},
+ {0xFAA4, 0, 1 | DECOMP_INLINE, 0x761D},
+ {0xFAA5, 0, 1 | DECOMP_INLINE, 0x761F},
+ {0xFAA6, 0, 1 | DECOMP_INLINE, 0x76CA},
+ {0xFAA7, 0, 1 | DECOMP_INLINE, 0x76DB},
+ {0xFAA8, 0, 1 | DECOMP_INLINE, 0x76F4},
+ {0xFAA9, 0, 1 | DECOMP_INLINE, 0x774A},
+ {0xFAAA, 0, 1 | DECOMP_INLINE, 0x7740},
+ {0xFAAB, 0, 1 | DECOMP_INLINE, 0x78CC},
+ {0xFAAC, 0, 1 | DECOMP_INLINE, 0x7AB1},
+ {0xFAAD, 0, 1 | DECOMP_INLINE, 0x7BC0},
+ {0xFAAE, 0, 1 | DECOMP_INLINE, 0x7C7B},
+ {0xFAAF, 0, 1 | DECOMP_INLINE, 0x7D5B},
+ {0xFAB0, 0, 1 | DECOMP_INLINE, 0x7DF4},
+ {0xFAB1, 0, 1 | DECOMP_INLINE, 0x7F3E},
+ {0xFAB2, 0, 1 | DECOMP_INLINE, 0x8005},
+ {0xFAB3, 0, 1 | DECOMP_INLINE, 0x8352},
+ {0xFAB4, 0, 1 | DECOMP_INLINE, 0x83EF},
+ {0xFAB5, 0, 1 | DECOMP_INLINE, 0x8779},
+ {0xFAB6, 0, 1 | DECOMP_INLINE, 0x8941},
+ {0xFAB7, 0, 1 | DECOMP_INLINE, 0x8986},
+ {0xFAB8, 0, 1 | DECOMP_INLINE, 0x8996},
+ {0xFAB9, 0, 1 | DECOMP_INLINE, 0x8ABF},
+ {0xFABA, 0, 1 | DECOMP_INLINE, 0x8AF8},
+ {0xFABB, 0, 1 | DECOMP_INLINE, 0x8ACB},
+ {0xFABC, 0, 1 | DECOMP_INLINE, 0x8B01},
+ {0xFABD, 0, 1 | DECOMP_INLINE, 0x8AFE},
+ {0xFABE, 0, 1 | DECOMP_INLINE, 0x8AED},
+ {0xFABF, 0, 1 | DECOMP_INLINE, 0x8B39},
+ {0xFAC0, 0, 1 | DECOMP_INLINE, 0x8B8A},
+ {0xFAC1, 0, 1 | DECOMP_INLINE, 0x8D08},
+ {0xFAC2, 0, 1 | DECOMP_INLINE, 0x8F38},
+ {0xFAC3, 0, 1 | DECOMP_INLINE, 0x9072},
+ {0xFAC4, 0, 1 | DECOMP_INLINE, 0x9199},
+ {0xFAC5, 0, 1 | DECOMP_INLINE, 0x9276},
+ {0xFAC6, 0, 1 | DECOMP_INLINE, 0x967C},
+ {0xFAC7, 0, 1 | DECOMP_INLINE, 0x96E3},
+ {0xFAC8, 0, 1 | DECOMP_INLINE, 0x9756},
+ {0xFAC9, 0, 1 | DECOMP_INLINE, 0x97DB},
+ {0xFACA, 0, 1 | DECOMP_INLINE, 0x97FF},
+ {0xFACB, 0, 1 | DECOMP_INLINE, 0x980B},
+ {0xFACC, 0, 1 | DECOMP_INLINE, 0x983B},
+ {0xFACD, 0, 1 | DECOMP_INLINE, 0x9B12},
+ {0xFACE, 0, 1 | DECOMP_INLINE, 0x9F9C},
+ {0xFACF, 0, 1, 3526},
+ {0xFAD0, 0, 1, 3527},
+ {0xFAD1, 0, 1, 3528},
+ {0xFAD2, 0, 1 | DECOMP_INLINE, 0x3B9D},
+ {0xFAD3, 0, 1 | DECOMP_INLINE, 0x4018},
+ {0xFAD4, 0, 1 | DECOMP_INLINE, 0x4039},
+ {0xFAD5, 0, 1, 3529},
+ {0xFAD6, 0, 1, 3530},
+ {0xFAD7, 0, 1, 3531},
+ {0xFAD8, 0, 1 | DECOMP_INLINE, 0x9F43},
+ {0xFAD9, 0, 1 | DECOMP_INLINE, 0x9F8E},
+ {0xFB00, 0, 2 | DECOMP_NO_COMPOSE, 3532}, /* compatibility mapping */
+ {0xFB01, 0, 2 | DECOMP_NO_COMPOSE, 3534}, /* compatibility mapping */
+ {0xFB02, 0, 2 | DECOMP_NO_COMPOSE, 3536}, /* compatibility mapping */
+ {0xFB03, 0, 3, 3538},
+ {0xFB04, 0, 3, 3541},
+ {0xFB05, 0, 2 | DECOMP_NO_COMPOSE, 3544}, /* compatibility mapping */
+ {0xFB06, 0, 2 | DECOMP_NO_COMPOSE, 3546}, /* compatibility mapping */
+ {0xFB13, 0, 2 | DECOMP_NO_COMPOSE, 3548}, /* compatibility mapping */
+ {0xFB14, 0, 2 | DECOMP_NO_COMPOSE, 3550}, /* compatibility mapping */
+ {0xFB15, 0, 2 | DECOMP_NO_COMPOSE, 3552}, /* compatibility mapping */
+ {0xFB16, 0, 2 | DECOMP_NO_COMPOSE, 3554}, /* compatibility mapping */
+ {0xFB17, 0, 2 | DECOMP_NO_COMPOSE, 3556}, /* compatibility mapping */
+ {0xFB1D, 0, 2 | DECOMP_NO_COMPOSE, 3558}, /* in exclusion list */
+ {0xFB1E, 26, 0, 0},
+ {0xFB1F, 0, 2 | DECOMP_NO_COMPOSE, 3560}, /* in exclusion list */
+ {0xFB20, 0, 1 | DECOMP_INLINE, 0x05E2},
+ {0xFB21, 0, 1 | DECOMP_INLINE, 0x05D0},
+ {0xFB22, 0, 1 | DECOMP_INLINE, 0x05D3},
+ {0xFB23, 0, 1 | DECOMP_INLINE, 0x05D4},
+ {0xFB24, 0, 1 | DECOMP_INLINE, 0x05DB},
+ {0xFB25, 0, 1 | DECOMP_INLINE, 0x05DC},
+ {0xFB26, 0, 1 | DECOMP_INLINE, 0x05DD},
+ {0xFB27, 0, 1 | DECOMP_INLINE, 0x05E8},
+ {0xFB28, 0, 1 | DECOMP_INLINE, 0x05EA},
+ {0xFB29, 0, 1 | DECOMP_INLINE, 0x002B},
+ {0xFB2A, 0, 2 | DECOMP_NO_COMPOSE, 3562}, /* in exclusion list */
+ {0xFB2B, 0, 2 | DECOMP_NO_COMPOSE, 3564}, /* in exclusion list */
+ {0xFB2C, 0, 2 | DECOMP_NO_COMPOSE, 3566}, /* in exclusion list */
+ {0xFB2D, 0, 2 | DECOMP_NO_COMPOSE, 3568}, /* in exclusion list */
+ {0xFB2E, 0, 2 | DECOMP_NO_COMPOSE, 3570}, /* in exclusion list */
+ {0xFB2F, 0, 2 | DECOMP_NO_COMPOSE, 3572}, /* in exclusion list */
+ {0xFB30, 0, 2 | DECOMP_NO_COMPOSE, 3574}, /* in exclusion list */
+ {0xFB31, 0, 2 | DECOMP_NO_COMPOSE, 3576}, /* in exclusion list */
+ {0xFB32, 0, 2 | DECOMP_NO_COMPOSE, 3578}, /* in exclusion list */
+ {0xFB33, 0, 2 | DECOMP_NO_COMPOSE, 3580}, /* in exclusion list */
+ {0xFB34, 0, 2 | DECOMP_NO_COMPOSE, 3582}, /* in exclusion list */
+ {0xFB35, 0, 2 | DECOMP_NO_COMPOSE, 3584}, /* in exclusion list */
+ {0xFB36, 0, 2 | DECOMP_NO_COMPOSE, 3586}, /* in exclusion list */
+ {0xFB38, 0, 2 | DECOMP_NO_COMPOSE, 3588}, /* in exclusion list */
+ {0xFB39, 0, 2 | DECOMP_NO_COMPOSE, 3590}, /* in exclusion list */
+ {0xFB3A, 0, 2 | DECOMP_NO_COMPOSE, 3592}, /* in exclusion list */
+ {0xFB3B, 0, 2 | DECOMP_NO_COMPOSE, 3594}, /* in exclusion list */
+ {0xFB3C, 0, 2 | DECOMP_NO_COMPOSE, 3596}, /* in exclusion list */
+ {0xFB3E, 0, 2 | DECOMP_NO_COMPOSE, 3598}, /* in exclusion list */
+ {0xFB40, 0, 2 | DECOMP_NO_COMPOSE, 3600}, /* in exclusion list */
+ {0xFB41, 0, 2 | DECOMP_NO_COMPOSE, 3602}, /* in exclusion list */
+ {0xFB43, 0, 2 | DECOMP_NO_COMPOSE, 3604}, /* in exclusion list */
+ {0xFB44, 0, 2 | DECOMP_NO_COMPOSE, 3606}, /* in exclusion list */
+ {0xFB46, 0, 2 | DECOMP_NO_COMPOSE, 3608}, /* in exclusion list */
+ {0xFB47, 0, 2 | DECOMP_NO_COMPOSE, 3610}, /* in exclusion list */
+ {0xFB48, 0, 2 | DECOMP_NO_COMPOSE, 3612}, /* in exclusion list */
+ {0xFB49, 0, 2 | DECOMP_NO_COMPOSE, 3614}, /* in exclusion list */
+ {0xFB4A, 0, 2 | DECOMP_NO_COMPOSE, 3616}, /* in exclusion list */
+ {0xFB4B, 0, 2 | DECOMP_NO_COMPOSE, 3618}, /* in exclusion list */
+ {0xFB4C, 0, 2 | DECOMP_NO_COMPOSE, 3620}, /* in exclusion list */
+ {0xFB4D, 0, 2 | DECOMP_NO_COMPOSE, 3622}, /* in exclusion list */
+ {0xFB4E, 0, 2 | DECOMP_NO_COMPOSE, 3624}, /* in exclusion list */
+ {0xFB4F, 0, 2 | DECOMP_NO_COMPOSE, 3626}, /* compatibility mapping */
+ {0xFB50, 0, 1 | DECOMP_INLINE, 0x0671},
+ {0xFB51, 0, 1 | DECOMP_INLINE, 0x0671},
+ {0xFB52, 0, 1 | DECOMP_INLINE, 0x067B},
+ {0xFB53, 0, 1 | DECOMP_INLINE, 0x067B},
+ {0xFB54, 0, 1 | DECOMP_INLINE, 0x067B},
+ {0xFB55, 0, 1 | DECOMP_INLINE, 0x067B},
+ {0xFB56, 0, 1 | DECOMP_INLINE, 0x067E},
+ {0xFB57, 0, 1 | DECOMP_INLINE, 0x067E},
+ {0xFB58, 0, 1 | DECOMP_INLINE, 0x067E},
+ {0xFB59, 0, 1 | DECOMP_INLINE, 0x067E},
+ {0xFB5A, 0, 1 | DECOMP_INLINE, 0x0680},
+ {0xFB5B, 0, 1 | DECOMP_INLINE, 0x0680},
+ {0xFB5C, 0, 1 | DECOMP_INLINE, 0x0680},
+ {0xFB5D, 0, 1 | DECOMP_INLINE, 0x0680},
+ {0xFB5E, 0, 1 | DECOMP_INLINE, 0x067A},
+ {0xFB5F, 0, 1 | DECOMP_INLINE, 0x067A},
+ {0xFB60, 0, 1 | DECOMP_INLINE, 0x067A},
+ {0xFB61, 0, 1 | DECOMP_INLINE, 0x067A},
+ {0xFB62, 0, 1 | DECOMP_INLINE, 0x067F},
+ {0xFB63, 0, 1 | DECOMP_INLINE, 0x067F},
+ {0xFB64, 0, 1 | DECOMP_INLINE, 0x067F},
+ {0xFB65, 0, 1 | DECOMP_INLINE, 0x067F},
+ {0xFB66, 0, 1 | DECOMP_INLINE, 0x0679},
+ {0xFB67, 0, 1 | DECOMP_INLINE, 0x0679},
+ {0xFB68, 0, 1 | DECOMP_INLINE, 0x0679},
+ {0xFB69, 0, 1 | DECOMP_INLINE, 0x0679},
+ {0xFB6A, 0, 1 | DECOMP_INLINE, 0x06A4},
+ {0xFB6B, 0, 1 | DECOMP_INLINE, 0x06A4},
+ {0xFB6C, 0, 1 | DECOMP_INLINE, 0x06A4},
+ {0xFB6D, 0, 1 | DECOMP_INLINE, 0x06A4},
+ {0xFB6E, 0, 1 | DECOMP_INLINE, 0x06A6},
+ {0xFB6F, 0, 1 | DECOMP_INLINE, 0x06A6},
+ {0xFB70, 0, 1 | DECOMP_INLINE, 0x06A6},
+ {0xFB71, 0, 1 | DECOMP_INLINE, 0x06A6},
+ {0xFB72, 0, 1 | DECOMP_INLINE, 0x0684},
+ {0xFB73, 0, 1 | DECOMP_INLINE, 0x0684},
+ {0xFB74, 0, 1 | DECOMP_INLINE, 0x0684},
+ {0xFB75, 0, 1 | DECOMP_INLINE, 0x0684},
+ {0xFB76, 0, 1 | DECOMP_INLINE, 0x0683},
+ {0xFB77, 0, 1 | DECOMP_INLINE, 0x0683},
+ {0xFB78, 0, 1 | DECOMP_INLINE, 0x0683},
+ {0xFB79, 0, 1 | DECOMP_INLINE, 0x0683},
+ {0xFB7A, 0, 1 | DECOMP_INLINE, 0x0686},
+ {0xFB7B, 0, 1 | DECOMP_INLINE, 0x0686},
+ {0xFB7C, 0, 1 | DECOMP_INLINE, 0x0686},
+ {0xFB7D, 0, 1 | DECOMP_INLINE, 0x0686},
+ {0xFB7E, 0, 1 | DECOMP_INLINE, 0x0687},
+ {0xFB7F, 0, 1 | DECOMP_INLINE, 0x0687},
+ {0xFB80, 0, 1 | DECOMP_INLINE, 0x0687},
+ {0xFB81, 0, 1 | DECOMP_INLINE, 0x0687},
+ {0xFB82, 0, 1 | DECOMP_INLINE, 0x068D},
+ {0xFB83, 0, 1 | DECOMP_INLINE, 0x068D},
+ {0xFB84, 0, 1 | DECOMP_INLINE, 0x068C},
+ {0xFB85, 0, 1 | DECOMP_INLINE, 0x068C},
+ {0xFB86, 0, 1 | DECOMP_INLINE, 0x068E},
+ {0xFB87, 0, 1 | DECOMP_INLINE, 0x068E},
+ {0xFB88, 0, 1 | DECOMP_INLINE, 0x0688},
+ {0xFB89, 0, 1 | DECOMP_INLINE, 0x0688},
+ {0xFB8A, 0, 1 | DECOMP_INLINE, 0x0698},
+ {0xFB8B, 0, 1 | DECOMP_INLINE, 0x0698},
+ {0xFB8C, 0, 1 | DECOMP_INLINE, 0x0691},
+ {0xFB8D, 0, 1 | DECOMP_INLINE, 0x0691},
+ {0xFB8E, 0, 1 | DECOMP_INLINE, 0x06A9},
+ {0xFB8F, 0, 1 | DECOMP_INLINE, 0x06A9},
+ {0xFB90, 0, 1 | DECOMP_INLINE, 0x06A9},
+ {0xFB91, 0, 1 | DECOMP_INLINE, 0x06A9},
+ {0xFB92, 0, 1 | DECOMP_INLINE, 0x06AF},
+ {0xFB93, 0, 1 | DECOMP_INLINE, 0x06AF},
+ {0xFB94, 0, 1 | DECOMP_INLINE, 0x06AF},
+ {0xFB95, 0, 1 | DECOMP_INLINE, 0x06AF},
+ {0xFB96, 0, 1 | DECOMP_INLINE, 0x06B3},
+ {0xFB97, 0, 1 | DECOMP_INLINE, 0x06B3},
+ {0xFB98, 0, 1 | DECOMP_INLINE, 0x06B3},
+ {0xFB99, 0, 1 | DECOMP_INLINE, 0x06B3},
+ {0xFB9A, 0, 1 | DECOMP_INLINE, 0x06B1},
+ {0xFB9B, 0, 1 | DECOMP_INLINE, 0x06B1},
+ {0xFB9C, 0, 1 | DECOMP_INLINE, 0x06B1},
+ {0xFB9D, 0, 1 | DECOMP_INLINE, 0x06B1},
+ {0xFB9E, 0, 1 | DECOMP_INLINE, 0x06BA},
+ {0xFB9F, 0, 1 | DECOMP_INLINE, 0x06BA},
+ {0xFBA0, 0, 1 | DECOMP_INLINE, 0x06BB},
+ {0xFBA1, 0, 1 | DECOMP_INLINE, 0x06BB},
+ {0xFBA2, 0, 1 | DECOMP_INLINE, 0x06BB},
+ {0xFBA3, 0, 1 | DECOMP_INLINE, 0x06BB},
+ {0xFBA4, 0, 1 | DECOMP_INLINE, 0x06C0},
+ {0xFBA5, 0, 1 | DECOMP_INLINE, 0x06C0},
+ {0xFBA6, 0, 1 | DECOMP_INLINE, 0x06C1},
+ {0xFBA7, 0, 1 | DECOMP_INLINE, 0x06C1},
+ {0xFBA8, 0, 1 | DECOMP_INLINE, 0x06C1},
+ {0xFBA9, 0, 1 | DECOMP_INLINE, 0x06C1},
+ {0xFBAA, 0, 1 | DECOMP_INLINE, 0x06BE},
+ {0xFBAB, 0, 1 | DECOMP_INLINE, 0x06BE},
+ {0xFBAC, 0, 1 | DECOMP_INLINE, 0x06BE},
+ {0xFBAD, 0, 1 | DECOMP_INLINE, 0x06BE},
+ {0xFBAE, 0, 1 | DECOMP_INLINE, 0x06D2},
+ {0xFBAF, 0, 1 | DECOMP_INLINE, 0x06D2},
+ {0xFBB0, 0, 1 | DECOMP_INLINE, 0x06D3},
+ {0xFBB1, 0, 1 | DECOMP_INLINE, 0x06D3},
+ {0xFBD3, 0, 1 | DECOMP_INLINE, 0x06AD},
+ {0xFBD4, 0, 1 | DECOMP_INLINE, 0x06AD},
+ {0xFBD5, 0, 1 | DECOMP_INLINE, 0x06AD},
+ {0xFBD6, 0, 1 | DECOMP_INLINE, 0x06AD},
+ {0xFBD7, 0, 1 | DECOMP_INLINE, 0x06C7},
+ {0xFBD8, 0, 1 | DECOMP_INLINE, 0x06C7},
+ {0xFBD9, 0, 1 | DECOMP_INLINE, 0x06C6},
+ {0xFBDA, 0, 1 | DECOMP_INLINE, 0x06C6},
+ {0xFBDB, 0, 1 | DECOMP_INLINE, 0x06C8},
+ {0xFBDC, 0, 1 | DECOMP_INLINE, 0x06C8},
+ {0xFBDD, 0, 1 | DECOMP_INLINE, 0x0677},
+ {0xFBDE, 0, 1 | DECOMP_INLINE, 0x06CB},
+ {0xFBDF, 0, 1 | DECOMP_INLINE, 0x06CB},
+ {0xFBE0, 0, 1 | DECOMP_INLINE, 0x06C5},
+ {0xFBE1, 0, 1 | DECOMP_INLINE, 0x06C5},
+ {0xFBE2, 0, 1 | DECOMP_INLINE, 0x06C9},
+ {0xFBE3, 0, 1 | DECOMP_INLINE, 0x06C9},
+ {0xFBE4, 0, 1 | DECOMP_INLINE, 0x06D0},
+ {0xFBE5, 0, 1 | DECOMP_INLINE, 0x06D0},
+ {0xFBE6, 0, 1 | DECOMP_INLINE, 0x06D0},
+ {0xFBE7, 0, 1 | DECOMP_INLINE, 0x06D0},
+ {0xFBE8, 0, 1 | DECOMP_INLINE, 0x0649},
+ {0xFBE9, 0, 1 | DECOMP_INLINE, 0x0649},
+ {0xFBEA, 0, 2 | DECOMP_NO_COMPOSE, 3628}, /* compatibility mapping */
+ {0xFBEB, 0, 2 | DECOMP_NO_COMPOSE, 3630}, /* compatibility mapping */
+ {0xFBEC, 0, 2 | DECOMP_NO_COMPOSE, 3632}, /* compatibility mapping */
+ {0xFBED, 0, 2 | DECOMP_NO_COMPOSE, 3634}, /* compatibility mapping */
+ {0xFBEE, 0, 2 | DECOMP_NO_COMPOSE, 3636}, /* compatibility mapping */
+ {0xFBEF, 0, 2 | DECOMP_NO_COMPOSE, 3638}, /* compatibility mapping */
+ {0xFBF0, 0, 2 | DECOMP_NO_COMPOSE, 3640}, /* compatibility mapping */
+ {0xFBF1, 0, 2 | DECOMP_NO_COMPOSE, 3642}, /* compatibility mapping */
+ {0xFBF2, 0, 2 | DECOMP_NO_COMPOSE, 3644}, /* compatibility mapping */
+ {0xFBF3, 0, 2 | DECOMP_NO_COMPOSE, 3646}, /* compatibility mapping */
+ {0xFBF4, 0, 2 | DECOMP_NO_COMPOSE, 3648}, /* compatibility mapping */
+ {0xFBF5, 0, 2 | DECOMP_NO_COMPOSE, 3650}, /* compatibility mapping */
+ {0xFBF6, 0, 2 | DECOMP_NO_COMPOSE, 3652}, /* compatibility mapping */
+ {0xFBF7, 0, 2 | DECOMP_NO_COMPOSE, 3654}, /* compatibility mapping */
+ {0xFBF8, 0, 2 | DECOMP_NO_COMPOSE, 3656}, /* compatibility mapping */
+ {0xFBF9, 0, 2 | DECOMP_NO_COMPOSE, 3658}, /* compatibility mapping */
+ {0xFBFA, 0, 2 | DECOMP_NO_COMPOSE, 3660}, /* compatibility mapping */
+ {0xFBFB, 0, 2 | DECOMP_NO_COMPOSE, 3662}, /* compatibility mapping */
+ {0xFBFC, 0, 1 | DECOMP_INLINE, 0x06CC},
+ {0xFBFD, 0, 1 | DECOMP_INLINE, 0x06CC},
+ {0xFBFE, 0, 1 | DECOMP_INLINE, 0x06CC},
+ {0xFBFF, 0, 1 | DECOMP_INLINE, 0x06CC},
+ {0xFC00, 0, 2 | DECOMP_NO_COMPOSE, 3664}, /* compatibility mapping */
+ {0xFC01, 0, 2 | DECOMP_NO_COMPOSE, 3666}, /* compatibility mapping */
+ {0xFC02, 0, 2 | DECOMP_NO_COMPOSE, 3668}, /* compatibility mapping */
+ {0xFC03, 0, 2 | DECOMP_NO_COMPOSE, 3670}, /* compatibility mapping */
+ {0xFC04, 0, 2 | DECOMP_NO_COMPOSE, 3672}, /* compatibility mapping */
+ {0xFC05, 0, 2 | DECOMP_NO_COMPOSE, 3674}, /* compatibility mapping */
+ {0xFC06, 0, 2 | DECOMP_NO_COMPOSE, 3676}, /* compatibility mapping */
+ {0xFC07, 0, 2 | DECOMP_NO_COMPOSE, 3678}, /* compatibility mapping */
+ {0xFC08, 0, 2 | DECOMP_NO_COMPOSE, 3680}, /* compatibility mapping */
+ {0xFC09, 0, 2 | DECOMP_NO_COMPOSE, 3682}, /* compatibility mapping */
+ {0xFC0A, 0, 2 | DECOMP_NO_COMPOSE, 3684}, /* compatibility mapping */
+ {0xFC0B, 0, 2 | DECOMP_NO_COMPOSE, 3686}, /* compatibility mapping */
+ {0xFC0C, 0, 2 | DECOMP_NO_COMPOSE, 3688}, /* compatibility mapping */
+ {0xFC0D, 0, 2 | DECOMP_NO_COMPOSE, 3690}, /* compatibility mapping */
+ {0xFC0E, 0, 2 | DECOMP_NO_COMPOSE, 3692}, /* compatibility mapping */
+ {0xFC0F, 0, 2 | DECOMP_NO_COMPOSE, 3694}, /* compatibility mapping */
+ {0xFC10, 0, 2 | DECOMP_NO_COMPOSE, 3696}, /* compatibility mapping */
+ {0xFC11, 0, 2 | DECOMP_NO_COMPOSE, 3698}, /* compatibility mapping */
+ {0xFC12, 0, 2 | DECOMP_NO_COMPOSE, 3700}, /* compatibility mapping */
+ {0xFC13, 0, 2 | DECOMP_NO_COMPOSE, 3702}, /* compatibility mapping */
+ {0xFC14, 0, 2 | DECOMP_NO_COMPOSE, 3704}, /* compatibility mapping */
+ {0xFC15, 0, 2 | DECOMP_NO_COMPOSE, 3706}, /* compatibility mapping */
+ {0xFC16, 0, 2 | DECOMP_NO_COMPOSE, 3708}, /* compatibility mapping */
+ {0xFC17, 0, 2 | DECOMP_NO_COMPOSE, 3710}, /* compatibility mapping */
+ {0xFC18, 0, 2 | DECOMP_NO_COMPOSE, 3712}, /* compatibility mapping */
+ {0xFC19, 0, 2 | DECOMP_NO_COMPOSE, 3714}, /* compatibility mapping */
+ {0xFC1A, 0, 2 | DECOMP_NO_COMPOSE, 3716}, /* compatibility mapping */
+ {0xFC1B, 0, 2 | DECOMP_NO_COMPOSE, 3718}, /* compatibility mapping */
+ {0xFC1C, 0, 2 | DECOMP_NO_COMPOSE, 3720}, /* compatibility mapping */
+ {0xFC1D, 0, 2 | DECOMP_NO_COMPOSE, 3722}, /* compatibility mapping */
+ {0xFC1E, 0, 2 | DECOMP_NO_COMPOSE, 3724}, /* compatibility mapping */
+ {0xFC1F, 0, 2 | DECOMP_NO_COMPOSE, 3726}, /* compatibility mapping */
+ {0xFC20, 0, 2 | DECOMP_NO_COMPOSE, 3728}, /* compatibility mapping */
+ {0xFC21, 0, 2 | DECOMP_NO_COMPOSE, 3730}, /* compatibility mapping */
+ {0xFC22, 0, 2 | DECOMP_NO_COMPOSE, 3732}, /* compatibility mapping */
+ {0xFC23, 0, 2 | DECOMP_NO_COMPOSE, 3734}, /* compatibility mapping */
+ {0xFC24, 0, 2 | DECOMP_NO_COMPOSE, 3736}, /* compatibility mapping */
+ {0xFC25, 0, 2 | DECOMP_NO_COMPOSE, 3738}, /* compatibility mapping */
+ {0xFC26, 0, 2 | DECOMP_NO_COMPOSE, 3740}, /* compatibility mapping */
+ {0xFC27, 0, 2 | DECOMP_NO_COMPOSE, 3742}, /* compatibility mapping */
+ {0xFC28, 0, 2 | DECOMP_NO_COMPOSE, 3744}, /* compatibility mapping */
+ {0xFC29, 0, 2 | DECOMP_NO_COMPOSE, 3746}, /* compatibility mapping */
+ {0xFC2A, 0, 2 | DECOMP_NO_COMPOSE, 3748}, /* compatibility mapping */
+ {0xFC2B, 0, 2 | DECOMP_NO_COMPOSE, 3750}, /* compatibility mapping */
+ {0xFC2C, 0, 2 | DECOMP_NO_COMPOSE, 3752}, /* compatibility mapping */
+ {0xFC2D, 0, 2 | DECOMP_NO_COMPOSE, 3754}, /* compatibility mapping */
+ {0xFC2E, 0, 2 | DECOMP_NO_COMPOSE, 3756}, /* compatibility mapping */
+ {0xFC2F, 0, 2 | DECOMP_NO_COMPOSE, 3758}, /* compatibility mapping */
+ {0xFC30, 0, 2 | DECOMP_NO_COMPOSE, 3760}, /* compatibility mapping */
+ {0xFC31, 0, 2 | DECOMP_NO_COMPOSE, 3762}, /* compatibility mapping */
+ {0xFC32, 0, 2 | DECOMP_NO_COMPOSE, 3764}, /* compatibility mapping */
+ {0xFC33, 0, 2 | DECOMP_NO_COMPOSE, 3766}, /* compatibility mapping */
+ {0xFC34, 0, 2 | DECOMP_NO_COMPOSE, 3768}, /* compatibility mapping */
+ {0xFC35, 0, 2 | DECOMP_NO_COMPOSE, 3770}, /* compatibility mapping */
+ {0xFC36, 0, 2 | DECOMP_NO_COMPOSE, 3772}, /* compatibility mapping */
+ {0xFC37, 0, 2 | DECOMP_NO_COMPOSE, 3774}, /* compatibility mapping */
+ {0xFC38, 0, 2 | DECOMP_NO_COMPOSE, 3776}, /* compatibility mapping */
+ {0xFC39, 0, 2 | DECOMP_NO_COMPOSE, 3778}, /* compatibility mapping */
+ {0xFC3A, 0, 2 | DECOMP_NO_COMPOSE, 3780}, /* compatibility mapping */
+ {0xFC3B, 0, 2 | DECOMP_NO_COMPOSE, 3782}, /* compatibility mapping */
+ {0xFC3C, 0, 2 | DECOMP_NO_COMPOSE, 3784}, /* compatibility mapping */
+ {0xFC3D, 0, 2 | DECOMP_NO_COMPOSE, 3786}, /* compatibility mapping */
+ {0xFC3E, 0, 2 | DECOMP_NO_COMPOSE, 3788}, /* compatibility mapping */
+ {0xFC3F, 0, 2 | DECOMP_NO_COMPOSE, 3790}, /* compatibility mapping */
+ {0xFC40, 0, 2 | DECOMP_NO_COMPOSE, 3792}, /* compatibility mapping */
+ {0xFC41, 0, 2 | DECOMP_NO_COMPOSE, 3794}, /* compatibility mapping */
+ {0xFC42, 0, 2 | DECOMP_NO_COMPOSE, 3796}, /* compatibility mapping */
+ {0xFC43, 0, 2 | DECOMP_NO_COMPOSE, 3798}, /* compatibility mapping */
+ {0xFC44, 0, 2 | DECOMP_NO_COMPOSE, 3800}, /* compatibility mapping */
+ {0xFC45, 0, 2 | DECOMP_NO_COMPOSE, 3802}, /* compatibility mapping */
+ {0xFC46, 0, 2 | DECOMP_NO_COMPOSE, 3804}, /* compatibility mapping */
+ {0xFC47, 0, 2 | DECOMP_NO_COMPOSE, 3806}, /* compatibility mapping */
+ {0xFC48, 0, 2 | DECOMP_NO_COMPOSE, 3808}, /* compatibility mapping */
+ {0xFC49, 0, 2 | DECOMP_NO_COMPOSE, 3810}, /* compatibility mapping */
+ {0xFC4A, 0, 2 | DECOMP_NO_COMPOSE, 3812}, /* compatibility mapping */
+ {0xFC4B, 0, 2 | DECOMP_NO_COMPOSE, 3814}, /* compatibility mapping */
+ {0xFC4C, 0, 2 | DECOMP_NO_COMPOSE, 3816}, /* compatibility mapping */
+ {0xFC4D, 0, 2 | DECOMP_NO_COMPOSE, 3818}, /* compatibility mapping */
+ {0xFC4E, 0, 2 | DECOMP_NO_COMPOSE, 3820}, /* compatibility mapping */
+ {0xFC4F, 0, 2 | DECOMP_NO_COMPOSE, 3822}, /* compatibility mapping */
+ {0xFC50, 0, 2 | DECOMP_NO_COMPOSE, 3824}, /* compatibility mapping */
+ {0xFC51, 0, 2 | DECOMP_NO_COMPOSE, 3826}, /* compatibility mapping */
+ {0xFC52, 0, 2 | DECOMP_NO_COMPOSE, 3828}, /* compatibility mapping */
+ {0xFC53, 0, 2 | DECOMP_NO_COMPOSE, 3830}, /* compatibility mapping */
+ {0xFC54, 0, 2 | DECOMP_NO_COMPOSE, 3832}, /* compatibility mapping */
+ {0xFC55, 0, 2 | DECOMP_NO_COMPOSE, 3834}, /* compatibility mapping */
+ {0xFC56, 0, 2 | DECOMP_NO_COMPOSE, 3836}, /* compatibility mapping */
+ {0xFC57, 0, 2 | DECOMP_NO_COMPOSE, 3838}, /* compatibility mapping */
+ {0xFC58, 0, 2 | DECOMP_NO_COMPOSE, 3840}, /* compatibility mapping */
+ {0xFC59, 0, 2 | DECOMP_NO_COMPOSE, 3842}, /* compatibility mapping */
+ {0xFC5A, 0, 2 | DECOMP_NO_COMPOSE, 3844}, /* compatibility mapping */
+ {0xFC5B, 0, 2 | DECOMP_NO_COMPOSE, 3846}, /* compatibility mapping */
+ {0xFC5C, 0, 2 | DECOMP_NO_COMPOSE, 3848}, /* compatibility mapping */
+ {0xFC5D, 0, 2 | DECOMP_NO_COMPOSE, 3850}, /* compatibility mapping */
+ {0xFC5E, 0, 3, 3852},
+ {0xFC5F, 0, 3, 3855},
+ {0xFC60, 0, 3, 3858},
+ {0xFC61, 0, 3, 3861},
+ {0xFC62, 0, 3, 3864},
+ {0xFC63, 0, 3, 3867},
+ {0xFC64, 0, 2 | DECOMP_NO_COMPOSE, 3870}, /* compatibility mapping */
+ {0xFC65, 0, 2 | DECOMP_NO_COMPOSE, 3872}, /* compatibility mapping */
+ {0xFC66, 0, 2 | DECOMP_NO_COMPOSE, 3874}, /* compatibility mapping */
+ {0xFC67, 0, 2 | DECOMP_NO_COMPOSE, 3876}, /* compatibility mapping */
+ {0xFC68, 0, 2 | DECOMP_NO_COMPOSE, 3878}, /* compatibility mapping */
+ {0xFC69, 0, 2 | DECOMP_NO_COMPOSE, 3880}, /* compatibility mapping */
+ {0xFC6A, 0, 2 | DECOMP_NO_COMPOSE, 3882}, /* compatibility mapping */
+ {0xFC6B, 0, 2 | DECOMP_NO_COMPOSE, 3884}, /* compatibility mapping */
+ {0xFC6C, 0, 2 | DECOMP_NO_COMPOSE, 3886}, /* compatibility mapping */
+ {0xFC6D, 0, 2 | DECOMP_NO_COMPOSE, 3888}, /* compatibility mapping */
+ {0xFC6E, 0, 2 | DECOMP_NO_COMPOSE, 3890}, /* compatibility mapping */
+ {0xFC6F, 0, 2 | DECOMP_NO_COMPOSE, 3892}, /* compatibility mapping */
+ {0xFC70, 0, 2 | DECOMP_NO_COMPOSE, 3894}, /* compatibility mapping */
+ {0xFC71, 0, 2 | DECOMP_NO_COMPOSE, 3896}, /* compatibility mapping */
+ {0xFC72, 0, 2 | DECOMP_NO_COMPOSE, 3898}, /* compatibility mapping */
+ {0xFC73, 0, 2 | DECOMP_NO_COMPOSE, 3900}, /* compatibility mapping */
+ {0xFC74, 0, 2 | DECOMP_NO_COMPOSE, 3902}, /* compatibility mapping */
+ {0xFC75, 0, 2 | DECOMP_NO_COMPOSE, 3904}, /* compatibility mapping */
+ {0xFC76, 0, 2 | DECOMP_NO_COMPOSE, 3906}, /* compatibility mapping */
+ {0xFC77, 0, 2 | DECOMP_NO_COMPOSE, 3908}, /* compatibility mapping */
+ {0xFC78, 0, 2 | DECOMP_NO_COMPOSE, 3910}, /* compatibility mapping */
+ {0xFC79, 0, 2 | DECOMP_NO_COMPOSE, 3912}, /* compatibility mapping */
+ {0xFC7A, 0, 2 | DECOMP_NO_COMPOSE, 3914}, /* compatibility mapping */
+ {0xFC7B, 0, 2 | DECOMP_NO_COMPOSE, 3916}, /* compatibility mapping */
+ {0xFC7C, 0, 2 | DECOMP_NO_COMPOSE, 3918}, /* compatibility mapping */
+ {0xFC7D, 0, 2 | DECOMP_NO_COMPOSE, 3920}, /* compatibility mapping */
+ {0xFC7E, 0, 2 | DECOMP_NO_COMPOSE, 3922}, /* compatibility mapping */
+ {0xFC7F, 0, 2 | DECOMP_NO_COMPOSE, 3924}, /* compatibility mapping */
+ {0xFC80, 0, 2 | DECOMP_NO_COMPOSE, 3926}, /* compatibility mapping */
+ {0xFC81, 0, 2 | DECOMP_NO_COMPOSE, 3928}, /* compatibility mapping */
+ {0xFC82, 0, 2 | DECOMP_NO_COMPOSE, 3930}, /* compatibility mapping */
+ {0xFC83, 0, 2 | DECOMP_NO_COMPOSE, 3932}, /* compatibility mapping */
+ {0xFC84, 0, 2 | DECOMP_NO_COMPOSE, 3934}, /* compatibility mapping */
+ {0xFC85, 0, 2 | DECOMP_NO_COMPOSE, 3936}, /* compatibility mapping */
+ {0xFC86, 0, 2 | DECOMP_NO_COMPOSE, 3938}, /* compatibility mapping */
+ {0xFC87, 0, 2 | DECOMP_NO_COMPOSE, 3940}, /* compatibility mapping */
+ {0xFC88, 0, 2 | DECOMP_NO_COMPOSE, 3942}, /* compatibility mapping */
+ {0xFC89, 0, 2 | DECOMP_NO_COMPOSE, 3944}, /* compatibility mapping */
+ {0xFC8A, 0, 2 | DECOMP_NO_COMPOSE, 3946}, /* compatibility mapping */
+ {0xFC8B, 0, 2 | DECOMP_NO_COMPOSE, 3948}, /* compatibility mapping */
+ {0xFC8C, 0, 2 | DECOMP_NO_COMPOSE, 3950}, /* compatibility mapping */
+ {0xFC8D, 0, 2 | DECOMP_NO_COMPOSE, 3952}, /* compatibility mapping */
+ {0xFC8E, 0, 2 | DECOMP_NO_COMPOSE, 3954}, /* compatibility mapping */
+ {0xFC8F, 0, 2 | DECOMP_NO_COMPOSE, 3956}, /* compatibility mapping */
+ {0xFC90, 0, 2 | DECOMP_NO_COMPOSE, 3958}, /* compatibility mapping */
+ {0xFC91, 0, 2 | DECOMP_NO_COMPOSE, 3960}, /* compatibility mapping */
+ {0xFC92, 0, 2 | DECOMP_NO_COMPOSE, 3962}, /* compatibility mapping */
+ {0xFC93, 0, 2 | DECOMP_NO_COMPOSE, 3964}, /* compatibility mapping */
+ {0xFC94, 0, 2 | DECOMP_NO_COMPOSE, 3966}, /* compatibility mapping */
+ {0xFC95, 0, 2 | DECOMP_NO_COMPOSE, 3968}, /* compatibility mapping */
+ {0xFC96, 0, 2 | DECOMP_NO_COMPOSE, 3970}, /* compatibility mapping */
+ {0xFC97, 0, 2 | DECOMP_NO_COMPOSE, 3972}, /* compatibility mapping */
+ {0xFC98, 0, 2 | DECOMP_NO_COMPOSE, 3974}, /* compatibility mapping */
+ {0xFC99, 0, 2 | DECOMP_NO_COMPOSE, 3976}, /* compatibility mapping */
+ {0xFC9A, 0, 2 | DECOMP_NO_COMPOSE, 3978}, /* compatibility mapping */
+ {0xFC9B, 0, 2 | DECOMP_NO_COMPOSE, 3980}, /* compatibility mapping */
+ {0xFC9C, 0, 2 | DECOMP_NO_COMPOSE, 3982}, /* compatibility mapping */
+ {0xFC9D, 0, 2 | DECOMP_NO_COMPOSE, 3984}, /* compatibility mapping */
+ {0xFC9E, 0, 2 | DECOMP_NO_COMPOSE, 3986}, /* compatibility mapping */
+ {0xFC9F, 0, 2 | DECOMP_NO_COMPOSE, 3988}, /* compatibility mapping */
+ {0xFCA0, 0, 2 | DECOMP_NO_COMPOSE, 3990}, /* compatibility mapping */
+ {0xFCA1, 0, 2 | DECOMP_NO_COMPOSE, 3992}, /* compatibility mapping */
+ {0xFCA2, 0, 2 | DECOMP_NO_COMPOSE, 3994}, /* compatibility mapping */
+ {0xFCA3, 0, 2 | DECOMP_NO_COMPOSE, 3996}, /* compatibility mapping */
+ {0xFCA4, 0, 2 | DECOMP_NO_COMPOSE, 3998}, /* compatibility mapping */
+ {0xFCA5, 0, 2 | DECOMP_NO_COMPOSE, 4000}, /* compatibility mapping */
+ {0xFCA6, 0, 2 | DECOMP_NO_COMPOSE, 4002}, /* compatibility mapping */
+ {0xFCA7, 0, 2 | DECOMP_NO_COMPOSE, 4004}, /* compatibility mapping */
+ {0xFCA8, 0, 2 | DECOMP_NO_COMPOSE, 4006}, /* compatibility mapping */
+ {0xFCA9, 0, 2 | DECOMP_NO_COMPOSE, 4008}, /* compatibility mapping */
+ {0xFCAA, 0, 2 | DECOMP_NO_COMPOSE, 4010}, /* compatibility mapping */
+ {0xFCAB, 0, 2 | DECOMP_NO_COMPOSE, 4012}, /* compatibility mapping */
+ {0xFCAC, 0, 2 | DECOMP_NO_COMPOSE, 4014}, /* compatibility mapping */
+ {0xFCAD, 0, 2 | DECOMP_NO_COMPOSE, 4016}, /* compatibility mapping */
+ {0xFCAE, 0, 2 | DECOMP_NO_COMPOSE, 4018}, /* compatibility mapping */
+ {0xFCAF, 0, 2 | DECOMP_NO_COMPOSE, 4020}, /* compatibility mapping */
+ {0xFCB0, 0, 2 | DECOMP_NO_COMPOSE, 4022}, /* compatibility mapping */
+ {0xFCB1, 0, 2 | DECOMP_NO_COMPOSE, 4024}, /* compatibility mapping */
+ {0xFCB2, 0, 2 | DECOMP_NO_COMPOSE, 4026}, /* compatibility mapping */
+ {0xFCB3, 0, 2 | DECOMP_NO_COMPOSE, 4028}, /* compatibility mapping */
+ {0xFCB4, 0, 2 | DECOMP_NO_COMPOSE, 4030}, /* compatibility mapping */
+ {0xFCB5, 0, 2 | DECOMP_NO_COMPOSE, 4032}, /* compatibility mapping */
+ {0xFCB6, 0, 2 | DECOMP_NO_COMPOSE, 4034}, /* compatibility mapping */
+ {0xFCB7, 0, 2 | DECOMP_NO_COMPOSE, 4036}, /* compatibility mapping */
+ {0xFCB8, 0, 2 | DECOMP_NO_COMPOSE, 4038}, /* compatibility mapping */
+ {0xFCB9, 0, 2 | DECOMP_NO_COMPOSE, 4040}, /* compatibility mapping */
+ {0xFCBA, 0, 2 | DECOMP_NO_COMPOSE, 4042}, /* compatibility mapping */
+ {0xFCBB, 0, 2 | DECOMP_NO_COMPOSE, 4044}, /* compatibility mapping */
+ {0xFCBC, 0, 2 | DECOMP_NO_COMPOSE, 4046}, /* compatibility mapping */
+ {0xFCBD, 0, 2 | DECOMP_NO_COMPOSE, 4048}, /* compatibility mapping */
+ {0xFCBE, 0, 2 | DECOMP_NO_COMPOSE, 4050}, /* compatibility mapping */
+ {0xFCBF, 0, 2 | DECOMP_NO_COMPOSE, 4052}, /* compatibility mapping */
+ {0xFCC0, 0, 2 | DECOMP_NO_COMPOSE, 4054}, /* compatibility mapping */
+ {0xFCC1, 0, 2 | DECOMP_NO_COMPOSE, 4056}, /* compatibility mapping */
+ {0xFCC2, 0, 2 | DECOMP_NO_COMPOSE, 4058}, /* compatibility mapping */
+ {0xFCC3, 0, 2 | DECOMP_NO_COMPOSE, 4060}, /* compatibility mapping */
+ {0xFCC4, 0, 2 | DECOMP_NO_COMPOSE, 4062}, /* compatibility mapping */
+ {0xFCC5, 0, 2 | DECOMP_NO_COMPOSE, 4064}, /* compatibility mapping */
+ {0xFCC6, 0, 2 | DECOMP_NO_COMPOSE, 4066}, /* compatibility mapping */
+ {0xFCC7, 0, 2 | DECOMP_NO_COMPOSE, 4068}, /* compatibility mapping */
+ {0xFCC8, 0, 2 | DECOMP_NO_COMPOSE, 4070}, /* compatibility mapping */
+ {0xFCC9, 0, 2 | DECOMP_NO_COMPOSE, 4072}, /* compatibility mapping */
+ {0xFCCA, 0, 2 | DECOMP_NO_COMPOSE, 4074}, /* compatibility mapping */
+ {0xFCCB, 0, 2 | DECOMP_NO_COMPOSE, 4076}, /* compatibility mapping */
+ {0xFCCC, 0, 2 | DECOMP_NO_COMPOSE, 4078}, /* compatibility mapping */
+ {0xFCCD, 0, 2 | DECOMP_NO_COMPOSE, 4080}, /* compatibility mapping */
+ {0xFCCE, 0, 2 | DECOMP_NO_COMPOSE, 4082}, /* compatibility mapping */
+ {0xFCCF, 0, 2 | DECOMP_NO_COMPOSE, 4084}, /* compatibility mapping */
+ {0xFCD0, 0, 2 | DECOMP_NO_COMPOSE, 4086}, /* compatibility mapping */
+ {0xFCD1, 0, 2 | DECOMP_NO_COMPOSE, 4088}, /* compatibility mapping */
+ {0xFCD2, 0, 2 | DECOMP_NO_COMPOSE, 4090}, /* compatibility mapping */
+ {0xFCD3, 0, 2 | DECOMP_NO_COMPOSE, 4092}, /* compatibility mapping */
+ {0xFCD4, 0, 2 | DECOMP_NO_COMPOSE, 4094}, /* compatibility mapping */
+ {0xFCD5, 0, 2 | DECOMP_NO_COMPOSE, 4096}, /* compatibility mapping */
+ {0xFCD6, 0, 2 | DECOMP_NO_COMPOSE, 4098}, /* compatibility mapping */
+ {0xFCD7, 0, 2 | DECOMP_NO_COMPOSE, 4100}, /* compatibility mapping */
+ {0xFCD8, 0, 2 | DECOMP_NO_COMPOSE, 4102}, /* compatibility mapping */
+ {0xFCD9, 0, 2 | DECOMP_NO_COMPOSE, 4104}, /* compatibility mapping */
+ {0xFCDA, 0, 2 | DECOMP_NO_COMPOSE, 4106}, /* compatibility mapping */
+ {0xFCDB, 0, 2 | DECOMP_NO_COMPOSE, 4108}, /* compatibility mapping */
+ {0xFCDC, 0, 2 | DECOMP_NO_COMPOSE, 4110}, /* compatibility mapping */
+ {0xFCDD, 0, 2 | DECOMP_NO_COMPOSE, 4112}, /* compatibility mapping */
+ {0xFCDE, 0, 2 | DECOMP_NO_COMPOSE, 4114}, /* compatibility mapping */
+ {0xFCDF, 0, 2 | DECOMP_NO_COMPOSE, 4116}, /* compatibility mapping */
+ {0xFCE0, 0, 2 | DECOMP_NO_COMPOSE, 4118}, /* compatibility mapping */
+ {0xFCE1, 0, 2 | DECOMP_NO_COMPOSE, 4120}, /* compatibility mapping */
+ {0xFCE2, 0, 2 | DECOMP_NO_COMPOSE, 4122}, /* compatibility mapping */
+ {0xFCE3, 0, 2 | DECOMP_NO_COMPOSE, 4124}, /* compatibility mapping */
+ {0xFCE4, 0, 2 | DECOMP_NO_COMPOSE, 4126}, /* compatibility mapping */
+ {0xFCE5, 0, 2 | DECOMP_NO_COMPOSE, 4128}, /* compatibility mapping */
+ {0xFCE6, 0, 2 | DECOMP_NO_COMPOSE, 4130}, /* compatibility mapping */
+ {0xFCE7, 0, 2 | DECOMP_NO_COMPOSE, 4132}, /* compatibility mapping */
+ {0xFCE8, 0, 2 | DECOMP_NO_COMPOSE, 4134}, /* compatibility mapping */
+ {0xFCE9, 0, 2 | DECOMP_NO_COMPOSE, 4136}, /* compatibility mapping */
+ {0xFCEA, 0, 2 | DECOMP_NO_COMPOSE, 4138}, /* compatibility mapping */
+ {0xFCEB, 0, 2 | DECOMP_NO_COMPOSE, 4140}, /* compatibility mapping */
+ {0xFCEC, 0, 2 | DECOMP_NO_COMPOSE, 4142}, /* compatibility mapping */
+ {0xFCED, 0, 2 | DECOMP_NO_COMPOSE, 4144}, /* compatibility mapping */
+ {0xFCEE, 0, 2 | DECOMP_NO_COMPOSE, 4146}, /* compatibility mapping */
+ {0xFCEF, 0, 2 | DECOMP_NO_COMPOSE, 4148}, /* compatibility mapping */
+ {0xFCF0, 0, 2 | DECOMP_NO_COMPOSE, 4150}, /* compatibility mapping */
+ {0xFCF1, 0, 2 | DECOMP_NO_COMPOSE, 4152}, /* compatibility mapping */
+ {0xFCF2, 0, 3, 4154},
+ {0xFCF3, 0, 3, 4157},
+ {0xFCF4, 0, 3, 4160},
+ {0xFCF5, 0, 2 | DECOMP_NO_COMPOSE, 4163}, /* compatibility mapping */
+ {0xFCF6, 0, 2 | DECOMP_NO_COMPOSE, 4165}, /* compatibility mapping */
+ {0xFCF7, 0, 2 | DECOMP_NO_COMPOSE, 4167}, /* compatibility mapping */
+ {0xFCF8, 0, 2 | DECOMP_NO_COMPOSE, 4169}, /* compatibility mapping */
+ {0xFCF9, 0, 2 | DECOMP_NO_COMPOSE, 4171}, /* compatibility mapping */
+ {0xFCFA, 0, 2 | DECOMP_NO_COMPOSE, 4173}, /* compatibility mapping */
+ {0xFCFB, 0, 2 | DECOMP_NO_COMPOSE, 4175}, /* compatibility mapping */
+ {0xFCFC, 0, 2 | DECOMP_NO_COMPOSE, 4177}, /* compatibility mapping */
+ {0xFCFD, 0, 2 | DECOMP_NO_COMPOSE, 4179}, /* compatibility mapping */
+ {0xFCFE, 0, 2 | DECOMP_NO_COMPOSE, 4181}, /* compatibility mapping */
+ {0xFCFF, 0, 2 | DECOMP_NO_COMPOSE, 4183}, /* compatibility mapping */
+ {0xFD00, 0, 2 | DECOMP_NO_COMPOSE, 4185}, /* compatibility mapping */
+ {0xFD01, 0, 2 | DECOMP_NO_COMPOSE, 4187}, /* compatibility mapping */
+ {0xFD02, 0, 2 | DECOMP_NO_COMPOSE, 4189}, /* compatibility mapping */
+ {0xFD03, 0, 2 | DECOMP_NO_COMPOSE, 4191}, /* compatibility mapping */
+ {0xFD04, 0, 2 | DECOMP_NO_COMPOSE, 4193}, /* compatibility mapping */
+ {0xFD05, 0, 2 | DECOMP_NO_COMPOSE, 4195}, /* compatibility mapping */
+ {0xFD06, 0, 2 | DECOMP_NO_COMPOSE, 4197}, /* compatibility mapping */
+ {0xFD07, 0, 2 | DECOMP_NO_COMPOSE, 4199}, /* compatibility mapping */
+ {0xFD08, 0, 2 | DECOMP_NO_COMPOSE, 4201}, /* compatibility mapping */
+ {0xFD09, 0, 2 | DECOMP_NO_COMPOSE, 4203}, /* compatibility mapping */
+ {0xFD0A, 0, 2 | DECOMP_NO_COMPOSE, 4205}, /* compatibility mapping */
+ {0xFD0B, 0, 2 | DECOMP_NO_COMPOSE, 4207}, /* compatibility mapping */
+ {0xFD0C, 0, 2 | DECOMP_NO_COMPOSE, 4209}, /* compatibility mapping */
+ {0xFD0D, 0, 2 | DECOMP_NO_COMPOSE, 4211}, /* compatibility mapping */
+ {0xFD0E, 0, 2 | DECOMP_NO_COMPOSE, 4213}, /* compatibility mapping */
+ {0xFD0F, 0, 2 | DECOMP_NO_COMPOSE, 4215}, /* compatibility mapping */
+ {0xFD10, 0, 2 | DECOMP_NO_COMPOSE, 4217}, /* compatibility mapping */
+ {0xFD11, 0, 2 | DECOMP_NO_COMPOSE, 4219}, /* compatibility mapping */
+ {0xFD12, 0, 2 | DECOMP_NO_COMPOSE, 4221}, /* compatibility mapping */
+ {0xFD13, 0, 2 | DECOMP_NO_COMPOSE, 4223}, /* compatibility mapping */
+ {0xFD14, 0, 2 | DECOMP_NO_COMPOSE, 4225}, /* compatibility mapping */
+ {0xFD15, 0, 2 | DECOMP_NO_COMPOSE, 4227}, /* compatibility mapping */
+ {0xFD16, 0, 2 | DECOMP_NO_COMPOSE, 4229}, /* compatibility mapping */
+ {0xFD17, 0, 2 | DECOMP_NO_COMPOSE, 4231}, /* compatibility mapping */
+ {0xFD18, 0, 2 | DECOMP_NO_COMPOSE, 4233}, /* compatibility mapping */
+ {0xFD19, 0, 2 | DECOMP_NO_COMPOSE, 4235}, /* compatibility mapping */
+ {0xFD1A, 0, 2 | DECOMP_NO_COMPOSE, 4237}, /* compatibility mapping */
+ {0xFD1B, 0, 2 | DECOMP_NO_COMPOSE, 4239}, /* compatibility mapping */
+ {0xFD1C, 0, 2 | DECOMP_NO_COMPOSE, 4241}, /* compatibility mapping */
+ {0xFD1D, 0, 2 | DECOMP_NO_COMPOSE, 4243}, /* compatibility mapping */
+ {0xFD1E, 0, 2 | DECOMP_NO_COMPOSE, 4245}, /* compatibility mapping */
+ {0xFD1F, 0, 2 | DECOMP_NO_COMPOSE, 4247}, /* compatibility mapping */
+ {0xFD20, 0, 2 | DECOMP_NO_COMPOSE, 4249}, /* compatibility mapping */
+ {0xFD21, 0, 2 | DECOMP_NO_COMPOSE, 4251}, /* compatibility mapping */
+ {0xFD22, 0, 2 | DECOMP_NO_COMPOSE, 4253}, /* compatibility mapping */
+ {0xFD23, 0, 2 | DECOMP_NO_COMPOSE, 4255}, /* compatibility mapping */
+ {0xFD24, 0, 2 | DECOMP_NO_COMPOSE, 4257}, /* compatibility mapping */
+ {0xFD25, 0, 2 | DECOMP_NO_COMPOSE, 4259}, /* compatibility mapping */
+ {0xFD26, 0, 2 | DECOMP_NO_COMPOSE, 4261}, /* compatibility mapping */
+ {0xFD27, 0, 2 | DECOMP_NO_COMPOSE, 4263}, /* compatibility mapping */
+ {0xFD28, 0, 2 | DECOMP_NO_COMPOSE, 4265}, /* compatibility mapping */
+ {0xFD29, 0, 2 | DECOMP_NO_COMPOSE, 4267}, /* compatibility mapping */
+ {0xFD2A, 0, 2 | DECOMP_NO_COMPOSE, 4269}, /* compatibility mapping */
+ {0xFD2B, 0, 2 | DECOMP_NO_COMPOSE, 4271}, /* compatibility mapping */
+ {0xFD2C, 0, 2 | DECOMP_NO_COMPOSE, 4273}, /* compatibility mapping */
+ {0xFD2D, 0, 2 | DECOMP_NO_COMPOSE, 4275}, /* compatibility mapping */
+ {0xFD2E, 0, 2 | DECOMP_NO_COMPOSE, 4277}, /* compatibility mapping */
+ {0xFD2F, 0, 2 | DECOMP_NO_COMPOSE, 4279}, /* compatibility mapping */
+ {0xFD30, 0, 2 | DECOMP_NO_COMPOSE, 4281}, /* compatibility mapping */
+ {0xFD31, 0, 2 | DECOMP_NO_COMPOSE, 4283}, /* compatibility mapping */
+ {0xFD32, 0, 2 | DECOMP_NO_COMPOSE, 4285}, /* compatibility mapping */
+ {0xFD33, 0, 2 | DECOMP_NO_COMPOSE, 4287}, /* compatibility mapping */
+ {0xFD34, 0, 2 | DECOMP_NO_COMPOSE, 4289}, /* compatibility mapping */
+ {0xFD35, 0, 2 | DECOMP_NO_COMPOSE, 4291}, /* compatibility mapping */
+ {0xFD36, 0, 2 | DECOMP_NO_COMPOSE, 4293}, /* compatibility mapping */
+ {0xFD37, 0, 2 | DECOMP_NO_COMPOSE, 4295}, /* compatibility mapping */
+ {0xFD38, 0, 2 | DECOMP_NO_COMPOSE, 4297}, /* compatibility mapping */
+ {0xFD39, 0, 2 | DECOMP_NO_COMPOSE, 4299}, /* compatibility mapping */
+ {0xFD3A, 0, 2 | DECOMP_NO_COMPOSE, 4301}, /* compatibility mapping */
+ {0xFD3B, 0, 2 | DECOMP_NO_COMPOSE, 4303}, /* compatibility mapping */
+ {0xFD3C, 0, 2 | DECOMP_NO_COMPOSE, 4305}, /* compatibility mapping */
+ {0xFD3D, 0, 2 | DECOMP_NO_COMPOSE, 4307}, /* compatibility mapping */
+ {0xFD50, 0, 3, 4309},
+ {0xFD51, 0, 3, 4312},
+ {0xFD52, 0, 3, 4315},
+ {0xFD53, 0, 3, 4318},
+ {0xFD54, 0, 3, 4321},
+ {0xFD55, 0, 3, 4324},
+ {0xFD56, 0, 3, 4327},
+ {0xFD57, 0, 3, 4330},
+ {0xFD58, 0, 3, 4333},
+ {0xFD59, 0, 3, 4336},
+ {0xFD5A, 0, 3, 4339},
+ {0xFD5B, 0, 3, 4342},
+ {0xFD5C, 0, 3, 4345},
+ {0xFD5D, 0, 3, 4348},
+ {0xFD5E, 0, 3, 4351},
+ {0xFD5F, 0, 3, 4354},
+ {0xFD60, 0, 3, 4357},
+ {0xFD61, 0, 3, 4360},
+ {0xFD62, 0, 3, 4363},
+ {0xFD63, 0, 3, 4366},
+ {0xFD64, 0, 3, 4369},
+ {0xFD65, 0, 3, 4372},
+ {0xFD66, 0, 3, 4375},
+ {0xFD67, 0, 3, 4378},
+ {0xFD68, 0, 3, 4381},
+ {0xFD69, 0, 3, 4384},
+ {0xFD6A, 0, 3, 4387},
+ {0xFD6B, 0, 3, 4390},
+ {0xFD6C, 0, 3, 4393},
+ {0xFD6D, 0, 3, 4396},
+ {0xFD6E, 0, 3, 4399},
+ {0xFD6F, 0, 3, 4402},
+ {0xFD70, 0, 3, 4405},
+ {0xFD71, 0, 3, 4408},
+ {0xFD72, 0, 3, 4411},
+ {0xFD73, 0, 3, 4414},
+ {0xFD74, 0, 3, 4417},
+ {0xFD75, 0, 3, 4420},
+ {0xFD76, 0, 3, 4423},
+ {0xFD77, 0, 3, 4426},
+ {0xFD78, 0, 3, 4429},
+ {0xFD79, 0, 3, 4432},
+ {0xFD7A, 0, 3, 4435},
+ {0xFD7B, 0, 3, 4438},
+ {0xFD7C, 0, 3, 4441},
+ {0xFD7D, 0, 3, 4444},
+ {0xFD7E, 0, 3, 4447},
+ {0xFD7F, 0, 3, 4450},
+ {0xFD80, 0, 3, 4453},
+ {0xFD81, 0, 3, 4456},
+ {0xFD82, 0, 3, 4459},
+ {0xFD83, 0, 3, 4462},
+ {0xFD84, 0, 3, 4465},
+ {0xFD85, 0, 3, 4468},
+ {0xFD86, 0, 3, 4471},
+ {0xFD87, 0, 3, 4474},
+ {0xFD88, 0, 3, 4477},
+ {0xFD89, 0, 3, 4480},
+ {0xFD8A, 0, 3, 4483},
+ {0xFD8B, 0, 3, 4486},
+ {0xFD8C, 0, 3, 4489},
+ {0xFD8D, 0, 3, 4492},
+ {0xFD8E, 0, 3, 4495},
+ {0xFD8F, 0, 3, 4498},
+ {0xFD92, 0, 3, 4501},
+ {0xFD93, 0, 3, 4504},
+ {0xFD94, 0, 3, 4507},
+ {0xFD95, 0, 3, 4510},
+ {0xFD96, 0, 3, 4513},
+ {0xFD97, 0, 3, 4516},
+ {0xFD98, 0, 3, 4519},
+ {0xFD99, 0, 3, 4522},
+ {0xFD9A, 0, 3, 4525},
+ {0xFD9B, 0, 3, 4528},
+ {0xFD9C, 0, 3, 4531},
+ {0xFD9D, 0, 3, 4534},
+ {0xFD9E, 0, 3, 4537},
+ {0xFD9F, 0, 3, 4540},
+ {0xFDA0, 0, 3, 4543},
+ {0xFDA1, 0, 3, 4546},
+ {0xFDA2, 0, 3, 4549},
+ {0xFDA3, 0, 3, 4552},
+ {0xFDA4, 0, 3, 4555},
+ {0xFDA5, 0, 3, 4558},
+ {0xFDA6, 0, 3, 4561},
+ {0xFDA7, 0, 3, 4564},
+ {0xFDA8, 0, 3, 4567},
+ {0xFDA9, 0, 3, 4570},
+ {0xFDAA, 0, 3, 4573},
+ {0xFDAB, 0, 3, 4576},
+ {0xFDAC, 0, 3, 4579},
+ {0xFDAD, 0, 3, 4582},
+ {0xFDAE, 0, 3, 4585},
+ {0xFDAF, 0, 3, 4588},
+ {0xFDB0, 0, 3, 4591},
+ {0xFDB1, 0, 3, 4594},
+ {0xFDB2, 0, 3, 4597},
+ {0xFDB3, 0, 3, 4600},
+ {0xFDB4, 0, 3, 4603},
+ {0xFDB5, 0, 3, 4606},
+ {0xFDB6, 0, 3, 4609},
+ {0xFDB7, 0, 3, 4612},
+ {0xFDB8, 0, 3, 4615},
+ {0xFDB9, 0, 3, 4618},
+ {0xFDBA, 0, 3, 4621},
+ {0xFDBB, 0, 3, 4624},
+ {0xFDBC, 0, 3, 4627},
+ {0xFDBD, 0, 3, 4630},
+ {0xFDBE, 0, 3, 4633},
+ {0xFDBF, 0, 3, 4636},
+ {0xFDC0, 0, 3, 4639},
+ {0xFDC1, 0, 3, 4642},
+ {0xFDC2, 0, 3, 4645},
+ {0xFDC3, 0, 3, 4648},
+ {0xFDC4, 0, 3, 4651},
+ {0xFDC5, 0, 3, 4654},
+ {0xFDC6, 0, 3, 4657},
+ {0xFDC7, 0, 3, 4660},
+ {0xFDF0, 0, 3, 4663},
+ {0xFDF1, 0, 3, 4666},
+ {0xFDF2, 0, 4, 4669},
+ {0xFDF3, 0, 4, 4673},
+ {0xFDF4, 0, 4, 4677},
+ {0xFDF5, 0, 4, 4681},
+ {0xFDF6, 0, 4, 4685},
+ {0xFDF7, 0, 4, 4689},
+ {0xFDF8, 0, 4, 4693},
+ {0xFDF9, 0, 3, 4697},
+ {0xFDFA, 0, 18, 4700},
+ {0xFDFB, 0, 8, 4718},
+ {0xFDFC, 0, 4, 4726},
+ {0xFE10, 0, 1 | DECOMP_INLINE, 0x002C},
+ {0xFE11, 0, 1 | DECOMP_INLINE, 0x3001},
+ {0xFE12, 0, 1 | DECOMP_INLINE, 0x3002},
+ {0xFE13, 0, 1 | DECOMP_INLINE, 0x003A},
+ {0xFE14, 0, 1 | DECOMP_INLINE, 0x003B},
+ {0xFE15, 0, 1 | DECOMP_INLINE, 0x0021},
+ {0xFE16, 0, 1 | DECOMP_INLINE, 0x003F},
+ {0xFE17, 0, 1 | DECOMP_INLINE, 0x3016},
+ {0xFE18, 0, 1 | DECOMP_INLINE, 0x3017},
+ {0xFE19, 0, 1 | DECOMP_INLINE, 0x2026},
+ {0xFE20, 230, 0, 0},
+ {0xFE21, 230, 0, 0},
+ {0xFE22, 230, 0, 0},
+ {0xFE23, 230, 0, 0},
+ {0xFE24, 230, 0, 0},
+ {0xFE25, 230, 0, 0},
+ {0xFE26, 230, 0, 0},
+ {0xFE27, 220, 0, 0},
+ {0xFE28, 220, 0, 0},
+ {0xFE29, 220, 0, 0},
+ {0xFE2A, 220, 0, 0},
+ {0xFE2B, 220, 0, 0},
+ {0xFE2C, 220, 0, 0},
+ {0xFE2D, 220, 0, 0},
+ {0xFE2E, 230, 0, 0},
+ {0xFE2F, 230, 0, 0},
+ {0xFE30, 0, 1 | DECOMP_INLINE, 0x2025},
+ {0xFE31, 0, 1 | DECOMP_INLINE, 0x2014},
+ {0xFE32, 0, 1 | DECOMP_INLINE, 0x2013},
+ {0xFE33, 0, 1 | DECOMP_INLINE, 0x005F},
+ {0xFE34, 0, 1 | DECOMP_INLINE, 0x005F},
+ {0xFE35, 0, 1 | DECOMP_INLINE, 0x0028},
+ {0xFE36, 0, 1 | DECOMP_INLINE, 0x0029},
+ {0xFE37, 0, 1 | DECOMP_INLINE, 0x007B},
+ {0xFE38, 0, 1 | DECOMP_INLINE, 0x007D},
+ {0xFE39, 0, 1 | DECOMP_INLINE, 0x3014},
+ {0xFE3A, 0, 1 | DECOMP_INLINE, 0x3015},
+ {0xFE3B, 0, 1 | DECOMP_INLINE, 0x3010},
+ {0xFE3C, 0, 1 | DECOMP_INLINE, 0x3011},
+ {0xFE3D, 0, 1 | DECOMP_INLINE, 0x300A},
+ {0xFE3E, 0, 1 | DECOMP_INLINE, 0x300B},
+ {0xFE3F, 0, 1 | DECOMP_INLINE, 0x3008},
+ {0xFE40, 0, 1 | DECOMP_INLINE, 0x3009},
+ {0xFE41, 0, 1 | DECOMP_INLINE, 0x300C},
+ {0xFE42, 0, 1 | DECOMP_INLINE, 0x300D},
+ {0xFE43, 0, 1 | DECOMP_INLINE, 0x300E},
+ {0xFE44, 0, 1 | DECOMP_INLINE, 0x300F},
+ {0xFE47, 0, 1 | DECOMP_INLINE, 0x005B},
+ {0xFE48, 0, 1 | DECOMP_INLINE, 0x005D},
+ {0xFE49, 0, 1 | DECOMP_INLINE, 0x203E},
+ {0xFE4A, 0, 1 | DECOMP_INLINE, 0x203E},
+ {0xFE4B, 0, 1 | DECOMP_INLINE, 0x203E},
+ {0xFE4C, 0, 1 | DECOMP_INLINE, 0x203E},
+ {0xFE4D, 0, 1 | DECOMP_INLINE, 0x005F},
+ {0xFE4E, 0, 1 | DECOMP_INLINE, 0x005F},
+ {0xFE4F, 0, 1 | DECOMP_INLINE, 0x005F},
+ {0xFE50, 0, 1 | DECOMP_INLINE, 0x002C},
+ {0xFE51, 0, 1 | DECOMP_INLINE, 0x3001},
+ {0xFE52, 0, 1 | DECOMP_INLINE, 0x002E},
+ {0xFE54, 0, 1 | DECOMP_INLINE, 0x003B},
+ {0xFE55, 0, 1 | DECOMP_INLINE, 0x003A},
+ {0xFE56, 0, 1 | DECOMP_INLINE, 0x003F},
+ {0xFE57, 0, 1 | DECOMP_INLINE, 0x0021},
+ {0xFE58, 0, 1 | DECOMP_INLINE, 0x2014},
+ {0xFE59, 0, 1 | DECOMP_INLINE, 0x0028},
+ {0xFE5A, 0, 1 | DECOMP_INLINE, 0x0029},
+ {0xFE5B, 0, 1 | DECOMP_INLINE, 0x007B},
+ {0xFE5C, 0, 1 | DECOMP_INLINE, 0x007D},
+ {0xFE5D, 0, 1 | DECOMP_INLINE, 0x3014},
+ {0xFE5E, 0, 1 | DECOMP_INLINE, 0x3015},
+ {0xFE5F, 0, 1 | DECOMP_INLINE, 0x0023},
+ {0xFE60, 0, 1 | DECOMP_INLINE, 0x0026},
+ {0xFE61, 0, 1 | DECOMP_INLINE, 0x002A},
+ {0xFE62, 0, 1 | DECOMP_INLINE, 0x002B},
+ {0xFE63, 0, 1 | DECOMP_INLINE, 0x002D},
+ {0xFE64, 0, 1 | DECOMP_INLINE, 0x003C},
+ {0xFE65, 0, 1 | DECOMP_INLINE, 0x003E},
+ {0xFE66, 0, 1 | DECOMP_INLINE, 0x003D},
+ {0xFE68, 0, 1 | DECOMP_INLINE, 0x005C},
+ {0xFE69, 0, 1 | DECOMP_INLINE, 0x0024},
+ {0xFE6A, 0, 1 | DECOMP_INLINE, 0x0025},
+ {0xFE6B, 0, 1 | DECOMP_INLINE, 0x0040},
+ {0xFE70, 0, 2 | DECOMP_NO_COMPOSE, 4730}, /* compatibility mapping */
+ {0xFE71, 0, 2 | DECOMP_NO_COMPOSE, 4732}, /* compatibility mapping */
+ {0xFE72, 0, 2 | DECOMP_NO_COMPOSE, 4734}, /* compatibility mapping */
+ {0xFE74, 0, 2 | DECOMP_NO_COMPOSE, 4736}, /* compatibility mapping */
+ {0xFE76, 0, 2 | DECOMP_NO_COMPOSE, 4738}, /* compatibility mapping */
+ {0xFE77, 0, 2 | DECOMP_NO_COMPOSE, 4740}, /* compatibility mapping */
+ {0xFE78, 0, 2 | DECOMP_NO_COMPOSE, 4742}, /* compatibility mapping */
+ {0xFE79, 0, 2 | DECOMP_NO_COMPOSE, 4744}, /* compatibility mapping */
+ {0xFE7A, 0, 2 | DECOMP_NO_COMPOSE, 4746}, /* compatibility mapping */
+ {0xFE7B, 0, 2 | DECOMP_NO_COMPOSE, 4748}, /* compatibility mapping */
+ {0xFE7C, 0, 2 | DECOMP_NO_COMPOSE, 4750}, /* compatibility mapping */
+ {0xFE7D, 0, 2 | DECOMP_NO_COMPOSE, 4752}, /* compatibility mapping */
+ {0xFE7E, 0, 2 | DECOMP_NO_COMPOSE, 4754}, /* compatibility mapping */
+ {0xFE7F, 0, 2 | DECOMP_NO_COMPOSE, 4756}, /* compatibility mapping */
+ {0xFE80, 0, 1 | DECOMP_INLINE, 0x0621},
+ {0xFE81, 0, 1 | DECOMP_INLINE, 0x0622},
+ {0xFE82, 0, 1 | DECOMP_INLINE, 0x0622},
+ {0xFE83, 0, 1 | DECOMP_INLINE, 0x0623},
+ {0xFE84, 0, 1 | DECOMP_INLINE, 0x0623},
+ {0xFE85, 0, 1 | DECOMP_INLINE, 0x0624},
+ {0xFE86, 0, 1 | DECOMP_INLINE, 0x0624},
+ {0xFE87, 0, 1 | DECOMP_INLINE, 0x0625},
+ {0xFE88, 0, 1 | DECOMP_INLINE, 0x0625},
+ {0xFE89, 0, 1 | DECOMP_INLINE, 0x0626},
+ {0xFE8A, 0, 1 | DECOMP_INLINE, 0x0626},
+ {0xFE8B, 0, 1 | DECOMP_INLINE, 0x0626},
+ {0xFE8C, 0, 1 | DECOMP_INLINE, 0x0626},
+ {0xFE8D, 0, 1 | DECOMP_INLINE, 0x0627},
+ {0xFE8E, 0, 1 | DECOMP_INLINE, 0x0627},
+ {0xFE8F, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0xFE90, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0xFE91, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0xFE92, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0xFE93, 0, 1 | DECOMP_INLINE, 0x0629},
+ {0xFE94, 0, 1 | DECOMP_INLINE, 0x0629},
+ {0xFE95, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0xFE96, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0xFE97, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0xFE98, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0xFE99, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0xFE9A, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0xFE9B, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0xFE9C, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0xFE9D, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0xFE9E, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0xFE9F, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0xFEA0, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0xFEA1, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0xFEA2, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0xFEA3, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0xFEA4, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0xFEA5, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0xFEA6, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0xFEA7, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0xFEA8, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0xFEA9, 0, 1 | DECOMP_INLINE, 0x062F},
+ {0xFEAA, 0, 1 | DECOMP_INLINE, 0x062F},
+ {0xFEAB, 0, 1 | DECOMP_INLINE, 0x0630},
+ {0xFEAC, 0, 1 | DECOMP_INLINE, 0x0630},
+ {0xFEAD, 0, 1 | DECOMP_INLINE, 0x0631},
+ {0xFEAE, 0, 1 | DECOMP_INLINE, 0x0631},
+ {0xFEAF, 0, 1 | DECOMP_INLINE, 0x0632},
+ {0xFEB0, 0, 1 | DECOMP_INLINE, 0x0632},
+ {0xFEB1, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0xFEB2, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0xFEB3, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0xFEB4, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0xFEB5, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0xFEB6, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0xFEB7, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0xFEB8, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0xFEB9, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0xFEBA, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0xFEBB, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0xFEBC, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0xFEBD, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0xFEBE, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0xFEBF, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0xFEC0, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0xFEC1, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0xFEC2, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0xFEC3, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0xFEC4, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0xFEC5, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0xFEC6, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0xFEC7, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0xFEC8, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0xFEC9, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0xFECA, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0xFECB, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0xFECC, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0xFECD, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0xFECE, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0xFECF, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0xFED0, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0xFED1, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0xFED2, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0xFED3, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0xFED4, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0xFED5, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0xFED6, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0xFED7, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0xFED8, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0xFED9, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0xFEDA, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0xFEDB, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0xFEDC, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0xFEDD, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0xFEDE, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0xFEDF, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0xFEE0, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0xFEE1, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0xFEE2, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0xFEE3, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0xFEE4, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0xFEE5, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0xFEE6, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0xFEE7, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0xFEE8, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0xFEE9, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0xFEEA, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0xFEEB, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0xFEEC, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0xFEED, 0, 1 | DECOMP_INLINE, 0x0648},
+ {0xFEEE, 0, 1 | DECOMP_INLINE, 0x0648},
+ {0xFEEF, 0, 1 | DECOMP_INLINE, 0x0649},
+ {0xFEF0, 0, 1 | DECOMP_INLINE, 0x0649},
+ {0xFEF1, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0xFEF2, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0xFEF3, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0xFEF4, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0xFEF5, 0, 2 | DECOMP_NO_COMPOSE, 4758}, /* compatibility mapping */
+ {0xFEF6, 0, 2 | DECOMP_NO_COMPOSE, 4760}, /* compatibility mapping */
+ {0xFEF7, 0, 2 | DECOMP_NO_COMPOSE, 4762}, /* compatibility mapping */
+ {0xFEF8, 0, 2 | DECOMP_NO_COMPOSE, 4764}, /* compatibility mapping */
+ {0xFEF9, 0, 2 | DECOMP_NO_COMPOSE, 4766}, /* compatibility mapping */
+ {0xFEFA, 0, 2 | DECOMP_NO_COMPOSE, 4768}, /* compatibility mapping */
+ {0xFEFB, 0, 2 | DECOMP_NO_COMPOSE, 4770}, /* compatibility mapping */
+ {0xFEFC, 0, 2 | DECOMP_NO_COMPOSE, 4772}, /* compatibility mapping */
+ {0xFF01, 0, 1 | DECOMP_INLINE, 0x0021},
+ {0xFF02, 0, 1 | DECOMP_INLINE, 0x0022},
+ {0xFF03, 0, 1 | DECOMP_INLINE, 0x0023},
+ {0xFF04, 0, 1 | DECOMP_INLINE, 0x0024},
+ {0xFF05, 0, 1 | DECOMP_INLINE, 0x0025},
+ {0xFF06, 0, 1 | DECOMP_INLINE, 0x0026},
+ {0xFF07, 0, 1 | DECOMP_INLINE, 0x0027},
+ {0xFF08, 0, 1 | DECOMP_INLINE, 0x0028},
+ {0xFF09, 0, 1 | DECOMP_INLINE, 0x0029},
+ {0xFF0A, 0, 1 | DECOMP_INLINE, 0x002A},
+ {0xFF0B, 0, 1 | DECOMP_INLINE, 0x002B},
+ {0xFF0C, 0, 1 | DECOMP_INLINE, 0x002C},
+ {0xFF0D, 0, 1 | DECOMP_INLINE, 0x002D},
+ {0xFF0E, 0, 1 | DECOMP_INLINE, 0x002E},
+ {0xFF0F, 0, 1 | DECOMP_INLINE, 0x002F},
+ {0xFF10, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0xFF11, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0xFF12, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0xFF13, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0xFF14, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0xFF15, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0xFF16, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0xFF17, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0xFF18, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0xFF19, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0xFF1A, 0, 1 | DECOMP_INLINE, 0x003A},
+ {0xFF1B, 0, 1 | DECOMP_INLINE, 0x003B},
+ {0xFF1C, 0, 1 | DECOMP_INLINE, 0x003C},
+ {0xFF1D, 0, 1 | DECOMP_INLINE, 0x003D},
+ {0xFF1E, 0, 1 | DECOMP_INLINE, 0x003E},
+ {0xFF1F, 0, 1 | DECOMP_INLINE, 0x003F},
+ {0xFF20, 0, 1 | DECOMP_INLINE, 0x0040},
+ {0xFF21, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0xFF22, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0xFF23, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0xFF24, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0xFF25, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0xFF26, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0xFF27, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0xFF28, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0xFF29, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0xFF2A, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0xFF2B, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0xFF2C, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0xFF2D, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0xFF2E, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0xFF2F, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0xFF30, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0xFF31, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0xFF32, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0xFF33, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0xFF34, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0xFF35, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0xFF36, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0xFF37, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0xFF38, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0xFF39, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0xFF3A, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0xFF3B, 0, 1 | DECOMP_INLINE, 0x005B},
+ {0xFF3C, 0, 1 | DECOMP_INLINE, 0x005C},
+ {0xFF3D, 0, 1 | DECOMP_INLINE, 0x005D},
+ {0xFF3E, 0, 1 | DECOMP_INLINE, 0x005E},
+ {0xFF3F, 0, 1 | DECOMP_INLINE, 0x005F},
+ {0xFF40, 0, 1 | DECOMP_INLINE, 0x0060},
+ {0xFF41, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0xFF42, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0xFF43, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0xFF44, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0xFF45, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0xFF46, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0xFF47, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0xFF48, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0xFF49, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0xFF4A, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0xFF4B, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0xFF4C, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0xFF4D, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0xFF4E, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0xFF4F, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0xFF50, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0xFF51, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0xFF52, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0xFF53, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0xFF54, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0xFF55, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0xFF56, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0xFF57, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0xFF58, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0xFF59, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0xFF5A, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0xFF5B, 0, 1 | DECOMP_INLINE, 0x007B},
+ {0xFF5C, 0, 1 | DECOMP_INLINE, 0x007C},
+ {0xFF5D, 0, 1 | DECOMP_INLINE, 0x007D},
+ {0xFF5E, 0, 1 | DECOMP_INLINE, 0x007E},
+ {0xFF5F, 0, 1 | DECOMP_INLINE, 0x2985},
+ {0xFF60, 0, 1 | DECOMP_INLINE, 0x2986},
+ {0xFF61, 0, 1 | DECOMP_INLINE, 0x3002},
+ {0xFF62, 0, 1 | DECOMP_INLINE, 0x300C},
+ {0xFF63, 0, 1 | DECOMP_INLINE, 0x300D},
+ {0xFF64, 0, 1 | DECOMP_INLINE, 0x3001},
+ {0xFF65, 0, 1 | DECOMP_INLINE, 0x30FB},
+ {0xFF66, 0, 1 | DECOMP_INLINE, 0x30F2},
+ {0xFF67, 0, 1 | DECOMP_INLINE, 0x30A1},
+ {0xFF68, 0, 1 | DECOMP_INLINE, 0x30A3},
+ {0xFF69, 0, 1 | DECOMP_INLINE, 0x30A5},
+ {0xFF6A, 0, 1 | DECOMP_INLINE, 0x30A7},
+ {0xFF6B, 0, 1 | DECOMP_INLINE, 0x30A9},
+ {0xFF6C, 0, 1 | DECOMP_INLINE, 0x30E3},
+ {0xFF6D, 0, 1 | DECOMP_INLINE, 0x30E5},
+ {0xFF6E, 0, 1 | DECOMP_INLINE, 0x30E7},
+ {0xFF6F, 0, 1 | DECOMP_INLINE, 0x30C3},
+ {0xFF70, 0, 1 | DECOMP_INLINE, 0x30FC},
+ {0xFF71, 0, 1 | DECOMP_INLINE, 0x30A2},
+ {0xFF72, 0, 1 | DECOMP_INLINE, 0x30A4},
+ {0xFF73, 0, 1 | DECOMP_INLINE, 0x30A6},
+ {0xFF74, 0, 1 | DECOMP_INLINE, 0x30A8},
+ {0xFF75, 0, 1 | DECOMP_INLINE, 0x30AA},
+ {0xFF76, 0, 1 | DECOMP_INLINE, 0x30AB},
+ {0xFF77, 0, 1 | DECOMP_INLINE, 0x30AD},
+ {0xFF78, 0, 1 | DECOMP_INLINE, 0x30AF},
+ {0xFF79, 0, 1 | DECOMP_INLINE, 0x30B1},
+ {0xFF7A, 0, 1 | DECOMP_INLINE, 0x30B3},
+ {0xFF7B, 0, 1 | DECOMP_INLINE, 0x30B5},
+ {0xFF7C, 0, 1 | DECOMP_INLINE, 0x30B7},
+ {0xFF7D, 0, 1 | DECOMP_INLINE, 0x30B9},
+ {0xFF7E, 0, 1 | DECOMP_INLINE, 0x30BB},
+ {0xFF7F, 0, 1 | DECOMP_INLINE, 0x30BD},
+ {0xFF80, 0, 1 | DECOMP_INLINE, 0x30BF},
+ {0xFF81, 0, 1 | DECOMP_INLINE, 0x30C1},
+ {0xFF82, 0, 1 | DECOMP_INLINE, 0x30C4},
+ {0xFF83, 0, 1 | DECOMP_INLINE, 0x30C6},
+ {0xFF84, 0, 1 | DECOMP_INLINE, 0x30C8},
+ {0xFF85, 0, 1 | DECOMP_INLINE, 0x30CA},
+ {0xFF86, 0, 1 | DECOMP_INLINE, 0x30CB},
+ {0xFF87, 0, 1 | DECOMP_INLINE, 0x30CC},
+ {0xFF88, 0, 1 | DECOMP_INLINE, 0x30CD},
+ {0xFF89, 0, 1 | DECOMP_INLINE, 0x30CE},
+ {0xFF8A, 0, 1 | DECOMP_INLINE, 0x30CF},
+ {0xFF8B, 0, 1 | DECOMP_INLINE, 0x30D2},
+ {0xFF8C, 0, 1 | DECOMP_INLINE, 0x30D5},
+ {0xFF8D, 0, 1 | DECOMP_INLINE, 0x30D8},
+ {0xFF8E, 0, 1 | DECOMP_INLINE, 0x30DB},
+ {0xFF8F, 0, 1 | DECOMP_INLINE, 0x30DE},
+ {0xFF90, 0, 1 | DECOMP_INLINE, 0x30DF},
+ {0xFF91, 0, 1 | DECOMP_INLINE, 0x30E0},
+ {0xFF92, 0, 1 | DECOMP_INLINE, 0x30E1},
+ {0xFF93, 0, 1 | DECOMP_INLINE, 0x30E2},
+ {0xFF94, 0, 1 | DECOMP_INLINE, 0x30E4},
+ {0xFF95, 0, 1 | DECOMP_INLINE, 0x30E6},
+ {0xFF96, 0, 1 | DECOMP_INLINE, 0x30E8},
+ {0xFF97, 0, 1 | DECOMP_INLINE, 0x30E9},
+ {0xFF98, 0, 1 | DECOMP_INLINE, 0x30EA},
+ {0xFF99, 0, 1 | DECOMP_INLINE, 0x30EB},
+ {0xFF9A, 0, 1 | DECOMP_INLINE, 0x30EC},
+ {0xFF9B, 0, 1 | DECOMP_INLINE, 0x30ED},
+ {0xFF9C, 0, 1 | DECOMP_INLINE, 0x30EF},
+ {0xFF9D, 0, 1 | DECOMP_INLINE, 0x30F3},
+ {0xFF9E, 0, 1 | DECOMP_INLINE, 0x3099},
+ {0xFF9F, 0, 1 | DECOMP_INLINE, 0x309A},
+ {0xFFA0, 0, 1 | DECOMP_INLINE, 0x3164},
+ {0xFFA1, 0, 1 | DECOMP_INLINE, 0x3131},
+ {0xFFA2, 0, 1 | DECOMP_INLINE, 0x3132},
+ {0xFFA3, 0, 1 | DECOMP_INLINE, 0x3133},
+ {0xFFA4, 0, 1 | DECOMP_INLINE, 0x3134},
+ {0xFFA5, 0, 1 | DECOMP_INLINE, 0x3135},
+ {0xFFA6, 0, 1 | DECOMP_INLINE, 0x3136},
+ {0xFFA7, 0, 1 | DECOMP_INLINE, 0x3137},
+ {0xFFA8, 0, 1 | DECOMP_INLINE, 0x3138},
+ {0xFFA9, 0, 1 | DECOMP_INLINE, 0x3139},
+ {0xFFAA, 0, 1 | DECOMP_INLINE, 0x313A},
+ {0xFFAB, 0, 1 | DECOMP_INLINE, 0x313B},
+ {0xFFAC, 0, 1 | DECOMP_INLINE, 0x313C},
+ {0xFFAD, 0, 1 | DECOMP_INLINE, 0x313D},
+ {0xFFAE, 0, 1 | DECOMP_INLINE, 0x313E},
+ {0xFFAF, 0, 1 | DECOMP_INLINE, 0x313F},
+ {0xFFB0, 0, 1 | DECOMP_INLINE, 0x3140},
+ {0xFFB1, 0, 1 | DECOMP_INLINE, 0x3141},
+ {0xFFB2, 0, 1 | DECOMP_INLINE, 0x3142},
+ {0xFFB3, 0, 1 | DECOMP_INLINE, 0x3143},
+ {0xFFB4, 0, 1 | DECOMP_INLINE, 0x3144},
+ {0xFFB5, 0, 1 | DECOMP_INLINE, 0x3145},
+ {0xFFB6, 0, 1 | DECOMP_INLINE, 0x3146},
+ {0xFFB7, 0, 1 | DECOMP_INLINE, 0x3147},
+ {0xFFB8, 0, 1 | DECOMP_INLINE, 0x3148},
+ {0xFFB9, 0, 1 | DECOMP_INLINE, 0x3149},
+ {0xFFBA, 0, 1 | DECOMP_INLINE, 0x314A},
+ {0xFFBB, 0, 1 | DECOMP_INLINE, 0x314B},
+ {0xFFBC, 0, 1 | DECOMP_INLINE, 0x314C},
+ {0xFFBD, 0, 1 | DECOMP_INLINE, 0x314D},
+ {0xFFBE, 0, 1 | DECOMP_INLINE, 0x314E},
+ {0xFFC2, 0, 1 | DECOMP_INLINE, 0x314F},
+ {0xFFC3, 0, 1 | DECOMP_INLINE, 0x3150},
+ {0xFFC4, 0, 1 | DECOMP_INLINE, 0x3151},
+ {0xFFC5, 0, 1 | DECOMP_INLINE, 0x3152},
+ {0xFFC6, 0, 1 | DECOMP_INLINE, 0x3153},
+ {0xFFC7, 0, 1 | DECOMP_INLINE, 0x3154},
+ {0xFFCA, 0, 1 | DECOMP_INLINE, 0x3155},
+ {0xFFCB, 0, 1 | DECOMP_INLINE, 0x3156},
+ {0xFFCC, 0, 1 | DECOMP_INLINE, 0x3157},
+ {0xFFCD, 0, 1 | DECOMP_INLINE, 0x3158},
+ {0xFFCE, 0, 1 | DECOMP_INLINE, 0x3159},
+ {0xFFCF, 0, 1 | DECOMP_INLINE, 0x315A},
+ {0xFFD2, 0, 1 | DECOMP_INLINE, 0x315B},
+ {0xFFD3, 0, 1 | DECOMP_INLINE, 0x315C},
+ {0xFFD4, 0, 1 | DECOMP_INLINE, 0x315D},
+ {0xFFD5, 0, 1 | DECOMP_INLINE, 0x315E},
+ {0xFFD6, 0, 1 | DECOMP_INLINE, 0x315F},
+ {0xFFD7, 0, 1 | DECOMP_INLINE, 0x3160},
+ {0xFFDA, 0, 1 | DECOMP_INLINE, 0x3161},
+ {0xFFDB, 0, 1 | DECOMP_INLINE, 0x3162},
+ {0xFFDC, 0, 1 | DECOMP_INLINE, 0x3163},
+ {0xFFE0, 0, 1 | DECOMP_INLINE, 0x00A2},
+ {0xFFE1, 0, 1 | DECOMP_INLINE, 0x00A3},
+ {0xFFE2, 0, 1 | DECOMP_INLINE, 0x00AC},
+ {0xFFE3, 0, 1 | DECOMP_INLINE, 0x00AF},
+ {0xFFE4, 0, 1 | DECOMP_INLINE, 0x00A6},
+ {0xFFE5, 0, 1 | DECOMP_INLINE, 0x00A5},
+ {0xFFE6, 0, 1 | DECOMP_INLINE, 0x20A9},
+ {0xFFE8, 0, 1 | DECOMP_INLINE, 0x2502},
+ {0xFFE9, 0, 1 | DECOMP_INLINE, 0x2190},
+ {0xFFEA, 0, 1 | DECOMP_INLINE, 0x2191},
+ {0xFFEB, 0, 1 | DECOMP_INLINE, 0x2192},
+ {0xFFEC, 0, 1 | DECOMP_INLINE, 0x2193},
+ {0xFFED, 0, 1 | DECOMP_INLINE, 0x25A0},
+ {0xFFEE, 0, 1 | DECOMP_INLINE, 0x25CB},
+ {0x101FD, 220, 0, 0},
+ {0x102E0, 220, 0, 0},
+ {0x10376, 230, 0, 0},
+ {0x10377, 230, 0, 0},
+ {0x10378, 230, 0, 0},
+ {0x10379, 230, 0, 0},
+ {0x1037A, 230, 0, 0},
+ {0x10A0D, 220, 0, 0},
+ {0x10A0F, 230, 0, 0},
+ {0x10A38, 230, 0, 0},
+ {0x10A39, 1, 0, 0},
+ {0x10A3A, 220, 0, 0},
+ {0x10A3F, 9, 0, 0},
+ {0x10AE5, 230, 0, 0},
+ {0x10AE6, 220, 0, 0},
+ {0x11046, 9, 0, 0},
+ {0x1107F, 9, 0, 0},
+ {0x1109A, 0, 2, 4774},
+ {0x1109C, 0, 2, 4776},
+ {0x110AB, 0, 2, 4778},
+ {0x110B9, 9, 0, 0},
+ {0x110BA, 7, 0, 0},
+ {0x11100, 230, 0, 0},
+ {0x11101, 230, 0, 0},
+ {0x11102, 230, 0, 0},
+ {0x1112E, 0, 2, 4780},
+ {0x1112F, 0, 2, 4782},
+ {0x11133, 9, 0, 0},
+ {0x11134, 9, 0, 0},
+ {0x11173, 7, 0, 0},
+ {0x111C0, 9, 0, 0},
+ {0x111CA, 7, 0, 0},
+ {0x11235, 9, 0, 0},
+ {0x11236, 7, 0, 0},
+ {0x112E9, 7, 0, 0},
+ {0x112EA, 9, 0, 0},
+ {0x1133C, 7, 0, 0},
+ {0x1134B, 0, 2, 4784},
+ {0x1134C, 0, 2, 4786},
+ {0x1134D, 9, 0, 0},
+ {0x11366, 230, 0, 0},
+ {0x11367, 230, 0, 0},
+ {0x11368, 230, 0, 0},
+ {0x11369, 230, 0, 0},
+ {0x1136A, 230, 0, 0},
+ {0x1136B, 230, 0, 0},
+ {0x1136C, 230, 0, 0},
+ {0x11370, 230, 0, 0},
+ {0x11371, 230, 0, 0},
+ {0x11372, 230, 0, 0},
+ {0x11373, 230, 0, 0},
+ {0x11374, 230, 0, 0},
+ {0x11442, 9, 0, 0},
+ {0x11446, 7, 0, 0},
+ {0x114BB, 0, 2, 4788},
+ {0x114BC, 0, 2, 4790},
+ {0x114BE, 0, 2, 4792},
+ {0x114C2, 9, 0, 0},
+ {0x114C3, 7, 0, 0},
+ {0x115BA, 0, 2, 4794},
+ {0x115BB, 0, 2, 4796},
+ {0x115BF, 9, 0, 0},
+ {0x115C0, 7, 0, 0},
+ {0x1163F, 9, 0, 0},
+ {0x116B6, 9, 0, 0},
+ {0x116B7, 7, 0, 0},
+ {0x1172B, 9, 0, 0},
+ {0x11C3F, 9, 0, 0},
+ {0x16AF0, 1, 0, 0},
+ {0x16AF1, 1, 0, 0},
+ {0x16AF2, 1, 0, 0},
+ {0x16AF3, 1, 0, 0},
+ {0x16AF4, 1, 0, 0},
+ {0x16B30, 230, 0, 0},
+ {0x16B31, 230, 0, 0},
+ {0x16B32, 230, 0, 0},
+ {0x16B33, 230, 0, 0},
+ {0x16B34, 230, 0, 0},
+ {0x16B35, 230, 0, 0},
+ {0x16B36, 230, 0, 0},
+ {0x1BC9E, 1, 0, 0},
+ {0x1D15E, 0, 2 | DECOMP_NO_COMPOSE, 4798}, /* in exclusion list */
+ {0x1D15F, 0, 2 | DECOMP_NO_COMPOSE, 4800}, /* in exclusion list */
+ {0x1D160, 0, 2 | DECOMP_NO_COMPOSE, 4802}, /* in exclusion list */
+ {0x1D161, 0, 2 | DECOMP_NO_COMPOSE, 4804}, /* in exclusion list */
+ {0x1D162, 0, 2 | DECOMP_NO_COMPOSE, 4806}, /* in exclusion list */
+ {0x1D163, 0, 2 | DECOMP_NO_COMPOSE, 4808}, /* in exclusion list */
+ {0x1D164, 0, 2 | DECOMP_NO_COMPOSE, 4810}, /* in exclusion list */
+ {0x1D165, 216, 0, 0},
+ {0x1D166, 216, 0, 0},
+ {0x1D167, 1, 0, 0},
+ {0x1D168, 1, 0, 0},
+ {0x1D169, 1, 0, 0},
+ {0x1D16D, 226, 0, 0},
+ {0x1D16E, 216, 0, 0},
+ {0x1D16F, 216, 0, 0},
+ {0x1D170, 216, 0, 0},
+ {0x1D171, 216, 0, 0},
+ {0x1D172, 216, 0, 0},
+ {0x1D17B, 220, 0, 0},
+ {0x1D17C, 220, 0, 0},
+ {0x1D17D, 220, 0, 0},
+ {0x1D17E, 220, 0, 0},
+ {0x1D17F, 220, 0, 0},
+ {0x1D180, 220, 0, 0},
+ {0x1D181, 220, 0, 0},
+ {0x1D182, 220, 0, 0},
+ {0x1D185, 230, 0, 0},
+ {0x1D186, 230, 0, 0},
+ {0x1D187, 230, 0, 0},
+ {0x1D188, 230, 0, 0},
+ {0x1D189, 230, 0, 0},
+ {0x1D18A, 220, 0, 0},
+ {0x1D18B, 220, 0, 0},
+ {0x1D1AA, 230, 0, 0},
+ {0x1D1AB, 230, 0, 0},
+ {0x1D1AC, 230, 0, 0},
+ {0x1D1AD, 230, 0, 0},
+ {0x1D1BB, 0, 2 | DECOMP_NO_COMPOSE, 4812}, /* in exclusion list */
+ {0x1D1BC, 0, 2 | DECOMP_NO_COMPOSE, 4814}, /* in exclusion list */
+ {0x1D1BD, 0, 2 | DECOMP_NO_COMPOSE, 4816}, /* in exclusion list */
+ {0x1D1BE, 0, 2 | DECOMP_NO_COMPOSE, 4818}, /* in exclusion list */
+ {0x1D1BF, 0, 2 | DECOMP_NO_COMPOSE, 4820}, /* in exclusion list */
+ {0x1D1C0, 0, 2 | DECOMP_NO_COMPOSE, 4822}, /* in exclusion list */
+ {0x1D242, 230, 0, 0},
+ {0x1D243, 230, 0, 0},
+ {0x1D244, 230, 0, 0},
+ {0x1D400, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D401, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D402, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D403, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D404, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D405, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D406, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D407, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D408, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D409, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D40A, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D40B, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D40C, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D40D, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D40E, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D40F, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D410, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D411, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D412, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D413, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D414, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D415, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D416, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D417, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D418, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D419, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D41A, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D41B, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D41C, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D41D, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D41E, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D41F, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D420, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D421, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D422, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D423, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D424, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D425, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D426, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D427, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D428, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D429, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D42A, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D42B, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D42C, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D42D, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D42E, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D42F, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D430, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D431, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D432, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D433, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D434, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D435, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D436, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D437, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D438, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D439, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D43A, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D43B, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D43C, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D43D, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D43E, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D43F, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D440, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D441, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D442, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D443, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D444, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D445, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D446, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D447, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D448, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D449, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D44A, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D44B, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D44C, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D44D, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D44E, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D44F, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D450, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D451, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D452, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D453, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D454, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D456, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D457, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D458, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D459, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D45A, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D45B, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D45C, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D45D, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D45E, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D45F, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D460, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D461, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D462, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D463, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D464, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D465, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D466, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D467, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D468, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D469, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D46A, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D46B, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D46C, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D46D, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D46E, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D46F, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D470, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D471, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D472, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D473, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D474, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D475, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D476, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D477, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D478, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D479, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D47A, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D47B, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D47C, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D47D, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D47E, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D47F, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D480, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D481, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D482, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D483, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D484, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D485, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D486, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D487, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D488, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D489, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D48A, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D48B, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D48C, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D48D, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D48E, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D48F, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D490, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D491, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D492, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D493, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D494, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D495, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D496, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D497, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D498, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D499, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D49A, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D49B, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D49C, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D49E, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D49F, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D4A2, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D4A5, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D4A6, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D4A9, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D4AA, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D4AB, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D4AC, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D4AE, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D4AF, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D4B0, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D4B1, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D4B2, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D4B3, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D4B4, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D4B5, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D4B6, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D4B7, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D4B8, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D4B9, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D4BB, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D4BD, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D4BE, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D4BF, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D4C0, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D4C1, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D4C2, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D4C3, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D4C5, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D4C6, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D4C7, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D4C8, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D4C9, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D4CA, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D4CB, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D4CC, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D4CD, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D4CE, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D4CF, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D4D0, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D4D1, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D4D2, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D4D3, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D4D4, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D4D5, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D4D6, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D4D7, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D4D8, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D4D9, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D4DA, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D4DB, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D4DC, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D4DD, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D4DE, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D4DF, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D4E0, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D4E1, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D4E2, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D4E3, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D4E4, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D4E5, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D4E6, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D4E7, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D4E8, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D4E9, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D4EA, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D4EB, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D4EC, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D4ED, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D4EE, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D4EF, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D4F0, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D4F1, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D4F2, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D4F3, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D4F4, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D4F5, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D4F6, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D4F7, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D4F8, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D4F9, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D4FA, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D4FB, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D4FC, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D4FD, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D4FE, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D4FF, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D500, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D501, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D502, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D503, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D504, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D505, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D507, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D508, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D509, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D50A, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D50D, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D50E, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D50F, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D510, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D511, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D512, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D513, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D514, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D516, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D517, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D518, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D519, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D51A, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D51B, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D51C, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D51E, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D51F, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D520, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D521, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D522, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D523, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D524, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D525, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D526, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D527, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D528, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D529, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D52A, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D52B, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D52C, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D52D, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D52E, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D52F, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D530, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D531, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D532, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D533, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D534, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D535, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D536, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D537, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D538, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D539, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D53B, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D53C, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D53D, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D53E, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D540, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D541, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D542, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D543, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D544, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D546, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D54A, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D54B, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D54C, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D54D, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D54E, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D54F, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D550, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D552, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D553, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D554, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D555, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D556, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D557, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D558, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D559, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D55A, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D55B, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D55C, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D55D, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D55E, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D55F, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D560, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D561, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D562, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D563, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D564, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D565, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D566, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D567, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D568, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D569, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D56A, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D56B, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D56C, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D56D, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D56E, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D56F, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D570, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D571, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D572, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D573, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D574, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D575, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D576, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D577, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D578, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D579, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D57A, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D57B, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D57C, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D57D, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D57E, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D57F, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D580, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D581, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D582, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D583, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D584, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D585, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D586, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D587, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D588, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D589, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D58A, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D58B, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D58C, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D58D, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D58E, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D58F, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D590, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D591, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D592, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D593, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D594, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D595, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D596, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D597, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D598, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D599, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D59A, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D59B, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D59C, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D59D, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D59E, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D59F, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D5A0, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D5A1, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D5A2, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D5A3, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D5A4, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D5A5, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D5A6, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D5A7, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D5A8, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D5A9, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D5AA, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D5AB, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D5AC, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D5AD, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D5AE, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D5AF, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D5B0, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D5B1, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D5B2, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D5B3, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D5B4, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D5B5, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D5B6, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D5B7, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D5B8, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D5B9, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D5BA, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D5BB, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D5BC, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D5BD, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D5BE, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D5BF, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D5C0, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D5C1, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D5C2, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D5C3, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D5C4, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D5C5, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D5C6, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D5C7, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D5C8, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D5C9, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D5CA, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D5CB, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D5CC, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D5CD, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D5CE, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D5CF, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D5D0, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D5D1, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D5D2, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D5D3, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D5D4, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D5D5, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D5D6, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D5D7, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D5D8, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D5D9, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D5DA, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D5DB, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D5DC, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D5DD, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D5DE, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D5DF, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D5E0, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D5E1, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D5E2, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D5E3, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D5E4, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D5E5, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D5E6, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D5E7, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D5E8, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D5E9, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D5EA, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D5EB, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D5EC, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D5ED, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D5EE, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D5EF, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D5F0, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D5F1, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D5F2, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D5F3, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D5F4, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D5F5, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D5F6, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D5F7, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D5F8, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D5F9, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D5FA, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D5FB, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D5FC, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D5FD, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D5FE, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D5FF, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D600, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D601, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D602, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D603, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D604, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D605, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D606, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D607, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D608, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D609, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D60A, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D60B, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D60C, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D60D, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D60E, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D60F, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D610, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D611, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D612, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D613, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D614, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D615, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D616, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D617, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D618, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D619, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D61A, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D61B, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D61C, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D61D, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D61E, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D61F, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D620, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D621, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D622, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D623, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D624, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D625, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D626, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D627, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D628, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D629, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D62A, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D62B, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D62C, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D62D, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D62E, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D62F, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D630, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D631, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D632, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D633, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D634, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D635, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D636, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D637, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D638, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D639, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D63A, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D63B, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D63C, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D63D, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D63E, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D63F, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D640, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D641, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D642, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D643, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D644, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D645, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D646, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D647, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D648, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D649, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D64A, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D64B, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D64C, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D64D, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D64E, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D64F, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D650, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D651, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D652, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D653, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D654, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D655, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D656, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D657, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D658, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D659, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D65A, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D65B, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D65C, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D65D, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D65E, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D65F, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D660, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D661, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D662, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D663, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D664, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D665, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D666, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D667, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D668, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D669, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D66A, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D66B, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D66C, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D66D, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D66E, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D66F, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D670, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1D671, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1D672, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1D673, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1D674, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1D675, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1D676, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1D677, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1D678, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1D679, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1D67A, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1D67B, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1D67C, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1D67D, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1D67E, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1D67F, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1D680, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1D681, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1D682, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1D683, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1D684, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1D685, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1D686, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1D687, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1D688, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1D689, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1D68A, 0, 1 | DECOMP_INLINE, 0x0061},
+ {0x1D68B, 0, 1 | DECOMP_INLINE, 0x0062},
+ {0x1D68C, 0, 1 | DECOMP_INLINE, 0x0063},
+ {0x1D68D, 0, 1 | DECOMP_INLINE, 0x0064},
+ {0x1D68E, 0, 1 | DECOMP_INLINE, 0x0065},
+ {0x1D68F, 0, 1 | DECOMP_INLINE, 0x0066},
+ {0x1D690, 0, 1 | DECOMP_INLINE, 0x0067},
+ {0x1D691, 0, 1 | DECOMP_INLINE, 0x0068},
+ {0x1D692, 0, 1 | DECOMP_INLINE, 0x0069},
+ {0x1D693, 0, 1 | DECOMP_INLINE, 0x006A},
+ {0x1D694, 0, 1 | DECOMP_INLINE, 0x006B},
+ {0x1D695, 0, 1 | DECOMP_INLINE, 0x006C},
+ {0x1D696, 0, 1 | DECOMP_INLINE, 0x006D},
+ {0x1D697, 0, 1 | DECOMP_INLINE, 0x006E},
+ {0x1D698, 0, 1 | DECOMP_INLINE, 0x006F},
+ {0x1D699, 0, 1 | DECOMP_INLINE, 0x0070},
+ {0x1D69A, 0, 1 | DECOMP_INLINE, 0x0071},
+ {0x1D69B, 0, 1 | DECOMP_INLINE, 0x0072},
+ {0x1D69C, 0, 1 | DECOMP_INLINE, 0x0073},
+ {0x1D69D, 0, 1 | DECOMP_INLINE, 0x0074},
+ {0x1D69E, 0, 1 | DECOMP_INLINE, 0x0075},
+ {0x1D69F, 0, 1 | DECOMP_INLINE, 0x0076},
+ {0x1D6A0, 0, 1 | DECOMP_INLINE, 0x0077},
+ {0x1D6A1, 0, 1 | DECOMP_INLINE, 0x0078},
+ {0x1D6A2, 0, 1 | DECOMP_INLINE, 0x0079},
+ {0x1D6A3, 0, 1 | DECOMP_INLINE, 0x007A},
+ {0x1D6A4, 0, 1 | DECOMP_INLINE, 0x0131},
+ {0x1D6A5, 0, 1 | DECOMP_INLINE, 0x0237},
+ {0x1D6A8, 0, 1 | DECOMP_INLINE, 0x0391},
+ {0x1D6A9, 0, 1 | DECOMP_INLINE, 0x0392},
+ {0x1D6AA, 0, 1 | DECOMP_INLINE, 0x0393},
+ {0x1D6AB, 0, 1 | DECOMP_INLINE, 0x0394},
+ {0x1D6AC, 0, 1 | DECOMP_INLINE, 0x0395},
+ {0x1D6AD, 0, 1 | DECOMP_INLINE, 0x0396},
+ {0x1D6AE, 0, 1 | DECOMP_INLINE, 0x0397},
+ {0x1D6AF, 0, 1 | DECOMP_INLINE, 0x0398},
+ {0x1D6B0, 0, 1 | DECOMP_INLINE, 0x0399},
+ {0x1D6B1, 0, 1 | DECOMP_INLINE, 0x039A},
+ {0x1D6B2, 0, 1 | DECOMP_INLINE, 0x039B},
+ {0x1D6B3, 0, 1 | DECOMP_INLINE, 0x039C},
+ {0x1D6B4, 0, 1 | DECOMP_INLINE, 0x039D},
+ {0x1D6B5, 0, 1 | DECOMP_INLINE, 0x039E},
+ {0x1D6B6, 0, 1 | DECOMP_INLINE, 0x039F},
+ {0x1D6B7, 0, 1 | DECOMP_INLINE, 0x03A0},
+ {0x1D6B8, 0, 1 | DECOMP_INLINE, 0x03A1},
+ {0x1D6B9, 0, 1 | DECOMP_INLINE, 0x03F4},
+ {0x1D6BA, 0, 1 | DECOMP_INLINE, 0x03A3},
+ {0x1D6BB, 0, 1 | DECOMP_INLINE, 0x03A4},
+ {0x1D6BC, 0, 1 | DECOMP_INLINE, 0x03A5},
+ {0x1D6BD, 0, 1 | DECOMP_INLINE, 0x03A6},
+ {0x1D6BE, 0, 1 | DECOMP_INLINE, 0x03A7},
+ {0x1D6BF, 0, 1 | DECOMP_INLINE, 0x03A8},
+ {0x1D6C0, 0, 1 | DECOMP_INLINE, 0x03A9},
+ {0x1D6C1, 0, 1 | DECOMP_INLINE, 0x2207},
+ {0x1D6C2, 0, 1 | DECOMP_INLINE, 0x03B1},
+ {0x1D6C3, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D6C4, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D6C5, 0, 1 | DECOMP_INLINE, 0x03B4},
+ {0x1D6C6, 0, 1 | DECOMP_INLINE, 0x03B5},
+ {0x1D6C7, 0, 1 | DECOMP_INLINE, 0x03B6},
+ {0x1D6C8, 0, 1 | DECOMP_INLINE, 0x03B7},
+ {0x1D6C9, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x1D6CA, 0, 1 | DECOMP_INLINE, 0x03B9},
+ {0x1D6CB, 0, 1 | DECOMP_INLINE, 0x03BA},
+ {0x1D6CC, 0, 1 | DECOMP_INLINE, 0x03BB},
+ {0x1D6CD, 0, 1 | DECOMP_INLINE, 0x03BC},
+ {0x1D6CE, 0, 1 | DECOMP_INLINE, 0x03BD},
+ {0x1D6CF, 0, 1 | DECOMP_INLINE, 0x03BE},
+ {0x1D6D0, 0, 1 | DECOMP_INLINE, 0x03BF},
+ {0x1D6D1, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x1D6D2, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x1D6D3, 0, 1 | DECOMP_INLINE, 0x03C2},
+ {0x1D6D4, 0, 1 | DECOMP_INLINE, 0x03C3},
+ {0x1D6D5, 0, 1 | DECOMP_INLINE, 0x03C4},
+ {0x1D6D6, 0, 1 | DECOMP_INLINE, 0x03C5},
+ {0x1D6D7, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D6D8, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D6D9, 0, 1 | DECOMP_INLINE, 0x03C8},
+ {0x1D6DA, 0, 1 | DECOMP_INLINE, 0x03C9},
+ {0x1D6DB, 0, 1 | DECOMP_INLINE, 0x2202},
+ {0x1D6DC, 0, 1 | DECOMP_INLINE, 0x03F5},
+ {0x1D6DD, 0, 1 | DECOMP_INLINE, 0x03D1},
+ {0x1D6DE, 0, 1 | DECOMP_INLINE, 0x03F0},
+ {0x1D6DF, 0, 1 | DECOMP_INLINE, 0x03D5},
+ {0x1D6E0, 0, 1 | DECOMP_INLINE, 0x03F1},
+ {0x1D6E1, 0, 1 | DECOMP_INLINE, 0x03D6},
+ {0x1D6E2, 0, 1 | DECOMP_INLINE, 0x0391},
+ {0x1D6E3, 0, 1 | DECOMP_INLINE, 0x0392},
+ {0x1D6E4, 0, 1 | DECOMP_INLINE, 0x0393},
+ {0x1D6E5, 0, 1 | DECOMP_INLINE, 0x0394},
+ {0x1D6E6, 0, 1 | DECOMP_INLINE, 0x0395},
+ {0x1D6E7, 0, 1 | DECOMP_INLINE, 0x0396},
+ {0x1D6E8, 0, 1 | DECOMP_INLINE, 0x0397},
+ {0x1D6E9, 0, 1 | DECOMP_INLINE, 0x0398},
+ {0x1D6EA, 0, 1 | DECOMP_INLINE, 0x0399},
+ {0x1D6EB, 0, 1 | DECOMP_INLINE, 0x039A},
+ {0x1D6EC, 0, 1 | DECOMP_INLINE, 0x039B},
+ {0x1D6ED, 0, 1 | DECOMP_INLINE, 0x039C},
+ {0x1D6EE, 0, 1 | DECOMP_INLINE, 0x039D},
+ {0x1D6EF, 0, 1 | DECOMP_INLINE, 0x039E},
+ {0x1D6F0, 0, 1 | DECOMP_INLINE, 0x039F},
+ {0x1D6F1, 0, 1 | DECOMP_INLINE, 0x03A0},
+ {0x1D6F2, 0, 1 | DECOMP_INLINE, 0x03A1},
+ {0x1D6F3, 0, 1 | DECOMP_INLINE, 0x03F4},
+ {0x1D6F4, 0, 1 | DECOMP_INLINE, 0x03A3},
+ {0x1D6F5, 0, 1 | DECOMP_INLINE, 0x03A4},
+ {0x1D6F6, 0, 1 | DECOMP_INLINE, 0x03A5},
+ {0x1D6F7, 0, 1 | DECOMP_INLINE, 0x03A6},
+ {0x1D6F8, 0, 1 | DECOMP_INLINE, 0x03A7},
+ {0x1D6F9, 0, 1 | DECOMP_INLINE, 0x03A8},
+ {0x1D6FA, 0, 1 | DECOMP_INLINE, 0x03A9},
+ {0x1D6FB, 0, 1 | DECOMP_INLINE, 0x2207},
+ {0x1D6FC, 0, 1 | DECOMP_INLINE, 0x03B1},
+ {0x1D6FD, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D6FE, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D6FF, 0, 1 | DECOMP_INLINE, 0x03B4},
+ {0x1D700, 0, 1 | DECOMP_INLINE, 0x03B5},
+ {0x1D701, 0, 1 | DECOMP_INLINE, 0x03B6},
+ {0x1D702, 0, 1 | DECOMP_INLINE, 0x03B7},
+ {0x1D703, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x1D704, 0, 1 | DECOMP_INLINE, 0x03B9},
+ {0x1D705, 0, 1 | DECOMP_INLINE, 0x03BA},
+ {0x1D706, 0, 1 | DECOMP_INLINE, 0x03BB},
+ {0x1D707, 0, 1 | DECOMP_INLINE, 0x03BC},
+ {0x1D708, 0, 1 | DECOMP_INLINE, 0x03BD},
+ {0x1D709, 0, 1 | DECOMP_INLINE, 0x03BE},
+ {0x1D70A, 0, 1 | DECOMP_INLINE, 0x03BF},
+ {0x1D70B, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x1D70C, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x1D70D, 0, 1 | DECOMP_INLINE, 0x03C2},
+ {0x1D70E, 0, 1 | DECOMP_INLINE, 0x03C3},
+ {0x1D70F, 0, 1 | DECOMP_INLINE, 0x03C4},
+ {0x1D710, 0, 1 | DECOMP_INLINE, 0x03C5},
+ {0x1D711, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D712, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D713, 0, 1 | DECOMP_INLINE, 0x03C8},
+ {0x1D714, 0, 1 | DECOMP_INLINE, 0x03C9},
+ {0x1D715, 0, 1 | DECOMP_INLINE, 0x2202},
+ {0x1D716, 0, 1 | DECOMP_INLINE, 0x03F5},
+ {0x1D717, 0, 1 | DECOMP_INLINE, 0x03D1},
+ {0x1D718, 0, 1 | DECOMP_INLINE, 0x03F0},
+ {0x1D719, 0, 1 | DECOMP_INLINE, 0x03D5},
+ {0x1D71A, 0, 1 | DECOMP_INLINE, 0x03F1},
+ {0x1D71B, 0, 1 | DECOMP_INLINE, 0x03D6},
+ {0x1D71C, 0, 1 | DECOMP_INLINE, 0x0391},
+ {0x1D71D, 0, 1 | DECOMP_INLINE, 0x0392},
+ {0x1D71E, 0, 1 | DECOMP_INLINE, 0x0393},
+ {0x1D71F, 0, 1 | DECOMP_INLINE, 0x0394},
+ {0x1D720, 0, 1 | DECOMP_INLINE, 0x0395},
+ {0x1D721, 0, 1 | DECOMP_INLINE, 0x0396},
+ {0x1D722, 0, 1 | DECOMP_INLINE, 0x0397},
+ {0x1D723, 0, 1 | DECOMP_INLINE, 0x0398},
+ {0x1D724, 0, 1 | DECOMP_INLINE, 0x0399},
+ {0x1D725, 0, 1 | DECOMP_INLINE, 0x039A},
+ {0x1D726, 0, 1 | DECOMP_INLINE, 0x039B},
+ {0x1D727, 0, 1 | DECOMP_INLINE, 0x039C},
+ {0x1D728, 0, 1 | DECOMP_INLINE, 0x039D},
+ {0x1D729, 0, 1 | DECOMP_INLINE, 0x039E},
+ {0x1D72A, 0, 1 | DECOMP_INLINE, 0x039F},
+ {0x1D72B, 0, 1 | DECOMP_INLINE, 0x03A0},
+ {0x1D72C, 0, 1 | DECOMP_INLINE, 0x03A1},
+ {0x1D72D, 0, 1 | DECOMP_INLINE, 0x03F4},
+ {0x1D72E, 0, 1 | DECOMP_INLINE, 0x03A3},
+ {0x1D72F, 0, 1 | DECOMP_INLINE, 0x03A4},
+ {0x1D730, 0, 1 | DECOMP_INLINE, 0x03A5},
+ {0x1D731, 0, 1 | DECOMP_INLINE, 0x03A6},
+ {0x1D732, 0, 1 | DECOMP_INLINE, 0x03A7},
+ {0x1D733, 0, 1 | DECOMP_INLINE, 0x03A8},
+ {0x1D734, 0, 1 | DECOMP_INLINE, 0x03A9},
+ {0x1D735, 0, 1 | DECOMP_INLINE, 0x2207},
+ {0x1D736, 0, 1 | DECOMP_INLINE, 0x03B1},
+ {0x1D737, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D738, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D739, 0, 1 | DECOMP_INLINE, 0x03B4},
+ {0x1D73A, 0, 1 | DECOMP_INLINE, 0x03B5},
+ {0x1D73B, 0, 1 | DECOMP_INLINE, 0x03B6},
+ {0x1D73C, 0, 1 | DECOMP_INLINE, 0x03B7},
+ {0x1D73D, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x1D73E, 0, 1 | DECOMP_INLINE, 0x03B9},
+ {0x1D73F, 0, 1 | DECOMP_INLINE, 0x03BA},
+ {0x1D740, 0, 1 | DECOMP_INLINE, 0x03BB},
+ {0x1D741, 0, 1 | DECOMP_INLINE, 0x03BC},
+ {0x1D742, 0, 1 | DECOMP_INLINE, 0x03BD},
+ {0x1D743, 0, 1 | DECOMP_INLINE, 0x03BE},
+ {0x1D744, 0, 1 | DECOMP_INLINE, 0x03BF},
+ {0x1D745, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x1D746, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x1D747, 0, 1 | DECOMP_INLINE, 0x03C2},
+ {0x1D748, 0, 1 | DECOMP_INLINE, 0x03C3},
+ {0x1D749, 0, 1 | DECOMP_INLINE, 0x03C4},
+ {0x1D74A, 0, 1 | DECOMP_INLINE, 0x03C5},
+ {0x1D74B, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D74C, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D74D, 0, 1 | DECOMP_INLINE, 0x03C8},
+ {0x1D74E, 0, 1 | DECOMP_INLINE, 0x03C9},
+ {0x1D74F, 0, 1 | DECOMP_INLINE, 0x2202},
+ {0x1D750, 0, 1 | DECOMP_INLINE, 0x03F5},
+ {0x1D751, 0, 1 | DECOMP_INLINE, 0x03D1},
+ {0x1D752, 0, 1 | DECOMP_INLINE, 0x03F0},
+ {0x1D753, 0, 1 | DECOMP_INLINE, 0x03D5},
+ {0x1D754, 0, 1 | DECOMP_INLINE, 0x03F1},
+ {0x1D755, 0, 1 | DECOMP_INLINE, 0x03D6},
+ {0x1D756, 0, 1 | DECOMP_INLINE, 0x0391},
+ {0x1D757, 0, 1 | DECOMP_INLINE, 0x0392},
+ {0x1D758, 0, 1 | DECOMP_INLINE, 0x0393},
+ {0x1D759, 0, 1 | DECOMP_INLINE, 0x0394},
+ {0x1D75A, 0, 1 | DECOMP_INLINE, 0x0395},
+ {0x1D75B, 0, 1 | DECOMP_INLINE, 0x0396},
+ {0x1D75C, 0, 1 | DECOMP_INLINE, 0x0397},
+ {0x1D75D, 0, 1 | DECOMP_INLINE, 0x0398},
+ {0x1D75E, 0, 1 | DECOMP_INLINE, 0x0399},
+ {0x1D75F, 0, 1 | DECOMP_INLINE, 0x039A},
+ {0x1D760, 0, 1 | DECOMP_INLINE, 0x039B},
+ {0x1D761, 0, 1 | DECOMP_INLINE, 0x039C},
+ {0x1D762, 0, 1 | DECOMP_INLINE, 0x039D},
+ {0x1D763, 0, 1 | DECOMP_INLINE, 0x039E},
+ {0x1D764, 0, 1 | DECOMP_INLINE, 0x039F},
+ {0x1D765, 0, 1 | DECOMP_INLINE, 0x03A0},
+ {0x1D766, 0, 1 | DECOMP_INLINE, 0x03A1},
+ {0x1D767, 0, 1 | DECOMP_INLINE, 0x03F4},
+ {0x1D768, 0, 1 | DECOMP_INLINE, 0x03A3},
+ {0x1D769, 0, 1 | DECOMP_INLINE, 0x03A4},
+ {0x1D76A, 0, 1 | DECOMP_INLINE, 0x03A5},
+ {0x1D76B, 0, 1 | DECOMP_INLINE, 0x03A6},
+ {0x1D76C, 0, 1 | DECOMP_INLINE, 0x03A7},
+ {0x1D76D, 0, 1 | DECOMP_INLINE, 0x03A8},
+ {0x1D76E, 0, 1 | DECOMP_INLINE, 0x03A9},
+ {0x1D76F, 0, 1 | DECOMP_INLINE, 0x2207},
+ {0x1D770, 0, 1 | DECOMP_INLINE, 0x03B1},
+ {0x1D771, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D772, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D773, 0, 1 | DECOMP_INLINE, 0x03B4},
+ {0x1D774, 0, 1 | DECOMP_INLINE, 0x03B5},
+ {0x1D775, 0, 1 | DECOMP_INLINE, 0x03B6},
+ {0x1D776, 0, 1 | DECOMP_INLINE, 0x03B7},
+ {0x1D777, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x1D778, 0, 1 | DECOMP_INLINE, 0x03B9},
+ {0x1D779, 0, 1 | DECOMP_INLINE, 0x03BA},
+ {0x1D77A, 0, 1 | DECOMP_INLINE, 0x03BB},
+ {0x1D77B, 0, 1 | DECOMP_INLINE, 0x03BC},
+ {0x1D77C, 0, 1 | DECOMP_INLINE, 0x03BD},
+ {0x1D77D, 0, 1 | DECOMP_INLINE, 0x03BE},
+ {0x1D77E, 0, 1 | DECOMP_INLINE, 0x03BF},
+ {0x1D77F, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x1D780, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x1D781, 0, 1 | DECOMP_INLINE, 0x03C2},
+ {0x1D782, 0, 1 | DECOMP_INLINE, 0x03C3},
+ {0x1D783, 0, 1 | DECOMP_INLINE, 0x03C4},
+ {0x1D784, 0, 1 | DECOMP_INLINE, 0x03C5},
+ {0x1D785, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D786, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D787, 0, 1 | DECOMP_INLINE, 0x03C8},
+ {0x1D788, 0, 1 | DECOMP_INLINE, 0x03C9},
+ {0x1D789, 0, 1 | DECOMP_INLINE, 0x2202},
+ {0x1D78A, 0, 1 | DECOMP_INLINE, 0x03F5},
+ {0x1D78B, 0, 1 | DECOMP_INLINE, 0x03D1},
+ {0x1D78C, 0, 1 | DECOMP_INLINE, 0x03F0},
+ {0x1D78D, 0, 1 | DECOMP_INLINE, 0x03D5},
+ {0x1D78E, 0, 1 | DECOMP_INLINE, 0x03F1},
+ {0x1D78F, 0, 1 | DECOMP_INLINE, 0x03D6},
+ {0x1D790, 0, 1 | DECOMP_INLINE, 0x0391},
+ {0x1D791, 0, 1 | DECOMP_INLINE, 0x0392},
+ {0x1D792, 0, 1 | DECOMP_INLINE, 0x0393},
+ {0x1D793, 0, 1 | DECOMP_INLINE, 0x0394},
+ {0x1D794, 0, 1 | DECOMP_INLINE, 0x0395},
+ {0x1D795, 0, 1 | DECOMP_INLINE, 0x0396},
+ {0x1D796, 0, 1 | DECOMP_INLINE, 0x0397},
+ {0x1D797, 0, 1 | DECOMP_INLINE, 0x0398},
+ {0x1D798, 0, 1 | DECOMP_INLINE, 0x0399},
+ {0x1D799, 0, 1 | DECOMP_INLINE, 0x039A},
+ {0x1D79A, 0, 1 | DECOMP_INLINE, 0x039B},
+ {0x1D79B, 0, 1 | DECOMP_INLINE, 0x039C},
+ {0x1D79C, 0, 1 | DECOMP_INLINE, 0x039D},
+ {0x1D79D, 0, 1 | DECOMP_INLINE, 0x039E},
+ {0x1D79E, 0, 1 | DECOMP_INLINE, 0x039F},
+ {0x1D79F, 0, 1 | DECOMP_INLINE, 0x03A0},
+ {0x1D7A0, 0, 1 | DECOMP_INLINE, 0x03A1},
+ {0x1D7A1, 0, 1 | DECOMP_INLINE, 0x03F4},
+ {0x1D7A2, 0, 1 | DECOMP_INLINE, 0x03A3},
+ {0x1D7A3, 0, 1 | DECOMP_INLINE, 0x03A4},
+ {0x1D7A4, 0, 1 | DECOMP_INLINE, 0x03A5},
+ {0x1D7A5, 0, 1 | DECOMP_INLINE, 0x03A6},
+ {0x1D7A6, 0, 1 | DECOMP_INLINE, 0x03A7},
+ {0x1D7A7, 0, 1 | DECOMP_INLINE, 0x03A8},
+ {0x1D7A8, 0, 1 | DECOMP_INLINE, 0x03A9},
+ {0x1D7A9, 0, 1 | DECOMP_INLINE, 0x2207},
+ {0x1D7AA, 0, 1 | DECOMP_INLINE, 0x03B1},
+ {0x1D7AB, 0, 1 | DECOMP_INLINE, 0x03B2},
+ {0x1D7AC, 0, 1 | DECOMP_INLINE, 0x03B3},
+ {0x1D7AD, 0, 1 | DECOMP_INLINE, 0x03B4},
+ {0x1D7AE, 0, 1 | DECOMP_INLINE, 0x03B5},
+ {0x1D7AF, 0, 1 | DECOMP_INLINE, 0x03B6},
+ {0x1D7B0, 0, 1 | DECOMP_INLINE, 0x03B7},
+ {0x1D7B1, 0, 1 | DECOMP_INLINE, 0x03B8},
+ {0x1D7B2, 0, 1 | DECOMP_INLINE, 0x03B9},
+ {0x1D7B3, 0, 1 | DECOMP_INLINE, 0x03BA},
+ {0x1D7B4, 0, 1 | DECOMP_INLINE, 0x03BB},
+ {0x1D7B5, 0, 1 | DECOMP_INLINE, 0x03BC},
+ {0x1D7B6, 0, 1 | DECOMP_INLINE, 0x03BD},
+ {0x1D7B7, 0, 1 | DECOMP_INLINE, 0x03BE},
+ {0x1D7B8, 0, 1 | DECOMP_INLINE, 0x03BF},
+ {0x1D7B9, 0, 1 | DECOMP_INLINE, 0x03C0},
+ {0x1D7BA, 0, 1 | DECOMP_INLINE, 0x03C1},
+ {0x1D7BB, 0, 1 | DECOMP_INLINE, 0x03C2},
+ {0x1D7BC, 0, 1 | DECOMP_INLINE, 0x03C3},
+ {0x1D7BD, 0, 1 | DECOMP_INLINE, 0x03C4},
+ {0x1D7BE, 0, 1 | DECOMP_INLINE, 0x03C5},
+ {0x1D7BF, 0, 1 | DECOMP_INLINE, 0x03C6},
+ {0x1D7C0, 0, 1 | DECOMP_INLINE, 0x03C7},
+ {0x1D7C1, 0, 1 | DECOMP_INLINE, 0x03C8},
+ {0x1D7C2, 0, 1 | DECOMP_INLINE, 0x03C9},
+ {0x1D7C3, 0, 1 | DECOMP_INLINE, 0x2202},
+ {0x1D7C4, 0, 1 | DECOMP_INLINE, 0x03F5},
+ {0x1D7C5, 0, 1 | DECOMP_INLINE, 0x03D1},
+ {0x1D7C6, 0, 1 | DECOMP_INLINE, 0x03F0},
+ {0x1D7C7, 0, 1 | DECOMP_INLINE, 0x03D5},
+ {0x1D7C8, 0, 1 | DECOMP_INLINE, 0x03F1},
+ {0x1D7C9, 0, 1 | DECOMP_INLINE, 0x03D6},
+ {0x1D7CA, 0, 1 | DECOMP_INLINE, 0x03DC},
+ {0x1D7CB, 0, 1 | DECOMP_INLINE, 0x03DD},
+ {0x1D7CE, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x1D7CF, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x1D7D0, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x1D7D1, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x1D7D2, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x1D7D3, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x1D7D4, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x1D7D5, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x1D7D6, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x1D7D7, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x1D7D8, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x1D7D9, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x1D7DA, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x1D7DB, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x1D7DC, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x1D7DD, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x1D7DE, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x1D7DF, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x1D7E0, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x1D7E1, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x1D7E2, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x1D7E3, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x1D7E4, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x1D7E5, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x1D7E6, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x1D7E7, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x1D7E8, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x1D7E9, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x1D7EA, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x1D7EB, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x1D7EC, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x1D7ED, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x1D7EE, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x1D7EF, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x1D7F0, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x1D7F1, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x1D7F2, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x1D7F3, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x1D7F4, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x1D7F5, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x1D7F6, 0, 1 | DECOMP_INLINE, 0x0030},
+ {0x1D7F7, 0, 1 | DECOMP_INLINE, 0x0031},
+ {0x1D7F8, 0, 1 | DECOMP_INLINE, 0x0032},
+ {0x1D7F9, 0, 1 | DECOMP_INLINE, 0x0033},
+ {0x1D7FA, 0, 1 | DECOMP_INLINE, 0x0034},
+ {0x1D7FB, 0, 1 | DECOMP_INLINE, 0x0035},
+ {0x1D7FC, 0, 1 | DECOMP_INLINE, 0x0036},
+ {0x1D7FD, 0, 1 | DECOMP_INLINE, 0x0037},
+ {0x1D7FE, 0, 1 | DECOMP_INLINE, 0x0038},
+ {0x1D7FF, 0, 1 | DECOMP_INLINE, 0x0039},
+ {0x1E000, 230, 0, 0},
+ {0x1E001, 230, 0, 0},
+ {0x1E002, 230, 0, 0},
+ {0x1E003, 230, 0, 0},
+ {0x1E004, 230, 0, 0},
+ {0x1E005, 230, 0, 0},
+ {0x1E006, 230, 0, 0},
+ {0x1E008, 230, 0, 0},
+ {0x1E009, 230, 0, 0},
+ {0x1E00A, 230, 0, 0},
+ {0x1E00B, 230, 0, 0},
+ {0x1E00C, 230, 0, 0},
+ {0x1E00D, 230, 0, 0},
+ {0x1E00E, 230, 0, 0},
+ {0x1E00F, 230, 0, 0},
+ {0x1E010, 230, 0, 0},
+ {0x1E011, 230, 0, 0},
+ {0x1E012, 230, 0, 0},
+ {0x1E013, 230, 0, 0},
+ {0x1E014, 230, 0, 0},
+ {0x1E015, 230, 0, 0},
+ {0x1E016, 230, 0, 0},
+ {0x1E017, 230, 0, 0},
+ {0x1E018, 230, 0, 0},
+ {0x1E01B, 230, 0, 0},
+ {0x1E01C, 230, 0, 0},
+ {0x1E01D, 230, 0, 0},
+ {0x1E01E, 230, 0, 0},
+ {0x1E01F, 230, 0, 0},
+ {0x1E020, 230, 0, 0},
+ {0x1E021, 230, 0, 0},
+ {0x1E023, 230, 0, 0},
+ {0x1E024, 230, 0, 0},
+ {0x1E026, 230, 0, 0},
+ {0x1E027, 230, 0, 0},
+ {0x1E028, 230, 0, 0},
+ {0x1E029, 230, 0, 0},
+ {0x1E02A, 230, 0, 0},
+ {0x1E8D0, 220, 0, 0},
+ {0x1E8D1, 220, 0, 0},
+ {0x1E8D2, 220, 0, 0},
+ {0x1E8D3, 220, 0, 0},
+ {0x1E8D4, 220, 0, 0},
+ {0x1E8D5, 220, 0, 0},
+ {0x1E8D6, 220, 0, 0},
+ {0x1E944, 230, 0, 0},
+ {0x1E945, 230, 0, 0},
+ {0x1E946, 230, 0, 0},
+ {0x1E947, 230, 0, 0},
+ {0x1E948, 230, 0, 0},
+ {0x1E949, 230, 0, 0},
+ {0x1E94A, 7, 0, 0},
+ {0x1EE00, 0, 1 | DECOMP_INLINE, 0x0627},
+ {0x1EE01, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0x1EE02, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0x1EE03, 0, 1 | DECOMP_INLINE, 0x062F},
+ {0x1EE05, 0, 1 | DECOMP_INLINE, 0x0648},
+ {0x1EE06, 0, 1 | DECOMP_INLINE, 0x0632},
+ {0x1EE07, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0x1EE08, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0x1EE09, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0x1EE0A, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0x1EE0B, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0x1EE0C, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0x1EE0D, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0x1EE0E, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0x1EE0F, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0x1EE10, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0x1EE11, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0x1EE12, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0x1EE13, 0, 1 | DECOMP_INLINE, 0x0631},
+ {0x1EE14, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0x1EE15, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0x1EE16, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0x1EE17, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0x1EE18, 0, 1 | DECOMP_INLINE, 0x0630},
+ {0x1EE19, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0x1EE1A, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0x1EE1B, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0x1EE1C, 0, 1 | DECOMP_INLINE, 0x066E},
+ {0x1EE1D, 0, 1 | DECOMP_INLINE, 0x06BA},
+ {0x1EE1E, 0, 1 | DECOMP_INLINE, 0x06A1},
+ {0x1EE1F, 0, 1 | DECOMP_INLINE, 0x066F},
+ {0x1EE21, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0x1EE22, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0x1EE24, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0x1EE27, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0x1EE29, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0x1EE2A, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0x1EE2B, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0x1EE2C, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0x1EE2D, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0x1EE2E, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0x1EE2F, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0x1EE30, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0x1EE31, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0x1EE32, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0x1EE34, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0x1EE35, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0x1EE36, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0x1EE37, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0x1EE39, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0x1EE3B, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0x1EE42, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0x1EE47, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0x1EE49, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0x1EE4B, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0x1EE4D, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0x1EE4E, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0x1EE4F, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0x1EE51, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0x1EE52, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0x1EE54, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0x1EE57, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0x1EE59, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0x1EE5B, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0x1EE5D, 0, 1 | DECOMP_INLINE, 0x06BA},
+ {0x1EE5F, 0, 1 | DECOMP_INLINE, 0x066F},
+ {0x1EE61, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0x1EE62, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0x1EE64, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0x1EE67, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0x1EE68, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0x1EE69, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0x1EE6A, 0, 1 | DECOMP_INLINE, 0x0643},
+ {0x1EE6C, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0x1EE6D, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0x1EE6E, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0x1EE6F, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0x1EE70, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0x1EE71, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0x1EE72, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0x1EE74, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0x1EE75, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0x1EE76, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0x1EE77, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0x1EE79, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0x1EE7A, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0x1EE7B, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0x1EE7C, 0, 1 | DECOMP_INLINE, 0x066E},
+ {0x1EE7E, 0, 1 | DECOMP_INLINE, 0x06A1},
+ {0x1EE80, 0, 1 | DECOMP_INLINE, 0x0627},
+ {0x1EE81, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0x1EE82, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0x1EE83, 0, 1 | DECOMP_INLINE, 0x062F},
+ {0x1EE84, 0, 1 | DECOMP_INLINE, 0x0647},
+ {0x1EE85, 0, 1 | DECOMP_INLINE, 0x0648},
+ {0x1EE86, 0, 1 | DECOMP_INLINE, 0x0632},
+ {0x1EE87, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0x1EE88, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0x1EE89, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0x1EE8B, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0x1EE8C, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0x1EE8D, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0x1EE8E, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0x1EE8F, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0x1EE90, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0x1EE91, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0x1EE92, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0x1EE93, 0, 1 | DECOMP_INLINE, 0x0631},
+ {0x1EE94, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0x1EE95, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0x1EE96, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0x1EE97, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0x1EE98, 0, 1 | DECOMP_INLINE, 0x0630},
+ {0x1EE99, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0x1EE9A, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0x1EE9B, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0x1EEA1, 0, 1 | DECOMP_INLINE, 0x0628},
+ {0x1EEA2, 0, 1 | DECOMP_INLINE, 0x062C},
+ {0x1EEA3, 0, 1 | DECOMP_INLINE, 0x062F},
+ {0x1EEA5, 0, 1 | DECOMP_INLINE, 0x0648},
+ {0x1EEA6, 0, 1 | DECOMP_INLINE, 0x0632},
+ {0x1EEA7, 0, 1 | DECOMP_INLINE, 0x062D},
+ {0x1EEA8, 0, 1 | DECOMP_INLINE, 0x0637},
+ {0x1EEA9, 0, 1 | DECOMP_INLINE, 0x064A},
+ {0x1EEAB, 0, 1 | DECOMP_INLINE, 0x0644},
+ {0x1EEAC, 0, 1 | DECOMP_INLINE, 0x0645},
+ {0x1EEAD, 0, 1 | DECOMP_INLINE, 0x0646},
+ {0x1EEAE, 0, 1 | DECOMP_INLINE, 0x0633},
+ {0x1EEAF, 0, 1 | DECOMP_INLINE, 0x0639},
+ {0x1EEB0, 0, 1 | DECOMP_INLINE, 0x0641},
+ {0x1EEB1, 0, 1 | DECOMP_INLINE, 0x0635},
+ {0x1EEB2, 0, 1 | DECOMP_INLINE, 0x0642},
+ {0x1EEB3, 0, 1 | DECOMP_INLINE, 0x0631},
+ {0x1EEB4, 0, 1 | DECOMP_INLINE, 0x0634},
+ {0x1EEB5, 0, 1 | DECOMP_INLINE, 0x062A},
+ {0x1EEB6, 0, 1 | DECOMP_INLINE, 0x062B},
+ {0x1EEB7, 0, 1 | DECOMP_INLINE, 0x062E},
+ {0x1EEB8, 0, 1 | DECOMP_INLINE, 0x0630},
+ {0x1EEB9, 0, 1 | DECOMP_INLINE, 0x0636},
+ {0x1EEBA, 0, 1 | DECOMP_INLINE, 0x0638},
+ {0x1EEBB, 0, 1 | DECOMP_INLINE, 0x063A},
+ {0x1F100, 0, 2 | DECOMP_NO_COMPOSE, 4824}, /* compatibility mapping */
+ {0x1F101, 0, 2 | DECOMP_NO_COMPOSE, 4826}, /* compatibility mapping */
+ {0x1F102, 0, 2 | DECOMP_NO_COMPOSE, 4828}, /* compatibility mapping */
+ {0x1F103, 0, 2 | DECOMP_NO_COMPOSE, 4830}, /* compatibility mapping */
+ {0x1F104, 0, 2 | DECOMP_NO_COMPOSE, 4832}, /* compatibility mapping */
+ {0x1F105, 0, 2 | DECOMP_NO_COMPOSE, 4834}, /* compatibility mapping */
+ {0x1F106, 0, 2 | DECOMP_NO_COMPOSE, 4836}, /* compatibility mapping */
+ {0x1F107, 0, 2 | DECOMP_NO_COMPOSE, 4838}, /* compatibility mapping */
+ {0x1F108, 0, 2 | DECOMP_NO_COMPOSE, 4840}, /* compatibility mapping */
+ {0x1F109, 0, 2 | DECOMP_NO_COMPOSE, 4842}, /* compatibility mapping */
+ {0x1F10A, 0, 2 | DECOMP_NO_COMPOSE, 4844}, /* compatibility mapping */
+ {0x1F110, 0, 3, 4846},
+ {0x1F111, 0, 3, 4849},
+ {0x1F112, 0, 3, 4852},
+ {0x1F113, 0, 3, 4855},
+ {0x1F114, 0, 3, 4858},
+ {0x1F115, 0, 3, 4861},
+ {0x1F116, 0, 3, 4864},
+ {0x1F117, 0, 3, 4867},
+ {0x1F118, 0, 3, 4870},
+ {0x1F119, 0, 3, 4873},
+ {0x1F11A, 0, 3, 4876},
+ {0x1F11B, 0, 3, 4879},
+ {0x1F11C, 0, 3, 4882},
+ {0x1F11D, 0, 3, 4885},
+ {0x1F11E, 0, 3, 4888},
+ {0x1F11F, 0, 3, 4891},
+ {0x1F120, 0, 3, 4894},
+ {0x1F121, 0, 3, 4897},
+ {0x1F122, 0, 3, 4900},
+ {0x1F123, 0, 3, 4903},
+ {0x1F124, 0, 3, 4906},
+ {0x1F125, 0, 3, 4909},
+ {0x1F126, 0, 3, 4912},
+ {0x1F127, 0, 3, 4915},
+ {0x1F128, 0, 3, 4918},
+ {0x1F129, 0, 3, 4921},
+ {0x1F12A, 0, 3, 4924},
+ {0x1F12B, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1F12C, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1F12D, 0, 2 | DECOMP_NO_COMPOSE, 4927}, /* compatibility mapping */
+ {0x1F12E, 0, 2 | DECOMP_NO_COMPOSE, 4929}, /* compatibility mapping */
+ {0x1F130, 0, 1 | DECOMP_INLINE, 0x0041},
+ {0x1F131, 0, 1 | DECOMP_INLINE, 0x0042},
+ {0x1F132, 0, 1 | DECOMP_INLINE, 0x0043},
+ {0x1F133, 0, 1 | DECOMP_INLINE, 0x0044},
+ {0x1F134, 0, 1 | DECOMP_INLINE, 0x0045},
+ {0x1F135, 0, 1 | DECOMP_INLINE, 0x0046},
+ {0x1F136, 0, 1 | DECOMP_INLINE, 0x0047},
+ {0x1F137, 0, 1 | DECOMP_INLINE, 0x0048},
+ {0x1F138, 0, 1 | DECOMP_INLINE, 0x0049},
+ {0x1F139, 0, 1 | DECOMP_INLINE, 0x004A},
+ {0x1F13A, 0, 1 | DECOMP_INLINE, 0x004B},
+ {0x1F13B, 0, 1 | DECOMP_INLINE, 0x004C},
+ {0x1F13C, 0, 1 | DECOMP_INLINE, 0x004D},
+ {0x1F13D, 0, 1 | DECOMP_INLINE, 0x004E},
+ {0x1F13E, 0, 1 | DECOMP_INLINE, 0x004F},
+ {0x1F13F, 0, 1 | DECOMP_INLINE, 0x0050},
+ {0x1F140, 0, 1 | DECOMP_INLINE, 0x0051},
+ {0x1F141, 0, 1 | DECOMP_INLINE, 0x0052},
+ {0x1F142, 0, 1 | DECOMP_INLINE, 0x0053},
+ {0x1F143, 0, 1 | DECOMP_INLINE, 0x0054},
+ {0x1F144, 0, 1 | DECOMP_INLINE, 0x0055},
+ {0x1F145, 0, 1 | DECOMP_INLINE, 0x0056},
+ {0x1F146, 0, 1 | DECOMP_INLINE, 0x0057},
+ {0x1F147, 0, 1 | DECOMP_INLINE, 0x0058},
+ {0x1F148, 0, 1 | DECOMP_INLINE, 0x0059},
+ {0x1F149, 0, 1 | DECOMP_INLINE, 0x005A},
+ {0x1F14A, 0, 2 | DECOMP_NO_COMPOSE, 4931}, /* compatibility mapping */
+ {0x1F14B, 0, 2 | DECOMP_NO_COMPOSE, 4933}, /* compatibility mapping */
+ {0x1F14C, 0, 2 | DECOMP_NO_COMPOSE, 4935}, /* compatibility mapping */
+ {0x1F14D, 0, 2 | DECOMP_NO_COMPOSE, 4937}, /* compatibility mapping */
+ {0x1F14E, 0, 3, 4939},
+ {0x1F14F, 0, 2 | DECOMP_NO_COMPOSE, 4942}, /* compatibility mapping */
+ {0x1F16A, 0, 2 | DECOMP_NO_COMPOSE, 4944}, /* compatibility mapping */
+ {0x1F16B, 0, 2 | DECOMP_NO_COMPOSE, 4946}, /* compatibility mapping */
+ {0x1F190, 0, 2 | DECOMP_NO_COMPOSE, 4948}, /* compatibility mapping */
+ {0x1F200, 0, 2 | DECOMP_NO_COMPOSE, 4950}, /* compatibility mapping */
+ {0x1F201, 0, 2 | DECOMP_NO_COMPOSE, 4952}, /* compatibility mapping */
+ {0x1F202, 0, 1 | DECOMP_INLINE, 0x30B5},
+ {0x1F210, 0, 1 | DECOMP_INLINE, 0x624B},
+ {0x1F211, 0, 1 | DECOMP_INLINE, 0x5B57},
+ {0x1F212, 0, 1 | DECOMP_INLINE, 0x53CC},
+ {0x1F213, 0, 1 | DECOMP_INLINE, 0x30C7},
+ {0x1F214, 0, 1 | DECOMP_INLINE, 0x4E8C},
+ {0x1F215, 0, 1 | DECOMP_INLINE, 0x591A},
+ {0x1F216, 0, 1 | DECOMP_INLINE, 0x89E3},
+ {0x1F217, 0, 1 | DECOMP_INLINE, 0x5929},
+ {0x1F218, 0, 1 | DECOMP_INLINE, 0x4EA4},
+ {0x1F219, 0, 1 | DECOMP_INLINE, 0x6620},
+ {0x1F21A, 0, 1 | DECOMP_INLINE, 0x7121},
+ {0x1F21B, 0, 1 | DECOMP_INLINE, 0x6599},
+ {0x1F21C, 0, 1 | DECOMP_INLINE, 0x524D},
+ {0x1F21D, 0, 1 | DECOMP_INLINE, 0x5F8C},
+ {0x1F21E, 0, 1 | DECOMP_INLINE, 0x518D},
+ {0x1F21F, 0, 1 | DECOMP_INLINE, 0x65B0},
+ {0x1F220, 0, 1 | DECOMP_INLINE, 0x521D},
+ {0x1F221, 0, 1 | DECOMP_INLINE, 0x7D42},
+ {0x1F222, 0, 1 | DECOMP_INLINE, 0x751F},
+ {0x1F223, 0, 1 | DECOMP_INLINE, 0x8CA9},
+ {0x1F224, 0, 1 | DECOMP_INLINE, 0x58F0},
+ {0x1F225, 0, 1 | DECOMP_INLINE, 0x5439},
+ {0x1F226, 0, 1 | DECOMP_INLINE, 0x6F14},
+ {0x1F227, 0, 1 | DECOMP_INLINE, 0x6295},
+ {0x1F228, 0, 1 | DECOMP_INLINE, 0x6355},
+ {0x1F229, 0, 1 | DECOMP_INLINE, 0x4E00},
+ {0x1F22A, 0, 1 | DECOMP_INLINE, 0x4E09},
+ {0x1F22B, 0, 1 | DECOMP_INLINE, 0x904A},
+ {0x1F22C, 0, 1 | DECOMP_INLINE, 0x5DE6},
+ {0x1F22D, 0, 1 | DECOMP_INLINE, 0x4E2D},
+ {0x1F22E, 0, 1 | DECOMP_INLINE, 0x53F3},
+ {0x1F22F, 0, 1 | DECOMP_INLINE, 0x6307},
+ {0x1F230, 0, 1 | DECOMP_INLINE, 0x8D70},
+ {0x1F231, 0, 1 | DECOMP_INLINE, 0x6253},
+ {0x1F232, 0, 1 | DECOMP_INLINE, 0x7981},
+ {0x1F233, 0, 1 | DECOMP_INLINE, 0x7A7A},
+ {0x1F234, 0, 1 | DECOMP_INLINE, 0x5408},
+ {0x1F235, 0, 1 | DECOMP_INLINE, 0x6E80},
+ {0x1F236, 0, 1 | DECOMP_INLINE, 0x6709},
+ {0x1F237, 0, 1 | DECOMP_INLINE, 0x6708},
+ {0x1F238, 0, 1 | DECOMP_INLINE, 0x7533},
+ {0x1F239, 0, 1 | DECOMP_INLINE, 0x5272},
+ {0x1F23A, 0, 1 | DECOMP_INLINE, 0x55B6},
+ {0x1F23B, 0, 1 | DECOMP_INLINE, 0x914D},
+ {0x1F240, 0, 3, 4954},
+ {0x1F241, 0, 3, 4957},
+ {0x1F242, 0, 3, 4960},
+ {0x1F243, 0, 3, 4963},
+ {0x1F244, 0, 3, 4966},
+ {0x1F245, 0, 3, 4969},
+ {0x1F246, 0, 3, 4972},
+ {0x1F247, 0, 3, 4975},
+ {0x1F248, 0, 3, 4978},
+ {0x1F250, 0, 1 | DECOMP_INLINE, 0x5F97},
+ {0x1F251, 0, 1 | DECOMP_INLINE, 0x53EF},
+ {0x2F800, 0, 1 | DECOMP_INLINE, 0x4E3D},
+ {0x2F801, 0, 1 | DECOMP_INLINE, 0x4E38},
+ {0x2F802, 0, 1 | DECOMP_INLINE, 0x4E41},
+ {0x2F803, 0, 1, 4981},
+ {0x2F804, 0, 1 | DECOMP_INLINE, 0x4F60},
+ {0x2F805, 0, 1 | DECOMP_INLINE, 0x4FAE},
+ {0x2F806, 0, 1 | DECOMP_INLINE, 0x4FBB},
+ {0x2F807, 0, 1 | DECOMP_INLINE, 0x5002},
+ {0x2F808, 0, 1 | DECOMP_INLINE, 0x507A},
+ {0x2F809, 0, 1 | DECOMP_INLINE, 0x5099},
+ {0x2F80A, 0, 1 | DECOMP_INLINE, 0x50E7},
+ {0x2F80B, 0, 1 | DECOMP_INLINE, 0x50CF},
+ {0x2F80C, 0, 1 | DECOMP_INLINE, 0x349E},
+ {0x2F80D, 0, 1, 4982},
+ {0x2F80E, 0, 1 | DECOMP_INLINE, 0x514D},
+ {0x2F80F, 0, 1 | DECOMP_INLINE, 0x5154},
+ {0x2F810, 0, 1 | DECOMP_INLINE, 0x5164},
+ {0x2F811, 0, 1 | DECOMP_INLINE, 0x5177},
+ {0x2F812, 0, 1, 4983},
+ {0x2F813, 0, 1 | DECOMP_INLINE, 0x34B9},
+ {0x2F814, 0, 1 | DECOMP_INLINE, 0x5167},
+ {0x2F815, 0, 1 | DECOMP_INLINE, 0x518D},
+ {0x2F816, 0, 1, 4984},
+ {0x2F817, 0, 1 | DECOMP_INLINE, 0x5197},
+ {0x2F818, 0, 1 | DECOMP_INLINE, 0x51A4},
+ {0x2F819, 0, 1 | DECOMP_INLINE, 0x4ECC},
+ {0x2F81A, 0, 1 | DECOMP_INLINE, 0x51AC},
+ {0x2F81B, 0, 1 | DECOMP_INLINE, 0x51B5},
+ {0x2F81C, 0, 1, 4985},
+ {0x2F81D, 0, 1 | DECOMP_INLINE, 0x51F5},
+ {0x2F81E, 0, 1 | DECOMP_INLINE, 0x5203},
+ {0x2F81F, 0, 1 | DECOMP_INLINE, 0x34DF},
+ {0x2F820, 0, 1 | DECOMP_INLINE, 0x523B},
+ {0x2F821, 0, 1 | DECOMP_INLINE, 0x5246},
+ {0x2F822, 0, 1 | DECOMP_INLINE, 0x5272},
+ {0x2F823, 0, 1 | DECOMP_INLINE, 0x5277},
+ {0x2F824, 0, 1 | DECOMP_INLINE, 0x3515},
+ {0x2F825, 0, 1 | DECOMP_INLINE, 0x52C7},
+ {0x2F826, 0, 1 | DECOMP_INLINE, 0x52C9},
+ {0x2F827, 0, 1 | DECOMP_INLINE, 0x52E4},
+ {0x2F828, 0, 1 | DECOMP_INLINE, 0x52FA},
+ {0x2F829, 0, 1 | DECOMP_INLINE, 0x5305},
+ {0x2F82A, 0, 1 | DECOMP_INLINE, 0x5306},
+ {0x2F82B, 0, 1 | DECOMP_INLINE, 0x5317},
+ {0x2F82C, 0, 1 | DECOMP_INLINE, 0x5349},
+ {0x2F82D, 0, 1 | DECOMP_INLINE, 0x5351},
+ {0x2F82E, 0, 1 | DECOMP_INLINE, 0x535A},
+ {0x2F82F, 0, 1 | DECOMP_INLINE, 0x5373},
+ {0x2F830, 0, 1 | DECOMP_INLINE, 0x537D},
+ {0x2F831, 0, 1 | DECOMP_INLINE, 0x537F},
+ {0x2F832, 0, 1 | DECOMP_INLINE, 0x537F},
+ {0x2F833, 0, 1 | DECOMP_INLINE, 0x537F},
+ {0x2F834, 0, 1, 4986},
+ {0x2F835, 0, 1 | DECOMP_INLINE, 0x7070},
+ {0x2F836, 0, 1 | DECOMP_INLINE, 0x53CA},
+ {0x2F837, 0, 1 | DECOMP_INLINE, 0x53DF},
+ {0x2F838, 0, 1, 4987},
+ {0x2F839, 0, 1 | DECOMP_INLINE, 0x53EB},
+ {0x2F83A, 0, 1 | DECOMP_INLINE, 0x53F1},
+ {0x2F83B, 0, 1 | DECOMP_INLINE, 0x5406},
+ {0x2F83C, 0, 1 | DECOMP_INLINE, 0x549E},
+ {0x2F83D, 0, 1 | DECOMP_INLINE, 0x5438},
+ {0x2F83E, 0, 1 | DECOMP_INLINE, 0x5448},
+ {0x2F83F, 0, 1 | DECOMP_INLINE, 0x5468},
+ {0x2F840, 0, 1 | DECOMP_INLINE, 0x54A2},
+ {0x2F841, 0, 1 | DECOMP_INLINE, 0x54F6},
+ {0x2F842, 0, 1 | DECOMP_INLINE, 0x5510},
+ {0x2F843, 0, 1 | DECOMP_INLINE, 0x5553},
+ {0x2F844, 0, 1 | DECOMP_INLINE, 0x5563},
+ {0x2F845, 0, 1 | DECOMP_INLINE, 0x5584},
+ {0x2F846, 0, 1 | DECOMP_INLINE, 0x5584},
+ {0x2F847, 0, 1 | DECOMP_INLINE, 0x5599},
+ {0x2F848, 0, 1 | DECOMP_INLINE, 0x55AB},
+ {0x2F849, 0, 1 | DECOMP_INLINE, 0x55B3},
+ {0x2F84A, 0, 1 | DECOMP_INLINE, 0x55C2},
+ {0x2F84B, 0, 1 | DECOMP_INLINE, 0x5716},
+ {0x2F84C, 0, 1 | DECOMP_INLINE, 0x5606},
+ {0x2F84D, 0, 1 | DECOMP_INLINE, 0x5717},
+ {0x2F84E, 0, 1 | DECOMP_INLINE, 0x5651},
+ {0x2F84F, 0, 1 | DECOMP_INLINE, 0x5674},
+ {0x2F850, 0, 1 | DECOMP_INLINE, 0x5207},
+ {0x2F851, 0, 1 | DECOMP_INLINE, 0x58EE},
+ {0x2F852, 0, 1 | DECOMP_INLINE, 0x57CE},
+ {0x2F853, 0, 1 | DECOMP_INLINE, 0x57F4},
+ {0x2F854, 0, 1 | DECOMP_INLINE, 0x580D},
+ {0x2F855, 0, 1 | DECOMP_INLINE, 0x578B},
+ {0x2F856, 0, 1 | DECOMP_INLINE, 0x5832},
+ {0x2F857, 0, 1 | DECOMP_INLINE, 0x5831},
+ {0x2F858, 0, 1 | DECOMP_INLINE, 0x58AC},
+ {0x2F859, 0, 1, 4988},
+ {0x2F85A, 0, 1 | DECOMP_INLINE, 0x58F2},
+ {0x2F85B, 0, 1 | DECOMP_INLINE, 0x58F7},
+ {0x2F85C, 0, 1 | DECOMP_INLINE, 0x5906},
+ {0x2F85D, 0, 1 | DECOMP_INLINE, 0x591A},
+ {0x2F85E, 0, 1 | DECOMP_INLINE, 0x5922},
+ {0x2F85F, 0, 1 | DECOMP_INLINE, 0x5962},
+ {0x2F860, 0, 1, 4989},
+ {0x2F861, 0, 1, 4990},
+ {0x2F862, 0, 1 | DECOMP_INLINE, 0x59EC},
+ {0x2F863, 0, 1 | DECOMP_INLINE, 0x5A1B},
+ {0x2F864, 0, 1 | DECOMP_INLINE, 0x5A27},
+ {0x2F865, 0, 1 | DECOMP_INLINE, 0x59D8},
+ {0x2F866, 0, 1 | DECOMP_INLINE, 0x5A66},
+ {0x2F867, 0, 1 | DECOMP_INLINE, 0x36EE},
+ {0x2F868, 0, 1 | DECOMP_INLINE, 0x36FC},
+ {0x2F869, 0, 1 | DECOMP_INLINE, 0x5B08},
+ {0x2F86A, 0, 1 | DECOMP_INLINE, 0x5B3E},
+ {0x2F86B, 0, 1 | DECOMP_INLINE, 0x5B3E},
+ {0x2F86C, 0, 1, 4991},
+ {0x2F86D, 0, 1 | DECOMP_INLINE, 0x5BC3},
+ {0x2F86E, 0, 1 | DECOMP_INLINE, 0x5BD8},
+ {0x2F86F, 0, 1 | DECOMP_INLINE, 0x5BE7},
+ {0x2F870, 0, 1 | DECOMP_INLINE, 0x5BF3},
+ {0x2F871, 0, 1, 4992},
+ {0x2F872, 0, 1 | DECOMP_INLINE, 0x5BFF},
+ {0x2F873, 0, 1 | DECOMP_INLINE, 0x5C06},
+ {0x2F874, 0, 1 | DECOMP_INLINE, 0x5F53},
+ {0x2F875, 0, 1 | DECOMP_INLINE, 0x5C22},
+ {0x2F876, 0, 1 | DECOMP_INLINE, 0x3781},
+ {0x2F877, 0, 1 | DECOMP_INLINE, 0x5C60},
+ {0x2F878, 0, 1 | DECOMP_INLINE, 0x5C6E},
+ {0x2F879, 0, 1 | DECOMP_INLINE, 0x5CC0},
+ {0x2F87A, 0, 1 | DECOMP_INLINE, 0x5C8D},
+ {0x2F87B, 0, 1, 4993},
+ {0x2F87C, 0, 1 | DECOMP_INLINE, 0x5D43},
+ {0x2F87D, 0, 1, 4994},
+ {0x2F87E, 0, 1 | DECOMP_INLINE, 0x5D6E},
+ {0x2F87F, 0, 1 | DECOMP_INLINE, 0x5D6B},
+ {0x2F880, 0, 1 | DECOMP_INLINE, 0x5D7C},
+ {0x2F881, 0, 1 | DECOMP_INLINE, 0x5DE1},
+ {0x2F882, 0, 1 | DECOMP_INLINE, 0x5DE2},
+ {0x2F883, 0, 1 | DECOMP_INLINE, 0x382F},
+ {0x2F884, 0, 1 | DECOMP_INLINE, 0x5DFD},
+ {0x2F885, 0, 1 | DECOMP_INLINE, 0x5E28},
+ {0x2F886, 0, 1 | DECOMP_INLINE, 0x5E3D},
+ {0x2F887, 0, 1 | DECOMP_INLINE, 0x5E69},
+ {0x2F888, 0, 1 | DECOMP_INLINE, 0x3862},
+ {0x2F889, 0, 1, 4995},
+ {0x2F88A, 0, 1 | DECOMP_INLINE, 0x387C},
+ {0x2F88B, 0, 1 | DECOMP_INLINE, 0x5EB0},
+ {0x2F88C, 0, 1 | DECOMP_INLINE, 0x5EB3},
+ {0x2F88D, 0, 1 | DECOMP_INLINE, 0x5EB6},
+ {0x2F88E, 0, 1 | DECOMP_INLINE, 0x5ECA},
+ {0x2F88F, 0, 1, 4996},
+ {0x2F890, 0, 1 | DECOMP_INLINE, 0x5EFE},
+ {0x2F891, 0, 1, 4997},
+ {0x2F892, 0, 1, 4998},
+ {0x2F893, 0, 1 | DECOMP_INLINE, 0x8201},
+ {0x2F894, 0, 1 | DECOMP_INLINE, 0x5F22},
+ {0x2F895, 0, 1 | DECOMP_INLINE, 0x5F22},
+ {0x2F896, 0, 1 | DECOMP_INLINE, 0x38C7},
+ {0x2F897, 0, 1, 4999},
+ {0x2F898, 0, 1, 5000},
+ {0x2F899, 0, 1 | DECOMP_INLINE, 0x5F62},
+ {0x2F89A, 0, 1 | DECOMP_INLINE, 0x5F6B},
+ {0x2F89B, 0, 1 | DECOMP_INLINE, 0x38E3},
+ {0x2F89C, 0, 1 | DECOMP_INLINE, 0x5F9A},
+ {0x2F89D, 0, 1 | DECOMP_INLINE, 0x5FCD},
+ {0x2F89E, 0, 1 | DECOMP_INLINE, 0x5FD7},
+ {0x2F89F, 0, 1 | DECOMP_INLINE, 0x5FF9},
+ {0x2F8A0, 0, 1 | DECOMP_INLINE, 0x6081},
+ {0x2F8A1, 0, 1 | DECOMP_INLINE, 0x393A},
+ {0x2F8A2, 0, 1 | DECOMP_INLINE, 0x391C},
+ {0x2F8A3, 0, 1 | DECOMP_INLINE, 0x6094},
+ {0x2F8A4, 0, 1, 5001},
+ {0x2F8A5, 0, 1 | DECOMP_INLINE, 0x60C7},
+ {0x2F8A6, 0, 1 | DECOMP_INLINE, 0x6148},
+ {0x2F8A7, 0, 1 | DECOMP_INLINE, 0x614C},
+ {0x2F8A8, 0, 1 | DECOMP_INLINE, 0x614E},
+ {0x2F8A9, 0, 1 | DECOMP_INLINE, 0x614C},
+ {0x2F8AA, 0, 1 | DECOMP_INLINE, 0x617A},
+ {0x2F8AB, 0, 1 | DECOMP_INLINE, 0x618E},
+ {0x2F8AC, 0, 1 | DECOMP_INLINE, 0x61B2},
+ {0x2F8AD, 0, 1 | DECOMP_INLINE, 0x61A4},
+ {0x2F8AE, 0, 1 | DECOMP_INLINE, 0x61AF},
+ {0x2F8AF, 0, 1 | DECOMP_INLINE, 0x61DE},
+ {0x2F8B0, 0, 1 | DECOMP_INLINE, 0x61F2},
+ {0x2F8B1, 0, 1 | DECOMP_INLINE, 0x61F6},
+ {0x2F8B2, 0, 1 | DECOMP_INLINE, 0x6210},
+ {0x2F8B3, 0, 1 | DECOMP_INLINE, 0x621B},
+ {0x2F8B4, 0, 1 | DECOMP_INLINE, 0x625D},
+ {0x2F8B5, 0, 1 | DECOMP_INLINE, 0x62B1},
+ {0x2F8B6, 0, 1 | DECOMP_INLINE, 0x62D4},
+ {0x2F8B7, 0, 1 | DECOMP_INLINE, 0x6350},
+ {0x2F8B8, 0, 1, 5002},
+ {0x2F8B9, 0, 1 | DECOMP_INLINE, 0x633D},
+ {0x2F8BA, 0, 1 | DECOMP_INLINE, 0x62FC},
+ {0x2F8BB, 0, 1 | DECOMP_INLINE, 0x6368},
+ {0x2F8BC, 0, 1 | DECOMP_INLINE, 0x6383},
+ {0x2F8BD, 0, 1 | DECOMP_INLINE, 0x63E4},
+ {0x2F8BE, 0, 1, 5003},
+ {0x2F8BF, 0, 1 | DECOMP_INLINE, 0x6422},
+ {0x2F8C0, 0, 1 | DECOMP_INLINE, 0x63C5},
+ {0x2F8C1, 0, 1 | DECOMP_INLINE, 0x63A9},
+ {0x2F8C2, 0, 1 | DECOMP_INLINE, 0x3A2E},
+ {0x2F8C3, 0, 1 | DECOMP_INLINE, 0x6469},
+ {0x2F8C4, 0, 1 | DECOMP_INLINE, 0x647E},
+ {0x2F8C5, 0, 1 | DECOMP_INLINE, 0x649D},
+ {0x2F8C6, 0, 1 | DECOMP_INLINE, 0x6477},
+ {0x2F8C7, 0, 1 | DECOMP_INLINE, 0x3A6C},
+ {0x2F8C8, 0, 1 | DECOMP_INLINE, 0x654F},
+ {0x2F8C9, 0, 1 | DECOMP_INLINE, 0x656C},
+ {0x2F8CA, 0, 1, 5004},
+ {0x2F8CB, 0, 1 | DECOMP_INLINE, 0x65E3},
+ {0x2F8CC, 0, 1 | DECOMP_INLINE, 0x66F8},
+ {0x2F8CD, 0, 1 | DECOMP_INLINE, 0x6649},
+ {0x2F8CE, 0, 1 | DECOMP_INLINE, 0x3B19},
+ {0x2F8CF, 0, 1 | DECOMP_INLINE, 0x6691},
+ {0x2F8D0, 0, 1 | DECOMP_INLINE, 0x3B08},
+ {0x2F8D1, 0, 1 | DECOMP_INLINE, 0x3AE4},
+ {0x2F8D2, 0, 1 | DECOMP_INLINE, 0x5192},
+ {0x2F8D3, 0, 1 | DECOMP_INLINE, 0x5195},
+ {0x2F8D4, 0, 1 | DECOMP_INLINE, 0x6700},
+ {0x2F8D5, 0, 1 | DECOMP_INLINE, 0x669C},
+ {0x2F8D6, 0, 1 | DECOMP_INLINE, 0x80AD},
+ {0x2F8D7, 0, 1 | DECOMP_INLINE, 0x43D9},
+ {0x2F8D8, 0, 1 | DECOMP_INLINE, 0x6717},
+ {0x2F8D9, 0, 1 | DECOMP_INLINE, 0x671B},
+ {0x2F8DA, 0, 1 | DECOMP_INLINE, 0x6721},
+ {0x2F8DB, 0, 1 | DECOMP_INLINE, 0x675E},
+ {0x2F8DC, 0, 1 | DECOMP_INLINE, 0x6753},
+ {0x2F8DD, 0, 1, 5005},
+ {0x2F8DE, 0, 1 | DECOMP_INLINE, 0x3B49},
+ {0x2F8DF, 0, 1 | DECOMP_INLINE, 0x67FA},
+ {0x2F8E0, 0, 1 | DECOMP_INLINE, 0x6785},
+ {0x2F8E1, 0, 1 | DECOMP_INLINE, 0x6852},
+ {0x2F8E2, 0, 1 | DECOMP_INLINE, 0x6885},
+ {0x2F8E3, 0, 1, 5006},
+ {0x2F8E4, 0, 1 | DECOMP_INLINE, 0x688E},
+ {0x2F8E5, 0, 1 | DECOMP_INLINE, 0x681F},
+ {0x2F8E6, 0, 1 | DECOMP_INLINE, 0x6914},
+ {0x2F8E7, 0, 1 | DECOMP_INLINE, 0x3B9D},
+ {0x2F8E8, 0, 1 | DECOMP_INLINE, 0x6942},
+ {0x2F8E9, 0, 1 | DECOMP_INLINE, 0x69A3},
+ {0x2F8EA, 0, 1 | DECOMP_INLINE, 0x69EA},
+ {0x2F8EB, 0, 1 | DECOMP_INLINE, 0x6AA8},
+ {0x2F8EC, 0, 1, 5007},
+ {0x2F8ED, 0, 1 | DECOMP_INLINE, 0x6ADB},
+ {0x2F8EE, 0, 1 | DECOMP_INLINE, 0x3C18},
+ {0x2F8EF, 0, 1 | DECOMP_INLINE, 0x6B21},
+ {0x2F8F0, 0, 1, 5008},
+ {0x2F8F1, 0, 1 | DECOMP_INLINE, 0x6B54},
+ {0x2F8F2, 0, 1 | DECOMP_INLINE, 0x3C4E},
+ {0x2F8F3, 0, 1 | DECOMP_INLINE, 0x6B72},
+ {0x2F8F4, 0, 1 | DECOMP_INLINE, 0x6B9F},
+ {0x2F8F5, 0, 1 | DECOMP_INLINE, 0x6BBA},
+ {0x2F8F6, 0, 1 | DECOMP_INLINE, 0x6BBB},
+ {0x2F8F7, 0, 1, 5009},
+ {0x2F8F8, 0, 1, 5010},
+ {0x2F8F9, 0, 1, 5011},
+ {0x2F8FA, 0, 1 | DECOMP_INLINE, 0x6C4E},
+ {0x2F8FB, 0, 1, 5012},
+ {0x2F8FC, 0, 1 | DECOMP_INLINE, 0x6CBF},
+ {0x2F8FD, 0, 1 | DECOMP_INLINE, 0x6CCD},
+ {0x2F8FE, 0, 1 | DECOMP_INLINE, 0x6C67},
+ {0x2F8FF, 0, 1 | DECOMP_INLINE, 0x6D16},
+ {0x2F900, 0, 1 | DECOMP_INLINE, 0x6D3E},
+ {0x2F901, 0, 1 | DECOMP_INLINE, 0x6D77},
+ {0x2F902, 0, 1 | DECOMP_INLINE, 0x6D41},
+ {0x2F903, 0, 1 | DECOMP_INLINE, 0x6D69},
+ {0x2F904, 0, 1 | DECOMP_INLINE, 0x6D78},
+ {0x2F905, 0, 1 | DECOMP_INLINE, 0x6D85},
+ {0x2F906, 0, 1, 5013},
+ {0x2F907, 0, 1 | DECOMP_INLINE, 0x6D34},
+ {0x2F908, 0, 1 | DECOMP_INLINE, 0x6E2F},
+ {0x2F909, 0, 1 | DECOMP_INLINE, 0x6E6E},
+ {0x2F90A, 0, 1 | DECOMP_INLINE, 0x3D33},
+ {0x2F90B, 0, 1 | DECOMP_INLINE, 0x6ECB},
+ {0x2F90C, 0, 1 | DECOMP_INLINE, 0x6EC7},
+ {0x2F90D, 0, 1, 5014},
+ {0x2F90E, 0, 1 | DECOMP_INLINE, 0x6DF9},
+ {0x2F90F, 0, 1 | DECOMP_INLINE, 0x6F6E},
+ {0x2F910, 0, 1, 5015},
+ {0x2F911, 0, 1, 5016},
+ {0x2F912, 0, 1 | DECOMP_INLINE, 0x6FC6},
+ {0x2F913, 0, 1 | DECOMP_INLINE, 0x7039},
+ {0x2F914, 0, 1 | DECOMP_INLINE, 0x701E},
+ {0x2F915, 0, 1 | DECOMP_INLINE, 0x701B},
+ {0x2F916, 0, 1 | DECOMP_INLINE, 0x3D96},
+ {0x2F917, 0, 1 | DECOMP_INLINE, 0x704A},
+ {0x2F918, 0, 1 | DECOMP_INLINE, 0x707D},
+ {0x2F919, 0, 1 | DECOMP_INLINE, 0x7077},
+ {0x2F91A, 0, 1 | DECOMP_INLINE, 0x70AD},
+ {0x2F91B, 0, 1, 5017},
+ {0x2F91C, 0, 1 | DECOMP_INLINE, 0x7145},
+ {0x2F91D, 0, 1, 5018},
+ {0x2F91E, 0, 1 | DECOMP_INLINE, 0x719C},
+ {0x2F91F, 0, 1, 5019},
+ {0x2F920, 0, 1 | DECOMP_INLINE, 0x7228},
+ {0x2F921, 0, 1 | DECOMP_INLINE, 0x7235},
+ {0x2F922, 0, 1 | DECOMP_INLINE, 0x7250},
+ {0x2F923, 0, 1, 5020},
+ {0x2F924, 0, 1 | DECOMP_INLINE, 0x7280},
+ {0x2F925, 0, 1 | DECOMP_INLINE, 0x7295},
+ {0x2F926, 0, 1, 5021},
+ {0x2F927, 0, 1, 5022},
+ {0x2F928, 0, 1 | DECOMP_INLINE, 0x737A},
+ {0x2F929, 0, 1 | DECOMP_INLINE, 0x738B},
+ {0x2F92A, 0, 1 | DECOMP_INLINE, 0x3EAC},
+ {0x2F92B, 0, 1 | DECOMP_INLINE, 0x73A5},
+ {0x2F92C, 0, 1 | DECOMP_INLINE, 0x3EB8},
+ {0x2F92D, 0, 1 | DECOMP_INLINE, 0x3EB8},
+ {0x2F92E, 0, 1 | DECOMP_INLINE, 0x7447},
+ {0x2F92F, 0, 1 | DECOMP_INLINE, 0x745C},
+ {0x2F930, 0, 1 | DECOMP_INLINE, 0x7471},
+ {0x2F931, 0, 1 | DECOMP_INLINE, 0x7485},
+ {0x2F932, 0, 1 | DECOMP_INLINE, 0x74CA},
+ {0x2F933, 0, 1 | DECOMP_INLINE, 0x3F1B},
+ {0x2F934, 0, 1 | DECOMP_INLINE, 0x7524},
+ {0x2F935, 0, 1, 5023},
+ {0x2F936, 0, 1 | DECOMP_INLINE, 0x753E},
+ {0x2F937, 0, 1, 5024},
+ {0x2F938, 0, 1 | DECOMP_INLINE, 0x7570},
+ {0x2F939, 0, 1, 5025},
+ {0x2F93A, 0, 1 | DECOMP_INLINE, 0x7610},
+ {0x2F93B, 0, 1, 5026},
+ {0x2F93C, 0, 1, 5027},
+ {0x2F93D, 0, 1, 5028},
+ {0x2F93E, 0, 1 | DECOMP_INLINE, 0x3FFC},
+ {0x2F93F, 0, 1 | DECOMP_INLINE, 0x4008},
+ {0x2F940, 0, 1 | DECOMP_INLINE, 0x76F4},
+ {0x2F941, 0, 1, 5029},
+ {0x2F942, 0, 1, 5030},
+ {0x2F943, 0, 1, 5031},
+ {0x2F944, 0, 1, 5032},
+ {0x2F945, 0, 1 | DECOMP_INLINE, 0x771E},
+ {0x2F946, 0, 1 | DECOMP_INLINE, 0x771F},
+ {0x2F947, 0, 1 | DECOMP_INLINE, 0x771F},
+ {0x2F948, 0, 1 | DECOMP_INLINE, 0x774A},
+ {0x2F949, 0, 1 | DECOMP_INLINE, 0x4039},
+ {0x2F94A, 0, 1 | DECOMP_INLINE, 0x778B},
+ {0x2F94B, 0, 1 | DECOMP_INLINE, 0x4046},
+ {0x2F94C, 0, 1 | DECOMP_INLINE, 0x4096},
+ {0x2F94D, 0, 1, 5033},
+ {0x2F94E, 0, 1 | DECOMP_INLINE, 0x784E},
+ {0x2F94F, 0, 1 | DECOMP_INLINE, 0x788C},
+ {0x2F950, 0, 1 | DECOMP_INLINE, 0x78CC},
+ {0x2F951, 0, 1 | DECOMP_INLINE, 0x40E3},
+ {0x2F952, 0, 1, 5034},
+ {0x2F953, 0, 1 | DECOMP_INLINE, 0x7956},
+ {0x2F954, 0, 1, 5035},
+ {0x2F955, 0, 1, 5036},
+ {0x2F956, 0, 1 | DECOMP_INLINE, 0x798F},
+ {0x2F957, 0, 1 | DECOMP_INLINE, 0x79EB},
+ {0x2F958, 0, 1 | DECOMP_INLINE, 0x412F},
+ {0x2F959, 0, 1 | DECOMP_INLINE, 0x7A40},
+ {0x2F95A, 0, 1 | DECOMP_INLINE, 0x7A4A},
+ {0x2F95B, 0, 1 | DECOMP_INLINE, 0x7A4F},
+ {0x2F95C, 0, 1, 5037},
+ {0x2F95D, 0, 1, 5038},
+ {0x2F95E, 0, 1, 5039},
+ {0x2F95F, 0, 1 | DECOMP_INLINE, 0x7AEE},
+ {0x2F960, 0, 1 | DECOMP_INLINE, 0x4202},
+ {0x2F961, 0, 1, 5040},
+ {0x2F962, 0, 1 | DECOMP_INLINE, 0x7BC6},
+ {0x2F963, 0, 1 | DECOMP_INLINE, 0x7BC9},
+ {0x2F964, 0, 1 | DECOMP_INLINE, 0x4227},
+ {0x2F965, 0, 1, 5041},
+ {0x2F966, 0, 1 | DECOMP_INLINE, 0x7CD2},
+ {0x2F967, 0, 1 | DECOMP_INLINE, 0x42A0},
+ {0x2F968, 0, 1 | DECOMP_INLINE, 0x7CE8},
+ {0x2F969, 0, 1 | DECOMP_INLINE, 0x7CE3},
+ {0x2F96A, 0, 1 | DECOMP_INLINE, 0x7D00},
+ {0x2F96B, 0, 1, 5042},
+ {0x2F96C, 0, 1 | DECOMP_INLINE, 0x7D63},
+ {0x2F96D, 0, 1 | DECOMP_INLINE, 0x4301},
+ {0x2F96E, 0, 1 | DECOMP_INLINE, 0x7DC7},
+ {0x2F96F, 0, 1 | DECOMP_INLINE, 0x7E02},
+ {0x2F970, 0, 1 | DECOMP_INLINE, 0x7E45},
+ {0x2F971, 0, 1 | DECOMP_INLINE, 0x4334},
+ {0x2F972, 0, 1, 5043},
+ {0x2F973, 0, 1, 5044},
+ {0x2F974, 0, 1 | DECOMP_INLINE, 0x4359},
+ {0x2F975, 0, 1, 5045},
+ {0x2F976, 0, 1 | DECOMP_INLINE, 0x7F7A},
+ {0x2F977, 0, 1, 5046},
+ {0x2F978, 0, 1 | DECOMP_INLINE, 0x7F95},
+ {0x2F979, 0, 1 | DECOMP_INLINE, 0x7FFA},
+ {0x2F97A, 0, 1 | DECOMP_INLINE, 0x8005},
+ {0x2F97B, 0, 1, 5047},
+ {0x2F97C, 0, 1, 5048},
+ {0x2F97D, 0, 1 | DECOMP_INLINE, 0x8060},
+ {0x2F97E, 0, 1, 5049},
+ {0x2F97F, 0, 1 | DECOMP_INLINE, 0x8070},
+ {0x2F980, 0, 1, 5050},
+ {0x2F981, 0, 1 | DECOMP_INLINE, 0x43D5},
+ {0x2F982, 0, 1 | DECOMP_INLINE, 0x80B2},
+ {0x2F983, 0, 1 | DECOMP_INLINE, 0x8103},
+ {0x2F984, 0, 1 | DECOMP_INLINE, 0x440B},
+ {0x2F985, 0, 1 | DECOMP_INLINE, 0x813E},
+ {0x2F986, 0, 1 | DECOMP_INLINE, 0x5AB5},
+ {0x2F987, 0, 1, 5051},
+ {0x2F988, 0, 1, 5052},
+ {0x2F989, 0, 1, 5053},
+ {0x2F98A, 0, 1, 5054},
+ {0x2F98B, 0, 1 | DECOMP_INLINE, 0x8201},
+ {0x2F98C, 0, 1 | DECOMP_INLINE, 0x8204},
+ {0x2F98D, 0, 1 | DECOMP_INLINE, 0x8F9E},
+ {0x2F98E, 0, 1 | DECOMP_INLINE, 0x446B},
+ {0x2F98F, 0, 1 | DECOMP_INLINE, 0x8291},
+ {0x2F990, 0, 1 | DECOMP_INLINE, 0x828B},
+ {0x2F991, 0, 1 | DECOMP_INLINE, 0x829D},
+ {0x2F992, 0, 1 | DECOMP_INLINE, 0x52B3},
+ {0x2F993, 0, 1 | DECOMP_INLINE, 0x82B1},
+ {0x2F994, 0, 1 | DECOMP_INLINE, 0x82B3},
+ {0x2F995, 0, 1 | DECOMP_INLINE, 0x82BD},
+ {0x2F996, 0, 1 | DECOMP_INLINE, 0x82E6},
+ {0x2F997, 0, 1, 5055},
+ {0x2F998, 0, 1 | DECOMP_INLINE, 0x82E5},
+ {0x2F999, 0, 1 | DECOMP_INLINE, 0x831D},
+ {0x2F99A, 0, 1 | DECOMP_INLINE, 0x8363},
+ {0x2F99B, 0, 1 | DECOMP_INLINE, 0x83AD},
+ {0x2F99C, 0, 1 | DECOMP_INLINE, 0x8323},
+ {0x2F99D, 0, 1 | DECOMP_INLINE, 0x83BD},
+ {0x2F99E, 0, 1 | DECOMP_INLINE, 0x83E7},
+ {0x2F99F, 0, 1 | DECOMP_INLINE, 0x8457},
+ {0x2F9A0, 0, 1 | DECOMP_INLINE, 0x8353},
+ {0x2F9A1, 0, 1 | DECOMP_INLINE, 0x83CA},
+ {0x2F9A2, 0, 1 | DECOMP_INLINE, 0x83CC},
+ {0x2F9A3, 0, 1 | DECOMP_INLINE, 0x83DC},
+ {0x2F9A4, 0, 1, 5056},
+ {0x2F9A5, 0, 1, 5057},
+ {0x2F9A6, 0, 1, 5058},
+ {0x2F9A7, 0, 1 | DECOMP_INLINE, 0x452B},
+ {0x2F9A8, 0, 1 | DECOMP_INLINE, 0x84F1},
+ {0x2F9A9, 0, 1 | DECOMP_INLINE, 0x84F3},
+ {0x2F9AA, 0, 1 | DECOMP_INLINE, 0x8516},
+ {0x2F9AB, 0, 1, 5059},
+ {0x2F9AC, 0, 1 | DECOMP_INLINE, 0x8564},
+ {0x2F9AD, 0, 1, 5060},
+ {0x2F9AE, 0, 1 | DECOMP_INLINE, 0x455D},
+ {0x2F9AF, 0, 1 | DECOMP_INLINE, 0x4561},
+ {0x2F9B0, 0, 1, 5061},
+ {0x2F9B1, 0, 1, 5062},
+ {0x2F9B2, 0, 1 | DECOMP_INLINE, 0x456B},
+ {0x2F9B3, 0, 1 | DECOMP_INLINE, 0x8650},
+ {0x2F9B4, 0, 1 | DECOMP_INLINE, 0x865C},
+ {0x2F9B5, 0, 1 | DECOMP_INLINE, 0x8667},
+ {0x2F9B6, 0, 1 | DECOMP_INLINE, 0x8669},
+ {0x2F9B7, 0, 1 | DECOMP_INLINE, 0x86A9},
+ {0x2F9B8, 0, 1 | DECOMP_INLINE, 0x8688},
+ {0x2F9B9, 0, 1 | DECOMP_INLINE, 0x870E},
+ {0x2F9BA, 0, 1 | DECOMP_INLINE, 0x86E2},
+ {0x2F9BB, 0, 1 | DECOMP_INLINE, 0x8779},
+ {0x2F9BC, 0, 1 | DECOMP_INLINE, 0x8728},
+ {0x2F9BD, 0, 1 | DECOMP_INLINE, 0x876B},
+ {0x2F9BE, 0, 1 | DECOMP_INLINE, 0x8786},
+ {0x2F9BF, 0, 1 | DECOMP_INLINE, 0x45D7},
+ {0x2F9C0, 0, 1 | DECOMP_INLINE, 0x87E1},
+ {0x2F9C1, 0, 1 | DECOMP_INLINE, 0x8801},
+ {0x2F9C2, 0, 1 | DECOMP_INLINE, 0x45F9},
+ {0x2F9C3, 0, 1 | DECOMP_INLINE, 0x8860},
+ {0x2F9C4, 0, 1 | DECOMP_INLINE, 0x8863},
+ {0x2F9C5, 0, 1, 5063},
+ {0x2F9C6, 0, 1 | DECOMP_INLINE, 0x88D7},
+ {0x2F9C7, 0, 1 | DECOMP_INLINE, 0x88DE},
+ {0x2F9C8, 0, 1 | DECOMP_INLINE, 0x4635},
+ {0x2F9C9, 0, 1 | DECOMP_INLINE, 0x88FA},
+ {0x2F9CA, 0, 1 | DECOMP_INLINE, 0x34BB},
+ {0x2F9CB, 0, 1, 5064},
+ {0x2F9CC, 0, 1, 5065},
+ {0x2F9CD, 0, 1 | DECOMP_INLINE, 0x46BE},
+ {0x2F9CE, 0, 1 | DECOMP_INLINE, 0x46C7},
+ {0x2F9CF, 0, 1 | DECOMP_INLINE, 0x8AA0},
+ {0x2F9D0, 0, 1 | DECOMP_INLINE, 0x8AED},
+ {0x2F9D1, 0, 1 | DECOMP_INLINE, 0x8B8A},
+ {0x2F9D2, 0, 1 | DECOMP_INLINE, 0x8C55},
+ {0x2F9D3, 0, 1, 5066},
+ {0x2F9D4, 0, 1 | DECOMP_INLINE, 0x8CAB},
+ {0x2F9D5, 0, 1 | DECOMP_INLINE, 0x8CC1},
+ {0x2F9D6, 0, 1 | DECOMP_INLINE, 0x8D1B},
+ {0x2F9D7, 0, 1 | DECOMP_INLINE, 0x8D77},
+ {0x2F9D8, 0, 1, 5067},
+ {0x2F9D9, 0, 1, 5068},
+ {0x2F9DA, 0, 1 | DECOMP_INLINE, 0x8DCB},
+ {0x2F9DB, 0, 1 | DECOMP_INLINE, 0x8DBC},
+ {0x2F9DC, 0, 1 | DECOMP_INLINE, 0x8DF0},
+ {0x2F9DD, 0, 1, 5069},
+ {0x2F9DE, 0, 1 | DECOMP_INLINE, 0x8ED4},
+ {0x2F9DF, 0, 1 | DECOMP_INLINE, 0x8F38},
+ {0x2F9E0, 0, 1, 5070},
+ {0x2F9E1, 0, 1, 5071},
+ {0x2F9E2, 0, 1 | DECOMP_INLINE, 0x9094},
+ {0x2F9E3, 0, 1 | DECOMP_INLINE, 0x90F1},
+ {0x2F9E4, 0, 1 | DECOMP_INLINE, 0x9111},
+ {0x2F9E5, 0, 1, 5072},
+ {0x2F9E6, 0, 1 | DECOMP_INLINE, 0x911B},
+ {0x2F9E7, 0, 1 | DECOMP_INLINE, 0x9238},
+ {0x2F9E8, 0, 1 | DECOMP_INLINE, 0x92D7},
+ {0x2F9E9, 0, 1 | DECOMP_INLINE, 0x92D8},
+ {0x2F9EA, 0, 1 | DECOMP_INLINE, 0x927C},
+ {0x2F9EB, 0, 1 | DECOMP_INLINE, 0x93F9},
+ {0x2F9EC, 0, 1 | DECOMP_INLINE, 0x9415},
+ {0x2F9ED, 0, 1, 5073},
+ {0x2F9EE, 0, 1 | DECOMP_INLINE, 0x958B},
+ {0x2F9EF, 0, 1 | DECOMP_INLINE, 0x4995},
+ {0x2F9F0, 0, 1 | DECOMP_INLINE, 0x95B7},
+ {0x2F9F1, 0, 1, 5074},
+ {0x2F9F2, 0, 1 | DECOMP_INLINE, 0x49E6},
+ {0x2F9F3, 0, 1 | DECOMP_INLINE, 0x96C3},
+ {0x2F9F4, 0, 1 | DECOMP_INLINE, 0x5DB2},
+ {0x2F9F5, 0, 1 | DECOMP_INLINE, 0x9723},
+ {0x2F9F6, 0, 1, 5075},
+ {0x2F9F7, 0, 1, 5076},
+ {0x2F9F8, 0, 1 | DECOMP_INLINE, 0x4A6E},
+ {0x2F9F9, 0, 1 | DECOMP_INLINE, 0x4A76},
+ {0x2F9FA, 0, 1 | DECOMP_INLINE, 0x97E0},
+ {0x2F9FB, 0, 1, 5077},
+ {0x2F9FC, 0, 1 | DECOMP_INLINE, 0x4AB2},
+ {0x2F9FD, 0, 1, 5078},
+ {0x2F9FE, 0, 1 | DECOMP_INLINE, 0x980B},
+ {0x2F9FF, 0, 1 | DECOMP_INLINE, 0x980B},
+ {0x2FA00, 0, 1 | DECOMP_INLINE, 0x9829},
+ {0x2FA01, 0, 1, 5079},
+ {0x2FA02, 0, 1 | DECOMP_INLINE, 0x98E2},
+ {0x2FA03, 0, 1 | DECOMP_INLINE, 0x4B33},
+ {0x2FA04, 0, 1 | DECOMP_INLINE, 0x9929},
+ {0x2FA05, 0, 1 | DECOMP_INLINE, 0x99A7},
+ {0x2FA06, 0, 1 | DECOMP_INLINE, 0x99C2},
+ {0x2FA07, 0, 1 | DECOMP_INLINE, 0x99FE},
+ {0x2FA08, 0, 1 | DECOMP_INLINE, 0x4BCE},
+ {0x2FA09, 0, 1, 5080},
+ {0x2FA0A, 0, 1 | DECOMP_INLINE, 0x9B12},
+ {0x2FA0B, 0, 1 | DECOMP_INLINE, 0x9C40},
+ {0x2FA0C, 0, 1 | DECOMP_INLINE, 0x9CFD},
+ {0x2FA0D, 0, 1 | DECOMP_INLINE, 0x4CCE},
+ {0x2FA0E, 0, 1 | DECOMP_INLINE, 0x4CED},
+ {0x2FA0F, 0, 1 | DECOMP_INLINE, 0x9D67},
+ {0x2FA10, 0, 1, 5081},
+ {0x2FA11, 0, 1 | DECOMP_INLINE, 0x4CF8},
+ {0x2FA12, 0, 1, 5082},
+ {0x2FA13, 0, 1, 5083},
+ {0x2FA14, 0, 1, 5084},
+ {0x2FA15, 0, 1 | DECOMP_INLINE, 0x9EBB},
+ {0x2FA16, 0, 1 | DECOMP_INLINE, 0x4D56},
+ {0x2FA17, 0, 1 | DECOMP_INLINE, 0x9EF9},
+ {0x2FA18, 0, 1 | DECOMP_INLINE, 0x9EFE},
+ {0x2FA19, 0, 1 | DECOMP_INLINE, 0x9F05},
+ {0x2FA1A, 0, 1 | DECOMP_INLINE, 0x9F0F},
+ {0x2FA1B, 0, 1 | DECOMP_INLINE, 0x9F16},
+ {0x2FA1C, 0, 1 | DECOMP_INLINE, 0x9F3B},
+ {0x2FA1D, 0, 1, 5085}
+
+};
+
+/* codepoints array */
+static const uint32 UnicodeDecomp_codepoints[5086] =
+{
+ /* 0 */ 0x0020, 0x0308,
+ /* 2 */ 0x0020, 0x0304,
+ /* 4 */ 0x0020, 0x0301,
+ /* 6 */ 0x0020, 0x0327,
+ /* 8 */ 0x0031, 0x2044, 0x0034,
+ /* 11 */ 0x0031, 0x2044, 0x0032,
+ /* 14 */ 0x0033, 0x2044, 0x0034,
+ /* 17 */ 0x0041, 0x0300,
+ /* 19 */ 0x0041, 0x0301,
+ /* 21 */ 0x0041, 0x0302,
+ /* 23 */ 0x0041, 0x0303,
+ /* 25 */ 0x0041, 0x0308,
+ /* 27 */ 0x0041, 0x030A,
+ /* 29 */ 0x0043, 0x0327,
+ /* 31 */ 0x0045, 0x0300,
+ /* 33 */ 0x0045, 0x0301,
+ /* 35 */ 0x0045, 0x0302,
+ /* 37 */ 0x0045, 0x0308,
+ /* 39 */ 0x0049, 0x0300,
+ /* 41 */ 0x0049, 0x0301,
+ /* 43 */ 0x0049, 0x0302,
+ /* 45 */ 0x0049, 0x0308,
+ /* 47 */ 0x004E, 0x0303,
+ /* 49 */ 0x004F, 0x0300,
+ /* 51 */ 0x004F, 0x0301,
+ /* 53 */ 0x004F, 0x0302,
+ /* 55 */ 0x004F, 0x0303,
+ /* 57 */ 0x004F, 0x0308,
+ /* 59 */ 0x0055, 0x0300,
+ /* 61 */ 0x0055, 0x0301,
+ /* 63 */ 0x0055, 0x0302,
+ /* 65 */ 0x0055, 0x0308,
+ /* 67 */ 0x0059, 0x0301,
+ /* 69 */ 0x0061, 0x0300,
+ /* 71 */ 0x0061, 0x0301,
+ /* 73 */ 0x0061, 0x0302,
+ /* 75 */ 0x0061, 0x0303,
+ /* 77 */ 0x0061, 0x0308,
+ /* 79 */ 0x0061, 0x030A,
+ /* 81 */ 0x0063, 0x0327,
+ /* 83 */ 0x0065, 0x0300,
+ /* 85 */ 0x0065, 0x0301,
+ /* 87 */ 0x0065, 0x0302,
+ /* 89 */ 0x0065, 0x0308,
+ /* 91 */ 0x0069, 0x0300,
+ /* 93 */ 0x0069, 0x0301,
+ /* 95 */ 0x0069, 0x0302,
+ /* 97 */ 0x0069, 0x0308,
+ /* 99 */ 0x006E, 0x0303,
+ /* 101 */ 0x006F, 0x0300,
+ /* 103 */ 0x006F, 0x0301,
+ /* 105 */ 0x006F, 0x0302,
+ /* 107 */ 0x006F, 0x0303,
+ /* 109 */ 0x006F, 0x0308,
+ /* 111 */ 0x0075, 0x0300,
+ /* 113 */ 0x0075, 0x0301,
+ /* 115 */ 0x0075, 0x0302,
+ /* 117 */ 0x0075, 0x0308,
+ /* 119 */ 0x0079, 0x0301,
+ /* 121 */ 0x0079, 0x0308,
+ /* 123 */ 0x0041, 0x0304,
+ /* 125 */ 0x0061, 0x0304,
+ /* 127 */ 0x0041, 0x0306,
+ /* 129 */ 0x0061, 0x0306,
+ /* 131 */ 0x0041, 0x0328,
+ /* 133 */ 0x0061, 0x0328,
+ /* 135 */ 0x0043, 0x0301,
+ /* 137 */ 0x0063, 0x0301,
+ /* 139 */ 0x0043, 0x0302,
+ /* 141 */ 0x0063, 0x0302,
+ /* 143 */ 0x0043, 0x0307,
+ /* 145 */ 0x0063, 0x0307,
+ /* 147 */ 0x0043, 0x030C,
+ /* 149 */ 0x0063, 0x030C,
+ /* 151 */ 0x0044, 0x030C,
+ /* 153 */ 0x0064, 0x030C,
+ /* 155 */ 0x0045, 0x0304,
+ /* 157 */ 0x0065, 0x0304,
+ /* 159 */ 0x0045, 0x0306,
+ /* 161 */ 0x0065, 0x0306,
+ /* 163 */ 0x0045, 0x0307,
+ /* 165 */ 0x0065, 0x0307,
+ /* 167 */ 0x0045, 0x0328,
+ /* 169 */ 0x0065, 0x0328,
+ /* 171 */ 0x0045, 0x030C,
+ /* 173 */ 0x0065, 0x030C,
+ /* 175 */ 0x0047, 0x0302,
+ /* 177 */ 0x0067, 0x0302,
+ /* 179 */ 0x0047, 0x0306,
+ /* 181 */ 0x0067, 0x0306,
+ /* 183 */ 0x0047, 0x0307,
+ /* 185 */ 0x0067, 0x0307,
+ /* 187 */ 0x0047, 0x0327,
+ /* 189 */ 0x0067, 0x0327,
+ /* 191 */ 0x0048, 0x0302,
+ /* 193 */ 0x0068, 0x0302,
+ /* 195 */ 0x0049, 0x0303,
+ /* 197 */ 0x0069, 0x0303,
+ /* 199 */ 0x0049, 0x0304,
+ /* 201 */ 0x0069, 0x0304,
+ /* 203 */ 0x0049, 0x0306,
+ /* 205 */ 0x0069, 0x0306,
+ /* 207 */ 0x0049, 0x0328,
+ /* 209 */ 0x0069, 0x0328,
+ /* 211 */ 0x0049, 0x0307,
+ /* 213 */ 0x0049, 0x004A,
+ /* 215 */ 0x0069, 0x006A,
+ /* 217 */ 0x004A, 0x0302,
+ /* 219 */ 0x006A, 0x0302,
+ /* 221 */ 0x004B, 0x0327,
+ /* 223 */ 0x006B, 0x0327,
+ /* 225 */ 0x004C, 0x0301,
+ /* 227 */ 0x006C, 0x0301,
+ /* 229 */ 0x004C, 0x0327,
+ /* 231 */ 0x006C, 0x0327,
+ /* 233 */ 0x004C, 0x030C,
+ /* 235 */ 0x006C, 0x030C,
+ /* 237 */ 0x004C, 0x00B7,
+ /* 239 */ 0x006C, 0x00B7,
+ /* 241 */ 0x004E, 0x0301,
+ /* 243 */ 0x006E, 0x0301,
+ /* 245 */ 0x004E, 0x0327,
+ /* 247 */ 0x006E, 0x0327,
+ /* 249 */ 0x004E, 0x030C,
+ /* 251 */ 0x006E, 0x030C,
+ /* 253 */ 0x02BC, 0x006E,
+ /* 255 */ 0x004F, 0x0304,
+ /* 257 */ 0x006F, 0x0304,
+ /* 259 */ 0x004F, 0x0306,
+ /* 261 */ 0x006F, 0x0306,
+ /* 263 */ 0x004F, 0x030B,
+ /* 265 */ 0x006F, 0x030B,
+ /* 267 */ 0x0052, 0x0301,
+ /* 269 */ 0x0072, 0x0301,
+ /* 271 */ 0x0052, 0x0327,
+ /* 273 */ 0x0072, 0x0327,
+ /* 275 */ 0x0052, 0x030C,
+ /* 277 */ 0x0072, 0x030C,
+ /* 279 */ 0x0053, 0x0301,
+ /* 281 */ 0x0073, 0x0301,
+ /* 283 */ 0x0053, 0x0302,
+ /* 285 */ 0x0073, 0x0302,
+ /* 287 */ 0x0053, 0x0327,
+ /* 289 */ 0x0073, 0x0327,
+ /* 291 */ 0x0053, 0x030C,
+ /* 293 */ 0x0073, 0x030C,
+ /* 295 */ 0x0054, 0x0327,
+ /* 297 */ 0x0074, 0x0327,
+ /* 299 */ 0x0054, 0x030C,
+ /* 301 */ 0x0074, 0x030C,
+ /* 303 */ 0x0055, 0x0303,
+ /* 305 */ 0x0075, 0x0303,
+ /* 307 */ 0x0055, 0x0304,
+ /* 309 */ 0x0075, 0x0304,
+ /* 311 */ 0x0055, 0x0306,
+ /* 313 */ 0x0075, 0x0306,
+ /* 315 */ 0x0055, 0x030A,
+ /* 317 */ 0x0075, 0x030A,
+ /* 319 */ 0x0055, 0x030B,
+ /* 321 */ 0x0075, 0x030B,
+ /* 323 */ 0x0055, 0x0328,
+ /* 325 */ 0x0075, 0x0328,
+ /* 327 */ 0x0057, 0x0302,
+ /* 329 */ 0x0077, 0x0302,
+ /* 331 */ 0x0059, 0x0302,
+ /* 333 */ 0x0079, 0x0302,
+ /* 335 */ 0x0059, 0x0308,
+ /* 337 */ 0x005A, 0x0301,
+ /* 339 */ 0x007A, 0x0301,
+ /* 341 */ 0x005A, 0x0307,
+ /* 343 */ 0x007A, 0x0307,
+ /* 345 */ 0x005A, 0x030C,
+ /* 347 */ 0x007A, 0x030C,
+ /* 349 */ 0x004F, 0x031B,
+ /* 351 */ 0x006F, 0x031B,
+ /* 353 */ 0x0055, 0x031B,
+ /* 355 */ 0x0075, 0x031B,
+ /* 357 */ 0x0044, 0x017D,
+ /* 359 */ 0x0044, 0x017E,
+ /* 361 */ 0x0064, 0x017E,
+ /* 363 */ 0x004C, 0x004A,
+ /* 365 */ 0x004C, 0x006A,
+ /* 367 */ 0x006C, 0x006A,
+ /* 369 */ 0x004E, 0x004A,
+ /* 371 */ 0x004E, 0x006A,
+ /* 373 */ 0x006E, 0x006A,
+ /* 375 */ 0x0041, 0x030C,
+ /* 377 */ 0x0061, 0x030C,
+ /* 379 */ 0x0049, 0x030C,
+ /* 381 */ 0x0069, 0x030C,
+ /* 383 */ 0x004F, 0x030C,
+ /* 385 */ 0x006F, 0x030C,
+ /* 387 */ 0x0055, 0x030C,
+ /* 389 */ 0x0075, 0x030C,
+ /* 391 */ 0x00DC, 0x0304,
+ /* 393 */ 0x00FC, 0x0304,
+ /* 395 */ 0x00DC, 0x0301,
+ /* 397 */ 0x00FC, 0x0301,
+ /* 399 */ 0x00DC, 0x030C,
+ /* 401 */ 0x00FC, 0x030C,
+ /* 403 */ 0x00DC, 0x0300,
+ /* 405 */ 0x00FC, 0x0300,
+ /* 407 */ 0x00C4, 0x0304,
+ /* 409 */ 0x00E4, 0x0304,
+ /* 411 */ 0x0226, 0x0304,
+ /* 413 */ 0x0227, 0x0304,
+ /* 415 */ 0x00C6, 0x0304,
+ /* 417 */ 0x00E6, 0x0304,
+ /* 419 */ 0x0047, 0x030C,
+ /* 421 */ 0x0067, 0x030C,
+ /* 423 */ 0x004B, 0x030C,
+ /* 425 */ 0x006B, 0x030C,
+ /* 427 */ 0x004F, 0x0328,
+ /* 429 */ 0x006F, 0x0328,
+ /* 431 */ 0x01EA, 0x0304,
+ /* 433 */ 0x01EB, 0x0304,
+ /* 435 */ 0x01B7, 0x030C,
+ /* 437 */ 0x0292, 0x030C,
+ /* 439 */ 0x006A, 0x030C,
+ /* 441 */ 0x0044, 0x005A,
+ /* 443 */ 0x0044, 0x007A,
+ /* 445 */ 0x0064, 0x007A,
+ /* 447 */ 0x0047, 0x0301,
+ /* 449 */ 0x0067, 0x0301,
+ /* 451 */ 0x004E, 0x0300,
+ /* 453 */ 0x006E, 0x0300,
+ /* 455 */ 0x00C5, 0x0301,
+ /* 457 */ 0x00E5, 0x0301,
+ /* 459 */ 0x00C6, 0x0301,
+ /* 461 */ 0x00E6, 0x0301,
+ /* 463 */ 0x00D8, 0x0301,
+ /* 465 */ 0x00F8, 0x0301,
+ /* 467 */ 0x0041, 0x030F,
+ /* 469 */ 0x0061, 0x030F,
+ /* 471 */ 0x0041, 0x0311,
+ /* 473 */ 0x0061, 0x0311,
+ /* 475 */ 0x0045, 0x030F,
+ /* 477 */ 0x0065, 0x030F,
+ /* 479 */ 0x0045, 0x0311,
+ /* 481 */ 0x0065, 0x0311,
+ /* 483 */ 0x0049, 0x030F,
+ /* 485 */ 0x0069, 0x030F,
+ /* 487 */ 0x0049, 0x0311,
+ /* 489 */ 0x0069, 0x0311,
+ /* 491 */ 0x004F, 0x030F,
+ /* 493 */ 0x006F, 0x030F,
+ /* 495 */ 0x004F, 0x0311,
+ /* 497 */ 0x006F, 0x0311,
+ /* 499 */ 0x0052, 0x030F,
+ /* 501 */ 0x0072, 0x030F,
+ /* 503 */ 0x0052, 0x0311,
+ /* 505 */ 0x0072, 0x0311,
+ /* 507 */ 0x0055, 0x030F,
+ /* 509 */ 0x0075, 0x030F,
+ /* 511 */ 0x0055, 0x0311,
+ /* 513 */ 0x0075, 0x0311,
+ /* 515 */ 0x0053, 0x0326,
+ /* 517 */ 0x0073, 0x0326,
+ /* 519 */ 0x0054, 0x0326,
+ /* 521 */ 0x0074, 0x0326,
+ /* 523 */ 0x0048, 0x030C,
+ /* 525 */ 0x0068, 0x030C,
+ /* 527 */ 0x0041, 0x0307,
+ /* 529 */ 0x0061, 0x0307,
+ /* 531 */ 0x0045, 0x0327,
+ /* 533 */ 0x0065, 0x0327,
+ /* 535 */ 0x00D6, 0x0304,
+ /* 537 */ 0x00F6, 0x0304,
+ /* 539 */ 0x00D5, 0x0304,
+ /* 541 */ 0x00F5, 0x0304,
+ /* 543 */ 0x004F, 0x0307,
+ /* 545 */ 0x006F, 0x0307,
+ /* 547 */ 0x022E, 0x0304,
+ /* 549 */ 0x022F, 0x0304,
+ /* 551 */ 0x0059, 0x0304,
+ /* 553 */ 0x0079, 0x0304,
+ /* 555 */ 0x0020, 0x0306,
+ /* 557 */ 0x0020, 0x0307,
+ /* 559 */ 0x0020, 0x030A,
+ /* 561 */ 0x0020, 0x0328,
+ /* 563 */ 0x0020, 0x0303,
+ /* 565 */ 0x0020, 0x030B,
+ /* 567 */ 0x0308, 0x0301,
+ /* 569 */ 0x0020, 0x0345,
+ /* 571 */ 0x0020, 0x0301,
+ /* 573 */ 0x00A8, 0x0301,
+ /* 575 */ 0x0391, 0x0301,
+ /* 577 */ 0x0395, 0x0301,
+ /* 579 */ 0x0397, 0x0301,
+ /* 581 */ 0x0399, 0x0301,
+ /* 583 */ 0x039F, 0x0301,
+ /* 585 */ 0x03A5, 0x0301,
+ /* 587 */ 0x03A9, 0x0301,
+ /* 589 */ 0x03CA, 0x0301,
+ /* 591 */ 0x0399, 0x0308,
+ /* 593 */ 0x03A5, 0x0308,
+ /* 595 */ 0x03B1, 0x0301,
+ /* 597 */ 0x03B5, 0x0301,
+ /* 599 */ 0x03B7, 0x0301,
+ /* 601 */ 0x03B9, 0x0301,
+ /* 603 */ 0x03CB, 0x0301,
+ /* 605 */ 0x03B9, 0x0308,
+ /* 607 */ 0x03C5, 0x0308,
+ /* 609 */ 0x03BF, 0x0301,
+ /* 611 */ 0x03C5, 0x0301,
+ /* 613 */ 0x03C9, 0x0301,
+ /* 615 */ 0x03D2, 0x0301,
+ /* 617 */ 0x03D2, 0x0308,
+ /* 619 */ 0x0415, 0x0300,
+ /* 621 */ 0x0415, 0x0308,
+ /* 623 */ 0x0413, 0x0301,
+ /* 625 */ 0x0406, 0x0308,
+ /* 627 */ 0x041A, 0x0301,
+ /* 629 */ 0x0418, 0x0300,
+ /* 631 */ 0x0423, 0x0306,
+ /* 633 */ 0x0418, 0x0306,
+ /* 635 */ 0x0438, 0x0306,
+ /* 637 */ 0x0435, 0x0300,
+ /* 639 */ 0x0435, 0x0308,
+ /* 641 */ 0x0433, 0x0301,
+ /* 643 */ 0x0456, 0x0308,
+ /* 645 */ 0x043A, 0x0301,
+ /* 647 */ 0x0438, 0x0300,
+ /* 649 */ 0x0443, 0x0306,
+ /* 651 */ 0x0474, 0x030F,
+ /* 653 */ 0x0475, 0x030F,
+ /* 655 */ 0x0416, 0x0306,
+ /* 657 */ 0x0436, 0x0306,
+ /* 659 */ 0x0410, 0x0306,
+ /* 661 */ 0x0430, 0x0306,
+ /* 663 */ 0x0410, 0x0308,
+ /* 665 */ 0x0430, 0x0308,
+ /* 667 */ 0x0415, 0x0306,
+ /* 669 */ 0x0435, 0x0306,
+ /* 671 */ 0x04D8, 0x0308,
+ /* 673 */ 0x04D9, 0x0308,
+ /* 675 */ 0x0416, 0x0308,
+ /* 677 */ 0x0436, 0x0308,
+ /* 679 */ 0x0417, 0x0308,
+ /* 681 */ 0x0437, 0x0308,
+ /* 683 */ 0x0418, 0x0304,
+ /* 685 */ 0x0438, 0x0304,
+ /* 687 */ 0x0418, 0x0308,
+ /* 689 */ 0x0438, 0x0308,
+ /* 691 */ 0x041E, 0x0308,
+ /* 693 */ 0x043E, 0x0308,
+ /* 695 */ 0x04E8, 0x0308,
+ /* 697 */ 0x04E9, 0x0308,
+ /* 699 */ 0x042D, 0x0308,
+ /* 701 */ 0x044D, 0x0308,
+ /* 703 */ 0x0423, 0x0304,
+ /* 705 */ 0x0443, 0x0304,
+ /* 707 */ 0x0423, 0x0308,
+ /* 709 */ 0x0443, 0x0308,
+ /* 711 */ 0x0423, 0x030B,
+ /* 713 */ 0x0443, 0x030B,
+ /* 715 */ 0x0427, 0x0308,
+ /* 717 */ 0x0447, 0x0308,
+ /* 719 */ 0x042B, 0x0308,
+ /* 721 */ 0x044B, 0x0308,
+ /* 723 */ 0x0565, 0x0582,
+ /* 725 */ 0x0627, 0x0653,
+ /* 727 */ 0x0627, 0x0654,
+ /* 729 */ 0x0648, 0x0654,
+ /* 731 */ 0x0627, 0x0655,
+ /* 733 */ 0x064A, 0x0654,
+ /* 735 */ 0x0627, 0x0674,
+ /* 737 */ 0x0648, 0x0674,
+ /* 739 */ 0x06C7, 0x0674,
+ /* 741 */ 0x064A, 0x0674,
+ /* 743 */ 0x06D5, 0x0654,
+ /* 745 */ 0x06C1, 0x0654,
+ /* 747 */ 0x06D2, 0x0654,
+ /* 749 */ 0x0928, 0x093C,
+ /* 751 */ 0x0930, 0x093C,
+ /* 753 */ 0x0933, 0x093C,
+ /* 755 */ 0x0915, 0x093C,
+ /* 757 */ 0x0916, 0x093C,
+ /* 759 */ 0x0917, 0x093C,
+ /* 761 */ 0x091C, 0x093C,
+ /* 763 */ 0x0921, 0x093C,
+ /* 765 */ 0x0922, 0x093C,
+ /* 767 */ 0x092B, 0x093C,
+ /* 769 */ 0x092F, 0x093C,
+ /* 771 */ 0x09C7, 0x09BE,
+ /* 773 */ 0x09C7, 0x09D7,
+ /* 775 */ 0x09A1, 0x09BC,
+ /* 777 */ 0x09A2, 0x09BC,
+ /* 779 */ 0x09AF, 0x09BC,
+ /* 781 */ 0x0A32, 0x0A3C,
+ /* 783 */ 0x0A38, 0x0A3C,
+ /* 785 */ 0x0A16, 0x0A3C,
+ /* 787 */ 0x0A17, 0x0A3C,
+ /* 789 */ 0x0A1C, 0x0A3C,
+ /* 791 */ 0x0A2B, 0x0A3C,
+ /* 793 */ 0x0B47, 0x0B56,
+ /* 795 */ 0x0B47, 0x0B3E,
+ /* 797 */ 0x0B47, 0x0B57,
+ /* 799 */ 0x0B21, 0x0B3C,
+ /* 801 */ 0x0B22, 0x0B3C,
+ /* 803 */ 0x0B92, 0x0BD7,
+ /* 805 */ 0x0BC6, 0x0BBE,
+ /* 807 */ 0x0BC7, 0x0BBE,
+ /* 809 */ 0x0BC6, 0x0BD7,
+ /* 811 */ 0x0C46, 0x0C56,
+ /* 813 */ 0x0CBF, 0x0CD5,
+ /* 815 */ 0x0CC6, 0x0CD5,
+ /* 817 */ 0x0CC6, 0x0CD6,
+ /* 819 */ 0x0CC6, 0x0CC2,
+ /* 821 */ 0x0CCA, 0x0CD5,
+ /* 823 */ 0x0D46, 0x0D3E,
+ /* 825 */ 0x0D47, 0x0D3E,
+ /* 827 */ 0x0D46, 0x0D57,
+ /* 829 */ 0x0DD9, 0x0DCA,
+ /* 831 */ 0x0DD9, 0x0DCF,
+ /* 833 */ 0x0DDC, 0x0DCA,
+ /* 835 */ 0x0DD9, 0x0DDF,
+ /* 837 */ 0x0E4D, 0x0E32,
+ /* 839 */ 0x0ECD, 0x0EB2,
+ /* 841 */ 0x0EAB, 0x0E99,
+ /* 843 */ 0x0EAB, 0x0EA1,
+ /* 845 */ 0x0F42, 0x0FB7,
+ /* 847 */ 0x0F4C, 0x0FB7,
+ /* 849 */ 0x0F51, 0x0FB7,
+ /* 851 */ 0x0F56, 0x0FB7,
+ /* 853 */ 0x0F5B, 0x0FB7,
+ /* 855 */ 0x0F40, 0x0FB5,
+ /* 857 */ 0x0F71, 0x0F72,
+ /* 859 */ 0x0F71, 0x0F74,
+ /* 861 */ 0x0FB2, 0x0F80,
+ /* 863 */ 0x0FB2, 0x0F81,
+ /* 865 */ 0x0FB3, 0x0F80,
+ /* 867 */ 0x0FB3, 0x0F81,
+ /* 869 */ 0x0F71, 0x0F80,
+ /* 871 */ 0x0F92, 0x0FB7,
+ /* 873 */ 0x0F9C, 0x0FB7,
+ /* 875 */ 0x0FA1, 0x0FB7,
+ /* 877 */ 0x0FA6, 0x0FB7,
+ /* 879 */ 0x0FAB, 0x0FB7,
+ /* 881 */ 0x0F90, 0x0FB5,
+ /* 883 */ 0x1025, 0x102E,
+ /* 885 */ 0x1B05, 0x1B35,
+ /* 887 */ 0x1B07, 0x1B35,
+ /* 889 */ 0x1B09, 0x1B35,
+ /* 891 */ 0x1B0B, 0x1B35,
+ /* 893 */ 0x1B0D, 0x1B35,
+ /* 895 */ 0x1B11, 0x1B35,
+ /* 897 */ 0x1B3A, 0x1B35,
+ /* 899 */ 0x1B3C, 0x1B35,
+ /* 901 */ 0x1B3E, 0x1B35,
+ /* 903 */ 0x1B3F, 0x1B35,
+ /* 905 */ 0x1B42, 0x1B35,
+ /* 907 */ 0x0041, 0x0325,
+ /* 909 */ 0x0061, 0x0325,
+ /* 911 */ 0x0042, 0x0307,
+ /* 913 */ 0x0062, 0x0307,
+ /* 915 */ 0x0042, 0x0323,
+ /* 917 */ 0x0062, 0x0323,
+ /* 919 */ 0x0042, 0x0331,
+ /* 921 */ 0x0062, 0x0331,
+ /* 923 */ 0x00C7, 0x0301,
+ /* 925 */ 0x00E7, 0x0301,
+ /* 927 */ 0x0044, 0x0307,
+ /* 929 */ 0x0064, 0x0307,
+ /* 931 */ 0x0044, 0x0323,
+ /* 933 */ 0x0064, 0x0323,
+ /* 935 */ 0x0044, 0x0331,
+ /* 937 */ 0x0064, 0x0331,
+ /* 939 */ 0x0044, 0x0327,
+ /* 941 */ 0x0064, 0x0327,
+ /* 943 */ 0x0044, 0x032D,
+ /* 945 */ 0x0064, 0x032D,
+ /* 947 */ 0x0112, 0x0300,
+ /* 949 */ 0x0113, 0x0300,
+ /* 951 */ 0x0112, 0x0301,
+ /* 953 */ 0x0113, 0x0301,
+ /* 955 */ 0x0045, 0x032D,
+ /* 957 */ 0x0065, 0x032D,
+ /* 959 */ 0x0045, 0x0330,
+ /* 961 */ 0x0065, 0x0330,
+ /* 963 */ 0x0228, 0x0306,
+ /* 965 */ 0x0229, 0x0306,
+ /* 967 */ 0x0046, 0x0307,
+ /* 969 */ 0x0066, 0x0307,
+ /* 971 */ 0x0047, 0x0304,
+ /* 973 */ 0x0067, 0x0304,
+ /* 975 */ 0x0048, 0x0307,
+ /* 977 */ 0x0068, 0x0307,
+ /* 979 */ 0x0048, 0x0323,
+ /* 981 */ 0x0068, 0x0323,
+ /* 983 */ 0x0048, 0x0308,
+ /* 985 */ 0x0068, 0x0308,
+ /* 987 */ 0x0048, 0x0327,
+ /* 989 */ 0x0068, 0x0327,
+ /* 991 */ 0x0048, 0x032E,
+ /* 993 */ 0x0068, 0x032E,
+ /* 995 */ 0x0049, 0x0330,
+ /* 997 */ 0x0069, 0x0330,
+ /* 999 */ 0x00CF, 0x0301,
+ /* 1001 */ 0x00EF, 0x0301,
+ /* 1003 */ 0x004B, 0x0301,
+ /* 1005 */ 0x006B, 0x0301,
+ /* 1007 */ 0x004B, 0x0323,
+ /* 1009 */ 0x006B, 0x0323,
+ /* 1011 */ 0x004B, 0x0331,
+ /* 1013 */ 0x006B, 0x0331,
+ /* 1015 */ 0x004C, 0x0323,
+ /* 1017 */ 0x006C, 0x0323,
+ /* 1019 */ 0x1E36, 0x0304,
+ /* 1021 */ 0x1E37, 0x0304,
+ /* 1023 */ 0x004C, 0x0331,
+ /* 1025 */ 0x006C, 0x0331,
+ /* 1027 */ 0x004C, 0x032D,
+ /* 1029 */ 0x006C, 0x032D,
+ /* 1031 */ 0x004D, 0x0301,
+ /* 1033 */ 0x006D, 0x0301,
+ /* 1035 */ 0x004D, 0x0307,
+ /* 1037 */ 0x006D, 0x0307,
+ /* 1039 */ 0x004D, 0x0323,
+ /* 1041 */ 0x006D, 0x0323,
+ /* 1043 */ 0x004E, 0x0307,
+ /* 1045 */ 0x006E, 0x0307,
+ /* 1047 */ 0x004E, 0x0323,
+ /* 1049 */ 0x006E, 0x0323,
+ /* 1051 */ 0x004E, 0x0331,
+ /* 1053 */ 0x006E, 0x0331,
+ /* 1055 */ 0x004E, 0x032D,
+ /* 1057 */ 0x006E, 0x032D,
+ /* 1059 */ 0x00D5, 0x0301,
+ /* 1061 */ 0x00F5, 0x0301,
+ /* 1063 */ 0x00D5, 0x0308,
+ /* 1065 */ 0x00F5, 0x0308,
+ /* 1067 */ 0x014C, 0x0300,
+ /* 1069 */ 0x014D, 0x0300,
+ /* 1071 */ 0x014C, 0x0301,
+ /* 1073 */ 0x014D, 0x0301,
+ /* 1075 */ 0x0050, 0x0301,
+ /* 1077 */ 0x0070, 0x0301,
+ /* 1079 */ 0x0050, 0x0307,
+ /* 1081 */ 0x0070, 0x0307,
+ /* 1083 */ 0x0052, 0x0307,
+ /* 1085 */ 0x0072, 0x0307,
+ /* 1087 */ 0x0052, 0x0323,
+ /* 1089 */ 0x0072, 0x0323,
+ /* 1091 */ 0x1E5A, 0x0304,
+ /* 1093 */ 0x1E5B, 0x0304,
+ /* 1095 */ 0x0052, 0x0331,
+ /* 1097 */ 0x0072, 0x0331,
+ /* 1099 */ 0x0053, 0x0307,
+ /* 1101 */ 0x0073, 0x0307,
+ /* 1103 */ 0x0053, 0x0323,
+ /* 1105 */ 0x0073, 0x0323,
+ /* 1107 */ 0x015A, 0x0307,
+ /* 1109 */ 0x015B, 0x0307,
+ /* 1111 */ 0x0160, 0x0307,
+ /* 1113 */ 0x0161, 0x0307,
+ /* 1115 */ 0x1E62, 0x0307,
+ /* 1117 */ 0x1E63, 0x0307,
+ /* 1119 */ 0x0054, 0x0307,
+ /* 1121 */ 0x0074, 0x0307,
+ /* 1123 */ 0x0054, 0x0323,
+ /* 1125 */ 0x0074, 0x0323,
+ /* 1127 */ 0x0054, 0x0331,
+ /* 1129 */ 0x0074, 0x0331,
+ /* 1131 */ 0x0054, 0x032D,
+ /* 1133 */ 0x0074, 0x032D,
+ /* 1135 */ 0x0055, 0x0324,
+ /* 1137 */ 0x0075, 0x0324,
+ /* 1139 */ 0x0055, 0x0330,
+ /* 1141 */ 0x0075, 0x0330,
+ /* 1143 */ 0x0055, 0x032D,
+ /* 1145 */ 0x0075, 0x032D,
+ /* 1147 */ 0x0168, 0x0301,
+ /* 1149 */ 0x0169, 0x0301,
+ /* 1151 */ 0x016A, 0x0308,
+ /* 1153 */ 0x016B, 0x0308,
+ /* 1155 */ 0x0056, 0x0303,
+ /* 1157 */ 0x0076, 0x0303,
+ /* 1159 */ 0x0056, 0x0323,
+ /* 1161 */ 0x0076, 0x0323,
+ /* 1163 */ 0x0057, 0x0300,
+ /* 1165 */ 0x0077, 0x0300,
+ /* 1167 */ 0x0057, 0x0301,
+ /* 1169 */ 0x0077, 0x0301,
+ /* 1171 */ 0x0057, 0x0308,
+ /* 1173 */ 0x0077, 0x0308,
+ /* 1175 */ 0x0057, 0x0307,
+ /* 1177 */ 0x0077, 0x0307,
+ /* 1179 */ 0x0057, 0x0323,
+ /* 1181 */ 0x0077, 0x0323,
+ /* 1183 */ 0x0058, 0x0307,
+ /* 1185 */ 0x0078, 0x0307,
+ /* 1187 */ 0x0058, 0x0308,
+ /* 1189 */ 0x0078, 0x0308,
+ /* 1191 */ 0x0059, 0x0307,
+ /* 1193 */ 0x0079, 0x0307,
+ /* 1195 */ 0x005A, 0x0302,
+ /* 1197 */ 0x007A, 0x0302,
+ /* 1199 */ 0x005A, 0x0323,
+ /* 1201 */ 0x007A, 0x0323,
+ /* 1203 */ 0x005A, 0x0331,
+ /* 1205 */ 0x007A, 0x0331,
+ /* 1207 */ 0x0068, 0x0331,
+ /* 1209 */ 0x0074, 0x0308,
+ /* 1211 */ 0x0077, 0x030A,
+ /* 1213 */ 0x0079, 0x030A,
+ /* 1215 */ 0x0061, 0x02BE,
+ /* 1217 */ 0x017F, 0x0307,
+ /* 1219 */ 0x0041, 0x0323,
+ /* 1221 */ 0x0061, 0x0323,
+ /* 1223 */ 0x0041, 0x0309,
+ /* 1225 */ 0x0061, 0x0309,
+ /* 1227 */ 0x00C2, 0x0301,
+ /* 1229 */ 0x00E2, 0x0301,
+ /* 1231 */ 0x00C2, 0x0300,
+ /* 1233 */ 0x00E2, 0x0300,
+ /* 1235 */ 0x00C2, 0x0309,
+ /* 1237 */ 0x00E2, 0x0309,
+ /* 1239 */ 0x00C2, 0x0303,
+ /* 1241 */ 0x00E2, 0x0303,
+ /* 1243 */ 0x1EA0, 0x0302,
+ /* 1245 */ 0x1EA1, 0x0302,
+ /* 1247 */ 0x0102, 0x0301,
+ /* 1249 */ 0x0103, 0x0301,
+ /* 1251 */ 0x0102, 0x0300,
+ /* 1253 */ 0x0103, 0x0300,
+ /* 1255 */ 0x0102, 0x0309,
+ /* 1257 */ 0x0103, 0x0309,
+ /* 1259 */ 0x0102, 0x0303,
+ /* 1261 */ 0x0103, 0x0303,
+ /* 1263 */ 0x1EA0, 0x0306,
+ /* 1265 */ 0x1EA1, 0x0306,
+ /* 1267 */ 0x0045, 0x0323,
+ /* 1269 */ 0x0065, 0x0323,
+ /* 1271 */ 0x0045, 0x0309,
+ /* 1273 */ 0x0065, 0x0309,
+ /* 1275 */ 0x0045, 0x0303,
+ /* 1277 */ 0x0065, 0x0303,
+ /* 1279 */ 0x00CA, 0x0301,
+ /* 1281 */ 0x00EA, 0x0301,
+ /* 1283 */ 0x00CA, 0x0300,
+ /* 1285 */ 0x00EA, 0x0300,
+ /* 1287 */ 0x00CA, 0x0309,
+ /* 1289 */ 0x00EA, 0x0309,
+ /* 1291 */ 0x00CA, 0x0303,
+ /* 1293 */ 0x00EA, 0x0303,
+ /* 1295 */ 0x1EB8, 0x0302,
+ /* 1297 */ 0x1EB9, 0x0302,
+ /* 1299 */ 0x0049, 0x0309,
+ /* 1301 */ 0x0069, 0x0309,
+ /* 1303 */ 0x0049, 0x0323,
+ /* 1305 */ 0x0069, 0x0323,
+ /* 1307 */ 0x004F, 0x0323,
+ /* 1309 */ 0x006F, 0x0323,
+ /* 1311 */ 0x004F, 0x0309,
+ /* 1313 */ 0x006F, 0x0309,
+ /* 1315 */ 0x00D4, 0x0301,
+ /* 1317 */ 0x00F4, 0x0301,
+ /* 1319 */ 0x00D4, 0x0300,
+ /* 1321 */ 0x00F4, 0x0300,
+ /* 1323 */ 0x00D4, 0x0309,
+ /* 1325 */ 0x00F4, 0x0309,
+ /* 1327 */ 0x00D4, 0x0303,
+ /* 1329 */ 0x00F4, 0x0303,
+ /* 1331 */ 0x1ECC, 0x0302,
+ /* 1333 */ 0x1ECD, 0x0302,
+ /* 1335 */ 0x01A0, 0x0301,
+ /* 1337 */ 0x01A1, 0x0301,
+ /* 1339 */ 0x01A0, 0x0300,
+ /* 1341 */ 0x01A1, 0x0300,
+ /* 1343 */ 0x01A0, 0x0309,
+ /* 1345 */ 0x01A1, 0x0309,
+ /* 1347 */ 0x01A0, 0x0303,
+ /* 1349 */ 0x01A1, 0x0303,
+ /* 1351 */ 0x01A0, 0x0323,
+ /* 1353 */ 0x01A1, 0x0323,
+ /* 1355 */ 0x0055, 0x0323,
+ /* 1357 */ 0x0075, 0x0323,
+ /* 1359 */ 0x0055, 0x0309,
+ /* 1361 */ 0x0075, 0x0309,
+ /* 1363 */ 0x01AF, 0x0301,
+ /* 1365 */ 0x01B0, 0x0301,
+ /* 1367 */ 0x01AF, 0x0300,
+ /* 1369 */ 0x01B0, 0x0300,
+ /* 1371 */ 0x01AF, 0x0309,
+ /* 1373 */ 0x01B0, 0x0309,
+ /* 1375 */ 0x01AF, 0x0303,
+ /* 1377 */ 0x01B0, 0x0303,
+ /* 1379 */ 0x01AF, 0x0323,
+ /* 1381 */ 0x01B0, 0x0323,
+ /* 1383 */ 0x0059, 0x0300,
+ /* 1385 */ 0x0079, 0x0300,
+ /* 1387 */ 0x0059, 0x0323,
+ /* 1389 */ 0x0079, 0x0323,
+ /* 1391 */ 0x0059, 0x0309,
+ /* 1393 */ 0x0079, 0x0309,
+ /* 1395 */ 0x0059, 0x0303,
+ /* 1397 */ 0x0079, 0x0303,
+ /* 1399 */ 0x03B1, 0x0313,
+ /* 1401 */ 0x03B1, 0x0314,
+ /* 1403 */ 0x1F00, 0x0300,
+ /* 1405 */ 0x1F01, 0x0300,
+ /* 1407 */ 0x1F00, 0x0301,
+ /* 1409 */ 0x1F01, 0x0301,
+ /* 1411 */ 0x1F00, 0x0342,
+ /* 1413 */ 0x1F01, 0x0342,
+ /* 1415 */ 0x0391, 0x0313,
+ /* 1417 */ 0x0391, 0x0314,
+ /* 1419 */ 0x1F08, 0x0300,
+ /* 1421 */ 0x1F09, 0x0300,
+ /* 1423 */ 0x1F08, 0x0301,
+ /* 1425 */ 0x1F09, 0x0301,
+ /* 1427 */ 0x1F08, 0x0342,
+ /* 1429 */ 0x1F09, 0x0342,
+ /* 1431 */ 0x03B5, 0x0313,
+ /* 1433 */ 0x03B5, 0x0314,
+ /* 1435 */ 0x1F10, 0x0300,
+ /* 1437 */ 0x1F11, 0x0300,
+ /* 1439 */ 0x1F10, 0x0301,
+ /* 1441 */ 0x1F11, 0x0301,
+ /* 1443 */ 0x0395, 0x0313,
+ /* 1445 */ 0x0395, 0x0314,
+ /* 1447 */ 0x1F18, 0x0300,
+ /* 1449 */ 0x1F19, 0x0300,
+ /* 1451 */ 0x1F18, 0x0301,
+ /* 1453 */ 0x1F19, 0x0301,
+ /* 1455 */ 0x03B7, 0x0313,
+ /* 1457 */ 0x03B7, 0x0314,
+ /* 1459 */ 0x1F20, 0x0300,
+ /* 1461 */ 0x1F21, 0x0300,
+ /* 1463 */ 0x1F20, 0x0301,
+ /* 1465 */ 0x1F21, 0x0301,
+ /* 1467 */ 0x1F20, 0x0342,
+ /* 1469 */ 0x1F21, 0x0342,
+ /* 1471 */ 0x0397, 0x0313,
+ /* 1473 */ 0x0397, 0x0314,
+ /* 1475 */ 0x1F28, 0x0300,
+ /* 1477 */ 0x1F29, 0x0300,
+ /* 1479 */ 0x1F28, 0x0301,
+ /* 1481 */ 0x1F29, 0x0301,
+ /* 1483 */ 0x1F28, 0x0342,
+ /* 1485 */ 0x1F29, 0x0342,
+ /* 1487 */ 0x03B9, 0x0313,
+ /* 1489 */ 0x03B9, 0x0314,
+ /* 1491 */ 0x1F30, 0x0300,
+ /* 1493 */ 0x1F31, 0x0300,
+ /* 1495 */ 0x1F30, 0x0301,
+ /* 1497 */ 0x1F31, 0x0301,
+ /* 1499 */ 0x1F30, 0x0342,
+ /* 1501 */ 0x1F31, 0x0342,
+ /* 1503 */ 0x0399, 0x0313,
+ /* 1505 */ 0x0399, 0x0314,
+ /* 1507 */ 0x1F38, 0x0300,
+ /* 1509 */ 0x1F39, 0x0300,
+ /* 1511 */ 0x1F38, 0x0301,
+ /* 1513 */ 0x1F39, 0x0301,
+ /* 1515 */ 0x1F38, 0x0342,
+ /* 1517 */ 0x1F39, 0x0342,
+ /* 1519 */ 0x03BF, 0x0313,
+ /* 1521 */ 0x03BF, 0x0314,
+ /* 1523 */ 0x1F40, 0x0300,
+ /* 1525 */ 0x1F41, 0x0300,
+ /* 1527 */ 0x1F40, 0x0301,
+ /* 1529 */ 0x1F41, 0x0301,
+ /* 1531 */ 0x039F, 0x0313,
+ /* 1533 */ 0x039F, 0x0314,
+ /* 1535 */ 0x1F48, 0x0300,
+ /* 1537 */ 0x1F49, 0x0300,
+ /* 1539 */ 0x1F48, 0x0301,
+ /* 1541 */ 0x1F49, 0x0301,
+ /* 1543 */ 0x03C5, 0x0313,
+ /* 1545 */ 0x03C5, 0x0314,
+ /* 1547 */ 0x1F50, 0x0300,
+ /* 1549 */ 0x1F51, 0x0300,
+ /* 1551 */ 0x1F50, 0x0301,
+ /* 1553 */ 0x1F51, 0x0301,
+ /* 1555 */ 0x1F50, 0x0342,
+ /* 1557 */ 0x1F51, 0x0342,
+ /* 1559 */ 0x03A5, 0x0314,
+ /* 1561 */ 0x1F59, 0x0300,
+ /* 1563 */ 0x1F59, 0x0301,
+ /* 1565 */ 0x1F59, 0x0342,
+ /* 1567 */ 0x03C9, 0x0313,
+ /* 1569 */ 0x03C9, 0x0314,
+ /* 1571 */ 0x1F60, 0x0300,
+ /* 1573 */ 0x1F61, 0x0300,
+ /* 1575 */ 0x1F60, 0x0301,
+ /* 1577 */ 0x1F61, 0x0301,
+ /* 1579 */ 0x1F60, 0x0342,
+ /* 1581 */ 0x1F61, 0x0342,
+ /* 1583 */ 0x03A9, 0x0313,
+ /* 1585 */ 0x03A9, 0x0314,
+ /* 1587 */ 0x1F68, 0x0300,
+ /* 1589 */ 0x1F69, 0x0300,
+ /* 1591 */ 0x1F68, 0x0301,
+ /* 1593 */ 0x1F69, 0x0301,
+ /* 1595 */ 0x1F68, 0x0342,
+ /* 1597 */ 0x1F69, 0x0342,
+ /* 1599 */ 0x03B1, 0x0300,
+ /* 1601 */ 0x03B5, 0x0300,
+ /* 1603 */ 0x03B7, 0x0300,
+ /* 1605 */ 0x03B9, 0x0300,
+ /* 1607 */ 0x03BF, 0x0300,
+ /* 1609 */ 0x03C5, 0x0300,
+ /* 1611 */ 0x03C9, 0x0300,
+ /* 1613 */ 0x1F00, 0x0345,
+ /* 1615 */ 0x1F01, 0x0345,
+ /* 1617 */ 0x1F02, 0x0345,
+ /* 1619 */ 0x1F03, 0x0345,
+ /* 1621 */ 0x1F04, 0x0345,
+ /* 1623 */ 0x1F05, 0x0345,
+ /* 1625 */ 0x1F06, 0x0345,
+ /* 1627 */ 0x1F07, 0x0345,
+ /* 1629 */ 0x1F08, 0x0345,
+ /* 1631 */ 0x1F09, 0x0345,
+ /* 1633 */ 0x1F0A, 0x0345,
+ /* 1635 */ 0x1F0B, 0x0345,
+ /* 1637 */ 0x1F0C, 0x0345,
+ /* 1639 */ 0x1F0D, 0x0345,
+ /* 1641 */ 0x1F0E, 0x0345,
+ /* 1643 */ 0x1F0F, 0x0345,
+ /* 1645 */ 0x1F20, 0x0345,
+ /* 1647 */ 0x1F21, 0x0345,
+ /* 1649 */ 0x1F22, 0x0345,
+ /* 1651 */ 0x1F23, 0x0345,
+ /* 1653 */ 0x1F24, 0x0345,
+ /* 1655 */ 0x1F25, 0x0345,
+ /* 1657 */ 0x1F26, 0x0345,
+ /* 1659 */ 0x1F27, 0x0345,
+ /* 1661 */ 0x1F28, 0x0345,
+ /* 1663 */ 0x1F29, 0x0345,
+ /* 1665 */ 0x1F2A, 0x0345,
+ /* 1667 */ 0x1F2B, 0x0345,
+ /* 1669 */ 0x1F2C, 0x0345,
+ /* 1671 */ 0x1F2D, 0x0345,
+ /* 1673 */ 0x1F2E, 0x0345,
+ /* 1675 */ 0x1F2F, 0x0345,
+ /* 1677 */ 0x1F60, 0x0345,
+ /* 1679 */ 0x1F61, 0x0345,
+ /* 1681 */ 0x1F62, 0x0345,
+ /* 1683 */ 0x1F63, 0x0345,
+ /* 1685 */ 0x1F64, 0x0345,
+ /* 1687 */ 0x1F65, 0x0345,
+ /* 1689 */ 0x1F66, 0x0345,
+ /* 1691 */ 0x1F67, 0x0345,
+ /* 1693 */ 0x1F68, 0x0345,
+ /* 1695 */ 0x1F69, 0x0345,
+ /* 1697 */ 0x1F6A, 0x0345,
+ /* 1699 */ 0x1F6B, 0x0345,
+ /* 1701 */ 0x1F6C, 0x0345,
+ /* 1703 */ 0x1F6D, 0x0345,
+ /* 1705 */ 0x1F6E, 0x0345,
+ /* 1707 */ 0x1F6F, 0x0345,
+ /* 1709 */ 0x03B1, 0x0306,
+ /* 1711 */ 0x03B1, 0x0304,
+ /* 1713 */ 0x1F70, 0x0345,
+ /* 1715 */ 0x03B1, 0x0345,
+ /* 1717 */ 0x03AC, 0x0345,
+ /* 1719 */ 0x03B1, 0x0342,
+ /* 1721 */ 0x1FB6, 0x0345,
+ /* 1723 */ 0x0391, 0x0306,
+ /* 1725 */ 0x0391, 0x0304,
+ /* 1727 */ 0x0391, 0x0300,
+ /* 1729 */ 0x0391, 0x0345,
+ /* 1731 */ 0x0020, 0x0313,
+ /* 1733 */ 0x0020, 0x0313,
+ /* 1735 */ 0x0020, 0x0342,
+ /* 1737 */ 0x00A8, 0x0342,
+ /* 1739 */ 0x1F74, 0x0345,
+ /* 1741 */ 0x03B7, 0x0345,
+ /* 1743 */ 0x03AE, 0x0345,
+ /* 1745 */ 0x03B7, 0x0342,
+ /* 1747 */ 0x1FC6, 0x0345,
+ /* 1749 */ 0x0395, 0x0300,
+ /* 1751 */ 0x0397, 0x0300,
+ /* 1753 */ 0x0397, 0x0345,
+ /* 1755 */ 0x1FBF, 0x0300,
+ /* 1757 */ 0x1FBF, 0x0301,
+ /* 1759 */ 0x1FBF, 0x0342,
+ /* 1761 */ 0x03B9, 0x0306,
+ /* 1763 */ 0x03B9, 0x0304,
+ /* 1765 */ 0x03CA, 0x0300,
+ /* 1767 */ 0x03B9, 0x0342,
+ /* 1769 */ 0x03CA, 0x0342,
+ /* 1771 */ 0x0399, 0x0306,
+ /* 1773 */ 0x0399, 0x0304,
+ /* 1775 */ 0x0399, 0x0300,
+ /* 1777 */ 0x1FFE, 0x0300,
+ /* 1779 */ 0x1FFE, 0x0301,
+ /* 1781 */ 0x1FFE, 0x0342,
+ /* 1783 */ 0x03C5, 0x0306,
+ /* 1785 */ 0x03C5, 0x0304,
+ /* 1787 */ 0x03CB, 0x0300,
+ /* 1789 */ 0x03C1, 0x0313,
+ /* 1791 */ 0x03C1, 0x0314,
+ /* 1793 */ 0x03C5, 0x0342,
+ /* 1795 */ 0x03CB, 0x0342,
+ /* 1797 */ 0x03A5, 0x0306,
+ /* 1799 */ 0x03A5, 0x0304,
+ /* 1801 */ 0x03A5, 0x0300,
+ /* 1803 */ 0x03A1, 0x0314,
+ /* 1805 */ 0x00A8, 0x0300,
+ /* 1807 */ 0x1F7C, 0x0345,
+ /* 1809 */ 0x03C9, 0x0345,
+ /* 1811 */ 0x03CE, 0x0345,
+ /* 1813 */ 0x03C9, 0x0342,
+ /* 1815 */ 0x1FF6, 0x0345,
+ /* 1817 */ 0x039F, 0x0300,
+ /* 1819 */ 0x03A9, 0x0300,
+ /* 1821 */ 0x03A9, 0x0345,
+ /* 1823 */ 0x0020, 0x0314,
+ /* 1825 */ 0x0020, 0x0333,
+ /* 1827 */ 0x002E, 0x002E,
+ /* 1829 */ 0x002E, 0x002E, 0x002E,
+ /* 1832 */ 0x2032, 0x2032,
+ /* 1834 */ 0x2032, 0x2032, 0x2032,
+ /* 1837 */ 0x2035, 0x2035,
+ /* 1839 */ 0x2035, 0x2035, 0x2035,
+ /* 1842 */ 0x0021, 0x0021,
+ /* 1844 */ 0x0020, 0x0305,
+ /* 1846 */ 0x003F, 0x003F,
+ /* 1848 */ 0x003F, 0x0021,
+ /* 1850 */ 0x0021, 0x003F,
+ /* 1852 */ 0x2032, 0x2032, 0x2032, 0x2032,
+ /* 1856 */ 0x0052, 0x0073,
+ /* 1858 */ 0x0061, 0x002F, 0x0063,
+ /* 1861 */ 0x0061, 0x002F, 0x0073,
+ /* 1864 */ 0x00B0, 0x0043,
+ /* 1866 */ 0x0063, 0x002F, 0x006F,
+ /* 1869 */ 0x0063, 0x002F, 0x0075,
+ /* 1872 */ 0x00B0, 0x0046,
+ /* 1874 */ 0x004E, 0x006F,
+ /* 1876 */ 0x0053, 0x004D,
+ /* 1878 */ 0x0054, 0x0045, 0x004C,
+ /* 1881 */ 0x0054, 0x004D,
+ /* 1883 */ 0x0046, 0x0041, 0x0058,
+ /* 1886 */ 0x0031, 0x2044, 0x0037,
+ /* 1889 */ 0x0031, 0x2044, 0x0039,
+ /* 1892 */ 0x0031, 0x2044, 0x0031, 0x0030,
+ /* 1896 */ 0x0031, 0x2044, 0x0033,
+ /* 1899 */ 0x0032, 0x2044, 0x0033,
+ /* 1902 */ 0x0031, 0x2044, 0x0035,
+ /* 1905 */ 0x0032, 0x2044, 0x0035,
+ /* 1908 */ 0x0033, 0x2044, 0x0035,
+ /* 1911 */ 0x0034, 0x2044, 0x0035,
+ /* 1914 */ 0x0031, 0x2044, 0x0036,
+ /* 1917 */ 0x0035, 0x2044, 0x0036,
+ /* 1920 */ 0x0031, 0x2044, 0x0038,
+ /* 1923 */ 0x0033, 0x2044, 0x0038,
+ /* 1926 */ 0x0035, 0x2044, 0x0038,
+ /* 1929 */ 0x0037, 0x2044, 0x0038,
+ /* 1932 */ 0x0031, 0x2044,
+ /* 1934 */ 0x0049, 0x0049,
+ /* 1936 */ 0x0049, 0x0049, 0x0049,
+ /* 1939 */ 0x0049, 0x0056,
+ /* 1941 */ 0x0056, 0x0049,
+ /* 1943 */ 0x0056, 0x0049, 0x0049,
+ /* 1946 */ 0x0056, 0x0049, 0x0049, 0x0049,
+ /* 1950 */ 0x0049, 0x0058,
+ /* 1952 */ 0x0058, 0x0049,
+ /* 1954 */ 0x0058, 0x0049, 0x0049,
+ /* 1957 */ 0x0069, 0x0069,
+ /* 1959 */ 0x0069, 0x0069, 0x0069,
+ /* 1962 */ 0x0069, 0x0076,
+ /* 1964 */ 0x0076, 0x0069,
+ /* 1966 */ 0x0076, 0x0069, 0x0069,
+ /* 1969 */ 0x0076, 0x0069, 0x0069, 0x0069,
+ /* 1973 */ 0x0069, 0x0078,
+ /* 1975 */ 0x0078, 0x0069,
+ /* 1977 */ 0x0078, 0x0069, 0x0069,
+ /* 1980 */ 0x0030, 0x2044, 0x0033,
+ /* 1983 */ 0x2190, 0x0338,
+ /* 1985 */ 0x2192, 0x0338,
+ /* 1987 */ 0x2194, 0x0338,
+ /* 1989 */ 0x21D0, 0x0338,
+ /* 1991 */ 0x21D4, 0x0338,
+ /* 1993 */ 0x21D2, 0x0338,
+ /* 1995 */ 0x2203, 0x0338,
+ /* 1997 */ 0x2208, 0x0338,
+ /* 1999 */ 0x220B, 0x0338,
+ /* 2001 */ 0x2223, 0x0338,
+ /* 2003 */ 0x2225, 0x0338,
+ /* 2005 */ 0x222B, 0x222B,
+ /* 2007 */ 0x222B, 0x222B, 0x222B,
+ /* 2010 */ 0x222E, 0x222E,
+ /* 2012 */ 0x222E, 0x222E, 0x222E,
+ /* 2015 */ 0x223C, 0x0338,
+ /* 2017 */ 0x2243, 0x0338,
+ /* 2019 */ 0x2245, 0x0338,
+ /* 2021 */ 0x2248, 0x0338,
+ /* 2023 */ 0x003D, 0x0338,
+ /* 2025 */ 0x2261, 0x0338,
+ /* 2027 */ 0x224D, 0x0338,
+ /* 2029 */ 0x003C, 0x0338,
+ /* 2031 */ 0x003E, 0x0338,
+ /* 2033 */ 0x2264, 0x0338,
+ /* 2035 */ 0x2265, 0x0338,
+ /* 2037 */ 0x2272, 0x0338,
+ /* 2039 */ 0x2273, 0x0338,
+ /* 2041 */ 0x2276, 0x0338,
+ /* 2043 */ 0x2277, 0x0338,
+ /* 2045 */ 0x227A, 0x0338,
+ /* 2047 */ 0x227B, 0x0338,
+ /* 2049 */ 0x2282, 0x0338,
+ /* 2051 */ 0x2283, 0x0338,
+ /* 2053 */ 0x2286, 0x0338,
+ /* 2055 */ 0x2287, 0x0338,
+ /* 2057 */ 0x22A2, 0x0338,
+ /* 2059 */ 0x22A8, 0x0338,
+ /* 2061 */ 0x22A9, 0x0338,
+ /* 2063 */ 0x22AB, 0x0338,
+ /* 2065 */ 0x227C, 0x0338,
+ /* 2067 */ 0x227D, 0x0338,
+ /* 2069 */ 0x2291, 0x0338,
+ /* 2071 */ 0x2292, 0x0338,
+ /* 2073 */ 0x22B2, 0x0338,
+ /* 2075 */ 0x22B3, 0x0338,
+ /* 2077 */ 0x22B4, 0x0338,
+ /* 2079 */ 0x22B5, 0x0338,
+ /* 2081 */ 0x0031, 0x0030,
+ /* 2083 */ 0x0031, 0x0031,
+ /* 2085 */ 0x0031, 0x0032,
+ /* 2087 */ 0x0031, 0x0033,
+ /* 2089 */ 0x0031, 0x0034,
+ /* 2091 */ 0x0031, 0x0035,
+ /* 2093 */ 0x0031, 0x0036,
+ /* 2095 */ 0x0031, 0x0037,
+ /* 2097 */ 0x0031, 0x0038,
+ /* 2099 */ 0x0031, 0x0039,
+ /* 2101 */ 0x0032, 0x0030,
+ /* 2103 */ 0x0028, 0x0031, 0x0029,
+ /* 2106 */ 0x0028, 0x0032, 0x0029,
+ /* 2109 */ 0x0028, 0x0033, 0x0029,
+ /* 2112 */ 0x0028, 0x0034, 0x0029,
+ /* 2115 */ 0x0028, 0x0035, 0x0029,
+ /* 2118 */ 0x0028, 0x0036, 0x0029,
+ /* 2121 */ 0x0028, 0x0037, 0x0029,
+ /* 2124 */ 0x0028, 0x0038, 0x0029,
+ /* 2127 */ 0x0028, 0x0039, 0x0029,
+ /* 2130 */ 0x0028, 0x0031, 0x0030, 0x0029,
+ /* 2134 */ 0x0028, 0x0031, 0x0031, 0x0029,
+ /* 2138 */ 0x0028, 0x0031, 0x0032, 0x0029,
+ /* 2142 */ 0x0028, 0x0031, 0x0033, 0x0029,
+ /* 2146 */ 0x0028, 0x0031, 0x0034, 0x0029,
+ /* 2150 */ 0x0028, 0x0031, 0x0035, 0x0029,
+ /* 2154 */ 0x0028, 0x0031, 0x0036, 0x0029,
+ /* 2158 */ 0x0028, 0x0031, 0x0037, 0x0029,
+ /* 2162 */ 0x0028, 0x0031, 0x0038, 0x0029,
+ /* 2166 */ 0x0028, 0x0031, 0x0039, 0x0029,
+ /* 2170 */ 0x0028, 0x0032, 0x0030, 0x0029,
+ /* 2174 */ 0x0031, 0x002E,
+ /* 2176 */ 0x0032, 0x002E,
+ /* 2178 */ 0x0033, 0x002E,
+ /* 2180 */ 0x0034, 0x002E,
+ /* 2182 */ 0x0035, 0x002E,
+ /* 2184 */ 0x0036, 0x002E,
+ /* 2186 */ 0x0037, 0x002E,
+ /* 2188 */ 0x0038, 0x002E,
+ /* 2190 */ 0x0039, 0x002E,
+ /* 2192 */ 0x0031, 0x0030, 0x002E,
+ /* 2195 */ 0x0031, 0x0031, 0x002E,
+ /* 2198 */ 0x0031, 0x0032, 0x002E,
+ /* 2201 */ 0x0031, 0x0033, 0x002E,
+ /* 2204 */ 0x0031, 0x0034, 0x002E,
+ /* 2207 */ 0x0031, 0x0035, 0x002E,
+ /* 2210 */ 0x0031, 0x0036, 0x002E,
+ /* 2213 */ 0x0031, 0x0037, 0x002E,
+ /* 2216 */ 0x0031, 0x0038, 0x002E,
+ /* 2219 */ 0x0031, 0x0039, 0x002E,
+ /* 2222 */ 0x0032, 0x0030, 0x002E,
+ /* 2225 */ 0x0028, 0x0061, 0x0029,
+ /* 2228 */ 0x0028, 0x0062, 0x0029,
+ /* 2231 */ 0x0028, 0x0063, 0x0029,
+ /* 2234 */ 0x0028, 0x0064, 0x0029,
+ /* 2237 */ 0x0028, 0x0065, 0x0029,
+ /* 2240 */ 0x0028, 0x0066, 0x0029,
+ /* 2243 */ 0x0028, 0x0067, 0x0029,
+ /* 2246 */ 0x0028, 0x0068, 0x0029,
+ /* 2249 */ 0x0028, 0x0069, 0x0029,
+ /* 2252 */ 0x0028, 0x006A, 0x0029,
+ /* 2255 */ 0x0028, 0x006B, 0x0029,
+ /* 2258 */ 0x0028, 0x006C, 0x0029,
+ /* 2261 */ 0x0028, 0x006D, 0x0029,
+ /* 2264 */ 0x0028, 0x006E, 0x0029,
+ /* 2267 */ 0x0028, 0x006F, 0x0029,
+ /* 2270 */ 0x0028, 0x0070, 0x0029,
+ /* 2273 */ 0x0028, 0x0071, 0x0029,
+ /* 2276 */ 0x0028, 0x0072, 0x0029,
+ /* 2279 */ 0x0028, 0x0073, 0x0029,
+ /* 2282 */ 0x0028, 0x0074, 0x0029,
+ /* 2285 */ 0x0028, 0x0075, 0x0029,
+ /* 2288 */ 0x0028, 0x0076, 0x0029,
+ /* 2291 */ 0x0028, 0x0077, 0x0029,
+ /* 2294 */ 0x0028, 0x0078, 0x0029,
+ /* 2297 */ 0x0028, 0x0079, 0x0029,
+ /* 2300 */ 0x0028, 0x007A, 0x0029,
+ /* 2303 */ 0x222B, 0x222B, 0x222B, 0x222B,
+ /* 2307 */ 0x003A, 0x003A, 0x003D,
+ /* 2310 */ 0x003D, 0x003D,
+ /* 2312 */ 0x003D, 0x003D, 0x003D,
+ /* 2315 */ 0x2ADD, 0x0338,
+ /* 2317 */ 0x304B, 0x3099,
+ /* 2319 */ 0x304D, 0x3099,
+ /* 2321 */ 0x304F, 0x3099,
+ /* 2323 */ 0x3051, 0x3099,
+ /* 2325 */ 0x3053, 0x3099,
+ /* 2327 */ 0x3055, 0x3099,
+ /* 2329 */ 0x3057, 0x3099,
+ /* 2331 */ 0x3059, 0x3099,
+ /* 2333 */ 0x305B, 0x3099,
+ /* 2335 */ 0x305D, 0x3099,
+ /* 2337 */ 0x305F, 0x3099,
+ /* 2339 */ 0x3061, 0x3099,
+ /* 2341 */ 0x3064, 0x3099,
+ /* 2343 */ 0x3066, 0x3099,
+ /* 2345 */ 0x3068, 0x3099,
+ /* 2347 */ 0x306F, 0x3099,
+ /* 2349 */ 0x306F, 0x309A,
+ /* 2351 */ 0x3072, 0x3099,
+ /* 2353 */ 0x3072, 0x309A,
+ /* 2355 */ 0x3075, 0x3099,
+ /* 2357 */ 0x3075, 0x309A,
+ /* 2359 */ 0x3078, 0x3099,
+ /* 2361 */ 0x3078, 0x309A,
+ /* 2363 */ 0x307B, 0x3099,
+ /* 2365 */ 0x307B, 0x309A,
+ /* 2367 */ 0x3046, 0x3099,
+ /* 2369 */ 0x0020, 0x3099,
+ /* 2371 */ 0x0020, 0x309A,
+ /* 2373 */ 0x309D, 0x3099,
+ /* 2375 */ 0x3088, 0x308A,
+ /* 2377 */ 0x30AB, 0x3099,
+ /* 2379 */ 0x30AD, 0x3099,
+ /* 2381 */ 0x30AF, 0x3099,
+ /* 2383 */ 0x30B1, 0x3099,
+ /* 2385 */ 0x30B3, 0x3099,
+ /* 2387 */ 0x30B5, 0x3099,
+ /* 2389 */ 0x30B7, 0x3099,
+ /* 2391 */ 0x30B9, 0x3099,
+ /* 2393 */ 0x30BB, 0x3099,
+ /* 2395 */ 0x30BD, 0x3099,
+ /* 2397 */ 0x30BF, 0x3099,
+ /* 2399 */ 0x30C1, 0x3099,
+ /* 2401 */ 0x30C4, 0x3099,
+ /* 2403 */ 0x30C6, 0x3099,
+ /* 2405 */ 0x30C8, 0x3099,
+ /* 2407 */ 0x30CF, 0x3099,
+ /* 2409 */ 0x30CF, 0x309A,
+ /* 2411 */ 0x30D2, 0x3099,
+ /* 2413 */ 0x30D2, 0x309A,
+ /* 2415 */ 0x30D5, 0x3099,
+ /* 2417 */ 0x30D5, 0x309A,
+ /* 2419 */ 0x30D8, 0x3099,
+ /* 2421 */ 0x30D8, 0x309A,
+ /* 2423 */ 0x30DB, 0x3099,
+ /* 2425 */ 0x30DB, 0x309A,
+ /* 2427 */ 0x30A6, 0x3099,
+ /* 2429 */ 0x30EF, 0x3099,
+ /* 2431 */ 0x30F0, 0x3099,
+ /* 2433 */ 0x30F1, 0x3099,
+ /* 2435 */ 0x30F2, 0x3099,
+ /* 2437 */ 0x30FD, 0x3099,
+ /* 2439 */ 0x30B3, 0x30C8,
+ /* 2441 */ 0x0028, 0x1100, 0x0029,
+ /* 2444 */ 0x0028, 0x1102, 0x0029,
+ /* 2447 */ 0x0028, 0x1103, 0x0029,
+ /* 2450 */ 0x0028, 0x1105, 0x0029,
+ /* 2453 */ 0x0028, 0x1106, 0x0029,
+ /* 2456 */ 0x0028, 0x1107, 0x0029,
+ /* 2459 */ 0x0028, 0x1109, 0x0029,
+ /* 2462 */ 0x0028, 0x110B, 0x0029,
+ /* 2465 */ 0x0028, 0x110C, 0x0029,
+ /* 2468 */ 0x0028, 0x110E, 0x0029,
+ /* 2471 */ 0x0028, 0x110F, 0x0029,
+ /* 2474 */ 0x0028, 0x1110, 0x0029,
+ /* 2477 */ 0x0028, 0x1111, 0x0029,
+ /* 2480 */ 0x0028, 0x1112, 0x0029,
+ /* 2483 */ 0x0028, 0x1100, 0x1161, 0x0029,
+ /* 2487 */ 0x0028, 0x1102, 0x1161, 0x0029,
+ /* 2491 */ 0x0028, 0x1103, 0x1161, 0x0029,
+ /* 2495 */ 0x0028, 0x1105, 0x1161, 0x0029,
+ /* 2499 */ 0x0028, 0x1106, 0x1161, 0x0029,
+ /* 2503 */ 0x0028, 0x1107, 0x1161, 0x0029,
+ /* 2507 */ 0x0028, 0x1109, 0x1161, 0x0029,
+ /* 2511 */ 0x0028, 0x110B, 0x1161, 0x0029,
+ /* 2515 */ 0x0028, 0x110C, 0x1161, 0x0029,
+ /* 2519 */ 0x0028, 0x110E, 0x1161, 0x0029,
+ /* 2523 */ 0x0028, 0x110F, 0x1161, 0x0029,
+ /* 2527 */ 0x0028, 0x1110, 0x1161, 0x0029,
+ /* 2531 */ 0x0028, 0x1111, 0x1161, 0x0029,
+ /* 2535 */ 0x0028, 0x1112, 0x1161, 0x0029,
+ /* 2539 */ 0x0028, 0x110C, 0x116E, 0x0029,
+ /* 2543 */ 0x0028, 0x110B, 0x1169, 0x110C, 0x1165, 0x11AB, 0x0029,
+ /* 2550 */ 0x0028, 0x110B, 0x1169, 0x1112, 0x116E, 0x0029,
+ /* 2556 */ 0x0028, 0x4E00, 0x0029,
+ /* 2559 */ 0x0028, 0x4E8C, 0x0029,
+ /* 2562 */ 0x0028, 0x4E09, 0x0029,
+ /* 2565 */ 0x0028, 0x56DB, 0x0029,
+ /* 2568 */ 0x0028, 0x4E94, 0x0029,
+ /* 2571 */ 0x0028, 0x516D, 0x0029,
+ /* 2574 */ 0x0028, 0x4E03, 0x0029,
+ /* 2577 */ 0x0028, 0x516B, 0x0029,
+ /* 2580 */ 0x0028, 0x4E5D, 0x0029,
+ /* 2583 */ 0x0028, 0x5341, 0x0029,
+ /* 2586 */ 0x0028, 0x6708, 0x0029,
+ /* 2589 */ 0x0028, 0x706B, 0x0029,
+ /* 2592 */ 0x0028, 0x6C34, 0x0029,
+ /* 2595 */ 0x0028, 0x6728, 0x0029,
+ /* 2598 */ 0x0028, 0x91D1, 0x0029,
+ /* 2601 */ 0x0028, 0x571F, 0x0029,
+ /* 2604 */ 0x0028, 0x65E5, 0x0029,
+ /* 2607 */ 0x0028, 0x682A, 0x0029,
+ /* 2610 */ 0x0028, 0x6709, 0x0029,
+ /* 2613 */ 0x0028, 0x793E, 0x0029,
+ /* 2616 */ 0x0028, 0x540D, 0x0029,
+ /* 2619 */ 0x0028, 0x7279, 0x0029,
+ /* 2622 */ 0x0028, 0x8CA1, 0x0029,
+ /* 2625 */ 0x0028, 0x795D, 0x0029,
+ /* 2628 */ 0x0028, 0x52B4, 0x0029,
+ /* 2631 */ 0x0028, 0x4EE3, 0x0029,
+ /* 2634 */ 0x0028, 0x547C, 0x0029,
+ /* 2637 */ 0x0028, 0x5B66, 0x0029,
+ /* 2640 */ 0x0028, 0x76E3, 0x0029,
+ /* 2643 */ 0x0028, 0x4F01, 0x0029,
+ /* 2646 */ 0x0028, 0x8CC7, 0x0029,
+ /* 2649 */ 0x0028, 0x5354, 0x0029,
+ /* 2652 */ 0x0028, 0x796D, 0x0029,
+ /* 2655 */ 0x0028, 0x4F11, 0x0029,
+ /* 2658 */ 0x0028, 0x81EA, 0x0029,
+ /* 2661 */ 0x0028, 0x81F3, 0x0029,
+ /* 2664 */ 0x0050, 0x0054, 0x0045,
+ /* 2667 */ 0x0032, 0x0031,
+ /* 2669 */ 0x0032, 0x0032,
+ /* 2671 */ 0x0032, 0x0033,
+ /* 2673 */ 0x0032, 0x0034,
+ /* 2675 */ 0x0032, 0x0035,
+ /* 2677 */ 0x0032, 0x0036,
+ /* 2679 */ 0x0032, 0x0037,
+ /* 2681 */ 0x0032, 0x0038,
+ /* 2683 */ 0x0032, 0x0039,
+ /* 2685 */ 0x0033, 0x0030,
+ /* 2687 */ 0x0033, 0x0031,
+ /* 2689 */ 0x0033, 0x0032,
+ /* 2691 */ 0x0033, 0x0033,
+ /* 2693 */ 0x0033, 0x0034,
+ /* 2695 */ 0x0033, 0x0035,
+ /* 2697 */ 0x1100, 0x1161,
+ /* 2699 */ 0x1102, 0x1161,
+ /* 2701 */ 0x1103, 0x1161,
+ /* 2703 */ 0x1105, 0x1161,
+ /* 2705 */ 0x1106, 0x1161,
+ /* 2707 */ 0x1107, 0x1161,
+ /* 2709 */ 0x1109, 0x1161,
+ /* 2711 */ 0x110B, 0x1161,
+ /* 2713 */ 0x110C, 0x1161,
+ /* 2715 */ 0x110E, 0x1161,
+ /* 2717 */ 0x110F, 0x1161,
+ /* 2719 */ 0x1110, 0x1161,
+ /* 2721 */ 0x1111, 0x1161,
+ /* 2723 */ 0x1112, 0x1161,
+ /* 2725 */ 0x110E, 0x1161, 0x11B7, 0x1100, 0x1169,
+ /* 2730 */ 0x110C, 0x116E, 0x110B, 0x1174,
+ /* 2734 */ 0x110B, 0x116E,
+ /* 2736 */ 0x0033, 0x0036,
+ /* 2738 */ 0x0033, 0x0037,
+ /* 2740 */ 0x0033, 0x0038,
+ /* 2742 */ 0x0033, 0x0039,
+ /* 2744 */ 0x0034, 0x0030,
+ /* 2746 */ 0x0034, 0x0031,
+ /* 2748 */ 0x0034, 0x0032,
+ /* 2750 */ 0x0034, 0x0033,
+ /* 2752 */ 0x0034, 0x0034,
+ /* 2754 */ 0x0034, 0x0035,
+ /* 2756 */ 0x0034, 0x0036,
+ /* 2758 */ 0x0034, 0x0037,
+ /* 2760 */ 0x0034, 0x0038,
+ /* 2762 */ 0x0034, 0x0039,
+ /* 2764 */ 0x0035, 0x0030,
+ /* 2766 */ 0x0031, 0x6708,
+ /* 2768 */ 0x0032, 0x6708,
+ /* 2770 */ 0x0033, 0x6708,
+ /* 2772 */ 0x0034, 0x6708,
+ /* 2774 */ 0x0035, 0x6708,
+ /* 2776 */ 0x0036, 0x6708,
+ /* 2778 */ 0x0037, 0x6708,
+ /* 2780 */ 0x0038, 0x6708,
+ /* 2782 */ 0x0039, 0x6708,
+ /* 2784 */ 0x0031, 0x0030, 0x6708,
+ /* 2787 */ 0x0031, 0x0031, 0x6708,
+ /* 2790 */ 0x0031, 0x0032, 0x6708,
+ /* 2793 */ 0x0048, 0x0067,
+ /* 2795 */ 0x0065, 0x0072, 0x0067,
+ /* 2798 */ 0x0065, 0x0056,
+ /* 2800 */ 0x004C, 0x0054, 0x0044,
+ /* 2803 */ 0x30A2, 0x30D1, 0x30FC, 0x30C8,
+ /* 2807 */ 0x30A2, 0x30EB, 0x30D5, 0x30A1,
+ /* 2811 */ 0x30A2, 0x30F3, 0x30DA, 0x30A2,
+ /* 2815 */ 0x30A2, 0x30FC, 0x30EB,
+ /* 2818 */ 0x30A4, 0x30CB, 0x30F3, 0x30B0,
+ /* 2822 */ 0x30A4, 0x30F3, 0x30C1,
+ /* 2825 */ 0x30A6, 0x30A9, 0x30F3,
+ /* 2828 */ 0x30A8, 0x30B9, 0x30AF, 0x30FC, 0x30C9,
+ /* 2833 */ 0x30A8, 0x30FC, 0x30AB, 0x30FC,
+ /* 2837 */ 0x30AA, 0x30F3, 0x30B9,
+ /* 2840 */ 0x30AA, 0x30FC, 0x30E0,
+ /* 2843 */ 0x30AB, 0x30A4, 0x30EA,
+ /* 2846 */ 0x30AB, 0x30E9, 0x30C3, 0x30C8,
+ /* 2850 */ 0x30AB, 0x30ED, 0x30EA, 0x30FC,
+ /* 2854 */ 0x30AC, 0x30ED, 0x30F3,
+ /* 2857 */ 0x30AC, 0x30F3, 0x30DE,
+ /* 2860 */ 0x30AE, 0x30AC,
+ /* 2862 */ 0x30AE, 0x30CB, 0x30FC,
+ /* 2865 */ 0x30AD, 0x30E5, 0x30EA, 0x30FC,
+ /* 2869 */ 0x30AE, 0x30EB, 0x30C0, 0x30FC,
+ /* 2873 */ 0x30AD, 0x30ED,
+ /* 2875 */ 0x30AD, 0x30ED, 0x30B0, 0x30E9, 0x30E0,
+ /* 2880 */ 0x30AD, 0x30ED, 0x30E1, 0x30FC, 0x30C8, 0x30EB,
+ /* 2886 */ 0x30AD, 0x30ED, 0x30EF, 0x30C3, 0x30C8,
+ /* 2891 */ 0x30B0, 0x30E9, 0x30E0,
+ /* 2894 */ 0x30B0, 0x30E9, 0x30E0, 0x30C8, 0x30F3,
+ /* 2899 */ 0x30AF, 0x30EB, 0x30BC, 0x30A4, 0x30ED,
+ /* 2904 */ 0x30AF, 0x30ED, 0x30FC, 0x30CD,
+ /* 2908 */ 0x30B1, 0x30FC, 0x30B9,
+ /* 2911 */ 0x30B3, 0x30EB, 0x30CA,
+ /* 2914 */ 0x30B3, 0x30FC, 0x30DD,
+ /* 2917 */ 0x30B5, 0x30A4, 0x30AF, 0x30EB,
+ /* 2921 */ 0x30B5, 0x30F3, 0x30C1, 0x30FC, 0x30E0,
+ /* 2926 */ 0x30B7, 0x30EA, 0x30F3, 0x30B0,
+ /* 2930 */ 0x30BB, 0x30F3, 0x30C1,
+ /* 2933 */ 0x30BB, 0x30F3, 0x30C8,
+ /* 2936 */ 0x30C0, 0x30FC, 0x30B9,
+ /* 2939 */ 0x30C7, 0x30B7,
+ /* 2941 */ 0x30C9, 0x30EB,
+ /* 2943 */ 0x30C8, 0x30F3,
+ /* 2945 */ 0x30CA, 0x30CE,
+ /* 2947 */ 0x30CE, 0x30C3, 0x30C8,
+ /* 2950 */ 0x30CF, 0x30A4, 0x30C4,
+ /* 2953 */ 0x30D1, 0x30FC, 0x30BB, 0x30F3, 0x30C8,
+ /* 2958 */ 0x30D1, 0x30FC, 0x30C4,
+ /* 2961 */ 0x30D0, 0x30FC, 0x30EC, 0x30EB,
+ /* 2965 */ 0x30D4, 0x30A2, 0x30B9, 0x30C8, 0x30EB,
+ /* 2970 */ 0x30D4, 0x30AF, 0x30EB,
+ /* 2973 */ 0x30D4, 0x30B3,
+ /* 2975 */ 0x30D3, 0x30EB,
+ /* 2977 */ 0x30D5, 0x30A1, 0x30E9, 0x30C3, 0x30C9,
+ /* 2982 */ 0x30D5, 0x30A3, 0x30FC, 0x30C8,
+ /* 2986 */ 0x30D6, 0x30C3, 0x30B7, 0x30A7, 0x30EB,
+ /* 2991 */ 0x30D5, 0x30E9, 0x30F3,
+ /* 2994 */ 0x30D8, 0x30AF, 0x30BF, 0x30FC, 0x30EB,
+ /* 2999 */ 0x30DA, 0x30BD,
+ /* 3001 */ 0x30DA, 0x30CB, 0x30D2,
+ /* 3004 */ 0x30D8, 0x30EB, 0x30C4,
+ /* 3007 */ 0x30DA, 0x30F3, 0x30B9,
+ /* 3010 */ 0x30DA, 0x30FC, 0x30B8,
+ /* 3013 */ 0x30D9, 0x30FC, 0x30BF,
+ /* 3016 */ 0x30DD, 0x30A4, 0x30F3, 0x30C8,
+ /* 3020 */ 0x30DC, 0x30EB, 0x30C8,
+ /* 3023 */ 0x30DB, 0x30F3,
+ /* 3025 */ 0x30DD, 0x30F3, 0x30C9,
+ /* 3028 */ 0x30DB, 0x30FC, 0x30EB,
+ /* 3031 */ 0x30DB, 0x30FC, 0x30F3,
+ /* 3034 */ 0x30DE, 0x30A4, 0x30AF, 0x30ED,
+ /* 3038 */ 0x30DE, 0x30A4, 0x30EB,
+ /* 3041 */ 0x30DE, 0x30C3, 0x30CF,
+ /* 3044 */ 0x30DE, 0x30EB, 0x30AF,
+ /* 3047 */ 0x30DE, 0x30F3, 0x30B7, 0x30E7, 0x30F3,
+ /* 3052 */ 0x30DF, 0x30AF, 0x30ED, 0x30F3,
+ /* 3056 */ 0x30DF, 0x30EA,
+ /* 3058 */ 0x30DF, 0x30EA, 0x30D0, 0x30FC, 0x30EB,
+ /* 3063 */ 0x30E1, 0x30AC,
+ /* 3065 */ 0x30E1, 0x30AC, 0x30C8, 0x30F3,
+ /* 3069 */ 0x30E1, 0x30FC, 0x30C8, 0x30EB,
+ /* 3073 */ 0x30E4, 0x30FC, 0x30C9,
+ /* 3076 */ 0x30E4, 0x30FC, 0x30EB,
+ /* 3079 */ 0x30E6, 0x30A2, 0x30F3,
+ /* 3082 */ 0x30EA, 0x30C3, 0x30C8, 0x30EB,
+ /* 3086 */ 0x30EA, 0x30E9,
+ /* 3088 */ 0x30EB, 0x30D4, 0x30FC,
+ /* 3091 */ 0x30EB, 0x30FC, 0x30D6, 0x30EB,
+ /* 3095 */ 0x30EC, 0x30E0,
+ /* 3097 */ 0x30EC, 0x30F3, 0x30C8, 0x30B2, 0x30F3,
+ /* 3102 */ 0x30EF, 0x30C3, 0x30C8,
+ /* 3105 */ 0x0030, 0x70B9,
+ /* 3107 */ 0x0031, 0x70B9,
+ /* 3109 */ 0x0032, 0x70B9,
+ /* 3111 */ 0x0033, 0x70B9,
+ /* 3113 */ 0x0034, 0x70B9,
+ /* 3115 */ 0x0035, 0x70B9,
+ /* 3117 */ 0x0036, 0x70B9,
+ /* 3119 */ 0x0037, 0x70B9,
+ /* 3121 */ 0x0038, 0x70B9,
+ /* 3123 */ 0x0039, 0x70B9,
+ /* 3125 */ 0x0031, 0x0030, 0x70B9,
+ /* 3128 */ 0x0031, 0x0031, 0x70B9,
+ /* 3131 */ 0x0031, 0x0032, 0x70B9,
+ /* 3134 */ 0x0031, 0x0033, 0x70B9,
+ /* 3137 */ 0x0031, 0x0034, 0x70B9,
+ /* 3140 */ 0x0031, 0x0035, 0x70B9,
+ /* 3143 */ 0x0031, 0x0036, 0x70B9,
+ /* 3146 */ 0x0031, 0x0037, 0x70B9,
+ /* 3149 */ 0x0031, 0x0038, 0x70B9,
+ /* 3152 */ 0x0031, 0x0039, 0x70B9,
+ /* 3155 */ 0x0032, 0x0030, 0x70B9,
+ /* 3158 */ 0x0032, 0x0031, 0x70B9,
+ /* 3161 */ 0x0032, 0x0032, 0x70B9,
+ /* 3164 */ 0x0032, 0x0033, 0x70B9,
+ /* 3167 */ 0x0032, 0x0034, 0x70B9,
+ /* 3170 */ 0x0068, 0x0050, 0x0061,
+ /* 3173 */ 0x0064, 0x0061,
+ /* 3175 */ 0x0041, 0x0055,
+ /* 3177 */ 0x0062, 0x0061, 0x0072,
+ /* 3180 */ 0x006F, 0x0056,
+ /* 3182 */ 0x0070, 0x0063,
+ /* 3184 */ 0x0064, 0x006D,
+ /* 3186 */ 0x0064, 0x006D, 0x00B2,
+ /* 3189 */ 0x0064, 0x006D, 0x00B3,
+ /* 3192 */ 0x0049, 0x0055,
+ /* 3194 */ 0x5E73, 0x6210,
+ /* 3196 */ 0x662D, 0x548C,
+ /* 3198 */ 0x5927, 0x6B63,
+ /* 3200 */ 0x660E, 0x6CBB,
+ /* 3202 */ 0x682A, 0x5F0F, 0x4F1A, 0x793E,
+ /* 3206 */ 0x0070, 0x0041,
+ /* 3208 */ 0x006E, 0x0041,
+ /* 3210 */ 0x03BC, 0x0041,
+ /* 3212 */ 0x006D, 0x0041,
+ /* 3214 */ 0x006B, 0x0041,
+ /* 3216 */ 0x004B, 0x0042,
+ /* 3218 */ 0x004D, 0x0042,
+ /* 3220 */ 0x0047, 0x0042,
+ /* 3222 */ 0x0063, 0x0061, 0x006C,
+ /* 3225 */ 0x006B, 0x0063, 0x0061, 0x006C,
+ /* 3229 */ 0x0070, 0x0046,
+ /* 3231 */ 0x006E, 0x0046,
+ /* 3233 */ 0x03BC, 0x0046,
+ /* 3235 */ 0x03BC, 0x0067,
+ /* 3237 */ 0x006D, 0x0067,
+ /* 3239 */ 0x006B, 0x0067,
+ /* 3241 */ 0x0048, 0x007A,
+ /* 3243 */ 0x006B, 0x0048, 0x007A,
+ /* 3246 */ 0x004D, 0x0048, 0x007A,
+ /* 3249 */ 0x0047, 0x0048, 0x007A,
+ /* 3252 */ 0x0054, 0x0048, 0x007A,
+ /* 3255 */ 0x03BC, 0x2113,
+ /* 3257 */ 0x006D, 0x2113,
+ /* 3259 */ 0x0064, 0x2113,
+ /* 3261 */ 0x006B, 0x2113,
+ /* 3263 */ 0x0066, 0x006D,
+ /* 3265 */ 0x006E, 0x006D,
+ /* 3267 */ 0x03BC, 0x006D,
+ /* 3269 */ 0x006D, 0x006D,
+ /* 3271 */ 0x0063, 0x006D,
+ /* 3273 */ 0x006B, 0x006D,
+ /* 3275 */ 0x006D, 0x006D, 0x00B2,
+ /* 3278 */ 0x0063, 0x006D, 0x00B2,
+ /* 3281 */ 0x006D, 0x00B2,
+ /* 3283 */ 0x006B, 0x006D, 0x00B2,
+ /* 3286 */ 0x006D, 0x006D, 0x00B3,
+ /* 3289 */ 0x0063, 0x006D, 0x00B3,
+ /* 3292 */ 0x006D, 0x00B3,
+ /* 3294 */ 0x006B, 0x006D, 0x00B3,
+ /* 3297 */ 0x006D, 0x2215, 0x0073,
+ /* 3300 */ 0x006D, 0x2215, 0x0073, 0x00B2,
+ /* 3304 */ 0x0050, 0x0061,
+ /* 3306 */ 0x006B, 0x0050, 0x0061,
+ /* 3309 */ 0x004D, 0x0050, 0x0061,
+ /* 3312 */ 0x0047, 0x0050, 0x0061,
+ /* 3315 */ 0x0072, 0x0061, 0x0064,
+ /* 3318 */ 0x0072, 0x0061, 0x0064, 0x2215, 0x0073,
+ /* 3323 */ 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0x00B2,
+ /* 3329 */ 0x0070, 0x0073,
+ /* 3331 */ 0x006E, 0x0073,
+ /* 3333 */ 0x03BC, 0x0073,
+ /* 3335 */ 0x006D, 0x0073,
+ /* 3337 */ 0x0070, 0x0056,
+ /* 3339 */ 0x006E, 0x0056,
+ /* 3341 */ 0x03BC, 0x0056,
+ /* 3343 */ 0x006D, 0x0056,
+ /* 3345 */ 0x006B, 0x0056,
+ /* 3347 */ 0x004D, 0x0056,
+ /* 3349 */ 0x0070, 0x0057,
+ /* 3351 */ 0x006E, 0x0057,
+ /* 3353 */ 0x03BC, 0x0057,
+ /* 3355 */ 0x006D, 0x0057,
+ /* 3357 */ 0x006B, 0x0057,
+ /* 3359 */ 0x004D, 0x0057,
+ /* 3361 */ 0x006B, 0x03A9,
+ /* 3363 */ 0x004D, 0x03A9,
+ /* 3365 */ 0x0061, 0x002E, 0x006D, 0x002E,
+ /* 3369 */ 0x0042, 0x0071,
+ /* 3371 */ 0x0063, 0x0063,
+ /* 3373 */ 0x0063, 0x0064,
+ /* 3375 */ 0x0043, 0x2215, 0x006B, 0x0067,
+ /* 3379 */ 0x0043, 0x006F, 0x002E,
+ /* 3382 */ 0x0064, 0x0042,
+ /* 3384 */ 0x0047, 0x0079,
+ /* 3386 */ 0x0068, 0x0061,
+ /* 3388 */ 0x0048, 0x0050,
+ /* 3390 */ 0x0069, 0x006E,
+ /* 3392 */ 0x004B, 0x004B,
+ /* 3394 */ 0x004B, 0x004D,
+ /* 3396 */ 0x006B, 0x0074,
+ /* 3398 */ 0x006C, 0x006D,
+ /* 3400 */ 0x006C, 0x006E,
+ /* 3402 */ 0x006C, 0x006F, 0x0067,
+ /* 3405 */ 0x006C, 0x0078,
+ /* 3407 */ 0x006D, 0x0062,
+ /* 3409 */ 0x006D, 0x0069, 0x006C,
+ /* 3412 */ 0x006D, 0x006F, 0x006C,
+ /* 3415 */ 0x0050, 0x0048,
+ /* 3417 */ 0x0070, 0x002E, 0x006D, 0x002E,
+ /* 3421 */ 0x0050, 0x0050, 0x004D,
+ /* 3424 */ 0x0050, 0x0052,
+ /* 3426 */ 0x0073, 0x0072,
+ /* 3428 */ 0x0053, 0x0076,
+ /* 3430 */ 0x0057, 0x0062,
+ /* 3432 */ 0x0056, 0x2215, 0x006D,
+ /* 3435 */ 0x0041, 0x2215, 0x006D,
+ /* 3438 */ 0x0031, 0x65E5,
+ /* 3440 */ 0x0032, 0x65E5,
+ /* 3442 */ 0x0033, 0x65E5,
+ /* 3444 */ 0x0034, 0x65E5,
+ /* 3446 */ 0x0035, 0x65E5,
+ /* 3448 */ 0x0036, 0x65E5,
+ /* 3450 */ 0x0037, 0x65E5,
+ /* 3452 */ 0x0038, 0x65E5,
+ /* 3454 */ 0x0039, 0x65E5,
+ /* 3456 */ 0x0031, 0x0030, 0x65E5,
+ /* 3459 */ 0x0031, 0x0031, 0x65E5,
+ /* 3462 */ 0x0031, 0x0032, 0x65E5,
+ /* 3465 */ 0x0031, 0x0033, 0x65E5,
+ /* 3468 */ 0x0031, 0x0034, 0x65E5,
+ /* 3471 */ 0x0031, 0x0035, 0x65E5,
+ /* 3474 */ 0x0031, 0x0036, 0x65E5,
+ /* 3477 */ 0x0031, 0x0037, 0x65E5,
+ /* 3480 */ 0x0031, 0x0038, 0x65E5,
+ /* 3483 */ 0x0031, 0x0039, 0x65E5,
+ /* 3486 */ 0x0032, 0x0030, 0x65E5,
+ /* 3489 */ 0x0032, 0x0031, 0x65E5,
+ /* 3492 */ 0x0032, 0x0032, 0x65E5,
+ /* 3495 */ 0x0032, 0x0033, 0x65E5,
+ /* 3498 */ 0x0032, 0x0034, 0x65E5,
+ /* 3501 */ 0x0032, 0x0035, 0x65E5,
+ /* 3504 */ 0x0032, 0x0036, 0x65E5,
+ /* 3507 */ 0x0032, 0x0037, 0x65E5,
+ /* 3510 */ 0x0032, 0x0038, 0x65E5,
+ /* 3513 */ 0x0032, 0x0039, 0x65E5,
+ /* 3516 */ 0x0033, 0x0030, 0x65E5,
+ /* 3519 */ 0x0033, 0x0031, 0x65E5,
+ /* 3522 */ 0x0067, 0x0061, 0x006C,
+ /* 3525 */ 0x242EE,
+ /* 3526 */ 0x2284A,
+ /* 3527 */ 0x22844,
+ /* 3528 */ 0x233D5,
+ /* 3529 */ 0x25249,
+ /* 3530 */ 0x25CD0,
+ /* 3531 */ 0x27ED3,
+ /* 3532 */ 0x0066, 0x0066,
+ /* 3534 */ 0x0066, 0x0069,
+ /* 3536 */ 0x0066, 0x006C,
+ /* 3538 */ 0x0066, 0x0066, 0x0069,
+ /* 3541 */ 0x0066, 0x0066, 0x006C,
+ /* 3544 */ 0x017F, 0x0074,
+ /* 3546 */ 0x0073, 0x0074,
+ /* 3548 */ 0x0574, 0x0576,
+ /* 3550 */ 0x0574, 0x0565,
+ /* 3552 */ 0x0574, 0x056B,
+ /* 3554 */ 0x057E, 0x0576,
+ /* 3556 */ 0x0574, 0x056D,
+ /* 3558 */ 0x05D9, 0x05B4,
+ /* 3560 */ 0x05F2, 0x05B7,
+ /* 3562 */ 0x05E9, 0x05C1,
+ /* 3564 */ 0x05E9, 0x05C2,
+ /* 3566 */ 0xFB49, 0x05C1,
+ /* 3568 */ 0xFB49, 0x05C2,
+ /* 3570 */ 0x05D0, 0x05B7,
+ /* 3572 */ 0x05D0, 0x05B8,
+ /* 3574 */ 0x05D0, 0x05BC,
+ /* 3576 */ 0x05D1, 0x05BC,
+ /* 3578 */ 0x05D2, 0x05BC,
+ /* 3580 */ 0x05D3, 0x05BC,
+ /* 3582 */ 0x05D4, 0x05BC,
+ /* 3584 */ 0x05D5, 0x05BC,
+ /* 3586 */ 0x05D6, 0x05BC,
+ /* 3588 */ 0x05D8, 0x05BC,
+ /* 3590 */ 0x05D9, 0x05BC,
+ /* 3592 */ 0x05DA, 0x05BC,
+ /* 3594 */ 0x05DB, 0x05BC,
+ /* 3596 */ 0x05DC, 0x05BC,
+ /* 3598 */ 0x05DE, 0x05BC,
+ /* 3600 */ 0x05E0, 0x05BC,
+ /* 3602 */ 0x05E1, 0x05BC,
+ /* 3604 */ 0x05E3, 0x05BC,
+ /* 3606 */ 0x05E4, 0x05BC,
+ /* 3608 */ 0x05E6, 0x05BC,
+ /* 3610 */ 0x05E7, 0x05BC,
+ /* 3612 */ 0x05E8, 0x05BC,
+ /* 3614 */ 0x05E9, 0x05BC,
+ /* 3616 */ 0x05EA, 0x05BC,
+ /* 3618 */ 0x05D5, 0x05B9,
+ /* 3620 */ 0x05D1, 0x05BF,
+ /* 3622 */ 0x05DB, 0x05BF,
+ /* 3624 */ 0x05E4, 0x05BF,
+ /* 3626 */ 0x05D0, 0x05DC,
+ /* 3628 */ 0x0626, 0x0627,
+ /* 3630 */ 0x0626, 0x0627,
+ /* 3632 */ 0x0626, 0x06D5,
+ /* 3634 */ 0x0626, 0x06D5,
+ /* 3636 */ 0x0626, 0x0648,
+ /* 3638 */ 0x0626, 0x0648,
+ /* 3640 */ 0x0626, 0x06C7,
+ /* 3642 */ 0x0626, 0x06C7,
+ /* 3644 */ 0x0626, 0x06C6,
+ /* 3646 */ 0x0626, 0x06C6,
+ /* 3648 */ 0x0626, 0x06C8,
+ /* 3650 */ 0x0626, 0x06C8,
+ /* 3652 */ 0x0626, 0x06D0,
+ /* 3654 */ 0x0626, 0x06D0,
+ /* 3656 */ 0x0626, 0x06D0,
+ /* 3658 */ 0x0626, 0x0649,
+ /* 3660 */ 0x0626, 0x0649,
+ /* 3662 */ 0x0626, 0x0649,
+ /* 3664 */ 0x0626, 0x062C,
+ /* 3666 */ 0x0626, 0x062D,
+ /* 3668 */ 0x0626, 0x0645,
+ /* 3670 */ 0x0626, 0x0649,
+ /* 3672 */ 0x0626, 0x064A,
+ /* 3674 */ 0x0628, 0x062C,
+ /* 3676 */ 0x0628, 0x062D,
+ /* 3678 */ 0x0628, 0x062E,
+ /* 3680 */ 0x0628, 0x0645,
+ /* 3682 */ 0x0628, 0x0649,
+ /* 3684 */ 0x0628, 0x064A,
+ /* 3686 */ 0x062A, 0x062C,
+ /* 3688 */ 0x062A, 0x062D,
+ /* 3690 */ 0x062A, 0x062E,
+ /* 3692 */ 0x062A, 0x0645,
+ /* 3694 */ 0x062A, 0x0649,
+ /* 3696 */ 0x062A, 0x064A,
+ /* 3698 */ 0x062B, 0x062C,
+ /* 3700 */ 0x062B, 0x0645,
+ /* 3702 */ 0x062B, 0x0649,
+ /* 3704 */ 0x062B, 0x064A,
+ /* 3706 */ 0x062C, 0x062D,
+ /* 3708 */ 0x062C, 0x0645,
+ /* 3710 */ 0x062D, 0x062C,
+ /* 3712 */ 0x062D, 0x0645,
+ /* 3714 */ 0x062E, 0x062C,
+ /* 3716 */ 0x062E, 0x062D,
+ /* 3718 */ 0x062E, 0x0645,
+ /* 3720 */ 0x0633, 0x062C,
+ /* 3722 */ 0x0633, 0x062D,
+ /* 3724 */ 0x0633, 0x062E,
+ /* 3726 */ 0x0633, 0x0645,
+ /* 3728 */ 0x0635, 0x062D,
+ /* 3730 */ 0x0635, 0x0645,
+ /* 3732 */ 0x0636, 0x062C,
+ /* 3734 */ 0x0636, 0x062D,
+ /* 3736 */ 0x0636, 0x062E,
+ /* 3738 */ 0x0636, 0x0645,
+ /* 3740 */ 0x0637, 0x062D,
+ /* 3742 */ 0x0637, 0x0645,
+ /* 3744 */ 0x0638, 0x0645,
+ /* 3746 */ 0x0639, 0x062C,
+ /* 3748 */ 0x0639, 0x0645,
+ /* 3750 */ 0x063A, 0x062C,
+ /* 3752 */ 0x063A, 0x0645,
+ /* 3754 */ 0x0641, 0x062C,
+ /* 3756 */ 0x0641, 0x062D,
+ /* 3758 */ 0x0641, 0x062E,
+ /* 3760 */ 0x0641, 0x0645,
+ /* 3762 */ 0x0641, 0x0649,
+ /* 3764 */ 0x0641, 0x064A,
+ /* 3766 */ 0x0642, 0x062D,
+ /* 3768 */ 0x0642, 0x0645,
+ /* 3770 */ 0x0642, 0x0649,
+ /* 3772 */ 0x0642, 0x064A,
+ /* 3774 */ 0x0643, 0x0627,
+ /* 3776 */ 0x0643, 0x062C,
+ /* 3778 */ 0x0643, 0x062D,
+ /* 3780 */ 0x0643, 0x062E,
+ /* 3782 */ 0x0643, 0x0644,
+ /* 3784 */ 0x0643, 0x0645,
+ /* 3786 */ 0x0643, 0x0649,
+ /* 3788 */ 0x0643, 0x064A,
+ /* 3790 */ 0x0644, 0x062C,
+ /* 3792 */ 0x0644, 0x062D,
+ /* 3794 */ 0x0644, 0x062E,
+ /* 3796 */ 0x0644, 0x0645,
+ /* 3798 */ 0x0644, 0x0649,
+ /* 3800 */ 0x0644, 0x064A,
+ /* 3802 */ 0x0645, 0x062C,
+ /* 3804 */ 0x0645, 0x062D,
+ /* 3806 */ 0x0645, 0x062E,
+ /* 3808 */ 0x0645, 0x0645,
+ /* 3810 */ 0x0645, 0x0649,
+ /* 3812 */ 0x0645, 0x064A,
+ /* 3814 */ 0x0646, 0x062C,
+ /* 3816 */ 0x0646, 0x062D,
+ /* 3818 */ 0x0646, 0x062E,
+ /* 3820 */ 0x0646, 0x0645,
+ /* 3822 */ 0x0646, 0x0649,
+ /* 3824 */ 0x0646, 0x064A,
+ /* 3826 */ 0x0647, 0x062C,
+ /* 3828 */ 0x0647, 0x0645,
+ /* 3830 */ 0x0647, 0x0649,
+ /* 3832 */ 0x0647, 0x064A,
+ /* 3834 */ 0x064A, 0x062C,
+ /* 3836 */ 0x064A, 0x062D,
+ /* 3838 */ 0x064A, 0x062E,
+ /* 3840 */ 0x064A, 0x0645,
+ /* 3842 */ 0x064A, 0x0649,
+ /* 3844 */ 0x064A, 0x064A,
+ /* 3846 */ 0x0630, 0x0670,
+ /* 3848 */ 0x0631, 0x0670,
+ /* 3850 */ 0x0649, 0x0670,
+ /* 3852 */ 0x0020, 0x064C, 0x0651,
+ /* 3855 */ 0x0020, 0x064D, 0x0651,
+ /* 3858 */ 0x0020, 0x064E, 0x0651,
+ /* 3861 */ 0x0020, 0x064F, 0x0651,
+ /* 3864 */ 0x0020, 0x0650, 0x0651,
+ /* 3867 */ 0x0020, 0x0651, 0x0670,
+ /* 3870 */ 0x0626, 0x0631,
+ /* 3872 */ 0x0626, 0x0632,
+ /* 3874 */ 0x0626, 0x0645,
+ /* 3876 */ 0x0626, 0x0646,
+ /* 3878 */ 0x0626, 0x0649,
+ /* 3880 */ 0x0626, 0x064A,
+ /* 3882 */ 0x0628, 0x0631,
+ /* 3884 */ 0x0628, 0x0632,
+ /* 3886 */ 0x0628, 0x0645,
+ /* 3888 */ 0x0628, 0x0646,
+ /* 3890 */ 0x0628, 0x0649,
+ /* 3892 */ 0x0628, 0x064A,
+ /* 3894 */ 0x062A, 0x0631,
+ /* 3896 */ 0x062A, 0x0632,
+ /* 3898 */ 0x062A, 0x0645,
+ /* 3900 */ 0x062A, 0x0646,
+ /* 3902 */ 0x062A, 0x0649,
+ /* 3904 */ 0x062A, 0x064A,
+ /* 3906 */ 0x062B, 0x0631,
+ /* 3908 */ 0x062B, 0x0632,
+ /* 3910 */ 0x062B, 0x0645,
+ /* 3912 */ 0x062B, 0x0646,
+ /* 3914 */ 0x062B, 0x0649,
+ /* 3916 */ 0x062B, 0x064A,
+ /* 3918 */ 0x0641, 0x0649,
+ /* 3920 */ 0x0641, 0x064A,
+ /* 3922 */ 0x0642, 0x0649,
+ /* 3924 */ 0x0642, 0x064A,
+ /* 3926 */ 0x0643, 0x0627,
+ /* 3928 */ 0x0643, 0x0644,
+ /* 3930 */ 0x0643, 0x0645,
+ /* 3932 */ 0x0643, 0x0649,
+ /* 3934 */ 0x0643, 0x064A,
+ /* 3936 */ 0x0644, 0x0645,
+ /* 3938 */ 0x0644, 0x0649,
+ /* 3940 */ 0x0644, 0x064A,
+ /* 3942 */ 0x0645, 0x0627,
+ /* 3944 */ 0x0645, 0x0645,
+ /* 3946 */ 0x0646, 0x0631,
+ /* 3948 */ 0x0646, 0x0632,
+ /* 3950 */ 0x0646, 0x0645,
+ /* 3952 */ 0x0646, 0x0646,
+ /* 3954 */ 0x0646, 0x0649,
+ /* 3956 */ 0x0646, 0x064A,
+ /* 3958 */ 0x0649, 0x0670,
+ /* 3960 */ 0x064A, 0x0631,
+ /* 3962 */ 0x064A, 0x0632,
+ /* 3964 */ 0x064A, 0x0645,
+ /* 3966 */ 0x064A, 0x0646,
+ /* 3968 */ 0x064A, 0x0649,
+ /* 3970 */ 0x064A, 0x064A,
+ /* 3972 */ 0x0626, 0x062C,
+ /* 3974 */ 0x0626, 0x062D,
+ /* 3976 */ 0x0626, 0x062E,
+ /* 3978 */ 0x0626, 0x0645,
+ /* 3980 */ 0x0626, 0x0647,
+ /* 3982 */ 0x0628, 0x062C,
+ /* 3984 */ 0x0628, 0x062D,
+ /* 3986 */ 0x0628, 0x062E,
+ /* 3988 */ 0x0628, 0x0645,
+ /* 3990 */ 0x0628, 0x0647,
+ /* 3992 */ 0x062A, 0x062C,
+ /* 3994 */ 0x062A, 0x062D,
+ /* 3996 */ 0x062A, 0x062E,
+ /* 3998 */ 0x062A, 0x0645,
+ /* 4000 */ 0x062A, 0x0647,
+ /* 4002 */ 0x062B, 0x0645,
+ /* 4004 */ 0x062C, 0x062D,
+ /* 4006 */ 0x062C, 0x0645,
+ /* 4008 */ 0x062D, 0x062C,
+ /* 4010 */ 0x062D, 0x0645,
+ /* 4012 */ 0x062E, 0x062C,
+ /* 4014 */ 0x062E, 0x0645,
+ /* 4016 */ 0x0633, 0x062C,
+ /* 4018 */ 0x0633, 0x062D,
+ /* 4020 */ 0x0633, 0x062E,
+ /* 4022 */ 0x0633, 0x0645,
+ /* 4024 */ 0x0635, 0x062D,
+ /* 4026 */ 0x0635, 0x062E,
+ /* 4028 */ 0x0635, 0x0645,
+ /* 4030 */ 0x0636, 0x062C,
+ /* 4032 */ 0x0636, 0x062D,
+ /* 4034 */ 0x0636, 0x062E,
+ /* 4036 */ 0x0636, 0x0645,
+ /* 4038 */ 0x0637, 0x062D,
+ /* 4040 */ 0x0638, 0x0645,
+ /* 4042 */ 0x0639, 0x062C,
+ /* 4044 */ 0x0639, 0x0645,
+ /* 4046 */ 0x063A, 0x062C,
+ /* 4048 */ 0x063A, 0x0645,
+ /* 4050 */ 0x0641, 0x062C,
+ /* 4052 */ 0x0641, 0x062D,
+ /* 4054 */ 0x0641, 0x062E,
+ /* 4056 */ 0x0641, 0x0645,
+ /* 4058 */ 0x0642, 0x062D,
+ /* 4060 */ 0x0642, 0x0645,
+ /* 4062 */ 0x0643, 0x062C,
+ /* 4064 */ 0x0643, 0x062D,
+ /* 4066 */ 0x0643, 0x062E,
+ /* 4068 */ 0x0643, 0x0644,
+ /* 4070 */ 0x0643, 0x0645,
+ /* 4072 */ 0x0644, 0x062C,
+ /* 4074 */ 0x0644, 0x062D,
+ /* 4076 */ 0x0644, 0x062E,
+ /* 4078 */ 0x0644, 0x0645,
+ /* 4080 */ 0x0644, 0x0647,
+ /* 4082 */ 0x0645, 0x062C,
+ /* 4084 */ 0x0645, 0x062D,
+ /* 4086 */ 0x0645, 0x062E,
+ /* 4088 */ 0x0645, 0x0645,
+ /* 4090 */ 0x0646, 0x062C,
+ /* 4092 */ 0x0646, 0x062D,
+ /* 4094 */ 0x0646, 0x062E,
+ /* 4096 */ 0x0646, 0x0645,
+ /* 4098 */ 0x0646, 0x0647,
+ /* 4100 */ 0x0647, 0x062C,
+ /* 4102 */ 0x0647, 0x0645,
+ /* 4104 */ 0x0647, 0x0670,
+ /* 4106 */ 0x064A, 0x062C,
+ /* 4108 */ 0x064A, 0x062D,
+ /* 4110 */ 0x064A, 0x062E,
+ /* 4112 */ 0x064A, 0x0645,
+ /* 4114 */ 0x064A, 0x0647,
+ /* 4116 */ 0x0626, 0x0645,
+ /* 4118 */ 0x0626, 0x0647,
+ /* 4120 */ 0x0628, 0x0645,
+ /* 4122 */ 0x0628, 0x0647,
+ /* 4124 */ 0x062A, 0x0645,
+ /* 4126 */ 0x062A, 0x0647,
+ /* 4128 */ 0x062B, 0x0645,
+ /* 4130 */ 0x062B, 0x0647,
+ /* 4132 */ 0x0633, 0x0645,
+ /* 4134 */ 0x0633, 0x0647,
+ /* 4136 */ 0x0634, 0x0645,
+ /* 4138 */ 0x0634, 0x0647,
+ /* 4140 */ 0x0643, 0x0644,
+ /* 4142 */ 0x0643, 0x0645,
+ /* 4144 */ 0x0644, 0x0645,
+ /* 4146 */ 0x0646, 0x0645,
+ /* 4148 */ 0x0646, 0x0647,
+ /* 4150 */ 0x064A, 0x0645,
+ /* 4152 */ 0x064A, 0x0647,
+ /* 4154 */ 0x0640, 0x064E, 0x0651,
+ /* 4157 */ 0x0640, 0x064F, 0x0651,
+ /* 4160 */ 0x0640, 0x0650, 0x0651,
+ /* 4163 */ 0x0637, 0x0649,
+ /* 4165 */ 0x0637, 0x064A,
+ /* 4167 */ 0x0639, 0x0649,
+ /* 4169 */ 0x0639, 0x064A,
+ /* 4171 */ 0x063A, 0x0649,
+ /* 4173 */ 0x063A, 0x064A,
+ /* 4175 */ 0x0633, 0x0649,
+ /* 4177 */ 0x0633, 0x064A,
+ /* 4179 */ 0x0634, 0x0649,
+ /* 4181 */ 0x0634, 0x064A,
+ /* 4183 */ 0x062D, 0x0649,
+ /* 4185 */ 0x062D, 0x064A,
+ /* 4187 */ 0x062C, 0x0649,
+ /* 4189 */ 0x062C, 0x064A,
+ /* 4191 */ 0x062E, 0x0649,
+ /* 4193 */ 0x062E, 0x064A,
+ /* 4195 */ 0x0635, 0x0649,
+ /* 4197 */ 0x0635, 0x064A,
+ /* 4199 */ 0x0636, 0x0649,
+ /* 4201 */ 0x0636, 0x064A,
+ /* 4203 */ 0x0634, 0x062C,
+ /* 4205 */ 0x0634, 0x062D,
+ /* 4207 */ 0x0634, 0x062E,
+ /* 4209 */ 0x0634, 0x0645,
+ /* 4211 */ 0x0634, 0x0631,
+ /* 4213 */ 0x0633, 0x0631,
+ /* 4215 */ 0x0635, 0x0631,
+ /* 4217 */ 0x0636, 0x0631,
+ /* 4219 */ 0x0637, 0x0649,
+ /* 4221 */ 0x0637, 0x064A,
+ /* 4223 */ 0x0639, 0x0649,
+ /* 4225 */ 0x0639, 0x064A,
+ /* 4227 */ 0x063A, 0x0649,
+ /* 4229 */ 0x063A, 0x064A,
+ /* 4231 */ 0x0633, 0x0649,
+ /* 4233 */ 0x0633, 0x064A,
+ /* 4235 */ 0x0634, 0x0649,
+ /* 4237 */ 0x0634, 0x064A,
+ /* 4239 */ 0x062D, 0x0649,
+ /* 4241 */ 0x062D, 0x064A,
+ /* 4243 */ 0x062C, 0x0649,
+ /* 4245 */ 0x062C, 0x064A,
+ /* 4247 */ 0x062E, 0x0649,
+ /* 4249 */ 0x062E, 0x064A,
+ /* 4251 */ 0x0635, 0x0649,
+ /* 4253 */ 0x0635, 0x064A,
+ /* 4255 */ 0x0636, 0x0649,
+ /* 4257 */ 0x0636, 0x064A,
+ /* 4259 */ 0x0634, 0x062C,
+ /* 4261 */ 0x0634, 0x062D,
+ /* 4263 */ 0x0634, 0x062E,
+ /* 4265 */ 0x0634, 0x0645,
+ /* 4267 */ 0x0634, 0x0631,
+ /* 4269 */ 0x0633, 0x0631,
+ /* 4271 */ 0x0635, 0x0631,
+ /* 4273 */ 0x0636, 0x0631,
+ /* 4275 */ 0x0634, 0x062C,
+ /* 4277 */ 0x0634, 0x062D,
+ /* 4279 */ 0x0634, 0x062E,
+ /* 4281 */ 0x0634, 0x0645,
+ /* 4283 */ 0x0633, 0x0647,
+ /* 4285 */ 0x0634, 0x0647,
+ /* 4287 */ 0x0637, 0x0645,
+ /* 4289 */ 0x0633, 0x062C,
+ /* 4291 */ 0x0633, 0x062D,
+ /* 4293 */ 0x0633, 0x062E,
+ /* 4295 */ 0x0634, 0x062C,
+ /* 4297 */ 0x0634, 0x062D,
+ /* 4299 */ 0x0634, 0x062E,
+ /* 4301 */ 0x0637, 0x0645,
+ /* 4303 */ 0x0638, 0x0645,
+ /* 4305 */ 0x0627, 0x064B,
+ /* 4307 */ 0x0627, 0x064B,
+ /* 4309 */ 0x062A, 0x062C, 0x0645,
+ /* 4312 */ 0x062A, 0x062D, 0x062C,
+ /* 4315 */ 0x062A, 0x062D, 0x062C,
+ /* 4318 */ 0x062A, 0x062D, 0x0645,
+ /* 4321 */ 0x062A, 0x062E, 0x0645,
+ /* 4324 */ 0x062A, 0x0645, 0x062C,
+ /* 4327 */ 0x062A, 0x0645, 0x062D,
+ /* 4330 */ 0x062A, 0x0645, 0x062E,
+ /* 4333 */ 0x062C, 0x0645, 0x062D,
+ /* 4336 */ 0x062C, 0x0645, 0x062D,
+ /* 4339 */ 0x062D, 0x0645, 0x064A,
+ /* 4342 */ 0x062D, 0x0645, 0x0649,
+ /* 4345 */ 0x0633, 0x062D, 0x062C,
+ /* 4348 */ 0x0633, 0x062C, 0x062D,
+ /* 4351 */ 0x0633, 0x062C, 0x0649,
+ /* 4354 */ 0x0633, 0x0645, 0x062D,
+ /* 4357 */ 0x0633, 0x0645, 0x062D,
+ /* 4360 */ 0x0633, 0x0645, 0x062C,
+ /* 4363 */ 0x0633, 0x0645, 0x0645,
+ /* 4366 */ 0x0633, 0x0645, 0x0645,
+ /* 4369 */ 0x0635, 0x062D, 0x062D,
+ /* 4372 */ 0x0635, 0x062D, 0x062D,
+ /* 4375 */ 0x0635, 0x0645, 0x0645,
+ /* 4378 */ 0x0634, 0x062D, 0x0645,
+ /* 4381 */ 0x0634, 0x062D, 0x0645,
+ /* 4384 */ 0x0634, 0x062C, 0x064A,
+ /* 4387 */ 0x0634, 0x0645, 0x062E,
+ /* 4390 */ 0x0634, 0x0645, 0x062E,
+ /* 4393 */ 0x0634, 0x0645, 0x0645,
+ /* 4396 */ 0x0634, 0x0645, 0x0645,
+ /* 4399 */ 0x0636, 0x062D, 0x0649,
+ /* 4402 */ 0x0636, 0x062E, 0x0645,
+ /* 4405 */ 0x0636, 0x062E, 0x0645,
+ /* 4408 */ 0x0637, 0x0645, 0x062D,
+ /* 4411 */ 0x0637, 0x0645, 0x062D,
+ /* 4414 */ 0x0637, 0x0645, 0x0645,
+ /* 4417 */ 0x0637, 0x0645, 0x064A,
+ /* 4420 */ 0x0639, 0x062C, 0x0645,
+ /* 4423 */ 0x0639, 0x0645, 0x0645,
+ /* 4426 */ 0x0639, 0x0645, 0x0645,
+ /* 4429 */ 0x0639, 0x0645, 0x0649,
+ /* 4432 */ 0x063A, 0x0645, 0x0645,
+ /* 4435 */ 0x063A, 0x0645, 0x064A,
+ /* 4438 */ 0x063A, 0x0645, 0x0649,
+ /* 4441 */ 0x0641, 0x062E, 0x0645,
+ /* 4444 */ 0x0641, 0x062E, 0x0645,
+ /* 4447 */ 0x0642, 0x0645, 0x062D,
+ /* 4450 */ 0x0642, 0x0645, 0x0645,
+ /* 4453 */ 0x0644, 0x062D, 0x0645,
+ /* 4456 */ 0x0644, 0x062D, 0x064A,
+ /* 4459 */ 0x0644, 0x062D, 0x0649,
+ /* 4462 */ 0x0644, 0x062C, 0x062C,
+ /* 4465 */ 0x0644, 0x062C, 0x062C,
+ /* 4468 */ 0x0644, 0x062E, 0x0645,
+ /* 4471 */ 0x0644, 0x062E, 0x0645,
+ /* 4474 */ 0x0644, 0x0645, 0x062D,
+ /* 4477 */ 0x0644, 0x0645, 0x062D,
+ /* 4480 */ 0x0645, 0x062D, 0x062C,
+ /* 4483 */ 0x0645, 0x062D, 0x0645,
+ /* 4486 */ 0x0645, 0x062D, 0x064A,
+ /* 4489 */ 0x0645, 0x062C, 0x062D,
+ /* 4492 */ 0x0645, 0x062C, 0x0645,
+ /* 4495 */ 0x0645, 0x062E, 0x062C,
+ /* 4498 */ 0x0645, 0x062E, 0x0645,
+ /* 4501 */ 0x0645, 0x062C, 0x062E,
+ /* 4504 */ 0x0647, 0x0645, 0x062C,
+ /* 4507 */ 0x0647, 0x0645, 0x0645,
+ /* 4510 */ 0x0646, 0x062D, 0x0645,
+ /* 4513 */ 0x0646, 0x062D, 0x0649,
+ /* 4516 */ 0x0646, 0x062C, 0x0645,
+ /* 4519 */ 0x0646, 0x062C, 0x0645,
+ /* 4522 */ 0x0646, 0x062C, 0x0649,
+ /* 4525 */ 0x0646, 0x0645, 0x064A,
+ /* 4528 */ 0x0646, 0x0645, 0x0649,
+ /* 4531 */ 0x064A, 0x0645, 0x0645,
+ /* 4534 */ 0x064A, 0x0645, 0x0645,
+ /* 4537 */ 0x0628, 0x062E, 0x064A,
+ /* 4540 */ 0x062A, 0x062C, 0x064A,
+ /* 4543 */ 0x062A, 0x062C, 0x0649,
+ /* 4546 */ 0x062A, 0x062E, 0x064A,
+ /* 4549 */ 0x062A, 0x062E, 0x0649,
+ /* 4552 */ 0x062A, 0x0645, 0x064A,
+ /* 4555 */ 0x062A, 0x0645, 0x0649,
+ /* 4558 */ 0x062C, 0x0645, 0x064A,
+ /* 4561 */ 0x062C, 0x062D, 0x0649,
+ /* 4564 */ 0x062C, 0x0645, 0x0649,
+ /* 4567 */ 0x0633, 0x062E, 0x0649,
+ /* 4570 */ 0x0635, 0x062D, 0x064A,
+ /* 4573 */ 0x0634, 0x062D, 0x064A,
+ /* 4576 */ 0x0636, 0x062D, 0x064A,
+ /* 4579 */ 0x0644, 0x062C, 0x064A,
+ /* 4582 */ 0x0644, 0x0645, 0x064A,
+ /* 4585 */ 0x064A, 0x062D, 0x064A,
+ /* 4588 */ 0x064A, 0x062C, 0x064A,
+ /* 4591 */ 0x064A, 0x0645, 0x064A,
+ /* 4594 */ 0x0645, 0x0645, 0x064A,
+ /* 4597 */ 0x0642, 0x0645, 0x064A,
+ /* 4600 */ 0x0646, 0x062D, 0x064A,
+ /* 4603 */ 0x0642, 0x0645, 0x062D,
+ /* 4606 */ 0x0644, 0x062D, 0x0645,
+ /* 4609 */ 0x0639, 0x0645, 0x064A,
+ /* 4612 */ 0x0643, 0x0645, 0x064A,
+ /* 4615 */ 0x0646, 0x062C, 0x062D,
+ /* 4618 */ 0x0645, 0x062E, 0x064A,
+ /* 4621 */ 0x0644, 0x062C, 0x0645,
+ /* 4624 */ 0x0643, 0x0645, 0x0645,
+ /* 4627 */ 0x0644, 0x062C, 0x0645,
+ /* 4630 */ 0x0646, 0x062C, 0x062D,
+ /* 4633 */ 0x062C, 0x062D, 0x064A,
+ /* 4636 */ 0x062D, 0x062C, 0x064A,
+ /* 4639 */ 0x0645, 0x062C, 0x064A,
+ /* 4642 */ 0x0641, 0x0645, 0x064A,
+ /* 4645 */ 0x0628, 0x062D, 0x064A,
+ /* 4648 */ 0x0643, 0x0645, 0x0645,
+ /* 4651 */ 0x0639, 0x062C, 0x0645,
+ /* 4654 */ 0x0635, 0x0645, 0x0645,
+ /* 4657 */ 0x0633, 0x062E, 0x064A,
+ /* 4660 */ 0x0646, 0x062C, 0x064A,
+ /* 4663 */ 0x0635, 0x0644, 0x06D2,
+ /* 4666 */ 0x0642, 0x0644, 0x06D2,
+ /* 4669 */ 0x0627, 0x0644, 0x0644, 0x0647,
+ /* 4673 */ 0x0627, 0x0643, 0x0628, 0x0631,
+ /* 4677 */ 0x0645, 0x062D, 0x0645, 0x062F,
+ /* 4681 */ 0x0635, 0x0644, 0x0639, 0x0645,
+ /* 4685 */ 0x0631, 0x0633, 0x0648, 0x0644,
+ /* 4689 */ 0x0639, 0x0644, 0x064A, 0x0647,
+ /* 4693 */ 0x0648, 0x0633, 0x0644, 0x0645,
+ /* 4697 */ 0x0635, 0x0644, 0x0649,
+ /* 4700 */ 0x0635, 0x0644, 0x0649, 0x0020, 0x0627, 0x0644, 0x0644, 0x0647, 0x0020, 0x0639, 0x0644, 0x064A, 0x0647, 0x0020, 0x0648, 0x0633, 0x0644, 0x0645,
+ /* 4718 */ 0x062C, 0x0644, 0x0020, 0x062C, 0x0644, 0x0627, 0x0644, 0x0647,
+ /* 4726 */ 0x0631, 0x06CC, 0x0627, 0x0644,
+ /* 4730 */ 0x0020, 0x064B,
+ /* 4732 */ 0x0640, 0x064B,
+ /* 4734 */ 0x0020, 0x064C,
+ /* 4736 */ 0x0020, 0x064D,
+ /* 4738 */ 0x0020, 0x064E,
+ /* 4740 */ 0x0640, 0x064E,
+ /* 4742 */ 0x0020, 0x064F,
+ /* 4744 */ 0x0640, 0x064F,
+ /* 4746 */ 0x0020, 0x0650,
+ /* 4748 */ 0x0640, 0x0650,
+ /* 4750 */ 0x0020, 0x0651,
+ /* 4752 */ 0x0640, 0x0651,
+ /* 4754 */ 0x0020, 0x0652,
+ /* 4756 */ 0x0640, 0x0652,
+ /* 4758 */ 0x0644, 0x0622,
+ /* 4760 */ 0x0644, 0x0622,
+ /* 4762 */ 0x0644, 0x0623,
+ /* 4764 */ 0x0644, 0x0623,
+ /* 4766 */ 0x0644, 0x0625,
+ /* 4768 */ 0x0644, 0x0625,
+ /* 4770 */ 0x0644, 0x0627,
+ /* 4772 */ 0x0644, 0x0627,
+ /* 4774 */ 0x11099, 0x110BA,
+ /* 4776 */ 0x1109B, 0x110BA,
+ /* 4778 */ 0x110A5, 0x110BA,
+ /* 4780 */ 0x11131, 0x11127,
+ /* 4782 */ 0x11132, 0x11127,
+ /* 4784 */ 0x11347, 0x1133E,
+ /* 4786 */ 0x11347, 0x11357,
+ /* 4788 */ 0x114B9, 0x114BA,
+ /* 4790 */ 0x114B9, 0x114B0,
+ /* 4792 */ 0x114B9, 0x114BD,
+ /* 4794 */ 0x115B8, 0x115AF,
+ /* 4796 */ 0x115B9, 0x115AF,
+ /* 4798 */ 0x1D157, 0x1D165,
+ /* 4800 */ 0x1D158, 0x1D165,
+ /* 4802 */ 0x1D15F, 0x1D16E,
+ /* 4804 */ 0x1D15F, 0x1D16F,
+ /* 4806 */ 0x1D15F, 0x1D170,
+ /* 4808 */ 0x1D15F, 0x1D171,
+ /* 4810 */ 0x1D15F, 0x1D172,
+ /* 4812 */ 0x1D1B9, 0x1D165,
+ /* 4814 */ 0x1D1BA, 0x1D165,
+ /* 4816 */ 0x1D1BB, 0x1D16E,
+ /* 4818 */ 0x1D1BC, 0x1D16E,
+ /* 4820 */ 0x1D1BB, 0x1D16F,
+ /* 4822 */ 0x1D1BC, 0x1D16F,
+ /* 4824 */ 0x0030, 0x002E,
+ /* 4826 */ 0x0030, 0x002C,
+ /* 4828 */ 0x0031, 0x002C,
+ /* 4830 */ 0x0032, 0x002C,
+ /* 4832 */ 0x0033, 0x002C,
+ /* 4834 */ 0x0034, 0x002C,
+ /* 4836 */ 0x0035, 0x002C,
+ /* 4838 */ 0x0036, 0x002C,
+ /* 4840 */ 0x0037, 0x002C,
+ /* 4842 */ 0x0038, 0x002C,
+ /* 4844 */ 0x0039, 0x002C,
+ /* 4846 */ 0x0028, 0x0041, 0x0029,
+ /* 4849 */ 0x0028, 0x0042, 0x0029,
+ /* 4852 */ 0x0028, 0x0043, 0x0029,
+ /* 4855 */ 0x0028, 0x0044, 0x0029,
+ /* 4858 */ 0x0028, 0x0045, 0x0029,
+ /* 4861 */ 0x0028, 0x0046, 0x0029,
+ /* 4864 */ 0x0028, 0x0047, 0x0029,
+ /* 4867 */ 0x0028, 0x0048, 0x0029,
+ /* 4870 */ 0x0028, 0x0049, 0x0029,
+ /* 4873 */ 0x0028, 0x004A, 0x0029,
+ /* 4876 */ 0x0028, 0x004B, 0x0029,
+ /* 4879 */ 0x0028, 0x004C, 0x0029,
+ /* 4882 */ 0x0028, 0x004D, 0x0029,
+ /* 4885 */ 0x0028, 0x004E, 0x0029,
+ /* 4888 */ 0x0028, 0x004F, 0x0029,
+ /* 4891 */ 0x0028, 0x0050, 0x0029,
+ /* 4894 */ 0x0028, 0x0051, 0x0029,
+ /* 4897 */ 0x0028, 0x0052, 0x0029,
+ /* 4900 */ 0x0028, 0x0053, 0x0029,
+ /* 4903 */ 0x0028, 0x0054, 0x0029,
+ /* 4906 */ 0x0028, 0x0055, 0x0029,
+ /* 4909 */ 0x0028, 0x0056, 0x0029,
+ /* 4912 */ 0x0028, 0x0057, 0x0029,
+ /* 4915 */ 0x0028, 0x0058, 0x0029,
+ /* 4918 */ 0x0028, 0x0059, 0x0029,
+ /* 4921 */ 0x0028, 0x005A, 0x0029,
+ /* 4924 */ 0x3014, 0x0053, 0x3015,
+ /* 4927 */ 0x0043, 0x0044,
+ /* 4929 */ 0x0057, 0x005A,
+ /* 4931 */ 0x0048, 0x0056,
+ /* 4933 */ 0x004D, 0x0056,
+ /* 4935 */ 0x0053, 0x0044,
+ /* 4937 */ 0x0053, 0x0053,
+ /* 4939 */ 0x0050, 0x0050, 0x0056,
+ /* 4942 */ 0x0057, 0x0043,
+ /* 4944 */ 0x004D, 0x0043,
+ /* 4946 */ 0x004D, 0x0044,
+ /* 4948 */ 0x0044, 0x004A,
+ /* 4950 */ 0x307B, 0x304B,
+ /* 4952 */ 0x30B3, 0x30B3,
+ /* 4954 */ 0x3014, 0x672C, 0x3015,
+ /* 4957 */ 0x3014, 0x4E09, 0x3015,
+ /* 4960 */ 0x3014, 0x4E8C, 0x3015,
+ /* 4963 */ 0x3014, 0x5B89, 0x3015,
+ /* 4966 */ 0x3014, 0x70B9, 0x3015,
+ /* 4969 */ 0x3014, 0x6253, 0x3015,
+ /* 4972 */ 0x3014, 0x76D7, 0x3015,
+ /* 4975 */ 0x3014, 0x52DD, 0x3015,
+ /* 4978 */ 0x3014, 0x6557, 0x3015,
+ /* 4981 */ 0x20122,
+ /* 4982 */ 0x2063A,
+ /* 4983 */ 0x2051C,
+ /* 4984 */ 0x2054B,
+ /* 4985 */ 0x291DF,
+ /* 4986 */ 0x20A2C,
+ /* 4987 */ 0x20B63,
+ /* 4988 */ 0x214E4,
+ /* 4989 */ 0x216A8,
+ /* 4990 */ 0x216EA,
+ /* 4991 */ 0x219C8,
+ /* 4992 */ 0x21B18,
+ /* 4993 */ 0x21DE4,
+ /* 4994 */ 0x21DE6,
+ /* 4995 */ 0x22183,
+ /* 4996 */ 0x2A392,
+ /* 4997 */ 0x22331,
+ /* 4998 */ 0x22331,
+ /* 4999 */ 0x232B8,
+ /* 5000 */ 0x261DA,
+ /* 5001 */ 0x226D4,
+ /* 5002 */ 0x22B0C,
+ /* 5003 */ 0x22BF1,
+ /* 5004 */ 0x2300A,
+ /* 5005 */ 0x233C3,
+ /* 5006 */ 0x2346D,
+ /* 5007 */ 0x236A3,
+ /* 5008 */ 0x238A7,
+ /* 5009 */ 0x23A8D,
+ /* 5010 */ 0x21D0B,
+ /* 5011 */ 0x23AFA,
+ /* 5012 */ 0x23CBC,
+ /* 5013 */ 0x23D1E,
+ /* 5014 */ 0x23ED1,
+ /* 5015 */ 0x23F5E,
+ /* 5016 */ 0x23F8E,
+ /* 5017 */ 0x20525,
+ /* 5018 */ 0x24263,
+ /* 5019 */ 0x243AB,
+ /* 5020 */ 0x24608,
+ /* 5021 */ 0x24735,
+ /* 5022 */ 0x24814,
+ /* 5023 */ 0x24C36,
+ /* 5024 */ 0x24C92,
+ /* 5025 */ 0x2219F,
+ /* 5026 */ 0x24FA1,
+ /* 5027 */ 0x24FB8,
+ /* 5028 */ 0x25044,
+ /* 5029 */ 0x250F3,
+ /* 5030 */ 0x250F2,
+ /* 5031 */ 0x25119,
+ /* 5032 */ 0x25133,
+ /* 5033 */ 0x2541D,
+ /* 5034 */ 0x25626,
+ /* 5035 */ 0x2569A,
+ /* 5036 */ 0x256C5,
+ /* 5037 */ 0x2597C,
+ /* 5038 */ 0x25AA7,
+ /* 5039 */ 0x25AA7,
+ /* 5040 */ 0x25BAB,
+ /* 5041 */ 0x25C80,
+ /* 5042 */ 0x25F86,
+ /* 5043 */ 0x26228,
+ /* 5044 */ 0x26247,
+ /* 5045 */ 0x262D9,
+ /* 5046 */ 0x2633E,
+ /* 5047 */ 0x264DA,
+ /* 5048 */ 0x26523,
+ /* 5049 */ 0x265A8,
+ /* 5050 */ 0x2335F,
+ /* 5051 */ 0x267A7,
+ /* 5052 */ 0x267B5,
+ /* 5053 */ 0x23393,
+ /* 5054 */ 0x2339C,
+ /* 5055 */ 0x26B3C,
+ /* 5056 */ 0x26C36,
+ /* 5057 */ 0x26D6B,
+ /* 5058 */ 0x26CD5,
+ /* 5059 */ 0x273CA,
+ /* 5060 */ 0x26F2C,
+ /* 5061 */ 0x26FB1,
+ /* 5062 */ 0x270D2,
+ /* 5063 */ 0x27667,
+ /* 5064 */ 0x278AE,
+ /* 5065 */ 0x27966,
+ /* 5066 */ 0x27CA8,
+ /* 5067 */ 0x27F2F,
+ /* 5068 */ 0x20804,
+ /* 5069 */ 0x208DE,
+ /* 5070 */ 0x285D2,
+ /* 5071 */ 0x285ED,
+ /* 5072 */ 0x2872E,
+ /* 5073 */ 0x28BFA,
+ /* 5074 */ 0x28D77,
+ /* 5075 */ 0x29145,
+ /* 5076 */ 0x2921A,
+ /* 5077 */ 0x2940A,
+ /* 5078 */ 0x29496,
+ /* 5079 */ 0x295B6,
+ /* 5080 */ 0x29B30,
+ /* 5081 */ 0x2A0CE,
+ /* 5082 */ 0x2A105,
+ /* 5083 */ 0x2A20E,
+ /* 5084 */ 0x2A291,
+ /* 5085 */ 0x2A600
+};
diff --git a/src/include/common/username.h b/src/include/common/username.h
index 0c3d754c61..114304f9e1 100644
--- a/src/include/common/username.h
+++ b/src/include/common/username.h
@@ -2,7 +2,7 @@
* username.h
* lookup effective username
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/common/username.h
*/
diff --git a/src/include/datatype/timestamp.h b/src/include/datatype/timestamp.h
index 68a41ebdc5..16e1b4c44d 100644
--- a/src/include/datatype/timestamp.h
+++ b/src/include/datatype/timestamp.h
@@ -5,7 +5,7 @@
*
* Note: this file must be includable in both frontend and backend contexts.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/datatype/timestamp.h
@@ -15,10 +15,6 @@
#ifndef DATATYPE_TIMESTAMP_H
#define DATATYPE_TIMESTAMP_H
-#include <math.h>
-#include <limits.h>
-#include <float.h>
-
/*
* Timestamp represents absolute time.
*
@@ -29,29 +25,20 @@
* Note that Postgres uses "time interval" to mean a bounded interval,
* consisting of a beginning and ending time, not a time span - thomas 97/03/20
*
- * We have two implementations, one that uses int64 values with units of
- * microseconds, and one that uses double values with units of seconds.
+ * Timestamps, as well as the h/m/s fields of intervals, are stored as
+ * int64 values with units of microseconds. (Once upon a time they were
+ * double values with units of seconds.)
*
- * TimeOffset and fsec_t are convenience typedefs for temporary variables
- * that are of different types in the two cases. Do not use fsec_t in values
- * stored on-disk, since it is not the same size in both implementations.
+ * TimeOffset and fsec_t are convenience typedefs for temporary variables.
+ * Do not use fsec_t in values stored on-disk.
* Also, fsec_t is only meant for *fractional* seconds; beware of overflow
* if the value you need to store could be many seconds.
*/
-#ifdef HAVE_INT64_TIMESTAMP
-
typedef int64 Timestamp;
typedef int64 TimestampTz;
typedef int64 TimeOffset;
typedef int32 fsec_t; /* fractional seconds (in microseconds) */
-#else
-
-typedef double Timestamp;
-typedef double TimestampTz;
-typedef double TimeOffset;
-typedef double fsec_t; /* fractional seconds (in seconds) */
-#endif
typedef struct
{
@@ -62,6 +49,7 @@ typedef struct
} Interval;
+/* Limits on the "precision" option (typmod) for these data types */
#define MAX_TIMESTAMP_PRECISION 6
#define MAX_INTERVAL_PRECISION 6
@@ -118,18 +106,8 @@ typedef struct
/*
* DT_NOBEGIN represents timestamp -infinity; DT_NOEND represents +infinity
*/
-#ifdef HAVE_INT64_TIMESTAMP
#define DT_NOBEGIN PG_INT64_MIN
#define DT_NOEND PG_INT64_MAX
-#else /* !HAVE_INT64_TIMESTAMP */
-#ifdef HUGE_VAL
-#define DT_NOBEGIN (-HUGE_VAL)
-#define DT_NOEND (HUGE_VAL)
-#else
-#define DT_NOBEGIN (-DBL_MAX)
-#define DT_NOEND (DBL_MAX)
-#endif
-#endif /* HAVE_INT64_TIMESTAMP */
#define TIMESTAMP_NOBEGIN(j) \
do {(j) = DT_NOBEGIN;} while (0)
@@ -191,35 +169,22 @@ typedef struct
* so that is the lower bound for both dates and timestamps.
*
* The upper limit for dates is 5874897-12-31, which is a bit less than what
- * the Julian-date code can allow. We use that same limit for timestamps when
- * using floating-point timestamps (so that the timezone offset problem would
- * exist here too if there were no slop). For integer timestamps, the upper
- * limit is 294276-12-31. The int64 overflow limit would be a few days later;
- * again, leaving some slop avoids worries about corner-case overflow, and
- * provides a simpler user-visible definition.
+ * the Julian-date code can allow. For timestamps, the upper limit is
+ * 294276-12-31. The int64 overflow limit would be a few days later; again,
+ * leaving some slop avoids worries about corner-case overflow, and provides
+ * a simpler user-visible definition.
*/
/* First allowed date, and first disallowed date, in Julian-date form */
#define DATETIME_MIN_JULIAN (0)
#define DATE_END_JULIAN (2147483494) /* == date2j(JULIAN_MAXYEAR, 1, 1) */
-#ifdef HAVE_INT64_TIMESTAMP
#define TIMESTAMP_END_JULIAN (109203528) /* == date2j(294277, 1, 1) */
-#else
-#define TIMESTAMP_END_JULIAN DATE_END_JULIAN
-#endif
/* Timestamp limits */
-#ifdef HAVE_INT64_TIMESTAMP
#define MIN_TIMESTAMP INT64CONST(-211813488000000000)
/* == (DATETIME_MIN_JULIAN - POSTGRES_EPOCH_JDATE) * USECS_PER_DAY */
#define END_TIMESTAMP INT64CONST(9223371331200000000)
/* == (TIMESTAMP_END_JULIAN - POSTGRES_EPOCH_JDATE) * USECS_PER_DAY */
-#else
-#define MIN_TIMESTAMP (-211813488000.0)
-/* == (DATETIME_MIN_JULIAN - POSTGRES_EPOCH_JDATE) * SECS_PER_DAY */
-#define END_TIMESTAMP 185330760393600.0
-/* == (TIMESTAMP_END_JULIAN - POSTGRES_EPOCH_JDATE) * SECS_PER_DAY */
-#endif
/* Range-check a date (given in Postgres, not Julian, numbering) */
#define IS_VALID_DATE(d) \
diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h
new file mode 100644
index 0000000000..86fdb33cd3
--- /dev/null
+++ b/src/include/executor/execExpr.h
@@ -0,0 +1,650 @@
+/*-------------------------------------------------------------------------
+ *
+ * execExpr.h
+ * Low level infrastructure related to expression evaluation
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/executor/execExpr.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXEC_EXPR_H
+#define EXEC_EXPR_H
+
+#include "nodes/execnodes.h"
+
+/* forward reference to avoid circularity */
+struct ArrayRefState;
+
+/* Bits in ExprState->flags (see also execnodes.h for public flag bits): */
+/* expression's interpreter has been initialized */
+#define EEO_FLAG_INTERPRETER_INITIALIZED (1 << 1)
+/* jump-threading is in use */
+#define EEO_FLAG_DIRECT_THREADED (1 << 2)
+
+/*
+ * Discriminator for ExprEvalSteps.
+ *
+ * Identifies the operation to be executed and which member in the
+ * ExprEvalStep->d union is valid.
+ *
+ * The order of entries needs to be kept in sync with the dispatch_table[]
+ * array in execExprInterp.c:ExecInterpExpr().
+ */
+typedef enum ExprEvalOp
+{
+ /* entire expression has been evaluated completely, return */
+ EEOP_DONE,
+
+ /* apply slot_getsomeattrs on corresponding tuple slot */
+ EEOP_INNER_FETCHSOME,
+ EEOP_OUTER_FETCHSOME,
+ EEOP_SCAN_FETCHSOME,
+
+ /* compute non-system Var value */
+ /* "FIRST" variants are used only the first time through */
+ EEOP_INNER_VAR_FIRST,
+ EEOP_INNER_VAR,
+ EEOP_OUTER_VAR_FIRST,
+ EEOP_OUTER_VAR,
+ EEOP_SCAN_VAR_FIRST,
+ EEOP_SCAN_VAR,
+
+ /* compute system Var value */
+ EEOP_INNER_SYSVAR,
+ EEOP_OUTER_SYSVAR,
+ EEOP_SCAN_SYSVAR,
+
+ /* compute wholerow Var */
+ EEOP_WHOLEROW,
+
+ /* compute non-system Var value, assign it into ExprState's resultslot */
+ /* (these are not used if _FIRST checks would be needed) */
+ EEOP_ASSIGN_INNER_VAR,
+ EEOP_ASSIGN_OUTER_VAR,
+ EEOP_ASSIGN_SCAN_VAR,
+
+ /* assign ExprState's resvalue/resnull to a column of its resultslot */
+ EEOP_ASSIGN_TMP,
+ /* ditto, applying MakeExpandedObjectReadOnly() */
+ EEOP_ASSIGN_TMP_MAKE_RO,
+
+ /* evaluate Const value */
+ EEOP_CONST,
+
+ /*
+ * Evaluate function call (including OpExprs etc). For speed, we
+ * distinguish in the opcode whether the function is strict and/or
+ * requires usage stats tracking.
+ */
+ EEOP_FUNCEXPR,
+ EEOP_FUNCEXPR_STRICT,
+ EEOP_FUNCEXPR_FUSAGE,
+ EEOP_FUNCEXPR_STRICT_FUSAGE,
+
+ /*
+ * Evaluate boolean AND expression, one step per subexpression. FIRST/LAST
+ * subexpressions are special-cased for performance. Since AND always has
+ * at least two subexpressions, FIRST and LAST never apply to the same
+ * subexpression.
+ */
+ EEOP_BOOL_AND_STEP_FIRST,
+ EEOP_BOOL_AND_STEP,
+ EEOP_BOOL_AND_STEP_LAST,
+
+ /* similarly for boolean OR expression */
+ EEOP_BOOL_OR_STEP_FIRST,
+ EEOP_BOOL_OR_STEP,
+ EEOP_BOOL_OR_STEP_LAST,
+
+ /* evaluate boolean NOT expression */
+ EEOP_BOOL_NOT_STEP,
+
+ /* simplified version of BOOL_AND_STEP for use by ExecQual() */
+ EEOP_QUAL,
+
+ /* unconditional jump to another step */
+ EEOP_JUMP,
+
+ /* conditional jumps based on current result value */
+ EEOP_JUMP_IF_NULL,
+ EEOP_JUMP_IF_NOT_NULL,
+ EEOP_JUMP_IF_NOT_TRUE,
+
+ /* perform NULL tests for scalar values */
+ EEOP_NULLTEST_ISNULL,
+ EEOP_NULLTEST_ISNOTNULL,
+
+ /* perform NULL tests for row values */
+ EEOP_NULLTEST_ROWISNULL,
+ EEOP_NULLTEST_ROWISNOTNULL,
+
+ /* evaluate a BooleanTest expression */
+ EEOP_BOOLTEST_IS_TRUE,
+ EEOP_BOOLTEST_IS_NOT_TRUE,
+ EEOP_BOOLTEST_IS_FALSE,
+ EEOP_BOOLTEST_IS_NOT_FALSE,
+
+ /* evaluate PARAM_EXEC/EXTERN parameters */
+ EEOP_PARAM_EXEC,
+ EEOP_PARAM_EXTERN,
+
+ /* return CaseTestExpr value */
+ EEOP_CASE_TESTVAL,
+
+ /* apply MakeExpandedObjectReadOnly() to target value */
+ EEOP_MAKE_READONLY,
+
+ /* evaluate assorted special-purpose expression types */
+ EEOP_IOCOERCE,
+ EEOP_DISTINCT,
+ EEOP_NULLIF,
+ EEOP_SQLVALUEFUNCTION,
+ EEOP_CURRENTOFEXPR,
+ EEOP_NEXTVALUEEXPR,
+ EEOP_ARRAYEXPR,
+ EEOP_ARRAYCOERCE,
+ EEOP_ROW,
+
+ /*
+ * Compare two individual elements of each of two compared ROW()
+ * expressions. Skip to ROWCOMPARE_FINAL if elements are not equal.
+ */
+ EEOP_ROWCOMPARE_STEP,
+
+ /* evaluate boolean value based on previous ROWCOMPARE_STEP operations */
+ EEOP_ROWCOMPARE_FINAL,
+
+ /* evaluate GREATEST() or LEAST() */
+ EEOP_MINMAX,
+
+ /* evaluate FieldSelect expression */
+ EEOP_FIELDSELECT,
+
+ /*
+ * Deform tuple before evaluating new values for individual fields in a
+ * FieldStore expression.
+ */
+ EEOP_FIELDSTORE_DEFORM,
+
+ /*
+ * Form the new tuple for a FieldStore expression. Individual fields will
+ * have been evaluated into columns of the tuple deformed by the preceding
+ * DEFORM step.
+ */
+ EEOP_FIELDSTORE_FORM,
+
+ /* Process an array subscript; short-circuit expression to NULL if NULL */
+ EEOP_ARRAYREF_SUBSCRIPT,
+
+ /*
+ * Compute old array element/slice when an ArrayRef assignment expression
+ * contains ArrayRef/FieldStore subexpressions. Value is accessed using
+ * the CaseTest mechanism.
+ */
+ EEOP_ARRAYREF_OLD,
+
+ /* compute new value for ArrayRef assignment expression */
+ EEOP_ARRAYREF_ASSIGN,
+
+ /* compute element/slice for ArrayRef fetch expression */
+ EEOP_ARRAYREF_FETCH,
+
+ /* evaluate value for CoerceToDomainValue */
+ EEOP_DOMAIN_TESTVAL,
+
+ /* evaluate a domain's NOT NULL constraint */
+ EEOP_DOMAIN_NOTNULL,
+
+ /* evaluate a single domain CHECK constraint */
+ EEOP_DOMAIN_CHECK,
+
+ /* evaluate assorted special-purpose expression types */
+ EEOP_CONVERT_ROWTYPE,
+ EEOP_SCALARARRAYOP,
+ EEOP_XMLEXPR,
+ EEOP_AGGREF,
+ EEOP_GROUPING_FUNC,
+ EEOP_WINDOW_FUNC,
+ EEOP_SUBPLAN,
+ EEOP_ALTERNATIVE_SUBPLAN,
+
+ /* non-existent operation, used e.g. to check array lengths */
+ EEOP_LAST
+} ExprEvalOp;
+
+
+typedef struct ExprEvalStep
+{
+ /*
+ * Instruction to be executed. During instruction preparation this is an
+ * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
+ * pointer for computed goto (that's why it's an intptr_t).
+ */
+ intptr_t opcode;
+
+ /* where to store the result of this step */
+ Datum *resvalue;
+ bool *resnull;
+
+ /*
+ * Inline data for the operation. Inline data is faster to access, but
+ * also bloats the size of all instructions. The union should be kept to
+ * no more than 40 bytes on 64-bit systems (so that the entire struct is
+ * no more than 64 bytes, a single cacheline on common systems).
+ */
+ union
+ {
+ /* for EEOP_INNER/OUTER/SCAN_FETCHSOME */
+ struct
+ {
+ /* attribute number up to which to fetch (inclusive) */
+ int last_var;
+ } fetch;
+
+ /* for EEOP_INNER/OUTER/SCAN_[SYS]VAR[_FIRST] */
+ struct
+ {
+ /* attnum is attr number - 1 for regular VAR ... */
+ /* but it's just the normal (negative) attr number for SYSVAR */
+ int attnum;
+ Oid vartype; /* type OID of variable */
+ } var;
+
+ /* for EEOP_WHOLEROW */
+ struct
+ {
+ Var *var; /* original Var node in plan tree */
+ bool first; /* first time through, need to initialize? */
+ bool slow; /* need runtime check for nulls? */
+ TupleDesc tupdesc; /* descriptor for resulting tuples */
+ JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
+ } wholerow;
+
+ /* for EEOP_ASSIGN_*_VAR */
+ struct
+ {
+ /* target index in ExprState->resultslot->tts_values/nulls */
+ int resultnum;
+ /* source attribute number - 1 */
+ int attnum;
+ } assign_var;
+
+ /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
+ struct
+ {
+ /* target index in ExprState->resultslot->tts_values/nulls */
+ int resultnum;
+ } assign_tmp;
+
+ /* for EEOP_CONST */
+ struct
+ {
+ /* constant's value */
+ Datum value;
+ bool isnull;
+ } constval;
+
+ /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
+ struct
+ {
+ FmgrInfo *finfo; /* function's lookup data */
+ FunctionCallInfo fcinfo_data; /* arguments etc */
+ /* faster to access without additional indirection: */
+ PGFunction fn_addr; /* actual call address */
+ int nargs; /* number of arguments */
+ } func;
+
+ /* for EEOP_BOOL_*_STEP */
+ struct
+ {
+ bool *anynull; /* track if any input was NULL */
+ int jumpdone; /* jump here if result determined */
+ } boolexpr;
+
+ /* for EEOP_QUAL */
+ struct
+ {
+ int jumpdone; /* jump here on false or null */
+ } qualexpr;
+
+ /* for EEOP_JUMP[_CONDITION] */
+ struct
+ {
+ int jumpdone; /* target instruction's index */
+ } jump;
+
+ /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
+ struct
+ {
+ /* cached tupdesc pointer - filled at runtime */
+ TupleDesc argdesc;
+ } nulltest_row;
+
+ /* for EEOP_PARAM_EXEC/EXTERN */
+ struct
+ {
+ int paramid; /* numeric ID for parameter */
+ Oid paramtype; /* OID of parameter's datatype */
+ } param;
+
+ /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
+ struct
+ {
+ Datum *value; /* value to return */
+ bool *isnull;
+ } casetest;
+
+ /* for EEOP_MAKE_READONLY */
+ struct
+ {
+ Datum *value; /* value to coerce to read-only */
+ bool *isnull;
+ } make_readonly;
+
+ /* for EEOP_IOCOERCE */
+ struct
+ {
+ /* lookup and call info for source type's output function */
+ FmgrInfo *finfo_out;
+ FunctionCallInfo fcinfo_data_out;
+ /* lookup and call info for result type's input function */
+ FmgrInfo *finfo_in;
+ FunctionCallInfo fcinfo_data_in;
+ } iocoerce;
+
+ /* for EEOP_SQLVALUEFUNCTION */
+ struct
+ {
+ SQLValueFunction *svf;
+ } sqlvaluefunction;
+
+ /* for EEOP_NEXTVALUEXPR */
+ struct
+ {
+ Oid seqid;
+ Oid seqtypid;
+ } nextvalueexpr;
+
+ /* for EEOP_ARRAYEXPR */
+ struct
+ {
+ Datum *elemvalues; /* element values get stored here */
+ bool *elemnulls;
+ int nelems; /* length of the above arrays */
+ Oid elemtype; /* array element type */
+ int16 elemlength; /* typlen of the array element type */
+ bool elembyval; /* is the element type pass-by-value? */
+ char elemalign; /* typalign of the element type */
+ bool multidims; /* is array expression multi-D? */
+ } arrayexpr;
+
+ /* for EEOP_ARRAYCOERCE */
+ struct
+ {
+ ArrayCoerceExpr *coerceexpr;
+ Oid resultelemtype; /* element type of result array */
+ FmgrInfo *elemfunc; /* lookup info for element coercion
+ * function */
+ struct ArrayMapState *amstate; /* workspace for array_map */
+ } arraycoerce;
+
+ /* for EEOP_ROW */
+ struct
+ {
+ TupleDesc tupdesc; /* descriptor for result tuples */
+ /* workspace for the values constituting the row: */
+ Datum *elemvalues;
+ bool *elemnulls;
+ } row;
+
+ /* for EEOP_ROWCOMPARE_STEP */
+ struct
+ {
+ /* lookup and call data for column comparison function */
+ FmgrInfo *finfo;
+ FunctionCallInfo fcinfo_data;
+ PGFunction fn_addr;
+ /* target for comparison resulting in NULL */
+ int jumpnull;
+ /* target for comparison yielding inequality */
+ int jumpdone;
+ } rowcompare_step;
+
+ /* for EEOP_ROWCOMPARE_FINAL */
+ struct
+ {
+ RowCompareType rctype;
+ } rowcompare_final;
+
+ /* for EEOP_MINMAX */
+ struct
+ {
+ /* workspace for argument values */
+ Datum *values;
+ bool *nulls;
+ int nelems;
+ /* is it GREATEST or LEAST? */
+ MinMaxOp op;
+ /* lookup and call data for comparison function */
+ FmgrInfo *finfo;
+ FunctionCallInfo fcinfo_data;
+ } minmax;
+
+ /* for EEOP_FIELDSELECT */
+ struct
+ {
+ AttrNumber fieldnum; /* field number to extract */
+ Oid resulttype; /* field's type */
+ /* cached tupdesc pointer - filled at runtime */
+ TupleDesc argdesc;
+ } fieldselect;
+
+ /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
+ struct
+ {
+ /* original expression node */
+ FieldStore *fstore;
+
+ /* cached tupdesc pointer - filled at runtime */
+ /* note that a DEFORM and FORM pair share the same tupdesc */
+ TupleDesc *argdesc;
+
+ /* workspace for column values */
+ Datum *values;
+ bool *nulls;
+ int ncolumns;
+ } fieldstore;
+
+ /* for EEOP_ARRAYREF_SUBSCRIPT */
+ struct
+ {
+ /* too big to have inline */
+ struct ArrayRefState *state;
+ int off; /* 0-based index of this subscript */
+ bool isupper; /* is it upper or lower subscript? */
+ int jumpdone; /* jump here on null */
+ } arrayref_subscript;
+
+ /* for EEOP_ARRAYREF_OLD / ASSIGN / FETCH */
+ struct
+ {
+ /* too big to have inline */
+ struct ArrayRefState *state;
+ } arrayref;
+
+ /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
+ struct
+ {
+ /* name of constraint */
+ char *constraintname;
+ /* where the result of a CHECK constraint will be stored */
+ Datum *checkvalue;
+ bool *checknull;
+ /* OID of domain type */
+ Oid resulttype;
+ } domaincheck;
+
+ /* for EEOP_CONVERT_ROWTYPE */
+ struct
+ {
+ ConvertRowtypeExpr *convert; /* original expression */
+ /* these three fields are filled at runtime: */
+ TupleDesc indesc; /* tupdesc for input type */
+ TupleDesc outdesc; /* tupdesc for output type */
+ TupleConversionMap *map; /* column mapping */
+ bool initialized; /* initialized for current types? */
+ } convert_rowtype;
+
+ /* for EEOP_SCALARARRAYOP */
+ struct
+ {
+ /* element_type/typlen/typbyval/typalign are filled at runtime */
+ Oid element_type; /* InvalidOid if not yet filled */
+ bool useOr; /* use OR or AND semantics? */
+ int16 typlen; /* array element type storage info */
+ bool typbyval;
+ char typalign;
+ FmgrInfo *finfo; /* function's lookup data */
+ FunctionCallInfo fcinfo_data; /* arguments etc */
+ /* faster to access without additional indirection: */
+ PGFunction fn_addr; /* actual call address */
+ } scalararrayop;
+
+ /* for EEOP_XMLEXPR */
+ struct
+ {
+ XmlExpr *xexpr; /* original expression node */
+ /* workspace for evaluating named args, if any */
+ Datum *named_argvalue;
+ bool *named_argnull;
+ /* workspace for evaluating unnamed args, if any */
+ Datum *argvalue;
+ bool *argnull;
+ } xmlexpr;
+
+ /* for EEOP_AGGREF */
+ struct
+ {
+ /* out-of-line state, modified by nodeAgg.c */
+ AggrefExprState *astate;
+ } aggref;
+
+ /* for EEOP_GROUPING_FUNC */
+ struct
+ {
+ AggState *parent; /* parent Agg */
+ List *clauses; /* integer list of column numbers */
+ } grouping_func;
+
+ /* for EEOP_WINDOW_FUNC */
+ struct
+ {
+ /* out-of-line state, modified by nodeWindowFunc.c */
+ WindowFuncExprState *wfstate;
+ } window_func;
+
+ /* for EEOP_SUBPLAN */
+ struct
+ {
+ /* out-of-line state, created by nodeSubplan.c */
+ SubPlanState *sstate;
+ } subplan;
+
+ /* for EEOP_ALTERNATIVE_SUBPLAN */
+ struct
+ {
+ /* out-of-line state, created by nodeSubplan.c */
+ AlternativeSubPlanState *asstate;
+ } alternative_subplan;
+ } d;
+} ExprEvalStep;
+
+
+/* Non-inline data for array operations */
+typedef struct ArrayRefState
+{
+ bool isassignment; /* is it assignment, or just fetch? */
+
+ Oid refelemtype; /* OID of the array element type */
+ int16 refattrlength; /* typlen of array type */
+ int16 refelemlength; /* typlen of the array element type */
+ bool refelembyval; /* is the element type pass-by-value? */
+ char refelemalign; /* typalign of the element type */
+
+ /* numupper and upperprovided[] are filled at compile time */
+ /* at runtime, extracted subscript datums get stored in upperindex[] */
+ int numupper;
+ bool upperprovided[MAXDIM];
+ int upperindex[MAXDIM];
+
+ /* similarly for lower indexes, if any */
+ int numlower;
+ bool lowerprovided[MAXDIM];
+ int lowerindex[MAXDIM];
+
+ /* subscript expressions get evaluated into here */
+ Datum subscriptvalue;
+ bool subscriptnull;
+
+ /* for assignment, new value to assign is evaluated into here */
+ Datum replacevalue;
+ bool replacenull;
+
+ /* if we have a nested assignment, ARRAYREF_OLD puts old value here */
+ Datum prevvalue;
+ bool prevnull;
+} ArrayRefState;
+
+
+extern void ExecReadyInterpretedExpr(ExprState *state);
+
+extern ExprEvalOp ExecEvalStepOp(ExprState *state, ExprEvalStep *op);
+
+/*
+ * Non fast-path execution functions. These are externs instead of statics in
+ * execExprInterp.c, because that allows them to be used by other methods of
+ * expression evaluation, reducing code duplication.
+ */
+extern void ExecEvalParamExec(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalParamExtern(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalSQLValueFunction(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalCurrentOfExpr(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalRowNull(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalRowNotNull(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalArrayCoerce(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalFieldStoreDeForm(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalFieldStoreForm(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern bool ExecEvalArrayRefSubscript(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalArrayRefFetch(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalArrayRefOld(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalArrayRefAssign(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalGroupingFunc(ExprState *state, ExprEvalStep *op);
+extern void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalAlternativeSubPlan(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+extern void ExecEvalWholeRowVar(ExprState *state, ExprEvalStep *op,
+ ExprContext *econtext);
+
+#endif /* EXEC_EXPR_H */
diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h
index f4c6d37a11..0b7ca59dca 100644
--- a/src/include/executor/execParallel.h
+++ b/src/include/executor/execParallel.h
@@ -2,7 +2,7 @@
* execParallel.h
* POSTGRES parallel execution interface
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -17,6 +17,7 @@
#include "nodes/execnodes.h"
#include "nodes/parsenodes.h"
#include "nodes/plannodes.h"
+#include "utils/dsa.h"
typedef struct SharedExecutorInstrumentation SharedExecutorInstrumentation;
@@ -27,6 +28,7 @@ typedef struct ParallelExecutorInfo
BufferUsage *buffer_usage;
SharedExecutorInstrumentation *instrumentation;
shm_mq_handle **tqueue;
+ dsa_area *area;
bool finished;
} ParallelExecutorInfo;
@@ -36,4 +38,6 @@ extern void ExecParallelFinish(ParallelExecutorInfo *pei);
extern void ExecParallelCleanup(ParallelExecutorInfo *pei);
extern void ExecParallelReinitialize(ParallelExecutorInfo *pei);
+extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
+
#endif /* EXECPARALLEL_H */
diff --git a/src/include/executor/execdebug.h b/src/include/executor/execdebug.h
index 950a0bc157..8b61520e18 100644
--- a/src/include/executor/execdebug.h
+++ b/src/include/executor/execdebug.h
@@ -7,7 +7,7 @@
* for debug printouts, because that's more flexible than printf().
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/execdebug.h
@@ -38,13 +38,6 @@
*/
/* ----------------
- * EXEC_EVALDEBUG is a flag which turns on debugging of
- * ExecEval and ExecTargetList() stuff by EV_printf() in execQual.c
- * ----------------
-#undef EXEC_EVALDEBUG
- */
-
-/* ----------------
* EXEC_SORTDEBUG is a flag which turns on debugging of
* the ExecSort() stuff by SO_printf() in nodeSort.c
* ----------------
@@ -86,20 +79,6 @@
#endif /* EXEC_NESTLOOPDEBUG */
/* ----------------
- * exec eval / target list debugging defines
- * ----------------
- */
-#ifdef EXEC_EVALDEBUG
-#define EV_nodeDisplay(l) nodeDisplay(l)
-#define EV_printf(s) printf(s)
-#define EV1_printf(s, a) printf(s, a)
-#else
-#define EV_nodeDisplay(l)
-#define EV_printf(s)
-#define EV1_printf(s, a)
-#endif /* EXEC_EVALDEBUG */
-
-/* ----------------
* sort node debugging defines
* ----------------
*/
@@ -146,4 +125,4 @@
#define MJ_DEBUG_PROC_NODE(slot)
#endif /* EXEC_MERGEJOINDEBUG */
-#endif /* ExecDebugIncluded */
+#endif /* EXECDEBUG_H */
diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h
index ca9edf539f..62a2f2e477 100644
--- a/src/include/executor/execdesc.h
+++ b/src/include/executor/execdesc.h
@@ -6,7 +6,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/execdesc.h
@@ -37,13 +37,13 @@ typedef struct QueryDesc
{
/* These fields are provided by CreateQueryDesc */
CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
- PlannedStmt *plannedstmt; /* planner's output, or null if utility */
- Node *utilitystmt; /* utility statement, or null */
+ PlannedStmt *plannedstmt; /* planner's output (could be utility, too) */
const char *sourceText; /* source text of the query */
Snapshot snapshot; /* snapshot to use for query */
Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */
DestReceiver *dest; /* the destination for tuple output */
ParamListInfo params; /* param values being passed in */
+ QueryEnvironment *queryEnv; /* query environment passed in */
int instrument_options; /* OR of InstrumentOption flags */
/* These fields are set by ExecutorStart */
@@ -58,6 +58,8 @@ typedef struct QueryDesc
* data and distribute via squeue. Otherwise
* get local data from squeue */
#endif
+ /* This field is set by ExecutorRun */
+ bool already_executed; /* true if previously executed */
/* This is always set NULL by the core system, but plugins can change it */
struct Instrumentation *totaltime; /* total time spent in ExecutorRun */
@@ -70,14 +72,9 @@ extern QueryDesc *CreateQueryDesc(PlannedStmt *plannedstmt,
Snapshot crosscheck_snapshot,
DestReceiver *dest,
ParamListInfo params,
+ QueryEnvironment *queryEnv,
int instrument_options);
-extern QueryDesc *CreateUtilityQueryDesc(Node *utilitystmt,
- const char *sourceText,
- Snapshot snapshot,
- DestReceiver *dest,
- ParamListInfo params);
-
extern void FreeQueryDesc(QueryDesc *qdesc);
#endif /* EXECDESC_H */
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 7b5cf2f1f7..fdf7c15b70 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/executor.h
@@ -15,6 +15,7 @@
#ifndef EXECUTOR_H
#define EXECUTOR_H
+#include "catalog/partition.h"
#include "executor/execdesc.h"
#include "nodes/parsenodes.h"
@@ -69,15 +70,6 @@
#endif
-/*
- * ExecEvalExpr was formerly a function containing a switch statement;
- * now it's just a macro invoking the function pointed to by an ExprState
- * node. Beware of double evaluation of the ExprState argument!
- */
-#define ExecEvalExpr(expr, econtext, isNull, isDone) \
- ((*(expr)->evalfunc) (expr, econtext, isNull, isDone))
-
-
/* Hook for plugins to get control in ExecutorStart() */
typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags);
extern PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook;
@@ -85,7 +77,8 @@ extern PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook;
/* Hook for plugins to get control in ExecutorRun() */
typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc,
ScanDirection direction,
- uint64 count);
+ uint64 count,
+ bool execute_once);
extern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook;
/* Hook for plugins to get control in ExecutorFinish() */
@@ -149,9 +142,9 @@ extern void execTuplesHashPrepare(int numCols,
extern TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx,
FmgrInfo *eqfunctions,
FmgrInfo *hashfunctions,
- long nbuckets, Size entrysize,
+ long nbuckets, Size additionalsize,
MemoryContext tablecxt,
- MemoryContext tempcxt);
+ MemoryContext tempcxt, bool use_variable_hash_iv);
extern TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable,
TupleTableSlot *slot,
bool *isnew);
@@ -184,9 +177,9 @@ extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
extern void ExecutorStart(QueryDesc *queryDesc, int eflags);
extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
extern void ExecutorRun(QueryDesc *queryDesc,
- ScanDirection direction, uint64 count);
+ ScanDirection direction, uint64 count, bool execute_once);
extern void standard_ExecutorRun(QueryDesc *queryDesc,
- ScanDirection direction, uint64 count);
+ ScanDirection direction, uint64 count, bool execute_once);
extern void ExecutorFinish(QueryDesc *queryDesc);
extern void standard_ExecutorFinish(QueryDesc *queryDesc);
extern void ExecutorEnd(QueryDesc *queryDesc);
@@ -197,8 +190,10 @@ extern void CheckValidResultRel(Relation resultRel, CmdType operation);
extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
Relation resultRelationDesc,
Index resultRelationIndex,
+ Relation partition_root,
int instrument_options);
extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid);
+extern void ExecCleanUpTriggerState(EState *estate);
extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids);
extern void ExecConstraints(ResultRelInfo *resultRelInfo,
TupleTableSlot *slot, EState *estate);
@@ -220,6 +215,16 @@ extern void EvalPlanQualSetPlan(EPQState *epqstate,
extern void EvalPlanQualSetTuple(EPQState *epqstate, Index rti,
HeapTuple tuple);
extern HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti);
+extern void ExecSetupPartitionTupleRouting(Relation rel,
+ PartitionDispatch **pd,
+ ResultRelInfo **partitions,
+ TupleConversionMap ***tup_conv_maps,
+ TupleTableSlot **partition_tuple_slot,
+ int *num_parted, int *num_partitions);
+extern int ExecFindPartition(ResultRelInfo *resultRelInfo,
+ PartitionDispatch *pd,
+ TupleTableSlot *slot,
+ EState *estate);
#define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
extern void EvalPlanQualFetchRowMarks(EPQState *epqstate);
@@ -240,26 +245,155 @@ extern void ExecEndNode(PlanState *node);
extern bool ExecShutdownNode(PlanState *node);
/*
- * prototypes from functions in execQual.c
+ * prototypes from functions in execExpr.c
*/
-extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno,
- bool *isNull);
-extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
- bool *isNull);
-extern Tuplestorestate *ExecMakeTableFunctionResult(ExprState *funcexpr,
+extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
+extern ExprState *ExecInitQual(List *qual, PlanState *parent);
+extern ExprState *ExecInitCheck(List *qual, PlanState *parent);
+extern List *ExecInitExprList(List *nodes, PlanState *parent);
+extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
+ ExprContext *econtext,
+ TupleTableSlot *slot,
+ PlanState *parent,
+ TupleDesc inputDesc);
+extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
+extern ExprState *ExecPrepareQual(List *qual, EState *estate);
+extern ExprState *ExecPrepareCheck(List *qual, EState *estate);
+extern List *ExecPrepareExprList(List *nodes, EState *estate);
+
+/*
+ * ExecEvalExpr
+ *
+ * Evaluate expression identified by "state" in the execution context
+ * given by "econtext". *isNull is set to the is-null flag for the result,
+ * and the Datum value is the function result.
+ *
+ * The caller should already have switched into the temporary memory
+ * context econtext->ecxt_per_tuple_memory. The convenience entry point
+ * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
+ * do the switch in an outer loop.
+ */
+#ifndef FRONTEND
+static inline Datum
+ExecEvalExpr(ExprState *state,
+ ExprContext *econtext,
+ bool *isNull)
+{
+ return (*state->evalfunc) (state, econtext, isNull);
+}
+#endif
+
+/*
+ * ExecEvalExprSwitchContext
+ *
+ * Same as ExecEvalExpr, but get into the right allocation context explicitly.
+ */
+#ifndef FRONTEND
+static inline Datum
+ExecEvalExprSwitchContext(ExprState *state,
+ ExprContext *econtext,
+ bool *isNull)
+{
+ Datum retDatum;
+ MemoryContext oldContext;
+
+ oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
+ retDatum = (*state->evalfunc) (state, econtext, isNull);
+ MemoryContextSwitchTo(oldContext);
+ return retDatum;
+}
+#endif
+
+/*
+ * ExecProject
+ *
+ * Projects a tuple based on projection info and stores it in the slot passed
+ * to ExecBuildProjectInfo().
+ *
+ * Note: the result is always a virtual tuple; therefore it may reference
+ * the contents of the exprContext's scan tuples and/or temporary results
+ * constructed in the exprContext. If the caller wishes the result to be
+ * valid longer than that data will be valid, he must call ExecMaterializeSlot
+ * on the result slot.
+ */
+#ifndef FRONTEND
+static inline TupleTableSlot *
+ExecProject(ProjectionInfo *projInfo)
+{
+ ExprContext *econtext = projInfo->pi_exprContext;
+ ExprState *state = &projInfo->pi_state;
+ TupleTableSlot *slot = state->resultslot;
+ bool isnull;
+
+ /*
+ * Clear any former contents of the result slot. This makes it safe for
+ * us to use the slot's Datum/isnull arrays as workspace.
+ */
+ ExecClearTuple(slot);
+
+ /* Run the expression, discarding scalar result from the last column. */
+ (void) ExecEvalExprSwitchContext(state, econtext, &isnull);
+
+ /*
+ * Successfully formed a result row. Mark the result slot as containing a
+ * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
+ */
+ slot->tts_isempty = false;
+ slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
+
+ return slot;
+}
+#endif
+
+/*
+ * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
+ * ExecPrepareQual). Returns true if qual is satisfied, else false.
+ *
+ * Note: ExecQual used to have a third argument "resultForNull". The
+ * behavior of this function now corresponds to resultForNull == false.
+ * If you want the resultForNull == true behavior, see ExecCheck.
+ */
+#ifndef FRONTEND
+static inline bool
+ExecQual(ExprState *state, ExprContext *econtext)
+{
+ Datum ret;
+ bool isnull;
+
+ /* short-circuit (here and in ExecInitQual) for empty restriction list */
+ if (state == NULL)
+ return true;
+
+ /* verify that expression was compiled using ExecInitQual */
+ Assert(state->flags & EEO_FLAG_IS_QUAL);
+
+ ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
+
+ /* EEOP_QUAL should never return NULL */
+ Assert(!isnull);
+
+ return DatumGetBool(ret);
+}
+#endif
+
+extern bool ExecCheck(ExprState *state, ExprContext *context);
+
+/*
+ * prototypes from functions in execSRF.c
+ */
+extern SetExprState *ExecInitTableFunctionResult(Expr *expr,
+ ExprContext *econtext, PlanState *parent);
+extern Tuplestorestate *ExecMakeTableFunctionResult(SetExprState *setexpr,
ExprContext *econtext,
MemoryContext argContext,
TupleDesc expectedDesc,
bool randomAccess);
-extern Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext,
- bool *isNull, ExprDoneCond *isDone);
-extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
-extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
-extern bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull);
-extern int ExecTargetListLength(List *targetlist);
-extern int ExecCleanTargetListLength(List *targetlist);
-extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo,
- ExprDoneCond *isDone);
+extern SetExprState *ExecInitFunctionResultSet(Expr *expr,
+ ExprContext *econtext, PlanState *parent);
+extern Datum ExecMakeFunctionResultSet(SetExprState *fcache,
+ ExprContext *econtext,
+ bool *isNull,
+ ExprDoneCond *isDone);
/*
* prototypes from functions in execScan.c
@@ -350,10 +484,6 @@ extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
extern void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc);
extern void ExecAssignResultTypeFromTL(PlanState *planstate);
extern TupleDesc ExecGetResultType(PlanState *planstate);
-extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
- ExprContext *econtext,
- TupleTableSlot *slot,
- TupleDesc inputDesc);
extern void ExecAssignProjectionInfo(PlanState *planstate,
TupleDesc inputDesc);
extern void ExecFreeExprContext(PlanState *planstate);
@@ -365,6 +495,8 @@ extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
extern void ExecCloseScanRelation(Relation scanrel);
+extern int executor_errposition(EState *estate, int location);
+
extern void RegisterExprContextCallback(ExprContext *econtext,
ExprContextCallbackFunction function,
Datum arg);
@@ -372,6 +504,16 @@ extern void UnregisterExprContextCallback(ExprContext *econtext,
ExprContextCallbackFunction function,
Datum arg);
+extern void ExecLockNonLeafAppendTables(List *partitioned_rels, EState *estate);
+
+extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
+ bool *isNull);
+extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno,
+ bool *isNull);
+
+extern int ExecTargetListLength(List *targetlist);
+extern int ExecCleanTargetListLength(List *targetlist);
+
/*
* prototypes from functions in execIndexing.c
*/
@@ -388,5 +530,24 @@ extern void check_exclusion_constraint(Relation heap, Relation index,
Datum *values, bool *isnull,
EState *estate, bool newIndex);
+/*
+ * prototypes from functions in execReplication.c
+ */
+extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
+ LockTupleMode lockmode,
+ TupleTableSlot *searchslot,
+ TupleTableSlot *outslot);
+extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
+ TupleTableSlot *searchslot, TupleTableSlot *outslot);
+
+extern void ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot);
+extern void ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
+ TupleTableSlot *searchslot, TupleTableSlot *slot);
+extern void ExecSimpleRelationDelete(EState *estate, EPQState *epqstate,
+ TupleTableSlot *searchslot);
+extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
+
+extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
+ const char *relname);
#endif /* EXECUTOR_H */
diff --git a/src/include/executor/functions.h b/src/include/executor/functions.h
index 410f0e2c5c..7821a634f1 100644
--- a/src/include/executor/functions.h
+++ b/src/include/executor/functions.h
@@ -4,7 +4,7 @@
* Declarations for execution of SQL-language functions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/functions.h
diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h
index 6d0e12bc5e..ac840533ee 100644
--- a/src/include/executor/hashjoin.h
+++ b/src/include/executor/hashjoin.h
@@ -4,7 +4,7 @@
* internal structures for hash joins
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/hashjoin.h
diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h
index 8e5f0ec03b..c9e169c45c 100644
--- a/src/include/executor/instrument.h
+++ b/src/include/executor/instrument.h
@@ -4,7 +4,7 @@
* definitions for run-time statistics collection
*
*
- * Copyright (c) 2001-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2001-2017, PostgreSQL Global Development Group
*
* src/include/executor/instrument.h
*
diff --git a/src/include/executor/nodeAgg.h b/src/include/executor/nodeAgg.h
index 54c75e8f31..d2fee52e12 100644
--- a/src/include/executor/nodeAgg.h
+++ b/src/include/executor/nodeAgg.h
@@ -4,7 +4,7 @@
* prototypes for nodeAgg.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeAgg.h
diff --git a/src/include/executor/nodeAppend.h b/src/include/executor/nodeAppend.h
index 51c381ee88..6fb4662c88 100644
--- a/src/include/executor/nodeAppend.h
+++ b/src/include/executor/nodeAppend.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeAppend.h
diff --git a/src/include/executor/nodeBitmapAnd.h b/src/include/executor/nodeBitmapAnd.h
index 883ee3536f..1cb3470bcb 100644
--- a/src/include/executor/nodeBitmapAnd.h
+++ b/src/include/executor/nodeBitmapAnd.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeBitmapAnd.h
diff --git a/src/include/executor/nodeBitmapHeapscan.h b/src/include/executor/nodeBitmapHeapscan.h
index 0ed9c7888a..465c58e6ee 100644
--- a/src/include/executor/nodeBitmapHeapscan.h
+++ b/src/include/executor/nodeBitmapHeapscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeBitmapHeapscan.h
@@ -15,10 +15,17 @@
#define NODEBITMAPHEAPSCAN_H
#include "nodes/execnodes.h"
+#include "access/parallel.h"
extern BitmapHeapScanState *ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags);
extern TupleTableSlot *ExecBitmapHeapScan(BitmapHeapScanState *node);
extern void ExecEndBitmapHeapScan(BitmapHeapScanState *node);
extern void ExecReScanBitmapHeapScan(BitmapHeapScanState *node);
+extern void ExecBitmapHeapEstimate(BitmapHeapScanState *node,
+ ParallelContext *pcxt);
+extern void ExecBitmapHeapInitializeDSM(BitmapHeapScanState *node,
+ ParallelContext *pcxt);
+extern void ExecBitmapHeapInitializeWorker(BitmapHeapScanState *node,
+ shm_toc *toc);
#endif /* NODEBITMAPHEAPSCAN_H */
diff --git a/src/include/executor/nodeBitmapIndexscan.h b/src/include/executor/nodeBitmapIndexscan.h
index 34ce521665..1fb8da01cb 100644
--- a/src/include/executor/nodeBitmapIndexscan.h
+++ b/src/include/executor/nodeBitmapIndexscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeBitmapIndexscan.h
diff --git a/src/include/executor/nodeBitmapOr.h b/src/include/executor/nodeBitmapOr.h
index 3885822929..a23bf77ff7 100644
--- a/src/include/executor/nodeBitmapOr.h
+++ b/src/include/executor/nodeBitmapOr.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeBitmapOr.h
diff --git a/src/include/executor/nodeCtescan.h b/src/include/executor/nodeCtescan.h
index ef5c2bc8b7..e8bcb88b35 100644
--- a/src/include/executor/nodeCtescan.h
+++ b/src/include/executor/nodeCtescan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeCtescan.h
diff --git a/src/include/executor/nodeCustom.h b/src/include/executor/nodeCustom.h
index 7d16c2b1fa..c2f2ca1eed 100644
--- a/src/include/executor/nodeCustom.h
+++ b/src/include/executor/nodeCustom.h
@@ -4,7 +4,7 @@
*
* prototypes for CustomScan nodes
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* ------------------------------------------------------------------------
@@ -37,5 +37,6 @@ extern void ExecCustomScanInitializeDSM(CustomScanState *node,
ParallelContext *pcxt);
extern void ExecCustomScanInitializeWorker(CustomScanState *node,
shm_toc *toc);
+extern void ExecShutdownCustomScan(CustomScanState *node);
#endif /* NODECUSTOM_H */
diff --git a/src/include/executor/nodeForeignscan.h b/src/include/executor/nodeForeignscan.h
index 0cdec4e843..1b167b8143 100644
--- a/src/include/executor/nodeForeignscan.h
+++ b/src/include/executor/nodeForeignscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeForeignscan.h
@@ -28,5 +28,6 @@ extern void ExecForeignScanInitializeDSM(ForeignScanState *node,
ParallelContext *pcxt);
extern void ExecForeignScanInitializeWorker(ForeignScanState *node,
shm_toc *toc);
+extern void ExecShutdownForeignScan(ForeignScanState *node);
#endif /* NODEFOREIGNSCAN_H */
diff --git a/src/include/executor/nodeFunctionscan.h b/src/include/executor/nodeFunctionscan.h
index d6e7a61730..efff0deaee 100644
--- a/src/include/executor/nodeFunctionscan.h
+++ b/src/include/executor/nodeFunctionscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeFunctionscan.h
diff --git a/src/include/executor/nodeGather.h b/src/include/executor/nodeGather.h
index f76d9be512..e19bc9b20d 100644
--- a/src/include/executor/nodeGather.h
+++ b/src/include/executor/nodeGather.h
@@ -4,7 +4,7 @@
* prototypes for nodeGather.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeGather.h
diff --git a/src/include/executor/nodeGatherMerge.h b/src/include/executor/nodeGatherMerge.h
new file mode 100644
index 0000000000..f5ba353762
--- /dev/null
+++ b/src/include/executor/nodeGatherMerge.h
@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeGatherMerge.h
+ * prototypes for nodeGatherMerge.c
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/executor/nodeGatherMerge.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEGATHERMERGE_H
+#define NODEGATHERMERGE_H
+
+#include "nodes/execnodes.h"
+
+extern GatherMergeState *ExecInitGatherMerge(GatherMerge *node,
+ EState *estate,
+ int eflags);
+extern TupleTableSlot *ExecGatherMerge(GatherMergeState *node);
+extern void ExecEndGatherMerge(GatherMergeState *node);
+extern void ExecReScanGatherMerge(GatherMergeState *node);
+extern void ExecShutdownGatherMerge(GatherMergeState *node);
+
+#endif /* NODEGATHERMERGE_H */
diff --git a/src/include/executor/nodeGroup.h b/src/include/executor/nodeGroup.h
index 92639f5c63..a9536a3c6f 100644
--- a/src/include/executor/nodeGroup.h
+++ b/src/include/executor/nodeGroup.h
@@ -4,7 +4,7 @@
* prototypes for nodeGroup.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeGroup.h
diff --git a/src/include/executor/nodeHash.h b/src/include/executor/nodeHash.h
index 8cf6d15c1f..fe5c2642d7 100644
--- a/src/include/executor/nodeHash.h
+++ b/src/include/executor/nodeHash.h
@@ -4,7 +4,7 @@
* prototypes for nodeHash.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeHash.h
diff --git a/src/include/executor/nodeHashjoin.h b/src/include/executor/nodeHashjoin.h
index f24127acac..ddc32b1de3 100644
--- a/src/include/executor/nodeHashjoin.h
+++ b/src/include/executor/nodeHashjoin.h
@@ -4,7 +4,7 @@
* prototypes for nodeHashjoin.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeHashjoin.h
diff --git a/src/include/executor/nodeIndexonlyscan.h b/src/include/executor/nodeIndexonlyscan.h
index d63d194a8f..5d3c6bbc0d 100644
--- a/src/include/executor/nodeIndexonlyscan.h
+++ b/src/include/executor/nodeIndexonlyscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeIndexonlyscan.h
@@ -15,6 +15,7 @@
#define NODEINDEXONLYSCAN_H
#include "nodes/execnodes.h"
+#include "access/parallel.h"
extern IndexOnlyScanState *ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags);
extern TupleTableSlot *ExecIndexOnlyScan(IndexOnlyScanState *node);
@@ -23,4 +24,12 @@ extern void ExecIndexOnlyMarkPos(IndexOnlyScanState *node);
extern void ExecIndexOnlyRestrPos(IndexOnlyScanState *node);
extern void ExecReScanIndexOnlyScan(IndexOnlyScanState *node);
+/* Support functions for parallel index-only scans */
+extern void ExecIndexOnlyScanEstimate(IndexOnlyScanState *node,
+ ParallelContext *pcxt);
+extern void ExecIndexOnlyScanInitializeDSM(IndexOnlyScanState *node,
+ ParallelContext *pcxt);
+extern void ExecIndexOnlyScanInitializeWorker(IndexOnlyScanState *node,
+ shm_toc *toc);
+
#endif /* NODEINDEXONLYSCAN_H */
diff --git a/src/include/executor/nodeIndexscan.h b/src/include/executor/nodeIndexscan.h
index 194fadb386..ea3f3a5cc4 100644
--- a/src/include/executor/nodeIndexscan.h
+++ b/src/include/executor/nodeIndexscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeIndexscan.h
@@ -14,6 +14,7 @@
#ifndef NODEINDEXSCAN_H
#define NODEINDEXSCAN_H
+#include "access/parallel.h"
#include "nodes/execnodes.h"
extern IndexScanState *ExecInitIndexScan(IndexScan *node, EState *estate, int eflags);
@@ -22,6 +23,9 @@ extern void ExecEndIndexScan(IndexScanState *node);
extern void ExecIndexMarkPos(IndexScanState *node);
extern void ExecIndexRestrPos(IndexScanState *node);
extern void ExecReScanIndexScan(IndexScanState *node);
+extern void ExecIndexScanEstimate(IndexScanState *node, ParallelContext *pcxt);
+extern void ExecIndexScanInitializeDSM(IndexScanState *node, ParallelContext *pcxt);
+extern void ExecIndexScanInitializeWorker(IndexScanState *node, shm_toc *toc);
/*
* These routines are exported to share code with nodeIndexonlyscan.c and
diff --git a/src/include/executor/nodeLimit.h b/src/include/executor/nodeLimit.h
index 96166b44f2..6e4084b46d 100644
--- a/src/include/executor/nodeLimit.h
+++ b/src/include/executor/nodeLimit.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeLimit.h
diff --git a/src/include/executor/nodeLockRows.h b/src/include/executor/nodeLockRows.h
index e828e9c6ec..c23954131b 100644
--- a/src/include/executor/nodeLockRows.h
+++ b/src/include/executor/nodeLockRows.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeLockRows.h
diff --git a/src/include/executor/nodeMaterial.h b/src/include/executor/nodeMaterial.h
index 2b8cae197d..f6a7241ee7 100644
--- a/src/include/executor/nodeMaterial.h
+++ b/src/include/executor/nodeMaterial.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeMaterial.h
diff --git a/src/include/executor/nodeMergeAppend.h b/src/include/executor/nodeMergeAppend.h
index 0efc489794..eafa15445c 100644
--- a/src/include/executor/nodeMergeAppend.h
+++ b/src/include/executor/nodeMergeAppend.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeMergeAppend.h
diff --git a/src/include/executor/nodeMergejoin.h b/src/include/executor/nodeMergejoin.h
index 74d691ce2c..ffaa3af908 100644
--- a/src/include/executor/nodeMergejoin.h
+++ b/src/include/executor/nodeMergejoin.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeMergejoin.h
diff --git a/src/include/executor/nodeModifyTable.h b/src/include/executor/nodeModifyTable.h
index 6b663537a5..0c327768e1 100644
--- a/src/include/executor/nodeModifyTable.h
+++ b/src/include/executor/nodeModifyTable.h
@@ -3,7 +3,7 @@
* nodeModifyTable.h
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeModifyTable.h
diff --git a/src/include/executor/nodeNamedtuplestorescan.h b/src/include/executor/nodeNamedtuplestorescan.h
new file mode 100644
index 0000000000..9ef477e7ff
--- /dev/null
+++ b/src/include/executor/nodeNamedtuplestorescan.h
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeNamedtuplestorescan.h
+ *
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/executor/nodeNamedtuplestorescan.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODENAMEDTUPLESTORESCAN_H
+#define NODENAMEDTUPLESTORESCAN_H
+
+#include "nodes/execnodes.h"
+
+extern NamedTuplestoreScanState *ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflags);
+extern TupleTableSlot *ExecNamedTuplestoreScan(NamedTuplestoreScanState *node);
+extern void ExecEndNamedTuplestoreScan(NamedTuplestoreScanState *node);
+extern void ExecReScanNamedTuplestoreScan(NamedTuplestoreScanState *node);
+
+#endif /* NODENAMEDTUPLESTORESCAN_H */
diff --git a/src/include/executor/nodeNestloop.h b/src/include/executor/nodeNestloop.h
index eeb42d6cea..4b2bf59050 100644
--- a/src/include/executor/nodeNestloop.h
+++ b/src/include/executor/nodeNestloop.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeNestloop.h
diff --git a/src/include/executor/nodeProjectSet.h b/src/include/executor/nodeProjectSet.h
new file mode 100644
index 0000000000..30b2b7cec9
--- /dev/null
+++ b/src/include/executor/nodeProjectSet.h
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeProjectSet.h
+ *
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/executor/nodeProjectSet.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEPROJECTSET_H
+#define NODEPROJECTSET_H
+
+#include "nodes/execnodes.h"
+
+extern ProjectSetState *ExecInitProjectSet(ProjectSet *node, EState *estate, int eflags);
+extern TupleTableSlot *ExecProjectSet(ProjectSetState *node);
+extern void ExecEndProjectSet(ProjectSetState *node);
+extern void ExecReScanProjectSet(ProjectSetState *node);
+
+#endif /* NODEPROJECTSET_H */
diff --git a/src/include/executor/nodeRecursiveunion.h b/src/include/executor/nodeRecursiveunion.h
index 1c087907c2..066596f773 100644
--- a/src/include/executor/nodeRecursiveunion.h
+++ b/src/include/executor/nodeRecursiveunion.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeRecursiveunion.h
diff --git a/src/include/executor/nodeResult.h b/src/include/executor/nodeResult.h
index 356027f8cf..8e547b77e9 100644
--- a/src/include/executor/nodeResult.h
+++ b/src/include/executor/nodeResult.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeResult.h
diff --git a/src/include/executor/nodeSamplescan.h b/src/include/executor/nodeSamplescan.h
index c8f03d8b18..8baf3a355c 100644
--- a/src/include/executor/nodeSamplescan.h
+++ b/src/include/executor/nodeSamplescan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeSamplescan.h
diff --git a/src/include/executor/nodeSeqscan.h b/src/include/executor/nodeSeqscan.h
index f2e61ffdb3..92b305e138 100644
--- a/src/include/executor/nodeSeqscan.h
+++ b/src/include/executor/nodeSeqscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeSeqscan.h
diff --git a/src/include/executor/nodeSetOp.h b/src/include/executor/nodeSetOp.h
index c6e9603204..887bdc1a42 100644
--- a/src/include/executor/nodeSetOp.h
+++ b/src/include/executor/nodeSetOp.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeSetOp.h
diff --git a/src/include/executor/nodeSort.h b/src/include/executor/nodeSort.h
index 481065fdbe..10d16b47b1 100644
--- a/src/include/executor/nodeSort.h
+++ b/src/include/executor/nodeSort.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeSort.h
diff --git a/src/include/executor/nodeSubplan.h b/src/include/executor/nodeSubplan.h
index f05a47419d..0d3f52118b 100644
--- a/src/include/executor/nodeSubplan.h
+++ b/src/include/executor/nodeSubplan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeSubplan.h
@@ -20,6 +20,10 @@ extern SubPlanState *ExecInitSubPlan(SubPlan *subplan, PlanState *parent);
extern AlternativeSubPlanState *ExecInitAlternativeSubPlan(AlternativeSubPlan *asplan, PlanState *parent);
+extern Datum ExecSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull);
+
+extern Datum ExecAlternativeSubPlan(AlternativeSubPlanState *node, ExprContext *econtext, bool *isNull);
+
extern void ExecReScanSetParamPlan(SubPlanState *node, PlanState *parent);
extern void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext);
diff --git a/src/include/executor/nodeSubqueryscan.h b/src/include/executor/nodeSubqueryscan.h
index 427699be0b..c2a0f707a6 100644
--- a/src/include/executor/nodeSubqueryscan.h
+++ b/src/include/executor/nodeSubqueryscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeSubqueryscan.h
diff --git a/src/include/executor/nodeTableFuncscan.h b/src/include/executor/nodeTableFuncscan.h
new file mode 100644
index 0000000000..529c929993
--- /dev/null
+++ b/src/include/executor/nodeTableFuncscan.h
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeTableFuncscan.h
+ *
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/executor/nodeTableFuncscan.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODETABLEFUNCSCAN_H
+#define NODETABLEFUNCSCAN_H
+
+#include "nodes/execnodes.h"
+
+extern TableFuncScanState *ExecInitTableFuncScan(TableFuncScan *node, EState *estate, int eflags);
+extern TupleTableSlot *ExecTableFuncScan(TableFuncScanState *node);
+extern void ExecEndTableFuncScan(TableFuncScanState *node);
+extern void ExecReScanTableFuncScan(TableFuncScanState *node);
+
+#endif /* NODETABLEFUNCSCAN_H */
diff --git a/src/include/executor/nodeTidscan.h b/src/include/executor/nodeTidscan.h
index 76c2a9f297..3186ca8cff 100644
--- a/src/include/executor/nodeTidscan.h
+++ b/src/include/executor/nodeTidscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeTidscan.h
diff --git a/src/include/executor/nodeUnique.h b/src/include/executor/nodeUnique.h
index aa8491dd3c..66ad898397 100644
--- a/src/include/executor/nodeUnique.h
+++ b/src/include/executor/nodeUnique.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeUnique.h
diff --git a/src/include/executor/nodeValuesscan.h b/src/include/executor/nodeValuesscan.h
index 026f261c51..6c2af73b1f 100644
--- a/src/include/executor/nodeValuesscan.h
+++ b/src/include/executor/nodeValuesscan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeValuesscan.h
diff --git a/src/include/executor/nodeWindowAgg.h b/src/include/executor/nodeWindowAgg.h
index 94ed0372e6..11d2dba2c5 100644
--- a/src/include/executor/nodeWindowAgg.h
+++ b/src/include/executor/nodeWindowAgg.h
@@ -4,7 +4,7 @@
* prototypes for nodeWindowAgg.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeWindowAgg.h
diff --git a/src/include/executor/nodeWorktablescan.h b/src/include/executor/nodeWorktablescan.h
index 217208a112..7790ca2e1b 100644
--- a/src/include/executor/nodeWorktablescan.h
+++ b/src/include/executor/nodeWorktablescan.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/nodeWorktablescan.h
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index 6d1320deda..c22b3ed5d6 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -3,7 +3,7 @@
* spi.h
* Server Programming Interface public declarations
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/spi.h
@@ -13,6 +13,7 @@
#ifndef SPI_H
#define SPI_H
+#include "commands/trigger.h"
#include "lib/ilist.h"
#include "nodes/parsenodes.h"
#include "utils/portal.h"
@@ -43,6 +44,8 @@ typedef struct _SPI_plan *SPIPlanPtr;
#define SPI_ERROR_NOATTRIBUTE (-9)
#define SPI_ERROR_NOOUTFUNC (-10)
#define SPI_ERROR_TYPUNKNOWN (-11)
+#define SPI_ERROR_REL_DUPLICATE (-12)
+#define SPI_ERROR_REL_NOT_FOUND (-13)
#define SPI_OK_CONNECT 1
#define SPI_OK_FINISH 2
@@ -58,6 +61,16 @@ typedef struct _SPI_plan *SPIPlanPtr;
#define SPI_OK_DELETE_RETURNING 12
#define SPI_OK_UPDATE_RETURNING 13
#define SPI_OK_REWRITTEN 14
+#define SPI_OK_REL_REGISTER 15
+#define SPI_OK_REL_UNREGISTER 16
+#define SPI_OK_TD_REGISTER 17
+
+/* These used to be functions, now just no-ops for backwards compatibility */
+#define SPI_push() ((void) 0)
+#define SPI_pop() ((void) 0)
+#define SPI_push_conditional() false
+#define SPI_pop_conditional(pushed) ((void) 0)
+#define SPI_restore_connection() ((void) 0)
extern PGDLLIMPORT uint64 SPI_processed;
extern PGDLLIMPORT Oid SPI_lastoid;
@@ -66,11 +79,6 @@ extern PGDLLIMPORT int SPI_result;
extern int SPI_connect(void);
extern int SPI_finish(void);
-extern void SPI_push(void);
-extern void SPI_pop(void);
-extern bool SPI_push_conditional(void);
-extern void SPI_pop_conditional(bool pushed);
-extern void SPI_restore_connection(void);
extern int SPI_execute(const char *src, bool read_only, long tcount);
extern int SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls,
bool read_only, long tcount);
@@ -144,6 +152,10 @@ extern void SPI_scroll_cursor_fetch(Portal, FetchDirection direction, long count
extern void SPI_scroll_cursor_move(Portal, FetchDirection direction, long count);
extern void SPI_cursor_close(Portal portal);
+extern int SPI_register_relation(EphemeralNamedRelation enr);
+extern int SPI_unregister_relation(const char *name);
+extern int SPI_register_trigger_data(TriggerData *tdata);
+
extern void AtEOXact_SPI(bool isCommit);
extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid);
diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h
index e8084dff09..49aa7c94e7 100644
--- a/src/include/executor/spi_priv.h
+++ b/src/include/executor/spi_priv.h
@@ -3,7 +3,7 @@
* spi_priv.h
* Server Programming Interface private declarations
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/spi_priv.h
@@ -14,6 +14,7 @@
#define SPI_PRIV_H
#include "executor/spi.h"
+#include "utils/queryenvironment.h"
#define _SPI_PLAN_MAGIC 569278163
@@ -31,6 +32,7 @@ typedef struct
MemoryContext execCxt; /* executor context */
MemoryContext savedcxt; /* context of SPI_connect's caller */
SubTransactionId connectSubid; /* ID of connecting subtransaction */
+ QueryEnvironment *queryEnv; /* query environment setup for SPI level */
} _SPI_connection;
/*
diff --git a/src/include/executor/tablefunc.h b/src/include/executor/tablefunc.h
new file mode 100644
index 0000000000..22ca916eb2
--- /dev/null
+++ b/src/include/executor/tablefunc.h
@@ -0,0 +1,67 @@
+/*-------------------------------------------------------------------------
+ *
+ * tablefunc.h
+ * interface for TableFunc executor node
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/executor/tablefunc.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef _TABLEFUNC_H
+#define _TABLEFUNC_H
+
+/* Forward-declare this to avoid including execnodes.h here */
+struct TableFuncScanState;
+
+/*
+ * TableFuncRoutine holds function pointers used for generating content of
+ * table-producer functions, such as XMLTABLE.
+ *
+ * InitBuilder initialize table builder private objects. The output tuple
+ * descriptor, input functions for the columns, and typioparams are passed
+ * from executor state.
+ *
+ * SetDoc is called to define the input document. The table builder may
+ * apply additional transformations not exposed outside the table builder
+ * context.
+ *
+ * SetNamespace is called to pass namespace declarations from the table
+ * expression. This function may be NULL if namespaces are not supported by
+ * the table builder. Namespaces must be given before setting the row and
+ * column filters. If the name is given as NULL, the entry shall be for the
+ * default namespace.
+ *
+ * SetRowFilter is called do define the row-generating filter, which shall be
+ * used to extract each row from the input document.
+ *
+ * SetColumnFilter is called once for each column, to define the column-
+ * generating filter for the given column.
+ *
+ * FetchRow shall be called repeatedly until it returns that no more rows are
+ * found in the document. On each invocation it shall set state in the table
+ * builder context such that each subsequent GetValue call returns the values
+ * for the indicated column for the row being processed.
+ *
+ * DestroyBuilder shall release all resources associated with a table builder
+ * context. It may be called either because all rows have been consumed, or
+ * because an error ocurred while processing the table expression.
+ */
+typedef struct TableFuncRoutine
+{
+ void (*InitOpaque) (struct TableFuncScanState *state, int natts);
+ void (*SetDocument) (struct TableFuncScanState *state, Datum value);
+ void (*SetNamespace) (struct TableFuncScanState *state, char *name,
+ char *uri);
+ void (*SetRowFilter) (struct TableFuncScanState *state, char *path);
+ void (*SetColumnFilter) (struct TableFuncScanState *state,
+ char *path, int colnum);
+ bool (*FetchRow) (struct TableFuncScanState *state);
+ Datum (*GetValue) (struct TableFuncScanState *state, int colnum,
+ Oid typid, int32 typmod, bool *isnull);
+ void (*DestroyOpaque) (struct TableFuncScanState *state);
+} TableFuncRoutine;
+
+#endif /* _TABLEFUNC_H */
diff --git a/src/include/executor/tqueue.h b/src/include/executor/tqueue.h
index 3a0aba162d..892eec812e 100644
--- a/src/include/executor/tqueue.h
+++ b/src/include/executor/tqueue.h
@@ -3,7 +3,7 @@
* tqueue.h
* Use shm_mq to send & receive tuples between parallel backends
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/tqueue.h
diff --git a/src/include/executor/tstoreReceiver.h b/src/include/executor/tstoreReceiver.h
index 54e67ea367..cd15e27821 100644
--- a/src/include/executor/tstoreReceiver.h
+++ b/src/include/executor/tstoreReceiver.h
@@ -4,7 +4,7 @@
* prototypes for tstoreReceiver.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/tstoreReceiver.h
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h
index bfcca219e0..efdb6fee5a 100644
--- a/src/include/executor/tuptable.h
+++ b/src/include/executor/tuptable.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/tuptable.h
diff --git a/src/include/fe_utils/mbprint.h b/src/include/fe_utils/mbprint.h
index e37eb5cb33..56626f631b 100644
--- a/src/include/fe_utils/mbprint.h
+++ b/src/include/fe_utils/mbprint.h
@@ -3,7 +3,7 @@
* Multibyte character printing support for frontend code
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fe_utils/mbprint.h
diff --git a/src/include/fe_utils/print.h b/src/include/fe_utils/print.h
index 18aee93ecd..d89b6febcb 100644
--- a/src/include/fe_utils/print.h
+++ b/src/include/fe_utils/print.h
@@ -3,7 +3,7 @@
* Query-result printing support for frontend code
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fe_utils/print.h
diff --git a/src/include/fe_utils/psqlscan.h b/src/include/fe_utils/psqlscan.h
index 1f10ecc2d4..e9c8143925 100644
--- a/src/include/fe_utils/psqlscan.h
+++ b/src/include/fe_utils/psqlscan.h
@@ -10,7 +10,7 @@
* backslash commands.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fe_utils/psqlscan.h
@@ -48,12 +48,22 @@ typedef enum _promptStatus
PROMPT_COPY
} promptStatus_t;
+/* Quoting request types for get_variable() callback */
+typedef enum
+{
+ PQUOTE_PLAIN, /* just return the actual value */
+ PQUOTE_SQL_LITERAL, /* add quotes to make a valid SQL literal */
+ PQUOTE_SQL_IDENT, /* quote if needed to make a SQL identifier */
+ PQUOTE_SHELL_ARG /* quote if needed to be safe in a shell cmd */
+} PsqlScanQuoteType;
+
/* Callback functions to be used by the lexer */
typedef struct PsqlScanCallbacks
{
- /* Fetch value of a variable, as a pfree'able string; NULL if unknown */
+ /* Fetch value of a variable, as a free'able string; NULL if unknown */
/* This pointer can be NULL if no variable substitution is wanted */
- char *(*get_variable) (const char *varname, bool escape, bool as_ident);
+ char *(*get_variable) (const char *varname, PsqlScanQuoteType quote,
+ void *passthrough);
/* Print an error message someplace appropriate */
/* (very old gcc versions don't support attributes on function pointers) */
#if defined(__GNUC__) && __GNUC__ < 4
@@ -67,6 +77,8 @@ typedef struct PsqlScanCallbacks
extern PsqlScanState psql_scan_create(const PsqlScanCallbacks *callbacks);
extern void psql_scan_destroy(PsqlScanState state);
+extern void psql_scan_set_passthrough(PsqlScanState state, void *passthrough);
+
extern void psql_scan_setup(PsqlScanState state,
const char *line, int line_len,
int encoding, bool std_strings);
diff --git a/src/include/fe_utils/psqlscan_int.h b/src/include/fe_utils/psqlscan_int.h
index a52929d5ab..af62f5ebdf 100644
--- a/src/include/fe_utils/psqlscan_int.h
+++ b/src/include/fe_utils/psqlscan_int.h
@@ -34,7 +34,7 @@
* same flex version, or if they don't use the same flex options.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fe_utils/psqlscan_int.h
@@ -115,9 +115,11 @@ typedef struct PsqlScanStateData
char *dolqstart; /* current $foo$ quote start string */
/*
- * Callback functions provided by the program making use of the lexer.
+ * Callback functions provided by the program making use of the lexer,
+ * plus a void* callback passthrough argument.
*/
const PsqlScanCallbacks *callbacks;
+ void *cb_passthrough;
} PsqlScanStateData;
@@ -139,6 +141,6 @@ extern char *psqlscan_extract_substring(PsqlScanState state,
const char *txt, int len);
extern void psqlscan_escape_variable(PsqlScanState state,
const char *txt, int len,
- bool as_ident);
+ PsqlScanQuoteType quote);
#endif /* PSQLSCAN_INT_H */
diff --git a/src/include/fe_utils/simple_list.h b/src/include/fe_utils/simple_list.h
index 87d32fbac9..b63f5dc061 100644
--- a/src/include/fe_utils/simple_list.h
+++ b/src/include/fe_utils/simple_list.h
@@ -7,7 +7,7 @@
* it's all we need in, eg, pg_dump.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fe_utils/simple_list.h
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index 7bbed360a3..c68234335e 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -6,7 +6,7 @@
* assorted contexts.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fe_utils/string_utils.h
@@ -19,8 +19,6 @@
#include "libpq-fe.h"
#include "pqexpbuffer.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
/* Global variables controlling behavior of fmtId() and fmtQualifiedId() */
extern int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);
@@ -30,6 +28,9 @@ extern const char *fmtId(const char *identifier);
extern const char *fmtQualifiedId(int remoteVersion,
const char *schema, const char *id);
+extern char *formatPGVersionNumber(int version_number, bool include_minor,
+ char *buf, size_t buflen);
+
extern void appendStringLiteral(PQExpBuffer buf, const char *str,
int encoding, bool std_strings);
extern void appendStringLiteralConn(PQExpBuffer buf, const char *str,
@@ -41,6 +42,7 @@ extern void appendByteaLiteral(PQExpBuffer buf,
bool std_strings);
extern void appendShellString(PQExpBuffer buf, const char *str);
+extern bool appendShellStringNoError(PQExpBuffer buf, const char *str);
extern void appendConnStrVal(PQExpBuffer buf, const char *str);
extern void appendPsqlMetaConnect(PQExpBuffer buf, const char *dbname);
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index 0491e2e1d1..cfb7b7774d 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -8,7 +8,7 @@
* or call fmgr-callable functions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/fmgr.h
@@ -49,6 +49,9 @@ typedef Datum (*PGFunction) (FunctionCallInfo fcinfo);
* arguments, rather than about the function itself. But it's convenient
* to store it here rather than in FunctionCallInfoData, where it might more
* logically belong.
+ *
+ * fn_extra is available for use by the called function; all other fields
+ * should be treated as read-only after the struct is created.
*/
typedef struct FmgrInfo
{
@@ -65,6 +68,11 @@ typedef struct FmgrInfo
/*
* This struct is the data actually passed to an fmgr-called function.
+ *
+ * The called function is expected to set isnull, and possibly resultinfo or
+ * fields in whatever resultinfo points to. It should not change any other
+ * fields. (In particular, scribbling on the argument arrays is a bad idea,
+ * since some callers assume they can re-call with the same arguments.)
*/
typedef struct FunctionCallInfoData
{
@@ -178,11 +186,12 @@ extern void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo,
* The resulting datum can be accessed using VARSIZE_ANY() and VARDATA_ANY()
* (beware of multiple evaluations in those macros!)
*
- * WARNING: It is only safe to use pg_detoast_datum_packed() and
- * VARDATA_ANY() if you really don't care about the alignment. Either because
- * you're working with something like text where the alignment doesn't matter
- * or because you're not going to access its constituent parts and just use
- * things like memcpy on it anyways.
+ * In consumers oblivious to data alignment, call PG_DETOAST_DATUM_PACKED(),
+ * VARDATA_ANY(), VARSIZE_ANY() and VARSIZE_ANY_EXHDR(). Elsewhere, call
+ * PG_DETOAST_DATUM(), VARDATA() and VARSIZE(). Directly fetching an int16,
+ * int32 or wider field in the struct representing the datum layout requires
+ * aligned data. memcpy() is alignment-oblivious, as are most operations on
+ * datatypes, such as text, whose layout struct contains only char fields.
*
* Note: it'd be nice if these could be macros, but I see no way to do that
* without evaluating the arguments multiple times, which is NOT acceptable.
@@ -243,13 +252,9 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena * datum);
/* and this if you can handle 1-byte-header datums: */
#define PG_GETARG_VARLENA_PP(n) PG_DETOAST_DATUM_PACKED(PG_GETARG_DATUM(n))
/* DatumGetFoo macros for varlena types will typically look like this: */
-#define DatumGetByteaP(X) ((bytea *) PG_DETOAST_DATUM(X))
#define DatumGetByteaPP(X) ((bytea *) PG_DETOAST_DATUM_PACKED(X))
-#define DatumGetTextP(X) ((text *) PG_DETOAST_DATUM(X))
#define DatumGetTextPP(X) ((text *) PG_DETOAST_DATUM_PACKED(X))
-#define DatumGetBpCharP(X) ((BpChar *) PG_DETOAST_DATUM(X))
#define DatumGetBpCharPP(X) ((BpChar *) PG_DETOAST_DATUM_PACKED(X))
-#define DatumGetVarCharP(X) ((VarChar *) PG_DETOAST_DATUM(X))
#define DatumGetVarCharPP(X) ((VarChar *) PG_DETOAST_DATUM_PACKED(X))
#define DatumGetHeapTupleHeader(X) ((HeapTupleHeader) PG_DETOAST_DATUM(X))
/* And we also offer variants that return an OK-to-write copy */
@@ -264,13 +269,9 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena * datum);
#define DatumGetBpCharPSlice(X,m,n) ((BpChar *) PG_DETOAST_DATUM_SLICE(X,m,n))
#define DatumGetVarCharPSlice(X,m,n) ((VarChar *) PG_DETOAST_DATUM_SLICE(X,m,n))
/* GETARG macros for varlena types will typically look like this: */
-#define PG_GETARG_BYTEA_P(n) DatumGetByteaP(PG_GETARG_DATUM(n))
#define PG_GETARG_BYTEA_PP(n) DatumGetByteaPP(PG_GETARG_DATUM(n))
-#define PG_GETARG_TEXT_P(n) DatumGetTextP(PG_GETARG_DATUM(n))
#define PG_GETARG_TEXT_PP(n) DatumGetTextPP(PG_GETARG_DATUM(n))
-#define PG_GETARG_BPCHAR_P(n) DatumGetBpCharP(PG_GETARG_DATUM(n))
#define PG_GETARG_BPCHAR_PP(n) DatumGetBpCharPP(PG_GETARG_DATUM(n))
-#define PG_GETARG_VARCHAR_P(n) DatumGetVarCharP(PG_GETARG_DATUM(n))
#define PG_GETARG_VARCHAR_PP(n) DatumGetVarCharPP(PG_GETARG_DATUM(n))
#define PG_GETARG_HEAPTUPLEHEADER(n) DatumGetHeapTupleHeader(PG_GETARG_DATUM(n))
/* And we also offer variants that return an OK-to-write copy */
@@ -284,6 +285,21 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena * datum);
#define PG_GETARG_TEXT_P_SLICE(n,a,b) DatumGetTextPSlice(PG_GETARG_DATUM(n),a,b)
#define PG_GETARG_BPCHAR_P_SLICE(n,a,b) DatumGetBpCharPSlice(PG_GETARG_DATUM(n),a,b)
#define PG_GETARG_VARCHAR_P_SLICE(n,a,b) DatumGetVarCharPSlice(PG_GETARG_DATUM(n),a,b)
+/*
+ * Obsolescent variants that guarantee INT alignment for the return value.
+ * Few operations on these particular types need alignment, mainly operations
+ * that cast the VARDATA pointer to a type like int16[]. Most code should use
+ * the ...PP(X) counterpart. Nonetheless, these appear frequently in code
+ * predating the PostgreSQL 8.3 introduction of the ...PP(X) variants.
+ */
+#define DatumGetByteaP(X) ((bytea *) PG_DETOAST_DATUM(X))
+#define DatumGetTextP(X) ((text *) PG_DETOAST_DATUM(X))
+#define DatumGetBpCharP(X) ((BpChar *) PG_DETOAST_DATUM(X))
+#define DatumGetVarCharP(X) ((VarChar *) PG_DETOAST_DATUM(X))
+#define PG_GETARG_BYTEA_P(n) DatumGetByteaP(PG_GETARG_DATUM(n))
+#define PG_GETARG_TEXT_P(n) DatumGetTextP(PG_GETARG_DATUM(n))
+#define PG_GETARG_BPCHAR_P(n) DatumGetBpCharP(PG_GETARG_DATUM(n))
+#define PG_GETARG_VARCHAR_P(n) DatumGetVarCharP(PG_GETARG_DATUM(n))
/* To return a NULL do this: */
#define PG_RETURN_NULL() \
@@ -320,10 +336,10 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena * datum);
/*-------------------------------------------------------------------------
* Support for detecting call convention of dynamically-loaded functions
*
- * Dynamically loaded functions may use either the version-1 ("new style")
- * or version-0 ("old style") calling convention. Version 1 is the call
- * convention defined in this header file; version 0 is the old "plain C"
- * convention. A version-1 function must be accompanied by the macro call
+ * Dynamically loaded functions currently can only use the version-1 ("new
+ * style") calling convention. Version-0 ("old style") is not supported
+ * anymore. Version 1 is the call convention defined in this header file, and
+ * must be accompanied by the macro call
*
* PG_FUNCTION_INFO_V1(function_name);
*
@@ -344,11 +360,18 @@ typedef const Pg_finfo_record *(*PGFInfoFunction) (void);
/*
* Macro to build an info function associated with the given function name.
- * Win32 loadable functions usually link with 'dlltool --export-all', but it
- * doesn't hurt to add PGDLLIMPORT in case they don't.
+ *
+ * As a convenience, also provide an "extern" declaration for the given
+ * function name, so that writers of C functions need not write that too.
+ *
+ * On Windows, the function and info function must be exported. Our normal
+ * build processes take care of that via .DEF files or --export-all-symbols.
+ * Module authors using a different build process might need to manually
+ * declare the function PGDLLEXPORT. We do that automatically here for the
+ * info function, since authors shouldn't need to be explicitly aware of it.
*/
#define PG_FUNCTION_INFO_V1(funcname) \
-Datum funcname(PG_FUNCTION_ARGS); \
+extern Datum funcname(PG_FUNCTION_ARGS); \
extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
const Pg_finfo_record * \
CppConcat(pg_finfo_,funcname) (void) \
@@ -468,6 +491,19 @@ extern Datum DirectFunctionCall9Coll(PGFunction func, Oid collation,
Datum arg6, Datum arg7, Datum arg8,
Datum arg9);
+/*
+ * These functions work like the DirectFunctionCall functions except that
+ * they use the flinfo parameter to initialise the fcinfo for the call.
+ * It's recommended that the callee only use the fn_extra and fn_mcxt
+ * fields, as other fields will typically describe the calling function
+ * not the callee. Conversely, the calling function should not have
+ * used fn_extra, unless its use is known to be compatible with the callee's.
+ */
+extern Datum CallerFInfoFunctionCall1(PGFunction func, FmgrInfo *flinfo,
+ Oid collation, Datum arg1);
+extern Datum CallerFInfoFunctionCall2(PGFunction func, FmgrInfo *flinfo,
+ Oid collation, Datum arg1, Datum arg2);
+
/* These are for invocation of a previously-looked-up function with a
* directly-computed parameter list. Note that neither arguments nor result
* are allowed to be NULL.
@@ -621,7 +657,7 @@ extern bytea *OidSendFunctionCall(Oid functionId, Datum val);
/*
* Routines in fmgr.c
*/
-extern const Pg_finfo_record *fetch_finfo_record(void *filehandle, char *funcname);
+extern const Pg_finfo_record *fetch_finfo_record(void *filehandle, const char *funcname);
extern void clear_external_function_hash(void *filehandle);
extern Oid fmgr_internal_function(const char *proname);
extern Oid get_fn_expr_rettype(FmgrInfo *flinfo);
@@ -637,9 +673,9 @@ extern bool CheckFunctionValidatorAccess(Oid validatorOid, Oid functionOid);
*/
extern char *Dynamic_library_path;
-extern PGFunction load_external_function(char *filename, char *funcname,
+extern PGFunction load_external_function(const char *filename, const char *funcname,
bool signalNotFound, void **filehandle);
-extern PGFunction lookup_external_function(void *filehandle, char *funcname);
+extern PGFunction lookup_external_function(void *filehandle, const char *funcname);
extern void load_file(const char *filename, bool restricted);
extern void **find_rendezvous_variable(const char *varName);
extern Size EstimateLibraryStateSpace(void);
diff --git a/src/include/foreign/fdwapi.h b/src/include/foreign/fdwapi.h
index e1b0d0da7d..6ca44f734f 100644
--- a/src/include/foreign/fdwapi.h
+++ b/src/include/foreign/fdwapi.h
@@ -3,7 +3,7 @@
* fdwapi.h
* API for foreign-data wrappers
*
- * Copyright (c) 2010-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2010-2017, PostgreSQL Global Development Group
*
* src/include/foreign/fdwapi.h
*
@@ -151,6 +151,7 @@ typedef void (*InitializeDSMForeignScan_function) (ForeignScanState *node,
typedef void (*InitializeWorkerForeignScan_function) (ForeignScanState *node,
shm_toc *toc,
void *coordinate);
+typedef void (*ShutdownForeignScan_function) (ForeignScanState *node);
typedef bool (*IsForeignScanParallelSafe_function) (PlannerInfo *root,
RelOptInfo *rel,
RangeTblEntry *rte);
@@ -224,6 +225,7 @@ typedef struct FdwRoutine
EstimateDSMForeignScan_function EstimateDSMForeignScan;
InitializeDSMForeignScan_function InitializeDSMForeignScan;
InitializeWorkerForeignScan_function InitializeWorkerForeignScan;
+ ShutdownForeignScan_function ShutdownForeignScan;
} FdwRoutine;
diff --git a/src/include/foreign/foreign.h b/src/include/foreign/foreign.h
index 5dc2c90f3c..446a071239 100644
--- a/src/include/foreign/foreign.h
+++ b/src/include/foreign/foreign.h
@@ -4,7 +4,7 @@
* support for foreign-data wrappers, servers and user mappings.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/foreign/foreign.h
*
@@ -23,7 +23,7 @@
/*
* Generic option types for validation.
- * NB! Thes are treated as flags, so use only powers of two here.
+ * NB! These are treated as flags, so use only powers of two here.
*/
typedef enum
{
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index e73a82427c..30e66b6335 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -7,7 +7,7 @@
* or call FUNCAPI-callable functions or macros.
*
*
- * Copyright (c) 2002-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2002-2017, PostgreSQL Global Development Group
*
* src/include/funcapi.h
*
diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h
index 46aad596c7..c5595142a5 100644
--- a/src/include/getaddrinfo.h
+++ b/src/include/getaddrinfo.h
@@ -13,7 +13,7 @@
* This code will also work on platforms where struct addrinfo is defined
* in the system headers but no getaddrinfo() can be located.
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/getaddrinfo.h
*
@@ -40,14 +40,12 @@
#define EAI_MEMORY (-10)
#define EAI_SYSTEM (-11)
#else /* WIN32 */
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
#ifndef WSA_NOT_ENOUGH_MEMORY
#define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS)
#endif
-#ifndef __BORLANDC__
#define WSATYPE_NOT_FOUND (WSABASEERR+109)
#endif
-#endif
#define EAI_AGAIN WSATRY_AGAIN
#define EAI_BADFLAGS WSAEINVAL
#define EAI_FAIL WSANO_RECOVERY
diff --git a/src/include/getopt_long.h b/src/include/getopt_long.h
index ad6c1e3ad0..a16c5f9b14 100644
--- a/src/include/getopt_long.h
+++ b/src/include/getopt_long.h
@@ -2,7 +2,7 @@
* Portions Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
- * Portions Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/getopt_long.h
*/
diff --git a/src/include/lib/binaryheap.h b/src/include/lib/binaryheap.h
index 08a4cedc07..a4bbb390ea 100644
--- a/src/include/lib/binaryheap.h
+++ b/src/include/lib/binaryheap.h
@@ -3,7 +3,7 @@
*
* A simple binary heap implementation
*
- * Portions Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
* src/include/lib/binaryheap.h
*/
diff --git a/src/include/lib/bipartite_match.h b/src/include/lib/bipartite_match.h
index f9292f264e..d662b3821e 100644
--- a/src/include/lib/bipartite_match.h
+++ b/src/include/lib/bipartite_match.h
@@ -1,7 +1,7 @@
/*
* bipartite_match.h
*
- * Copyright (c) 2015-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2015-2017, PostgreSQL Global Development Group
*
* src/include/lib/bipartite_match.h
*/
diff --git a/src/include/lib/hyperloglog.h b/src/include/lib/hyperloglog.h
index ee88f8f781..dd40fe9b00 100644
--- a/src/include/lib/hyperloglog.h
+++ b/src/include/lib/hyperloglog.h
@@ -3,7 +3,7 @@
*
* A simple HyperLogLog cardinality estimator implementation
*
- * Portions Copyright (c) 2014-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2014-2017, PostgreSQL Global Development Group
*
* Based on Hideaki Ohno's C++ implementation. The copyright terms of Ohno's
* original version (the MIT license) follow.
diff --git a/src/include/lib/ilist.h b/src/include/lib/ilist.h
index e189e4f377..8a44c90c4f 100644
--- a/src/include/lib/ilist.h
+++ b/src/include/lib/ilist.h
@@ -96,7 +96,7 @@
* }
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
diff --git a/src/include/lib/knapsack.h b/src/include/lib/knapsack.h
new file mode 100644
index 0000000000..8d1e6d0aa0
--- /dev/null
+++ b/src/include/lib/knapsack.h
@@ -0,0 +1,17 @@
+/*
+ * knapsack.h
+ *
+ * Copyright (c) 2017, PostgreSQL Global Development Group
+ *
+ * src/include/lib/knapsack.h
+ */
+#ifndef KNAPSACK_H
+#define KNAPSACK_H
+
+#include "postgres.h"
+#include "nodes/bitmapset.h"
+
+extern Bitmapset *DiscreteKnapsack(int max_weight, int num_items,
+ int *item_weights, double *item_values);
+
+#endif /* KNAPSACK_H */
diff --git a/src/include/lib/pairingheap.h b/src/include/lib/pairingheap.h
index ee1454850c..9ee90befe5 100644
--- a/src/include/lib/pairingheap.h
+++ b/src/include/lib/pairingheap.h
@@ -3,7 +3,7 @@
*
* A Pairing Heap implementation
*
- * Portions Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
* src/include/lib/pairingheap.h
*/
diff --git a/src/include/lib/rbtree.h b/src/include/lib/rbtree.h
index 73e83c367a..7e2b7ae71b 100644
--- a/src/include/lib/rbtree.h
+++ b/src/include/lib/rbtree.h
@@ -3,7 +3,7 @@
* rbtree.h
* interface for PostgreSQL generic Red-Black binary tree package
*
- * Copyright (c) 2009-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2009-2017, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/include/lib/rbtree.h
@@ -22,7 +22,6 @@
*/
typedef struct RBNode
{
- char iteratorState; /* workspace for iterating through tree */
char color; /* node's current color, red or black */
struct RBNode *left; /* left child, or RBNIL if none */
struct RBNode *right; /* right child, or RBNIL if none */
@@ -41,6 +40,22 @@ typedef enum RBOrderControl
InvertedWalk /* postorder: left child, right child, node */
} RBOrderControl;
+/*
+ * RBTreeIterator holds state while traversing a tree. This is declared
+ * here so that callers can stack-allocate this, but must otherwise be
+ * treated as an opaque struct.
+ */
+typedef struct RBTreeIterator RBTreeIterator;
+
+struct RBTreeIterator
+{
+ RBTree *rb;
+ RBNode *(*iterate) (RBTreeIterator *iter);
+ RBNode *last_visited;
+ char next_step;
+ bool is_over;
+};
+
/* Support functions to be provided by caller */
typedef int (*rb_comparator) (const RBNode *a, const RBNode *b, void *arg);
typedef void (*rb_combiner) (RBNode *existing, const RBNode *newdata, void *arg);
@@ -60,7 +75,8 @@ extern RBNode *rb_leftmost(RBTree *rb);
extern RBNode *rb_insert(RBTree *rb, const RBNode *data, bool *isNew);
extern void rb_delete(RBTree *rb, RBNode *node);
-extern void rb_begin_iterate(RBTree *rb, RBOrderControl ctrl);
-extern RBNode *rb_iterate(RBTree *rb);
+extern void rb_begin_iterate(RBTree *rb, RBOrderControl ctrl,
+ RBTreeIterator *iter);
+extern RBNode *rb_iterate(RBTreeIterator *iter);
#endif /* RBTREE_H */
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
new file mode 100644
index 0000000000..a35addf636
--- /dev/null
+++ b/src/include/lib/simplehash.h
@@ -0,0 +1,956 @@
+/*
+ * simplehash.h
+ *
+ * Hash table implementation which will be specialized to user-defined
+ * types, by including this file to generate the required code. It's
+ * probably not worthwhile to do so for hash tables that aren't performance
+ * or space sensitive.
+ *
+ * Usage notes:
+ *
+ * To generate a hash-table and associated functions for a use case several
+ * macros have to be #define'ed before this file is included. Including
+ * the file #undef's all those, so a new hash table can be generated
+ * afterwards.
+ * The relevant parameters are:
+ * - SH_PREFIX - prefix for all symbol names generated. A prefix of 'foo'
+ * will result in hash table type 'foo_hash' and functions like
+ * 'foo_insert'/'foo_lookup' and so forth.
+ * - SH_ELEMENT_TYPE - type of the contained elements
+ * - SH_KEY_TYPE - type of the hashtable's key
+ * - SH_DECLARE - if defined function prototypes and type declarations are
+ * generated
+ * - SH_DEFINE - if defined function definitions are generated
+ * - SH_SCOPE - in which scope (e.g. extern, static inline) do function
+ * declarations reside
+ * - SH_USE_NONDEFAULT_ALLOCATOR - if defined no element allocator functions
+ * are defined, so you can supply your own
+ * The following parameters are only relevant when SH_DEFINE is defined:
+ * - SH_KEY - name of the element in SH_ELEMENT_TYPE containing the hash key
+ * - SH_EQUAL(table, a, b) - compare two table keys
+ * - SH_HASH_KEY(table, key) - generate hash for the key
+ * - SH_STORE_HASH - if defined the hash is stored in the elements
+ * - SH_GET_HASH(tb, a) - return the field to store the hash in
+ *
+ * For examples of usage look at simplehash.c (file local definition) and
+ * execnodes.h/execGrouping.c (exposed declaration, file local
+ * implementation).
+ *
+ * Hash table design:
+ *
+ * The hash table design chosen is a variant of linear open-addressing. The
+ * reason for doing so is that linear addressing is CPU cache & pipeline
+ * friendly. The biggest disadvantage of simple linear addressing schemes
+ * are highly variable lookup times due to clustering, and deletions
+ * leaving a lot of tombstones around. To address these issues a variant
+ * of "robin hood" hashing is employed. Robin hood hashing optimizes
+ * chaining lengths by moving elements close to their optimal bucket
+ * ("rich" elements), out of the way if a to-be-inserted element is further
+ * away from its optimal position (i.e. it's "poor"). While that can make
+ * insertions slower, the average lookup performance is a lot better, and
+ * higher fill factors can be used in a still performant manner. To avoid
+ * tombstones - which normally solve the issue that a deleted node's
+ * presence is relevant to determine whether a lookup needs to continue
+ * looking or is done - buckets following a deleted element are shifted
+ * backwards, unless they're empty or already at their optimal position.
+ */
+
+/* helpers */
+#define SH_MAKE_PREFIX(a) CppConcat(a,_)
+#define SH_MAKE_NAME(name) SH_MAKE_NAME_(SH_MAKE_PREFIX(SH_PREFIX),name)
+#define SH_MAKE_NAME_(a,b) CppConcat(a,b)
+
+/* name macros for: */
+
+/* type declarations */
+#define SH_TYPE SH_MAKE_NAME(hash)
+#define SH_STATUS SH_MAKE_NAME(status)
+#define SH_STATUS_EMPTY SH_MAKE_NAME(EMPTY)
+#define SH_STATUS_IN_USE SH_MAKE_NAME(IN_USE)
+#define SH_ITERATOR SH_MAKE_NAME(iterator)
+
+/* function declarations */
+#define SH_CREATE SH_MAKE_NAME(create)
+#define SH_DESTROY SH_MAKE_NAME(destroy)
+#define SH_INSERT SH_MAKE_NAME(insert)
+#define SH_DELETE SH_MAKE_NAME(delete)
+#define SH_LOOKUP SH_MAKE_NAME(lookup)
+#define SH_GROW SH_MAKE_NAME(grow)
+#define SH_START_ITERATE SH_MAKE_NAME(start_iterate)
+#define SH_START_ITERATE_AT SH_MAKE_NAME(start_iterate_at)
+#define SH_ITERATE SH_MAKE_NAME(iterate)
+#define SH_ALLOCATE SH_MAKE_NAME(allocate)
+#define SH_FREE SH_MAKE_NAME(free)
+#define SH_STAT SH_MAKE_NAME(stat)
+
+/* internal helper functions (no externally visible prototypes) */
+#define SH_COMPUTE_PARAMETERS SH_MAKE_NAME(compute_parameters)
+#define SH_NEXT SH_MAKE_NAME(next)
+#define SH_PREV SH_MAKE_NAME(prev)
+#define SH_DISTANCE_FROM_OPTIMAL SH_MAKE_NAME(distance)
+#define SH_INITIAL_BUCKET SH_MAKE_NAME(initial_bucket)
+#define SH_ENTRY_HASH SH_MAKE_NAME(entry_hash)
+
+/* generate forward declarations necessary to use the hash table */
+#ifdef SH_DECLARE
+
+/* type definitions */
+typedef struct SH_TYPE
+{
+ /*
+ * Size of data / bucket array, 64 bits to handle UINT32_MAX sized hash
+ * tables. Note that the maximum number of elements is lower
+ * (SH_MAX_FILLFACTOR)
+ */
+ uint64 size;
+
+ /* how many elements have valid contents */
+ uint32 members;
+
+ /* mask for bucket and size calculations, based on size */
+ uint32 sizemask;
+
+ /* boundary after which to grow hashtable */
+ uint32 grow_threshold;
+
+ /* hash buckets */
+ SH_ELEMENT_TYPE *data;
+
+ /* memory context to use for allocations */
+ MemoryContext ctx;
+
+ /* user defined data, useful for callbacks */
+ void *private_data;
+} SH_TYPE;
+
+typedef enum SH_STATUS
+{
+ SH_STATUS_EMPTY = 0x00,
+ SH_STATUS_IN_USE = 0x01
+} SH_STATUS;
+
+typedef struct SH_ITERATOR
+{
+ uint32 cur; /* current element */
+ uint32 end;
+ bool done; /* iterator exhausted? */
+} SH_ITERATOR;
+
+/* externally visible function prototypes */
+SH_SCOPE SH_TYPE *SH_CREATE(MemoryContext ctx, uint32 nelements,
+ void *private_data);
+SH_SCOPE void SH_DESTROY(SH_TYPE * tb);
+SH_SCOPE void SH_GROW(SH_TYPE * tb, uint32 newsize);
+SH_SCOPE SH_ELEMENT_TYPE *SH_INSERT(SH_TYPE * tb, SH_KEY_TYPE key, bool *found);
+SH_SCOPE SH_ELEMENT_TYPE *SH_LOOKUP(SH_TYPE * tb, SH_KEY_TYPE key);
+SH_SCOPE bool SH_DELETE(SH_TYPE * tb, SH_KEY_TYPE key);
+SH_SCOPE void SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter);
+SH_SCOPE void SH_START_ITERATE_AT(SH_TYPE * tb, SH_ITERATOR * iter, uint32 at);
+SH_SCOPE SH_ELEMENT_TYPE *SH_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter);
+SH_SCOPE void SH_STAT(SH_TYPE * tb);
+
+#endif /* SH_DECLARE */
+
+
+/* generate implementation of the hash table */
+#ifdef SH_DEFINE
+
+#include "utils/memutils.h"
+
+/* max data array size,we allow up to PG_UINT32_MAX buckets, including 0 */
+#define SH_MAX_SIZE (((uint64) PG_UINT32_MAX) + 1)
+
+/* normal fillfactor, unless already close to maximum */
+#ifndef SH_FILLFACTOR
+#define SH_FILLFACTOR (0.9)
+#endif
+/* increase fillfactor if we otherwise would error out */
+#define SH_MAX_FILLFACTOR (0.98)
+/* grow if actual and optimal location bigger than */
+#ifndef SH_GROW_MAX_DIB
+#define SH_GROW_MAX_DIB 25
+#endif
+/* grow if more than elements to move when inserting */
+#ifndef SH_GROW_MAX_MOVE
+#define SH_GROW_MAX_MOVE 150
+#endif
+
+#ifdef SH_STORE_HASH
+#define SH_COMPARE_KEYS(tb, ahash, akey, b) (ahash == SH_GET_HASH(tb, b) && SH_EQUAL(tb, b->SH_KEY, akey))
+#else
+#define SH_COMPARE_KEYS(tb, ahash, akey, b) (SH_EQUAL(tb, b->SH_KEY, akey))
+#endif
+
+/* FIXME: can we move these to a central location? */
+
+/* calculate ceil(log base 2) of num */
+static inline uint64
+sh_log2(uint64 num)
+{
+ int i;
+ uint64 limit;
+
+ for (i = 0, limit = 1; limit < num; i++, limit <<= 1)
+ ;
+ return i;
+}
+
+/* calculate first power of 2 >= num */
+static inline uint64
+sh_pow2(uint64 num)
+{
+ return ((uint64) 1) << sh_log2(num);
+}
+
+/*
+ * Compute sizing parameters for hashtable. Called when creating and growing
+ * the hashtable.
+ */
+static inline void
+SH_COMPUTE_PARAMETERS(SH_TYPE * tb, uint32 newsize)
+{
+ uint64 size;
+
+ /* supporting zero sized hashes would complicate matters */
+ size = Max(newsize, 2);
+
+ /* round up size to the next power of 2, that's the bucketing works */
+ size = sh_pow2(size);
+ Assert(size <= SH_MAX_SIZE);
+
+ /*
+ * Verify allocation of ->data is possible on platform, without
+ * overflowing Size.
+ */
+ if ((((uint64) sizeof(SH_ELEMENT_TYPE)) * size) >= MaxAllocHugeSize)
+ elog(ERROR, "hash table too large");
+
+ /* now set size */
+ tb->size = size;
+
+ if (tb->size == SH_MAX_SIZE)
+ tb->sizemask = 0;
+ else
+ tb->sizemask = tb->size - 1;
+
+ /*
+ * Compute growth threshold here and after growing the table, to make
+ * computations during insert cheaper.
+ */
+ if (tb->size == SH_MAX_SIZE)
+ tb->grow_threshold = ((double) tb->size) * SH_MAX_FILLFACTOR;
+ else
+ tb->grow_threshold = ((double) tb->size) * SH_FILLFACTOR;
+}
+
+/* return the optimal bucket for the hash */
+static inline uint32
+SH_INITIAL_BUCKET(SH_TYPE * tb, uint32 hash)
+{
+ return hash & tb->sizemask;
+}
+
+/* return next bucket after the current, handling wraparound */
+static inline uint32
+SH_NEXT(SH_TYPE * tb, uint32 curelem, uint32 startelem)
+{
+ curelem = (curelem + 1) & tb->sizemask;
+
+ Assert(curelem != startelem);
+
+ return curelem;
+}
+
+/* return bucket before the current, handling wraparound */
+static inline uint32
+SH_PREV(SH_TYPE * tb, uint32 curelem, uint32 startelem)
+{
+ curelem = (curelem - 1) & tb->sizemask;
+
+ Assert(curelem != startelem);
+
+ return curelem;
+}
+
+/* return distance between bucket and its optimal position */
+static inline uint32
+SH_DISTANCE_FROM_OPTIMAL(SH_TYPE * tb, uint32 optimal, uint32 bucket)
+{
+ if (optimal <= bucket)
+ return bucket - optimal;
+ else
+ return (tb->size + bucket) - optimal;
+}
+
+static inline uint32
+SH_ENTRY_HASH(SH_TYPE * tb, SH_ELEMENT_TYPE * entry)
+{
+#ifdef SH_STORE_HASH
+ return SH_GET_HASH(tb, entry);
+#else
+ return SH_HASH_KEY(tb, entry->SH_KEY);
+#endif
+}
+
+/* default memory allocator function */
+static inline void *SH_ALLOCATE(SH_TYPE * type, Size size);
+static inline void SH_FREE(SH_TYPE * type, void *pointer);
+
+#ifndef SH_USE_NONDEFAULT_ALLOCATOR
+
+/* default memory allocator function */
+static inline void *
+SH_ALLOCATE(SH_TYPE * type, Size size)
+{
+ return MemoryContextAllocExtended(type->ctx, size,
+ MCXT_ALLOC_HUGE | MCXT_ALLOC_ZERO);
+}
+
+/* default memory free function */
+static inline void
+SH_FREE(SH_TYPE * type, void *pointer)
+{
+ pfree(pointer);
+}
+
+#endif
+
+/*
+ * Create a hash table with enough space for `nelements` distinct members.
+ * Memory for the hash table is allocated from the passed-in context. If
+ * desired, the array of elements can be allocated using a passed-in allocator;
+ * this could be useful in order to place the array of elements in a shared
+ * memory, or in a context that will outlive the rest of the hash table.
+ * Memory other than for the array of elements will still be allocated from
+ * the passed-in context.
+ */
+SH_SCOPE SH_TYPE *
+SH_CREATE(MemoryContext ctx, uint32 nelements, void *private_data)
+{
+ SH_TYPE *tb;
+ uint64 size;
+
+ tb = MemoryContextAllocZero(ctx, sizeof(SH_TYPE));
+ tb->ctx = ctx;
+ tb->private_data = private_data;
+
+ /* increase nelements by fillfactor, want to store nelements elements */
+ size = Min((double) SH_MAX_SIZE, ((double) nelements) / SH_FILLFACTOR);
+
+ SH_COMPUTE_PARAMETERS(tb, size);
+
+ tb->data = SH_ALLOCATE(tb, sizeof(SH_ELEMENT_TYPE) * tb->size);
+
+ return tb;
+}
+
+/* destroy a previously created hash table */
+SH_SCOPE void
+SH_DESTROY(SH_TYPE * tb)
+{
+ SH_FREE(tb, tb->data);
+ pfree(tb);
+}
+
+/*
+ * Grow a hash table to at least `newsize` buckets.
+ *
+ * Usually this will automatically be called by insertions/deletions, when
+ * necessary. But resizing to the exact input size can be advantageous
+ * performance-wise, when known at some point.
+ */
+SH_SCOPE void
+SH_GROW(SH_TYPE * tb, uint32 newsize)
+{
+ uint64 oldsize = tb->size;
+ SH_ELEMENT_TYPE *olddata = tb->data;
+ SH_ELEMENT_TYPE *newdata;
+ uint32 i;
+ uint32 startelem = 0;
+ uint32 copyelem;
+
+ Assert(oldsize == sh_pow2(oldsize));
+ Assert(oldsize != SH_MAX_SIZE);
+ Assert(oldsize < newsize);
+
+ /* compute parameters for new table */
+ SH_COMPUTE_PARAMETERS(tb, newsize);
+
+ tb->data = SH_ALLOCATE(tb, sizeof(SH_ELEMENT_TYPE) * tb->size);
+
+ newdata = tb->data;
+
+ /*
+ * Copy entries from the old data to newdata. We theoretically could use
+ * SH_INSERT here, to avoid code duplication, but that's more general than
+ * we need. We neither want tb->members increased, nor do we need to do
+ * deal with deleted elements, nor do we need to compare keys. So a
+ * special-cased implementation is lot faster. As resizing can be time
+ * consuming and frequent, that's worthwhile to optimize.
+ *
+ * To be able to simply move entries over, we have to start not at the
+ * first bucket (i.e olddata[0]), but find the first bucket that's either
+ * empty, or is occupied by an entry at its optimal position. Such a
+ * bucket has to exist in any table with a load factor under 1, as not all
+ * buckets are occupied, i.e. there always has to be an empty bucket. By
+ * starting at such a bucket we can move the entries to the larger table,
+ * without having to deal with conflicts.
+ */
+
+ /* search for the first element in the hash that's not wrapped around */
+ for (i = 0; i < oldsize; i++)
+ {
+ SH_ELEMENT_TYPE *oldentry = &olddata[i];
+ uint32 hash;
+ uint32 optimal;
+
+ if (oldentry->status != SH_STATUS_IN_USE)
+ {
+ startelem = i;
+ break;
+ }
+
+ hash = SH_ENTRY_HASH(tb, oldentry);
+ optimal = SH_INITIAL_BUCKET(tb, hash);
+
+ if (optimal == i)
+ {
+ startelem = i;
+ break;
+ }
+ }
+
+ /* and copy all elements in the old table */
+ copyelem = startelem;
+ for (i = 0; i < oldsize; i++)
+ {
+ SH_ELEMENT_TYPE *oldentry = &olddata[copyelem];
+
+ if (oldentry->status == SH_STATUS_IN_USE)
+ {
+ uint32 hash;
+ uint32 startelem;
+ uint32 curelem;
+ SH_ELEMENT_TYPE *newentry;
+
+ hash = SH_ENTRY_HASH(tb, oldentry);
+ startelem = SH_INITIAL_BUCKET(tb, hash);
+ curelem = startelem;
+
+ /* find empty element to put data into */
+ while (true)
+ {
+ newentry = &newdata[curelem];
+
+ if (newentry->status == SH_STATUS_EMPTY)
+ {
+ break;
+ }
+
+ curelem = SH_NEXT(tb, curelem, startelem);
+ }
+
+ /* copy entry to new slot */
+ memcpy(newentry, oldentry, sizeof(SH_ELEMENT_TYPE));
+ }
+
+ /* can't use SH_NEXT here, would use new size */
+ copyelem++;
+ if (copyelem >= oldsize)
+ {
+ copyelem = 0;
+ }
+ }
+
+ SH_FREE(tb, olddata);
+}
+
+/*
+ * Insert the key key into the hash-table, set *found to true if the key
+ * already exists, false otherwise. Returns the hash-table entry in either
+ * case.
+ */
+SH_SCOPE SH_ELEMENT_TYPE *
+SH_INSERT(SH_TYPE * tb, SH_KEY_TYPE key, bool *found)
+{
+ uint32 hash = SH_HASH_KEY(tb, key);
+ uint32 startelem;
+ uint32 curelem;
+ SH_ELEMENT_TYPE *data;
+ uint32 insertdist;
+
+restart:
+ insertdist = 0;
+
+ /*
+ * We do the grow check even if the key is actually present, to avoid
+ * doing the check inside the loop. This also lets us avoid having to
+ * re-find our position in the hashtable after resizing.
+ *
+ * Note that this also reached when resizing the table due to
+ * SH_GROW_MAX_DIB / SH_GROW_MAX_MOVE.
+ */
+ if (unlikely(tb->members >= tb->grow_threshold))
+ {
+ if (tb->size == SH_MAX_SIZE)
+ {
+ elog(ERROR, "hash table size exceeded");
+ }
+
+ /*
+ * When optimizing, it can be very useful to print these out.
+ */
+ /* SH_STAT(tb); */
+ SH_GROW(tb, tb->size * 2);
+ /* SH_STAT(tb); */
+ }
+
+ /* perform insert, start bucket search at optimal location */
+ data = tb->data;
+ startelem = SH_INITIAL_BUCKET(tb, hash);
+ curelem = startelem;
+ while (true)
+ {
+ uint32 curdist;
+ uint32 curhash;
+ uint32 curoptimal;
+ SH_ELEMENT_TYPE *entry = &data[curelem];
+
+ /* any empty bucket can directly be used */
+ if (entry->status == SH_STATUS_EMPTY)
+ {
+ tb->members++;
+ entry->SH_KEY = key;
+#ifdef SH_STORE_HASH
+ SH_GET_HASH(tb, entry) = hash;
+#endif
+ entry->status = SH_STATUS_IN_USE;
+ *found = false;
+ return entry;
+ }
+
+ /*
+ * If the bucket is not empty, we either found a match (in which case
+ * we're done), or we have to decide whether to skip over or move the
+ * colliding entry. When the colliding element's distance to its
+ * optimal position is smaller than the to-be-inserted entry's, we
+ * shift the colliding entry (and its followers) forward by one.
+ */
+
+ if (SH_COMPARE_KEYS(tb, hash, key, entry))
+ {
+ Assert(entry->status == SH_STATUS_IN_USE);
+ *found = true;
+ return entry;
+ }
+
+ curhash = SH_ENTRY_HASH(tb, entry);
+ curoptimal = SH_INITIAL_BUCKET(tb, curhash);
+ curdist = SH_DISTANCE_FROM_OPTIMAL(tb, curoptimal, curelem);
+
+ if (insertdist > curdist)
+ {
+ SH_ELEMENT_TYPE *lastentry = entry;
+ uint32 emptyelem = curelem;
+ uint32 moveelem;
+ int32 emptydist = 0;
+
+ /* find next empty bucket */
+ while (true)
+ {
+ SH_ELEMENT_TYPE *emptyentry;
+
+ emptyelem = SH_NEXT(tb, emptyelem, startelem);
+ emptyentry = &data[emptyelem];
+
+ if (emptyentry->status == SH_STATUS_EMPTY)
+ {
+ lastentry = emptyentry;
+ break;
+ }
+
+ /*
+ * To avoid negative consequences from overly imbalanced
+ * hashtables, grow the hashtable if collisions would require
+ * us to move a lot of entries. The most likely cause of such
+ * imbalance is filling a (currently) small table, from a
+ * currently big one, in hash-table order.
+ */
+ if (++emptydist > SH_GROW_MAX_MOVE)
+ {
+ tb->grow_threshold = 0;
+ goto restart;
+ }
+ }
+
+ /* shift forward, starting at last occupied element */
+
+ /*
+ * TODO: This could be optimized to be one memcpy in may cases,
+ * excepting wrapping around at the end of ->data. Hasn't shown up
+ * in profiles so far though.
+ */
+ moveelem = emptyelem;
+ while (moveelem != curelem)
+ {
+ SH_ELEMENT_TYPE *moveentry;
+
+ moveelem = SH_PREV(tb, moveelem, startelem);
+ moveentry = &data[moveelem];
+
+ memcpy(lastentry, moveentry, sizeof(SH_ELEMENT_TYPE));
+ lastentry = moveentry;
+ }
+
+ /* and fill the now empty spot */
+ tb->members++;
+
+ entry->SH_KEY = key;
+#ifdef SH_STORE_HASH
+ SH_GET_HASH(tb, entry) = hash;
+#endif
+ entry->status = SH_STATUS_IN_USE;
+ *found = false;
+ return entry;
+ }
+
+ curelem = SH_NEXT(tb, curelem, startelem);
+ insertdist++;
+
+ /*
+ * To avoid negative consequences from overly imbalanced hashtables,
+ * grow the hashtable if collisions lead to large runs. The most
+ * likely cause of such imbalance is filling a (currently) small
+ * table, from a currently big one, in hash-table order.
+ */
+ if (insertdist > SH_GROW_MAX_DIB)
+ {
+ tb->grow_threshold = 0;
+ goto restart;
+ }
+ }
+}
+
+/*
+ * Lookup up entry in hash table. Returns NULL if key not present.
+ */
+SH_SCOPE SH_ELEMENT_TYPE *
+SH_LOOKUP(SH_TYPE * tb, SH_KEY_TYPE key)
+{
+ uint32 hash = SH_HASH_KEY(tb, key);
+ const uint32 startelem = SH_INITIAL_BUCKET(tb, hash);
+ uint32 curelem = startelem;
+
+ while (true)
+ {
+ SH_ELEMENT_TYPE *entry = &tb->data[curelem];
+
+ if (entry->status == SH_STATUS_EMPTY)
+ {
+ return NULL;
+ }
+
+ Assert(entry->status == SH_STATUS_IN_USE);
+
+ if (SH_COMPARE_KEYS(tb, hash, key, entry))
+ return entry;
+
+ /*
+ * TODO: we could stop search based on distance. If the current
+ * buckets's distance-from-optimal is smaller than what we've skipped
+ * already, the entry doesn't exist. Probably only do so if
+ * SH_STORE_HASH is defined, to avoid re-computing hashes?
+ */
+
+ curelem = SH_NEXT(tb, curelem, startelem);
+ }
+}
+
+/*
+ * Delete entry from hash table. Returns whether to-be-deleted key was
+ * present.
+ */
+SH_SCOPE bool
+SH_DELETE(SH_TYPE * tb, SH_KEY_TYPE key)
+{
+ uint32 hash = SH_HASH_KEY(tb, key);
+ uint32 startelem = SH_INITIAL_BUCKET(tb, hash);
+ uint32 curelem = startelem;
+
+ while (true)
+ {
+ SH_ELEMENT_TYPE *entry = &tb->data[curelem];
+
+ if (entry->status == SH_STATUS_EMPTY)
+ return false;
+
+ if (entry->status == SH_STATUS_IN_USE &&
+ SH_COMPARE_KEYS(tb, hash, key, entry))
+ {
+ SH_ELEMENT_TYPE *lastentry = entry;
+
+ tb->members--;
+
+ /*
+ * Backward shift following elements till either an empty element
+ * or an element at its optimal position is encountered.
+ *
+ * While that sounds expensive, the average chain length is short,
+ * and deletions would otherwise require toombstones.
+ */
+ while (true)
+ {
+ SH_ELEMENT_TYPE *curentry;
+ uint32 curhash;
+ uint32 curoptimal;
+
+ curelem = SH_NEXT(tb, curelem, startelem);
+ curentry = &tb->data[curelem];
+
+ if (curentry->status != SH_STATUS_IN_USE)
+ {
+ lastentry->status = SH_STATUS_EMPTY;
+ break;
+ }
+
+ curhash = SH_ENTRY_HASH(tb, curentry);
+ curoptimal = SH_INITIAL_BUCKET(tb, curhash);
+
+ /* current is at optimal position, done */
+ if (curoptimal == curelem)
+ {
+ lastentry->status = SH_STATUS_EMPTY;
+ break;
+ }
+
+ /* shift */
+ memcpy(lastentry, curentry, sizeof(SH_ELEMENT_TYPE));
+
+ lastentry = curentry;
+ }
+
+ return true;
+ }
+
+ /* TODO: return false; if distance too big */
+
+ curelem = SH_NEXT(tb, curelem, startelem);
+ }
+}
+
+/*
+ * Initialize iterator.
+ */
+SH_SCOPE void
+SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
+{
+ int i;
+ uint64 startelem = PG_UINT64_MAX;
+
+ /*
+ * Search for the first empty element. As deletions during iterations are
+ * supported, we want to start/end at an element that cannot be affected
+ * by elements being shifted.
+ */
+ for (i = 0; i < tb->size; i++)
+ {
+ SH_ELEMENT_TYPE *entry = &tb->data[i];
+
+ if (entry->status != SH_STATUS_IN_USE)
+ {
+ startelem = i;
+ break;
+ }
+ }
+
+ Assert(startelem < SH_MAX_SIZE);
+
+ /*
+ * Iterate backwards, that allows the current element to be deleted, even
+ * if there are backward shifts
+ */
+ iter->cur = startelem;
+ iter->end = iter->cur;
+ iter->done = false;
+}
+
+/*
+ * Initialize iterator to a specific bucket. That's really only useful for
+ * cases where callers are partially iterating over the hashspace, and that
+ * iteration deletes and inserts elements based on visited entries. Doing that
+ * repeatedly could lead to an unbalanced keyspace when always starting at the
+ * same position.
+ */
+SH_SCOPE void
+SH_START_ITERATE_AT(SH_TYPE * tb, SH_ITERATOR * iter, uint32 at)
+{
+ /*
+ * Iterate backwards, that allows the current element to be deleted, even
+ * if there are backward shifts.
+ */
+ iter->cur = at & tb->sizemask; /* ensure at is within a valid range */
+ iter->end = iter->cur;
+ iter->done = false;
+}
+
+/*
+ * Iterate over all entries in the hash-table. Return the next occupied entry,
+ * or NULL if done.
+ *
+ * During iteration the current entry in the hash table may be deleted,
+ * without leading to elements being skipped or returned twice. Additionally
+ * the rest of the table may be modified (i.e. there can be insertions or
+ * deletions), but if so, there's neither a guarantee that all nodes are
+ * visited at least once, nor a guarantee that a node is visited at most once.
+ */
+SH_SCOPE SH_ELEMENT_TYPE *
+SH_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
+{
+ while (!iter->done)
+ {
+ SH_ELEMENT_TYPE *elem;
+
+ elem = &tb->data[iter->cur];
+
+ /* next element in backward direction */
+ iter->cur = (iter->cur - 1) & tb->sizemask;
+
+ if ((iter->cur & tb->sizemask) == (iter->end & tb->sizemask))
+ iter->done = true;
+ if (elem->status == SH_STATUS_IN_USE)
+ {
+ return elem;
+ }
+ }
+
+ return NULL;
+}
+
+/*
+ * Report some statistics about the state of the hashtable. For
+ * debugging/profiling purposes only.
+ */
+SH_SCOPE void
+SH_STAT(SH_TYPE * tb)
+{
+ uint32 max_chain_length = 0;
+ uint32 total_chain_length = 0;
+ double avg_chain_length;
+ double fillfactor;
+ uint32 i;
+
+ uint32 *collisions = palloc0(tb->size * sizeof(uint32));
+ uint32 total_collisions = 0;
+ uint32 max_collisions = 0;
+ double avg_collisions;
+
+ for (i = 0; i < tb->size; i++)
+ {
+ uint32 hash;
+ uint32 optimal;
+ uint32 dist;
+ SH_ELEMENT_TYPE *elem;
+
+ elem = &tb->data[i];
+
+ if (elem->status != SH_STATUS_IN_USE)
+ continue;
+
+ hash = SH_ENTRY_HASH(tb, elem);
+ optimal = SH_INITIAL_BUCKET(tb, hash);
+ dist = SH_DISTANCE_FROM_OPTIMAL(tb, optimal, i);
+
+ if (dist > max_chain_length)
+ max_chain_length = dist;
+ total_chain_length += dist;
+
+ collisions[optimal]++;
+ }
+
+ for (i = 0; i < tb->size; i++)
+ {
+ uint32 curcoll = collisions[i];
+
+ if (curcoll == 0)
+ continue;
+
+ /* single contained element is not a collision */
+ curcoll--;
+ total_collisions += curcoll;
+ if (curcoll > max_collisions)
+ max_collisions = curcoll;
+ }
+
+ if (tb->members > 0)
+ {
+ fillfactor = tb->members / ((double) tb->size);
+ avg_chain_length = ((double) total_chain_length) / tb->members;
+ avg_collisions = ((double) total_collisions) / tb->members;
+ }
+ else
+ {
+ fillfactor = 0;
+ avg_chain_length = 0;
+ avg_collisions = 0;
+ }
+
+ elog(LOG, "size: " UINT64_FORMAT ", members: %u, filled: %f, total chain: %u, max chain: %u, avg chain: %f, total_collisions: %u, max_collisions: %i, avg_collisions: %f",
+ tb->size, tb->members, fillfactor, total_chain_length, max_chain_length, avg_chain_length,
+ total_collisions, max_collisions, avg_collisions);
+}
+
+#endif /* SH_DEFINE */
+
+
+/* undefine external paramters, so next hash table can be defined */
+#undef SH_PREFIX
+#undef SH_KEY_TYPE
+#undef SH_KEY
+#undef SH_ELEMENT_TYPE
+#undef SH_HASH_KEY
+#undef SH_SCOPE
+#undef SH_DECLARE
+#undef SH_DEFINE
+#undef SH_GET_HASH
+#undef SH_STORE_HASH
+#undef SH_USE_NONDEFAULT_ALLOCATOR
+
+/* undefine locally declared macros */
+#undef SH_MAKE_PREFIX
+#undef SH_MAKE_NAME
+#undef SH_MAKE_NAME_
+#undef SH_FILLFACTOR
+#undef SH_MAX_FILLFACTOR
+#undef SH_GROW_MAX_DIB
+#undef SH_GROW_MAX_MOVE
+#undef SH_MAX_SIZE
+
+/* types */
+#undef SH_TYPE
+#undef SH_STATUS
+#undef SH_STATUS_EMPTY
+#undef SH_STATUS_IN_USE
+#undef SH_ITERATOR
+
+/* external function names */
+#undef SH_CREATE
+#undef SH_DESTROY
+#undef SH_INSERT
+#undef SH_DELETE
+#undef SH_LOOKUP
+#undef SH_GROW
+#undef SH_START_ITERATE
+#undef SH_START_ITERATE_AT
+#undef SH_ITERATE
+#undef SH_ALLOCATE
+#undef SH_FREE
+#undef SH_STAT
+
+/* internal function names */
+#undef SH_COMPUTE_PARAMETERS
+#undef SH_COMPARE_KEYS
+#undef SH_INITIAL_BUCKET
+#undef SH_NEXT
+#undef SH_PREV
+#undef SH_DISTANCE_FROM_OPTIMAL
+#undef SH_ENTRY_HASH
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h
index f64406710e..316c196565 100644
--- a/src/include/lib/stringinfo.h
+++ b/src/include/lib/stringinfo.h
@@ -7,7 +7,7 @@
* It can be used to buffer either ordinary C strings (null-terminated text)
* or arbitrary binary data. All storage is allocated with palloc().
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/lib/stringinfo.h
diff --git a/src/include/libpq/auth.h b/src/include/libpq/auth.h
index 3cd06b75c8..601dc5d71a 100644
--- a/src/include/libpq/auth.h
+++ b/src/include/libpq/auth.h
@@ -4,7 +4,7 @@
* Definitions for network authentication routines
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/auth.h
diff --git a/src/include/libpq/be-fsstubs.h b/src/include/libpq/be-fsstubs.h
index 3959bf1d96..641124cd21 100644
--- a/src/include/libpq/be-fsstubs.h
+++ b/src/include/libpq/be-fsstubs.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/be-fsstubs.h
@@ -14,37 +14,6 @@
#ifndef BE_FSSTUBS_H
#define BE_FSSTUBS_H
-#include "fmgr.h"
-
-/*
- * LO functions available via pg_proc entries
- */
-extern Datum lo_import(PG_FUNCTION_ARGS);
-extern Datum lo_import_with_oid(PG_FUNCTION_ARGS);
-extern Datum lo_export(PG_FUNCTION_ARGS);
-
-extern Datum lo_creat(PG_FUNCTION_ARGS);
-extern Datum lo_create(PG_FUNCTION_ARGS);
-extern Datum lo_from_bytea(PG_FUNCTION_ARGS);
-
-extern Datum lo_open(PG_FUNCTION_ARGS);
-extern Datum lo_close(PG_FUNCTION_ARGS);
-
-extern Datum loread(PG_FUNCTION_ARGS);
-extern Datum lowrite(PG_FUNCTION_ARGS);
-
-extern Datum lo_get(PG_FUNCTION_ARGS);
-extern Datum lo_get_fragment(PG_FUNCTION_ARGS);
-extern Datum lo_put(PG_FUNCTION_ARGS);
-
-extern Datum lo_lseek(PG_FUNCTION_ARGS);
-extern Datum lo_tell(PG_FUNCTION_ARGS);
-extern Datum lo_lseek64(PG_FUNCTION_ARGS);
-extern Datum lo_tell64(PG_FUNCTION_ARGS);
-extern Datum lo_unlink(PG_FUNCTION_ARGS);
-extern Datum lo_truncate(PG_FUNCTION_ARGS);
-extern Datum lo_truncate64(PG_FUNCTION_ARGS);
-
/*
* compatibility option for access control
*/
diff --git a/src/include/libpq/crypt.h b/src/include/libpq/crypt.h
index 5725bb409e..9bad67c890 100644
--- a/src/include/libpq/crypt.h
+++ b/src/include/libpq/crypt.h
@@ -3,7 +3,7 @@
* crypt.h
* Interface to libpq/crypt.c
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/crypt.h
@@ -13,9 +13,34 @@
#ifndef PG_CRYPT_H
#define PG_CRYPT_H
-#include "libpq/libpq-be.h"
+#include "datatype/timestamp.h"
-extern int md5_crypt_verify(const Port *port, const char *role,
- char *client_pass, char **logdetail);
+/*
+ * Types of password hashes or verifiers.
+ *
+ * Plaintext passwords can be passed in by the user, in a CREATE/ALTER USER
+ * command. They will be encrypted to MD5 or SCRAM-SHA-256 format, before
+ * storing on-disk, so only MD5 and SCRAM-SHA-256 passwords should appear
+ * in pg_authid.rolpassword. They are also the allowed values for the
+ * password_encryption GUC.
+ */
+typedef enum PasswordType
+{
+ PASSWORD_TYPE_PLAINTEXT = 0,
+ PASSWORD_TYPE_MD5,
+ PASSWORD_TYPE_SCRAM_SHA_256
+} PasswordType;
+
+extern PasswordType get_password_type(const char *shadow_pass);
+extern char *encrypt_password(PasswordType target_type, const char *role,
+ const char *password);
+
+extern char *get_role_password(const char *role, char **logdetail);
+
+extern int md5_crypt_verify(const char *role, const char *shadow_pass,
+ const char *client_pass, const char *md5_salt,
+ int md5_salt_len, char **logdetail);
+extern int plain_crypt_verify(const char *role, const char *shadow_pass,
+ const char *client_pass, char **logdetail);
#endif
diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h
index dc7d2572ea..f28b860877 100644
--- a/src/include/libpq/hba.h
+++ b/src/include/libpq/hba.h
@@ -16,14 +16,21 @@
#include "regex/regex.h"
+/*
+ * The following enum represents the authentication methods that
+ * are supported by PostgreSQL.
+ *
+ * Note: keep this in sync with the UserAuthName array in hba.c.
+ */
typedef enum UserAuth
{
uaReject,
- uaImplicitReject,
+ uaImplicitReject, /* Not a user-visible option */
uaTrust,
uaIdent,
uaPassword,
uaMD5,
+ uaSCRAM,
uaGSS,
uaSSPI,
uaPAM,
@@ -32,6 +39,7 @@ typedef enum UserAuth
uaCert,
uaRADIUS,
uaPeer
+#define USER_AUTH_LAST uaPeer /* Must be last value of this enum */
} UserAuth;
typedef enum IPCompareMethod
@@ -81,10 +89,14 @@ typedef struct HbaLine
bool include_realm;
bool compat_realm;
bool upn_username;
- char *radiusserver;
- char *radiussecret;
- char *radiusidentifier;
- int radiusport;
+ List *radiusservers;
+ char *radiusservers_s;
+ List *radiussecrets;
+ char *radiussecrets_s;
+ List *radiusidentifiers;
+ char *radiusidentifiers_s;
+ List *radiusports;
+ char *radiusports_s;
} HbaLine;
typedef struct IdentLine
diff --git a/src/include/libpq/ifaddr.h b/src/include/libpq/ifaddr.h
new file mode 100644
index 0000000000..5f6f48598f
--- /dev/null
+++ b/src/include/libpq/ifaddr.h
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * ifaddr.h
+ * IP netmask calculations, and enumerating network interfaces.
+ *
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
+ *
+ * src/include/libpq/ifaddr.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef IFADDR_H
+#define IFADDR_H
+
+#include "libpq/pqcomm.h" /* pgrminclude ignore */
+
+typedef void (*PgIfAddrCallback) (struct sockaddr * addr,
+ struct sockaddr * netmask,
+ void *cb_data);
+
+extern int pg_range_sockaddr(const struct sockaddr_storage * addr,
+ const struct sockaddr_storage * netaddr,
+ const struct sockaddr_storage * netmask);
+
+extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask,
+ char *numbits, int family);
+
+extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data);
+
+#endif /* IFADDR_H */
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index 138aa86494..ed4ecea816 100644
--- a/src/include/libpq/libpq-be.h
+++ b/src/include/libpq/libpq-be.h
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------------------
*
- * libpq_be.h
+ * libpq-be.h
* This file contains definitions for structures and externs used
* by the postmaster during client authentication.
*
@@ -8,7 +8,7 @@
* Structs that need to be client-visible are in pqcomm.h.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/libpq-be.h
@@ -18,9 +18,7 @@
#ifndef LIBPQ_BE_H
#define LIBPQ_BE_H
-#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
-#endif
#ifdef USE_OPENSSL
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -40,14 +38,14 @@
* that doesn't match the msvc build. It gives a bunch of compiler warnings that we ignore,
* but also defines a symbol that simply does not exist. Undefine it again.
*/
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
#undef HAVE_GETADDRINFO
#endif
#endif /* ENABLE_GSS */
#ifdef ENABLE_SSPI
#define SECURITY_WIN32
-#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER)
+#if defined(WIN32) && !defined(_MSC_VER)
#include <ntsecapi.h>
#endif
#include <security.h>
@@ -143,7 +141,6 @@ typedef struct Port
* Information that needs to be held during the authentication cycle.
*/
HbaLine *hba;
- char md5Salt[4]; /* Password salt */
/*
* Information that really has no business at all being in struct Port,
@@ -191,7 +188,6 @@ typedef struct Port
#ifdef USE_OPENSSL
SSL *ssl;
X509 *peer;
- unsigned long count;
#endif
} Port;
@@ -200,7 +196,8 @@ typedef struct Port
* These functions are implemented by the glue code specific to each
* SSL implementation (e.g. be-secure-openssl.c)
*/
-extern void be_tls_init(void);
+extern int be_tls_init(bool isServerStart);
+extern void be_tls_destroy(void);
extern int be_tls_open_server(Port *port);
extern void be_tls_close(Port *port);
extern ssize_t be_tls_read(Port *port, void *ptr, size_t len, int *waitfor);
diff --git a/src/include/libpq/libpq-fs.h b/src/include/libpq/libpq-fs.h
index 5134ce6aba..afe32706f4 100644
--- a/src/include/libpq/libpq-fs.h
+++ b/src/include/libpq/libpq-fs.h
@@ -4,7 +4,7 @@
* definitions for using Inversion file system routines (ie, large objects)
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/libpq-fs.h
diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h
index 18052cbfef..d4885a5e28 100644
--- a/src/include/libpq/libpq.h
+++ b/src/include/libpq/libpq.h
@@ -4,7 +4,7 @@
* POSTGRES LIBPQ buffer structure definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/libpq.h
@@ -14,7 +14,6 @@
#ifndef LIBPQ_H
#define LIBPQ_H
-#include <sys/types.h>
#include <netinet/in.h>
#include "lib/stringinfo.h"
@@ -81,10 +80,7 @@ extern char *ssl_key_file;
extern char *ssl_ca_file;
extern char *ssl_crl_file;
-extern int (*pq_putmessage_hook) (char msgtype, const char *s, size_t len);
-extern int (*pq_flush_hook) (void);
-
-extern int secure_initialize(void);
+extern int secure_initialize(bool isServerStart);
extern bool secure_loaded_verify_locations(void);
extern void secure_destroy(void);
extern int secure_open_server(Port *port);
diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h
index c6bbfc2377..b6de569c5c 100644
--- a/src/include/libpq/pqcomm.h
+++ b/src/include/libpq/pqcomm.h
@@ -6,7 +6,7 @@
* NOTE: for historical reasons, this does not correspond to pqcomm.c.
* pqcomm.c's routines are declared in libpq.h.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/pqcomm.h
@@ -107,7 +107,7 @@ typedef struct
/* The earliest and latest frontend/backend protocol version supported. */
-#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(1,0)
+#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(2,0)
#define PG_PROTOCOL_LATEST PG_PROTOCOL(3,0)
typedef uint32 ProtocolVersion; /* FE/BE protocol version number */
@@ -172,6 +172,9 @@ extern bool Db_user_namespace;
#define AUTH_REQ_GSS 7 /* GSSAPI without wrap() */
#define AUTH_REQ_GSS_CONT 8 /* Continue GSS exchanges */
#define AUTH_REQ_SSPI 9 /* SSPI negotiate without wrap() */
+#define AUTH_REQ_SASL 10 /* Begin SASL authentication */
+#define AUTH_REQ_SASL_CONT 11 /* Continue SASL authentication */
+#define AUTH_REQ_SASL_FIN 12 /* Final SASL message */
typedef uint32 AuthRequest;
diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h
index 3c0d4b2622..4df87ec8a2 100644
--- a/src/include/libpq/pqformat.h
+++ b/src/include/libpq/pqformat.h
@@ -3,7 +3,7 @@
* pqformat.h
* Definitions for formatting and parsing frontend/backend messages
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/pqformat.h
diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h
index 8c03acb308..e356bd60f4 100644
--- a/src/include/libpq/pqmq.h
+++ b/src/include/libpq/pqmq.h
@@ -3,7 +3,7 @@
* pqmq.h
* Use the frontend/backend protocol for communication over a shm_mq
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/pqmq.h
diff --git a/src/include/libpq/pqsignal.h b/src/include/libpq/pqsignal.h
index c77553c7aa..a9dbce49d1 100644
--- a/src/include/libpq/pqsignal.h
+++ b/src/include/libpq/pqsignal.h
@@ -3,7 +3,7 @@
* pqsignal.h
* Backend signal(2) support (see also src/port/pqsignal.c)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/libpq/pqsignal.h
diff --git a/src/include/libpq/scram.h b/src/include/libpq/scram.h
new file mode 100644
index 0000000000..14b48af12f
--- /dev/null
+++ b/src/include/libpq/scram.h
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ *
+ * scram.h
+ * Interface to libpq/scram.c
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/libpq/scram.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_SCRAM_H
+#define PG_SCRAM_H
+
+/* Name of SCRAM-SHA-256 per IANA */
+#define SCRAM_SHA256_NAME "SCRAM-SHA-256"
+
+/* Status codes for message exchange */
+#define SASL_EXCHANGE_CONTINUE 0
+#define SASL_EXCHANGE_SUCCESS 1
+#define SASL_EXCHANGE_FAILURE 2
+
+/* Routines dedicated to authentication */
+extern void *pg_be_scram_init(const char *username, const char *shadow_pass);
+extern int pg_be_scram_exchange(void *opaq, char *input, int inputlen,
+ char **output, int *outputlen, char **logdetail);
+
+/* Routines to handle and check SCRAM-SHA-256 verifier */
+extern char *pg_be_scram_build_verifier(const char *password);
+extern bool scram_verify_plain_password(const char *username,
+ const char *password, const char *verifier);
+
+#endif /* PG_SCRAM_H */
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 24e8d0dc54..737ab1c713 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -3,7 +3,7 @@
* pg_wchar.h
* multibyte-character support
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/mb/pg_wchar.h
@@ -333,6 +333,12 @@ typedef struct pg_enc2gettext
extern const pg_enc2gettext pg_enc2gettext_tbl[];
/*
+ * Encoding names for ICU
+ */
+extern bool is_encoding_supported_by_icu(int encoding);
+extern const char *get_encoding_name_for_icu(int encoding);
+
+/*
* pg_wchar stuff
*/
typedef int (*mb2wchar_with_len_converter) (const unsigned char *from,
@@ -372,25 +378,81 @@ extern const pg_wchar_tbl pg_wchar_table[];
* characters up to 4 bytes long. For example, the byte sequence 0xC2 0x89
* would be represented by 0x0000C289, and 0xE8 0xA2 0xB4 by 0x00E8A2B4.
*
- * Maps are arrays of these structs, which must be in order by the lookup key
- * (so that bsearch() can be used).
+ * There are three possible ways a character can be mapped:
*
- * UTF-8 to local code conversion map
+ * 1. Using a radix tree, from source to destination code.
+ * 2. Using a sorted array of source -> destination code pairs. This
+ * method is used for "combining" characters. There are so few of
+ * them that building a radix tree would be wasteful.
+ * 3. Using a conversion function.
*/
-typedef struct
-{
- uint32 utf; /* UTF-8 */
- uint32 code; /* local code */
-} pg_utf_to_local;
/*
- * local code to UTF-8 conversion map
+ * Radix tree for character conversion.
+ *
+ * Logically, this is actually four different radix trees, for 1-byte,
+ * 2-byte, 3-byte and 4-byte inputs. The 1-byte tree is a simple lookup
+ * table from source to target code. The 2-byte tree consists of two levels:
+ * one lookup table for the first byte, where the value in the lookup table
+ * points to a lookup table for the second byte. And so on.
+ *
+ * Physically, all the trees are stored in one big array, in 'chars16' or
+ * 'chars32', depending on the maximum value that needs to be reprented. For
+ * each level in each tree, we also store lower and upper bound of allowed
+ * values - values outside those bounds are considered invalid, and are left
+ * out of the tables.
+ *
+ * In the intermediate levels of the trees, the values stored are offsets
+ * into the chars[16|32] array.
+ *
+ * In the beginning of the chars[16|32] array, there is always a number of
+ * zeros, so that you safely follow an index from an intermediate table
+ * without explicitly checking for a zero. Following a zero any number of
+ * times will always bring you to the dummy, all-zeros table in the
+ * beginning. This helps to shave some cycles when looking up values.
*/
typedef struct
{
- uint32 code; /* local code */
- uint32 utf; /* UTF-8 */
-} pg_local_to_utf;
+ /*
+ * Array containing all the values. Only one of chars16 or chars32 is
+ * used, depending on how wide the values we need to represent are.
+ */
+ const uint16 *chars16;
+ const uint32 *chars32;
+
+ /* Radix tree for 1-byte inputs */
+ uint32 b1root; /* offset of table in the chars[16|32] array */
+ uint8 b1_lower; /* min allowed value for a single byte input */
+ uint8 b1_upper; /* max allowed value for a single byte input */
+
+ /* Radix tree for 2-byte inputs */
+ uint32 b2root; /* offset of 1st byte's table */
+ uint8 b2_1_lower; /* min/max allowed value for 1st input byte */
+ uint8 b2_1_upper;
+ uint8 b2_2_lower; /* min/max allowed value for 2nd input byte */
+ uint8 b2_2_upper;
+
+ /* Radix tree for 3-byte inputs */
+ uint32 b3root; /* offset of 1st byte's table */
+ uint8 b3_1_lower; /* min/max allowed value for 1st input byte */
+ uint8 b3_1_upper;
+ uint8 b3_2_lower; /* min/max allowed value for 2nd input byte */
+ uint8 b3_2_upper;
+ uint8 b3_3_lower; /* min/max allowed value for 3rd input byte */
+ uint8 b3_3_upper;
+
+ /* Radix tree for 4-byte inputs */
+ uint32 b4root; /* offset of 1st byte's table */
+ uint8 b4_1_lower; /* min/max allowed value for 1st input byte */
+ uint8 b4_1_upper;
+ uint8 b4_2_lower; /* min/max allowed value for 2nd input byte */
+ uint8 b4_2_upper;
+ uint8 b4_3_lower; /* min/max allowed value for 3rd input byte */
+ uint8 b4_3_upper;
+ uint8 b4_4_lower; /* min/max allowed value for 4th input byte */
+ uint8 b4_4_upper;
+
+} pg_mb_radix_tree;
/*
* UTF-8 to local code conversion map (for combined characters)
@@ -510,13 +572,13 @@ extern unsigned short CNStoBIG5(unsigned short cns, unsigned char lc);
extern void UtfToLocal(const unsigned char *utf, int len,
unsigned char *iso,
- const pg_utf_to_local *map, int mapsize,
+ const pg_mb_radix_tree *map,
const pg_utf_to_local_combined *cmap, int cmapsize,
utf_local_conversion_func conv_func,
int encoding);
extern void LocalToUtf(const unsigned char *iso, int len,
unsigned char *utf,
- const pg_local_to_utf *map, int mapsize,
+ const pg_mb_radix_tree *map,
const pg_local_to_utf_combined *cmap, int cmapsize,
utf_local_conversion_func conv_func,
int encoding);
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index bb0d7d1dac..343cbd9692 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -11,7 +11,7 @@
* resource-limitation stuff, such as work_mem and check_stack_depth().
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/miscadmin.h
@@ -145,9 +145,9 @@ do { \
* from utils/init/globals.c
*/
extern PGDLLIMPORT pid_t PostmasterPid;
-extern bool IsPostmasterEnvironment;
+extern PGDLLIMPORT bool IsPostmasterEnvironment;
extern PGDLLIMPORT bool IsUnderPostmaster;
-extern bool IsBackgroundWorker;
+extern PGDLLIMPORT bool IsBackgroundWorker;
extern PGDLLIMPORT bool IsBinaryUpgrade;
extern bool ExitOnAnyError;
@@ -158,12 +158,13 @@ extern PGDLLIMPORT int NBuffers;
extern int MaxBackends;
extern int MaxConnections;
extern int max_worker_processes;
+extern int max_parallel_workers;
extern PGDLLIMPORT int MyProcPid;
extern PGDLLIMPORT pg_time_t MyStartTime;
extern PGDLLIMPORT struct Port *MyProcPort;
extern PGDLLIMPORT struct Latch *MyLatch;
-extern long MyCancelKey;
+extern int32 MyCancelKey;
extern int MyPMChildSlot;
extern char OutputFileName[];
diff --git a/src/include/nodes/bitmapset.h b/src/include/nodes/bitmapset.h
index 16b0c5efb8..f381bedd44 100644
--- a/src/include/nodes/bitmapset.h
+++ b/src/include/nodes/bitmapset.h
@@ -11,7 +11,7 @@
* bms_is_empty() in preference to testing for NULL.)
*
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/nodes/bitmapset.h
*
@@ -21,6 +21,11 @@
#define BITMAPSET_H
/*
+ * Forward decl to save including pg_list.h
+ */
+struct List;
+
+/*
* Data representation
*/
@@ -70,6 +75,7 @@ extern bool bms_is_subset(const Bitmapset *a, const Bitmapset *b);
extern BMS_Comparison bms_subset_compare(const Bitmapset *a, const Bitmapset *b);
extern bool bms_is_member(int x, const Bitmapset *a);
extern bool bms_overlap(const Bitmapset *a, const Bitmapset *b);
+extern bool bms_overlap_list(const Bitmapset *a, const struct List *b);
extern bool bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b);
extern int bms_singleton_member(const Bitmapset *a);
extern bool bms_get_singleton_member(const Bitmapset *a, int *member);
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 411d969b3b..2bc126dabe 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/execnodes.h
@@ -17,15 +17,86 @@
#include "access/genam.h"
#include "access/heapam.h"
+#include "access/tupconvert.h"
#include "executor/instrument.h"
#include "lib/pairingheap.h"
#include "nodes/params.h"
#include "nodes/plannodes.h"
+#include "utils/hsearch.h"
+#include "utils/queryenvironment.h"
#include "utils/reltrigger.h"
#include "utils/sortsupport.h"
#include "utils/tuplestore.h"
#include "pgxc/squeue.h"
#include "utils/tuplesort.h"
+#include "nodes/tidbitmap.h"
+#include "storage/condition_variable.h"
+
+
+/* ----------------
+ * ExprState node
+ *
+ * ExprState is the top-level node for expression evaluation.
+ * It contains instructions (in ->steps) to evaluate the expression.
+ * ----------------
+ */
+struct ExprState; /* forward references in this file */
+struct ExprContext;
+struct ExprEvalStep; /* avoid including execExpr.h everywhere */
+
+typedef Datum (*ExprStateEvalFunc) (struct ExprState *expression,
+ struct ExprContext *econtext,
+ bool *isNull);
+
+/* Bits in ExprState->flags (see also execExpr.h for private flag bits): */
+/* expression is for use with ExecQual() */
+#define EEO_FLAG_IS_QUAL (1 << 0)
+
+typedef struct ExprState
+{
+ Node tag;
+
+ uint8 flags; /* bitmask of EEO_FLAG_* bits, see above */
+
+ /*
+ * Storage for result value of a scalar expression, or for individual
+ * column results within expressions built by ExecBuildProjectionInfo().
+ */
+ bool resnull;
+ Datum resvalue;
+
+ /*
+ * If projecting a tuple result, this slot holds the result; else NULL.
+ */
+ TupleTableSlot *resultslot;
+
+ /*
+ * Instructions to compute expression's return value.
+ */
+ struct ExprEvalStep *steps;
+
+ /*
+ * Function that actually evaluates the expression. This can be set to
+ * different values depending on the complexity of the expression.
+ */
+ ExprStateEvalFunc evalfunc;
+
+ /* original expression tree, for debugging only */
+ Expr *expr;
+
+ /*
+ * XXX: following only needed during "compilation", could be thrown away.
+ */
+
+ int steps_len; /* number of steps currently */
+ int steps_alloc; /* allocated length of steps array */
+
+ Datum *innermost_caseval;
+ bool *innermost_casenull;
+
+ Datum *innermost_domainval;
+ bool *innermost_domainnull;
+} ExprState;
/* ----------------
@@ -52,6 +123,8 @@
* ReadyForInserts is it valid for inserts?
* Concurrent are we doing a concurrent index build?
* BrokenHotChain did we detect any broken HOT chains?
+ * AmCache private cache area for index AM
+ * Context memory context holding this IndexInfo
*
* ii_Concurrent and ii_BrokenHotChain are used only during index build;
* they're conventionally set to false otherwise.
@@ -65,7 +138,7 @@ typedef struct IndexInfo
List *ii_Expressions; /* list of Expr */
List *ii_ExpressionsState; /* list of ExprState */
List *ii_Predicate; /* list of Expr */
- List *ii_PredicateState; /* list of ExprState */
+ ExprState *ii_PredicateState;
Oid *ii_ExclusionOps; /* array with one entry per column */
Oid *ii_ExclusionProcs; /* array with one entry per column */
uint16 *ii_ExclusionStrats; /* array with one entry per column */
@@ -76,6 +149,8 @@ typedef struct IndexInfo
bool ii_ReadyForInserts;
bool ii_Concurrent;
bool ii_BrokenHotChain;
+ void *ii_AmCache;
+ MemoryContext ii_Context;
} IndexInfo;
/* ----------------
@@ -156,7 +231,8 @@ typedef struct ExprContext
} ExprContext;
/*
- * Set-result status returned by ExecEvalExpr()
+ * Set-result status used when evaluating functions potentially returning a
+ * set.
*/
typedef enum
{
@@ -207,53 +283,21 @@ typedef struct ReturnSetInfo
* that is, form new tuples by evaluation of targetlist expressions.
* Nodes which need to do projections create one of these.
*
+ * The target tuple slot is kept in ProjectionInfo->pi_state.resultslot.
* ExecProject() evaluates the tlist, forms a tuple, and stores it
* in the given slot. Note that the result will be a "virtual" tuple
* unless ExecMaterializeSlot() is then called to force it to be
* converted to a physical tuple. The slot must have a tupledesc
* that matches the output of the tlist!
- *
- * The planner very often produces tlists that consist entirely of
- * simple Var references (lower levels of a plan tree almost always
- * look like that). And top-level tlists are often mostly Vars too.
- * We therefore optimize execution of simple-Var tlist entries.
- * The pi_targetlist list actually contains only the tlist entries that
- * aren't simple Vars, while those that are Vars are processed using the
- * varSlotOffsets/varNumbers/varOutputCols arrays.
- *
- * The lastXXXVar fields are used to optimize fetching of fields from
- * input tuples: they let us do a slot_getsomeattrs() call to ensure
- * that all needed attributes are extracted in one pass.
- *
- * targetlist target list for projection (non-Var expressions only)
- * exprContext expression context in which to evaluate targetlist
- * slot slot to place projection result in
- * itemIsDone workspace array for ExecProject
- * directMap true if varOutputCols[] is an identity map
- * numSimpleVars number of simple Vars found in original tlist
- * varSlotOffsets array indicating which slot each simple Var is from
- * varNumbers array containing input attr numbers of simple Vars
- * varOutputCols array containing output attr numbers of simple Vars
- * lastInnerVar highest attnum from inner tuple slot (0 if none)
- * lastOuterVar highest attnum from outer tuple slot (0 if none)
- * lastScanVar highest attnum from scan tuple slot (0 if none)
* ----------------
*/
typedef struct ProjectionInfo
{
NodeTag type;
- List *pi_targetlist;
+ /* instructions to evaluate projection */
+ ExprState pi_state;
+ /* expression context in which to evaluate expression */
ExprContext *pi_exprContext;
- TupleTableSlot *pi_slot;
- ExprDoneCond *pi_itemIsDone;
- bool pi_directMap;
- int pi_numSimpleVars;
- int *pi_varSlotOffsets;
- int *pi_varNumbers;
- int *pi_varOutputCols;
- int pi_lastInnerVar;
- int pi_lastOuterVar;
- int pi_lastScanVar;
} ProjectionInfo;
/* ----------------
@@ -321,6 +365,8 @@ typedef struct JunkFilter
* projectReturning for computing a RETURNING list
* onConflictSetProj for computing ON CONFLICT DO UPDATE SET
* onConflictSetWhere list of ON CONFLICT DO UPDATE exprs (qual)
+ * PartitionCheck partition check expression
+ * PartitionCheckExpr partition check expression state
* ----------------
*/
typedef struct ResultRelInfo
@@ -333,18 +379,21 @@ typedef struct ResultRelInfo
IndexInfo **ri_IndexRelationInfo;
TriggerDesc *ri_TrigDesc;
FmgrInfo *ri_TrigFunctions;
- List **ri_TrigWhenExprs;
+ ExprState **ri_TrigWhenExprs;
Instrumentation *ri_TrigInstrument;
struct FdwRoutine *ri_FdwRoutine;
void *ri_FdwState;
bool ri_usesFdwDirectModify;
List *ri_WithCheckOptions;
List *ri_WithCheckOptionExprs;
- List **ri_ConstraintExprs;
+ ExprState **ri_ConstraintExprs;
JunkFilter *ri_junkFilter;
ProjectionInfo *ri_projectReturning;
ProjectionInfo *ri_onConflictSetProj;
- List *ri_onConflictSetWhere;
+ ExprState *ri_onConflictSetWhere;
+ List *ri_PartitionCheck;
+ ExprState *ri_PartitionCheckExpr;
+ Relation ri_PartitionRoot;
} ResultRelInfo;
/* ----------------
@@ -363,6 +412,7 @@ typedef struct EState
Snapshot es_crosscheck_snapshot; /* crosscheck time qual for RI */
List *es_range_table; /* List of RangeTblEntry */
PlannedStmt *es_plannedstmt; /* link to top of plan tree */
+ const char *es_sourceText; /* Source text from QueryDesc */
JunkFilter *es_junkFilter; /* top-level junk filter, if any */
@@ -379,6 +429,16 @@ typedef struct EState
#endif
#endif
+ /*
+ * Info about the target partitioned target table root(s) for
+ * update/delete queries. They required only to fire any per-statement
+ * triggers defined on the table. It exists separately from
+ * es_result_relations, because partitioned tables don't appear in the
+ * plan tree for the update/delete cases.
+ */
+ ResultRelInfo *es_root_result_relations; /* array of ResultRelInfos */
+ int es_num_root_result_relations; /* length of the array */
+
/* Stuff used for firing triggers: */
List *es_trig_target_relations; /* trigger-only ResultRelInfos */
TupleTableSlot *es_trig_tuple_slot; /* for trigger output tuples */
@@ -389,6 +449,8 @@ typedef struct EState
ParamListInfo es_param_list_info; /* values of external params */
ParamExecData *es_param_exec_vals; /* values of internal params */
+ QueryEnvironment *es_queryEnv; /* query environment */
+
/* Other working state: */
MemoryContext es_query_cxt; /* per-query context in which EState lives */
@@ -428,6 +490,9 @@ typedef struct EState
HeapTuple *es_epqTuple; /* array of EPQ substitute tuples */
bool *es_epqTupleSet; /* true if EPQ tuple is provided */
bool *es_epqScanDone; /* true if EPQ tuple has been fetched */
+
+ /* The per-query shared memory area to use for parallel execution. */
+ struct dsa_area *es_query_dsa;
} EState;
@@ -505,14 +570,23 @@ typedef struct TupleHashTableData *TupleHashTable;
typedef struct TupleHashEntryData
{
- /* firstTuple must be the first field in this struct! */
MinimalTuple firstTuple; /* copy of first tuple in this group */
- /* there may be additional data beyond the end of this struct */
-} TupleHashEntryData; /* VARIABLE LENGTH STRUCT */
+ void *additional; /* user data */
+ uint32 status; /* hash status */
+ uint32 hash; /* hash value (cached) */
+} TupleHashEntryData;
+
+/* define paramters necessary to generate the tuple hash table interface */
+#define SH_PREFIX tuplehash
+#define SH_ELEMENT_TYPE TupleHashEntryData
+#define SH_KEY_TYPE MinimalTuple
+#define SH_SCOPE extern
+#define SH_DECLARE
+#include "lib/simplehash.h"
typedef struct TupleHashTableData
{
- HTAB *hashtab; /* underlying dynahash table */
+ tuplehash_hash *hashtab; /* underlying hash table */
int numCols; /* number of columns in lookup key */
AttrNumber *keyColIdx; /* attr numbers of key columns */
FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */
@@ -525,9 +599,10 @@ typedef struct TupleHashTableData
TupleTableSlot *inputslot; /* current input tuple's slot */
FmgrInfo *in_hash_funcs; /* hash functions for input datatype(s) */
FmgrInfo *cur_eq_funcs; /* equality functions for input vs. table */
+ uint32 hash_iv; /* hash-function IV */
} TupleHashTableData;
-typedef HASH_SEQ_STATUS TupleHashIterator;
+typedef tuplehash_iterator TupleHashIterator;
/*
* Use InitTupleHashIterator/TermTupleHashIterator for a read/write scan.
@@ -535,158 +610,78 @@ typedef HASH_SEQ_STATUS TupleHashIterator;
* explicit scan termination is needed).
*/
#define InitTupleHashIterator(htable, iter) \
- hash_seq_init(iter, (htable)->hashtab)
+ tuplehash_start_iterate(htable->hashtab, iter)
#define TermTupleHashIterator(iter) \
- hash_seq_term(iter)
+ ((void) 0)
#define ResetTupleHashIterator(htable, iter) \
- do { \
- hash_freeze((htable)->hashtab); \
- hash_seq_init(iter, (htable)->hashtab); \
- } while (0)
-#define ScanTupleHashTable(iter) \
- ((TupleHashEntry) hash_seq_search(iter))
+ InitTupleHashIterator(htable, iter)
+#define ScanTupleHashTable(htable, iter) \
+ tuplehash_iterate(htable->hashtab, iter)
/* ----------------------------------------------------------------
- * Expression State Trees
- *
- * Each executable expression tree has a parallel ExprState tree.
- *
- * Unlike PlanState, there is not an exact one-for-one correspondence between
- * ExprState node types and Expr node types. Many Expr node types have no
- * need for node-type-specific run-time state, and so they can use plain
- * ExprState or GenericExprState as their associated ExprState node type.
+ * Expression State Nodes
+ *
+ * Formerly, there was a separate executor expression state node corresponding
+ * to each node in a planned expression tree. That's no longer the case; for
+ * common expression node types, all the execution info is embedded into
+ * step(s) in a single ExprState node. But we still have a few executor state
+ * node types for selected expression node types, mostly those in which info
+ * has to be shared with other parts of the execution state tree.
* ----------------------------------------------------------------
*/
/* ----------------
- * ExprState node
- *
- * ExprState is the common superclass for all ExprState-type nodes.
- *
- * It can also be instantiated directly for leaf Expr nodes that need no
- * local run-time state (such as Var, Const, or Param).
- *
- * To save on dispatch overhead, each ExprState node contains a function
- * pointer to the routine to execute to evaluate the node.
- * ----------------
- */
-
-typedef struct ExprState ExprState;
-
-typedef Datum (*ExprStateEvalFunc) (ExprState *expression,
- ExprContext *econtext,
- bool *isNull,
- ExprDoneCond *isDone);
-
-struct ExprState
-{
- NodeTag type;
- Expr *expr; /* associated Expr node */
- ExprStateEvalFunc evalfunc; /* routine to run to execute node */
-};
-
-/* ----------------
- * GenericExprState node
- *
- * This is used for Expr node types that need no local run-time state,
- * but have one child Expr node.
- * ----------------
- */
-typedef struct GenericExprState
-{
- ExprState xprstate;
- ExprState *arg; /* state of my child node */
-} GenericExprState;
-
-/* ----------------
- * WholeRowVarExprState node
- * ----------------
- */
-typedef struct WholeRowVarExprState
-{
- ExprState xprstate;
- struct PlanState *parent; /* parent PlanState, or NULL if none */
- TupleDesc wrv_tupdesc; /* descriptor for resulting tuples */
- JunkFilter *wrv_junkFilter; /* JunkFilter to remove resjunk cols */
-} WholeRowVarExprState;
-
-/* ----------------
* AggrefExprState node
* ----------------
*/
typedef struct AggrefExprState
{
- ExprState xprstate;
+ NodeTag type;
+ Aggref *aggref; /* expression plan node */
int aggno; /* ID number for agg within its plan node */
} AggrefExprState;
/* ----------------
- * GroupingFuncExprState node
- *
- * The list of column numbers refers to the input tuples of the Agg node to
- * which the GroupingFunc belongs, and may contain 0 for references to columns
- * that are only present in grouping sets processed by different Agg nodes (and
- * which are therefore always considered "grouping" here).
- * ----------------
- */
-typedef struct GroupingFuncExprState
-{
- ExprState xprstate;
- struct AggState *aggstate;
- List *clauses; /* integer list of column numbers */
-} GroupingFuncExprState;
-
-/* ----------------
* WindowFuncExprState node
* ----------------
*/
typedef struct WindowFuncExprState
{
- ExprState xprstate;
- List *args; /* states of argument expressions */
+ NodeTag type;
+ WindowFunc *wfunc; /* expression plan node */
+ List *args; /* ExprStates for argument expressions */
ExprState *aggfilter; /* FILTER expression */
int wfuncno; /* ID number for wfunc within its plan node */
} WindowFuncExprState;
-/* ----------------
- * ArrayRefExprState node
- *
- * Note: array types can be fixed-length (typlen > 0), but only when the
- * element type is itself fixed-length. Otherwise they are varlena structures
- * and have typlen = -1. In any case, an array type is never pass-by-value.
- * ----------------
- */
-typedef struct ArrayRefExprState
-{
- ExprState xprstate;
- List *refupperindexpr; /* states for child nodes */
- List *reflowerindexpr;
- ExprState *refexpr;
- ExprState *refassgnexpr;
- int16 refattrlength; /* typlen of array type */
- int16 refelemlength; /* typlen of the array element type */
- bool refelembyval; /* is the element type pass-by-value? */
- char refelemalign; /* typalign of the element type */
-} ArrayRefExprState;
/* ----------------
- * FuncExprState node
+ * SetExprState node
*
- * Although named for FuncExpr, this is also used for OpExpr, DistinctExpr,
- * and NullIf nodes; be careful to check what xprstate.expr is actually
- * pointing at!
+ * State for evaluating a potentially set-returning expression (like FuncExpr
+ * or OpExpr). In some cases, like some of the expressions in ROWS FROM(...)
+ * the expression might not be a SRF, but nonetheless it uses the same
+ * machinery as SRFs; it will be treated as a SRF returning a single row.
* ----------------
*/
-typedef struct FuncExprState
+typedef struct SetExprState
{
- ExprState xprstate;
- List *args; /* states of argument expressions */
+ NodeTag type;
+ Expr *expr; /* expression plan node */
+ List *args; /* ExprStates for argument expressions */
+
+ /*
+ * In ROWS FROM, functions can be inlined, removing the FuncExpr normally
+ * inside. In such a case this is the compiled expression (which cannot
+ * return a set), which'll be evaluated using regular ExecEvalExpr().
+ */
+ ExprState *elidedFuncState;
/*
* Function manager's lookup info for the target function. If func.fn_oid
* is InvalidOid, we haven't initialized it yet (nor any of the following
- * fields).
+ * fields, except funcReturnsSet).
*/
FmgrInfo func;
@@ -707,6 +702,12 @@ typedef struct FuncExprState
* NULL */
/*
+ * Remember whether the function is declared to return a set. This is set
+ * by ExecInitExpr, and is valid even before the FmgrInfo is set up.
+ */
+ bool funcReturnsSet;
+
+ /*
* setArgsValid is true when we are evaluating a set-returning function
* that uses value-per-call mode and we are in the middle of a call
* series; we want to pass the same argument values to the function again
@@ -716,15 +717,8 @@ typedef struct FuncExprState
bool setArgsValid;
/*
- * Flag to remember whether we found a set-valued argument to the
- * function. This causes the function result to be a set as well. Valid
- * only when setArgsValid is true or funcResultStore isn't NULL.
- */
- bool setHasSetArg; /* some argument returns a set */
-
- /*
* Flag to remember whether we have registered a shutdown callback for
- * this FuncExprState. We do so only if funcResultStore or setArgsValid
+ * this SetExprState. We do so only if funcResultStore or setArgsValid
* has been set at least once (since all the callback is for is to release
* the tuplestore or clear setArgsValid).
*/
@@ -736,33 +730,7 @@ typedef struct FuncExprState
* argument values between calls, when setArgsValid is true.
*/
FunctionCallInfoData fcinfo_data;
-} FuncExprState;
-
-/* ----------------
- * ScalarArrayOpExprState node
- *
- * This is a FuncExprState plus some additional data.
- * ----------------
- */
-typedef struct ScalarArrayOpExprState
-{
- FuncExprState fxprstate;
- /* Cached info about array element type */
- Oid element_type;
- int16 typlen;
- bool typbyval;
- char typalign;
-} ScalarArrayOpExprState;
-
-/* ----------------
- * BoolExprState node
- * ----------------
- */
-typedef struct BoolExprState
-{
- ExprState xprstate;
- List *args; /* states of argument expression(s) */
-} BoolExprState;
+} SetExprState;
/* ----------------
* SubPlanState node
@@ -770,7 +738,8 @@ typedef struct BoolExprState
*/
typedef struct SubPlanState
{
- ExprState xprstate;
+ NodeTag type;
+ SubPlan *subplan; /* expression plan node */
struct PlanState *planstate; /* subselect plan's state tree */
struct PlanState *parent; /* parent plan node's state tree */
ExprState *testexpr; /* state of combining expression */
@@ -800,202 +769,18 @@ typedef struct SubPlanState
*/
typedef struct AlternativeSubPlanState
{
- ExprState xprstate;
- List *subplans; /* states of alternative subplans */
+ NodeTag type;
+ AlternativeSubPlan *subplan; /* expression plan node */
+ List *subplans; /* SubPlanStates of alternative subplans */
int active; /* list index of the one we're using */
} AlternativeSubPlanState;
-/* ----------------
- * FieldSelectState node
- * ----------------
- */
-typedef struct FieldSelectState
-{
- ExprState xprstate;
- ExprState *arg; /* input expression */
- TupleDesc argdesc; /* tupdesc for most recent input */
-} FieldSelectState;
-
-/* ----------------
- * FieldStoreState node
- * ----------------
- */
-typedef struct FieldStoreState
-{
- ExprState xprstate;
- ExprState *arg; /* input tuple value */
- List *newvals; /* new value(s) for field(s) */
- TupleDesc argdesc; /* tupdesc for most recent input */
-} FieldStoreState;
-
-/* ----------------
- * CoerceViaIOState node
- * ----------------
- */
-typedef struct CoerceViaIOState
-{
- ExprState xprstate;
- ExprState *arg; /* input expression */
- FmgrInfo outfunc; /* lookup info for source output function */
- FmgrInfo infunc; /* lookup info for result input function */
- Oid intypioparam; /* argument needed for input function */
-} CoerceViaIOState;
-
-/* ----------------
- * ArrayCoerceExprState node
- * ----------------
- */
-typedef struct ArrayCoerceExprState
-{
- ExprState xprstate;
- ExprState *arg; /* input array value */
- Oid resultelemtype; /* element type of result array */
- FmgrInfo elemfunc; /* lookup info for element coercion function */
- /* use struct pointer to avoid including array.h here */
- struct ArrayMapState *amstate; /* workspace for array_map */
-} ArrayCoerceExprState;
-
-/* ----------------
- * ConvertRowtypeExprState node
- * ----------------
- */
-typedef struct ConvertRowtypeExprState
-{
- ExprState xprstate;
- ExprState *arg; /* input tuple value */
- TupleDesc indesc; /* tupdesc for source rowtype */
- TupleDesc outdesc; /* tupdesc for result rowtype */
- /* use "struct" so we needn't include tupconvert.h here */
- struct TupleConversionMap *map;
- bool initialized;
-} ConvertRowtypeExprState;
-
-/* ----------------
- * CaseExprState node
- * ----------------
- */
-typedef struct CaseExprState
-{
- ExprState xprstate;
- ExprState *arg; /* implicit equality comparison argument */
- List *args; /* the arguments (list of WHEN clauses) */
- ExprState *defresult; /* the default result (ELSE clause) */
-} CaseExprState;
-
-/* ----------------
- * CaseWhenState node
- * ----------------
- */
-typedef struct CaseWhenState
-{
- ExprState xprstate;
- ExprState *expr; /* condition expression */
- ExprState *result; /* substitution result */
-} CaseWhenState;
-
-/* ----------------
- * ArrayExprState node
- *
- * Note: ARRAY[] expressions always produce varlena arrays, never fixed-length
- * arrays.
- * ----------------
- */
-typedef struct ArrayExprState
-{
- ExprState xprstate;
- List *elements; /* states for child nodes */
- int16 elemlength; /* typlen of the array element type */
- bool elembyval; /* is the element type pass-by-value? */
- char elemalign; /* typalign of the element type */
-} ArrayExprState;
-
-/* ----------------
- * RowExprState node
- * ----------------
- */
-typedef struct RowExprState
-{
- ExprState xprstate;
- List *args; /* the arguments */
- TupleDesc tupdesc; /* descriptor for result tuples */
-} RowExprState;
-
-/* ----------------
- * RowCompareExprState node
- * ----------------
- */
-typedef struct RowCompareExprState
-{
- ExprState xprstate;
- List *largs; /* the left-hand input arguments */
- List *rargs; /* the right-hand input arguments */
- FmgrInfo *funcs; /* array of comparison function info */
- Oid *collations; /* array of collations to use */
-} RowCompareExprState;
-
-/* ----------------
- * CoalesceExprState node
- * ----------------
- */
-typedef struct CoalesceExprState
-{
- ExprState xprstate;
- List *args; /* the arguments */
-} CoalesceExprState;
-
-/* ----------------
- * MinMaxExprState node
- * ----------------
- */
-typedef struct MinMaxExprState
-{
- ExprState xprstate;
- List *args; /* the arguments */
- FmgrInfo cfunc; /* lookup info for comparison func */
-} MinMaxExprState;
-
-/* ----------------
- * XmlExprState node
- * ----------------
- */
-typedef struct XmlExprState
-{
- ExprState xprstate;
- List *named_args; /* ExprStates for named arguments */
- List *args; /* ExprStates for other arguments */
-} XmlExprState;
-
-/* ----------------
- * NullTestState node
- * ----------------
- */
-typedef struct NullTestState
-{
- ExprState xprstate;
- ExprState *arg; /* input expression */
- /* used only if input is of composite type: */
- TupleDesc argdesc; /* tupdesc for most recent input */
-} NullTestState;
-
-/* ----------------
- * CoerceToDomainState node
- * ----------------
- */
-typedef struct CoerceToDomainState
-{
- ExprState xprstate;
- ExprState *arg; /* input expression */
- /* Cached set of constraints that need to be checked */
- /* use struct pointer to avoid including typcache.h here */
- struct DomainConstraintRef *constraint_ref;
-} CoerceToDomainState;
-
/*
* DomainConstraintState - one item to check during CoerceToDomain
*
- * Note: this is just a Node, and not an ExprState, because it has no
- * corresponding Expr to link to. Nonetheless it is part of an ExprState
- * tree, so we give it a name following the xxxState convention.
+ * Note: we consider this to be part of an ExprState tree, so we give it
+ * a name following the xxxState convention. But there's no directly
+ * associated plan-tree node.
*/
typedef enum DomainConstraintType
{
@@ -1008,7 +793,8 @@ typedef struct DomainConstraintState
NodeTag type;
DomainConstraintType constrainttype; /* constraint type */
char *name; /* name of constraint (for error msgs) */
- ExprState *check_expr; /* for CHECK, a boolean expression */
+ Expr *check_expr; /* for CHECK, a boolean expression */
+ ExprState *check_exprstate; /* check_expr's eval state, or NULL */
} DomainConstraintState;
@@ -1045,8 +831,7 @@ typedef struct PlanState
* state trees parallel links in the associated plan tree (except for the
* subPlan list, which does not exist in the plan tree).
*/
- List *targetlist; /* target list to be computed at this node */
- List *qual; /* implicitly-ANDed qual conditions */
+ ExprState *qual; /* boolean qual condition */
struct PlanState *lefttree; /* input plan tree(s) */
struct PlanState *righttree;
List *initPlan; /* Init SubPlanState nodes (un-correlated expr
@@ -1064,8 +849,6 @@ typedef struct PlanState
TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */
ExprContext *ps_ExprContext; /* node's expression-evaluation context */
ProjectionInfo *ps_ProjInfo; /* info for doing tuple projection */
- bool ps_TupFromTlist;/* state flag for processing set-valued
- * functions in targetlist */
} PlanState;
/* ----------------
@@ -1119,6 +902,22 @@ typedef struct ResultState
} ResultState;
/* ----------------
+ * ProjectSetState information
+ *
+ * Note: at least one of the "elems" will be a SetExprState; the rest are
+ * regular ExprStates.
+ * ----------------
+ */
+typedef struct ProjectSetState
+{
+ PlanState ps; /* its first field is NodeTag */
+ Node **elems; /* array of expression states */
+ ExprDoneCond *elemdone; /* array of per-SRF is-done states */
+ int nelems; /* length of elemdone[] array */
+ bool pending_srf_tuples; /* still evaluating srfs in tlist? */
+} ProjectSetState;
+
+/* ----------------
* ModifyTableState information
* ----------------
*/
@@ -1135,6 +934,8 @@ typedef struct ModifyTableState
int mt_nplans; /* number of plans in the array */
int mt_whichplan; /* which one is being executed (0..n-1) */
ResultRelInfo *resultRelInfo; /* per-subplan target relations */
+ ResultRelInfo *rootResultRelInfo; /* root target relation (partitioned
+ * table root) */
List **mt_arowmarks; /* per-subplan ExecAuxRowMark lists */
EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */
bool fireBSTriggers; /* do we need to fire stmt triggers? */
@@ -1146,6 +947,15 @@ typedef struct ModifyTableState
* tlist */
TupleTableSlot *mt_conflproj; /* CONFLICT ... SET ... projection
* target */
+ struct PartitionDispatchData **mt_partition_dispatch_info;
+ /* Tuple-routing support info */
+ int mt_num_dispatch; /* Number of entries in the above array */
+ int mt_num_partitions; /* Number of members in the following
+ * arrays */
+ ResultRelInfo *mt_partitions; /* Per partition result relation */
+ TupleConversionMap **mt_partition_tupconv_maps;
+ /* Per partition tuple conversion map */
+ TupleTableSlot *mt_partition_tuple_slot;
} ModifyTableState;
/* ----------------
@@ -1334,12 +1144,13 @@ typedef struct
* SortSupport for reordering ORDER BY exprs
* OrderByTypByVals is the datatype of order by expression pass-by-value?
* OrderByTypLens typlens of the datatypes of order by expressions
+ * pscan_len size of parallel index scan descriptor
* ----------------
*/
typedef struct IndexScanState
{
ScanState ss; /* its first field is NodeTag */
- List *indexqualorig;
+ ExprState *indexqualorig;
List *indexorderbyorig;
ScanKey iss_ScanKeys;
int iss_NumScanKeys;
@@ -1360,6 +1171,7 @@ typedef struct IndexScanState
SortSupport iss_SortSupport;
bool *iss_OrderByTypByVals;
int16 *iss_OrderByTypLens;
+ Size iss_PscanLen;
} IndexScanState;
/* ----------------
@@ -1378,12 +1190,13 @@ typedef struct IndexScanState
* ScanDesc index scan descriptor
* VMBuffer buffer in use for visibility map testing, if any
* HeapFetches number of tuples we were forced to fetch from heap
+ * ioss_PscanLen Size of parallel index-only scan descriptor
* ----------------
*/
typedef struct IndexOnlyScanState
{
ScanState ss; /* its first field is NodeTag */
- List *indexqual;
+ ExprState *indexqual;
ScanKey ioss_ScanKeys;
int ioss_NumScanKeys;
ScanKey ioss_OrderByKeys;
@@ -1396,6 +1209,7 @@ typedef struct IndexOnlyScanState
IndexScanDesc ioss_ScanDesc;
Buffer ioss_VMBuffer;
long ioss_HeapFetches;
+ Size ioss_PscanLen;
} IndexOnlyScanState;
/* ----------------
@@ -1431,6 +1245,51 @@ typedef struct BitmapIndexScanState
} BitmapIndexScanState;
/* ----------------
+ * SharedBitmapState information
+ *
+ * BM_INITIAL TIDBitmap creation is not yet started, so first worker
+ * to see this state will set the state to BM_INPROGRESS
+ * and that process will be responsible for creating
+ * TIDBitmap.
+ * BM_INPROGRESS TIDBitmap creation is in progress; workers need to
+ * sleep until it's finished.
+ * BM_FINISHED TIDBitmap creation is done, so now all workers can
+ * proceed to iterate over TIDBitmap.
+ * ----------------
+ */
+typedef enum
+{
+ BM_INITIAL,
+ BM_INPROGRESS,
+ BM_FINISHED
+} SharedBitmapState;
+
+/* ----------------
+ * ParallelBitmapHeapState information
+ * tbmiterator iterator for scanning current pages
+ * prefetch_iterator iterator for prefetching ahead of current page
+ * mutex mutual exclusion for the prefetching variable
+ * and state
+ * prefetch_pages # pages prefetch iterator is ahead of current
+ * prefetch_target current target prefetch distance
+ * state current state of the TIDBitmap
+ * cv conditional wait variable
+ * phs_snapshot_data snapshot data shared to workers
+ * ----------------
+ */
+typedef struct ParallelBitmapHeapState
+{
+ dsa_pointer tbmiterator;
+ dsa_pointer prefetch_iterator;
+ slock_t mutex;
+ int prefetch_pages;
+ int prefetch_target;
+ SharedBitmapState state;
+ ConditionVariable cv;
+ char phs_snapshot_data[FLEXIBLE_ARRAY_MEMBER];
+} ParallelBitmapHeapState;
+
+/* ----------------
* BitmapHeapScanState information
*
* bitmapqualorig execution state for bitmapqualorig expressions
@@ -1443,12 +1302,17 @@ typedef struct BitmapIndexScanState
* prefetch_pages # pages prefetch iterator is ahead of current
* prefetch_target current target prefetch distance
* prefetch_maximum maximum value for prefetch_target
+ * pscan_len size of the shared memory for parallel bitmap
+ * initialized is node is ready to iterate
+ * shared_tbmiterator shared iterator
+ * shared_prefetch_iterator shared iterator for prefetching
+ * pstate shared state for parallel bitmap scan
* ----------------
*/
typedef struct BitmapHeapScanState
{
ScanState ss; /* its first field is NodeTag */
- List *bitmapqualorig;
+ ExprState *bitmapqualorig;
TIDBitmap *tbm;
TBMIterator *tbmiterator;
TBMIterateResult *tbmres;
@@ -1458,21 +1322,28 @@ typedef struct BitmapHeapScanState
int prefetch_pages;
int prefetch_target;
int prefetch_maximum;
+ Size pscan_len;
+ bool initialized;
+ TBMSharedIterator *shared_tbmiterator;
+ TBMSharedIterator *shared_prefetch_iterator;
+ ParallelBitmapHeapState *pstate;
} BitmapHeapScanState;
/* ----------------
* TidScanState information
*
+ * tidexprs list of TidExpr structs (see nodeTidscan.c)
* isCurrentOf scan has a CurrentOfExpr qual
* NumTids number of tids in this scan
* TidPtr index of currently fetched tid
* TidList evaluated item pointers (array of size NumTids)
+ * htup currently-fetched tuple, if any
* ----------------
*/
typedef struct TidScanState
{
ScanState ss; /* its first field is NodeTag */
- List *tss_tidquals; /* list of ExprState nodes */
+ List *tss_tidexprs;
bool tss_isCurrentOf;
int tss_NumTids;
int tss_TidPtr;
@@ -1551,6 +1422,31 @@ typedef struct ValuesScanState
} ValuesScanState;
/* ----------------
+ * TableFuncScanState node
+ *
+ * Used in table-expression functions like XMLTABLE.
+ * ----------------
+ */
+typedef struct TableFuncScanState
+{
+ ScanState ss; /* its first field is NodeTag */
+ ExprState *docexpr; /* state for document expression */
+ ExprState *rowexpr; /* state for row-generating expression */
+ List *colexprs; /* state for column-generating expression */
+ List *coldefexprs; /* state for column default expressions */
+ List *ns_names; /* list of str nodes with namespace names */
+ List *ns_uris; /* list of states of namespace uri exprs */
+ Bitmapset *notnulls; /* nullability flag for each output column */
+ void *opaque; /* table builder private space */
+ const struct TableFuncRoutine *routine; /* table builder methods */
+ FmgrInfo *in_functions; /* input function for each column */
+ Oid *typioparams; /* typioparam for each column */
+ int64 ordinal; /* row number to be output next */
+ MemoryContext perValueCxt; /* short life context for value evaluation */
+ Tuplestorestate *tupstore; /* output tuple store */
+} TableFuncScanState;
+
+/* ----------------
* CteScanState information
*
* CteScan nodes are used to scan a CommonTableExpr query.
@@ -1574,6 +1470,24 @@ typedef struct CteScanState
} CteScanState;
/* ----------------
+ * NamedTuplestoreScanState information
+ *
+ * NamedTuplestoreScan nodes are used to scan a Tuplestore created and
+ * named prior to execution of the query. An example is a transition
+ * table for an AFTER trigger.
+ *
+ * Multiple NamedTuplestoreScan nodes can read out from the same Tuplestore.
+ * ----------------
+ */
+typedef struct NamedTuplestoreScanState
+{
+ ScanState ss; /* its first field is NodeTag */
+ int readptr; /* index of my tuplestore read pointer */
+ TupleDesc tupdesc; /* format of the tuples in the tuplestore */
+ Tuplestorestate *relation; /* the rows */
+} NamedTuplestoreScanState;
+
+/* ----------------
* WorkTableScanState information
*
* WorkTableScan nodes are used to scan the work table created by
@@ -1596,7 +1510,7 @@ typedef struct WorkTableScanState
typedef struct ForeignScanState
{
ScanState ss; /* its first field is NodeTag */
- List *fdw_recheck_quals; /* original quals not in ss.ps.qual */
+ ExprState *fdw_recheck_quals; /* original quals not in ss.ps.qual */
Size pscan_len; /* size of parallel coordination information */
/* use struct pointer to avoid including fdwapi.h here */
struct FdwRoutine *fdwroutine;
@@ -1621,7 +1535,8 @@ struct CustomExecMethods;
typedef struct CustomScanState
{
ScanState ss;
- uint32 flags; /* mask of CUSTOMPATH_* flags, see relation.h */
+ uint32 flags; /* mask of CUSTOMPATH_* flags, see
+ * nodes/extensible.h */
List *custom_ps; /* list of child PlanState nodes, if any */
Size pscan_len; /* size of parallel coordination information */
const struct CustomExecMethods *methods;
@@ -1642,7 +1557,9 @@ typedef struct JoinState
{
PlanState ps;
JoinType jointype;
- List *joinqual; /* JOIN quals (in addition to ps.qual) */
+ bool single_match; /* True if we should skip to next outer tuple
+ * after finding one inner match */
+ ExprState *joinqual; /* JOIN quals (in addition to ps.qual) */
} JoinState;
/* ----------------
@@ -1667,6 +1584,7 @@ typedef struct NestLoopState
* NumClauses number of mergejoinable join clauses
* Clauses info for each mergejoinable clause
* JoinState current state of ExecMergeJoin state machine
+ * SkipMarkRestore true if we may skip Mark and Restore operations
* ExtraMarks true to issue extra Mark operations on inner scan
* ConstFalseJoin true if we have a constant-false joinqual
* FillOuter true if should emit unjoined outer tuples anyway
@@ -1691,6 +1609,7 @@ typedef struct MergeJoinState
int mj_NumClauses;
MergeJoinClause mj_Clauses; /* array of length mj_NumClauses */
int mj_JoinState;
+ bool mj_SkipMarkRestore;
bool mj_ExtraMarks;
bool mj_ConstFalseJoin;
bool mj_FillOuter;
@@ -1740,7 +1659,7 @@ typedef struct HashJoinTableData *HashJoinTable;
typedef struct HashJoinState
{
JoinState js; /* its first field is NodeTag */
- List *hashclauses; /* list of ExprState nodes */
+ ExprState *hashclauses;
List *hj_OuterHashKeys; /* list of ExprState nodes */
List *hj_InnerHashKeys; /* list of ExprState nodes */
List *hj_HashOperators; /* list of operator OIDs */
@@ -1800,7 +1719,7 @@ typedef struct SortState
/* ---------------------
* GroupState information
- * -------------------------
+ * ---------------------
*/
typedef struct GroupState
{
@@ -1819,13 +1738,14 @@ typedef struct GroupState
* input group during evaluation of an Agg node's output tuple(s). We
* create a second ExprContext, tmpcontext, in which to evaluate input
* expressions and run the aggregate transition functions.
- * -------------------------
+ * ---------------------
*/
/* these structs are private in nodeAgg.c: */
typedef struct AggStatePerAggData *AggStatePerAgg;
typedef struct AggStatePerTransData *AggStatePerTrans;
typedef struct AggStatePerGroupData *AggStatePerGroup;
typedef struct AggStatePerPhaseData *AggStatePerPhase;
+typedef struct AggStatePerHashData *AggStatePerHash;
typedef struct AggState
{
@@ -1833,15 +1753,17 @@ typedef struct AggState
List *aggs; /* all Aggref nodes in targetlist & quals */
int numaggs; /* length of list (could be zero!) */
int numtrans; /* number of pertrans items */
+ AggStrategy aggstrategy; /* strategy mode */
AggSplit aggsplit; /* agg-splitting mode, see nodes.h */
AggStatePerPhase phase; /* pointer to current phase data */
- int numphases; /* number of phases */
+ int numphases; /* number of phases (including phase 0) */
int current_phase; /* current phase number */
- FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
AggStatePerAgg peragg; /* per-Aggref information */
AggStatePerTrans pertrans; /* per-Trans state information */
+ ExprContext *hashcontext; /* econtexts for long-lived data (hashtable) */
ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */
ExprContext *tmpcontext; /* econtext for input expressions */
+ ExprContext *curaggcontext; /* currently active aggcontext */
AggStatePerTrans curpertrans; /* currently active trans state */
bool input_done; /* indicates end of input */
bool agg_done; /* indicates completion of Agg scan */
@@ -1853,18 +1775,21 @@ typedef struct AggState
/* These fields are for grouping set phase data */
int maxsets; /* The max number of sets in any phase */
AggStatePerPhase phases; /* array of all phases */
- Tuplesortstate *sort_in; /* sorted input to phases > 0 */
+ Tuplesortstate *sort_in; /* sorted input to phases > 1 */
Tuplesortstate *sort_out; /* input is copied here for next phase */
TupleTableSlot *sort_slot; /* slot for sort results */
/* these fields are used in AGG_PLAIN and AGG_SORTED modes: */
AggStatePerGroup pergroup; /* per-Aggref-per-group working state */
HeapTuple grp_firstTuple; /* copy of first tuple of current group */
- /* these fields are used in AGG_HASHED mode: */
- TupleHashTable hashtable; /* hash table with one entry per group */
- TupleTableSlot *hashslot; /* slot for loading hash table */
- List *hash_needed; /* list of columns needed in hash table */
+ /* these fields are used in AGG_HASHED and AGG_MIXED modes: */
bool table_filled; /* hash table filled yet? */
- TupleHashIterator hashiter; /* for iterating through hash table */
+ int num_hashes;
+ AggStatePerHash perhash;
+ AggStatePerGroup *hash_pergroup; /* array of per-group pointers */
+ /* support for evaluation of agg inputs */
+ TupleTableSlot *evalslot; /* slot for agg inputs */
+ ProjectionInfo *evalproj; /* projection machinery */
+ TupleDesc evaldesc; /* descriptor of input tuples */
} AggState;
/* ----------------
@@ -1971,6 +1896,35 @@ typedef struct GatherState
} GatherState;
/* ----------------
+ * GatherMergeState information
+ *
+ * Gather merge nodes launch 1 or more parallel workers, run a
+ * subplan which produces sorted output in each worker, and then
+ * merge the results into a single sorted stream.
+ * ----------------
+ */
+struct GMReaderTuple;
+
+typedef struct GatherMergeState
+{
+ PlanState ps; /* its first field is NodeTag */
+ bool initialized;
+ struct ParallelExecutorInfo *pei;
+ int nreaders;
+ int nworkers_launched;
+ struct TupleQueueReader **reader;
+ TupleDesc tupDesc;
+ TupleTableSlot **gm_slots;
+ struct binaryheap *gm_heap; /* binary heap of slot indices */
+ bool gm_initialized; /* gather merge initilized ? */
+ bool need_to_scan_locally;
+ int gm_nkeys;
+ SortSupport gm_sortkeys; /* array of length ms_nkeys */
+ struct GMReaderTupleBuffer *gm_tuple_buffers; /* tuple buffer per
+ * reader */
+} GatherMergeState;
+
+/* ----------------
* HashState information
* ----------------
*/
diff --git a/src/include/nodes/extensible.h b/src/include/nodes/extensible.h
index 17afe5897c..0b02cc18e9 100644
--- a/src/include/nodes/extensible.h
+++ b/src/include/nodes/extensible.h
@@ -4,7 +4,7 @@
* Definitions for extensible nodes and custom scans
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/extensible.h
@@ -139,6 +139,7 @@ typedef struct CustomExecMethods
void (*InitializeWorkerCustomScan) (CustomScanState *node,
shm_toc *toc,
void *coordinate);
+ void (*ShutdownCustomScan) (CustomScanState *node);
/* Optional: print additional information in EXPLAIN */
void (*ExplainCustomScan) (CustomScanState *node,
diff --git a/src/include/nodes/lockoptions.h b/src/include/nodes/lockoptions.h
index 1c2f00f65b..4f8affd930 100644
--- a/src/include/nodes/lockoptions.h
+++ b/src/include/nodes/lockoptions.h
@@ -4,7 +4,7 @@
* Common header for some locking-related declarations.
*
*
- * Copyright (c) 2014-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2014-2017, PostgreSQL Global Development Group
*
* src/include/nodes/lockoptions.h
*
diff --git a/src/include/nodes/makefuncs.h b/src/include/nodes/makefuncs.h
index 01c5cb45d5..53ea6598c8 100644
--- a/src/include/nodes/makefuncs.h
+++ b/src/include/nodes/makefuncs.h
@@ -4,7 +4,7 @@
* prototypes for the creator functions (for primitive nodes)
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/makefuncs.h
@@ -80,9 +80,9 @@ extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype, List *args,
extern FuncCall *makeFuncCall(List *name, List *args, int location);
-extern DefElem *makeDefElem(char *name, Node *arg);
+extern DefElem *makeDefElem(char *name, Node *arg, int location);
extern DefElem *makeDefElemExtended(char *nameSpace, char *name, Node *arg,
- DefElemAction defaction);
+ DefElemAction defaction, int location);
extern GroupingSet *makeGroupingSet(GroupingSetKind kind, List *content, int location);
diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h
index ba069cc130..fe6bc903b3 100644
--- a/src/include/nodes/memnodes.h
+++ b/src/include/nodes/memnodes.h
@@ -4,7 +4,7 @@
* POSTGRES memory context node definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/memnodes.h
@@ -96,6 +96,6 @@ typedef struct MemoryContextData
*/
#define MemoryContextIsValid(context) \
((context) != NULL && \
- (IsA((context), AllocSetContext)))
+ (IsA((context), AllocSetContext) || IsA((context), SlabContext)))
#endif /* MEMNODES_H */
diff --git a/src/include/nodes/nodeFuncs.h b/src/include/nodes/nodeFuncs.h
index 97af142929..b6c9b48ee6 100644
--- a/src/include/nodes/nodeFuncs.h
+++ b/src/include/nodes/nodeFuncs.h
@@ -3,7 +3,7 @@
* nodeFuncs.h
* Various general-purpose manipulations of Node trees
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/nodeFuncs.h
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 88d615d6fd..df93faed90 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -20,10 +20,10 @@
* The first field of every node is NodeTag. Each node created (with makeNode)
* will have one of the following tags as the value of its first field.
*
- * Note that the numbers of the node tags are not contiguous. We left holes
- * here so that we can add more tags without changing the existing enum's.
- * (Since node tag numbers never exist outside backend memory, there's no
- * real harm in renumbering, it just costs a full rebuild ...)
+ * Note that inserting or deleting node types changes the numbers of other
+ * node types later in the list. This is no problem during development, since
+ * the node numbers are never stored on disk. But don't do it in a released
+ * branch, because that would represent an ABI break for extensions.
*/
typedef enum NodeTag
{
@@ -32,7 +32,7 @@ typedef enum NodeTag
/*
* TAGS FOR EXECUTOR NODES (execnodes.h)
*/
- T_IndexInfo = 10,
+ T_IndexInfo,
T_ExprContext,
T_ProjectionInfo,
T_JunkFilter,
@@ -43,8 +43,9 @@ typedef enum NodeTag
/*
* TAGS FOR PLAN NODES (plannodes.h)
*/
- T_Plan = 100,
+ T_Plan,
T_Result,
+ T_ProjectSet,
T_ModifyTable,
T_Append,
T_MergeAppend,
@@ -62,7 +63,9 @@ typedef enum NodeTag
T_SubqueryScan,
T_FunctionScan,
T_ValuesScan,
+ T_TableFuncScan,
T_CteScan,
+ T_NamedTuplestoreScan,
T_WorkTableScan,
T_ForeignScan,
T_CustomScan,
@@ -77,6 +80,7 @@ typedef enum NodeTag
T_WindowAgg,
T_Unique,
T_Gather,
+ T_GatherMerge,
T_Hash,
T_SetOp,
T_LockRows,
@@ -112,8 +116,9 @@ typedef enum NodeTag
*
* These should correspond one-to-one with Plan node types.
*/
- T_PlanState = 200,
+ T_PlanState,
T_ResultState,
+ T_ProjectSetState,
T_ModifyTableState,
T_AppendState,
T_MergeAppendState,
@@ -130,8 +135,10 @@ typedef enum NodeTag
T_TidScanState,
T_SubqueryScanState,
T_FunctionScanState,
+ T_TableFuncScanState,
T_ValuesScanState,
T_CteScanState,
+ T_NamedTuplestoreScanState,
T_WorkTableScanState,
T_ForeignScanState,
T_CustomScanState,
@@ -146,6 +153,7 @@ typedef enum NodeTag
T_WindowAggState,
T_UniqueState,
T_GatherState,
+ T_GatherMergeState,
T_HashState,
T_SetOpState,
T_LockRowsState,
@@ -160,8 +168,9 @@ typedef enum NodeTag
/*
* TAGS FOR PRIMITIVE NODES (primnodes.h)
*/
- T_Alias = 300,
+ T_Alias,
T_RangeVar,
+ T_TableFunc,
T_Expr,
T_Var,
T_Const,
@@ -195,6 +204,7 @@ typedef enum NodeTag
T_RowCompareExpr,
T_CoalesceExpr,
T_MinMaxExpr,
+ T_SQLValueFunction,
T_XmlExpr,
T_NullTest,
T_BooleanTest,
@@ -213,46 +223,29 @@ typedef enum NodeTag
T_DistributeBy,
T_PGXCSubCluster,
#endif
+ T_NextValueExpr,
/*
* TAGS FOR EXPRESSION STATE NODES (execnodes.h)
*
- * These correspond (not always one-for-one) to primitive nodes derived
- * from Expr.
+ * ExprState represents the evaluation state for a whole expression tree.
+ * Most Expr-based plan nodes do not have a corresponding expression state
+ * node, they're fully handled within execExpr* - but sometimes the state
+ * needs to be shared with other parts of the executor, as for example
+ * with AggrefExprState, which nodeAgg.c has to modify.
*/
- T_ExprState = 400,
- T_GenericExprState,
- T_WholeRowVarExprState,
+ T_ExprState,
T_AggrefExprState,
- T_GroupingFuncExprState,
T_WindowFuncExprState,
- T_ArrayRefExprState,
- T_FuncExprState,
- T_ScalarArrayOpExprState,
- T_BoolExprState,
+ T_SetExprState,
T_SubPlanState,
T_AlternativeSubPlanState,
- T_FieldSelectState,
- T_FieldStoreState,
- T_CoerceViaIOState,
- T_ArrayCoerceExprState,
- T_ConvertRowtypeExprState,
- T_CaseExprState,
- T_CaseWhenState,
- T_ArrayExprState,
- T_RowExprState,
- T_RowCompareExprState,
- T_CoalesceExprState,
- T_MinMaxExprState,
- T_XmlExprState,
- T_NullTestState,
- T_CoerceToDomainState,
T_DomainConstraintState,
/*
* TAGS FOR PLANNER NODES (relation.h)
*/
- T_PlannerInfo = 500,
+ T_PlannerInfo,
T_PlannerGlobal,
T_RelOptInfo,
T_IndexOptInfo,
@@ -276,7 +269,9 @@ typedef enum NodeTag
T_MaterialPath,
T_UniquePath,
T_GatherPath,
+ T_GatherMergePath,
T_ProjectionPath,
+ T_ProjectSetPath,
T_SortPath,
T_GroupPath,
T_UpperUniquePath,
@@ -298,22 +293,28 @@ typedef enum NodeTag
T_PlaceHolderVar,
T_SpecialJoinInfo,
T_AppendRelInfo,
+ T_PartitionedChildRelInfo,
T_PlaceHolderInfo,
T_MinMaxAggInfo,
T_PlannerParamItem,
#ifdef XCP
T_RemoteSubPath,
#endif
+ T_RollupData,
+ T_GroupingSetData,
+ T_StatisticExtInfo,
+
/*
* TAGS FOR MEMORY NODES (memnodes.h)
*/
- T_MemoryContext = 600,
+ T_MemoryContext,
T_AllocSetContext,
+ T_SlabContext,
/*
* TAGS FOR VALUE NODES (value.h)
*/
- T_Value = 650,
+ T_Value,
T_Integer,
T_Float,
T_String,
@@ -335,7 +336,8 @@ typedef enum NodeTag
/*
* TAGS FOR STATEMENT NODES (mostly in parsenodes.h)
*/
- T_Query = 700,
+ T_RawStmt,
+ T_Query,
T_PlannedStmt,
T_InsertStmt,
T_DeleteStmt,
@@ -449,11 +451,18 @@ typedef enum NodeTag
T_AlterPolicyStmt,
T_CreateTransformStmt,
T_CreateAmStmt,
+ T_CreatePublicationStmt,
+ T_AlterPublicationStmt,
+ T_CreateSubscriptionStmt,
+ T_AlterSubscriptionStmt,
+ T_DropSubscriptionStmt,
+ T_CreateStatsStmt,
+ T_AlterCollationStmt,
/*
* TAGS FOR PARSE TREE NODES (parsenodes.h)
*/
- T_A_Expr = 900,
+ T_A_Expr,
T_ColumnRef,
T_ParamRef,
T_A_Const,
@@ -471,6 +480,8 @@ typedef enum NodeTag
T_RangeSubselect,
T_RangeFunction,
T_RangeTableSample,
+ T_RangeTableFunc,
+ T_RangeTableFuncCol,
T_TypeName,
T_ColumnDef,
T_IndexElem,
@@ -483,7 +494,7 @@ typedef enum NodeTag
T_SortGroupClause,
T_GroupingSet,
T_WindowClause,
- T_FuncWithArgs,
+ T_ObjectWithArgs,
T_AccessPriv,
T_CreateOpClassItem,
T_TableLikeClause,
@@ -496,6 +507,12 @@ typedef enum NodeTag
T_OnConflictClause,
T_CommonTableExpr,
T_RoleSpec,
+ T_TriggerTransition,
+ T_PartitionElem,
+ T_PartitionSpec,
+ T_PartitionBoundSpec,
+ T_PartitionRangeDatum,
+ T_PartitionCmd,
/*
* TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h)
@@ -506,6 +523,7 @@ typedef enum NodeTag
T_DropReplicationSlotCmd,
T_StartReplicationCmd,
T_TimeLineHistoryCmd,
+ T_SQLCmd,
/*
* TAGS FOR RANDOM OTHER STUFF
@@ -515,7 +533,7 @@ typedef enum NodeTag
* purposes (usually because they are involved in APIs where we want to
* pass multiple object types through the same pointer).
*/
- T_TriggerData = 950, /* in commands/trigger.h */
+ T_TriggerData, /* in commands/trigger.h */
T_EventTriggerData, /* in commands/event_trigger.h */
T_ReturnSetInfo, /* in nodes/execnodes.h */
T_WindowObjectData, /* private in nodeWindowAgg.c */
@@ -586,6 +604,26 @@ extern PGDLLIMPORT Node *newNodeMacroHolder;
#define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_)
+/*
+ * castNode(type, ptr) casts ptr to "type *", and if assertions are enabled,
+ * verifies that the node has the appropriate type (using its nodeTag()).
+ *
+ * Use an inline function when assertions are enabled, to avoid multiple
+ * evaluations of the ptr argument (which could e.g. be a function call).
+ */
+#ifdef USE_ASSERT_CHECKING
+static inline Node *
+castNodeImpl(NodeTag type, void *ptr)
+{
+ Assert(ptr == NULL || nodeTag(ptr) == type);
+ return (Node *) ptr;
+}
+#define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr))
+#else
+#define castNode(_type_, nodeptr) ((_type_ *) (nodeptr))
+#endif /* USE_ASSERT_CHECKING */
+
+
/* ----------------------------------------------------------------
* extern declarations follow
* ----------------------------------------------------------------
@@ -597,16 +635,17 @@ extern PGDLLIMPORT Node *newNodeMacroHolder;
#ifdef XCP
extern void set_portable_output(bool value);
#endif
-extern char *nodeToString(const void *obj);
-
struct Bitmapset; /* not to include bitmapset.h here */
struct StringInfoData; /* not to include stringinfo.h here */
+
extern void outNode(struct StringInfoData *str, const void *obj);
extern void outToken(struct StringInfoData *str, const char *s);
extern void outBitmapset(struct StringInfoData *str,
const struct Bitmapset *bms);
extern void outDatum(struct StringInfoData *str, uintptr_t value,
int typlen, bool typbyval);
+extern char *nodeToString(const void *obj);
+extern char *bmsToString(const struct Bitmapset *bms);
/*
* nodes/{readfuncs.c,read.c}
@@ -625,7 +664,13 @@ extern int16 *readAttrNumberCols(int numCols);
/*
* nodes/copyfuncs.c
*/
-extern void *copyObject(const void *obj);
+extern void *copyObjectImpl(const void *obj);
+/* cast result back to argument type, if supported by compiler */
+#ifdef HAVE_TYPEOF
+#define copyObject(obj) ((typeof(obj)) copyObjectImpl(obj))
+#else
+#define copyObject(obj) copyObjectImpl(obj)
+#endif
/*
* nodes/equalfuncs.c
@@ -742,7 +787,8 @@ typedef enum AggStrategy
{
AGG_PLAIN, /* simple agg across all input rows */
AGG_SORTED, /* grouped agg, input must be sorted */
- AGG_HASHED /* grouped agg, use internal hashtable */
+ AGG_HASHED, /* grouped agg, use internal hashtable */
+ AGG_MIXED /* grouped agg, hash and sort both used */
} AggStrategy;
/*
diff --git a/src/include/nodes/params.h b/src/include/nodes/params.h
index 79b310647b..d9a48191f0 100644
--- a/src/include/nodes/params.h
+++ b/src/include/nodes/params.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/params.h
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 8c78e3eb2b..8d4e58ca89 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,11 +7,13 @@
* This is a byte (not character) offset in the original source text, to be
* used for positioning an error cursor when there is an error related to
* the node. Access to the original source text is needed to make use of
- * the location.
+ * the location. At the topmost (statement) level, we also provide a
+ * statement length, likewise measured in bytes, for convenience in
+ * identifying statement boundaries in multi-statement source strings.
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -31,6 +33,13 @@
#include "pgxc/locator.h"
#endif
+typedef enum OverridingKind
+{
+ OVERRIDING_NOT_SET = 0,
+ OVERRIDING_USER_VALUE,
+ OVERRIDING_SYSTEM_VALUE
+} OverridingKind;
+
/* Possible sources of a Query */
typedef enum QuerySource
{
@@ -95,9 +104,7 @@ typedef uint32 AclMode; /* a bitmask of privilege bits */
* for further processing by the rewriter and planner.
*
* Utility statements (i.e. non-optimizable statements) have the
- * utilityStmt field set, and the Query itself is mostly dummy.
- * DECLARE CURSOR is a special case: it is represented like a SELECT,
- * but the original DeclareCursorStmt is stored in utilityStmt.
+ * utilityStmt field set, and the rest of the Query is mostly dummy.
*
* Planning converts a Query tree into a Plan tree headed by a PlannedStmt
* node --- the Query structure is not used by the executor.
@@ -114,14 +121,14 @@ typedef struct Query
bool canSetTag; /* do I set the command result tag? */
- Node *utilityStmt; /* non-null if this is DECLARE CURSOR or a
- * non-optimizable statement */
+ Node *utilityStmt; /* non-null if commandType == CMD_UTILITY */
int resultRelation; /* rtable index of target relation for
* INSERT/UPDATE/DELETE; 0 for SELECT */
bool hasAggs; /* has aggregates in tlist or havingQual */
bool hasWindowFuncs; /* has window functions in tlist */
+ bool hasTargetSRFs; /* has set-returning functions in tlist */
bool hasSubLinks; /* has subquery SubLink */
bool hasDistinctOn; /* distinctClause is from DISTINCT ON */
bool hasRecursive; /* WITH RECURSIVE was specified */
@@ -136,6 +143,8 @@ typedef struct Query
List *targetList; /* target list (of TargetEntry) */
+ OverridingKind override; /* OVERRIDING clause */
+
OnConflictExpr *onConflict; /* ON CONFLICT DO [NOTHING | UPDATE] */
List *returningList; /* return-values list (of TargetEntry) */
@@ -167,6 +176,15 @@ typedef struct Query
* are only added during rewrite and
* therefore are not written out as
* part of Query. */
+
+ /*
+ * The following two fields identify the portion of the source text string
+ * containing this query. They are typically only populated in top-level
+ * Queries, not in sub-queries. When not set, they might both be zero, or
+ * both be -1 meaning "unknown".
+ */
+ int stmt_location; /* start location, or -1 if unknown */
+ int stmt_len; /* length in bytes; 0 means "rest of string" */
} Query;
@@ -552,6 +570,39 @@ typedef struct RangeFunction
} RangeFunction;
/*
+ * RangeTableFunc - raw form of "table functions" such as XMLTABLE
+ */
+typedef struct RangeTableFunc
+{
+ NodeTag type;
+ bool lateral; /* does it have LATERAL prefix? */
+ Node *docexpr; /* document expression */
+ Node *rowexpr; /* row generator expression */
+ List *namespaces; /* list of namespaces as ResTarget */
+ List *columns; /* list of RangeTableFuncCol */
+ Alias *alias; /* table alias & optional column aliases */
+ int location; /* token location, or -1 if unknown */
+} RangeTableFunc;
+
+/*
+ * RangeTableFuncCol - one column in a RangeTableFunc->columns
+ *
+ * If for_ordinality is true (FOR ORDINALITY), then the column is an int4
+ * column and the rest of the fields are ignored.
+ */
+typedef struct RangeTableFuncCol
+{
+ NodeTag type;
+ char *colname; /* name of generated column */
+ TypeName *typeName; /* type of generated column */
+ bool for_ordinality; /* does it have FOR ORDINALITY? */
+ bool is_not_null; /* does it have NOT NULL? */
+ Node *colexpr; /* column filter expression */
+ Node *coldefexpr; /* column default value expression */
+ int location; /* token location, or -1 if unknown */
+} RangeTableFuncCol;
+
+/*
* RangeTableSample - TABLESAMPLE appearing in a raw FROM clause
*
* This node, appearing only in raw parse trees, represents
@@ -598,9 +649,11 @@ typedef struct ColumnDef
bool is_local; /* column has local (non-inherited) def'n */
bool is_not_null; /* NOT NULL constraint specified? */
bool is_from_type; /* column definition came from table type */
+ bool is_from_parent; /* column def came from partition parent */
char storage; /* attstorage setting, or 0 for default */
Node *raw_default; /* default value (untransformed parse tree) */
Node *cooked_default; /* default value (transformed expr tree) */
+ char identity; /* attidentity setting */
CollateClause *collClause; /* untransformed COLLATE spec, if any */
Oid collOid; /* collation OID (InvalidOid if not set) */
List *constraints; /* other constraints on column */
@@ -622,9 +675,10 @@ typedef enum TableLikeOption
{
CREATE_TABLE_LIKE_DEFAULTS = 1 << 0,
CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 1,
- CREATE_TABLE_LIKE_INDEXES = 1 << 2,
- CREATE_TABLE_LIKE_STORAGE = 1 << 3,
- CREATE_TABLE_LIKE_COMMENTS = 1 << 4,
+ CREATE_TABLE_LIKE_IDENTITY = 1 << 2,
+ CREATE_TABLE_LIKE_INDEXES = 1 << 3,
+ CREATE_TABLE_LIKE_STORAGE = 1 << 4,
+ CREATE_TABLE_LIKE_COMMENTS = 1 << 5,
CREATE_TABLE_LIKE_ALL = PG_INT32_MAX
} TableLikeOption;
@@ -672,6 +726,7 @@ typedef struct DefElem
char *defname;
Node *arg; /* a (Value *) or a (TypeName *) */
DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
+ int location; /* token location, or -1 if unknown */
} DefElem;
/*
@@ -703,6 +758,87 @@ typedef struct XmlSerialize
int location; /* token location, or -1 if unknown */
} XmlSerialize;
+/* Partitioning related definitions */
+
+/*
+ * PartitionElem - parse-time representation of a single partition key
+ *
+ * expr can be either a raw expression tree or a parse-analyzed expression.
+ * We don't store these on-disk, though.
+ */
+typedef struct PartitionElem
+{
+ NodeTag type;
+ char *name; /* name of column to partition on, or NULL */
+ Node *expr; /* expression to partition on, or NULL */
+ List *collation; /* name of collation; NIL = default */
+ List *opclass; /* name of desired opclass; NIL = default */
+ int location; /* token location, or -1 if unknown */
+} PartitionElem;
+
+/*
+ * PartitionSpec - parse-time representation of a partition key specification
+ *
+ * This represents the key space we will be partitioning on.
+ */
+typedef struct PartitionSpec
+{
+ NodeTag type;
+ char *strategy; /* partitioning strategy ('list' or 'range') */
+ List *partParams; /* List of PartitionElems */
+ int location; /* token location, or -1 if unknown */
+} PartitionSpec;
+
+/* Internal codes for partitioning strategies */
+#define PARTITION_STRATEGY_LIST 'l'
+#define PARTITION_STRATEGY_RANGE 'r'
+
+/*
+ * PartitionBoundSpec - a partition bound specification
+ *
+ * This represents the portion of the partition key space assigned to a
+ * particular partition. These are stored on disk in pg_class.relpartbound.
+ */
+typedef struct PartitionBoundSpec
+{
+ NodeTag type;
+
+ char strategy; /* see PARTITION_STRATEGY codes above */
+
+ /* Partitioning info for LIST strategy: */
+ List *listdatums; /* List of Consts (or A_Consts in raw tree) */
+
+ /* Partitioning info for RANGE strategy: */
+ List *lowerdatums; /* List of PartitionRangeDatums */
+ List *upperdatums; /* List of PartitionRangeDatums */
+
+ int location; /* token location, or -1 if unknown */
+} PartitionBoundSpec;
+
+/*
+ * PartitionRangeDatum - can be either a value or UNBOUNDED
+ *
+ * "value" is an A_Const in raw grammar output, a Const after analysis
+ */
+typedef struct PartitionRangeDatum
+{
+ NodeTag type;
+
+ bool infinite; /* true if UNBOUNDED */
+ Node *value; /* null if UNBOUNDED */
+
+ int location; /* token location, or -1 if unknown */
+} PartitionRangeDatum;
+
+/*
+ * PartitionCmd - info for ALTER TABLE ATTACH/DETACH PARTITION commands
+ */
+typedef struct PartitionCmd
+{
+ NodeTag type;
+ RangeVar *name; /* name of partition to attach/detach */
+ PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
+} PartitionCmd;
/****************************************************************************
* Nodes for a Query tree
@@ -779,6 +915,13 @@ typedef struct XmlSerialize
* FirstLowInvalidHeapAttributeNumber from column numbers before storing
* them in these fields. A whole-row Var reference is represented by
* setting the bit for InvalidAttrNumber.
+ *
+ * securityQuals is a list of security barrier quals (boolean expressions),
+ * to be tested in the listed order before returning a row from the
+ * relation. It is always NIL in parser output. Entries are added by the
+ * rewriter to implement security-barrier views and/or row-level security.
+ * Note that the planner turns each boolean expression into an implicitly
+ * AND'ed sublist, as is its usual habit with qualification expressions.
*--------------------
*/
typedef enum RTEKind
@@ -787,11 +930,13 @@ typedef enum RTEKind
RTE_SUBQUERY, /* subquery in FROM */
RTE_JOIN, /* join */
RTE_FUNCTION, /* function in FROM */
+ RTE_TABLEFUNC, /* TableFunc(.., column list) */
RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
- RTE_CTE /* common table expr (WITH list element) */
#ifdef PGXC
- ,RTE_REMOTE_DUMMY /* RTEs created by remote plan reduction */
+ RTE_REMOTE_DUMMY, /* RTEs created by remote plan reduction */
#endif /* PGXC */
+ RTE_CTE, /* common table expr (WITH list element) */
+ RTE_NAMEDTUPLESTORE /* tuplestore, e.g. for AFTER triggers */
} RTEKind;
typedef struct RangeTblEntry
@@ -855,10 +1000,14 @@ typedef struct RangeTblEntry
bool funcordinality; /* is this called WITH ORDINALITY? */
/*
+ * Fields valid for a TableFunc RTE (else NULL):
+ */
+ TableFunc *tablefunc;
+
+ /*
* Fields valid for a values RTE (else NIL):
*/
List *values_lists; /* list of expression lists */
- List *values_collations; /* OID list of column collation OIDs */
/*
* Fields valid for a CTE RTE (else NULL/zero):
@@ -866,9 +1015,20 @@ typedef struct RangeTblEntry
char *ctename; /* name of the WITH list item */
Index ctelevelsup; /* number of query levels up */
bool self_reference; /* is this a recursive self-reference? */
- List *ctecoltypes; /* OID list of column type OIDs */
- List *ctecoltypmods; /* integer list of column typmods */
- List *ctecolcollations; /* OID list of column collation OIDs */
+
+ /*
+ * Fields valid for values and CTE RTEs (else NIL):
+ *
+ * We need these for CTE RTEs so that the types of self-referential
+ * columns are well-defined. For VALUES RTEs, storing these explicitly
+ * saves having to re-determine the info by scanning the values_lists.
+ */
+ List *coltypes; /* OID list of column type OIDs */
+ List *coltypmods; /* integer list of column typmods */
+ List *colcollations; /* OID list of column collation OIDs */
+
+ char *enrname; /* name of ephemeral named relation */
+ double enrtuples; /* estimated or actual from caller */
/*
* Fields valid in all RTEs:
@@ -883,7 +1043,7 @@ typedef struct RangeTblEntry
Bitmapset *selectedCols; /* columns needing SELECT permission */
Bitmapset *insertedCols; /* columns needing INSERT permission */
Bitmapset *updatedCols; /* columns needing UPDATE permission */
- List *securityQuals; /* any security barrier quals to apply */
+ List *securityQuals; /* security barrier quals to apply, if any */
} RangeTblEntry;
/*
@@ -1215,6 +1375,45 @@ typedef struct CommonTableExpr
((Query *) (cte)->ctequery)->targetList : \
((Query *) (cte)->ctequery)->returningList)
+/*
+ * TriggerTransition -
+ * representation of transition row or table naming clause
+ *
+ * Only transition tables are initially supported in the syntax, and only for
+ * AFTER triggers, but other permutations are accepted by the parser so we can
+ * give a meaningful message from C code.
+ */
+typedef struct TriggerTransition
+{
+ NodeTag type;
+ char *name;
+ bool isNew;
+ bool isTable;
+} TriggerTransition;
+
+/*****************************************************************************
+ * Raw Grammar Output Statements
+ *****************************************************************************/
+
+/*
+ * RawStmt --- container for any one statement's raw parse tree
+ *
+ * Parse analysis converts a raw parse tree headed by a RawStmt node into
+ * an analyzed statement headed by a Query node. For optimizable statements,
+ * the conversion is complex. For utility statements, the parser usually just
+ * transfers the raw parse tree (sans RawStmt) into the utilityStmt field of
+ * the Query node, and all the useful work happens at execution time.
+ *
+ * stmt_location/stmt_len identify the portion of the source text string
+ * containing this raw statement (useful for multi-statement strings).
+ */
+typedef struct RawStmt
+{
+ NodeTag type;
+ Node *stmt; /* raw parse tree */
+ int stmt_location; /* start location, or -1 if unknown */
+ int stmt_len; /* length in bytes; 0 means "rest of string" */
+} RawStmt;
/*****************************************************************************
* Optimizable Statements
@@ -1237,6 +1436,7 @@ typedef struct InsertStmt
OnConflictClause *onConflictClause; /* ON CONFLICT clause */
List *returningList; /* list of expressions to return */
WithClause *withClause; /* WITH clause */
+ OverridingKind override; /* OVERRIDING clause */
} InsertStmt;
/* ----------------------
@@ -1383,6 +1583,9 @@ typedef struct SetOperationStmt
* statements do need attention from parse analysis, and this is
* done by routines in parser/parse_utilcmd.c after ProcessUtility
* receives the command for execution.
+ * DECLARE CURSOR, EXPLAIN, and CREATE TABLE AS are special cases:
+ * they contain optimizable statements, which get processed normally
+ * by parser/analyze.c.
*****************************************************************************/
/*
@@ -1421,10 +1624,14 @@ typedef enum ObjectType
OBJECT_OPERATOR,
OBJECT_OPFAMILY,
OBJECT_POLICY,
+ OBJECT_PUBLICATION,
+ OBJECT_PUBLICATION_REL,
OBJECT_ROLE,
OBJECT_RULE,
OBJECT_SCHEMA,
OBJECT_SEQUENCE,
+ OBJECT_SUBSCRIPTION,
+ OBJECT_STATISTIC_EXT,
OBJECT_TABCONSTRAINT,
OBJECT_TABLE,
OBJECT_TABLESPACE,
@@ -1451,7 +1658,7 @@ typedef struct CreateSchemaStmt
{
NodeTag type;
char *schemaname; /* the name of the schema to create */
- Node *authrole; /* the owner of the created schema */
+ RoleSpec *authrole; /* the owner of the created schema */
List *schemaElts; /* schema components (list of parsenodes) */
bool if_not_exists; /* just do nothing if schema already exists? */
} CreateSchemaStmt;
@@ -1544,7 +1751,12 @@ typedef enum AlterTableType
AT_DisableRowSecurity, /* DISABLE ROW SECURITY */
AT_ForceRowSecurity, /* FORCE ROW SECURITY */
AT_NoForceRowSecurity, /* NO FORCE ROW SECURITY */
- AT_GenericOptions /* OPTIONS (...) */
+ AT_GenericOptions, /* OPTIONS (...) */
+ AT_AttachPartition, /* ATTACH PARTITION */
+ AT_DetachPartition, /* DETACH PARTITION */
+ AT_AddIdentity, /* ADD IDENTITY */
+ AT_SetIdentity, /* SET identity column options */
+ AT_DropIdentity /* DROP IDENTITY */
} AlterTableType;
typedef struct ReplicaIdentityStmt
@@ -1560,7 +1772,7 @@ typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
AlterTableType subtype; /* Type of table alteration to apply */
char *name; /* column, constraint, or trigger to act on,
* or tablespace */
- Node *newowner; /* RoleSpec */
+ RoleSpec *newowner;
Node *def; /* definition of new column, index,
* constraint, or parent table */
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
@@ -1569,6 +1781,17 @@ typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
/* ----------------------
+ * Alter Collation
+ * ----------------------
+ */
+typedef struct AlterCollationStmt
+{
+ NodeTag type;
+ List *collname;
+} AlterCollationStmt;
+
+
+/* ----------------------
* Alter Domain
*
* The fields are used in different ways by the different variants of
@@ -1628,8 +1851,8 @@ typedef struct GrantStmt
bool is_grant; /* true = GRANT, false = REVOKE */
GrantTargetType targtype; /* type of the grant target */
GrantObjectType objtype; /* kind of object being operated on */
- List *objects; /* list of RangeVar nodes, FuncWithArgs nodes,
- * or plain names (as Value strings) */
+ List *objects; /* list of RangeVar nodes, ObjectWithArgs
+ * nodes, or plain names (as Value strings) */
List *privileges; /* list of AccessPriv nodes */
/* privileges == NIL denotes ALL PRIVILEGES */
List *grantees; /* list of RoleSpec nodes */
@@ -1638,16 +1861,19 @@ typedef struct GrantStmt
} GrantStmt;
/*
- * Note: FuncWithArgs carries only the types of the input parameters of the
+ * Note: ObjectWithArgs carries only the types of the input parameters of the
* function. So it is sufficient to identify an existing function, but it
* is not enough info to define a function nor to call it.
*/
-typedef struct FuncWithArgs
+typedef struct ObjectWithArgs
{
NodeTag type;
- List *funcname; /* qualified name of function */
- List *funcargs; /* list of Typename nodes */
-} FuncWithArgs;
+ List *objname; /* qualified name of function/operator */
+ List *objargs; /* list of Typename nodes */
+ bool args_unspecified; /* argument list was omitted, so name
+ * must be unique (note that objargs
+ * == NIL means zero args) */
+} ObjectWithArgs;
/*
* An access privilege, with optional list of column names
@@ -1679,7 +1905,7 @@ typedef struct GrantRoleStmt
List *grantee_roles; /* list of member roles to add/delete */
bool is_grant; /* true = GRANT, false = REVOKE */
bool admin_opt; /* with admin option */
- Node *grantor; /* set grantor to other than current role */
+ RoleSpec *grantor; /* set grantor to other than current role */
DropBehavior behavior; /* drop behavior (for REVOKE) */
} GrantRoleStmt;
@@ -1707,7 +1933,7 @@ typedef struct CopyStmt
NodeTag type;
RangeVar *relation; /* the relation to copy */
Node *query; /* the query (SELECT or DML statement with
- * RETURNING) to copy */
+ * RETURNING) to copy, as a raw parse tree */
List *attlist; /* List of column names (as Strings), or NIL
* for all columns */
bool is_from; /* TO or FROM */
@@ -1770,6 +1996,8 @@ typedef struct CreateStmt
List *tableElts; /* column definitions (list of ColumnDef) */
List *inhRelations; /* relations to inherit from (list of
* inhRelation) */
+ PartitionBoundSpec *partbound; /* FOR VALUES clause */
+ PartitionSpec *partspec; /* PARTITION BY clause */
TypeName *ofTypename; /* OF typename */
List *constraints; /* constraints (list of Constraint nodes) */
List *options; /* options from WITH clause */
@@ -1821,6 +2049,7 @@ typedef enum ConstrType /* types of constraints */
* expect it */
CONSTR_NOTNULL,
CONSTR_DEFAULT,
+ CONSTR_IDENTITY,
CONSTR_CHECK,
CONSTR_PRIMARY,
CONSTR_UNIQUE,
@@ -1859,6 +2088,7 @@ typedef struct Constraint
bool is_no_inherit; /* is constraint non-inheritable? */
Node *raw_expr; /* expr, as untransformed parse tree */
char *cooked_expr; /* expr, as nodeToString representation */
+ char generated_when;
/* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */
List *keys; /* String nodes naming referenced column(s) */
@@ -1898,7 +2128,7 @@ typedef struct CreateTableSpaceStmt
{
NodeTag type;
char *tablespacename;
- Node *owner;
+ RoleSpec *owner;
char *location;
List *options;
} CreateTableSpaceStmt;
@@ -1955,8 +2185,7 @@ typedef struct AlterExtensionContentsStmt
char *extname; /* Extension's name */
int action; /* +1 = add object, -1 = drop object */
ObjectType objtype; /* Object's type */
- List *objname; /* Qualified name of the object */
- List *objargs; /* Arguments if needed (eg, for functions) */
+ Node *object; /* Qualified name of the object */
} AlterExtensionContentsStmt;
/* ----------------------
@@ -1992,6 +2221,7 @@ typedef struct CreateForeignServerStmt
char *servertype; /* optional server type */
char *version; /* optional server version */
char *fdwname; /* FDW name */
+ bool if_not_exists; /* just do nothing if it already exists? */
List *options; /* generic options to server */
} CreateForeignServerStmt;
@@ -2024,15 +2254,16 @@ typedef struct CreateForeignTableStmt
typedef struct CreateUserMappingStmt
{
NodeTag type;
- Node *user; /* user role */
+ RoleSpec *user; /* user role */
char *servername; /* server name */
+ bool if_not_exists; /* just do nothing if it already exists? */
List *options; /* generic options to server */
} CreateUserMappingStmt;
typedef struct AlterUserMappingStmt
{
NodeTag type;
- Node *user; /* user role */
+ RoleSpec *user; /* user role */
char *servername; /* server name */
List *options; /* generic options to server */
} AlterUserMappingStmt;
@@ -2040,7 +2271,7 @@ typedef struct AlterUserMappingStmt
typedef struct DropUserMappingStmt
{
NodeTag type;
- Node *user; /* user role */
+ RoleSpec *user; /* user role */
char *servername; /* server name */
bool missing_ok; /* ignore missing mappings */
} DropUserMappingStmt;
@@ -2078,6 +2309,7 @@ typedef struct CreatePolicyStmt
char *policy_name; /* Policy's name */
RangeVar *table; /* the table name the policy applies to */
char *cmd_name; /* the command name the policy applies to */
+ bool permissive; /* restrictive or permissive policy */
List *roles; /* the roles associated with the policy */
Node *qual; /* the policy's condition */
Node *with_check; /* the policy's WITH CHECK condition. */
@@ -2128,6 +2360,8 @@ typedef struct CreateTrigStmt
List *columns; /* column names, or NIL for all columns */
Node *whenClause; /* qual expression, or NULL if none */
bool isconstraint; /* This is a constraint trigger */
+ /* explicitly named transition data */
+ List *transitionRels; /* TriggerTransition nodes, or NIL if none */
/* The remaining fields are only used for constraint triggers */
bool deferrable; /* [NOT] DEFERRABLE */
bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */
@@ -2202,7 +2436,7 @@ typedef struct CreateRoleStmt
typedef struct AlterRoleStmt
{
NodeTag type;
- Node *role; /* role */
+ RoleSpec *role; /* role */
List *options; /* List of DefElem nodes */
int action; /* +1 = add members, -1 = drop members */
} AlterRoleStmt;
@@ -2210,7 +2444,7 @@ typedef struct AlterRoleStmt
typedef struct AlterRoleSetStmt
{
NodeTag type;
- Node *role; /* role */
+ RoleSpec *role; /* role */
char *database; /* database name, or NULL */
VariableSetStmt *setstmt; /* SET or RESET subcommand */
} AlterRoleSetStmt;
@@ -2236,6 +2470,7 @@ typedef struct CreateSeqStmt
#ifdef PGXC
bool is_serial; /* Indicates if this sequence is part of SERIAL process */
#endif
+ bool for_identity;
bool if_not_exists; /* just do nothing if it already exists? */
} CreateSeqStmt;
@@ -2244,6 +2479,7 @@ typedef struct AlterSeqStmt
NodeTag type;
RangeVar *sequence; /* the sequence to alter */
List *options;
+ bool for_identity;
bool missing_ok; /* skip error if a role is missing? */
#ifdef PGXC
bool is_serial; /* Indicates if this sequence is part of SERIAL process */
@@ -2262,6 +2498,7 @@ typedef struct DefineStmt
List *defnames; /* qualified name (list of Value strings) */
List *args; /* a list of TypeName (if needed) */
List *definition; /* a list of DefElem */
+ bool if_not_exists; /* just do nothing if it already exists? */
} DefineStmt;
/* ----------------------
@@ -2300,12 +2537,11 @@ typedef struct CreateOpClassItem
{
NodeTag type;
int itemtype; /* see codes above */
- /* fields used for an operator or function item: */
- List *name; /* operator or function name */
- List *args; /* argument types */
+ ObjectWithArgs *name; /* operator or function name and args */
int number; /* strategy num or support proc num */
List *order_family; /* only used for ordering operators */
- List *class_args; /* only used for functions */
+ List *class_args; /* amproclefttype/amprocrighttype or
+ * amoplefttype/amoprighttype */
/* fields used for a storagetype item: */
TypeName *storedtype; /* datatype stored in index */
} CreateOpClassItem;
@@ -2342,8 +2578,7 @@ typedef struct AlterOpFamilyStmt
typedef struct DropStmt
{
NodeTag type;
- List *objects; /* list of sublists of names (as Values) */
- List *arguments; /* list of sublists of arguments (as Values) */
+ List *objects; /* list of names */
ObjectType removeType; /* object type */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */
bool missing_ok; /* skip error if object is missing? */
@@ -2370,8 +2605,7 @@ typedef struct CommentStmt
{
NodeTag type;
ObjectType objtype; /* Object's type */
- List *objname; /* Qualified name of the object */
- List *objargs; /* Arguments if needed (eg, for functions) */
+ Node *object; /* Qualified name of the object */
char *comment; /* Comment to insert, or NULL to remove */
} CommentStmt;
@@ -2383,8 +2617,7 @@ typedef struct SecLabelStmt
{
NodeTag type;
ObjectType objtype; /* Object's type */
- List *objname; /* Qualified name of the object */
- List *objargs; /* Arguments if needed (eg, for functions) */
+ Node *object; /* Qualified name of the object */
char *provider; /* Label provider (or NULL) */
char *label; /* New security label to be assigned */
} SecLabelStmt;
@@ -2392,9 +2625,9 @@ typedef struct SecLabelStmt
/* ----------------------
* Declare Cursor Statement
*
- * Note: the "query" field of DeclareCursorStmt is only used in the raw grammar
- * output. After parse analysis it's set to null, and the Query points to the
- * DeclareCursorStmt, not vice versa.
+ * The "query" field is initially a raw parse tree, and is converted to a
+ * Query node during parse analysis. Note that rewriting and planning
+ * of the query are always postponed until execution.
* ----------------------
*/
#define CURSOR_OPT_BINARY 0x0001 /* BINARY */
@@ -2413,7 +2646,7 @@ typedef struct DeclareCursorStmt
NodeTag type;
char *portalname; /* name of the portal (cursor) */
int options; /* bitmask of options (see above) */
- Node *query; /* the raw SELECT query */
+ Node *query; /* the query (see comments above) */
} DeclareCursorStmt;
/* ----------------------
@@ -2488,6 +2721,20 @@ typedef struct IndexStmt
} IndexStmt;
/* ----------------------
+ * Create Statistics Statement
+ * ----------------------
+ */
+typedef struct CreateStatsStmt
+{
+ NodeTag type;
+ List *defnames; /* qualified name (list of Value strings) */
+ List *stat_types; /* stat types (list of Value strings) */
+ List *exprs; /* expressions to build statistics on */
+ List *relations; /* rels to build stats on (list of RangeVar) */
+ bool if_not_exists; /* do nothing if stats name already exists */
+} CreateStatsStmt;
+
+/* ----------------------
* Create Function Statement
* ----------------------
*/
@@ -2524,7 +2771,7 @@ typedef struct FunctionParameter
typedef struct AlterFunctionStmt
{
NodeTag type;
- FuncWithArgs *func; /* name and args of function */
+ ObjectWithArgs *func; /* name and args of function */
List *actions; /* list of DefElem */
} AlterFunctionStmt;
@@ -2558,8 +2805,7 @@ typedef struct RenameStmt
ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */
ObjectType relationType; /* if column name, associated relation type */
RangeVar *relation; /* in case it's a table */
- List *object; /* in case it's some other object */
- List *objarg; /* argument types, if applicable */
+ Node *object; /* in case it's some other object */
char *subname; /* name of contained object (column, rule,
* trigger, etc) */
char *newname; /* the new name */
@@ -2576,8 +2822,7 @@ typedef struct AlterObjectDependsStmt
NodeTag type;
ObjectType objectType; /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
RangeVar *relation; /* in case a table is involved */
- List *objname; /* name of the object */
- List *objargs; /* argument types, if applicable */
+ Node *object; /* name of the object */
Value *extname; /* extension name */
} AlterObjectDependsStmt;
@@ -2590,8 +2835,7 @@ typedef struct AlterObjectSchemaStmt
NodeTag type;
ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
RangeVar *relation; /* in case it's a table */
- List *object; /* in case it's some other object */
- List *objarg; /* argument types, if applicable */
+ Node *object; /* in case it's some other object */
char *newschema; /* the new schema */
bool missing_ok; /* skip error if missing? */
} AlterObjectSchemaStmt;
@@ -2605,9 +2849,8 @@ typedef struct AlterOwnerStmt
NodeTag type;
ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */
RangeVar *relation; /* in case it's a table */
- List *object; /* in case it's some other object */
- List *objarg; /* argument types, if applicable */
- Node *newowner; /* the new owner */
+ Node *object; /* in case it's some other object */
+ RoleSpec *newowner; /* the new owner */
} AlterOwnerStmt;
@@ -2618,8 +2861,7 @@ typedef struct AlterOwnerStmt
typedef struct AlterOperatorStmt
{
NodeTag type;
- List *opername; /* operator name */
- List *operargs; /* operator's argument TypeNames */
+ ObjectWithArgs *opername; /* operator name and argument types */
List *options; /* List of DefElem nodes */
} AlterOperatorStmt;
@@ -2738,10 +2980,11 @@ typedef struct AlterEnumStmt
{
NodeTag type;
List *typeName; /* qualified name (list of Value strings) */
+ char *oldVal; /* old enum value's name, if renaming */
char *newVal; /* new enum value's name */
char *newValNeighbor; /* neighboring enum value, if specified */
bool newValIsAfter; /* place new enum value after neighbor? */
- bool skipIfExists; /* no error if label already exists */
+ bool skipIfNewValExists; /* no error if new already exists? */
} AlterEnumStmt;
/* ----------------------
@@ -2760,7 +3003,7 @@ typedef struct ViewStmt
NodeTag type;
RangeVar *view; /* the view to be created */
List *aliases; /* target column names */
- Node *query; /* the SELECT query */
+ Node *query; /* the SELECT query (as a raw parse tree) */
bool replace; /* replace an existing view? */
List *options; /* options from WITH clause */
ViewCheckOption withCheckOption; /* WITH CHECK OPTION */
@@ -2949,9 +3192,9 @@ typedef struct DropGroupStmt
/* ----------------------
* Explain Statement
*
- * The "query" field is either a raw parse tree (SelectStmt, InsertStmt, etc)
- * or a Query node if parse analysis has been done. Note that rewriting and
- * planning of the query are always postponed until execution of EXPLAIN.
+ * The "query" field is initially a raw parse tree, and is converted to a
+ * Query node during parse analysis. Note that rewriting and planning
+ * of the query are always postponed until execution.
* ----------------------
*/
typedef struct ExplainStmt
@@ -3100,7 +3343,7 @@ typedef struct CreateCastStmt
NodeTag type;
TypeName *sourcetype;
TypeName *targettype;
- FuncWithArgs *func;
+ ObjectWithArgs *func;
CoercionContext context;
bool inout;
} CreateCastStmt;
@@ -3115,8 +3358,8 @@ typedef struct CreateTransformStmt
bool replace;
TypeName *type_name;
char *lang;
- FuncWithArgs *fromsql;
- FuncWithArgs *tosql;
+ ObjectWithArgs *fromsql;
+ ObjectWithArgs *tosql;
} CreateTransformStmt;
/* ----------------------
@@ -3173,7 +3416,7 @@ typedef struct ReassignOwnedStmt
{
NodeTag type;
List *roles;
- Node *newrole;
+ RoleSpec *newrole;
} ReassignOwnedStmt;
/*
@@ -3240,4 +3483,64 @@ typedef struct CleanConnStmt
} CleanConnStmt;
/* PGXC_END */
+typedef struct CreatePublicationStmt
+{
+ NodeTag type;
+ char *pubname; /* Name of of the publication */
+ List *options; /* List of DefElem nodes */
+ List *tables; /* Optional list of tables to add */
+ bool for_all_tables; /* Special publication for all tables in db */
+} CreatePublicationStmt;
+
+typedef struct AlterPublicationStmt
+{
+ NodeTag type;
+ char *pubname; /* Name of of the publication */
+
+ /* parameters used for ALTER PUBLICATION ... WITH */
+ List *options; /* List of DefElem nodes */
+
+ /* parameters used for ALTER PUBLICATION ... ADD/DROP TABLE */
+ List *tables; /* List of tables to add/drop */
+ bool for_all_tables; /* Special publication for all tables in db */
+ DefElemAction tableAction; /* What action to perform with the tables */
+} AlterPublicationStmt;
+
+typedef struct CreateSubscriptionStmt
+{
+ NodeTag type;
+ char *subname; /* Name of of the subscription */
+ char *conninfo; /* Connection string to publisher */
+ List *publication; /* One or more publication to subscribe to */
+ List *options; /* List of DefElem nodes */
+} CreateSubscriptionStmt;
+
+typedef enum AlterSubscriptionType
+{
+ ALTER_SUBSCRIPTION_OPTIONS,
+ ALTER_SUBSCRIPTION_CONNECTION,
+ ALTER_SUBSCRIPTION_PUBLICATION,
+ ALTER_SUBSCRIPTION_PUBLICATION_REFRESH,
+ ALTER_SUBSCRIPTION_REFRESH,
+ ALTER_SUBSCRIPTION_ENABLED
+} AlterSubscriptionType;
+
+typedef struct AlterSubscriptionStmt
+{
+ NodeTag type;
+ AlterSubscriptionType kind; /* ALTER_SUBSCRIPTION_OPTIONS, etc */
+ char *subname; /* Name of of the subscription */
+ char *conninfo; /* Connection string to publisher */
+ List *publication; /* One or more publication to subscribe to */
+ List *options; /* List of DefElem nodes */
+} AlterSubscriptionStmt;
+
+typedef struct DropSubscriptionStmt
+{
+ NodeTag type;
+ char *subname; /* Name of of the subscription */
+ bool missing_ok; /* Skip error if missing? */
+ DropBehavior behavior; /* RESTRICT or CASCADE behavior */
+} DropSubscriptionStmt;
+
#endif /* PARSENODES_H */
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h
index 62ee2719e3..8395bb4322 100644
--- a/src/include/nodes/pg_list.h
+++ b/src/include/nodes/pg_list.h
@@ -27,7 +27,7 @@
* always be so; try to be careful to maintain the distinction.)
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/pg_list.h
@@ -106,26 +106,32 @@ list_length(const List *l)
#define lfirst(lc) ((lc)->data.ptr_value)
#define lfirst_int(lc) ((lc)->data.int_value)
#define lfirst_oid(lc) ((lc)->data.oid_value)
+#define lfirst_node(type,lc) castNode(type, lfirst(lc))
#define linitial(l) lfirst(list_head(l))
#define linitial_int(l) lfirst_int(list_head(l))
#define linitial_oid(l) lfirst_oid(list_head(l))
+#define linitial_node(type,l) castNode(type, linitial(l))
#define lsecond(l) lfirst(lnext(list_head(l)))
#define lsecond_int(l) lfirst_int(lnext(list_head(l)))
#define lsecond_oid(l) lfirst_oid(lnext(list_head(l)))
+#define lsecond_node(type,l) castNode(type, lsecond(l))
#define lthird(l) lfirst(lnext(lnext(list_head(l))))
#define lthird_int(l) lfirst_int(lnext(lnext(list_head(l))))
#define lthird_oid(l) lfirst_oid(lnext(lnext(list_head(l))))
+#define lthird_node(type,l) castNode(type, lthird(l))
#define lfourth(l) lfirst(lnext(lnext(lnext(list_head(l)))))
#define lfourth_int(l) lfirst_int(lnext(lnext(lnext(list_head(l)))))
#define lfourth_oid(l) lfirst_oid(lnext(lnext(lnext(list_head(l)))))
+#define lfourth_node(type,l) castNode(type, lfourth(l))
#define llast(l) lfirst(list_tail(l))
#define llast_int(l) lfirst_int(list_tail(l))
#define llast_oid(l) lfirst_oid(list_tail(l))
+#define llast_node(type,l) castNode(type, llast(l))
/*
* Convenience macros for building fixed-length lists
@@ -177,6 +183,20 @@ list_length(const List *l)
(cell1) = lnext(cell1), (cell2) = lnext(cell2))
/*
+ * for_both_cell -
+ * a convenience macro which loops through two lists starting from the
+ * specified cells of each. This macro loops through both lists at the same
+ * time, stopping when either list runs out of elements. Depending on the
+ * requirements of the call site, it may also be wise to assert that the
+ * lengths of the two lists are equal, and initcell1 and initcell2 are at
+ * the same position in the respective lists.
+ */
+#define for_both_cell(cell1, initcell1, cell2, initcell2) \
+ for ((cell1) = (initcell1), (cell2) = (initcell2); \
+ (cell1) != NULL && (cell2) != NULL; \
+ (cell1) = lnext(cell1), (cell2) = lnext(cell2))
+
+/*
* forthree -
* the same for three lists
*/
@@ -204,6 +224,7 @@ extern ListCell *list_nth_cell(const List *list, int n);
extern void *list_nth(const List *list, int n);
extern int list_nth_int(const List *list, int n);
extern Oid list_nth_oid(const List *list, int n);
+#define list_nth_node(type,list,n) castNode(type, list_nth(list, n))
extern bool list_member(const List *list, const void *datum);
extern bool list_member_ptr(const List *list, const void *datum);
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index d811d09cca..a4b9f18aa5 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/plannodes.h
@@ -32,13 +32,18 @@
*
* The output of the planner is a Plan tree headed by a PlannedStmt node.
* PlannedStmt holds the "one time" information needed by the executor.
+ *
+ * For simplicity in APIs, we also wrap utility statements in PlannedStmt
+ * nodes; in such cases, commandType == CMD_UTILITY, the statement itself
+ * is in the utilityStmt field, and the rest of the struct is mostly dummy.
+ * (We do use canSetTag, stmt_location, stmt_len, and possibly queryId.)
* ----------------
*/
typedef struct PlannedStmt
{
NodeTag type;
- CmdType commandType; /* select|insert|update|delete */
+ CmdType commandType; /* select|insert|update|delete|utility */
uint32 queryId; /* query identifier (copied from Query) */
@@ -61,9 +66,21 @@ typedef struct PlannedStmt
/* rtable indexes of target relations for INSERT/UPDATE/DELETE */
List *resultRelations; /* integer list of RT indexes, or NIL */
- Node *utilityStmt; /* non-null if this is DECLARE CURSOR */
+ /*
+ * rtable indexes of non-leaf target relations for UPDATE/DELETE on all
+ * the partitioned table mentioned in the query.
+ */
+ List *nonleafResultRelations;
+
+ /*
+ * rtable indexes of root target relations for UPDATE/DELETE; this list
+ * maintains a subset of the RT indexes in nonleafResultRelations,
+ * indicating the roots of the respective partition hierarchies.
+ */
+ List *rootResultRelations;
- List *subplans; /* Plan trees for SubPlan expressions */
+ List *subplans; /* Plan trees for SubPlan expressions; note
+ * that some could be NULL */
Bitmapset *rewindPlanIDs; /* indices of subplans that require REWIND */
@@ -87,6 +104,12 @@ typedef struct PlannedStmt
List *distributionNodes;
List *distributionRestrict;
#endif
+
+ Node *utilityStmt; /* non-null if this is utility stmt */
+
+ /* statement location in source string (copied from Query) */
+ int stmt_location; /* start location, or -1 if unknown */
+ int stmt_len; /* length in bytes; 0 means "rest of string" */
} PlannedStmt;
/* macro for fetching the Plan associated with a SubPlan node */
@@ -126,6 +149,7 @@ typedef struct Plan
* information needed for parallel query
*/
bool parallel_aware; /* engage parallel-aware logic? */
+ bool parallel_safe; /* OK to use as part of parallel plan? */
/*
* Common structural data for all Plan types.
@@ -182,6 +206,17 @@ typedef struct Result
} Result;
/* ----------------
+ * ProjectSet node -
+ * Apply a projection that includes set-returning functions to the
+ * output tuples of the outer plan.
+ * ----------------
+ */
+typedef struct ProjectSet
+{
+ Plan plan;
+} ProjectSet;
+
+/* ----------------
* ModifyTable node -
* Apply rows produced by subplan(s) to result table(s),
* by inserting, updating, or deleting.
@@ -196,8 +231,11 @@ typedef struct ModifyTable
CmdType operation; /* INSERT, UPDATE, or DELETE */
bool canSetTag; /* do we set the command tag/es_processed? */
Index nominalRelation; /* Parent RT index for use of EXPLAIN */
+ /* RT indexes of non-leaf tables in a partition tree */
+ List *partitioned_rels;
List *resultRelations; /* integer list of RT indexes */
int resultRelIndex; /* index of first resultRel in plan's list */
+ int rootResultRelIndex; /* index of the partitioned table root */
List *plans; /* plan(s) producing source data */
List *withCheckOptionLists; /* per-target-table WCO lists */
List *returningLists; /* per-target-table RETURNING tlists */
@@ -221,6 +259,8 @@ typedef struct ModifyTable
typedef struct Append
{
Plan plan;
+ /* RT indexes of non-leaf tables in a partition tree */
+ List *partitioned_rels;
List *appendplans;
} Append;
@@ -232,6 +272,8 @@ typedef struct Append
typedef struct MergeAppend
{
Plan plan;
+ /* RT indexes of non-leaf tables in a partition tree */
+ List *partitioned_rels;
List *mergeplans;
/* remaining fields are just like the sort-key info in struct Sort */
int numCols; /* number of sort-key columns */
@@ -286,6 +328,7 @@ typedef struct BitmapAnd
typedef struct BitmapOr
{
Plan plan;
+ bool isshared;
List *bitmapplans;
} BitmapOr;
@@ -414,6 +457,7 @@ typedef struct BitmapIndexScan
{
Scan scan;
Oid indexid; /* OID of index to scan */
+ bool isshared; /* Create shared bitmap if set */
List *indexqual; /* list of index quals (OpExprs) */
List *indexqualorig; /* the same in original form */
} BitmapIndexScan;
@@ -490,6 +534,16 @@ typedef struct ValuesScan
} ValuesScan;
/* ----------------
+ * TableFunc scan node
+ * ----------------
+ */
+typedef struct TableFuncScan
+{
+ Scan scan;
+ TableFunc *tablefunc; /* table function node */
+} TableFuncScan;
+
+/* ----------------
* CteScan node
* ----------------
*/
@@ -501,6 +555,16 @@ typedef struct CteScan
} CteScan;
/* ----------------
+ * NamedTuplestoreScan node
+ * ----------------
+ */
+typedef struct NamedTuplestoreScan
+{
+ Scan scan;
+ char *enrname; /* Name given to Ephemeral Named Relation */
+} NamedTuplestoreScan;
+
+/* ----------------
* WorkTableScan node
* ----------------
*/
@@ -574,7 +638,8 @@ struct CustomScanMethods;
typedef struct CustomScan
{
Scan scan;
- uint32 flags; /* mask of CUSTOMPATH_* flags, see relation.h */
+ uint32 flags; /* mask of CUSTOMPATH_* flags, see
+ * nodes/extensible.h */
List *custom_plans; /* list of Plan nodes, if any */
List *custom_exprs; /* expressions that custom code may evaluate */
List *custom_private; /* private data for custom code */
@@ -594,6 +659,7 @@ typedef struct CustomScan
* Join node
*
* jointype: rule for joining tuples from left and right subtrees
+ * inner_unique each outer tuple can match to no more than one inner tuple
* joinqual: qual conditions that came from JOIN/ON or JOIN/USING
* (plan.qual contains conditions that came from WHERE)
*
@@ -604,12 +670,18 @@ typedef struct CustomScan
* (But plan.qual is still applied before actually returning a tuple.)
* For an outer join, only joinquals are allowed to be used as the merge
* or hash condition of a merge or hash join.
+ *
+ * inner_unique is set if the joinquals are such that no more than one inner
+ * tuple could match any given outer tuple. This allows the executor to
+ * skip searching for additional matches. (This must be provable from just
+ * the joinquals, ignoring plan.qual, due to where the executor tests it.)
* ----------------
*/
typedef struct Join
{
Plan plan;
JoinType jointype;
+ bool inner_unique;
List *joinqual; /* JOIN quals (in addition to plan.qual) */
} Join;
@@ -651,6 +723,7 @@ typedef struct NestLoopParam
typedef struct MergeJoin
{
Join join;
+ bool skip_mark_restore; /* Can we skip mark/restore calls? */
List *mergeclauses; /* mergeclauses as expression trees */
/* these are arrays, but have the same length as the mergeclauses list: */
Oid *mergeFamilies; /* per-clause OIDs of btree opfamilies */
@@ -729,7 +802,8 @@ typedef struct Agg
AttrNumber *grpColIdx; /* their indexes in the target list */
Oid *grpOperators; /* equality operators to compare with */
long numGroups; /* estimated number of groups in input */
- /* Note: the planner only provides numGroups in AGG_HASHED case */
+ Bitmapset *aggParams; /* IDs of Params used in Aggref inputs */
+ /* Note: planner provides numGroups & aggParams only in HASHED/MIXED case */
List *groupingSets; /* grouping sets to use */
List *chain; /* chained Agg/Sort nodes */
} Agg;
@@ -777,13 +851,28 @@ typedef struct Gather
bool invisible; /* suppress EXPLAIN display (for testing)? */
} Gather;
+/* ------------
+ * gather merge node
+ * ------------
+ */
+typedef struct GatherMerge
+{
+ Plan plan;
+ int num_workers;
+ /* remaining fields are just like the sort-key info in struct Sort */
+ int numCols; /* number of sort-key columns */
+ AttrNumber *sortColIdx; /* their indexes in the target list */
+ Oid *sortOperators; /* OIDs of operators to sort them by */
+ Oid *collations; /* OIDs of collations */
+ bool *nullsFirst; /* NULLS FIRST/LAST directions */
+} GatherMerge;
+
/* ----------------
* hash build node
*
* If the executor is supposed to try to apply skew join optimization, then
* skewTable/skewColumn/skewInherit identify the outer relation's join key
- * column, from which the relevant MCV statistics can be fetched. Also, its
- * type information is provided to save a lookup.
+ * column, from which the relevant MCV statistics can be fetched.
* ----------------
*/
typedef struct Hash
@@ -792,8 +881,6 @@ typedef struct Hash
Oid skewTable; /* outer join key's table OID, or InvalidOid */
AttrNumber skewColumn; /* outer join key's column #, or zero */
bool skewInherit; /* is outer join rel an inheritance tree? */
- Oid skewColType; /* datatype of the outer key column */
- int32 skewColTypmod; /* typmod of the outer key column */
/* all other info is in the parent HashJoin node */
} Hash;
@@ -901,11 +988,12 @@ typedef enum RowMarkType
* When the planner discovers that a relation is the root of an inheritance
* tree, it sets isParent true, and adds an additional PlanRowMark to the
* list for each child relation (including the target rel itself in its role
- * as a child). The child entries have rti == child rel's RT index and
- * prti == parent's RT index, and can therefore be recognized as children by
- * the fact that prti != rti. The parent's allMarkTypes field gets the OR
- * of (1<<markType) across all its children (this definition allows children
- * to use different markTypes).
+ * as a child). isParent is also set to true for the partitioned child
+ * relations, which are not scanned just like the root parent. The child
+ * entries have rti == child rel's RT index and prti == parent's RT index,
+ * and can therefore be recognized as children by the fact that prti != rti.
+ * The parent's allMarkTypes field gets the OR of (1<<markType) across all
+ * its children (this definition allows children to use different markTypes).
*
* The planner also adds resjunk output columns to the plan that carry
* information sufficient to identify the locked or fetched rows. When
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index f22afd3803..66dd6b50e4 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -8,7 +8,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -20,6 +20,7 @@
#define PRIMNODES_H
#include "access/attnum.h"
+#include "nodes/bitmapset.h"
#include "nodes/pg_list.h"
@@ -44,13 +45,6 @@ typedef struct Alias
List *colnames; /* optional list of column aliases */
} Alias;
-typedef enum InhOption
-{
- INH_NO, /* Do NOT scan child tables */
- INH_YES, /* DO scan child tables */
- INH_DEFAULT /* Use current SQL_inheritance option */
-} InhOption;
-
/* What to do at commit time for temporary relations */
typedef enum OnCommitAction
{
@@ -64,7 +58,7 @@ typedef enum OnCommitAction
* RangeVar - range variable, used in FROM clauses
*
* Also used to represent table names in utility statements; there, the alias
- * field is not used, and inhOpt shows whether to apply the operation
+ * field is not used, and inh tells whether to apply the operation
* recursively to child tables. In some contexts it is also useful to carry
* a TEMP table indication here.
*/
@@ -74,7 +68,7 @@ typedef struct RangeVar
char *catalogname; /* the catalog (database) name, or NULL */
char *schemaname; /* the schema name, or NULL */
char *relname; /* the relation/sequence name */
- InhOption inhOpt; /* expand rel by inheritance? recursively act
+ bool inh; /* expand rel by inheritance? recursively act
* on children? */
char relpersistence; /* see RELPERSISTENCE_* in pg_class.h */
Alias *alias; /* table alias & optional column aliases */
@@ -82,6 +76,27 @@ typedef struct RangeVar
} RangeVar;
/*
+ * TableFunc - node for a table function, such as XMLTABLE.
+ */
+typedef struct TableFunc
+{
+ NodeTag type;
+ List *ns_uris; /* list of namespace uri */
+ List *ns_names; /* list of namespace names */
+ Node *docexpr; /* input document expression */
+ Node *rowexpr; /* row filter expression */
+ List *colnames; /* column names (list of String) */
+ List *coltypes; /* OID list of column type OIDs */
+ List *coltypmods; /* integer list of column typmods */
+ List *colcollations; /* OID list of column collation OIDs */
+ List *colexprs; /* list of column filter expressions */
+ List *coldefexprs; /* list of column default expressions */
+ Bitmapset *notnulls; /* nullability flag for each output column */
+ int ordinalitycol; /* counts from 0; -1 if none specified */
+ int location; /* token location, or -1 if unknown */
+} TableFunc;
+
+/*
* IntoClause - target information for SELECT INTO, CREATE TABLE AS, and
* CREATE MATERIALIZED VIEW
*
@@ -694,6 +709,8 @@ typedef struct SubPlan
bool unknownEqFalse; /* TRUE if it's okay to return FALSE when the
* spec result is UNKNOWN; this allows much
* simpler handling of null values */
+ bool parallel_safe; /* is the subplan parallel-safe? */
+ /* Note: parallel_safe does not consider contents of testexpr or args */
/* Information for passing params into and out of the subselect: */
/* setParam and parParam are lists of integers (param IDs) */
List *setParam; /* initplan subqueries have to set these
@@ -1061,6 +1078,45 @@ typedef struct MinMaxExpr
} MinMaxExpr;
/*
+ * SQLValueFunction - parameterless functions with special grammar productions
+ *
+ * The SQL standard categorizes some of these as <datetime value function>
+ * and others as <general value specification>. We call 'em SQLValueFunctions
+ * for lack of a better term. We store type and typmod of the result so that
+ * some code doesn't need to know each function individually, and because
+ * we would need to store typmod anyway for some of the datetime functions.
+ * Note that currently, all variants return non-collating datatypes, so we do
+ * not need a collation field; also, all these functions are stable.
+ */
+typedef enum SQLValueFunctionOp
+{
+ SVFOP_CURRENT_DATE,
+ SVFOP_CURRENT_TIME,
+ SVFOP_CURRENT_TIME_N,
+ SVFOP_CURRENT_TIMESTAMP,
+ SVFOP_CURRENT_TIMESTAMP_N,
+ SVFOP_LOCALTIME,
+ SVFOP_LOCALTIME_N,
+ SVFOP_LOCALTIMESTAMP,
+ SVFOP_LOCALTIMESTAMP_N,
+ SVFOP_CURRENT_ROLE,
+ SVFOP_CURRENT_USER,
+ SVFOP_USER,
+ SVFOP_SESSION_USER,
+ SVFOP_CURRENT_CATALOG,
+ SVFOP_CURRENT_SCHEMA
+} SQLValueFunctionOp;
+
+typedef struct SQLValueFunction
+{
+ Expr xpr;
+ SQLValueFunctionOp op; /* which function this is */
+ Oid type; /* result type/typmod */
+ int32 typmod;
+ int location; /* token location, or -1 if unknown */
+} SQLValueFunction;
+
+/*
* XmlExpr - various SQL/XML functions requiring special grammar productions
*
* 'name' carries the "NAME foo" argument (already XML-escaped).
@@ -1247,6 +1303,20 @@ typedef struct InferenceElem
Oid inferopclass; /* OID of att opclass, or InvalidOid */
} InferenceElem;
+/*
+ * NextValueExpr - get next value from sequence
+ *
+ * This has the same effect as calling the nextval() function, but it does not
+ * check permissions on the sequence. This is used for identity columns,
+ * where the sequence is an implicit dependency without its own permissions.
+ */
+typedef struct NextValueExpr
+{
+ Expr xpr;
+ Oid seqid;
+ Oid typeId;
+} NextValueExpr;
+
/*--------------------
* TargetEntry -
* a target entry (used in query target lists)
diff --git a/src/include/nodes/print.h b/src/include/nodes/print.h
index 431d72d6f6..4c94a3afe5 100644
--- a/src/include/nodes/print.h
+++ b/src/include/nodes/print.h
@@ -4,7 +4,7 @@
* definitions for nodes/print.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/print.h
diff --git a/src/include/nodes/readfuncs.h b/src/include/nodes/readfuncs.h
index 1b38da112b..ca540baf02 100644
--- a/src/include/nodes/readfuncs.h
+++ b/src/include/nodes/readfuncs.h
@@ -4,7 +4,7 @@
* header file for read.c and readfuncs.c. These functions are internal
* to the stringToNode interface and should not be used by anyone else.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/readfuncs.h
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index d78197e8a7..1e7e6942d5 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/relation.h
@@ -127,6 +127,9 @@ typedef struct PlannerGlobal
List *resultRelations; /* "flat" list of integer RT indexes */
+ List *nonleafResultRelations; /* "flat" list of integer RT indexes */
+ List *rootResultRelations; /* "flat" list of integer RT indexes */
+
List *relationOids; /* OIDs of relations the plan depends on */
List *invalItems; /* other dependencies, as PlanInvalItems */
@@ -146,6 +149,8 @@ typedef struct PlannerGlobal
bool parallelModeOK; /* parallel mode potentially OK? */
bool parallelModeNeeded; /* parallel mode actually required? */
+
+ char maxParallelHazard; /* worst PROPARALLEL hazard level */
} PlannerGlobal;
/* macro for fetching the Plan associated with a SubPlan node */
@@ -266,6 +271,8 @@ typedef struct PlannerInfo
List *append_rel_list; /* list of AppendRelInfos */
+ List *pcinfo_list; /* list of PartitionedChildRelInfos */
+
List *rowMarks; /* list of PlanRowMarks */
List *placeholder_list; /* list of PlaceHolderInfos */
@@ -304,6 +311,9 @@ typedef struct PlannerInfo
double tuple_fraction; /* tuple_fraction passed to query_planner */
double limit_tuples; /* limit_tuples passed to query_planner */
+ Index qual_security_level; /* minimum security_level for quals */
+ /* Note: qual_security_level is zero if there are no securityQuals */
+
bool hasInheritedTarget; /* true if parse->resultRelation is an
* inheritance child rel */
bool hasJoinRTEs; /* true if any RTEs are RTE_JOIN kind */
@@ -465,6 +475,19 @@ typedef struct PlannerInfo
* fdwroutine - function hooks for FDW, if foreign table (else NULL)
* fdw_private - private state for FDW, if foreign table (else NULL)
*
+ * Two fields are used to cache knowledge acquired during the join search
+ * about whether this rel is provably unique when being joined to given other
+ * relation(s), ie, it can have at most one row matching any given row from
+ * that join relation. Currently we only attempt such proofs, and thus only
+ * populate these fields, for base rels; but someday they might be used for
+ * join rels too:
+ *
+ * unique_for_rels - list of Relid sets, each one being a set of other
+ * rels for which this one has been proven unique
+ * non_unique_for_rels - list of Relid sets, each one being a set of
+ * other rels for which we have tried and failed to prove
+ * this one unique
+ *
* The presence of the remaining fields depends on the restrictions
* and joins that the relation participates in:
*
@@ -473,6 +496,8 @@ typedef struct PlannerInfo
* participates (only used for base rels)
* baserestrictcost - Estimated cost of evaluating the baserestrictinfo
* clauses at a single tuple (only used for base rels)
+ * baserestrict_min_security - Smallest security_level found among
+ * clauses in baserestrictinfo
* joininfo - List of RestrictInfo nodes, containing info about each
* join clause in which this relation participates (but
* note this excludes clauses that might be derivable from
@@ -505,6 +530,23 @@ typedef enum RelOptKind
RELOPT_DEADREL
} RelOptKind;
+/*
+ * Is the given relation a simple relation i.e a base or "other" member
+ * relation?
+ */
+#define IS_SIMPLE_REL(rel) \
+ ((rel)->reloptkind == RELOPT_BASEREL || \
+ (rel)->reloptkind == RELOPT_OTHER_MEMBER_REL)
+
+/* Is the given relation a join relation? */
+#define IS_JOIN_REL(rel) ((rel)->reloptkind == RELOPT_JOINREL)
+
+/* Is the given relation an upper relation? */
+#define IS_UPPER_REL(rel) ((rel)->reloptkind == RELOPT_UPPER_REL)
+
+/* Is the given relation an "other" relation? */
+#define IS_OTHER_REL(rel) ((rel)->reloptkind == RELOPT_OTHER_MEMBER_REL)
+
typedef struct RelOptInfo
{
NodeTag type;
@@ -550,6 +592,7 @@ typedef struct RelOptInfo
List *lateral_vars; /* LATERAL Vars and PHVs referenced by rel */
Relids lateral_referencers; /* rels that reference me laterally */
List *indexlist; /* list of IndexOptInfo */
+ List *statlist; /* list of StatisticExtInfo */
BlockNumber pages; /* size estimates derived from pg_class */
double tuples;
double allvisfrac;
@@ -565,13 +608,22 @@ typedef struct RelOptInfo
struct FdwRoutine *fdwroutine;
void *fdw_private;
+ /* cache space for remembering if we have proven this relation unique */
+ List *unique_for_rels; /* known unique for these other relid set(s) */
+ List *non_unique_for_rels; /* known not unique for these set(s) */
+
/* used by various scans and joins: */
List *baserestrictinfo; /* RestrictInfo structures (if base
* rel) */
QualCost baserestrictcost; /* cost of evaluating the above */
+ Index baserestrict_min_security; /* min security_level found in
+ * baserestrictinfo */
List *joininfo; /* RestrictInfo structures for join clauses
* involving this rel */
bool has_eclass_joins; /* T means joininfo is incomplete */
+
+ /* used by "other" relations */
+ Relids top_parent_relids; /* Relids of topmost parents */
} RelOptInfo;
/*
@@ -652,6 +704,7 @@ typedef struct IndexOptInfo
bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */
bool amhasgettuple; /* does AM have amgettuple interface? */
bool amhasgetbitmap; /* does AM have amgetbitmap interface? */
+ bool amcanparallel; /* does AM support parallel scan? */
/* Rather than include amapi.h here, we declare amcostestimate like this */
void (*amcostestimate) (); /* AM's cost estimator */
} IndexOptInfo;
@@ -686,6 +739,22 @@ typedef struct ForeignKeyOptInfo
List *rinfos[INDEX_MAX_KEYS];
} ForeignKeyOptInfo;
+/*
+ * StatisticExtInfo
+ * Information about extended statistics for planning/optimization
+ *
+ * Each pg_statistic_ext row is represented by one or more nodes of this
+ * type, or even zero if ANALYZE has not computed them.
+ */
+typedef struct StatisticExtInfo
+{
+ NodeTag type;
+
+ Oid statOid; /* OID of the statistics row */
+ RelOptInfo *rel; /* back-link to statistic's table */
+ char kind; /* statistic kind of this entry */
+ Bitmapset *keys; /* attnums of the columns covered */
+} StatisticExtInfo;
/*
* EquivalenceClasses
@@ -743,6 +812,8 @@ typedef struct EquivalenceClass
bool ec_below_outer_join; /* equivalence applies below an OJ */
bool ec_broken; /* failed to generate needed clauses? */
Index ec_sortref; /* originating sortclause label, or 0 */
+ Index ec_min_security; /* minimum security_level in ec_sources */
+ Index ec_max_security; /* maximum security_level in ec_sources */
struct EquivalenceClass *ec_merged; /* set if merged into another EC */
} EquivalenceClass;
@@ -1120,7 +1191,8 @@ struct CustomPathMethods;
typedef struct CustomPath
{
Path path;
- uint32 flags; /* mask of CUSTOMPATH_* flags, see above */
+ uint32 flags; /* mask of CUSTOMPATH_* flags, see
+ * nodes/extensible.h */
List *custom_paths; /* list of child Path nodes, if any */
List *custom_private;
const struct CustomPathMethods *methods;
@@ -1138,6 +1210,8 @@ typedef struct CustomPath
typedef struct AppendPath
{
Path path;
+ /* RT indexes of non-leaf tables in a partition tree */
+ List *partitioned_rels;
List *subpaths; /* list of component Paths */
} AppendPath;
@@ -1156,6 +1230,8 @@ typedef struct AppendPath
typedef struct MergeAppendPath
{
Path path;
+ /* RT indexes of non-leaf tables in a partition tree */
+ List *partitioned_rels;
List *subpaths; /* list of component Paths */
double limit_tuples; /* hard limit on output tuples, or -1 */
} MergeAppendPath;
@@ -1230,10 +1306,24 @@ typedef struct GatherPath
{
Path path;
Path *subpath; /* path for each worker */
- bool single_copy; /* path must not be executed >1x */
+ bool single_copy; /* don't execute path more than once */
+ int num_workers; /* number of workers sought to help */
} GatherPath;
/*
+ * GatherMergePath runs several copies of a plan in parallel and
+ * collects the results. For gather merge parallel leader always execute the
+ * plan.
+ */
+typedef struct GatherMergePath
+{
+ Path path;
+ Path *subpath; /* path for each worker */
+ int num_workers; /* number of workers sought to help */
+} GatherMergePath;
+
+
+/*
* All join-type paths share these fields.
*/
@@ -1243,6 +1333,9 @@ typedef struct JoinPath
JoinType jointype;
+ bool inner_unique; /* each outer tuple provably matches no more
+ * than one inner tuple */
+
Path *outerjoinpath; /* path for the outer side of the join */
Path *innerjoinpath; /* path for the inner side of the join */
@@ -1289,6 +1382,13 @@ typedef JoinPath NestPath;
* mergejoin. If it is not NIL then it is a PathKeys list describing
* the ordering that must be created by an explicit Sort node.
*
+ * skip_mark_restore is TRUE if the executor need not do mark/restore calls.
+ * Mark/restore overhead is usually required, but can be skipped if we know
+ * that the executor need find only one match per outer tuple, and that the
+ * mergeclauses are sufficient to identify a match. In such cases the
+ * executor can immediately advance the outer relation after processing a
+ * match, and therefoere it need never back up the inner relation.
+ *
* materialize_inner is TRUE if a Material node should be placed atop the
* inner input. This may appear with or without an inner Sort step.
*/
@@ -1299,6 +1399,7 @@ typedef struct MergePath
List *path_mergeclauses; /* join clauses to be used for merge */
List *outersortkeys; /* keys for explicit sort, if any */
List *innersortkeys; /* keys for explicit sort, if any */
+ bool skip_mark_restore; /* can executor skip mark/restore? */
bool materialize_inner; /* add Materialize to inner? */
} MergePath;
@@ -1340,6 +1441,17 @@ typedef struct ProjectionPath
} ProjectionPath;
/*
+ * ProjectSetPath represents evaluation of a targetlist that includes
+ * set-returning function(s), which will need to be implemented by a
+ * ProjectSet plan node.
+ */
+typedef struct ProjectSetPath
+{
+ Path path;
+ Path *subpath; /* path representing input source */
+} ProjectSetPath;
+
+/*
* SortPath represents an explicit sort step
*
* The sort keys are, by definition, the same as path.pathkeys.
@@ -1401,17 +1513,37 @@ typedef struct AggPath
} AggPath;
/*
+ * Various annotations used for grouping sets in the planner.
+ */
+
+typedef struct GroupingSetData
+{
+ NodeTag type;
+ List *set; /* grouping set as list of sortgrouprefs */
+ double numGroups; /* est. number of result groups */
+} GroupingSetData;
+
+typedef struct RollupData
+{
+ NodeTag type;
+ List *groupClause; /* applicable subset of parse->groupClause */
+ List *gsets; /* lists of integer indexes into groupClause */
+ List *gsets_data; /* list of GroupingSetData */
+ double numGroups; /* est. number of result groups */
+ bool hashable; /* can be hashed */
+ bool is_hashed; /* to be implemented as a hashagg */
+} RollupData;
+
+/*
* GroupingSetsPath represents a GROUPING SETS aggregation
- *
- * Currently we only support this in sorted not hashed form, so the input
- * must always be appropriately presorted.
*/
+
typedef struct GroupingSetsPath
{
Path path;
Path *subpath; /* path representing input source */
- List *rollup_groupclauses; /* list of lists of SortGroupClause's */
- List *rollup_lists; /* parallel list of lists of grouping sets */
+ AggStrategy aggstrategy; /* basic strategy */
+ List *rollups; /* list of RollupData */
List *qual; /* quals (HAVING quals), if any */
} GroupingSetsPath;
@@ -1492,6 +1624,8 @@ typedef struct ModifyTablePath
CmdType operation; /* INSERT, UPDATE, or DELETE */
bool canSetTag; /* do we set the command tag/es_processed? */
Index nominalRelation; /* Parent RT index for use of EXPLAIN */
+ /* RT indexes of non-leaf tables in a partition tree */
+ List *partitioned_rels;
List *resultRelations; /* integer list of RT indexes */
List *subpaths; /* Path(s) producing source data */
List *subroots; /* per-target-table PlannerInfos */
@@ -1604,6 +1738,15 @@ typedef struct LimitPath
* outer join(s). A clause that is not outerjoin_delayed can be enforced
* anywhere it is computable.
*
+ * To handle security-barrier conditions efficiently, we mark RestrictInfo
+ * nodes with a security_level field, in which higher values identify clauses
+ * coming from less-trusted sources. The exact semantics are that a clause
+ * cannot be evaluated before another clause with a lower security_level value
+ * unless the first clause is leakproof. As with outer-join clauses, this
+ * creates a reason for clauses to sometimes need to be evaluated higher in
+ * the join tree than their contents would suggest; and even at a single plan
+ * node, this rule constrains the order of application of clauses.
+ *
* In general, the referenced clause might be arbitrarily complex. The
* kinds of clauses we can handle as indexscan quals, mergejoin clauses,
* or hashjoin clauses are limited (e.g., no volatile functions). The code
@@ -1658,6 +1801,10 @@ typedef struct RestrictInfo
bool pseudoconstant; /* see comment above */
+ bool leakproof; /* TRUE if known to contain no leaked Vars */
+
+ Index security_level; /* see comment above */
+
/* The set of relids (varnos) actually referenced in the clause: */
Relids clause_relids;
@@ -1833,10 +1980,10 @@ typedef struct SpecialJoinInfo
*
* When we expand an inheritable table or a UNION-ALL subselect into an
* "append relation" (essentially, a list of child RTEs), we build an
- * AppendRelInfo for each child RTE. The list of AppendRelInfos indicates
- * which child RTEs must be included when expanding the parent, and each
- * node carries information needed to translate Vars referencing the parent
- * into Vars referencing that child.
+ * AppendRelInfo for each non-partitioned child RTE. The list of
+ * AppendRelInfos indicates which child RTEs must be included when expanding
+ * the parent, and each node carries information needed to translate Vars
+ * referencing the parent into Vars referencing that child.
*
* These structs are kept in the PlannerInfo node's append_rel_list.
* Note that we just throw all the structs into one list, and scan the
@@ -1911,6 +2058,25 @@ typedef struct AppendRelInfo
} AppendRelInfo;
/*
+ * For a partitioned table, this maps its RT index to the list of RT indexes
+ * of the partitioned child tables in the partition tree. We need to
+ * separately store this information, because we do not create AppendRelInfos
+ * for the partitioned child tables of a parent table, since AppendRelInfos
+ * contain information that is unnecessary for the partitioned child tables.
+ * The child_rels list must contain at least one element, because the parent
+ * partitioned table is itself counted as a child.
+ *
+ * These structs are kept in the PlannerInfo node's pcinfo_list.
+ */
+typedef struct PartitionedChildRelInfo
+{
+ NodeTag type;
+
+ Index parent_relid;
+ List *child_rels;
+} PartitionedChildRelInfo;
+
+/*
* For each distinct placeholder expression generated during planning, we
* store a PlaceHolderInfo node in the PlannerInfo node's placeholder_list.
* This stores info that is needed centrally rather than in each copy of the
@@ -2022,8 +2188,8 @@ typedef struct PlannerParamItem
} PlannerParamItem;
/*
- * When making cost estimates for a SEMI or ANTI join, there are some
- * correction factors that are needed in both nestloop and hash joins
+ * When making cost estimates for a SEMI/ANTI/inner_unique join, there are
+ * some correction factors that are needed in both nestloop and hash joins
* to account for the fact that the executor can stop scanning inner rows
* as soon as it finds a match to the current outer row. These numbers
* depend only on the selected outer and inner join relations, not on the
@@ -2050,14 +2216,17 @@ typedef struct SemiAntiJoinFactors
* clauses that apply to this join
* mergeclause_list is a list of RestrictInfo nodes for available
* mergejoin clauses in this join
+ * inner_unique is true if each outer tuple provably matches no more
+ * than one inner tuple
* sjinfo is extra info about special joins for selectivity estimation
- * semifactors is as shown above (only valid for SEMI or ANTI joins)
+ * semifactors is as shown above (only valid for SEMI/ANTI/inner_unique joins)
* param_source_rels are OK targets for parameterization of result paths
*/
typedef struct JoinPathExtraData
{
List *restrictlist;
List *mergeclause_list;
+ bool inner_unique;
SpecialJoinInfo *sjinfo;
SemiAntiJoinFactors semifactors;
Relids param_source_rels;
diff --git a/src/include/nodes/replnodes.h b/src/include/nodes/replnodes.h
index d2f1edbf0d..92ada41b6d 100644
--- a/src/include/nodes/replnodes.h
+++ b/src/include/nodes/replnodes.h
@@ -4,7 +4,7 @@
* definitions for replication grammar parse nodes
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/replnodes.h
@@ -55,7 +55,8 @@ typedef struct CreateReplicationSlotCmd
char *slotname;
ReplicationKind kind;
char *plugin;
- bool reserve_wal;
+ bool temporary;
+ List *options;
} CreateReplicationSlotCmd;
@@ -95,4 +96,13 @@ typedef struct TimeLineHistoryCmd
TimeLineID timeline;
} TimeLineHistoryCmd;
+/* ----------------------
+ * SQL commands
+ * ----------------------
+ */
+typedef struct SQLCmd
+{
+ NodeTag type;
+} SQLCmd;
+
#endif /* REPLNODES_H */
diff --git a/src/include/nodes/tidbitmap.h b/src/include/nodes/tidbitmap.h
index 930329988d..87f4bb7c91 100644
--- a/src/include/nodes/tidbitmap.h
+++ b/src/include/nodes/tidbitmap.h
@@ -13,7 +13,7 @@
* fact that a particular page needs to be visited.
*
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/nodes/tidbitmap.h
*
@@ -23,6 +23,7 @@
#define TIDBITMAP_H
#include "storage/itemptr.h"
+#include "utils/dsa.h"
/*
@@ -33,6 +34,7 @@ typedef struct TIDBitmap TIDBitmap;
/* Likewise, TBMIterator is private */
typedef struct TBMIterator TBMIterator;
+typedef struct TBMSharedIterator TBMSharedIterator;
/* Result structure for tbm_iterate */
typedef struct
@@ -46,8 +48,9 @@ typedef struct
/* function prototypes in nodes/tidbitmap.c */
-extern TIDBitmap *tbm_create(long maxbytes);
+extern TIDBitmap *tbm_create(long maxbytes, dsa_area *dsa);
extern void tbm_free(TIDBitmap *tbm);
+extern void tbm_free_shared_area(dsa_area *dsa, dsa_pointer dp);
extern void tbm_add_tuples(TIDBitmap *tbm,
const ItemPointer tids, int ntids,
@@ -60,7 +63,12 @@ extern void tbm_intersect(TIDBitmap *a, const TIDBitmap *b);
extern bool tbm_is_empty(const TIDBitmap *tbm);
extern TBMIterator *tbm_begin_iterate(TIDBitmap *tbm);
+extern dsa_pointer tbm_prepare_shared_iterate(TIDBitmap *tbm);
extern TBMIterateResult *tbm_iterate(TBMIterator *iterator);
+extern TBMIterateResult *tbm_shared_iterate(TBMSharedIterator *iterator);
extern void tbm_end_iterate(TBMIterator *iterator);
+extern void tbm_end_shared_iterate(TBMSharedIterator *iterator);
+extern TBMSharedIterator *tbm_attach_shared_iterate(dsa_area *dsa,
+ dsa_pointer dp);
#endif /* TIDBITMAP_H */
diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h
index 31ede000c1..ede97b7bcd 100644
--- a/src/include/nodes/value.h
+++ b/src/include/nodes/value.h
@@ -4,7 +4,7 @@
* interface for Value nodes
*
*
- * Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/nodes/value.h
*
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index be7c639f7b..cc0d7b0a26 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -4,7 +4,7 @@
* prototypes for clauses.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/clauses.h
@@ -54,14 +54,14 @@ extern bool contain_window_function(Node *clause);
extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
extern double expression_returns_set_rows(Node *clause);
-extern double tlist_returns_set_rows(List *tlist);
extern bool contain_subplans(Node *clause);
extern bool contain_mutable_functions(Node *clause);
extern bool contain_volatile_functions(Node *clause);
extern bool contain_volatile_functions_not_nextval(Node *clause);
-extern bool has_parallel_hazard(Node *node, bool allow_restricted);
+extern char max_parallel_hazard(Query *parse);
+extern bool is_parallel_safe(PlannerInfo *root, Node *node);
extern bool contain_nonstrict_functions(Node *clause);
extern bool contain_leaked_vars(Node *clause);
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 0a70840dd3..2701500a4a 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/cost.h
@@ -75,10 +75,8 @@ extern bool enable_nestloop;
extern bool enable_material;
extern bool enable_mergejoin;
extern bool enable_hashjoin;
-#ifdef PGXC
extern bool enable_fast_query_shipping;
-
-#endif
+extern bool enable_gathermerge;
extern int constraint_exclusion;
extern double clamp_row_est(double nrows);
@@ -89,7 +87,7 @@ extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
extern void cost_samplescan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
ParamPathInfo *param_info);
extern void cost_index(IndexPath *path, PlannerInfo *root,
- double loop_count);
+ double loop_count, bool partial_path);
extern void cost_bitmap_heap_scan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
ParamPathInfo *param_info,
Path *bitmapqual, double loop_count);
@@ -102,13 +100,19 @@ extern void cost_subqueryscan(SubqueryScanPath *path, PlannerInfo *root,
RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_functionscan(Path *path, PlannerInfo *root,
RelOptInfo *baserel, ParamPathInfo *param_info);
+extern void cost_tableexprscan(Path *path, PlannerInfo *root,
+ RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_valuesscan(Path *path, PlannerInfo *root,
RelOptInfo *baserel, ParamPathInfo *param_info);
#ifdef PGXC
extern void cost_remotequery(Path *path, PlannerInfo *root, RelOptInfo *baserel);
#endif
+extern void cost_tablefuncscan(Path *path, PlannerInfo *root,
+ RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_ctescan(Path *path, PlannerInfo *root,
RelOptInfo *baserel, ParamPathInfo *param_info);
+extern void cost_namedtuplestorescan(Path *path, PlannerInfo *root,
+ RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_recursive_union(Path *runion, Path *nrterm, Path *rterm);
extern void cost_sort(Path *path, PlannerInfo *root,
List *pathkeys, Cost input_cost, double tuples, int width,
@@ -138,33 +142,29 @@ extern void initial_cost_nestloop(PlannerInfo *root,
JoinCostWorkspace *workspace,
JoinType jointype,
Path *outer_path, Path *inner_path,
- SpecialJoinInfo *sjinfo,
- SemiAntiJoinFactors *semifactors);
+ JoinPathExtraData *extra);
extern void final_cost_nestloop(PlannerInfo *root, NestPath *path,
JoinCostWorkspace *workspace,
- SpecialJoinInfo *sjinfo,
- SemiAntiJoinFactors *semifactors);
+ JoinPathExtraData *extra);
extern void initial_cost_mergejoin(PlannerInfo *root,
JoinCostWorkspace *workspace,
JoinType jointype,
List *mergeclauses,
Path *outer_path, Path *inner_path,
List *outersortkeys, List *innersortkeys,
- SpecialJoinInfo *sjinfo);
+ JoinPathExtraData *extra);
extern void final_cost_mergejoin(PlannerInfo *root, MergePath *path,
JoinCostWorkspace *workspace,
- SpecialJoinInfo *sjinfo);
+ JoinPathExtraData *extra);
extern void initial_cost_hashjoin(PlannerInfo *root,
JoinCostWorkspace *workspace,
JoinType jointype,
List *hashclauses,
Path *outer_path, Path *inner_path,
- SpecialJoinInfo *sjinfo,
- SemiAntiJoinFactors *semifactors);
+ JoinPathExtraData *extra);
extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path,
JoinCostWorkspace *workspace,
- SpecialJoinInfo *sjinfo,
- SemiAntiJoinFactors *semifactors);
+ JoinPathExtraData *extra);
extern void cost_gather(GatherPath *path, PlannerInfo *root,
RelOptInfo *baserel, ParamPathInfo *param_info, double *rows);
extern void cost_subplan(PlannerInfo *root, SubPlan *subplan, Plan *plan);
@@ -202,8 +202,12 @@ extern void set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_values_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_cte_size_estimates(PlannerInfo *root, RelOptInfo *rel,
double cte_rows);
+extern void set_tablefunc_size_estimates(PlannerInfo *root, RelOptInfo *rel);
+extern void set_namedtuplestore_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_foreign_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern PathTarget *set_pathtarget_cost_width(PlannerInfo *root, PathTarget *target);
+extern double compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel,
+ Path *bitmapqual, int loop_count, Cost *cost, double *tuple);
/*
* prototypes for clausesel.c
@@ -219,5 +223,9 @@ extern Selectivity clause_selectivity(PlannerInfo *root,
int varRelid,
JoinType jointype,
SpecialJoinInfo *sjinfo);
+extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
+ RelOptInfo *rel, ParamPathInfo *param_info,
+ Cost input_startup_cost, Cost input_total_cost,
+ double *rows);
#endif /* COST_H */
diff --git a/src/include/optimizer/geqo.h b/src/include/optimizer/geqo.h
index 094d572fa4..6b09c4e195 100644
--- a/src/include/optimizer/geqo.h
+++ b/src/include/optimizer/geqo.h
@@ -3,7 +3,7 @@
* geqo.h
* prototypes for various files in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo.h
diff --git a/src/include/optimizer/geqo_copy.h b/src/include/optimizer/geqo_copy.h
index 0892e7993e..3cbaf3e4ca 100644
--- a/src/include/optimizer/geqo_copy.h
+++ b/src/include/optimizer/geqo_copy.h
@@ -3,7 +3,7 @@
* geqo_copy.h
* prototypes for copy functions in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_copy.h
diff --git a/src/include/optimizer/geqo_gene.h b/src/include/optimizer/geqo_gene.h
index f4e5d5064a..f936ebdd89 100644
--- a/src/include/optimizer/geqo_gene.h
+++ b/src/include/optimizer/geqo_gene.h
@@ -3,7 +3,7 @@
* geqo_gene.h
* genome representation in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_gene.h
diff --git a/src/include/optimizer/geqo_misc.h b/src/include/optimizer/geqo_misc.h
index 7b0a052ad5..880bd0e140 100644
--- a/src/include/optimizer/geqo_misc.h
+++ b/src/include/optimizer/geqo_misc.h
@@ -3,7 +3,7 @@
* geqo_misc.h
* prototypes for printout routines in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_misc.h
diff --git a/src/include/optimizer/geqo_mutation.h b/src/include/optimizer/geqo_mutation.h
index 940d05a3ce..85781c3c31 100644
--- a/src/include/optimizer/geqo_mutation.h
+++ b/src/include/optimizer/geqo_mutation.h
@@ -3,7 +3,7 @@
* geqo_mutation.h
* prototypes for mutation functions in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_mutation.h
diff --git a/src/include/optimizer/geqo_pool.h b/src/include/optimizer/geqo_pool.h
index 798d72c858..7947b6e5bb 100644
--- a/src/include/optimizer/geqo_pool.h
+++ b/src/include/optimizer/geqo_pool.h
@@ -3,7 +3,7 @@
* geqo_pool.h
* pool representation in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_pool.h
diff --git a/src/include/optimizer/geqo_random.h b/src/include/optimizer/geqo_random.h
index 782ac6d026..5312589387 100644
--- a/src/include/optimizer/geqo_random.h
+++ b/src/include/optimizer/geqo_random.h
@@ -3,7 +3,7 @@
* geqo_random.h
* random number generator
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_random.h
diff --git a/src/include/optimizer/geqo_recombination.h b/src/include/optimizer/geqo_recombination.h
index 0906833334..8ddde22296 100644
--- a/src/include/optimizer/geqo_recombination.h
+++ b/src/include/optimizer/geqo_recombination.h
@@ -3,7 +3,7 @@
* geqo_recombination.h
* prototypes for recombination in the genetic query optimizer
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_recombination.h
diff --git a/src/include/optimizer/geqo_selection.h b/src/include/optimizer/geqo_selection.h
index c02d5c2918..1aecf14ac1 100644
--- a/src/include/optimizer/geqo_selection.h
+++ b/src/include/optimizer/geqo_selection.h
@@ -3,7 +3,7 @@
* geqo_selection.h
* prototypes for selection routines in optimizer/geqo
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/geqo_selection.h
diff --git a/src/include/optimizer/joininfo.h b/src/include/optimizer/joininfo.h
index 9261f065a2..c9a8b53f1f 100644
--- a/src/include/optimizer/joininfo.h
+++ b/src/include/optimizer/joininfo.h
@@ -4,7 +4,7 @@
* prototypes for joininfo.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/joininfo.h
diff --git a/src/include/optimizer/orclauses.h b/src/include/optimizer/orclauses.h
index f1c7a0bff4..2512ddee8f 100644
--- a/src/include/optimizer/orclauses.h
+++ b/src/include/optimizer/orclauses.h
@@ -4,7 +4,7 @@
* prototypes for orclauses.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/orclauses.h
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
index e8ffed5f49..7937deebda 100644
--- a/src/include/optimizer/pathnode.h
+++ b/src/include/optimizer/pathnode.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/pathnode.h
@@ -48,12 +48,14 @@ extern IndexPath *create_index_path(PlannerInfo *root,
ScanDirection indexscandir,
bool indexonly,
Relids required_outer,
- double loop_count);
+ double loop_count,
+ bool partial_path);
extern BitmapHeapPath *create_bitmap_heap_path(PlannerInfo *root,
RelOptInfo *rel,
Path *bitmapqual,
Relids required_outer,
- double loop_count);
+ double loop_count,
+ int parallel_degree);
extern BitmapAndPath *create_bitmap_and_path(PlannerInfo *root,
RelOptInfo *rel,
List *bitmapquals);
@@ -63,12 +65,14 @@ extern BitmapOrPath *create_bitmap_or_path(PlannerInfo *root,
extern TidPath *create_tidscan_path(PlannerInfo *root, RelOptInfo *rel,
List *tidquals, Relids required_outer);
extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths,
- Relids required_outer, int parallel_workers);
+ Relids required_outer, int parallel_workers,
+ List *partitioned_rels);
extern MergeAppendPath *create_merge_append_path(PlannerInfo *root,
RelOptInfo *rel,
List *subpaths,
List *pathkeys,
- Relids required_outer);
+ Relids required_outer,
+ List *partitioned_rels);
extern ResultPath *create_result_path(PlannerInfo *root, RelOptInfo *rel,
PathTarget *target, List *resconstantqual);
extern MaterialPath *create_material_path(RelOptInfo *rel, Path *subpath);
@@ -77,15 +81,28 @@ extern UniquePath *create_unique_path(PlannerInfo *root, RelOptInfo *rel,
extern GatherPath *create_gather_path(PlannerInfo *root,
RelOptInfo *rel, Path *subpath, PathTarget *target,
Relids required_outer, double *rows);
+extern GatherMergePath *create_gather_merge_path(PlannerInfo *root,
+ RelOptInfo *rel,
+ Path *subpath,
+ PathTarget *target,
+ List *pathkeys,
+ Relids required_outer,
+ double *rows);
extern SubqueryScanPath *create_subqueryscan_path(PlannerInfo *root,
RelOptInfo *rel, Path *subpath, List *pathkeys,
Relids required_outer, Distribution *distribution);
extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel,
List *pathkeys, Relids required_outer);
+extern Path *create_tablexprscan_path(PlannerInfo *root, RelOptInfo *rel,
+ List *pathkeys, Relids required_outer);
extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel,
Relids required_outer);
+extern Path *create_tablefuncscan_path(PlannerInfo *root, RelOptInfo *rel,
+ Relids required_outer);
extern Path *create_ctescan_path(PlannerInfo *root, RelOptInfo *rel,
Relids required_outer);
+extern Path *create_namedtuplestorescan_path(PlannerInfo *root, RelOptInfo *rel,
+ Relids required_outer);
extern Path *create_worktablescan_path(PlannerInfo *root, RelOptInfo *rel,
Relids required_outer);
extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
@@ -103,8 +120,7 @@ extern NestPath *create_nestloop_path(PlannerInfo *root,
RelOptInfo *joinrel,
JoinType jointype,
JoinCostWorkspace *workspace,
- SpecialJoinInfo *sjinfo,
- SemiAntiJoinFactors *semifactors,
+ JoinPathExtraData *extra,
Path *outer_path,
Path *inner_path,
List *restrict_clauses,
@@ -115,7 +131,7 @@ extern MergePath *create_mergejoin_path(PlannerInfo *root,
RelOptInfo *joinrel,
JoinType jointype,
JoinCostWorkspace *workspace,
- SpecialJoinInfo *sjinfo,
+ JoinPathExtraData *extra,
Path *outer_path,
Path *inner_path,
List *restrict_clauses,
@@ -129,8 +145,7 @@ extern HashPath *create_hashjoin_path(PlannerInfo *root,
RelOptInfo *joinrel,
JoinType jointype,
JoinCostWorkspace *workspace,
- SpecialJoinInfo *sjinfo,
- SemiAntiJoinFactors *semifactors,
+ JoinPathExtraData *extra,
Path *outer_path,
Path *inner_path,
List *restrict_clauses,
@@ -145,6 +160,10 @@ extern Path *apply_projection_to_path(PlannerInfo *root,
RelOptInfo *rel,
Path *path,
PathTarget *target);
+extern ProjectSetPath *create_set_projection_path(PlannerInfo *root,
+ RelOptInfo *rel,
+ Path *subpath,
+ PathTarget *target);
extern SortPath *create_sort_path(PlannerInfo *root,
RelOptInfo *rel,
Path *subpath,
@@ -177,8 +196,8 @@ extern GroupingSetsPath *create_groupingsets_path(PlannerInfo *root,
Path *subpath,
PathTarget *target,
List *having_qual,
- List *rollup_lists,
- List *rollup_groupclauses,
+ AggStrategy aggstrategy,
+ List *rollups,
const AggClauseCosts *agg_costs,
double numGroups);
extern MinMaxAggPath *create_minmaxagg_path(PlannerInfo *root,
@@ -216,7 +235,7 @@ extern LockRowsPath *create_lockrows_path(PlannerInfo *root, RelOptInfo *rel,
extern ModifyTablePath *create_modifytable_path(PlannerInfo *root,
RelOptInfo *rel,
CmdType operation, bool canSetTag,
- Index nominalRelation,
+ Index nominalRelation, List *partitioned_rels,
List *resultRelations, List *subpaths,
List *subroots,
List *withCheckOptionLists, List *returningLists,
@@ -239,7 +258,7 @@ extern Path *create_remotesubplan_path(PlannerInfo *root, Path *subpath,
*/
extern void setup_simple_rel_arrays(PlannerInfo *root);
extern RelOptInfo *build_simple_rel(PlannerInfo *root, int relid,
- RelOptKind reloptkind);
+ RelOptInfo *parent);
extern RelOptInfo *find_base_rel(PlannerInfo *root, int relid);
extern RelOptInfo *find_join_rel(PlannerInfo *root, Relids relids);
extern RelOptInfo *build_join_rel(PlannerInfo *root,
@@ -257,7 +276,6 @@ extern RelOptInfo *fetch_upper_rel(PlannerInfo *root, UpperRelationKind kind,
Relids relids);
extern AppendRelInfo *find_childrel_appendrelinfo(PlannerInfo *root,
RelOptInfo *rel);
-extern RelOptInfo *find_childrel_top_parent(PlannerInfo *root, RelOptInfo *rel);
extern Relids find_childrel_parents(PlannerInfo *root, RelOptInfo *rel);
extern ParamPathInfo *get_baserel_parampathinfo(PlannerInfo *root,
RelOptInfo *baserel,
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index 44abe8336a..a216f9e912 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -4,7 +4,7 @@
* prototypes for various files in optimizer/path
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/paths.h
@@ -22,7 +22,8 @@
*/
extern bool enable_geqo;
extern int geqo_threshold;
-extern int min_parallel_relation_size;
+extern int min_parallel_table_scan_size;
+extern int min_parallel_index_scan_size;
/* Hook for plugins to get control in set_rel_pathlist() */
typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root,
@@ -53,6 +54,10 @@ extern RelOptInfo *standard_join_search(PlannerInfo *root, int levels_needed,
List *initial_rels);
extern void generate_gather_paths(PlannerInfo *root, RelOptInfo *rel);
+extern int compute_parallel_worker(RelOptInfo *rel, double heap_pages,
+ double index_pages);
+extern void create_partial_bitmap_paths(PlannerInfo *root, RelOptInfo *rel,
+ Path *bitmapqual);
#ifdef OPTIMIZER_DEBUG
extern void debug_print_rel(PlannerInfo *root, RelOptInfo *rel);
@@ -66,6 +71,8 @@ extern void create_index_paths(PlannerInfo *root, RelOptInfo *rel);
extern bool relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel,
List *restrictlist,
List *exprlist, List *oprlist);
+extern bool indexcol_is_bool_constant_for_query(IndexOptInfo *index,
+ int indexcol);
extern bool match_index_to_operand(Node *operand, int indexcol,
IndexOptInfo *index);
extern void expand_indexqual_conditions(IndexOptInfo *index,
@@ -177,11 +184,13 @@ extern PathKeysComparison compare_pathkeys(List *keys1, List *keys2);
extern bool pathkeys_contained_in(List *keys1, List *keys2);
extern Path *get_cheapest_path_for_pathkeys(List *paths, List *pathkeys,
Relids required_outer,
- CostSelector cost_criterion);
+ CostSelector cost_criterion,
+ bool require_parallel_safe);
extern Path *get_cheapest_fractional_path_for_pathkeys(List *paths,
List *pathkeys,
Relids required_outer,
double fraction);
+extern Path *get_cheapest_parallel_safe_total_inner(List *paths);
extern List *build_index_pathkeys(PlannerInfo *root, IndexOptInfo *index,
ScanDirection scandir);
extern List *build_expression_pathkey(PlannerInfo *root, Expr *expr,
diff --git a/src/include/optimizer/placeholder.h b/src/include/optimizer/placeholder.h
index 54d0216ef8..11e6403aa3 100644
--- a/src/include/optimizer/placeholder.h
+++ b/src/include/optimizer/placeholder.h
@@ -4,7 +4,7 @@
* prototypes for optimizer/util/placeholder.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/placeholder.h
diff --git a/src/include/optimizer/plancat.h b/src/include/optimizer/plancat.h
index 125274e490..68fd713b09 100644
--- a/src/include/optimizer/plancat.h
+++ b/src/include/optimizer/plancat.h
@@ -4,7 +4,7 @@
* prototypes for plancat.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/plancat.h
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 7f96df0beb..4ef9ddb2ba 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/planmain.h
@@ -97,6 +97,7 @@ extern void process_implied_equality(PlannerInfo *root,
Expr *item2,
Relids qualscope,
Relids nullable_relids,
+ Index security_level,
bool below_outer_join,
bool both_const);
extern RestrictInfo *build_implied_join_equality(Oid opno,
@@ -104,15 +105,20 @@ extern RestrictInfo *build_implied_join_equality(Oid opno,
Expr *item1,
Expr *item2,
Relids qualscope,
- Relids nullable_relids);
+ Relids nullable_relids,
+ Index security_level);
extern void match_foreign_keys_to_quals(PlannerInfo *root);
/*
* prototypes for plan/analyzejoins.c
*/
extern List *remove_useless_joins(PlannerInfo *root, List *joinlist);
+extern void reduce_unique_semijoins(PlannerInfo *root);
extern bool query_supports_distinctness(Query *query);
extern bool query_is_distinct_for(Query *query, List *colnos, List *opids);
+extern bool innerrel_is_unique(PlannerInfo *root,
+ Relids outerrelids, RelOptInfo *innerrel,
+ JoinType jointype, List *restrictlist, bool force_cache);
/*
* prototypes for plan/setrefs.c
diff --git a/src/include/optimizer/planner.h b/src/include/optimizer/planner.h
index a623b9a009..99ddafb4f3 100644
--- a/src/include/optimizer/planner.h
+++ b/src/include/optimizer/planner.h
@@ -4,7 +4,7 @@
* prototypes for planner.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/planner.h
@@ -61,4 +61,6 @@ extern Expr *preprocess_phv_expression(PlannerInfo *root, Expr *expr);
extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
+extern List *get_partitioned_child_rels(PlannerInfo *root, Index rti);
+
#endif /* PLANNER_H */
diff --git a/src/include/optimizer/predtest.h b/src/include/optimizer/predtest.h
index f0a1c12c14..658a86cc15 100644
--- a/src/include/optimizer/predtest.h
+++ b/src/include/optimizer/predtest.h
@@ -4,7 +4,7 @@
* prototypes for predtest.c
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/predtest.h
diff --git a/src/include/optimizer/prep.h b/src/include/optimizer/prep.h
index fb35b689bb..2b20b36f74 100644
--- a/src/include/optimizer/prep.h
+++ b/src/include/optimizer/prep.h
@@ -4,7 +4,7 @@
* prototypes for files in optimizer/prep/
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/prep.h
@@ -36,11 +36,6 @@ extern Node *negate_clause(Node *node);
extern Expr *canonicalize_qual(Expr *qual);
/*
- * prototypes for prepsecurity.c
- */
-extern void expand_security_quals(PlannerInfo *root, List *tlist);
-
-/*
* prototypes for preptlist.c
*/
extern List *preprocess_targetlist(PlannerInfo *root, List *tlist);
diff --git a/src/include/optimizer/restrictinfo.h b/src/include/optimizer/restrictinfo.h
index fa8a5b145b..31b9a79285 100644
--- a/src/include/optimizer/restrictinfo.h
+++ b/src/include/optimizer/restrictinfo.h
@@ -4,7 +4,7 @@
* prototypes for restrictinfo.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/restrictinfo.h
@@ -19,20 +19,20 @@
/* Convenience macro for the common case of a valid-everywhere qual */
#define make_simple_restrictinfo(clause) \
- make_restrictinfo(clause, true, false, false, NULL, NULL, NULL)
+ make_restrictinfo(clause, true, false, false, 0, NULL, NULL, NULL)
extern RestrictInfo *make_restrictinfo(Expr *clause,
bool is_pushed_down,
bool outerjoin_delayed,
bool pseudoconstant,
+ Index security_level,
Relids required_relids,
Relids outer_relids,
Relids nullable_relids);
-extern List *make_restrictinfos_from_actual_clauses(PlannerInfo *root,
- List *clause_list);
extern bool restriction_is_or_clause(RestrictInfo *restrictinfo);
+extern bool restriction_is_securely_promotable(RestrictInfo *restrictinfo,
+ RelOptInfo *rel);
extern List *get_actual_clauses(List *restrictinfo_list);
-extern List *get_all_actual_clauses(List *restrictinfo_list);
extern List *extract_actual_clauses(List *restrictinfo_list,
bool pseudoconstant);
extern void extract_actual_join_clauses(List *restrictinfo_list,
diff --git a/src/include/optimizer/subselect.h b/src/include/optimizer/subselect.h
index f100d02940..56dc237b51 100644
--- a/src/include/optimizer/subselect.h
+++ b/src/include/optimizer/subselect.h
@@ -2,7 +2,7 @@
*
* subselect.h
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/subselect.h
diff --git a/src/include/optimizer/tlist.h b/src/include/optimizer/tlist.h
index 0d745a0891..ccb93d8c80 100644
--- a/src/include/optimizer/tlist.h
+++ b/src/include/optimizer/tlist.h
@@ -4,7 +4,7 @@
* prototypes for tlist.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/tlist.h
@@ -17,8 +17,8 @@
#include "nodes/relation.h"
-extern TargetEntry *tlist_member(Node *node, List *targetlist);
-extern TargetEntry *tlist_member_ignore_relabel(Node *node, List *targetlist);
+extern TargetEntry *tlist_member(Expr *node, List *targetlist);
+extern TargetEntry *tlist_member_ignore_relabel(Expr *node, List *targetlist);
extern List *add_to_flat_tlist(List *tlist, List *exprs);
@@ -61,6 +61,9 @@ extern void add_column_to_pathtarget(PathTarget *target,
extern void add_new_column_to_pathtarget(PathTarget *target, Expr *expr);
extern void add_new_columns_to_pathtarget(PathTarget *target, List *exprs);
extern void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target);
+extern void split_pathtarget_at_srfs(PlannerInfo *root,
+ PathTarget *target, PathTarget *input_target,
+ List **targets, List **targets_contain_srfs);
/* Convenience macro to get a PathTarget with valid cost/width fields */
#define create_pathtarget(root, tlist) \
diff --git a/src/include/optimizer/var.h b/src/include/optimizer/var.h
index 463e75b828..ae1f856933 100644
--- a/src/include/optimizer/var.h
+++ b/src/include/optimizer/var.h
@@ -4,7 +4,7 @@
* prototypes for optimizer/util/var.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/var.h
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index 6e3c47daff..2c14b1e1af 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/analyze.h
@@ -23,19 +23,20 @@ typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,
extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook;
-extern Query *parse_analyze(Node *parseTree, const char *sourceText,
- Oid *paramTypes, int numParams);
-extern Query *parse_analyze_varparams(Node *parseTree, const char *sourceText,
+extern Query *parse_analyze(RawStmt *parseTree, const char *sourceText,
+ Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);
+extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
Oid **paramTypes, int *numParams);
extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState,
CommonTableExpr *parentCTE,
- bool locked_from_parent);
+ bool locked_from_parent,
+ bool resolve_unknowns);
-extern Query *transformTopLevelStmt(ParseState *pstate, Node *parseTree);
+extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
extern Query *transformStmt(ParseState *pstate, Node *parseTree);
-extern bool analyze_requires_snapshot(Node *parseTree);
+extern bool analyze_requires_snapshot(RawStmt *parseTree);
extern const char *LCS_asString(LockClauseStrength strength);
extern void CheckSelectLocking(Query *qry, LockClauseStrength strength);
diff --git a/src/include/parser/gramparse.h b/src/include/parser/gramparse.h
index 14e5de1352..a8c267a28c 100644
--- a/src/include/parser/gramparse.h
+++ b/src/include/parser/gramparse.h
@@ -8,7 +8,7 @@
* Definitions that are needed outside the core parser should be in parser.h.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/gramparse.h
diff --git a/src/include/parser/kwlist.h b/src/include/parser/kwlist.h
index ca265b4de2..d10017583d 100644
--- a/src/include/parser/kwlist.h
+++ b/src/include/parser/kwlist.h
@@ -7,7 +7,7 @@
* by the PG_KEYWORD macro, which is not defined in this file; it can
* be defined by the caller for special purposes.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -50,6 +50,7 @@ PG_KEYWORD("assertion", ASSERTION, UNRESERVED_KEYWORD)
PG_KEYWORD("assignment", ASSIGNMENT, UNRESERVED_KEYWORD)
PG_KEYWORD("asymmetric", ASYMMETRIC, RESERVED_KEYWORD)
PG_KEYWORD("at", AT, UNRESERVED_KEYWORD)
+PG_KEYWORD("attach", ATTACH, UNRESERVED_KEYWORD)
PG_KEYWORD("attribute", ATTRIBUTE, UNRESERVED_KEYWORD)
PG_KEYWORD("authorization", AUTHORIZATION, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("backward", BACKWARD, UNRESERVED_KEYWORD)
@@ -88,6 +89,7 @@ PG_KEYWORD("coalesce", COALESCE, COL_NAME_KEYWORD)
PG_KEYWORD("collate", COLLATE, RESERVED_KEYWORD)
PG_KEYWORD("collation", COLLATION, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("column", COLUMN, RESERVED_KEYWORD)
+PG_KEYWORD("columns", COLUMNS, UNRESERVED_KEYWORD)
PG_KEYWORD("comment", COMMENT, UNRESERVED_KEYWORD)
PG_KEYWORD("comments", COMMENTS, UNRESERVED_KEYWORD)
PG_KEYWORD("commit", COMMIT, UNRESERVED_KEYWORD)
@@ -135,6 +137,7 @@ PG_KEYWORD("delimiter", DELIMITER, UNRESERVED_KEYWORD)
PG_KEYWORD("delimiters", DELIMITERS, UNRESERVED_KEYWORD)
PG_KEYWORD("depends", DEPENDS, UNRESERVED_KEYWORD)
PG_KEYWORD("desc", DESC, RESERVED_KEYWORD)
+PG_KEYWORD("detach", DETACH, UNRESERVED_KEYWORD)
PG_KEYWORD("dictionary", DICTIONARY, UNRESERVED_KEYWORD)
PG_KEYWORD("direct", DIRECT, UNRESERVED_KEYWORD)
PG_KEYWORD("disable", DISABLE_P, UNRESERVED_KEYWORD)
@@ -186,6 +189,7 @@ PG_KEYWORD("from", FROM, RESERVED_KEYWORD)
PG_KEYWORD("full", FULL, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("function", FUNCTION, UNRESERVED_KEYWORD)
PG_KEYWORD("functions", FUNCTIONS, UNRESERVED_KEYWORD)
+PG_KEYWORD("generated", GENERATED, UNRESERVED_KEYWORD)
PG_KEYWORD("global", GLOBAL, UNRESERVED_KEYWORD)
PG_KEYWORD("grant", GRANT, RESERVED_KEYWORD)
PG_KEYWORD("granted", GRANTED, UNRESERVED_KEYWORD)
@@ -266,6 +270,7 @@ PG_KEYWORD("names", NAMES, UNRESERVED_KEYWORD)
PG_KEYWORD("national", NATIONAL, COL_NAME_KEYWORD)
PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("nchar", NCHAR, COL_NAME_KEYWORD)
+PG_KEYWORD("new", NEW, UNRESERVED_KEYWORD)
PG_KEYWORD("next", NEXT, UNRESERVED_KEYWORD)
PG_KEYWORD("no", NO, UNRESERVED_KEYWORD)
#ifdef PGXC
@@ -286,6 +291,7 @@ PG_KEYWORD("of", OF, UNRESERVED_KEYWORD)
PG_KEYWORD("off", OFF, UNRESERVED_KEYWORD)
PG_KEYWORD("offset", OFFSET, RESERVED_KEYWORD)
PG_KEYWORD("oids", OIDS, UNRESERVED_KEYWORD)
+PG_KEYWORD("old", OLD, UNRESERVED_KEYWORD)
PG_KEYWORD("on", ON, RESERVED_KEYWORD)
PG_KEYWORD("only", ONLY, RESERVED_KEYWORD)
PG_KEYWORD("operator", OPERATOR, UNRESERVED_KEYWORD)
@@ -299,6 +305,7 @@ PG_KEYWORD("outer", OUTER_P, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("over", OVER, UNRESERVED_KEYWORD)
PG_KEYWORD("overlaps", OVERLAPS, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("overlay", OVERLAY, COL_NAME_KEYWORD)
+PG_KEYWORD("overriding", OVERRIDING, UNRESERVED_KEYWORD)
PG_KEYWORD("owned", OWNED, UNRESERVED_KEYWORD)
PG_KEYWORD("owner", OWNER, UNRESERVED_KEYWORD)
PG_KEYWORD("parallel", PARALLEL, UNRESERVED_KEYWORD)
@@ -328,6 +335,7 @@ PG_KEYWORD("privileges", PRIVILEGES, UNRESERVED_KEYWORD)
PG_KEYWORD("procedural", PROCEDURAL, UNRESERVED_KEYWORD)
PG_KEYWORD("procedure", PROCEDURE, UNRESERVED_KEYWORD)
PG_KEYWORD("program", PROGRAM, UNRESERVED_KEYWORD)
+PG_KEYWORD("publication", PUBLICATION, UNRESERVED_KEYWORD)
PG_KEYWORD("quote", QUOTE, UNRESERVED_KEYWORD)
#ifdef PGXC
PG_KEYWORD("randomly", RANDOMLY, UNRESERVED_KEYWORD)
@@ -340,6 +348,7 @@ PG_KEYWORD("recheck", RECHECK, UNRESERVED_KEYWORD)
PG_KEYWORD("recursive", RECURSIVE, UNRESERVED_KEYWORD)
PG_KEYWORD("ref", REF, UNRESERVED_KEYWORD)
PG_KEYWORD("references", REFERENCES, RESERVED_KEYWORD)
+PG_KEYWORD("referencing", REFERENCING, UNRESERVED_KEYWORD)
PG_KEYWORD("refresh", REFRESH, UNRESERVED_KEYWORD)
PG_KEYWORD("reindex", REINDEX, UNRESERVED_KEYWORD)
PG_KEYWORD("relative", RELATIVE_P, UNRESERVED_KEYWORD)
@@ -363,6 +372,7 @@ PG_KEYWORD("rows", ROWS, UNRESERVED_KEYWORD)
PG_KEYWORD("rule", RULE, UNRESERVED_KEYWORD)
PG_KEYWORD("savepoint", SAVEPOINT, UNRESERVED_KEYWORD)
PG_KEYWORD("schema", SCHEMA, UNRESERVED_KEYWORD)
+PG_KEYWORD("schemas", SCHEMAS, UNRESERVED_KEYWORD)
PG_KEYWORD("scroll", SCROLL, UNRESERVED_KEYWORD)
PG_KEYWORD("search", SEARCH, UNRESERVED_KEYWORD)
PG_KEYWORD("second", SECOND_P, UNRESERVED_KEYWORD)
@@ -396,6 +406,7 @@ PG_KEYWORD("stdout", STDOUT, UNRESERVED_KEYWORD)
PG_KEYWORD("storage", STORAGE, UNRESERVED_KEYWORD)
PG_KEYWORD("strict", STRICT_P, UNRESERVED_KEYWORD)
PG_KEYWORD("strip", STRIP_P, UNRESERVED_KEYWORD)
+PG_KEYWORD("subscription", SUBSCRIPTION, UNRESERVED_KEYWORD)
PG_KEYWORD("substring", SUBSTRING, COL_NAME_KEYWORD)
PG_KEYWORD("symmetric", SYMMETRIC, RESERVED_KEYWORD)
PG_KEYWORD("sysid", SYSID, UNRESERVED_KEYWORD)
@@ -468,10 +479,12 @@ PG_KEYWORD("xmlconcat", XMLCONCAT, COL_NAME_KEYWORD)
PG_KEYWORD("xmlelement", XMLELEMENT, COL_NAME_KEYWORD)
PG_KEYWORD("xmlexists", XMLEXISTS, COL_NAME_KEYWORD)
PG_KEYWORD("xmlforest", XMLFOREST, COL_NAME_KEYWORD)
+PG_KEYWORD("xmlnamespaces", XMLNAMESPACES, COL_NAME_KEYWORD)
PG_KEYWORD("xmlparse", XMLPARSE, COL_NAME_KEYWORD)
PG_KEYWORD("xmlpi", XMLPI, COL_NAME_KEYWORD)
PG_KEYWORD("xmlroot", XMLROOT, COL_NAME_KEYWORD)
PG_KEYWORD("xmlserialize", XMLSERIALIZE, COL_NAME_KEYWORD)
+PG_KEYWORD("xmltable", XMLTABLE, COL_NAME_KEYWORD)
PG_KEYWORD("year", YEAR_P, UNRESERVED_KEYWORD)
PG_KEYWORD("yes", YES_P, UNRESERVED_KEYWORD)
PG_KEYWORD("zone", ZONE, UNRESERVED_KEYWORD)
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index 2c81da6c58..0ec3bc2e24 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -4,7 +4,7 @@
* handle aggregates and window functions in parser
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_agg.h
diff --git a/src/include/parser/parse_clause.h b/src/include/parser/parse_clause.h
index d04ce1125c..823138f6c0 100644
--- a/src/include/parser/parse_clause.h
+++ b/src/include/parser/parse_clause.h
@@ -4,7 +4,7 @@
* handle clauses in parser
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_clause.h
@@ -19,7 +19,6 @@
extern void transformFromClause(ParseState *pstate, List *frmList);
extern int setTargetTable(ParseState *pstate, RangeVar *relation,
bool inh, bool alsoSource, AclMode requiredPerms);
-extern bool interpretInhOption(InhOption inhOpt);
extern bool interpretOidsOption(List *defList, bool allowOids);
extern Node *transformWhereClause(ParseState *pstate, Node *clause,
@@ -32,7 +31,7 @@ extern List *transformGroupClause(ParseState *pstate, List *grouplist,
ParseExprKind exprKind, bool useSQL99);
extern List *transformSortClause(ParseState *pstate, List *orderlist,
List **targetlist, ParseExprKind exprKind,
- bool resolveUnknown, bool useSQL99);
+ bool useSQL99);
extern List *transformWindowDefinitions(ParseState *pstate,
List *windowdefs,
@@ -48,8 +47,7 @@ extern void transformOnConflictArbiter(ParseState *pstate,
Oid *constraint);
extern List *addTargetToSortList(ParseState *pstate, TargetEntry *tle,
- List *sortlist, List *targetlist, SortBy *sortby,
- bool resolveUnknown);
+ List *sortlist, List *targetlist, SortBy *sortby);
extern Index assignSortGroupRef(TargetEntry *tle, List *tlist);
extern bool targetIsInSortList(TargetEntry *tle, Oid sortop, List *sortList);
diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h
index 66519e67a2..3eed81966d 100644
--- a/src/include/parser/parse_coerce.h
+++ b/src/include/parser/parse_coerce.h
@@ -4,7 +4,7 @@
* Routines for type coercion.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_coerce.h
@@ -58,6 +58,10 @@ extern Node *coerce_to_specific_type(ParseState *pstate, Node *node,
Oid targetTypeId,
const char *constructName);
+extern Node *coerce_to_specific_type_typmod(ParseState *pstate, Node *node,
+ Oid targetTypeId, int32 targetTypmod,
+ const char *constructName);
+
extern int parser_coercion_errposition(ParseState *pstate,
int coerce_location,
Node *input_expr);
diff --git a/src/include/parser/parse_collate.h b/src/include/parser/parse_collate.h
index d1b599777b..e42971dfde 100644
--- a/src/include/parser/parse_collate.h
+++ b/src/include/parser/parse_collate.h
@@ -4,7 +4,7 @@
* Routines for assigning collation information.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_collate.h
diff --git a/src/include/parser/parse_cte.h b/src/include/parser/parse_cte.h
index 11a16ffa1c..9130612312 100644
--- a/src/include/parser/parse_cte.h
+++ b/src/include/parser/parse_cte.h
@@ -4,7 +4,7 @@
* handle CTEs (common table expressions) in parser
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_cte.h
diff --git a/src/include/parser/parse_enr.h b/src/include/parser/parse_enr.h
new file mode 100644
index 0000000000..48a7576f2c
--- /dev/null
+++ b/src/include/parser/parse_enr.h
@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ *
+ * parse_enr.h
+ * Internal definitions for parser
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/parser/parse_enr.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PARSE_ENR_H
+#define PARSE_ENR_H
+
+#include "parser/parse_node.h"
+
+extern bool name_matches_visible_ENR(ParseState *pstate, const char *refname);
+extern EphemeralNamedRelationMetadata get_visible_ENR(ParseState *pstate, const char *refname);
+
+#endif /* PARSE_ENR_H */
diff --git a/src/include/parser/parse_expr.h b/src/include/parser/parse_expr.h
index 539b6058e2..2101eaefda 100644
--- a/src/include/parser/parse_expr.h
+++ b/src/include/parser/parse_expr.h
@@ -3,7 +3,7 @@
* parse_expr.h
* handle expressions in parser
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_expr.h
diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h
index e8ff93058d..e0dad6ac10 100644
--- a/src/include/parser/parse_func.h
+++ b/src/include/parser/parse_func.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_func.h
@@ -62,10 +62,12 @@ extern const char *func_signature_string(List *funcname, int nargs,
extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
bool noError);
-extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
- bool noError);
-extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
- bool noError);
+extern Oid LookupFuncWithArgs(ObjectWithArgs *func,
+ bool noError);
+extern Oid LookupAggWithArgs(ObjectWithArgs *agg,
+ bool noError);
+
+extern void check_srf_call_placement(ParseState *pstate, int location);
extern void check_pg_get_expr_args(ParseState *pstate, Oid fnoid, List *args);
#endif /* PARSE_FUNC_H */
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h
index e3e359c021..0b54840e29 100644
--- a/src/include/parser/parse_node.h
+++ b/src/include/parser/parse_node.h
@@ -4,7 +4,7 @@
* Internal definitions for parser
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_node.h
@@ -15,6 +15,7 @@
#define PARSE_NODE_H
#include "nodes/parsenodes.h"
+#include "utils/queryenvironment.h"
#include "utils/relcache.h"
@@ -27,7 +28,7 @@
* by extension code that might need to call transformExpr(). The core code
* will not enforce any context-driven restrictions on EXPR_KIND_OTHER
* expressions, so the caller would have to check for sub-selects, aggregates,
- * and window functions if those need to be disallowed.
+ * window functions, SRFs, etc if those need to be disallowed.
*/
typedef enum ParseExprKind
{
@@ -55,6 +56,7 @@ typedef enum ParseExprKind
EXPR_KIND_OFFSET, /* OFFSET */
EXPR_KIND_RETURNING, /* RETURNING */
EXPR_KIND_VALUES, /* VALUES */
+ EXPR_KIND_VALUES_SINGLE, /* single-row VALUES (in INSERT only) */
EXPR_KIND_CHECK_CONSTRAINT, /* CHECK constraint for a table */
EXPR_KIND_DOMAIN_CHECK, /* CHECK constraint for a domain */
EXPR_KIND_COLUMN_DEFAULT, /* default value for a table column */
@@ -64,7 +66,8 @@ typedef enum ParseExprKind
EXPR_KIND_ALTER_COL_TRANSFORM, /* transform expr in ALTER COLUMN TYPE */
EXPR_KIND_EXECUTE_PARAMETER, /* parameter value in EXECUTE */
EXPR_KIND_TRIGGER_WHEN, /* WHEN condition in CREATE TRIGGER */
- EXPR_KIND_POLICY /* USING or WITH CHECK expr in policy */
+ EXPR_KIND_POLICY, /* USING or WITH CHECK expr in policy */
+ EXPR_KIND_PARTITION_EXPRESSION /* PARTITION BY expression */
} ParseExprKind;
@@ -122,11 +125,42 @@ typedef Node *(*CoerceParamHook) (ParseState *pstate, Param *param,
* p_parent_cte: CommonTableExpr that immediately contains the current query,
* if any.
*
+ * p_target_relation: target relation, if query is INSERT, UPDATE, or DELETE.
+ *
+ * p_target_rangetblentry: target relation's entry in the rtable list.
+ *
+ * p_is_insert: true to process assignment expressions like INSERT, false
+ * to process them like UPDATE. (Note this can change intra-statement, for
+ * cases like INSERT ON CONFLICT UPDATE.)
+ *
* p_windowdefs: list of WindowDefs representing WINDOW and OVER clauses.
* We collect these while transforming expressions and then transform them
* afterwards (so that any resjunk tlist items needed for the sort/group
* clauses end up at the end of the query tlist). A WindowDef's location in
* this list, counting from 1, is the winref number to use to reference it.
+ *
+ * p_expr_kind: kind of expression we're currently parsing, as per enum above;
+ * EXPR_KIND_NONE when not in an expression.
+ *
+ * p_next_resno: next TargetEntry.resno to assign, starting from 1.
+ *
+ * p_multiassign_exprs: partially-processed MultiAssignRef source expressions.
+ *
+ * p_locking_clause: query's FOR UPDATE/FOR SHARE clause, if any.
+ *
+ * p_locked_from_parent: true if parent query level applies FOR UPDATE/SHARE
+ * to this subquery as a whole.
+ *
+ * p_resolve_unknowns: resolve unknown-type SELECT output columns as type TEXT
+ * (this is true by default).
+ *
+ * p_hasAggs, p_hasWindowFuncs, etc: true if we've found any of the indicated
+ * constructs in the query.
+ *
+ * p_pre_columnref_hook, etc: optional parser hook functions for modifying the
+ * interpretation of ColumnRefs and ParamRefs.
+ *
+ * p_ref_hook_state: passthrough state for the parser hook functions.
*/
struct ParseState
{
@@ -142,20 +176,28 @@ struct ParseState
List *p_ctenamespace; /* current namespace for common table exprs */
List *p_future_ctes; /* common table exprs not yet in namespace */
CommonTableExpr *p_parent_cte; /* this query's containing CTE */
+ Relation p_target_relation; /* INSERT/UPDATE/DELETE target rel */
+ RangeTblEntry *p_target_rangetblentry; /* target rel's RTE */
+ bool p_is_insert; /* process assignment like INSERT not UPDATE */
List *p_windowdefs; /* raw representations of window clauses */
ParseExprKind p_expr_kind; /* what kind of expression we're parsing */
int p_next_resno; /* next targetlist resno to assign */
List *p_multiassign_exprs; /* junk tlist entries for multiassign */
List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */
- Node *p_value_substitute; /* what to replace VALUE with, if any */
+ bool p_locked_from_parent; /* parent has marked this subquery
+ * with FOR UPDATE/FOR SHARE */
+ bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs
+ * as type text */
+
+ QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing
+ * env */
+
+ /* Flags telling about things found in the query: */
bool p_hasAggs;
bool p_hasWindowFuncs;
+ bool p_hasTargetSRFs;
bool p_hasSubLinks;
bool p_hasModifyingCTE;
- bool p_is_insert;
- bool p_locked_from_parent;
- Relation p_target_relation;
- RangeTblEntry *p_target_rangetblentry;
/*
* Optional hook functions for parser callbacks. These are null unless
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h
index 03bb5b9a14..d783b37f0f 100644
--- a/src/include/parser/parse_oper.h
+++ b/src/include/parser/parse_oper.h
@@ -4,7 +4,7 @@
* handle operator things for parser
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_oper.h
@@ -15,6 +15,7 @@
#define PARSE_OPER_H
#include "access/htup.h"
+#include "nodes/parsenodes.h"
#include "parser/parse_node.h"
@@ -24,9 +25,7 @@ typedef HeapTuple Operator;
extern Oid LookupOperName(ParseState *pstate, List *opername,
Oid oprleft, Oid oprright,
bool noError, int location);
-extern Oid LookupOperNameTypeNames(ParseState *pstate, List *opername,
- TypeName *oprleft, TypeName *oprright,
- bool noError, int location);
+extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
/* Routines to find operators matching a name and given input types */
/* NB: the selected operator may require coercion of the input types! */
diff --git a/src/include/parser/parse_param.h b/src/include/parser/parse_param.h
index bbf608a2a9..68f3ddaffa 100644
--- a/src/include/parser/parse_param.h
+++ b/src/include/parser/parse_param.h
@@ -3,7 +3,7 @@
* parse_param.h
* handle parameters in parser
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_param.h
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index 997c2ff4d5..4eece2bf8d 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -4,7 +4,7 @@
* prototypes for parse_relation.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_relation.h
@@ -42,6 +42,7 @@ extern RangeTblEntry *refnameRangeTblEntry(ParseState *pstate,
extern CommonTableExpr *scanNameSpaceForCTE(ParseState *pstate,
const char *refname,
Index *ctelevelsup);
+extern bool scanNameSpaceForENR(ParseState *pstate, const char *refname);
extern void checkNameSpaceConflicts(ParseState *pstate, List *namespace1,
List *namespace2);
extern int RTERangeTablePosn(ParseState *pstate,
@@ -85,10 +86,17 @@ extern RangeTblEntry *addRangeTableEntryForFunction(ParseState *pstate,
bool inFromCl);
extern RangeTblEntry *addRangeTableEntryForValues(ParseState *pstate,
List *exprs,
- List *collations,
+ List *coltypes,
+ List *coltypmods,
+ List *colcollations,
Alias *alias,
bool lateral,
bool inFromCl);
+extern RangeTblEntry *addRangeTableEntryForTableFunc(ParseState *pstate,
+ TableFunc *tf,
+ Alias *alias,
+ bool lateral,
+ bool inFromCl);
extern RangeTblEntry *addRangeTableEntryForJoin(ParseState *pstate,
List *colnames,
JoinType jointype,
@@ -100,6 +108,9 @@ extern RangeTblEntry *addRangeTableEntryForCTE(ParseState *pstate,
Index levelsup,
RangeVar *rv,
bool inFromCl);
+extern RangeTblEntry *addRangeTableEntryForENR(ParseState *pstate,
+ RangeVar *rv,
+ bool inFromCl);
extern bool isLockedRefname(ParseState *pstate, const char *refname);
extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte,
bool addToJoinList,
diff --git a/src/include/parser/parse_target.h b/src/include/parser/parse_target.h
index 8d4ad60026..d06a235df0 100644
--- a/src/include/parser/parse_target.h
+++ b/src/include/parser/parse_target.h
@@ -4,7 +4,7 @@
* handle target lists
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_target.h
@@ -20,7 +20,8 @@
extern List *transformTargetList(ParseState *pstate, List *targetlist,
ParseExprKind exprKind);
extern List *transformExpressionList(ParseState *pstate, List *exprlist,
- ParseExprKind exprKind);
+ ParseExprKind exprKind, bool allowDefault);
+extern void resolveTargetListUnknowns(ParseState *pstate, List *targetlist);
extern void markTargetListOrigins(ParseState *pstate, List *targetlist);
extern TargetEntry *transformTargetEntry(ParseState *pstate,
Node *node, Node *expr, ParseExprKind exprKind,
diff --git a/src/include/parser/parse_type.h b/src/include/parser/parse_type.h
index ba580beda3..db0cd56ecc 100644
--- a/src/include/parser/parse_type.h
+++ b/src/include/parser/parse_type.h
@@ -3,7 +3,7 @@
* parse_type.h
* handle type operations for parser
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parse_type.h
diff --git a/src/include/parser/parse_utilcmd.h b/src/include/parser/parse_utilcmd.h
index f4497d6cea..c3cdf7158c 100644
--- a/src/include/parser/parse_utilcmd.h
+++ b/src/include/parser/parse_utilcmd.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -35,5 +35,7 @@ extern List *transformCreateSchemaStmt(CreateSchemaStmt *stmt);
#ifdef PGXC
extern bool CheckLocalIndexColumn (char loctype, char *partcolname, char *indexcolname);
#endif
+extern PartitionBoundSpec *transformPartitionBound(ParseState *pstate, Relation parent,
+ PartitionBoundSpec *spec);
#endif /* PARSE_UTILCMD_H */
diff --git a/src/include/parser/parser.h b/src/include/parser/parser.h
index 6259af86e1..cce7844457 100644
--- a/src/include/parser/parser.h
+++ b/src/include/parser/parser.h
@@ -5,7 +5,7 @@
*
* This is the external API for the raw lexing/parsing functions.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parser.h
diff --git a/src/include/parser/parsetree.h b/src/include/parser/parsetree.h
index 465989b526..951ff0a254 100644
--- a/src/include/parser/parsetree.h
+++ b/src/include/parser/parsetree.h
@@ -5,7 +5,7 @@
* parse trees.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/parsetree.h
diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h
index d216225844..597ff17078 100644
--- a/src/include/parser/scanner.h
+++ b/src/include/parser/scanner.h
@@ -3,12 +3,12 @@
* scanner.h
* API for the core scanner (flex machine)
*
- * The core scanner is also used by PL/pgsql, so we provide a public API
+ * The core scanner is also used by PL/pgSQL, so we provide a public API
* for it. However, the rest of the backend is only expected to use the
* higher-level API provided by parser.h.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/scanner.h
diff --git a/src/include/parser/scansup.h b/src/include/parser/scansup.h
index 7f482b6067..3464eb4c0e 100644
--- a/src/include/parser/scansup.h
+++ b/src/include/parser/scansup.h
@@ -4,7 +4,7 @@
* scanner support routines. used by both the bootstrap lexer
* as well as the normal lexer
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/parser/scansup.h
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index a4e5e9ebb3..8826a4666a 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -84,24 +84,42 @@
/* Define to 1 if you have the `append_history' function. */
#undef HAVE_APPEND_HISTORY
+/* Define to 1 if you have the `ASN1_STRING_get0_data' function. */
+#undef HAVE_ASN1_STRING_GET0_DATA
+
/* Define to 1 if you want to use atomics if available. */
#undef HAVE_ATOMICS
/* Define to 1 if you have the <atomic.h> header file. */
#undef HAVE_ATOMIC_H
+/* Define to 1 if you have the `BIO_get_data' function. */
+#undef HAVE_BIO_GET_DATA
+
+/* Define to 1 if you have the `BIO_meth_new' function. */
+#undef HAVE_BIO_METH_NEW
+
/* Define to 1 if you have the `cbrt' function. */
#undef HAVE_CBRT
/* Define to 1 if you have the `class' function. */
#undef HAVE_CLASS
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if your compiler handles computed gotos. */
+#undef HAVE_COMPUTED_GOTO
+
/* Define to 1 if you have the <crtdefs.h> header file. */
#undef HAVE_CRTDEFS_H
/* Define to 1 if you have the `crypt' function. */
#undef HAVE_CRYPT
+/* Define to 1 if you have the `CRYPTO_lock' function. */
+#undef HAVE_CRYPTO_LOCK
+
/* Define to 1 if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H
@@ -355,15 +373,15 @@
/* Define to 1 if you have the `mkdtemp' function. */
#undef HAVE_MKDTEMP
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#undef HAVE_NETINET_TCP_H
/* Define to 1 if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
+/* Define to 1 if you have the `OPENSSL_init_ssl' function. */
+#undef HAVE_OPENSSL_INIT_SSL
+
/* Define to 1 if you have the <ossp/uuid.h> header file. */
#undef HAVE_OSSP_UUID_H
@@ -397,12 +415,12 @@
/* Have PTHREAD_PRIO_INHERIT. */
#undef HAVE_PTHREAD_PRIO_INHERIT
-/* Define to 1 if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
/* Define to 1 if you have the `random' function. */
#undef HAVE_RANDOM
+/* Define to 1 if you have the `RAND_OpenSSL' function. */
+#undef HAVE_RAND_OPENSSL
+
/* Define to 1 if you have the <readline.h> header file. */
#undef HAVE_READLINE_H
@@ -479,6 +497,9 @@
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
+/* Define to use have a strong random number source */
+#undef HAVE_STRONG_RANDOM
+
/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL
@@ -533,15 +554,9 @@
/* Define to 1 if you have the <sys/epoll.h> header file. */
#undef HAVE_SYS_EPOLL_H
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
/* Define to 1 if you have the <sys/ipc.h> header file. */
#undef HAVE_SYS_IPC_H
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#undef HAVE_SYS_POLL_H
-
/* Define to 1 if you have the <sys/pstat.h> header file. */
#undef HAVE_SYS_PSTAT_H
@@ -557,9 +572,6 @@
/* Define to 1 if you have the <sys/shm.h> header file. */
#undef HAVE_SYS_SHM_H
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
/* Define to 1 if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
@@ -569,9 +581,6 @@
/* Define to 1 if you have the <sys/tas.h> header file. */
#undef HAVE_SYS_TAS_H
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
@@ -591,9 +600,15 @@
/* Define to 1 if you have the `towlower' function. */
#undef HAVE_TOWLOWER
+/* Define to 1 if your compiler understands `typeof' or something similar. */
+#undef HAVE_TYPEOF
+
/* Define to 1 if you have the external array `tzname'. */
#undef HAVE_TZNAME
+/* Define to 1 if you have the `ucol_strcollUTF8' function. */
+#undef HAVE_UCOL_STRCOLLUTF8
+
/* Define to 1 if you have the <ucred.h> header file. */
#undef HAVE_UCRED_H
@@ -811,6 +826,9 @@
/* Define to 1 to build with BSD Authentication support. (--with-bsd-auth) */
#undef USE_BSD_AUTH
+/* Define to use /dev/urandom for random number generation */
+#undef USE_DEV_URANDOM
+
/* Define to 1 if you want float4 values to be passed by value.
(--enable-float4-byval) */
#undef USE_FLOAT4_BYVAL
@@ -819,9 +837,8 @@
(--enable-float8-byval) */
#undef USE_FLOAT8_BYVAL
-/* Define to 1 if you want 64-bit integer timestamp and interval support.
- (--enable-integer-datetimes) */
-#undef USE_INTEGER_DATETIMES
+/* Define to build with ICU support. (--with-icu) */
+#undef USE_ICU
/* Define to 1 to build with LDAP support. (--with-ldap) */
#undef USE_LDAP
@@ -839,6 +856,9 @@
/* Define to build with OpenSSL support. (--with-openssl) */
#undef USE_OPENSSL
+/* Define to use OpenSSL for random number generation */
+#undef USE_OPENSSL_RANDOM
+
/* Define to 1 to build with PAM support. (--with-pam) */
#undef USE_PAM
@@ -866,6 +886,9 @@
/* Define to select unnamed POSIX semaphores. */
#undef USE_UNNAMED_POSIX_SEMAPHORES
+/* Define to use native Windows API for random number generation */
+#undef USE_WIN32_RANDOM
+
/* Define to select Win32-style semaphores. */
#undef USE_WIN32_SEMAPHORES
@@ -923,6 +946,9 @@
/* Define to empty if the C compiler does not understand signed types. */
#undef signed
+/* Define to how the compiler spells `typeof'. */
+#undef typeof
+
/* Define to the type of an unsigned integer type wide enough to hold a
pointer, if such a type exists, and if the system does not define it. */
#undef uintptr_t
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index bb8cb3a5fb..f920e35664 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -75,6 +75,12 @@
/* Define to 1 if you have the `class' function. */
/* #undef HAVE_CLASS */
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if your compiler handles computed gotos. */
+/* #undef HAVE_COMPUTED_GOTO */
+
/* Define to 1 if you have the `crypt' function. */
/* #undef HAVE_CRYPT */
@@ -249,9 +255,6 @@
/* Define to 1 if you have the `mkdtemp' function. */
/* #undef HAVE_MKDTEMP */
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#define HAVE_NETINET_IN_H 1
-
/* Define to 1 if you have the <netinet/tcp.h> header file. */
/* #undef HAVE_NETINET_TCP_H */
@@ -270,9 +273,6 @@
/* Define to 1 if the PS_STRINGS thing exists. */
/* #undef HAVE_PS_STRINGS */
-/* Define to 1 if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
/* Define to 1 if you have the `random' function. */
/* #undef HAVE_RANDOM */
@@ -348,6 +348,9 @@
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
+/* Define to use have a strong random number source */
+#define HAVE_STRONG_RANDOM 1
+
/* Define to 1 if you have the `strtoll' function. */
//#define HAVE_STRTOLL 1
@@ -414,9 +417,6 @@
/* Define to 1 if you have the <sys/ipc.h> header file. */
/* #undef HAVE_SYS_IPC_H */
-/* Define to 1 if you have the <sys/poll.h> header file. */
-/* #undef HAVE_SYS_POLL_H */
-
/* Define to 1 if you have the <sys/pstat.h> header file. */
/* #undef HAVE_SYS_PSTAT_H */
@@ -429,15 +429,9 @@
/* Define to 1 if you have the <sys/shm.h> header file. */
/* #undef HAVE_SYS_SHM_H */
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
@@ -457,6 +451,9 @@
/* Define to 1 if you have the `towlower' function. */
#define HAVE_TOWLOWER 1
+/* Define to 1 if your compiler understands `typeof' or something similar. */
+/* #undef HAVE_TYPEOF */
+
/* Define to 1 if you have the external array `tzname'. */
/* #undef HAVE_TZNAME */
@@ -554,10 +551,10 @@
#define PACKAGE_NAME "Postgres-XL"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Postgres-XL 9.6alpha1"
+#define PACKAGE_STRING "Postgres-XL 10alpha1"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "9.6alpha1"
+#define PACKAGE_VERSION "10beta1"
/* Define to the name of a signed 128-bit integer type. */
#undef PG_INT128_TYPE
@@ -566,10 +563,10 @@
#define PG_INT64_TYPE long long int
/* PostgreSQL version as a string */
-#define PG_VERSION "9.6beta4"
+#define PG_VERSION "10beta1"
/* PostgreSQL version as a number */
-#define PG_VERSION_NUM 90600
+#define PG_VERSION_NUM 100000
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "postgres-xl"
@@ -625,9 +622,8 @@
/* Define to 1 to build with BSD Authentication support. (--with-bsd-auth) */
/* #undef USE_BSD_AUTH */
-/* Define to 1 if you want 64-bit integer timestamp and interval support.
- (--enable-integer-datetimes) */
-/* #undef USE_INTEGER_DATETIMES */
+/* Define to use /dev/urandom for random number generation */
+/* #undef USE_DEV_URANDOM */
/* Define to 1 to build with LDAP support. (--with-ldap) */
/* #undef USE_LDAP */
@@ -638,6 +634,9 @@
/* Define to build with OpenSSL support. (--with-openssl) */
/* #undef USE_OPENSSL */
+/* Define to use OpenSSL for random number generation */
+/* #undef USE_OPENSSL_RANDOM */
+
/* Define to 1 to build with PAM support. (--with-pam) */
/* #undef USE_PAM */
@@ -666,6 +665,9 @@
/* Define to select unnamed POSIX semaphores. */
/* #undef USE_UNNAMED_POSIX_SEMAPHORES */
+/* Define to use native Windows API for random number generation */
+#define USE_WIN32_RANDOM 1
+
/* Define to select Win32-style semaphores. */
#define USE_WIN32_SEMAPHORES 1
@@ -689,3 +691,6 @@
/* Define to empty if the C compiler does not understand signed types. */
/* #undef signed */
+
+/* Define to how the compiler spells `typeof'. */
+/* #undef typeof */
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index a2b2b614be..f3b35297d1 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -6,7 +6,7 @@
* for developers. If you edit any of these, be sure to do a *full*
* rebuild (and an initdb if noted).
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/pg_config_manual.h
@@ -46,10 +46,9 @@
#define INDEX_MAX_KEYS 32
/*
- * Set the upper and lower bounds of sequence values.
+ * Maximum number of columns in a partition key
*/
-#define SEQ_MAXVALUE PG_INT64_MAX
-#define SEQ_MINVALUE (-SEQ_MAXVALUE)
+#define PARTITION_MAX_KEYS 32
/*
* When we don't have native spinlocks, we use semaphores to simulate them.
@@ -148,6 +147,24 @@
#endif
/*
+ * Default and maximum values for backend_flush_after, bgwriter_flush_after
+ * and checkpoint_flush_after; measured in blocks. Currently, these are
+ * enabled by default if sync_file_range() exists, ie, only on Linux. Perhaps
+ * we could also enable by default if we have mmap and msync(MS_ASYNC)?
+ */
+#ifdef HAVE_SYNC_FILE_RANGE
+#define DEFAULT_BACKEND_FLUSH_AFTER 0 /* never enabled by default */
+#define DEFAULT_BGWRITER_FLUSH_AFTER 64
+#define DEFAULT_CHECKPOINT_FLUSH_AFTER 32
+#else
+#define DEFAULT_BACKEND_FLUSH_AFTER 0
+#define DEFAULT_BGWRITER_FLUSH_AFTER 0
+#define DEFAULT_CHECKPOINT_FLUSH_AFTER 0
+#endif
+/* upper limit for all three variables */
+#define WRITEBACK_MAX_PENDING_FLUSHES 256
+
+/*
* USE_SSL code should be compiled only when compiling with an SSL
* implementation. (Currently, only OpenSSL is supported, but we might add
* more implementations in the future.)
diff --git a/src/include/pg_getopt.h b/src/include/pg_getopt.h
index 82532d5b95..2e25576499 100644
--- a/src/include/pg_getopt.h
+++ b/src/include/pg_getopt.h
@@ -2,7 +2,7 @@
* Portions Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
- * Portions Copyright (c) 2003-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2003-2017, PostgreSQL Global Development Group
*
* src/include/pg_getopt.h
*/
diff --git a/src/include/pg_trace.h b/src/include/pg_trace.h
index 6bb73864e5..1fe95e6403 100644
--- a/src/include/pg_trace.h
+++ b/src/include/pg_trace.h
@@ -3,7 +3,7 @@
*
* Definitions for the PostgreSQL tracing framework
*
- * Copyright (c) 2006-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2006-2017, PostgreSQL Global Development Group
*
* src/include/pg_trace.h
* ----------
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index bace5c6bd1..5f58effe6c 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -4,7 +4,7 @@
* Definitions for the PostgreSQL statistics collector daemon.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Copyright (c) 2001-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2001-2017, PostgreSQL Global Development Group
*
* src/include/pgstat.h
* ----------
@@ -15,9 +15,9 @@
#include "datatype/timestamp.h"
#include "fmgr.h"
#include "libpq/pqcomm.h"
+#include "port/atomics.h"
#include "portability/instr_time.h"
#include "postmaster/pgarch.h"
-#include "storage/barrier.h"
#include "storage/proc.h"
#include "utils/hsearch.h"
#include "utils/relcache.h"
@@ -697,6 +697,25 @@ typedef struct PgStat_GlobalStats
/* ----------
+ * Backend types
+ * ----------
+ */
+typedef enum BackendType
+{
+ B_AUTOVAC_LAUNCHER,
+ B_AUTOVAC_WORKER,
+ B_BACKEND,
+ B_BG_WORKER,
+ B_BG_WRITER,
+ B_CHECKPOINTER,
+ B_STARTUP,
+ B_WAL_RECEIVER,
+ B_WAL_SENDER,
+ B_WAL_WRITER
+} BackendType;
+
+
+/* ----------
* Backend states
* ----------
*/
@@ -716,15 +735,177 @@ typedef enum BackendState
* Wait Classes
* ----------
*/
-typedef enum WaitClass
+#define PG_WAIT_LWLOCK 0x01000000U
+#define PG_WAIT_LOCK 0x03000000U
+#define PG_WAIT_BUFFER_PIN 0x04000000U
+#define PG_WAIT_ACTIVITY 0x05000000U
+#define PG_WAIT_CLIENT 0x06000000U
+#define PG_WAIT_EXTENSION 0x07000000U
+#define PG_WAIT_IPC 0x08000000U
+#define PG_WAIT_TIMEOUT 0x09000000U
+#define PG_WAIT_IO 0x0A000000U
+
+/* ----------
+ * Wait Events - Activity
+ *
+ * Use this category when a process is waiting because it has no work to do,
+ * unless the "Client" or "Timeout" category describes the situation better.
+ * Typically, this should only be used for background processes.
+ * ----------
+ */
+typedef enum
{
- WAIT_UNDEFINED,
- WAIT_LWLOCK_NAMED,
- WAIT_LWLOCK_TRANCHE,
- WAIT_LOCK,
- WAIT_BUFFER_PIN
-} WaitClass;
+ WAIT_EVENT_ARCHIVER_MAIN = PG_WAIT_ACTIVITY,
+ WAIT_EVENT_AUTOVACUUM_MAIN,
+ WAIT_EVENT_BGWRITER_HIBERNATE,
+ WAIT_EVENT_BGWRITER_MAIN,
+ WAIT_EVENT_CHECKPOINTER_MAIN,
+ WAIT_EVENT_PGSTAT_MAIN,
+ WAIT_EVENT_RECOVERY_WAL_ALL,
+ WAIT_EVENT_RECOVERY_WAL_STREAM,
+ WAIT_EVENT_SYSLOGGER_MAIN,
+ WAIT_EVENT_WAL_RECEIVER_MAIN,
+ WAIT_EVENT_WAL_SENDER_MAIN,
+ WAIT_EVENT_WAL_WRITER_MAIN,
+ WAIT_EVENT_LOGICAL_LAUNCHER_MAIN,
+ WAIT_EVENT_LOGICAL_APPLY_MAIN,
+ WAIT_EVENT_CLUSTER_MONITOR_MAIN
+} WaitEventActivity;
+/* ----------
+ * Wait Events - Client
+ *
+ * Use this category when a process is waiting to send data to or receive data
+ * from the frontend process to which it is connected. This is never used for
+ * a background process, which has no client connection.
+ * ----------
+ */
+typedef enum
+{
+ WAIT_EVENT_CLIENT_READ = PG_WAIT_CLIENT,
+ WAIT_EVENT_CLIENT_WRITE,
+ WAIT_EVENT_SSL_OPEN_SERVER,
+ WAIT_EVENT_WAL_RECEIVER_WAIT_START,
+ WAIT_EVENT_LIBPQWALRECEIVER,
+ WAIT_EVENT_WAL_SENDER_WAIT_WAL,
+ WAIT_EVENT_WAL_SENDER_WRITE_DATA
+} WaitEventClient;
+
+/* ----------
+ * Wait Events - IPC
+ *
+ * Use this category when a process cannot complete the work it is doing because
+ * it is waiting for a notification from another process.
+ * ----------
+ */
+typedef enum
+{
+ WAIT_EVENT_BGWORKER_SHUTDOWN = PG_WAIT_IPC,
+ WAIT_EVENT_BGWORKER_STARTUP,
+ WAIT_EVENT_BTREE_PAGE,
+ WAIT_EVENT_EXECUTE_GATHER,
+ WAIT_EVENT_MQ_INTERNAL,
+ WAIT_EVENT_MQ_PUT_MESSAGE,
+ WAIT_EVENT_MQ_RECEIVE,
+ WAIT_EVENT_MQ_SEND,
+ WAIT_EVENT_PARALLEL_FINISH,
+ WAIT_EVENT_PARALLEL_BITMAP_SCAN,
+ WAIT_EVENT_PROCARRAY_GROUP_UPDATE,
+ WAIT_EVENT_SAFE_SNAPSHOT,
+ WAIT_EVENT_SYNC_REP,
+ WAIT_EVENT_LOGICAL_SYNC_DATA,
+ WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE
+} WaitEventIPC;
+
+/* ----------
+ * Wait Events - Timeout
+ *
+ * Use this category when a process is waiting for a timeout to expire.
+ * ----------
+ */
+typedef enum
+{
+ WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT,
+ WAIT_EVENT_PG_SLEEP,
+ WAIT_EVENT_RECOVERY_APPLY_DELAY
+} WaitEventTimeout;
+
+/* ----------
+ * Wait Events - IO
+ *
+ * Use this category when a process is waiting for a IO.
+ * ----------
+ */
+typedef enum
+{
+ WAIT_EVENT_BUFFILE_READ = PG_WAIT_IO,
+ WAIT_EVENT_BUFFILE_WRITE,
+ WAIT_EVENT_CONTROL_FILE_READ,
+ WAIT_EVENT_CONTROL_FILE_SYNC,
+ WAIT_EVENT_CONTROL_FILE_SYNC_UPDATE,
+ WAIT_EVENT_CONTROL_FILE_WRITE,
+ WAIT_EVENT_CONTROL_FILE_WRITE_UPDATE,
+ WAIT_EVENT_COPY_FILE_READ,
+ WAIT_EVENT_COPY_FILE_WRITE,
+ WAIT_EVENT_DATA_FILE_EXTEND,
+ WAIT_EVENT_DATA_FILE_FLUSH,
+ WAIT_EVENT_DATA_FILE_IMMEDIATE_SYNC,
+ WAIT_EVENT_DATA_FILE_PREFETCH,
+ WAIT_EVENT_DATA_FILE_READ,
+ WAIT_EVENT_DATA_FILE_SYNC,
+ WAIT_EVENT_DATA_FILE_TRUNCATE,
+ WAIT_EVENT_DATA_FILE_WRITE,
+ WAIT_EVENT_DSM_FILL_ZERO_WRITE,
+ WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ,
+ WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC,
+ WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE,
+ WAIT_EVENT_LOCK_FILE_CREATE_READ,
+ WAIT_EVENT_LOCK_FILE_CREATE_SYNC,
+ WAIT_EVENT_LOCK_FILE_CREATE_WRITE,
+ WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ,
+ WAIT_EVENT_LOGICAL_REWRITE_CHECKPOINT_SYNC,
+ WAIT_EVENT_LOGICAL_REWRITE_MAPPING_SYNC,
+ WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE,
+ WAIT_EVENT_LOGICAL_REWRITE_SYNC,
+ WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE,
+ WAIT_EVENT_LOGICAL_REWRITE_WRITE,
+ WAIT_EVENT_RELATION_MAP_READ,
+ WAIT_EVENT_RELATION_MAP_SYNC,
+ WAIT_EVENT_RELATION_MAP_WRITE,
+ WAIT_EVENT_REORDER_BUFFER_READ,
+ WAIT_EVENT_REORDER_BUFFER_WRITE,
+ WAIT_EVENT_REORDER_LOGICAL_MAPPING_READ,
+ WAIT_EVENT_REPLICATION_SLOT_READ,
+ WAIT_EVENT_REPLICATION_SLOT_RESTORE_SYNC,
+ WAIT_EVENT_REPLICATION_SLOT_SYNC,
+ WAIT_EVENT_REPLICATION_SLOT_WRITE,
+ WAIT_EVENT_SLRU_FLUSH_SYNC,
+ WAIT_EVENT_SLRU_READ,
+ WAIT_EVENT_SLRU_SYNC,
+ WAIT_EVENT_SLRU_WRITE,
+ WAIT_EVENT_SNAPBUILD_READ,
+ WAIT_EVENT_SNAPBUILD_SYNC,
+ WAIT_EVENT_SNAPBUILD_WRITE,
+ WAIT_EVENT_TIMELINE_HISTORY_FILE_SYNC,
+ WAIT_EVENT_TIMELINE_HISTORY_FILE_WRITE,
+ WAIT_EVENT_TIMELINE_HISTORY_READ,
+ WAIT_EVENT_TIMELINE_HISTORY_SYNC,
+ WAIT_EVENT_TIMELINE_HISTORY_WRITE,
+ WAIT_EVENT_TWOPHASE_FILE_READ,
+ WAIT_EVENT_TWOPHASE_FILE_SYNC,
+ WAIT_EVENT_TWOPHASE_FILE_WRITE,
+ WAIT_EVENT_WALSENDER_TIMELINE_HISTORY_READ,
+ WAIT_EVENT_WAL_BOOTSTRAP_SYNC,
+ WAIT_EVENT_WAL_BOOTSTRAP_WRITE,
+ WAIT_EVENT_WAL_COPY_READ,
+ WAIT_EVENT_WAL_COPY_SYNC,
+ WAIT_EVENT_WAL_COPY_WRITE,
+ WAIT_EVENT_WAL_INIT_SYNC,
+ WAIT_EVENT_WAL_INIT_WRITE,
+ WAIT_EVENT_WAL_READ,
+ WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN,
+ WAIT_EVENT_WAL_WRITE
+} WaitEventIO;
/* ----------
* Command type for progress reporting purposes
@@ -768,6 +949,9 @@ typedef struct PgBackendSSLStatus
* showing its current activity. (The structs are allocated according to
* BackendId, but that is not critical.) Note that the collector process
* has no involvement in, or even access to, these structs.
+ *
+ * Each auxiliary process also maintains a PgBackendStatus struct in shared
+ * memory.
* ----------
*/
typedef struct PgBackendStatus
@@ -792,6 +976,9 @@ typedef struct PgBackendStatus
/* The entry is valid iff st_procpid > 0, unused if st_procpid == 0 */
int st_procpid;
+ /* Type of backends */
+ BackendType st_backendType;
+
/* Times when current backend, transaction, and activity started */
TimestampTz st_proc_start_timestamp;
TimestampTz st_xact_start_timestamp;
@@ -820,7 +1007,7 @@ typedef struct PgBackendStatus
/*
* Command progress reporting. Any command which wishes can advertise
* that it is running by setting st_progress_command,
- * st_progress_command_target, and st_progress_command[].
+ * st_progress_command_target, and st_progress_param[].
* st_progress_command_target should be the OID of the relation which the
* command targets (we assume there's just one, as this is meant for
* utility commands), but the meaning of each element in the
@@ -990,6 +1177,7 @@ extern const char *pgstat_get_wait_event_type(uint32 wait_event_info);
extern const char *pgstat_get_backend_current_activity(int pid, bool checkUser);
extern const char *pgstat_get_crashed_backend_activity(int pid, char *buffer,
int buflen);
+extern const char *pgstat_get_backend_desc(BackendType backendType);
extern void pgstat_progress_start_command(ProgressCommandType cmdtype,
Oid relid);
@@ -1008,9 +1196,9 @@ extern void pgstat_initstats(Relation rel);
*
* Called from places where server process needs to wait. This is called
* to report wait event information. The wait information is stored
- * as 4-bytes where first byte repersents the wait event class (type of
+ * as 4-bytes where first byte represents the wait event class (type of
* wait, for different types of wait, refer WaitClass) and the next
- * 3-bytes repersent the actual wait event. Currently 2-bytes are used
+ * 3-bytes represent the actual wait event. Currently 2-bytes are used
* for wait event which is sufficient for current usage, 1-byte is
* reserved for future usage.
*
@@ -1019,23 +1207,18 @@ extern void pgstat_initstats(Relation rel);
* ----------
*/
static inline void
-pgstat_report_wait_start(uint8 classId, uint16 eventId)
+pgstat_report_wait_start(uint32 wait_event_info)
{
volatile PGPROC *proc = MyProc;
- uint32 wait_event_val;
if (!pgstat_track_activities || !proc)
return;
- wait_event_val = classId;
- wait_event_val <<= 24;
- wait_event_val |= eventId;
-
/*
* Since this is a four-byte field which is always read and written as
* four-bytes, updates are atomic.
*/
- proc->wait_event_info = wait_event_val;
+ proc->wait_event_info = wait_event_info;
}
/* ----------
@@ -1104,7 +1287,7 @@ pgstat_report_wait_end(void)
#define pgstat_count_buffer_write_time(n) \
(pgStatBlockWriteTime += (n))
-extern void pgstat_count_heap_insert(Relation rel, int n);
+extern void pgstat_count_heap_insert(Relation rel, PgStat_Counter n);
extern void pgstat_count_heap_update(Relation rel, bool hot);
extern void pgstat_count_heap_delete(Relation rel);
extern void pgstat_count_truncate(Relation rel);
diff --git a/src/include/pgtar.h b/src/include/pgtar.h
index 45ca400f98..d0188efaa6 100644
--- a/src/include/pgtar.h
+++ b/src/include/pgtar.h
@@ -4,7 +4,7 @@
* Functions for manipulating tarfile datastructures (src/port/tar.c)
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/pgtar.h
@@ -22,4 +22,5 @@ enum tarError
extern enum tarError tarCreateHeader(char *h, const char *filename, const char *linktarget,
pgoff_t size, mode_t mode, uid_t uid, gid_t gid, time_t mtime);
extern uint64 read_tar_number(const char *s, int len);
+extern void print_tar_number(char *s, int len, uint64 val);
extern int tarChecksum(char *header);
diff --git a/src/include/pgtime.h b/src/include/pgtime.h
index 182da3e645..52b54b920a 100644
--- a/src/include/pgtime.h
+++ b/src/include/pgtime.h
@@ -3,7 +3,7 @@
* pgtime.h
* PostgreSQL internal timezone library
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/include/pgtime.h
@@ -28,7 +28,7 @@ struct pg_tm
int tm_min;
int tm_hour;
int tm_mday;
- int tm_mon; /* origin 0, not 1 */
+ int tm_mon; /* origin 1, not 0! */
int tm_year; /* relative to 1900 */
int tm_wday;
int tm_yday;
diff --git a/src/include/port.h b/src/include/port.h
index 7ef1b7b3d6..7d8e8a68d4 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -3,7 +3,7 @@
* port.h
* Header for src/port/ compatibility functions.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/port.h
@@ -203,7 +203,8 @@ extern char *pgwin32_setlocale(int category, const char *locale);
#endif /* WIN32 */
/* Portable prompt handling */
-extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
+extern void simple_prompt(const char *prompt, char *destination, size_t destlen,
+ bool echo);
#ifdef WIN32
#define PG_SIGNAL_COUNT 32
@@ -230,7 +231,7 @@ extern int pgrename(const char *from, const char *to);
extern int pgunlink(const char *path);
/* Include this first so later includes don't see these defines */
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
#include <io.h>
#endif
@@ -250,7 +251,7 @@ extern int pgunlink(const char *path);
#if defined(WIN32) && !defined(__CYGWIN__)
extern int pgsymlink(const char *oldpath, const char *newpath);
extern int pgreadlink(const char *path, char *buf, size_t size);
-extern bool pgwin32_is_junction(char *path);
+extern bool pgwin32_is_junction(const char *path);
#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)
#define readlink(path, buf, size) pgreadlink(path, buf, size)
@@ -360,6 +361,7 @@ extern off_t ftello(FILE *stream);
extern double pg_erand48(unsigned short xseed[3]);
extern long pg_lrand48(void);
+extern long pg_jrand48(unsigned short xseed[3]);
extern void pg_srand48(long seed);
#ifndef HAVE_FLS
@@ -401,7 +403,7 @@ extern size_t strlcat(char *dst, const char *src, size_t siz);
extern size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
-#if !defined(HAVE_RANDOM) && !defined(__BORLANDC__)
+#if !defined(HAVE_RANDOM)
extern long random(void);
#endif
@@ -453,6 +455,11 @@ extern int pg_codepage_to_encoding(UINT cp);
extern char *inet_net_ntop(int af, const void *src, int bits,
char *dst, size_t size);
+/* port/pg_strong_random.c */
+#ifdef HAVE_STRONG_RANDOM
+extern bool pg_strong_random(void *buf, size_t len);
+#endif
+
/* port/pgcheckdir.c */
extern int pg_check_dir(const char *dir);
@@ -466,6 +473,11 @@ typedef void (*pqsigfunc) (int signo);
#endif
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
+#ifndef WIN32
+extern pqsigfunc pqsignal_no_restart(int signo, pqsigfunc func);
+#else
+#define pqsignal_no_restart(signo, func) pqsignal(signo, func)
+#endif
/* port/quotes.c */
extern char *escape_single_quotes_ascii(const char *src);
diff --git a/src/include/port/atomics.h b/src/include/port/atomics.h
index f7884d72c6..89eb522637 100644
--- a/src/include/port/atomics.h
+++ b/src/include/port/atomics.h
@@ -12,13 +12,14 @@
* * pg_compiler_barrier(), pg_write_barrier(), pg_read_barrier()
* * pg_atomic_compare_exchange_u32(), pg_atomic_fetch_add_u32()
* * pg_atomic_test_set_flag(), pg_atomic_init_flag(), pg_atomic_clear_flag()
+ * * PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY should be defined if appropriate.
*
* There exist generic, hardware independent, implementations for several
* compilers which might be sufficient, although possibly not optimal, for a
* new platform. If no such generic implementation is available spinlocks (or
* even OS provided semaphores) will be used to implement the API.
*
- * Implement the _u64 variants if and only if your platform can use them
+ * Implement _u64 atomics if and only if your platform can use them
* efficiently (and obviously correctly).
*
* Use higher level functionality (lwlocks, spinlocks, heavyweight locks)
@@ -27,7 +28,7 @@
* For an introduction to using memory barriers within the PostgreSQL backend,
* see src/backend/storage/lmgr/README.barrier
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/port/atomics.h
@@ -95,7 +96,7 @@
/* gcc or compatible, including clang and icc */
#elif defined(__GNUC__) || defined(__INTEL_COMPILER)
#include "port/atomics/generic-gcc.h"
-#elif defined(WIN32_ONLY_COMPILER)
+#elif defined(_MSC_VER)
#include "port/atomics/generic-msvc.h"
#elif defined(__hpux) && defined(__ia64) && !defined(__GNUC__)
#include "port/atomics/generic-acc.h"
@@ -110,9 +111,9 @@
/*
* Provide a full fallback of the pg_*_barrier(), pg_atomic**_flag and
- * pg_atomic_*_u32 APIs for platforms without sufficient spinlock and/or
- * atomics support. In the case of spinlock backed atomics the emulation is
- * expected to be efficient, although less so than native atomics support.
+ * pg_atomic_* APIs for platforms without sufficient spinlock and/or atomics
+ * support. In the case of spinlock backed atomics the emulation is expected
+ * to be efficient, although less so than native atomics support.
*/
#include "port/atomics/fallback.h"
@@ -255,10 +256,12 @@ pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
}
/*
- * pg_atomic_write_u32 - unlocked write to atomic variable.
+ * pg_atomic_write_u32 - write to atomic variable.
*
* The write is guaranteed to succeed as a whole, i.e. it's not possible to
- * observe a partial write for any reader.
+ * observe a partial write for any reader. Note that this correctly interacts
+ * with pg_atomic_compare_exchange_u32, in contrast to
+ * pg_atomic_unlocked_write_u32().
*
* No barrier semantics.
*/
@@ -271,6 +274,25 @@ pg_atomic_write_u32(volatile pg_atomic_uint32 *ptr, uint32 val)
}
/*
+ * pg_atomic_unlocked_write_u32 - unlocked write to atomic variable.
+ *
+ * The write is guaranteed to succeed as a whole, i.e. it's not possible to
+ * observe a partial write for any reader. But note that writing this way is
+ * not guaranteed to correctly interact with read-modify-write operations like
+ * pg_atomic_compare_exchange_u32. This should only be used in cases where
+ * minor performance regressions due to atomics emulation are unacceptable.
+ *
+ * No barrier semantics.
+ */
+static inline void
+pg_atomic_unlocked_write_u32(volatile pg_atomic_uint32 *ptr, uint32 val)
+{
+ AssertPointerAlignment(ptr, 4);
+
+ pg_atomic_unlocked_write_u32_impl(ptr, val);
+}
+
+/*
* pg_atomic_exchange_u32 - exchange newval with current value
*
* Returns the old value of 'ptr' before the swap.
@@ -400,35 +422,44 @@ pg_atomic_sub_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 sub_)
* documentation.
* ----
*/
-#ifdef PG_HAVE_ATOMIC_U64_SUPPORT
-
static inline void
pg_atomic_init_u64(volatile pg_atomic_uint64 *ptr, uint64 val)
{
+ /*
+ * Can't necessarily enforce alignment - and don't need it - when using
+ * the spinlock based fallback implementation. Therefore only assert when
+ * not using it.
+ */
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
-
+#endif
pg_atomic_init_u64_impl(ptr, val);
}
static inline uint64
pg_atomic_read_u64(volatile pg_atomic_uint64 *ptr)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
return pg_atomic_read_u64_impl(ptr);
}
static inline void
pg_atomic_write_u64(volatile pg_atomic_uint64 *ptr, uint64 val)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
pg_atomic_write_u64_impl(ptr, val);
}
static inline uint64
pg_atomic_exchange_u64(volatile pg_atomic_uint64 *ptr, uint64 newval)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
-
+#endif
return pg_atomic_exchange_u64_impl(ptr, newval);
}
@@ -436,22 +467,28 @@ static inline bool
pg_atomic_compare_exchange_u64(volatile pg_atomic_uint64 *ptr,
uint64 *expected, uint64 newval)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
AssertPointerAlignment(expected, 8);
+#endif
return pg_atomic_compare_exchange_u64_impl(ptr, expected, newval);
}
static inline uint64
pg_atomic_fetch_add_u64(volatile pg_atomic_uint64 *ptr, int64 add_)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
return pg_atomic_fetch_add_u64_impl(ptr, add_);
}
static inline uint64
pg_atomic_fetch_sub_u64(volatile pg_atomic_uint64 *ptr, int64 sub_)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
Assert(sub_ != PG_INT64_MIN);
return pg_atomic_fetch_sub_u64_impl(ptr, sub_);
}
@@ -459,34 +496,40 @@ pg_atomic_fetch_sub_u64(volatile pg_atomic_uint64 *ptr, int64 sub_)
static inline uint64
pg_atomic_fetch_and_u64(volatile pg_atomic_uint64 *ptr, uint64 and_)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
return pg_atomic_fetch_and_u64_impl(ptr, and_);
}
static inline uint64
pg_atomic_fetch_or_u64(volatile pg_atomic_uint64 *ptr, uint64 or_)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
return pg_atomic_fetch_or_u64_impl(ptr, or_);
}
static inline uint64
pg_atomic_add_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 add_)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
return pg_atomic_add_fetch_u64_impl(ptr, add_);
}
static inline uint64
pg_atomic_sub_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 sub_)
{
+#ifndef PG_HAVE_ATOMIC_U64_SIMULATION
AssertPointerAlignment(ptr, 8);
+#endif
Assert(sub_ != PG_INT64_MIN);
return pg_atomic_sub_fetch_u64_impl(ptr, sub_);
}
-#endif /* PG_HAVE_64_BIT_ATOMICS */
-
#undef INSIDE_ATOMICS_H
#endif /* ATOMICS_H */
diff --git a/src/include/port/atomics/arch-arm.h b/src/include/port/atomics/arch-arm.h
index 78b211b651..58614ae2ca 100644
--- a/src/include/port/atomics/arch-arm.h
+++ b/src/include/port/atomics/arch-arm.h
@@ -3,7 +3,7 @@
* arch-arm.h
* Atomic operations considerations specific to ARM
*
- * Portions Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* NOTES:
*
@@ -18,8 +18,9 @@
#endif
/*
- * 64 bit atomics on arm are implemented using kernel fallbacks and might be
- * slow, so disable entirely for now.
- * XXX: We might want to change that at some point for AARCH64
+ * 64 bit atomics on ARM32 are implemented using kernel fallbacks and thus
+ * might be slow, so disable entirely. On ARM64 that problem doesn't exist.
*/
+#if !defined(__aarch64__) && !defined(__aarch64)
#define PG_DISABLE_64_BIT_ATOMICS
+#endif /* __aarch64__ || __aarch64 */
diff --git a/src/include/port/atomics/arch-hppa.h b/src/include/port/atomics/arch-hppa.h
index b50e339c7e..c4176c6f42 100644
--- a/src/include/port/atomics/arch-hppa.h
+++ b/src/include/port/atomics/arch-hppa.h
@@ -3,7 +3,7 @@
* arch-hppa.h
* Atomic operations considerations specific to HPPA
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
diff --git a/src/include/port/atomics/arch-ia64.h b/src/include/port/atomics/arch-ia64.h
index 03cc8a006f..3dc4b298e1 100644
--- a/src/include/port/atomics/arch-ia64.h
+++ b/src/include/port/atomics/arch-ia64.h
@@ -3,7 +3,7 @@
* arch-ia64.h
* Atomic operations considerations specific to intel itanium
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
@@ -24,3 +24,6 @@
#elif defined(__hpux)
# define pg_memory_barrier_impl() _Asm_mf()
#endif
+
+/* per architecture manual doubleword accesses have single copy atomicity */
+#define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
diff --git a/src/include/port/atomics/arch-ppc.h b/src/include/port/atomics/arch-ppc.h
index 2b54c42645..ed30468398 100644
--- a/src/include/port/atomics/arch-ppc.h
+++ b/src/include/port/atomics/arch-ppc.h
@@ -3,7 +3,7 @@
* arch-ppc.h
* Atomic operations considerations specific to PowerPC
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
@@ -24,3 +24,6 @@
#define pg_read_barrier_impl() __asm__ __volatile__ ("lwsync" : : : "memory")
#define pg_write_barrier_impl() __asm__ __volatile__ ("lwsync" : : : "memory")
#endif
+
+/* per architecture manual doubleword accesses have single copy atomicity */
+#define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
diff --git a/src/include/port/atomics/arch-x86.h b/src/include/port/atomics/arch-x86.h
index 3dbababa5f..bf8152573d 100644
--- a/src/include/port/atomics/arch-x86.h
+++ b/src/include/port/atomics/arch-x86.h
@@ -7,7 +7,7 @@
* support for xadd and cmpxchg. Given that the 386 isn't supported anywhere
* anymore that's not much of a restriction luckily.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
@@ -113,14 +113,14 @@ pg_spin_delay_impl(void)
{
__asm__ __volatile__(" rep; nop \n");
}
-#elif defined(WIN32_ONLY_COMPILER) && defined(__x86_64__)
+#elif defined(_MSC_VER) && defined(__x86_64__)
#define PG_HAVE_SPIN_DELAY
static __forceinline void
pg_spin_delay_impl(void)
{
_mm_pause();
}
-#elif defined(WIN32_ONLY_COMPILER)
+#elif defined(_MSC_VER)
#define PG_HAVE_SPIN_DELAY
static __forceinline void
pg_spin_delay_impl(void)
@@ -239,4 +239,14 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_)
#endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */
+/*
+ * 8 byte reads / writes have single-copy atomicity on 32 bit x86 platforms
+ * since at least the 586. As well as on all x86-64 cpus.
+ */
+#if defined(__i568__) || defined(__i668__) || /* gcc i586+ */ \
+ (defined(_M_IX86) && _M_IX86 >= 500) || /* msvc i586+ */ \
+ defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) /* gcc, sunpro, msvc */
+#define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
+#endif /* 8 byte single-copy atomicity */
+
#endif /* HAVE_ATOMICS */
diff --git a/src/include/port/atomics/fallback.h b/src/include/port/atomics/fallback.h
index bdaa795abe..4e07add0a4 100644
--- a/src/include/port/atomics/fallback.h
+++ b/src/include/port/atomics/fallback.h
@@ -4,7 +4,7 @@
* Fallback for platforms without spinlock and/or atomics support. Slower
* than native atomics support, but not unusably slow.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/port/atomics/fallback.h
@@ -102,6 +102,24 @@ typedef struct pg_atomic_uint32
#endif /* PG_HAVE_ATOMIC_U32_SUPPORT */
+#if !defined(PG_HAVE_ATOMIC_U64_SUPPORT)
+
+#define PG_HAVE_ATOMIC_U64_SIMULATION
+
+#define PG_HAVE_ATOMIC_U64_SUPPORT
+typedef struct pg_atomic_uint64
+{
+ /* Check pg_atomic_flag's definition above for an explanation */
+#if defined(__hppa) || defined(__hppa__) /* HP PA-RISC, GCC and HP compilers */
+ int sema[4];
+#else
+ int sema;
+#endif
+ volatile uint64 value;
+} pg_atomic_uint64;
+
+#endif /* PG_HAVE_ATOMIC_U64_SUPPORT */
+
#ifdef PG_HAVE_ATOMIC_FLAG_SIMULATION
#define PG_HAVE_ATOMIC_INIT_FLAG
@@ -133,6 +151,9 @@ pg_atomic_unlocked_test_flag_impl(volatile pg_atomic_flag *ptr)
#define PG_HAVE_ATOMIC_INIT_U32
extern void pg_atomic_init_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 val_);
+#define PG_HAVE_ATOMIC_WRITE_U32
+extern void pg_atomic_write_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 val);
+
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
extern bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
uint32 *expected, uint32 newval);
@@ -141,3 +162,18 @@ extern bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
extern uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_);
#endif /* PG_HAVE_ATOMIC_U32_SIMULATION */
+
+
+#ifdef PG_HAVE_ATOMIC_U64_SIMULATION
+
+#define PG_HAVE_ATOMIC_INIT_U64
+extern void pg_atomic_init_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val_);
+
+#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64
+extern bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
+ uint64 *expected, uint64 newval);
+
+#define PG_HAVE_ATOMIC_FETCH_ADD_U64
+extern uint64 pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_);
+
+#endif /* PG_HAVE_ATOMIC_U64_SIMULATION */
diff --git a/src/include/port/atomics/generic-acc.h b/src/include/port/atomics/generic-acc.h
index fa978498c3..4ea3ed3fc7 100644
--- a/src/include/port/atomics/generic-acc.h
+++ b/src/include/port/atomics/generic-acc.h
@@ -3,7 +3,7 @@
* generic-acc.h
* Atomic operations support when using HPs acc on HPUX
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
diff --git a/src/include/port/atomics/generic-gcc.h b/src/include/port/atomics/generic-gcc.h
index a3abc8a1a9..7efc0861e7 100644
--- a/src/include/port/atomics/generic-gcc.h
+++ b/src/include/port/atomics/generic-gcc.h
@@ -3,7 +3,7 @@
* generic-gcc.h
* Atomic operations, implemented using gcc (or compatible) intrinsics.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
@@ -62,12 +62,15 @@
#define PG_HAVE_ATOMIC_FLAG_SUPPORT
typedef struct pg_atomic_flag
{
- /* some platforms only have a 8 bit wide TAS */
-#ifdef HAVE_GCC__SYNC_CHAR_TAS
- volatile char value;
-#else
- /* but an int works on more platforms */
+ /*
+ * If we have a choice, use int-width TAS, because that is more efficient
+ * and/or more reliably implemented on most non-Intel platforms. (Note
+ * that this code isn't used on x86[_64]; see arch-x86.h for that.)
+ */
+#ifdef HAVE_GCC__SYNC_INT32_TAS
volatile int value;
+#else
+ volatile char value;
#endif
} pg_atomic_flag;
diff --git a/src/include/port/atomics/generic-msvc.h b/src/include/port/atomics/generic-msvc.h
index aeac2cd240..f82cfec8ec 100644
--- a/src/include/port/atomics/generic-msvc.h
+++ b/src/include/port/atomics/generic-msvc.h
@@ -3,7 +3,7 @@
* generic-msvc.h
* Atomic operations support when using MSVC
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
@@ -17,14 +17,12 @@
*-------------------------------------------------------------------------
*/
#include <intrin.h>
-#include <windows.h>
/* intentionally no include guards, should only be included by atomics.h */
#ifndef INSIDE_ATOMICS_H
#error "should be included via atomics.h"
#endif
-/* Should work on both MSVC and Borland. */
#pragma intrinsic(_ReadWriteBarrier)
#define pg_compiler_barrier_impl() _ReadWriteBarrier()
diff --git a/src/include/port/atomics/generic-sunpro.h b/src/include/port/atomics/generic-sunpro.h
index f5dd9ffcec..a58e8e3bad 100644
--- a/src/include/port/atomics/generic-sunpro.h
+++ b/src/include/port/atomics/generic-sunpro.h
@@ -3,7 +3,7 @@
* generic-sunpro.h
* Atomic operations for solaris' CC
*
- * Portions Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* NOTES:
*
diff --git a/src/include/port/atomics/generic-xlc.h b/src/include/port/atomics/generic-xlc.h
index f4fd2f3d43..f854612d39 100644
--- a/src/include/port/atomics/generic-xlc.h
+++ b/src/include/port/atomics/generic-xlc.h
@@ -3,7 +3,7 @@
* generic-xlc.h
* Atomic operations for IBM's CC
*
- * Portions Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* NOTES:
*
diff --git a/src/include/port/atomics/generic.h b/src/include/port/atomics/generic.h
index 32a01136e6..424543604a 100644
--- a/src/include/port/atomics/generic.h
+++ b/src/include/port/atomics/generic.h
@@ -4,7 +4,7 @@
* Implement higher level operations based on some lower level atomic
* operations.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/port/atomics/generic.h
@@ -58,6 +58,15 @@ pg_atomic_write_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 val)
}
#endif
+#ifndef PG_HAVE_ATOMIC_UNLOCKED_WRITE_U32
+#define PG_HAVE_ATOMIC_UNLOCKED_WRITE_U32
+static inline void
+pg_atomic_unlocked_write_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 val)
+{
+ ptr->value = val;
+}
+#endif
+
/*
* provide fallback for test_and_set using atomic_exchange if available
*/
@@ -246,8 +255,6 @@ pg_atomic_sub_fetch_u32_impl(volatile pg_atomic_uint32 *ptr, int32 sub_)
}
#endif
-#ifdef PG_HAVE_ATOMIC_U64_SUPPORT
-
#if !defined(PG_HAVE_ATOMIC_EXCHANGE_U64) && defined(PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64)
#define PG_HAVE_ATOMIC_EXCHANGE_U64
static inline uint64
@@ -266,6 +273,24 @@ pg_atomic_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 xchg_)
#ifndef PG_HAVE_ATOMIC_WRITE_U64
#define PG_HAVE_ATOMIC_WRITE_U64
+
+#if defined(PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY) && \
+ !defined(PG_HAVE_ATOMIC_U64_SIMULATION)
+
+static inline void
+pg_atomic_write_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val)
+{
+ /*
+ * On this platform aligned 64bit writes are guaranteed to be atomic,
+ * except if using the fallback implementation, where can't guarantee the
+ * required alignment.
+ */
+ AssertPointerAlignment(ptr, 8);
+ ptr->value = val;
+}
+
+#else
+
static inline void
pg_atomic_write_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val)
{
@@ -275,10 +300,30 @@ pg_atomic_write_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val)
*/
pg_atomic_exchange_u64_impl(ptr, val);
}
-#endif
+
+#endif /* PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY && !PG_HAVE_ATOMIC_U64_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_WRITE_U64 */
#ifndef PG_HAVE_ATOMIC_READ_U64
#define PG_HAVE_ATOMIC_READ_U64
+
+#if defined(PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY) && \
+ !defined(PG_HAVE_ATOMIC_U64_SIMULATION)
+
+static inline uint64
+pg_atomic_read_u64_impl(volatile pg_atomic_uint64 *ptr)
+{
+ /*
+ * On this platform aligned 64bit reads are guaranteed to be atomic,
+ * except if using the fallback implementation, where can't guarantee the
+ * required alignment.
+ */
+ AssertPointerAlignment(ptr, 8);
+ return *(&ptr->value);
+}
+
+#else
+
static inline uint64
pg_atomic_read_u64_impl(volatile pg_atomic_uint64 *ptr)
{
@@ -294,7 +339,8 @@ pg_atomic_read_u64_impl(volatile pg_atomic_uint64 *ptr)
return old;
}
-#endif
+#endif /* PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY && !PG_HAVE_ATOMIC_U64_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_READ_U64 */
#ifndef PG_HAVE_ATOMIC_INIT_U64
#define PG_HAVE_ATOMIC_INIT_U64
@@ -379,5 +425,3 @@ pg_atomic_sub_fetch_u64_impl(volatile pg_atomic_uint64 *ptr, int64 sub_)
return pg_atomic_fetch_sub_u64_impl(ptr, sub_) - sub_;
}
#endif
-
-#endif /* PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 */
diff --git a/src/include/port/darwin.h b/src/include/port/darwin.h
index 29c4b91d8c..15fb69d6db 100644
--- a/src/include/port/darwin.h
+++ b/src/include/port/darwin.h
@@ -2,7 +2,7 @@
#define __darwin__ 1
-#if HAVE_DECL_F_FULLFSYNC /* not present before OS X 10.3 */
+#if HAVE_DECL_F_FULLFSYNC /* not present before macOS 10.3 */
#define HAVE_FSYNC_WRITETHROUGH
#endif
diff --git a/src/include/port/pg_bswap.h b/src/include/port/pg_bswap.h
index a42f757af2..18859a6ea3 100644
--- a/src/include/port/pg_bswap.h
+++ b/src/include/port/pg_bswap.h
@@ -6,13 +6,14 @@
* Macros for reversing the byte order of 32-bit and 64-bit unsigned integers.
* For example, 0xAABBCCDD becomes 0xDDCCBBAA. These are just wrappers for
* built-in functions provided by the compiler where support exists.
+ * Elsewhere, beware of multiple evaluations of the arguments!
*
* Note that the GCC built-in functions __builtin_bswap32() and
* __builtin_bswap64() are documented as accepting single arguments of type
* uint32_t and uint64_t respectively (these are also the respective return
* types). Use caution when using these wrapper macros with signed integers.
*
- * Copyright (c) 2015-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2015-2017, PostgreSQL Global Development Group
*
* src/include/port/pg_bswap.h
*
@@ -24,23 +25,23 @@
#ifdef HAVE__BUILTIN_BSWAP32
#define BSWAP32(x) __builtin_bswap32(x)
#else
-#define BSWAP32(x) (((x << 24) & 0xff000000) | \
- ((x << 8) & 0x00ff0000) | \
- ((x >> 8) & 0x0000ff00) | \
- ((x >> 24) & 0x000000ff))
+#define BSWAP32(x) ((((x) << 24) & 0xff000000) | \
+ (((x) << 8) & 0x00ff0000) | \
+ (((x) >> 8) & 0x0000ff00) | \
+ (((x) >> 24) & 0x000000ff))
#endif /* HAVE__BUILTIN_BSWAP32 */
#ifdef HAVE__BUILTIN_BSWAP64
#define BSWAP64(x) __builtin_bswap64(x)
#else
-#define BSWAP64(x) (((x << 56) & 0xff00000000000000UL) | \
- ((x << 40) & 0x00ff000000000000UL) | \
- ((x << 24) & 0x0000ff0000000000UL) | \
- ((x << 8) & 0x000000ff00000000UL) | \
- ((x >> 8) & 0x00000000ff000000UL) | \
- ((x >> 24) & 0x0000000000ff0000UL) | \
- ((x >> 40) & 0x000000000000ff00UL) | \
- ((x >> 56) & 0x00000000000000ffUL))
+#define BSWAP64(x) ((((x) << 56) & UINT64CONST(0xff00000000000000)) | \
+ (((x) << 40) & UINT64CONST(0x00ff000000000000)) | \
+ (((x) << 24) & UINT64CONST(0x0000ff0000000000)) | \
+ (((x) << 8) & UINT64CONST(0x000000ff00000000)) | \
+ (((x) >> 8) & UINT64CONST(0x00000000ff000000)) | \
+ (((x) >> 24) & UINT64CONST(0x0000000000ff0000)) | \
+ (((x) >> 40) & UINT64CONST(0x000000000000ff00)) | \
+ (((x) >> 56) & UINT64CONST(0x00000000000000ff)))
#endif /* HAVE__BUILTIN_BSWAP64 */
/*
diff --git a/src/include/port/pg_crc32c.h b/src/include/port/pg_crc32c.h
index 57bdacb884..aa35fa89d2 100644
--- a/src/include/port/pg_crc32c.h
+++ b/src/include/port/pg_crc32c.h
@@ -23,7 +23,7 @@
* EQ_CRC32C(c1, c2)
* Check for equality of two CRCs.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/port/pg_crc32c.h
diff --git a/src/include/port/sco.h b/src/include/port/sco.h
deleted file mode 100644
index 30811450c9..0000000000
--- a/src/include/port/sco.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * src/include/port/sco.h
- *
- * see src/backend/libpq/pqcomm.c */
-#define SCO_ACCEPT_BUG
-
-#define USE_UNIVEL_CC
diff --git a/src/include/port/unixware.h b/src/include/port/unixware.h
deleted file mode 100644
index e068820957..0000000000
--- a/src/include/port/unixware.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * src/include/port/unixware.h
- *
- * see src/backend/libpq/pqcomm.c */
-#define SCO_ACCEPT_BUG
-
-/***************************************
- * Define this if you are compiling with
- * the native UNIXWARE C compiler.
- ***************************************/
-#define USE_UNIVEL_CC
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 4453c90346..0debb3b3f4 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,9 +1,5 @@
/* src/include/port/win32.h */
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#define WIN32_ONLY_COMPILER
-#endif
-
/*
* Make sure _WIN32_WINNT has the minimum required value.
* Leave a higher value in place. When building with at least Visual
@@ -32,9 +28,7 @@
* Always build with SSPI support. Keep it as a #define in case
* we want a switch to disable it sometime in the future.
*/
-#ifndef __BORLANDC__
#define ENABLE_SSPI 1
-#endif
/* undefine and redefine after #include */
#undef mkdir
@@ -45,7 +39,7 @@
* The Mingw64 headers choke if this is already defined - they
* define it themselves.
*/
-#if !defined(__MINGW64_VERSION_MAJOR) || defined(WIN32_ONLY_COMPILER)
+#if !defined(__MINGW64_VERSION_MAJOR) || defined(_MSC_VER)
#define _WINSOCKAPI_
#endif
#include <winsock2.h>
@@ -56,9 +50,7 @@
#include <signal.h>
#include <errno.h>
#include <direct.h>
-#ifndef __BORLANDC__
#include <sys/utime.h> /* for non-unicode version */
-#endif
#undef near
/* Must be here to avoid conflicting with prototype in windows.h */
@@ -207,10 +199,8 @@
#define SIGTTIN 21
#define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */
#define SIGWINCH 28
-#ifndef __BORLANDC__
#define SIGUSR1 30
#define SIGUSR2 31
-#endif
/*
* New versions of mingw have gettimeofday() and also declare
@@ -239,7 +229,7 @@ int setitimer(int which, const struct itimerval * value, struct itimerval * ov
* with 64-bit offsets.
*/
#define pgoff_t __int64
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
#define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin)
#define ftello(stream) _ftelli64(stream)
#else
@@ -262,7 +252,7 @@ typedef int gid_t;
#endif
typedef long key_t;
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
typedef int pid_t;
#endif
@@ -421,8 +411,8 @@ extern int pgwin32_is_admin(void);
#define putenv(x) pgwin32_putenv(x)
#define unsetenv(x) pgwin32_unsetenv(x)
-/* Things that exist in MingW headers, but need to be added to MSVC & BCC */
-#ifdef WIN32_ONLY_COMPILER
+/* Things that exist in MingW headers, but need to be added to MSVC */
+#ifdef _MSC_VER
#ifndef _WIN64
typedef long ssize_t;
@@ -430,7 +420,6 @@ typedef long ssize_t;
typedef __int64 ssize_t;
#endif
-#ifndef __BORLANDC__
typedef unsigned short mode_t;
#define S_IRUSR _S_IREAD
@@ -440,7 +429,6 @@ typedef unsigned short mode_t;
/* see also S_IRGRP etc below */
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif /* __BORLANDC__ */
#define F_OK 0
#define W_OK 2
@@ -454,26 +442,9 @@ typedef unsigned short mode_t;
/* Pulled from Makefile.port in mingw */
#define DLSUFFIX ".dll"
-#ifdef __BORLANDC__
-
-/* for port/dirent.c */
-#ifndef INVALID_FILE_ATTRIBUTES
-#define INVALID_FILE_ATTRIBUTES ((DWORD) -1)
-#endif
-
-/* for port/open.c */
-#ifndef O_RANDOM
-#define O_RANDOM 0x0010 /* File access is primarily random */
-#define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */
-#define O_TEMPORARY 0x0040 /* Temporary file bit */
-#define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */
-#define _O_SHORT_LIVED O_SHORT_LIVED
-#endif /* ifndef O_RANDOM */
-#endif /* __BORLANDC__ */
-#endif /* WIN32_ONLY_COMPILER */
+#endif /* _MSC_VER */
/* These aren't provided by either MingW or MSVC */
-#ifndef __BORLANDC__
#define S_IRGRP 0
#define S_IWGRP 0
#define S_IXGRP 0
@@ -482,5 +453,3 @@ typedef unsigned short mode_t;
#define S_IWOTH 0
#define S_IXOTH 0
#define S_IRWXO 0
-
-#endif /* __BORLANDC__ */
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index 16caf6eee3..9eb4bb7eac 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -4,10 +4,10 @@
* portable high-precision interval timing
*
* This file provides an abstraction layer to hide portability issues in
- * interval timing. On Unix we use gettimeofday(), but on Windows that
- * gives a low-precision result so we must use QueryPerformanceCounter()
- * instead. These macros also give some breathing room to use other
- * high-precision-timing APIs on yet other platforms.
+ * interval timing. On Unix we use clock_gettime() if available, else
+ * gettimeofday(). On Windows, gettimeofday() gives a low-precision result
+ * so we must use QueryPerformanceCounter() instead. These macros also give
+ * some breathing room to use other high-precision-timing APIs.
*
* The basic data type is instr_time, which all callers should treat as an
* opaque typedef. instr_time can store either an absolute time (of
@@ -43,7 +43,7 @@
* Beware of multiple evaluations of the macro arguments.
*
*
- * Copyright (c) 2001-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2001-2017, PostgreSQL Global Development Group
*
* src/include/portability/instr_time.h
*
@@ -54,6 +54,94 @@
#ifndef WIN32
+#ifdef HAVE_CLOCK_GETTIME
+
+/* Use clock_gettime() */
+
+#include <time.h>
+
+/*
+ * The best clockid to use according to the POSIX spec is CLOCK_MONOTONIC,
+ * since that will give reliable interval timing even in the face of changes
+ * to the system clock. However, POSIX doesn't require implementations to
+ * provide anything except CLOCK_REALTIME, so fall back to that if we don't
+ * find CLOCK_MONOTONIC.
+ *
+ * Also, some implementations have nonstandard clockids with better properties
+ * than CLOCK_MONOTONIC. In particular, as of macOS 10.12, Apple provides
+ * CLOCK_MONOTONIC_RAW which is both faster to read and higher resolution than
+ * their version of CLOCK_MONOTONIC.
+ */
+#if defined(__darwin__) && defined(CLOCK_MONOTONIC_RAW)
+#define PG_INSTR_CLOCK CLOCK_MONOTONIC_RAW
+#elif defined(CLOCK_MONOTONIC)
+#define PG_INSTR_CLOCK CLOCK_MONOTONIC
+#else
+#define PG_INSTR_CLOCK CLOCK_REALTIME
+#endif
+
+typedef struct timespec instr_time;
+
+#define INSTR_TIME_IS_ZERO(t) ((t).tv_nsec == 0 && (t).tv_sec == 0)
+
+#define INSTR_TIME_SET_ZERO(t) ((t).tv_sec = 0, (t).tv_nsec = 0)
+
+#define INSTR_TIME_SET_CURRENT(t) ((void) clock_gettime(PG_INSTR_CLOCK, &(t)))
+
+#define INSTR_TIME_ADD(x,y) \
+ do { \
+ (x).tv_sec += (y).tv_sec; \
+ (x).tv_nsec += (y).tv_nsec; \
+ /* Normalize */ \
+ while ((x).tv_nsec >= 1000000000) \
+ { \
+ (x).tv_nsec -= 1000000000; \
+ (x).tv_sec++; \
+ } \
+ } while (0)
+
+#define INSTR_TIME_SUBTRACT(x,y) \
+ do { \
+ (x).tv_sec -= (y).tv_sec; \
+ (x).tv_nsec -= (y).tv_nsec; \
+ /* Normalize */ \
+ while ((x).tv_nsec < 0) \
+ { \
+ (x).tv_nsec += 1000000000; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define INSTR_TIME_ACCUM_DIFF(x,y,z) \
+ do { \
+ (x).tv_sec += (y).tv_sec - (z).tv_sec; \
+ (x).tv_nsec += (y).tv_nsec - (z).tv_nsec; \
+ /* Normalize after each add to avoid overflow/underflow of tv_nsec */ \
+ while ((x).tv_nsec < 0) \
+ { \
+ (x).tv_nsec += 1000000000; \
+ (x).tv_sec--; \
+ } \
+ while ((x).tv_nsec >= 1000000000) \
+ { \
+ (x).tv_nsec -= 1000000000; \
+ (x).tv_sec++; \
+ } \
+ } while (0)
+
+#define INSTR_TIME_GET_DOUBLE(t) \
+ (((double) (t).tv_sec) + ((double) (t).tv_nsec) / 1000000000.0)
+
+#define INSTR_TIME_GET_MILLISEC(t) \
+ (((double) (t).tv_sec * 1000.0) + ((double) (t).tv_nsec) / 1000000.0)
+
+#define INSTR_TIME_GET_MICROSEC(t) \
+ (((uint64) (t).tv_sec * (uint64) 1000000) + (uint64) ((t).tv_nsec / 1000))
+
+#else /* !HAVE_CLOCK_GETTIME */
+
+/* Use gettimeofday() */
+
#include <sys/time.h>
typedef struct timeval instr_time;
@@ -113,8 +201,13 @@ typedef struct timeval instr_time;
#define INSTR_TIME_GET_MICROSEC(t) \
(((uint64) (t).tv_sec * (uint64) 1000000) + (uint64) (t).tv_usec)
+
+#endif /* HAVE_CLOCK_GETTIME */
+
#else /* WIN32 */
+/* Use QueryPerformanceCounter() */
+
typedef LARGE_INTEGER instr_time;
#define INSTR_TIME_IS_ZERO(t) ((t).QuadPart == 0)
@@ -149,6 +242,7 @@ GetTimerFrequency(void)
QueryPerformanceFrequency(&f);
return (double) f.QuadPart;
}
+
#endif /* WIN32 */
#endif /* INSTR_TIME_H */
diff --git a/src/include/portability/mem.h b/src/include/portability/mem.h
index 9f055e19ed..d560c3ce56 100644
--- a/src/include/portability/mem.h
+++ b/src/include/portability/mem.h
@@ -3,7 +3,7 @@
* mem.h
* portability definitions for various memory operations
*
- * Copyright (c) 2001-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2001-2017, PostgreSQL Global Development Group
*
* src/include/portability/mem.h
*
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 3b93f7b3bb..87df7844f4 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -7,7 +7,7 @@
* Client-side code should include postgres_fe.h instead.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1995, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -297,20 +297,18 @@ typedef struct
/* Externally visible macros */
/*
- * VARDATA, VARSIZE, and SET_VARSIZE are the recommended API for most code
- * for varlena datatypes. Note that they only work on untoasted,
- * 4-byte-header Datums!
+ * In consumers oblivious to data alignment, call PG_DETOAST_DATUM_PACKED(),
+ * VARDATA_ANY(), VARSIZE_ANY() and VARSIZE_ANY_EXHDR(). Elsewhere, call
+ * PG_DETOAST_DATUM(), VARDATA() and VARSIZE(). Directly fetching an int16,
+ * int32 or wider field in the struct representing the datum layout requires
+ * aligned data. memcpy() is alignment-oblivious, as are most operations on
+ * datatypes, such as text, whose layout struct contains only char fields.
*
- * Code that wants to use 1-byte-header values without detoasting should
- * use VARSIZE_ANY/VARSIZE_ANY_EXHDR/VARDATA_ANY. The other macros here
- * should usually be used only by tuple assembly/disassembly code and
- * code that specifically wants to work with still-toasted Datums.
+ * Code assembling a new datum should call VARDATA() and SET_VARSIZE().
+ * (Datums begin life untoasted.)
*
- * WARNING: It is only safe to use VARDATA_ANY() -- typically with
- * PG_DETOAST_DATUM_PACKED() -- if you really don't care about the alignment.
- * Either because you're working with something like text where the alignment
- * doesn't matter or because you're not going to access its constituent parts
- * and just use things like memcpy on it anyways.
+ * Other macros here should usually be used only by tuple assembly/disassembly
+ * code and code that specifically wants to work with still-toasted Datums.
*/
#define VARDATA(PTR) VARDATA_4B(PTR)
#define VARSIZE(PTR) VARSIZE_4B(PTR)
@@ -610,7 +608,7 @@ typedef Datum *DatumPtr;
* value has adequate lifetime.
*/
-#define NameGetDatum(X) PointerGetDatum(X)
+#define NameGetDatum(X) CStringGetDatum(NameStr(*(X)))
/*
* DatumGetInt64
@@ -667,6 +665,14 @@ extern Datum Int64GetDatum(int64 X);
#endif
/*
+ * Float <-> Datum conversions
+ *
+ * These have to be implemented as inline functions rather than macros, when
+ * passing by value, because many machines pass int and float function
+ * parameters/results differently; so we need to play weird games with unions.
+ */
+
+/*
* DatumGetFloat4
* Returns 4-byte floating point value of a datum.
*
@@ -674,7 +680,18 @@ extern Datum Int64GetDatum(int64 X);
*/
#ifdef USE_FLOAT4_BYVAL
-extern float4 DatumGetFloat4(Datum X);
+static inline float4
+DatumGetFloat4(Datum X)
+{
+ union
+ {
+ int32 value;
+ float4 retval;
+ } myunion;
+
+ myunion.value = GET_4_BYTES(X);
+ return myunion.retval;
+}
#else
#define DatumGetFloat4(X) (* ((float4 *) DatumGetPointer(X)))
#endif
@@ -686,8 +703,22 @@ extern float4 DatumGetFloat4(Datum X);
* Note: if float4 is pass by reference, this function returns a reference
* to palloc'd space.
*/
+#ifdef USE_FLOAT4_BYVAL
+static inline Datum
+Float4GetDatum(float4 X)
+{
+ union
+ {
+ float4 value;
+ int32 retval;
+ } myunion;
+ myunion.value = X;
+ return SET_4_BYTES(myunion.retval);
+}
+#else
extern Datum Float4GetDatum(float4 X);
+#endif
/*
* DatumGetFloat8
@@ -697,7 +728,18 @@ extern Datum Float4GetDatum(float4 X);
*/
#ifdef USE_FLOAT8_BYVAL
-extern float8 DatumGetFloat8(Datum X);
+static inline float8
+DatumGetFloat8(Datum X)
+{
+ union
+ {
+ int64 value;
+ float8 retval;
+ } myunion;
+
+ myunion.value = GET_8_BYTES(X);
+ return myunion.retval;
+}
#else
#define DatumGetFloat8(X) (* ((float8 *) DatumGetPointer(X)))
#endif
@@ -710,7 +752,22 @@ extern float8 DatumGetFloat8(Datum X);
* to palloc'd space.
*/
+#ifdef USE_FLOAT8_BYVAL
+static inline Datum
+Float8GetDatum(float8 X)
+{
+ union
+ {
+ float8 value;
+ int64 retval;
+ } myunion;
+
+ myunion.value = X;
+ return SET_8_BYTES(myunion.retval);
+}
+#else
extern Datum Float8GetDatum(float8 X);
+#endif
/*
diff --git a/src/include/postgres_ext.h b/src/include/postgres_ext.h
index 74c344c704..452eae9935 100644
--- a/src/include/postgres_ext.h
+++ b/src/include/postgres_ext.h
@@ -39,6 +39,10 @@ typedef unsigned int Oid;
#define OID_MAX UINT_MAX
/* you will need to include <limits.h> to use the above #define */
+#define atooid(x) ((Oid) strtoul((x), NULL, 10))
+/* the above needs <stdlib.h> */
+
+
/* Define a signed 64-bit integer type for use in client API declarations. */
typedef PG_INT64_TYPE pg_int64;
@@ -49,6 +53,7 @@ typedef PG_INT64_TYPE pg_int64;
* applications.
*/
#define PG_DIAG_SEVERITY 'S'
+#define PG_DIAG_SEVERITY_NONLOCALIZED 'V'
#define PG_DIAG_SQLSTATE 'C'
#define PG_DIAG_MESSAGE_PRIMARY 'M'
#define PG_DIAG_MESSAGE_DETAIL 'D'
diff --git a/src/include/postgres_fe.h b/src/include/postgres_fe.h
index 69c0ad8eaa..f49e33bc35 100644
--- a/src/include/postgres_fe.h
+++ b/src/include/postgres_fe.h
@@ -8,7 +8,7 @@
* postgres.h.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1995, Regents of the University of California
*
* src/include/postgres_fe.h
diff --git a/src/include/postmaster/autovacuum.h b/src/include/postmaster/autovacuum.h
index 5b1ee8fd21..e61cc93e55 100644
--- a/src/include/postmaster/autovacuum.h
+++ b/src/include/postmaster/autovacuum.h
@@ -4,7 +4,7 @@
* header file for integrated autovacuum daemon
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -15,6 +15,17 @@
#ifndef AUTOVACUUM_H
#define AUTOVACUUM_H
+#include "storage/block.h"
+
+/*
+ * Other processes can request specific work from autovacuum, identified by
+ * AutoVacuumWorkItem elements.
+ */
+typedef enum
+{
+ AVW_BRINSummarizeRange
+} AutoVacuumWorkItemType;
+
#ifdef PGXC /* PGXC_DATANODE */
@@ -66,6 +77,9 @@ extern void AutovacuumWorkerIAm(void);
extern void AutovacuumLauncherIAm(void);
#endif
+extern void AutoVacuumRequestWork(AutoVacuumWorkItemType type,
+ Oid relationId, BlockNumber blkno);
+
/* shared memory stuff */
extern Size AutoVacuumShmemSize(void);
extern void AutoVacuumShmemInit(void);
diff --git a/src/include/postmaster/bgworker.h b/src/include/postmaster/bgworker.h
index b6889a3320..51a5978ea8 100644
--- a/src/include/postmaster/bgworker.h
+++ b/src/include/postmaster/bgworker.h
@@ -31,7 +31,7 @@
* different) code.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -58,6 +58,15 @@
*/
#define BGWORKER_BACKEND_DATABASE_CONNECTION 0x0002
+/*
+ * This class is used internally for parallel queries, to keep track of the
+ * number of active parallel workers and make sure we never launch more than
+ * max_parallel_workers parallel workers at the same time. Third party
+ * background workers should not use this class.
+ */
+#define BGWORKER_CLASS_PARALLEL 0x0010
+/* add additional bgworker classes here */
+
typedef void (*bgworker_main_type) (Datum main_arg);
@@ -82,9 +91,8 @@ typedef struct BackgroundWorker
int bgw_flags;
BgWorkerStartTime bgw_start_time;
int bgw_restart_time; /* in seconds, or BGW_NEVER_RESTART */
- bgworker_main_type bgw_main;
- char bgw_library_name[BGW_MAXLEN]; /* only if bgw_main is NULL */
- char bgw_function_name[BGW_MAXLEN]; /* only if bgw_main is NULL */
+ char bgw_library_name[BGW_MAXLEN];
+ char bgw_function_name[BGW_MAXLEN];
Datum bgw_main_arg;
char bgw_extra[BGW_EXTRALEN];
pid_t bgw_notify_pid; /* SIGUSR1 this backend on start/stop */
diff --git a/src/include/postmaster/bgworker_internals.h b/src/include/postmaster/bgworker_internals.h
index cd6cd44ef2..9e0b0621cf 100644
--- a/src/include/postmaster/bgworker_internals.h
+++ b/src/include/postmaster/bgworker_internals.h
@@ -2,7 +2,7 @@
* bgworker_internals.h
* POSTGRES pluggable background workers internals
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
@@ -16,6 +16,13 @@
#include "lib/ilist.h"
#include "postmaster/bgworker.h"
+/* GUC options */
+
+/*
+ * Maximum possible value of parallel workers.
+ */
+#define MAX_PARALLEL_WORKER_LIMIT 1024
+
/*
* List of background workers, private to postmaster.
*
@@ -42,6 +49,7 @@ extern void BackgroundWorkerShmemInit(void);
extern void BackgroundWorkerStateChange(void);
extern void ForgetBackgroundWorker(slist_mutable_iter *cur);
extern void ReportBackgroundWorkerPID(RegisteredBgWorker *);
+extern void ReportBackgroundWorkerExit(slist_mutable_iter *cur);
extern void BackgroundWorkerStopNotifications(pid_t pid);
extern void ResetBackgroundWorkerCrashTimes(void);
diff --git a/src/include/postmaster/bgwriter.h b/src/include/postmaster/bgwriter.h
index b162b0dea9..359b3ef5a5 100644
--- a/src/include/postmaster/bgwriter.h
+++ b/src/include/postmaster/bgwriter.h
@@ -6,7 +6,7 @@
* The bgwriter process used to handle checkpointing duties too. Now
* there is a separate process, but we did not bother to split this header.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/postmaster/bgwriter.h
*
diff --git a/src/include/postmaster/fork_process.h b/src/include/postmaster/fork_process.h
index c1cad6e83d..c2bfd44ea0 100644
--- a/src/include/postmaster/fork_process.h
+++ b/src/include/postmaster/fork_process.h
@@ -3,7 +3,7 @@
* fork_process.h
* Exports from postmaster/fork_process.c.
*
- * Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/postmaster/fork_process.h
*
diff --git a/src/include/postmaster/pgarch.h b/src/include/postmaster/pgarch.h
index f2cbfb3952..6a4e0f43b8 100644
--- a/src/include/postmaster/pgarch.h
+++ b/src/include/postmaster/pgarch.h
@@ -3,7 +3,7 @@
* pgarch.h
* Exports from postmaster/pgarch.c.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/postmaster/pgarch.h
@@ -16,7 +16,7 @@
/* ----------
* Archiver control info.
*
- * We expect that archivable files within pg_xlog will have names between
+ * We expect that archivable files within pg_wal will have names between
* MIN_XFN_CHARS and MAX_XFN_CHARS in length, consisting only of characters
* appearing in VALID_XFN_CHARS. The status files in archive_status have
* corresponding names with ".ready" or ".done" appended.
diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h
index b2d7776f2a..95231bf768 100644
--- a/src/include/postmaster/postmaster.h
+++ b/src/include/postmaster/postmaster.h
@@ -3,7 +3,7 @@
* postmaster.h
* Exports from postmaster/postmaster.c.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/postmaster/postmaster.h
diff --git a/src/include/postmaster/startup.h b/src/include/postmaster/startup.h
index 8cd6335719..ce76d94991 100644
--- a/src/include/postmaster/startup.h
+++ b/src/include/postmaster/startup.h
@@ -3,7 +3,7 @@
* startup.h
* Exports from postmaster/startup.c.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/postmaster/startup.h
*
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
index 66c21119de..94d7eac347 100644
--- a/src/include/postmaster/syslogger.h
+++ b/src/include/postmaster/syslogger.h
@@ -3,7 +3,7 @@
* syslogger.h
* Exports from postmaster/syslogger.c.
*
- * Copyright (c) 2004-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2004-2017, PostgreSQL Global Development Group
*
* src/include/postmaster/syslogger.h
*
@@ -87,4 +87,11 @@ extern void write_syslogger_file(const char *buffer, int count, int dest);
extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn();
#endif
+/*
+ * Name of files saving meta-data information about the log
+ * files currently in use by the syslogger
+ */
+#define LOG_METAINFO_DATAFILE "current_logfiles"
+#define LOG_METAINFO_DATAFILE_TMP LOG_METAINFO_DATAFILE ".tmp"
+
#endif /* _SYSLOGGER_H */
diff --git a/src/include/postmaster/walwriter.h b/src/include/postmaster/walwriter.h
index 49c5c1d016..fb91385e0b 100644
--- a/src/include/postmaster/walwriter.h
+++ b/src/include/postmaster/walwriter.h
@@ -3,7 +3,7 @@
* walwriter.h
* Exports from postmaster/walwriter.c.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/postmaster/walwriter.h
*
diff --git a/src/include/regex/regcustom.h b/src/include/regex/regcustom.h
index 60034daee8..82c9e2fad8 100644
--- a/src/include/regex/regcustom.h
+++ b/src/include/regex/regcustom.h
@@ -29,6 +29,13 @@
*/
/* headers if any */
+
+/*
+ * It's against Postgres coding conventions to include postgres.h in a
+ * header file, but we allow the violation here because the regexp library
+ * files specifically intend this file to supply application-dependent
+ * headers, and are careful to include this file before anything else.
+ */
#include "postgres.h"
#include <ctype.h>
@@ -47,6 +54,8 @@
#include "mb/pg_wchar.h"
+#include "miscadmin.h" /* needed by rcancelrequested/rstacktoodeep */
+
/* overrides for regguts.h definitions, if any */
#define FUNCPTR(name, args) (*name) args
@@ -58,15 +67,13 @@
/* internal character type and related */
typedef pg_wchar chr; /* the type itself */
typedef unsigned uchr; /* unsigned type that will hold a chr */
-typedef int celt; /* type to hold chr, or NOCELT */
-#define NOCELT (-1) /* celt value which is not valid chr */
#define CHR(c) ((unsigned char) (c)) /* turn char literal into chr literal */
#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */
#define CHRBITS 32 /* bits in a chr; must not use sizeof */
#define CHR_MIN 0x00000000 /* smallest and largest chr; the value */
#define CHR_MAX 0x7ffffffe /* CHR_MAX-CHR_MIN+1 must fit in an int, and
- * CHR_MAX+1 must fit in both chr and celt */
+ * CHR_MAX+1 must fit in a chr variable */
/*
* Check if a chr value is in range. Ideally we'd just write this as
@@ -79,6 +86,16 @@ typedef int celt; /* type to hold chr, or NOCELT */
*/
#define CHR_IS_IN_RANGE(c) ((c) <= CHR_MAX)
+/*
+ * MAX_SIMPLE_CHR is the cutoff between "simple" and "complicated" processing
+ * in the color map logic. It should usually be chosen high enough to ensure
+ * that all common characters are <= MAX_SIMPLE_CHR. However, very large
+ * values will be counterproductive since they cause more regex setup time.
+ * Also, small values can be helpful for testing the high-color-map logic
+ * with plain old ASCII input.
+ */
+#define MAX_SIMPLE_CHR 0x7FF /* suitable value for Unicode */
+
/* functions operating on chr */
#define iscalnum(x) pg_wc_isalnum(x)
#define iscalpha(x) pg_wc_isalpha(x)
diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h
index 2f89dc9326..cc73db2547 100644
--- a/src/include/regex/regex.h
+++ b/src/include/regex/regex.h
@@ -172,6 +172,5 @@ extern int pg_regexec(regex_t *, const pg_wchar *, size_t, size_t, rm_detail_t *
extern int pg_regprefix(regex_t *, pg_wchar **, size_t *);
extern void pg_regfree(regex_t *);
extern size_t pg_regerror(int, const regex_t *, char *, size_t);
-extern void pg_set_regex_collation(Oid collation);
#endif /* _REGEX_H_ */
diff --git a/src/include/regex/regexport.h b/src/include/regex/regexport.h
index b7da613c95..091c568e63 100644
--- a/src/include/regex/regexport.h
+++ b/src/include/regex/regexport.h
@@ -17,7 +17,7 @@
* line and start/end of string. Colors are numbered 0..C-1, but note that
* color 0 is "white" (all unused characters) and can generally be ignored.
*
- * Portions Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1998, 1999 Henry Spencer
*
* IDENTIFICATION
diff --git a/src/include/regex/regguts.h b/src/include/regex/regguts.h
index 2ceffa6563..69816f1449 100644
--- a/src/include/regex/regguts.h
+++ b/src/include/regex/regguts.h
@@ -127,70 +127,19 @@
#define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS)))
-
-/*
- * We dissect a chr into byts for colormap table indexing. Here we define
- * a byt, which will be the same as a byte on most machines... The exact
- * size of a byt is not critical, but about 8 bits is good, and extraction
- * of 8-bit chunks is sometimes especially fast.
- */
-#ifndef BYTBITS
-#define BYTBITS 8 /* bits in a byt */
-#endif
-#define BYTTAB (1<<BYTBITS) /* size of table with one entry per byt value */
-#define BYTMASK (BYTTAB-1) /* bit mask for byt */
-#define NBYTS ((CHRBITS+BYTBITS-1)/BYTBITS)
-/* the definition of GETCOLOR(), below, assumes NBYTS <= 4 */
-
-
-
/*
* As soon as possible, we map chrs into equivalence classes -- "colors" --
* which are of much more manageable number.
*/
typedef short color; /* colors of characters */
-typedef int pcolor; /* what color promotes to */
#define MAX_COLOR 32767 /* max color (must fit in 'color' datatype) */
#define COLORLESS (-1) /* impossible color */
#define WHITE 0 /* default color, parent of all others */
-
+/* Note: various places in the code know that WHITE is zero */
/*
- * A colormap is a tree -- more precisely, a DAG -- indexed at each level
- * by a byt of the chr, to map the chr to a color efficiently. Because
- * lower sections of the tree can be shared, it can exploit the usual
- * sparseness of such a mapping table. The tree is always NBYTS levels
- * deep (in the past it was shallower during construction but was "filled"
- * to full depth at the end of that); areas that are unaltered as yet point
- * to "fill blocks" which are entirely WHITE in color.
- *
- * Leaf-level tree blocks are of type "struct colors", while upper-level
- * blocks are of type "struct ptrs". Pointers into the tree are generally
- * declared as "union tree *" to be agnostic about what level they point to.
- */
-
-/* the tree itself */
-struct colors
-{
- color ccolor[BYTTAB];
-};
-struct ptrs
-{
- union tree *pptr[BYTTAB];
-};
-union tree
-{
- struct colors colors;
- struct ptrs ptrs;
-};
-
-/* use these pseudo-field names when dereferencing a "union tree" pointer */
-#define tcolor colors.ccolor
-#define tptr ptrs.pptr
-
-/*
* Per-color data structure for the compile-time color machinery
*
* If "sub" is not NOSUB then it is the number of the color's current
@@ -204,26 +153,56 @@ union tree
*/
struct colordesc
{
- uchr nchrs; /* number of chars of this color */
+ int nschrs; /* number of simple chars of this color */
+ int nuchrs; /* number of upper map entries of this color */
color sub; /* open subcolor, if any; or free-chain ptr */
#define NOSUB COLORLESS /* value of "sub" when no open subcolor */
struct arc *arcs; /* chain of all arcs of this color */
- chr firstchr; /* char first assigned to this color */
+ chr firstchr; /* simple char first assigned to this color */
int flags; /* bit values defined next */
#define FREECOL 01 /* currently free */
#define PSEUDO 02 /* pseudocolor, no real chars */
#define UNUSEDCOLOR(cd) ((cd)->flags & FREECOL)
- union tree *block; /* block of solid color, if any */
};
/*
* The color map itself
*
- * Much of the data in the colormap struct is only used at compile time.
- * However, the bulk of the space usage is in the "tree" structure, so it's
- * not clear that there's much point in converting the rest to a more compact
- * form when compilation is finished.
+ * This struct holds both data used only at compile time, and the chr to
+ * color mapping information, used at both compile and run time. The latter
+ * is the bulk of the space, so it's not really worth separating out the
+ * compile-only portion.
+ *
+ * Ideally, the mapping data would just be an array of colors indexed by
+ * chr codes; but for large character sets that's impractical. Fortunately,
+ * common characters have smaller codes, so we can use a simple array for chr
+ * codes up to MAX_SIMPLE_CHR, and do something more complex for codes above
+ * that, without much loss of performance. The "something more complex" is a
+ * 2-D array of color entries, where row indexes correspond to individual chrs
+ * or chr ranges that have been mentioned in the regex (with row zero
+ * representing all other chrs), and column indexes correspond to different
+ * sets of locale-dependent character classes such as "isalpha". The
+ * classbits[k] entry is zero if we do not care about the k'th character class
+ * in this regex, and otherwise it is the bit to be OR'd into the column index
+ * if the character in question is a member of that class. We find the color
+ * of a high-valued chr by identifying which colormaprange it is in to get
+ * the row index (use row zero if it's in none of them), identifying which of
+ * the interesting cclasses it's in to get the column index, and then indexing
+ * into the 2-D hicolormap array.
+ *
+ * The colormapranges are required to be nonempty, nonoverlapping, and to
+ * appear in increasing chr-value order.
*/
+
+#define NUM_CCLASSES 13 /* must match data in regc_locale.c */
+
+typedef struct colormaprange
+{
+ chr cmin; /* range represents cmin..cmax inclusive */
+ chr cmax;
+ int rownum; /* row index in hicolormap array (>= 1) */
+} colormaprange;
+
struct colormap
{
int magic;
@@ -234,27 +213,27 @@ struct colormap
color free; /* beginning of free chain (if non-0) */
struct colordesc *cd; /* pointer to array of colordescs */
#define CDEND(cm) (&(cm)->cd[(cm)->max + 1])
+
+ /* mapping data for chrs <= MAX_SIMPLE_CHR: */
+ color *locolormap; /* simple array indexed by chr code */
+
+ /* mapping data for chrs > MAX_SIMPLE_CHR: */
+ int classbits[NUM_CCLASSES]; /* see comment above */
+ int numcmranges; /* number of colormapranges */
+ colormaprange *cmranges; /* ranges of high chrs */
+ color *hicolormap; /* 2-D array of color entries */
+ int maxarrayrows; /* number of array rows allocated */
+ int hiarrayrows; /* number of array rows in use */
+ int hiarraycols; /* number of array columns (2^N) */
+
/* If we need up to NINLINECDS, we store them here to save a malloc */
-#define NINLINECDS ((size_t)10)
+#define NINLINECDS ((size_t) 10)
struct colordesc cdspace[NINLINECDS];
- union tree tree[NBYTS]; /* tree top, plus lower-level fill blocks */
};
-/* optimization magic to do fast chr->color mapping */
-#define B0(c) ((c) & BYTMASK)
-#define B1(c) (((c)>>BYTBITS) & BYTMASK)
-#define B2(c) (((c)>>(2*BYTBITS)) & BYTMASK)
-#define B3(c) (((c)>>(3*BYTBITS)) & BYTMASK)
-#if NBYTS == 1
-#define GETCOLOR(cm, c) ((cm)->tree->tcolor[B0(c)])
-#endif
-/* beware, for NBYTS>1, GETCOLOR() is unsafe -- 2nd arg used repeatedly */
-#if NBYTS == 2
-#define GETCOLOR(cm, c) ((cm)->tree->tptr[B1(c)]->tcolor[B0(c)])
-#endif
-#if NBYTS == 4
-#define GETCOLOR(cm, c) ((cm)->tree->tptr[B3(c)]->tptr[B2(c)]->tptr[B1(c)]->tcolor[B0(c)])
-#endif
+/* fetch color for chr; beware of multiple evaluation of c argument */
+#define GETCOLOR(cm, c) \
+ ((c) <= MAX_SIMPLE_CHR ? (cm)->locolormap[(c) - CHR_MIN] : pg_reg_getcolor(cm, c))
/*
@@ -265,6 +244,11 @@ struct colormap
* Representation of a set of characters. chrs[] represents individual
* code points, ranges[] represents ranges in the form min..max inclusive.
*
+ * If the cvec represents a locale-specific character class, eg [[:alpha:]],
+ * then the chrs[] and ranges[] arrays contain only members of that class
+ * up to MAX_SIMPLE_CHR (inclusive). cclasscode is set to regc_locale.c's
+ * code for the class, rather than being -1 as it is in an ordinary cvec.
+ *
* Note that in cvecs gotten from newcvec() and intended to be freed by
* freecvec(), both arrays of chrs are after the end of the struct, not
* separately malloc'd; so chrspace and rangespace are effectively immutable.
@@ -277,6 +261,7 @@ struct cvec
int nranges; /* number of ranges (chr pairs) */
int rangespace; /* number of ranges allocated in ranges[] */
chr *ranges; /* pointer to vector of chr pairs */
+ int cclasscode; /* value of "enum classes", or -1 */
};
@@ -490,3 +475,8 @@ struct guts
int nlacons; /* size of lacons[]; note that only slots
* numbered 1 .. nlacons-1 are used */
};
+
+
+/* prototypes for functions that are exported from regcomp.c to regexec.c */
+extern void pg_set_regex_collation(Oid collation);
+extern color pg_reg_getcolor(struct colormap * cm, chr c);
diff --git a/src/include/replication/basebackup.h b/src/include/replication/basebackup.h
index c0a1edd397..bbd446904f 100644
--- a/src/include/replication/basebackup.h
+++ b/src/include/replication/basebackup.h
@@ -3,7 +3,7 @@
* basebackup.h
* Exports from replication/basebackup.c.
*
- * Portions Copyright (c) 2010-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2010-2017, PostgreSQL Global Development Group
*
* src/include/replication/basebackup.h
*
diff --git a/src/include/replication/decode.h b/src/include/replication/decode.h
index 0561abfd73..f9d81d77d0 100644
--- a/src/include/replication/decode.h
+++ b/src/include/replication/decode.h
@@ -2,7 +2,7 @@
* decode.h
* PostgreSQL WAL to logical transformation
*
- * Portions Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h
index 947000e63f..159da7f23f 100644
--- a/src/include/replication/logical.h
+++ b/src/include/replication/logical.h
@@ -2,7 +2,7 @@
* logical.h
* PostgreSQL logical decoding coordination
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
@@ -26,14 +26,22 @@ typedef void (*LogicalOutputPluginWriterWrite) (
typedef LogicalOutputPluginWriterWrite LogicalOutputPluginWriterPrepareWrite;
+typedef void (*LogicalOutputPluginWriterUpdateProgress) (
+ struct LogicalDecodingContext *lr,
+ XLogRecPtr Ptr,
+ TransactionId xid
+);
+
typedef struct LogicalDecodingContext
{
/* memory context this is all allocated in */
MemoryContext context;
- /* infrastructure pieces */
- XLogReaderState *reader;
+ /* The associated replication slot */
ReplicationSlot *slot;
+
+ /* infrastructure pieces for decoding */
+ XLogReaderState *reader;
struct ReorderBuffer *reorder;
struct SnapBuild *snapshot_builder;
@@ -50,6 +58,7 @@ typedef struct LogicalDecodingContext
*/
LogicalOutputPluginWriterPrepareWrite prepare_write;
LogicalOutputPluginWriterWrite write;
+ LogicalOutputPluginWriterUpdateProgress update_progress;
/*
* Output buffer.
@@ -75,19 +84,23 @@ typedef struct LogicalDecodingContext
TransactionId write_xid;
} LogicalDecodingContext;
+
extern void CheckLogicalDecodingRequirements(void);
extern LogicalDecodingContext *CreateInitDecodingContext(char *plugin,
List *output_plugin_options,
+ bool need_full_snapshot,
XLogPageReadCB read_page,
LogicalOutputPluginWriterPrepareWrite prepare_write,
- LogicalOutputPluginWriterWrite do_write);
+ LogicalOutputPluginWriterWrite do_write,
+ LogicalOutputPluginWriterUpdateProgress update_progress);
extern LogicalDecodingContext *CreateDecodingContext(
XLogRecPtr start_lsn,
List *output_plugin_options,
XLogPageReadCB read_page,
LogicalOutputPluginWriterPrepareWrite prepare_write,
- LogicalOutputPluginWriterWrite do_write);
+ LogicalOutputPluginWriterWrite do_write,
+ LogicalOutputPluginWriterUpdateProgress update_progress);
extern void DecodingContextFindStartpoint(LogicalDecodingContext *ctx);
extern bool DecodingContextReady(LogicalDecodingContext *ctx);
extern void FreeDecodingContext(LogicalDecodingContext *ctx);
diff --git a/src/include/replication/logicalfuncs.h b/src/include/replication/logicalfuncs.h
index 554041405c..71faee18cf 100644
--- a/src/include/replication/logicalfuncs.h
+++ b/src/include/replication/logicalfuncs.h
@@ -2,7 +2,7 @@
* logicalfuncs.h
* PostgreSQL WAL to logical transformation support functions
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
@@ -16,11 +16,4 @@ extern int logical_read_local_xlog_page(XLogReaderState *state,
int reqLen, XLogRecPtr targetRecPtr,
char *cur_page, TimeLineID *pageTLI);
-extern Datum pg_logical_slot_get_changes(PG_FUNCTION_ARGS);
-extern Datum pg_logical_slot_get_binary_changes(PG_FUNCTION_ARGS);
-extern Datum pg_logical_slot_peek_changes(PG_FUNCTION_ARGS);
-extern Datum pg_logical_slot_peek_binary_changes(PG_FUNCTION_ARGS);
-
-extern Datum pg_logical_emit_message_bytea(PG_FUNCTION_ARGS);
-extern Datum pg_logical_emit_message_text(PG_FUNCTION_ARGS);
#endif
diff --git a/src/include/replication/logicallauncher.h b/src/include/replication/logicallauncher.h
new file mode 100644
index 0000000000..d202a237e7
--- /dev/null
+++ b/src/include/replication/logicallauncher.h
@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ *
+ * logicallauncher.h
+ * Exports for logical replication launcher.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * src/include/replication/logicallauncher.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef LOGICALLAUNCHER_H
+#define LOGICALLAUNCHER_H
+
+extern int max_logical_replication_workers;
+extern int max_sync_workers_per_subscription;
+
+extern void ApplyLauncherRegister(void);
+extern void ApplyLauncherMain(Datum main_arg);
+
+extern Size ApplyLauncherShmemSize(void);
+extern void ApplyLauncherShmemInit(void);
+
+extern void ApplyLauncherWakeupAtCommit(void);
+extern void AtEOXact_ApplyLauncher(bool isCommit);
+
+#endif /* LOGICALLAUNCHER_H */
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
new file mode 100644
index 0000000000..e7679e29ed
--- /dev/null
+++ b/src/include/replication/logicalproto.h
@@ -0,0 +1,106 @@
+/*-------------------------------------------------------------------------
+ *
+ * logicalproto.h
+ * logical replication protocol
+ *
+ * Copyright (c) 2015, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * src/include/replication/logicalproto.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef LOGICAL_PROTO_H
+#define LOGICAL_PROTO_H
+
+#include "replication/reorderbuffer.h"
+#include "utils/rel.h"
+
+/*
+ * Protocol capabilities
+ *
+ * LOGICAL_PROTO_VERSION_NUM is our native protocol and the greatest version
+ * we can support. PGLOGICAL_PROTO_MIN_VERSION_NUM is the oldest version we
+ * have backwards compatibility for. The client requests protocol version at
+ * connect time.
+ */
+#define LOGICALREP_PROTO_MIN_VERSION_NUM 1
+#define LOGICALREP_PROTO_VERSION_NUM 1
+
+/* Tuple coming via logical replication. */
+typedef struct LogicalRepTupleData
+{
+ /* column values in text format, or NULL for a null value: */
+ char *values[MaxTupleAttributeNumber];
+ /* markers for changed/unchanged column values: */
+ bool changed[MaxTupleAttributeNumber];
+} LogicalRepTupleData;
+
+typedef uint32 LogicalRepRelId;
+
+/* Relation information */
+typedef struct LogicalRepRelation
+{
+ /* Info coming from the remote side. */
+ LogicalRepRelId remoteid; /* unique id of the relation */
+ char *nspname; /* schema name */
+ char *relname; /* relation name */
+ int natts; /* number of columns */
+ char **attnames; /* column names */
+ Oid *atttyps; /* column types */
+ char replident; /* replica identity */
+ Bitmapset *attkeys; /* Bitmap of key columns */
+} LogicalRepRelation;
+
+/* Type mapping info */
+typedef struct LogicalRepTyp
+{
+ Oid remoteid; /* unique id of the type */
+ char *nspname; /* schema name */
+ char *typname; /* name of the type */
+ Oid typoid; /* local type Oid */
+} LogicalRepTyp;
+
+/* Transaction info */
+typedef struct LogicalRepBeginData
+{
+ XLogRecPtr final_lsn;
+ TimestampTz committime;
+ TransactionId xid;
+} LogicalRepBeginData;
+
+typedef struct LogicalRepCommitData
+{
+ XLogRecPtr commit_lsn;
+ XLogRecPtr end_lsn;
+ TimestampTz committime;
+} LogicalRepCommitData;
+
+extern void logicalrep_write_begin(StringInfo out, ReorderBufferTXN *txn);
+extern void logicalrep_read_begin(StringInfo in,
+ LogicalRepBeginData *begin_data);
+extern void logicalrep_write_commit(StringInfo out, ReorderBufferTXN *txn,
+ XLogRecPtr commit_lsn);
+extern void logicalrep_read_commit(StringInfo in,
+ LogicalRepCommitData *commit_data);
+extern void logicalrep_write_origin(StringInfo out, const char *origin,
+ XLogRecPtr origin_lsn);
+extern char *logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn);
+extern void logicalrep_write_insert(StringInfo out, Relation rel,
+ HeapTuple newtuple);
+extern LogicalRepRelId logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
+extern void logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
+ HeapTuple newtuple);
+extern LogicalRepRelId logicalrep_read_update(StringInfo in,
+ bool *has_oldtuple, LogicalRepTupleData *oldtup,
+ LogicalRepTupleData *newtup);
+extern void logicalrep_write_delete(StringInfo out, Relation rel,
+ HeapTuple oldtuple);
+extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
+ LogicalRepTupleData *oldtup);
+extern void logicalrep_write_rel(StringInfo out, Relation rel);
+extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
+extern void logicalrep_write_typ(StringInfo out, Oid typoid);
+extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
+
+#endif /* LOGICALREP_PROTO_H */
diff --git a/src/include/replication/logicalrelation.h b/src/include/replication/logicalrelation.h
new file mode 100644
index 0000000000..3b814d3b2b
--- /dev/null
+++ b/src/include/replication/logicalrelation.h
@@ -0,0 +1,42 @@
+/*-------------------------------------------------------------------------
+ *
+ * logicalrelation.h
+ * Relation definitions for logical replication relation mapping.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * src/include/replication/logicalrelation.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef LOGICALRELATION_H
+#define LOGICALRELATION_H
+
+#include "replication/logicalproto.h"
+
+typedef struct LogicalRepRelMapEntry
+{
+ LogicalRepRelation remoterel; /* key is remoterel.remoteid */
+
+ /* Mapping to local relation, filled as needed. */
+ Oid localreloid; /* local relation id */
+ Relation localrel; /* relcache entry */
+ AttrNumber *attrmap; /* map of local attributes to remote ones */
+ bool updatable; /* Can apply updates/deletes? */
+
+ /* Sync state. */
+ char state;
+ XLogRecPtr statelsn;
+} LogicalRepRelMapEntry;
+
+extern void logicalrep_relmap_update(LogicalRepRelation *remoterel);
+
+extern LogicalRepRelMapEntry *logicalrep_rel_open(LogicalRepRelId remoteid,
+ LOCKMODE lockmode);
+extern void logicalrep_rel_close(LogicalRepRelMapEntry *rel,
+ LOCKMODE lockmode);
+
+extern void logicalrep_typmap_update(LogicalRepTyp *remotetyp);
+extern Oid logicalrep_typmap_getid(Oid remoteid);
+
+#endif /* LOGICALRELATION_H */
diff --git a/src/include/replication/logicalworker.h b/src/include/replication/logicalworker.h
new file mode 100644
index 0000000000..3e0affa190
--- /dev/null
+++ b/src/include/replication/logicalworker.h
@@ -0,0 +1,17 @@
+/*-------------------------------------------------------------------------
+ *
+ * logicalworker.h
+ * Exports for logical replication workers.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * src/include/replication/logicalworker.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef LOGICALWORKER_H
+#define LOGICALWORKER_H
+
+extern void ApplyWorkerMain(Datum main_arg);
+
+#endif /* LOGICALWORKER_H */
diff --git a/src/include/replication/message.h b/src/include/replication/message.h
index 9aff9273bf..b016af7bd7 100644
--- a/src/include/replication/message.h
+++ b/src/include/replication/message.h
@@ -2,7 +2,7 @@
* message.h
* Exports from replication/logical/message.c
*
- * Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* src/include/replication/message.h
*-------------------------------------------------------------------------
diff --git a/src/include/replication/origin.h b/src/include/replication/origin.h
index 22d4643bf9..d6b8eb9d80 100644
--- a/src/include/replication/origin.h
+++ b/src/include/replication/origin.h
@@ -2,7 +2,7 @@
* origin.h
* Exports from replication/logical/origin.c
*
- * Copyright (c) 2013-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* src/include/replication/origin.h
*-------------------------------------------------------------------------
@@ -71,18 +71,4 @@ const char *replorigin_identify(uint8 info);
extern Size ReplicationOriginShmemSize(void);
extern void ReplicationOriginShmemInit(void);
-/* SQL callable functions */
-extern Datum pg_replication_origin_create(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_drop(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_oid(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_session_setup(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_session_reset(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_session_is_setup(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_session_progress(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_xact_setup(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_xact_reset(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_advance(PG_FUNCTION_ARGS);
-extern Datum pg_replication_origin_progress(PG_FUNCTION_ARGS);
-extern Datum pg_show_replication_origin_status(PG_FUNCTION_ARGS);
-
#endif /* PG_ORIGIN_H */
diff --git a/src/include/replication/output_plugin.h b/src/include/replication/output_plugin.h
index 7911cc0a29..2435e2be2d 100644
--- a/src/include/replication/output_plugin.h
+++ b/src/include/replication/output_plugin.h
@@ -2,7 +2,7 @@
* output_plugin.h
* PostgreSQL Logical Decode Plugin Interface
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
@@ -41,43 +41,36 @@ typedef void (*LogicalOutputPluginInit) (struct OutputPluginCallbacks *cb);
* "is_init" will be set to "true" if the decoding slot just got defined. When
* the same slot is used from there one, it will be "false".
*/
-typedef void (*LogicalDecodeStartupCB) (
- struct LogicalDecodingContext *ctx,
+typedef void (*LogicalDecodeStartupCB) (struct LogicalDecodingContext *ctx,
OutputPluginOptions *options,
- bool is_init
-);
+ bool is_init);
/*
* Callback called for every (explicit or implicit) BEGIN of a successful
* transaction.
*/
-typedef void (*LogicalDecodeBeginCB) (
- struct LogicalDecodingContext *,
+typedef void (*LogicalDecodeBeginCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
/*
* Callback for every individual change in a successful transaction.
*/
-typedef void (*LogicalDecodeChangeCB) (
- struct LogicalDecodingContext *,
+typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
Relation relation,
- ReorderBufferChange *change
-);
+ ReorderBufferChange *change);
/*
* Called for every (explicit or implicit) COMMIT of a successful transaction.
*/
-typedef void (*LogicalDecodeCommitCB) (
- struct LogicalDecodingContext *,
+typedef void (*LogicalDecodeCommitCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
XLogRecPtr commit_lsn);
/*
* Called for the generic logical decoding messages.
*/
-typedef void (*LogicalDecodeMessageCB) (
- struct LogicalDecodingContext *,
+typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
XLogRecPtr message_lsn,
bool transactional,
@@ -88,16 +81,13 @@ typedef void (*LogicalDecodeMessageCB) (
/*
* Filter changes by origin.
*/
-typedef bool (*LogicalDecodeFilterByOriginCB) (
- struct LogicalDecodingContext *,
+typedef bool (*LogicalDecodeFilterByOriginCB) (struct LogicalDecodingContext *ctx,
RepOriginId origin_id);
/*
* Called to shutdown an output plugin.
*/
-typedef void (*LogicalDecodeShutdownCB) (
- struct LogicalDecodingContext *
-);
+typedef void (*LogicalDecodeShutdownCB) (struct LogicalDecodingContext *ctx);
/*
* Output plugin callbacks
@@ -113,7 +103,9 @@ typedef struct OutputPluginCallbacks
LogicalDecodeShutdownCB shutdown_cb;
} OutputPluginCallbacks;
-void OutputPluginPrepareWrite(struct LogicalDecodingContext *ctx, bool last_write);
-void OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write);
+/* Functions in replication/logical/logical.c */
+extern void OutputPluginPrepareWrite(struct LogicalDecodingContext *ctx, bool last_write);
+extern void OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write);
+extern void OutputPluginUpdateProgress(struct LogicalDecodingContext *ctx);
#endif /* OUTPUT_PLUGIN_H */
diff --git a/src/include/replication/pgoutput.h b/src/include/replication/pgoutput.h
new file mode 100644
index 0000000000..8cd29ab164
--- /dev/null
+++ b/src/include/replication/pgoutput.h
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * pgoutput.h
+ * Logical Replication output plugin
+ *
+ * Copyright (c) 2015, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * pgoutput.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PGOUTPUT_H
+#define PGOUTPUT_H
+
+#include "nodes/pg_list.h"
+
+typedef struct PGOutputData
+{
+ MemoryContext context; /* private memory context for transient
+ * allocations */
+
+ /* client info */
+ uint32 protocol_version;
+
+ List *publication_names;
+ List *publications;
+} PGOutputData;
+
+#endif /* PGOUTPUT_H */
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index 9e209aef4f..17e47b385b 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -2,7 +2,7 @@
* reorderbuffer.h
* PostgreSQL logical replay/reorder buffer management.
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
* src/include/replication/reorderbuffer.h
*/
@@ -331,6 +331,12 @@ struct ReorderBuffer
MemoryContext context;
/*
+ * Memory contexts for specific types objects
+ */
+ MemoryContext change_context;
+ MemoryContext txn_context;
+
+ /*
* Data structure slab cache.
*
* We allocate/deallocate some structures very frequently, to avoid bigger
@@ -340,14 +346,6 @@ struct ReorderBuffer
* on top of reorderbuffer.c
*/
- /* cached ReorderBufferTXNs */
- dlist_head cached_transactions;
- Size nr_cached_transactions;
-
- /* cached ReorderBufferChanges */
- dlist_head cached_changes;
- Size nr_cached_changes;
-
/* cached ReorderBufferTupleBufs */
slist_head cached_tuplebufs;
Size nr_cached_tuplebufs;
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index e00562d274..9a2dbd7b61 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -2,7 +2,7 @@
* slot.h
* Replication slot management.
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
@@ -28,7 +28,8 @@
typedef enum ReplicationSlotPersistency
{
RS_PERSISTENT,
- RS_EPHEMERAL
+ RS_EPHEMERAL,
+ RS_TEMPORARY
} ReplicationSlotPersistency;
/*
@@ -165,6 +166,7 @@ extern void ReplicationSlotDrop(const char *name);
extern void ReplicationSlotAcquire(const char *name);
extern void ReplicationSlotRelease(void);
+extern void ReplicationSlotCleanup(void);
extern void ReplicationSlotSave(void);
extern void ReplicationSlotMarkDirty(void);
@@ -175,16 +177,11 @@ extern void ReplicationSlotsComputeRequiredXmin(bool already_locked);
extern void ReplicationSlotsComputeRequiredLSN(void);
extern XLogRecPtr ReplicationSlotsComputeLogicalRestartLSN(void);
extern bool ReplicationSlotsCountDBSlots(Oid dboid, int *nslots, int *nactive);
+extern void ReplicationSlotsDropDBSlots(Oid dboid);
extern void StartupReplicationSlots(void);
extern void CheckPointReplicationSlots(void);
extern void CheckSlotRequirements(void);
-/* SQL callable functions */
-extern Datum pg_create_physical_replication_slot(PG_FUNCTION_ARGS);
-extern Datum pg_create_logical_replication_slot(PG_FUNCTION_ARGS);
-extern Datum pg_drop_replication_slot(PG_FUNCTION_ARGS);
-extern Datum pg_get_replication_slots(PG_FUNCTION_ARGS);
-
#endif /* SLOT_H */
diff --git a/src/include/replication/snapbuild.h b/src/include/replication/snapbuild.h
index df229a895c..dc676a0ce2 100644
--- a/src/include/replication/snapbuild.h
+++ b/src/include/replication/snapbuild.h
@@ -3,7 +3,7 @@
* snapbuild.h
* Exports from replication/logical/snapbuild.c.
*
- * Copyright (c) 2012-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2012-2017, PostgreSQL Global Development Group
*
* src/include/replication/snapbuild.h
*
@@ -20,24 +20,30 @@ typedef enum
/*
* Initial state, we can't do much yet.
*/
- SNAPBUILD_START,
+ SNAPBUILD_START = -1,
+
+ /*
+ * Collecting committed transactions, to build the initial catalog
+ * snapshot.
+ */
+ SNAPBUILD_BUILDING_SNAPSHOT = 0,
/*
* We have collected enough information to decode tuples in transactions
* that started after this.
*
* Once we reached this we start to collect changes. We cannot apply them
- * yet because the might be based on transactions that were still running
- * when we reached them yet.
+ * yet, because they might be based on transactions that were still
+ * running when FULL_SNAPSHOT was reached.
*/
- SNAPBUILD_FULL_SNAPSHOT,
+ SNAPBUILD_FULL_SNAPSHOT = 1,
/*
- * Found a point after hitting built_full_snapshot where all transactions
- * that were running at that point finished. Till we reach that we hold
- * off calling any commit callbacks.
+ * Found a point after SNAPBUILD_FULL_SNAPSHOT where all transactions that
+ * were running at that point finished. Till we reach that we hold off
+ * calling any commit callbacks.
*/
- SNAPBUILD_CONSISTENT
+ SNAPBUILD_CONSISTENT = 2
} SnapBuildState;
/* forward declare so we don't have to expose the struct to the public */
@@ -54,11 +60,13 @@ struct xl_running_xacts;
extern void CheckPointSnapBuild(void);
extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *cache,
- TransactionId xmin_horizon, XLogRecPtr start_lsn);
+ TransactionId xmin_horizon, XLogRecPtr start_lsn,
+ bool need_full_snapshot);
extern void FreeSnapshotBuilder(SnapBuild *cache);
extern void SnapBuildSnapDecRefcount(Snapshot snap);
+extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
extern const char *SnapBuildExportSnapshot(SnapBuild *snapstate);
extern void SnapBuildClearExportedSnapshot(void);
@@ -71,9 +79,6 @@ extern bool SnapBuildXactNeedsSkip(SnapBuild *snapstate, XLogRecPtr ptr);
extern void SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn,
TransactionId xid, int nsubxacts,
TransactionId *subxacts);
-extern void SnapBuildAbortTxn(SnapBuild *builder, XLogRecPtr lsn,
- TransactionId xid, int nsubxacts,
- TransactionId *subxacts);
extern bool SnapBuildProcessChange(SnapBuild *builder, TransactionId xid,
XLogRecPtr lsn);
extern void SnapBuildProcessNewCid(SnapBuild *builder, TransactionId xid,
diff --git a/src/include/replication/syncrep.h b/src/include/replication/syncrep.h
index e4e0e27371..1676ea0952 100644
--- a/src/include/replication/syncrep.h
+++ b/src/include/replication/syncrep.h
@@ -3,7 +3,7 @@
* syncrep.h
* Exports from replication/syncrep.c.
*
- * Portions Copyright (c) 2010-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2010-2017, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/include/replication/syncrep.h
@@ -32,6 +32,10 @@
#define SYNC_REP_WAITING 1
#define SYNC_REP_WAIT_COMPLETE 2
+/* syncrep_method of SyncRepConfigData */
+#define SYNC_REP_PRIORITY 0
+#define SYNC_REP_QUORUM 1
+
/*
* Struct for the configuration of synchronous replication.
*
@@ -44,11 +48,14 @@ typedef struct SyncRepConfigData
int config_size; /* total size of this struct, in bytes */
int num_sync; /* number of sync standbys that we need to
* wait for */
+ uint8 syncrep_method; /* method to choose sync standbys */
int nmembers; /* number of members in the following list */
/* member_names contains nmembers consecutive nul-terminated C strings */
char member_names[FLEXIBLE_ARRAY_MEMBER];
} SyncRepConfigData;
+extern SyncRepConfigData *SyncRepConfig;
+
/* communication variables for parsing synchronous_standby_names GUC */
extern SyncRepConfigData *syncrep_parse_result;
extern char *syncrep_parse_error_msg;
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h
index cd787c92b3..31d090c99d 100644
--- a/src/include/replication/walreceiver.h
+++ b/src/include/replication/walreceiver.h
@@ -3,7 +3,7 @@
* walreceiver.h
* Exports from replication/walreceiverfuncs.c.
*
- * Portions Copyright (c) 2010-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2010-2017, PostgreSQL Global Development Group
*
* src/include/replication/walreceiver.h
*
@@ -15,9 +15,12 @@
#include "access/xlog.h"
#include "access/xlogdefs.h"
#include "fmgr.h"
+#include "replication/logicalproto.h"
+#include "replication/walsender.h"
#include "storage/latch.h"
#include "storage/spin.h"
#include "pgtime.h"
+#include "utils/tuplestore.h"
/* user-settable parameters */
extern int wal_receiver_status_interval;
@@ -126,44 +129,161 @@ typedef struct
* Latch used by startup process to wake up walreceiver after telling it
* where to start streaming (after setting receiveStart and
* receiveStartTLI), and also to tell it to send apply feedback to the
- * primary whenever specially marked commit records are applied.
+ * primary whenever specially marked commit records are applied. This is
+ * normally mapped to procLatch when walreceiver is running.
*/
- Latch latch;
+ Latch *latch;
} WalRcvData;
extern WalRcvData *WalRcv;
+typedef struct
+{
+ bool logical; /* True if this is logical replication stream,
+ * false if physical stream. */
+ char *slotname; /* Name of the replication slot or NULL. */
+ XLogRecPtr startpoint; /* LSN of starting point. */
+
+ union
+ {
+ struct
+ {
+ TimeLineID startpointTLI; /* Starting timeline */
+ } physical;
+ struct
+ {
+ uint32 proto_version; /* Logical protocol version */
+ List *publication_names; /* String list of publications */
+ } logical;
+ } proto;
+} WalRcvStreamOptions;
+
+struct WalReceiverConn;
+typedef struct WalReceiverConn WalReceiverConn;
+
+/*
+ * Status of walreceiver query execution.
+ *
+ * We only define statuses that are currently used.
+ */
+typedef enum
+{
+ WALRCV_ERROR, /* There was error when executing the query. */
+ WALRCV_OK_COMMAND, /* Query executed utility or replication
+ * command. */
+ WALRCV_OK_TUPLES, /* Query returned tuples. */
+ WALRCV_OK_COPY_IN, /* Query started COPY FROM. */
+ WALRCV_OK_COPY_OUT, /* Query started COPY TO. */
+ WALRCV_OK_COPY_BOTH /* Query started COPY BOTH replication
+ * protocol. */
+} WalRcvExecStatus;
+
+/*
+ * Return value for walrcv_query, returns the status of the execution and
+ * tuples if any.
+ */
+typedef struct WalRcvExecResult
+{
+ WalRcvExecStatus status;
+ char *err;
+ Tuplestorestate *tuplestore;
+ TupleDesc tupledesc;
+} WalRcvExecResult;
+
/* libpqwalreceiver hooks */
-typedef void (*walrcv_connect_type) (char *conninfo);
-extern PGDLLIMPORT walrcv_connect_type walrcv_connect;
+typedef WalReceiverConn *(*walrcv_connect_fn) (const char *conninfo, bool logical,
+ const char *appname,
+ char **err);
+typedef void (*walrcv_check_conninfo_fn) (const char *conninfo);
+typedef char *(*walrcv_get_conninfo_fn) (WalReceiverConn *conn);
+typedef char *(*walrcv_identify_system_fn) (WalReceiverConn *conn,
+ TimeLineID *primary_tli,
+ int *server_version);
+typedef void (*walrcv_readtimelinehistoryfile_fn) (WalReceiverConn *conn,
+ TimeLineID tli,
+ char **filename,
+ char **content, int *size);
+typedef bool (*walrcv_startstreaming_fn) (WalReceiverConn *conn,
+ const WalRcvStreamOptions *options);
+typedef void (*walrcv_endstreaming_fn) (WalReceiverConn *conn,
+ TimeLineID *next_tli);
+typedef int (*walrcv_receive_fn) (WalReceiverConn *conn, char **buffer,
+ pgsocket *wait_fd);
+typedef void (*walrcv_send_fn) (WalReceiverConn *conn, const char *buffer,
+ int nbytes);
+typedef char *(*walrcv_create_slot_fn) (WalReceiverConn *conn,
+ const char *slotname, bool temporary,
+ CRSSnapshotAction snapshot_action,
+ XLogRecPtr *lsn);
+typedef WalRcvExecResult *(*walrcv_exec_fn) (WalReceiverConn *conn,
+ const char *query,
+ const int nRetTypes,
+ const Oid *retTypes);
+typedef void (*walrcv_disconnect_fn) (WalReceiverConn *conn);
-typedef char *(*walrcv_get_conninfo_type) (void);
-extern PGDLLIMPORT walrcv_get_conninfo_type walrcv_get_conninfo;
+typedef struct WalReceiverFunctionsType
+{
+ walrcv_connect_fn walrcv_connect;
+ walrcv_check_conninfo_fn walrcv_check_conninfo;
+ walrcv_get_conninfo_fn walrcv_get_conninfo;
+ walrcv_identify_system_fn walrcv_identify_system;
+ walrcv_readtimelinehistoryfile_fn walrcv_readtimelinehistoryfile;
+ walrcv_startstreaming_fn walrcv_startstreaming;
+ walrcv_endstreaming_fn walrcv_endstreaming;
+ walrcv_receive_fn walrcv_receive;
+ walrcv_send_fn walrcv_send;
+ walrcv_create_slot_fn walrcv_create_slot;
+ walrcv_exec_fn walrcv_exec;
+ walrcv_disconnect_fn walrcv_disconnect;
+} WalReceiverFunctionsType;
-typedef void (*walrcv_identify_system_type) (TimeLineID *primary_tli);
-extern PGDLLIMPORT walrcv_identify_system_type walrcv_identify_system;
+extern PGDLLIMPORT WalReceiverFunctionsType *WalReceiverFunctions;
-typedef void (*walrcv_readtimelinehistoryfile_type) (TimeLineID tli, char **filename, char **content, int *size);
-extern PGDLLIMPORT walrcv_readtimelinehistoryfile_type walrcv_readtimelinehistoryfile;
+#define walrcv_connect(conninfo, logical, appname, err) \
+ WalReceiverFunctions->walrcv_connect(conninfo, logical, appname, err)
+#define walrcv_check_conninfo(conninfo) \
+ WalReceiverFunctions->walrcv_check_conninfo(conninfo)
+#define walrcv_get_conninfo(conn) \
+ WalReceiverFunctions->walrcv_get_conninfo(conn)
+#define walrcv_identify_system(conn, primary_tli, server_version) \
+ WalReceiverFunctions->walrcv_identify_system(conn, primary_tli, server_version)
+#define walrcv_readtimelinehistoryfile(conn, tli, filename, content, size) \
+ WalReceiverFunctions->walrcv_readtimelinehistoryfile(conn, tli, filename, content, size)
+#define walrcv_startstreaming(conn, options) \
+ WalReceiverFunctions->walrcv_startstreaming(conn, options)
+#define walrcv_endstreaming(conn, next_tli) \
+ WalReceiverFunctions->walrcv_endstreaming(conn, next_tli)
+#define walrcv_receive(conn, buffer, wait_fd) \
+ WalReceiverFunctions->walrcv_receive(conn, buffer, wait_fd)
+#define walrcv_send(conn, buffer, nbytes) \
+ WalReceiverFunctions->walrcv_send(conn, buffer, nbytes)
+#define walrcv_create_slot(conn, slotname, temporary, snapshot_action, lsn) \
+ WalReceiverFunctions->walrcv_create_slot(conn, slotname, temporary, snapshot_action, lsn)
+#define walrcv_exec(conn, exec, nRetTypes, retTypes) \
+ WalReceiverFunctions->walrcv_exec(conn, exec, nRetTypes, retTypes)
+#define walrcv_disconnect(conn) \
+ WalReceiverFunctions->walrcv_disconnect(conn)
-typedef bool (*walrcv_startstreaming_type) (TimeLineID tli, XLogRecPtr startpoint, char *slotname);
-extern PGDLLIMPORT walrcv_startstreaming_type walrcv_startstreaming;
+static inline void
+walrcv_clear_result(WalRcvExecResult *walres)
+{
+ if (!walres)
+ return;
-typedef void (*walrcv_endstreaming_type) (TimeLineID *next_tli);
-extern PGDLLIMPORT walrcv_endstreaming_type walrcv_endstreaming;
+ if (walres->err)
+ pfree(walres->err);
-typedef int (*walrcv_receive_type) (char **buffer, pgsocket *wait_fd);
-extern PGDLLIMPORT walrcv_receive_type walrcv_receive;
+ if (walres->tuplestore)
+ tuplestore_end(walres->tuplestore);
-typedef void (*walrcv_send_type) (const char *buffer, int nbytes);
-extern PGDLLIMPORT walrcv_send_type walrcv_send;
+ if (walres->tupledesc)
+ FreeTupleDesc(walres->tupledesc);
-typedef void (*walrcv_disconnect_type) (void);
-extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect;
+ pfree(walres);
+}
/* prototypes for functions in walreceiver.c */
extern void WalReceiverMain(void) pg_attribute_noreturn();
-extern Datum pg_stat_get_wal_receiver(PG_FUNCTION_ARGS);
/* prototypes for functions in walreceiverfuncs.c */
extern Size WalRcvShmemSize(void);
diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h
index de7338638e..99f12377e0 100644
--- a/src/include/replication/walsender.h
+++ b/src/include/replication/walsender.h
@@ -3,7 +3,7 @@
* walsender.h
* Exports from replication/walsender.c.
*
- * Portions Copyright (c) 2010-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2010-2017, PostgreSQL Global Development Group
*
* src/include/replication/walsender.h
*
@@ -16,6 +16,16 @@
#include "fmgr.h"
+/*
+ * What to do with a snapshot in create replication slot command.
+ */
+typedef enum
+{
+ CRS_EXPORT_SNAPSHOT,
+ CRS_NOEXPORT_SNAPSHOT,
+ CRS_USE_SNAPSHOT
+} CRSSnapshotAction;
+
/* global state */
extern bool am_walsender;
extern bool am_cascading_walsender;
@@ -28,16 +38,15 @@ extern int wal_sender_timeout;
extern bool log_replication_commands;
extern void InitWalSender(void);
-extern void exec_replication_command(const char *query_string);
+extern bool exec_replication_command(const char *query_string);
extern void WalSndErrorCleanup(void);
extern void WalSndSignals(void);
extern Size WalSndShmemSize(void);
extern void WalSndShmemInit(void);
extern void WalSndWakeup(void);
+extern void WalSndWaitStopping(void);
extern void WalSndRqstFileReload(void);
-extern Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS);
-
/*
* Remember that we want to wakeup walsenders later
*
diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h
index 7794aa567e..36311e124c 100644
--- a/src/include/replication/walsender_private.h
+++ b/src/include/replication/walsender_private.h
@@ -3,7 +3,7 @@
* walsender_private.h
* Private definitions from replication/walsender.c.
*
- * Portions Copyright (c) 2010-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2010-2017, PostgreSQL Global Development Group
*
* src/include/replication/walsender_private.h
*
@@ -24,7 +24,8 @@ typedef enum WalSndState
WALSNDSTATE_STARTUP = 0,
WALSNDSTATE_BACKUP,
WALSNDSTATE_CATCHUP,
- WALSNDSTATE_STREAMING
+ WALSNDSTATE_STREAMING,
+ WALSNDSTATE_STOPPING
} WalSndState;
/*
@@ -47,6 +48,11 @@ typedef struct WalSnd
XLogRecPtr flush;
XLogRecPtr apply;
+ /* Measured lag times, or -1 for unknown/none. */
+ TimeOffset writeLag;
+ TimeOffset flushLag;
+ TimeOffset applyLag;
+
/* Protects shared variables shown above. */
slock_t mutex;
diff --git a/src/include/replication/worker_internal.h b/src/include/replication/worker_internal.h
new file mode 100644
index 0000000000..0654461305
--- /dev/null
+++ b/src/include/replication/worker_internal.h
@@ -0,0 +1,97 @@
+/*-------------------------------------------------------------------------
+ *
+ * worker_internal.h
+ * Internal headers shared by logical replication workers.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * src/include/replication/worker_internal.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef WORKER_INTERNAL_H
+#define WORKER_INTERNAL_H
+
+#include <signal.h>
+
+#include "access/xlogdefs.h"
+#include "catalog/pg_subscription.h"
+#include "datatype/timestamp.h"
+#include "storage/lock.h"
+
+typedef struct LogicalRepWorker
+{
+ /* Time at which this worker was launched. */
+ TimestampTz launch_time;
+
+ /* Indicates if this slot is used or free. */
+ bool in_use;
+
+ /* Increased everytime the slot is taken by new worker. */
+ uint16 generation;
+
+ /* Pointer to proc array. NULL if not running. */
+ PGPROC *proc;
+
+ /* Database id to connect to. */
+ Oid dbid;
+
+ /* User to use for connection (will be same as owner of subscription). */
+ Oid userid;
+
+ /* Subscription id for the worker. */
+ Oid subid;
+
+ /* Used for initial table synchronization. */
+ Oid relid;
+ char relstate;
+ XLogRecPtr relstate_lsn;
+ slock_t relmutex;
+
+ /* Stats. */
+ XLogRecPtr last_lsn;
+ TimestampTz last_send_time;
+ TimestampTz last_recv_time;
+ XLogRecPtr reply_lsn;
+ TimestampTz reply_time;
+} LogicalRepWorker;
+
+/* Main memory context for apply worker. Permanent during worker lifetime. */
+extern MemoryContext ApplyContext;
+
+/* libpqreceiver connection */
+extern struct WalReceiverConn *wrconn;
+
+/* Worker and subscription objects. */
+extern Subscription *MySubscription;
+extern LogicalRepWorker *MyLogicalRepWorker;
+
+extern bool in_remote_transaction;
+extern volatile sig_atomic_t got_SIGHUP;
+extern volatile sig_atomic_t got_SIGTERM;
+
+extern void logicalrep_worker_attach(int slot);
+extern LogicalRepWorker *logicalrep_worker_find(Oid subid, Oid relid,
+ bool only_running);
+extern void logicalrep_worker_launch(Oid dbid, Oid subid, const char *subname,
+ Oid userid, Oid relid);
+extern void logicalrep_worker_stop(Oid subid, Oid relid);
+extern void logicalrep_worker_wakeup(Oid subid, Oid relid);
+extern void logicalrep_worker_wakeup_ptr(LogicalRepWorker *worker);
+
+extern int logicalrep_sync_worker_count(Oid subid);
+
+extern void logicalrep_worker_sighup(SIGNAL_ARGS);
+extern void logicalrep_worker_sigterm(SIGNAL_ARGS);
+extern char *LogicalRepSyncTableStart(XLogRecPtr *origin_startpos);
+void process_syncing_tables(XLogRecPtr current_lsn);
+void invalidate_syncing_table_states(Datum arg, int cacheid,
+ uint32 hashvalue);
+
+static inline bool
+am_tablesync_worker(void)
+{
+ return OidIsValid(MyLogicalRepWorker->relid);
+}
+
+#endif /* WORKER_INTERNAL_H */
diff --git a/src/include/rewrite/prs2lock.h b/src/include/rewrite/prs2lock.h
index bb91708beb..36dca02a7e 100644
--- a/src/include/rewrite/prs2lock.h
+++ b/src/include/rewrite/prs2lock.h
@@ -3,7 +3,7 @@
* prs2lock.h
* data structures for POSTGRES Rule System II (rewrite rules only)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rewrite/prs2lock.h
diff --git a/src/include/rewrite/rewriteDefine.h b/src/include/rewrite/rewriteDefine.h
index c08acb4a71..5495700970 100644
--- a/src/include/rewrite/rewriteDefine.h
+++ b/src/include/rewrite/rewriteDefine.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rewrite/rewriteDefine.h
diff --git a/src/include/rewrite/rewriteHandler.h b/src/include/rewrite/rewriteHandler.h
index e3eee523da..4504968437 100644
--- a/src/include/rewrite/rewriteHandler.h
+++ b/src/include/rewrite/rewriteHandler.h
@@ -4,7 +4,7 @@
* External interface to query rewriter.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rewrite/rewriteHandler.h
diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index f941299814..3910bceb2a 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -4,7 +4,7 @@
* Querytree manipulation subroutines for query rewriter.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rewrite/rewriteManip.h
diff --git a/src/include/rewrite/rewriteRemove.h b/src/include/rewrite/rewriteRemove.h
index 0274dfad56..28c9be72db 100644
--- a/src/include/rewrite/rewriteRemove.h
+++ b/src/include/rewrite/rewriteRemove.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rewrite/rewriteRemove.h
diff --git a/src/include/rewrite/rewriteSupport.h b/src/include/rewrite/rewriteSupport.h
index 1841aa9c55..d287bbda78 100644
--- a/src/include/rewrite/rewriteSupport.h
+++ b/src/include/rewrite/rewriteSupport.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rewrite/rewriteSupport.h
@@ -22,7 +22,5 @@ extern bool IsDefinedRewriteRule(Oid owningRel, const char *ruleName);
extern void SetRelationRuleStatus(Oid relationId, bool relHasRules);
extern Oid get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok);
-extern Oid get_rewrite_oid_without_relid(const char *rulename,
- Oid *relid, bool missing_ok);
#endif /* REWRITESUPPORT_H */
diff --git a/src/include/rewrite/rowsecurity.h b/src/include/rewrite/rowsecurity.h
index fd0cbaff59..0e739fd334 100644
--- a/src/include/rewrite/rowsecurity.h
+++ b/src/include/rewrite/rowsecurity.h
@@ -5,7 +5,7 @@
* prototypes for rewrite/rowsecurity.c and the structures for managing
* the row security policies for relations in relcache.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* -------------------------------------------------------------------------
@@ -22,6 +22,7 @@ typedef struct RowSecurityPolicy
char *policy_name; /* Name of the policy */
char polcmd; /* Type of command policy is for */
ArrayType *roles; /* Array of roles policy is for */
+ bool permissive; /* restrictive or permissive policy */
Expr *qual; /* Expression to filter rows */
Expr *with_check_qual; /* Expression to limit rows allowed */
bool hassublinks; /* If either expression has sublinks */
diff --git a/src/include/rusagestub.h b/src/include/rusagestub.h
index 077d5c218d..0e366cab10 100644
--- a/src/include/rusagestub.h
+++ b/src/include/rusagestub.h
@@ -4,7 +4,7 @@
* Stubs for getrusage(3).
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/rusagestub.h
diff --git a/src/include/snowball/header.h b/src/include/snowball/header.h
index 025c146afe..d8be02ee60 100644
--- a/src/include/snowball/header.h
+++ b/src/include/snowball/header.h
@@ -13,7 +13,7 @@
*
* NOTE: this file should not be included into any non-snowball sources!
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/snowball/header.h
*
@@ -22,6 +22,11 @@
#ifndef SNOWBALL_HEADR_H
#define SNOWBALL_HEADR_H
+/*
+ * It's against Postgres coding conventions to include postgres.h in a
+ * header file, but we allow the violation here because the alternative is
+ * to modify the machine-generated .c files provided by the Snowball project.
+ */
#include "postgres.h"
/* Some platforms define MAXINT and/or MININT, causing conflicts */
diff --git a/src/include/statistics/extended_stats_internal.h b/src/include/statistics/extended_stats_internal.h
new file mode 100644
index 0000000000..dc72e2f479
--- /dev/null
+++ b/src/include/statistics/extended_stats_internal.h
@@ -0,0 +1,69 @@
+/*-------------------------------------------------------------------------
+ *
+ * extended_stats_internal.h
+ * POSTGRES extended statistics internal declarations
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * IDENTIFICATION
+ * src/include/statistics/extended_stats_internal.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXTENDED_STATS_INTERNAL_H
+#define EXTENDED_STATS_INTERNAL_H
+
+#include "utils/sortsupport.h"
+#include "statistics/statistics.h"
+
+
+typedef struct
+{
+ Oid eqopr; /* '=' operator for datatype, if any */
+ Oid eqfunc; /* and associated function */
+ Oid ltopr; /* '<' operator for datatype, if any */
+} StdAnalyzeData;
+
+typedef struct
+{
+ Datum value; /* a data value */
+ int tupno; /* position index for tuple it came from */
+} ScalarItem;
+
+/* multi-sort */
+typedef struct MultiSortSupportData
+{
+ int ndims; /* number of dimensions supported by the */
+ SortSupportData ssup[1]; /* sort support data for each dimension */
+} MultiSortSupportData;
+
+typedef MultiSortSupportData *MultiSortSupport;
+
+typedef struct SortItem
+{
+ Datum *values;
+ bool *isnull;
+} SortItem;
+
+extern MVNDistinct *statext_ndistinct_build(double totalrows,
+ int numrows, HeapTuple *rows,
+ Bitmapset *attrs, VacAttrStats **stats);
+extern bytea *statext_ndistinct_serialize(MVNDistinct *ndistinct);
+extern MVNDistinct *statext_ndistinct_deserialize(bytea *data);
+
+extern MVDependencies *statext_dependencies_build(int numrows, HeapTuple *rows,
+ Bitmapset *attrs, VacAttrStats **stats);
+extern bytea *statext_dependencies_serialize(MVDependencies *dependencies);
+extern MVDependencies *statext_dependencies_deserialize(bytea *data);
+
+extern MultiSortSupport multi_sort_init(int ndims);
+extern void multi_sort_add_dimension(MultiSortSupport mss, int sortdim,
+ Oid oper);
+extern int multi_sort_compare(const void *a, const void *b, void *arg);
+extern int multi_sort_compare_dim(int dim, const SortItem *a,
+ const SortItem *b, MultiSortSupport mss);
+extern int multi_sort_compare_dims(int start, int end, const SortItem *a,
+ const SortItem *b, MultiSortSupport mss);
+
+#endif /* EXTENDED_STATS_INTERNAL_H */
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
new file mode 100644
index 0000000000..a3f0d90195
--- /dev/null
+++ b/src/include/statistics/statistics.h
@@ -0,0 +1,98 @@
+/*-------------------------------------------------------------------------
+ *
+ * statistics.h
+ * Extended statistics and selectivity estimation functions.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/statistics/statistics.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef STATISTICS_H
+#define STATISTICS_H
+
+#include "commands/vacuum.h"
+#include "nodes/relation.h"
+
+#define STATS_MAX_DIMENSIONS 8 /* max number of attributes */
+
+/* Multivariate distinct coefficients */
+#define STATS_NDISTINCT_MAGIC 0xA352BFA4 /* struct identifier */
+#define STATS_NDISTINCT_TYPE_BASIC 1 /* struct version */
+
+/* MVDistinctItem represents a single combination of columns */
+typedef struct MVNDistinctItem
+{
+ double ndistinct; /* ndistinct value for this combination */
+ Bitmapset *attrs; /* attr numbers of items */
+} MVNDistinctItem;
+/* size of the struct, excluding attribute list */
+#define SizeOfMVNDistinctItem \
+ (offsetof(MVNDistinctItem, ndistinct) + sizeof(double))
+
+/* A MVNDistinct object, comprising all possible combinations of columns */
+typedef struct MVNDistinct
+{
+ uint32 magic; /* magic constant marker */
+ uint32 type; /* type of ndistinct (BASIC) */
+ uint32 nitems; /* number of items in the statistic */
+ MVNDistinctItem items[FLEXIBLE_ARRAY_MEMBER];
+} MVNDistinct;
+
+/* size of the struct excluding the items array */
+#define SizeOfMVNDistinct (offsetof(MVNDistinct, nitems) + sizeof(uint32))
+
+
+/* size of the struct excluding the items array */
+#define SizeOfMVNDistinct (offsetof(MVNDistinct, nitems) + sizeof(uint32))
+
+#define STATS_DEPS_MAGIC 0xB4549A2C /* marks serialized bytea */
+#define STATS_DEPS_TYPE_BASIC 1 /* basic dependencies type */
+
+/*
+ * Functional dependencies, tracking column-level relationships (values
+ * in one column determine values in another one).
+ */
+typedef struct MVDependency
+{
+ double degree; /* degree of validity (0-1) */
+ AttrNumber nattributes; /* number of attributes */
+ AttrNumber attributes[FLEXIBLE_ARRAY_MEMBER]; /* attribute numbers */
+} MVDependency;
+
+/* size of the struct excluding the deps array */
+#define SizeOfDependency \
+ (offsetof(MVDependency, nattributes) + sizeof(AttrNumber))
+
+typedef struct MVDependencies
+{
+ uint32 magic; /* magic constant marker */
+ uint32 type; /* type of MV Dependencies (BASIC) */
+ uint32 ndeps; /* number of dependencies */
+ MVDependency *deps[FLEXIBLE_ARRAY_MEMBER]; /* dependencies */
+} MVDependencies;
+
+/* size of the struct excluding the deps array */
+#define SizeOfDependencies (offsetof(MVDependencies, ndeps) + sizeof(uint32))
+
+extern MVNDistinct *statext_ndistinct_load(Oid mvoid);
+extern MVDependencies *staext_dependencies_load(Oid mvoid);
+
+extern void BuildRelationExtStatistics(Relation onerel, double totalrows,
+ int numrows, HeapTuple *rows,
+ int natts, VacAttrStats **vacattrstats);
+extern bool statext_is_kind_built(HeapTuple htup, char kind);
+extern Selectivity dependencies_clauselist_selectivity(PlannerInfo *root,
+ List *clauses,
+ int varRelid,
+ JoinType jointype,
+ SpecialJoinInfo *sjinfo,
+ RelOptInfo *rel,
+ Bitmapset **estimatedclauses);
+extern bool has_stats_of_kind(List *stats, char requiredkind);
+extern StatisticExtInfo *choose_best_statistics(List *stats,
+ Bitmapset *attnums, char requiredkind);
+
+#endif /* STATISTICS_H */
diff --git a/src/include/storage/backendid.h b/src/include/storage/backendid.h
index 4ec99d8a18..3445caeb93 100644
--- a/src/include/storage/backendid.h
+++ b/src/include/storage/backendid.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/backendid.h
diff --git a/src/include/storage/barrier.h b/src/include/storage/barrier.h
deleted file mode 100644
index 6202e57608..0000000000
--- a/src/include/storage/barrier.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * barrier.h
- * Memory barrier operations.
- *
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/storage/barrier.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef BARRIER_H
-#define BARRIER_H
-
-/*
- * This used to be a separate file, full of compiler/architecture
- * dependent defines, but it's not included in the atomics.h
- * infrastructure and just kept for backward compatibility.
- */
-#include "port/atomics.h"
-
-#endif /* BARRIER_H */
diff --git a/src/include/storage/block.h b/src/include/storage/block.h
index 1bfad18ddd..ec847bbb7a 100644
--- a/src/include/storage/block.h
+++ b/src/include/storage/block.h
@@ -4,7 +4,7 @@
* POSTGRES disk block definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/block.h
diff --git a/src/include/storage/buf.h b/src/include/storage/buf.h
index e641c4504c..ac33b83b4b 100644
--- a/src/include/storage/buf.h
+++ b/src/include/storage/buf.h
@@ -4,7 +4,7 @@
* Basic buffer manager data types.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/buf.h
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h
index e0dfb2f5b0..ff99f6b5e2 100644
--- a/src/include/storage/buf_internals.h
+++ b/src/include/storage/buf_internals.h
@@ -5,7 +5,7 @@
* strategy.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/buf_internals.h
@@ -64,8 +64,8 @@
#define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */
#define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */
#define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */
-#define BM_PERMANENT (1U << 31) /* permanent relation (not
- * unlogged) */
+#define BM_PERMANENT (1U << 31) /* permanent buffer (not
+ * unlogged, or init fork) */
/*
* The maximum allowed value of usage_count represents a tradeoff between
* accuracy and speed of the clock-sweep buffer management algorithm. A
@@ -168,7 +168,8 @@ typedef struct buftag
* We use this same struct for local buffer headers, but the locks are not
* used and not all of the flag bits are useful either. To avoid unnecessary
* overhead, manipulations of the state field should be done without actual
- * atomic operations (i.e. only pg_atomic_read/write).
+ * atomic operations (i.e. only pg_atomic_read_u32() and
+ * pg_atomic_unlocked_write_u32()).
*
* Be careful to avoid increasing the size of the struct when adding or
* reordering members. Keeping it below 64 bytes (the most common CPU
diff --git a/src/include/storage/buffile.h b/src/include/storage/buffile.h
index 809e5962e4..fe00bf0c31 100644
--- a/src/include/storage/buffile.h
+++ b/src/include/storage/buffile.h
@@ -15,7 +15,7 @@
* but currently we have no need for oversize temp files without buffered
* access.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/buffile.h
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index fcd0c75b1c..07a32d6dfc 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -4,7 +4,7 @@
* POSTGRES buffer manager definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/bufmgr.h
@@ -14,7 +14,6 @@
#ifndef BUFMGR_H
#define BUFMGR_H
-#include "catalog/catalog.h"
#include "storage/block.h"
#include "storage/buf.h"
#include "storage/bufpage.h"
@@ -55,17 +54,6 @@ struct WritebackContext;
extern PGDLLIMPORT int NBuffers;
/* in bufmgr.c */
-#define WRITEBACK_MAX_PENDING_FLUSHES 256
-
-/* FIXME: Also default to on for mmap && msync(MS_ASYNC)? */
-#ifdef HAVE_SYNC_FILE_RANGE
-#define DEFAULT_CHECKPOINT_FLUSH_AFTER 32
-#define DEFAULT_BGWRITER_FLUSH_AFTER 64
-#else
-#define DEFAULT_CHECKPOINT_FLUSH_AFTER 0
-#define DEFAULT_BGWRITER_FLUSH_AFTER 0
-#endif /* HAVE_SYNC_FILE_RANGE */
-
extern bool zero_damaged_pages;
extern int bgwriter_lru_maxpages;
extern double bgwriter_lru_multiplier;
@@ -228,6 +216,7 @@ extern void LockBuffer(Buffer buffer, int mode);
extern bool ConditionalLockBuffer(Buffer buffer);
extern void LockBufferForCleanup(Buffer buffer);
extern bool ConditionalLockBufferForCleanup(Buffer buffer);
+extern bool IsBufferCleanupOK(Buffer buffer);
extern bool HoldingBufferPinThatDelaysRecovery(void);
extern void AbortBufferIO(void);
@@ -248,7 +237,7 @@ extern void FreeAccessStrategy(BufferAccessStrategy strategy);
/*
* Although this header file is nominally backend-only, certain frontend
- * programs like pg_xlogdump include it. For compilers that emit static
+ * programs like pg_waldump include it. For compilers that emit static
* inline functions even when they're unused, that leads to unsatisfied
* external references; hence hide these with #ifndef FRONTEND.
*/
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 15cebfc60d..e956dc3386 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -4,7 +4,7 @@
* Standard POSTGRES buffer page definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/bufpage.h
@@ -409,12 +409,14 @@ do { \
*/
#define PAI_OVERWRITE (1 << 0)
#define PAI_IS_HEAP (1 << 1)
-#define PAI_ALLOW_FAR_OFFSET (1 << 2)
+
+#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \
+ PageAddItemExtended(page, item, size, offsetNumber, \
+ ((overwrite) ? PAI_OVERWRITE : 0) | \
+ ((is_heap) ? PAI_IS_HEAP : 0))
extern void PageInit(Page page, Size pageSize, Size specialSize);
extern bool PageIsVerified(Page page, BlockNumber blkno);
-extern OffsetNumber PageAddItem(Page page, Item item, Size size,
- OffsetNumber offsetNumber, bool overwrite, bool is_heap);
extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size,
OffsetNumber offsetNumber, int flags);
extern Page PageGetTempPage(Page page);
@@ -423,12 +425,14 @@ extern Page PageGetTempPageCopySpecial(Page page);
extern void PageRestoreTempPage(Page tempPage, Page oldPage);
extern void PageRepairFragmentation(Page page);
extern Size PageGetFreeSpace(Page page);
+extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups);
extern Size PageGetExactFreeSpace(Page page);
extern Size PageGetHeapFreeSpace(Page page);
extern void PageIndexTupleDelete(Page page, OffsetNumber offset);
extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems);
-extern void PageIndexDeleteNoCompact(Page page, OffsetNumber *itemnos,
- int nitems);
+extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offset);
+extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
+ Item newtup, Size newsize);
extern char *PageSetChecksumCopy(Page page, BlockNumber blkno);
extern void PageSetChecksumInplace(Page page, BlockNumber blkno);
diff --git a/src/include/storage/checksum.h b/src/include/storage/checksum.h
index 5afc23f607..682043f8e7 100644
--- a/src/include/storage/checksum.h
+++ b/src/include/storage/checksum.h
@@ -3,7 +3,7 @@
* checksum.h
* Checksum implementation for data pages.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/checksum.h
diff --git a/src/include/storage/checksum_impl.h b/src/include/storage/checksum_impl.h
index ce141258c9..bffd061de8 100644
--- a/src/include/storage/checksum_impl.h
+++ b/src/include/storage/checksum_impl.h
@@ -8,7 +8,7 @@
* referenced by storage/checksum.h. (Note: you may need to redefine
* Assert() as empty to compile this successfully externally.)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/checksum_impl.h
diff --git a/src/include/storage/condition_variable.h b/src/include/storage/condition_variable.h
new file mode 100644
index 0000000000..89f5d5804b
--- /dev/null
+++ b/src/include/storage/condition_variable.h
@@ -0,0 +1,59 @@
+/*-------------------------------------------------------------------------
+ *
+ * condition_variable.h
+ * Condition variables
+ *
+ * A condition variable is a method of waiting until a certain condition
+ * becomes true. Conventionally, a condition variable supports three
+ * operations: (1) sleep; (2) signal, which wakes up one process sleeping
+ * on the condition variable; and (3) broadcast, which wakes up every
+ * process sleeping on the condition variable. In our implementation,
+ * condition variables put a process into an interruptible sleep (so it
+ * can be cancelled prior to the fulfillment of the condition) and do not
+ * use pointers internally (so that they are safe to use within DSMs).
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/storage/condition_variable.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef CONDITION_VARIABLE_H
+#define CONDITION_VARIABLE_H
+
+#include "storage/s_lock.h"
+#include "storage/proclist_types.h"
+
+typedef struct
+{
+ slock_t mutex;
+ proclist_head wakeup;
+} ConditionVariable;
+
+/* Initialize a condition variable. */
+extern void ConditionVariableInit(ConditionVariable *);
+
+/*
+ * To sleep on a condition variable, a process should use a loop which first
+ * checks the condition, exiting the loop if it is met, and then calls
+ * ConditionVariableSleep. Spurious wakeups are possible, but should be
+ * infrequent. After exiting the loop, ConditionVariableCancelSleep should
+ * be called to ensure that the process is no longer in the wait list for
+ * the condition variable.
+ */
+extern void ConditionVariableSleep(ConditionVariable *, uint32 wait_event_info);
+extern void ConditionVariableCancelSleep(void);
+
+/*
+ * The use of this function is optional and not necessary for correctness;
+ * for efficiency, it should be called prior entering the loop described above
+ * if it is thought that the condition is unlikely to hold immediately.
+ */
+extern void ConditionVariablePrepareToSleep(ConditionVariable *);
+
+/* Wake up a single waiter (via signal) or all waiters (via broadcast). */
+extern bool ConditionVariableSignal(ConditionVariable *);
+extern int ConditionVariableBroadcast(ConditionVariable *);
+
+#endif /* CONDITION_VARIABLE_H */
diff --git a/src/include/storage/copydir.h b/src/include/storage/copydir.h
index 4b7b813e7e..c3722b4033 100644
--- a/src/include/storage/copydir.h
+++ b/src/include/storage/copydir.h
@@ -3,7 +3,7 @@
* copydir.h
* Copy a directory.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/copydir.h
diff --git a/src/include/storage/dsm.h b/src/include/storage/dsm.h
index 86ede7a7e7..7d1250c1e0 100644
--- a/src/include/storage/dsm.h
+++ b/src/include/storage/dsm.h
@@ -3,7 +3,7 @@
* dsm.h
* manage dynamic shared memory segments
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/dsm.h
@@ -19,6 +19,9 @@ typedef struct dsm_segment dsm_segment;
#define DSM_CREATE_NULL_IF_MAXSEGMENTS 0x0001
+/* A sentinel value for an invalid DSM handle. */
+#define DSM_HANDLE_INVALID 0
+
/* Startup and shutdown functions. */
struct PGShmemHeader; /* avoid including pg_shmem.h */
extern void dsm_cleanup_using_control_segment(dsm_handle old_control_handle);
@@ -41,6 +44,7 @@ extern void dsm_detach(dsm_segment *seg);
extern void dsm_pin_mapping(dsm_segment *seg);
extern void dsm_unpin_mapping(dsm_segment *seg);
extern void dsm_pin_segment(dsm_segment *seg);
+extern void dsm_unpin_segment(dsm_handle h);
extern dsm_segment *dsm_find_mapping(dsm_handle h);
/* Informational functions. */
diff --git a/src/include/storage/dsm_impl.h b/src/include/storage/dsm_impl.h
index ec05e22a6b..51c217899d 100644
--- a/src/include/storage/dsm_impl.h
+++ b/src/include/storage/dsm_impl.h
@@ -3,7 +3,7 @@
* dsm_impl.h
* low-level dynamic shared memory primitives
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/dsm_impl.h
@@ -73,6 +73,8 @@ extern bool dsm_impl_op(dsm_op op, dsm_handle handle, Size request_size,
extern bool dsm_impl_can_resize(void);
/* Implementation-dependent actions required to keep segment until shutdown. */
-extern void dsm_impl_pin_segment(dsm_handle handle, void *impl_private);
+extern void dsm_impl_pin_segment(dsm_handle handle, void *impl_private,
+ void **impl_private_pm_handle);
+extern void dsm_impl_unpin_segment(dsm_handle handle, void **impl_private);
#endif /* DSM_IMPL_H */
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index cbc2224685..05680499e4 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -4,7 +4,7 @@
* Virtual file descriptor definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/fd.h
@@ -68,13 +68,13 @@ extern int max_safe_fds;
extern File PathNameOpenFile(FileName fileName, int fileFlags, int fileMode);
extern File OpenTemporaryFile(bool interXact);
extern void FileClose(File file);
-extern int FilePrefetch(File file, off_t offset, int amount);
-extern int FileRead(File file, char *buffer, int amount);
-extern int FileWrite(File file, char *buffer, int amount);
-extern int FileSync(File file);
+extern int FilePrefetch(File file, off_t offset, int amount, uint32 wait_event_info);
+extern int FileRead(File file, char *buffer, int amount, uint32 wait_event_info);
+extern int FileWrite(File file, char *buffer, int amount, uint32 wait_event_info);
+extern int FileSync(File file, uint32 wait_event_info);
extern off_t FileSeek(File file, off_t offset, int whence);
-extern int FileTruncate(File file, off_t offset);
-extern void FileWriteback(File file, off_t offset, off_t nbytes);
+extern int FileTruncate(File file, off_t offset, uint32 wait_event_info);
+extern void FileWriteback(File file, off_t offset, off_t nbytes, uint32 wait_event_info);
extern char *FilePathName(File file);
extern int FileGetRawDesc(File file);
extern int FileGetRawFlags(File file);
@@ -119,6 +119,7 @@ extern int pg_fdatasync(int fd);
extern void pg_flush_data(int fd, off_t offset, off_t amount);
extern void fsync_fname(const char *fname, bool isdir);
extern int durable_rename(const char *oldfile, const char *newfile, int loglevel);
+extern int durable_unlink(const char *fname, int loglevel);
extern int durable_link_or_rename(const char *oldfile, const char *newfile, int loglevel);
extern void SyncDataDirectory(void);
diff --git a/src/include/storage/freespace.h b/src/include/storage/freespace.h
index 77b3bc3dc7..9a5c9f4be4 100644
--- a/src/include/storage/freespace.h
+++ b/src/include/storage/freespace.h
@@ -4,7 +4,7 @@
* POSTGRES free space map for quickly finding free space in relations
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/freespace.h
diff --git a/src/include/storage/fsm_internals.h b/src/include/storage/fsm_internals.h
index 58383eed1f..4eb3fc12b1 100644
--- a/src/include/storage/fsm_internals.h
+++ b/src/include/storage/fsm_internals.h
@@ -4,7 +4,7 @@
* internal functions for free space map
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/fsm_internals.h
diff --git a/src/include/storage/indexfsm.h b/src/include/storage/indexfsm.h
index 3cb2fc857d..b256ee6aef 100644
--- a/src/include/storage/indexfsm.h
+++ b/src/include/storage/indexfsm.h
@@ -4,7 +4,7 @@
* POSTGRES free space map for quickly finding an unused page in index
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/indexfsm.h
diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h
index 7a07bd29ce..8d5a6b2698 100644
--- a/src/include/storage/ipc.h
+++ b/src/include/storage/ipc.h
@@ -8,7 +8,7 @@
* exit-time cleanup for either a postmaster or a backend.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/ipc.h
diff --git a/src/include/storage/item.h b/src/include/storage/item.h
index e10448c343..d19e19e01b 100644
--- a/src/include/storage/item.h
+++ b/src/include/storage/item.h
@@ -4,7 +4,7 @@
* POSTGRES disk item definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/item.h
diff --git a/src/include/storage/itemid.h b/src/include/storage/itemid.h
index 509c577926..af77852cc0 100644
--- a/src/include/storage/itemid.h
+++ b/src/include/storage/itemid.h
@@ -4,7 +4,7 @@
* Standard POSTGRES buffer page item identifier definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/itemid.h
diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h
index 7ec7ed30c9..c21d2adfcb 100644
--- a/src/include/storage/itemptr.h
+++ b/src/include/storage/itemptr.h
@@ -4,7 +4,7 @@
* POSTGRES disk item pointer definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/itemptr.h
@@ -30,9 +30,8 @@
* structure padding bytes. The struct is designed to be six bytes long
* (it contains three int16 fields) but a few compilers will pad it to
* eight bytes unless coerced. We apply appropriate persuasion where
- * possible, and to cope with unpersuadable compilers, we try to use
- * "SizeOfIptrData" rather than "sizeof(ItemPointerData)" when computing
- * on-disk sizes.
+ * possible. If your compiler can't be made to play along, you'll waste
+ * lots of space.
*/
typedef struct ItemPointerData
{
@@ -46,9 +45,6 @@ pg_attribute_aligned(2)
#endif
ItemPointerData;
-#define SizeOfIptrData \
- (offsetof(ItemPointerData, ip_posid) + sizeof(OffsetNumber))
-
typedef ItemPointerData *ItemPointer;
/* ----------------
@@ -64,23 +60,41 @@ typedef ItemPointerData *ItemPointer;
((bool) (PointerIsValid(pointer) && ((pointer)->ip_posid != 0)))
/*
- * ItemPointerGetBlockNumber
+ * ItemPointerGetBlockNumberNoCheck
* Returns the block number of a disk item pointer.
*/
+#define ItemPointerGetBlockNumberNoCheck(pointer) \
+( \
+ BlockIdGetBlockNumber(&(pointer)->ip_blkid) \
+)
+
+/*
+ * ItemPointerGetBlockNumber
+ * As above, but verifies that the item pointer looks valid.
+ */
#define ItemPointerGetBlockNumber(pointer) \
( \
AssertMacro(ItemPointerIsValid(pointer)), \
- BlockIdGetBlockNumber(&(pointer)->ip_blkid) \
+ ItemPointerGetBlockNumberNoCheck(pointer) \
)
/*
- * ItemPointerGetOffsetNumber
+ * ItemPointerGetOffsetNumberNoCheck
* Returns the offset number of a disk item pointer.
*/
+#define ItemPointerGetOffsetNumberNoCheck(pointer) \
+( \
+ (pointer)->ip_posid \
+)
+
+/*
+ * ItemPointerGetOffsetNumber
+ * As above, but verifies that the item pointer looks valid.
+ */
#define ItemPointerGetOffsetNumber(pointer) \
( \
AssertMacro(ItemPointerIsValid(pointer)), \
- (pointer)->ip_posid \
+ ItemPointerGetOffsetNumberNoCheck(pointer) \
)
/*
diff --git a/src/include/storage/large_object.h b/src/include/storage/large_object.h
index 6a4f3f6d1f..fc55019b98 100644
--- a/src/include/storage/large_object.h
+++ b/src/include/storage/large_object.h
@@ -5,7 +5,7 @@
* zillions of large objects (internal, external, jaquith, inversion).
* Now we only support inversion.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/large_object.h
diff --git a/src/include/storage/latch.h b/src/include/storage/latch.h
index 5179ecc0db..3158d7bec6 100644
--- a/src/include/storage/latch.h
+++ b/src/include/storage/latch.h
@@ -90,7 +90,7 @@
* efficient than using WaitLatch or WaitLatchOrSocket.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/latch.h
@@ -133,6 +133,9 @@ typedef struct WaitEvent
uint32 events; /* triggered events */
pgsocket fd; /* socket fd associated with event */
void *user_data; /* pointer provided in AddWaitEventToSet */
+#ifdef WIN32
+ bool reset; /* Is reset of the event required? */
+#endif
} WaitEvent;
/* forward declaration to avoid exposing latch.c implementation details */
@@ -155,10 +158,13 @@ extern int AddWaitEventToSet(WaitEventSet *set, uint32 events, pgsocket fd,
Latch *latch, void *user_data);
extern void ModifyWaitEvent(WaitEventSet *set, int pos, uint32 events, Latch *latch);
-extern int WaitEventSetWait(WaitEventSet *set, long timeout, WaitEvent *occurred_events, int nevents);
-extern int WaitLatch(volatile Latch *latch, int wakeEvents, long timeout);
+extern int WaitEventSetWait(WaitEventSet *set, long timeout,
+ WaitEvent *occurred_events, int nevents,
+ uint32 wait_event_info);
+extern int WaitLatch(volatile Latch *latch, int wakeEvents, long timeout,
+ uint32 wait_event_info);
extern int WaitLatchOrSocket(volatile Latch *latch, int wakeEvents,
- pgsocket sock, long timeout);
+ pgsocket sock, long timeout, uint32 wait_event_info);
/*
* Unix implementation uses SIGUSR1 for inter-process signaling.
diff --git a/src/include/storage/lmgr.h b/src/include/storage/lmgr.h
index 8288e7d505..2a1244c836 100644
--- a/src/include/storage/lmgr.h
+++ b/src/include/storage/lmgr.h
@@ -4,7 +4,7 @@
* POSTGRES lock manager definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/lmgr.h
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
index b546e7a53a..3abeb59fc7 100644
--- a/src/include/storage/lock.h
+++ b/src/include/storage/lock.h
@@ -4,7 +4,7 @@
* POSTGRES low-level lock mechanism
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/lock.h
diff --git a/src/include/storage/lockdefs.h b/src/include/storage/lockdefs.h
index dd7cb164c8..bfeb8779f7 100644
--- a/src/include/storage/lockdefs.h
+++ b/src/include/storage/lockdefs.h
@@ -7,7 +7,7 @@
* contains definition that have to (indirectly) be available when included by
* FRONTEND code.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/lockdefs.h
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index a8dfbf2ee6..c22daef179 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/lwlock.h
@@ -19,39 +19,13 @@
#error "lwlock.h may not be included from frontend code"
#endif
-#include "lib/ilist.h"
+#include "storage/proclist_types.h"
#include "storage/s_lock.h"
#include "port/atomics.h"
struct PGPROC;
/*
- * Prior to PostgreSQL 9.4, every lightweight lock in the system was stored
- * in a single array. For convenience and for compatibility with past
- * releases, we still have a main array, but it's now also permissible to
- * store LWLocks elsewhere in the main shared memory segment or in a dynamic
- * shared memory segment. Each array of lwlocks forms a separate "tranche".
- *
- * It's occasionally necessary to identify a particular LWLock "by name"; e.g.
- * because we wish to report the lock to dtrace. We could store a name or
- * other identifying information in the lock itself, but since it's common
- * to have many nearly-identical locks (e.g. one per buffer) this would end
- * up wasting significant amounts of memory. Instead, each lwlock stores a
- * tranche ID which tells us which array it's part of. Based on that, we can
- * figure out where the lwlock lies within the array using the data structure
- * shown below; the lock is then identified based on the tranche name and
- * computed array index. We need the array stride because the array might not
- * be an array of lwlocks, but rather some larger data structure that includes
- * one or more lwlocks per element.
- */
-typedef struct LWLockTranche
-{
- const char *name;
- void *array_base;
- Size array_stride;
-} LWLockTranche;
-
-/*
* Code outside of lwlock.c should not manipulate the contents of this
* structure directly, but we have to declare it here to allow LWLocks to be
* incorporated into other data structures.
@@ -60,7 +34,7 @@ typedef struct LWLock
{
uint16 tranche; /* tranche ID */
pg_atomic_uint32 state; /* state of exclusive/nonexclusive lockers */
- dlist_head waiters; /* list of waiting PGPROCs */
+ proclist_head waiters; /* list of waiting PGPROCs */
#ifdef LOCK_DEBUG
pg_atomic_uint32 nwaiters; /* number of waiters */
struct PGPROC *owner; /* last exclusive owner of the lock */
@@ -85,16 +59,17 @@ typedef struct LWLock
* LWLockPadded can be used for cases where we want each lock to be an entire
* cache line.
*
- * On 32-bit platforms, an LWLockMinimallyPadded might actually contain more
- * than the absolute minimum amount of padding required to keep a lock from
- * crossing a cache line boundary, because an unpadded LWLock might fit into
- * 16 bytes. We ignore that possibility when determining the minimal amount
- * of padding. Older releases had larger LWLocks, so 32 really was the
- * minimum, and packing them in tighter might hurt performance.
+ * An LWLockMinimallyPadded might contain more than the absolute minimum amount
+ * of padding required to keep a lock from crossing a cache line boundary,
+ * because an unpadded LWLock will normally fit into 16 bytes. We ignore that
+ * possibility when determining the minimal amount of padding. Older releases
+ * had larger LWLocks, so 32 really was the minimum, and packing them in
+ * tighter might hurt performance.
*
* LWLOCK_MINIMAL_SIZE should be 32 on basically all common platforms, but
- * because slock_t is more than 2 bytes on some obscure platforms, we allow
- * for the possibility that it might be 64.
+ * because pg_atomic_uint32 is more than 4 bytes on some obscure platforms, we
+ * allow for the possibility that it might be 64. Even on those platforms,
+ * we probably won't exceed 32 bytes unless LOCK_DEBUG is defined.
*/
#define LWLOCK_PADDED_SIZE PG_CACHE_LINE_SIZE
#define LWLOCK_MINIMAL_SIZE (sizeof(LWLock) <= 32 ? 32 : 64)
@@ -119,8 +94,8 @@ extern char *MainLWLockNames[];
/* struct for storing named tranche information */
typedef struct NamedLWLockTranche
{
- LWLockTranche lwLockTranche;
int trancheId;
+ char *trancheName;
} NamedLWLockTranche;
extern PGDLLIMPORT NamedLWLockTranche *NamedLWLockTrancheArray;
@@ -176,6 +151,7 @@ extern void LWLockRelease(LWLock *lock);
extern void LWLockReleaseClearVar(LWLock *lock, uint64 *valptr, uint64 val);
extern void LWLockReleaseAll(void);
extern bool LWLockHeldByMe(LWLock *lock);
+extern bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode);
extern bool LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval);
extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 value);
@@ -184,7 +160,7 @@ extern Size LWLockShmemSize(void);
extern void CreateLWLocks(void);
extern void InitLWLockAccess(void);
-extern const char *GetLWLockIdentifier(uint8 classId, uint16 eventId);
+extern const char *GetLWLockIdentifier(uint32 classId, uint16 eventId);
/*
* Extensions (or core code) can obtain an LWLocks by calling
@@ -199,9 +175,9 @@ extern LWLockPadded *GetNamedLWLockTranche(const char *tranche_name);
* There is another, more flexible method of obtaining lwlocks. First, call
* LWLockNewTrancheId just once to obtain a tranche ID; this allocates from
* a shared counter. Next, each individual process using the tranche should
- * call LWLockRegisterTranche() to associate that tranche ID with appropriate
- * metadata. Finally, LWLockInitialize should be called just once per lwlock,
- * passing the tranche ID as an argument.
+ * call LWLockRegisterTranche() to associate that tranche ID with a name.
+ * Finally, LWLockInitialize should be called just once per lwlock, passing
+ * the tranche ID as an argument.
*
* It may seem strange that each process using the tranche must register it
* separately, but dynamic shared memory segments aren't guaranteed to be
@@ -209,17 +185,18 @@ extern LWLockPadded *GetNamedLWLockTranche(const char *tranche_name);
* registration in the main shared memory segment wouldn't work for that case.
*/
extern int LWLockNewTrancheId(void);
-extern void LWLockRegisterTranche(int tranche_id, LWLockTranche *tranche);
+extern void LWLockRegisterTranche(int tranche_id, char *tranche_name);
extern void LWLockInitialize(LWLock *lock, int tranche_id);
/*
- * We reserve a few predefined tranche IDs. A call to LWLockNewTrancheId
- * will never return a value less than LWTRANCHE_FIRST_USER_DEFINED.
+ * Every tranche ID less than NUM_INDIVIDUAL_LWLOCKS is reserved; also,
+ * we reserve additional tranche IDs for builtin tranches not included in
+ * the set of individual LWLocks. A call to LWLockNewTrancheId will never
+ * return a value less than LWTRANCHE_FIRST_USER_DEFINED.
*/
typedef enum BuiltinTrancheIds
{
- LWTRANCHE_MAIN,
- LWTRANCHE_CLOG_BUFFERS,
+ LWTRANCHE_CLOG_BUFFERS = NUM_INDIVIDUAL_LWLOCKS,
LWTRANCHE_COMMITTS_BUFFERS,
LWTRANCHE_SUBTRANS_BUFFERS,
LWTRANCHE_MXACTOFFSET_BUFFERS,
@@ -236,6 +213,8 @@ typedef enum BuiltinTrancheIds
LWTRANCHE_LOCK_MANAGER,
LWTRANCHE_PREDICATE_LOCK_MANAGER,
LWTRANCHE_SHARED_QUEUES,
+ LWTRANCHE_PARALLEL_QUERY_DSA,
+ LWTRANCHE_TBM,
LWTRANCHE_FIRST_USER_DEFINED
} BuiltinTrancheIds;
diff --git a/src/include/storage/off.h b/src/include/storage/off.h
index 9f707930d7..fe8638fe15 100644
--- a/src/include/storage/off.h
+++ b/src/include/storage/off.h
@@ -4,7 +4,7 @@
* POSTGRES disk "offset" definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/off.h
diff --git a/src/include/storage/pg_sema.h b/src/include/storage/pg_sema.h
index 2c9418320e..b819f41d19 100644
--- a/src/include/storage/pg_sema.h
+++ b/src/include/storage/pg_sema.h
@@ -10,7 +10,7 @@
* be provided by each port.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/pg_sema.h
@@ -21,52 +21,30 @@
#define PG_SEMA_H
/*
- * PGSemaphoreData and pointer type PGSemaphore are the data structure
- * representing an individual semaphore. The contents of PGSemaphoreData
- * vary across implementations and must never be touched by platform-
- * independent code. PGSemaphoreData structures are always allocated
- * in shared memory (to support implementations where the data changes during
- * lock/unlock).
+ * struct PGSemaphoreData and pointer type PGSemaphore are the data structure
+ * representing an individual semaphore. The contents of PGSemaphoreData vary
+ * across implementations and must never be touched by platform-independent
+ * code; hence, PGSemaphoreData is declared as an opaque struct here.
*
- * pg_config.h must define exactly one of the USE_xxx_SEMAPHORES symbols.
+ * However, Windows is sufficiently unlike our other ports that it doesn't
+ * seem worth insisting on ABI compatibility for Windows too. Hence, on
+ * that platform just define PGSemaphore as HANDLE.
*/
-
-#ifdef USE_NAMED_POSIX_SEMAPHORES
-
-#include <semaphore.h>
-
-typedef sem_t *PGSemaphoreData;
-#endif
-
-#ifdef USE_UNNAMED_POSIX_SEMAPHORES
-
-#include <semaphore.h>
-
-typedef sem_t PGSemaphoreData;
-#endif
-
-#ifdef USE_SYSV_SEMAPHORES
-
-typedef struct PGSemaphoreData
-{
- int semId; /* semaphore set identifier */
- int semNum; /* semaphore number within set */
-} PGSemaphoreData;
-#endif
-
-#ifdef USE_WIN32_SEMAPHORES
-
-typedef HANDLE PGSemaphoreData;
+#ifndef USE_WIN32_SEMAPHORES
+typedef struct PGSemaphoreData *PGSemaphore;
+#else
+typedef HANDLE PGSemaphore;
#endif
-typedef PGSemaphoreData *PGSemaphore;
+/* Report amount of shared memory needed */
+extern Size PGSemaphoreShmemSize(int maxSemas);
/* Module initialization (called during postmaster start or shmem reinit) */
extern void PGReserveSemaphores(int maxSemas, int port);
-/* Initialize a PGSemaphore structure to represent a sema with count 1 */
-extern void PGSemaphoreCreate(PGSemaphore sema);
+/* Allocate a PGSemaphore structure with initial count 1 */
+extern PGSemaphore PGSemaphoreCreate(void);
/* Reset a previously-initialized PGSemaphore to have count 0 */
extern void PGSemaphoreReset(PGSemaphore sema);
diff --git a/src/include/storage/pg_shmem.h b/src/include/storage/pg_shmem.h
index 6bf803ab88..a329c81899 100644
--- a/src/include/storage/pg_shmem.h
+++ b/src/include/storage/pg_shmem.h
@@ -14,7 +14,7 @@
* only one ID number.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/pg_shmem.h
diff --git a/src/include/storage/pmsignal.h b/src/include/storage/pmsignal.h
index b53504ae50..90ddfa3b31 100644
--- a/src/include/storage/pmsignal.h
+++ b/src/include/storage/pmsignal.h
@@ -4,7 +4,7 @@
* routines for signaling the postmaster from its child processes
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/pmsignal.h
diff --git a/src/include/storage/pos.h b/src/include/storage/pos.h
deleted file mode 100644
index 9f9ba6d264..0000000000
--- a/src/include/storage/pos.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * pos.h
- * POSTGRES "position" definitions.
- *
- *
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/storage/pos.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef POS_H
-#define POS_H
-
-
-/*
- * a 'position' used to be <pagenumber, offset> in postgres. this has
- * been changed to just <offset> as the notion of having multiple pages
- * within a block has been removed.
- *
- * the 'offset' abstraction is somewhat confusing. it is NOT a byte
- * offset within the page; instead, it is an offset into the line
- * pointer array contained on every page that store (heap or index)
- * tuples.
- */
-typedef bits16 PositionIdData;
-typedef PositionIdData *PositionId;
-
-/* ----------------
- * support macros
- * ----------------
- */
-
-/*
- * PositionIdIsValid
- * True iff the position identifier is valid.
- */
-#define PositionIdIsValid(positionId) \
- PointerIsValid(positionId)
-
-/*
- * PositionIdSetInvalid
- * Make an invalid position.
- */
-#define PositionIdSetInvalid(positionId) \
- *(positionId) = (bits16) 0
-
-/*
- * PositionIdSet
- * Sets a position identifier to the specified value.
- */
-#define PositionIdSet(positionId, offsetNumber) \
- *(positionId) = (offsetNumber)
-
-/*
- * PositionIdGetOffsetNumber
- * Retrieve the offset number from a position identifier.
- */
-#define PositionIdGetOffsetNumber(positionId) \
- ((OffsetNumber) *(positionId))
-
-#endif /* POS_H */
diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h
index a66b5b7134..8f9ea29917 100644
--- a/src/include/storage/predicate.h
+++ b/src/include/storage/predicate.h
@@ -4,7 +4,7 @@
* POSTGRES public predicate locking definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/predicate.h
@@ -22,6 +22,8 @@
* GUC variables
*/
extern int max_predicate_locks_per_xact;
+extern int max_predicate_locks_per_relation;
+extern int max_predicate_locks_per_page;
/* Number of SLRU buffers to use for predicate locking */
diff --git a/src/include/storage/predicate_internals.h b/src/include/storage/predicate_internals.h
index 3175d286d3..3cb0ab9bb0 100644
--- a/src/include/storage/predicate_internals.h
+++ b/src/include/storage/predicate_internals.h
@@ -4,7 +4,7 @@
* POSTGRES internal predicate locking definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/predicate_internals.h
@@ -474,5 +474,7 @@ typedef struct TwoPhasePredicateRecord
* locking internals.
*/
extern PredicateLockData *GetPredicateLockStatusData(void);
+extern int GetSafeSnapshotBlockingPids(int blocked_pid,
+ int *output, int output_size);
#endif /* PREDICATE_INTERNALS_H */
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
index bc336fbaff..0be7165d4f 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/proc.h
@@ -20,6 +20,7 @@
#include "storage/latch.h"
#include "storage/lock.h"
#include "storage/pg_sema.h"
+#include "storage/proclist_types.h"
/*
* Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds
@@ -39,13 +40,23 @@ struct XidCache
TransactionId xids[PGPROC_MAX_CACHED_SUBXIDS];
};
-/* Flags for PGXACT->vacuumFlags */
+/*
+ * Flags for PGXACT->vacuumFlags
+ *
+ * Note: If you modify these flags, you need to modify PROCARRAY_XXX flags
+ * in src/include/storage/procarray.h.
+ *
+ * PROC_RESERVED may later be assigned for use in vacuumFlags, but its value is
+ * used for PROCARRAY_SLOTS_XMIN in procarray.h, so GetOldestXmin won't be able
+ * to match and ignore processes with this flag set.
+ */
#define PROC_IS_AUTOVACUUM 0x01 /* is it an autovac worker? */
#define PROC_IN_VACUUM 0x02 /* currently running lazy vacuum */
#define PROC_IN_ANALYZE 0x04 /* currently running analyze */
#define PROC_VACUUM_FOR_WRAPAROUND 0x08 /* set by autovac only */
#define PROC_IN_LOGICAL_DECODING 0x10 /* currently doing logical
* decoding outside xact */
+#define PROC_RESERVED 0x20 /* reserved for procarray */
/* flags reset at EOXact */
#define PROC_VACUUM_STATE_MASK \
@@ -87,7 +98,7 @@ struct PGPROC
SHM_QUEUE links; /* list link if process is in a list */
PGPROC **procgloballist; /* procglobal list that owns this PGPROC */
- PGSemaphoreData sem; /* ONE semaphore to sleep on */
+ PGSemaphore sem; /* ONE semaphore to sleep on */
int waitStatus; /* STATUS_WAITING, STATUS_OK or STATUS_ERROR */
Latch procLatch; /* generic latch for process */
@@ -109,6 +120,8 @@ struct PGPROC
* the distributed session */
#endif
+ bool isBackgroundWorker; /* true if background worker. */
+
/*
* While in hot standby mode, shows that a conflict signal has been sent
* for the current transaction. Set/cleared while holding ProcArrayLock,
@@ -124,7 +137,10 @@ struct PGPROC
/* Info about LWLock the process is currently waiting for, if any. */
bool lwWaiting; /* true if waiting for an LW lock */
uint8 lwWaitMode; /* lwlock mode being waited for */
- dlist_node lwWaitLink; /* position in LW lock wait list */
+ proclist_node lwWaitLink; /* position in LW lock wait list */
+
+ /* Support for condition variables. */
+ proclist_node cvWaitLink; /* position in CV wait list */
/* Info about lock the process is currently waiting for, if any. */
/* waitLock and waitProcLock are NULL if not currently waiting. */
@@ -255,6 +271,9 @@ extern PROC_HDR *ProcGlobal;
extern PGPROC *PreparedXactProcs;
+/* Accessor for PGPROC given a pgprocno. */
+#define GetPGProcByNumber(n) (&ProcGlobal->allProcs[(n)])
+
/*
* We set aside some extra PGPROC structures for auxiliary processes,
* ie things that aren't full-fledged backends but need shmem access.
@@ -271,7 +290,6 @@ extern PGPROC *PreparedXactProcs;
#define NUM_AUXILIARY_PROCS 4
#endif
-
/* configurable options */
extern int DeadlockTimeout;
extern int StatementTimeout;
@@ -305,9 +323,11 @@ extern void CheckDeadLockAlert(void);
extern bool IsWaitingForLock(void);
extern void LockErrorCleanup(void);
-extern void ProcWaitForSignal(void);
+extern void ProcWaitForSignal(uint32 wait_event_info);
extern void ProcSendSignal(int pid);
+extern PGPROC *AuxiliaryPidGetProc(int pid);
+
extern void BecomeLockGroupLeader(void);
extern bool BecomeLockGroupMember(PGPROC *leader, int pid);
diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h
index ea12e5c795..bc46229b42 100644
--- a/src/include/storage/procarray.h
+++ b/src/include/storage/procarray.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -31,6 +31,42 @@ typedef enum GlobalSnapshotSourceType
} GlobalSnapshotSourceType;
#endif
+/*
+ * These are to implement PROCARRAY_FLAGS_XXX
+ *
+ * Note: These flags are cloned from PROC_XXX flags in src/include/storage/proc.h
+ * to avoid forcing to include proc.h when including procarray.h. So if you modify
+ * PROC_XXX flags, you need to modify these flags.
+ */
+#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running
+ * lazy vacuum */
+#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running
+ * analyze */
+#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing
+ * logical decoding
+ * outside xact */
+
+#define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot
+ * xmin, catalog_xmin */
+/*
+ * Only flags in PROCARRAY_PROC_FLAGS_MASK are considered when matching
+ * PGXACT->vacuumFlags. Other flags are used for different purposes and
+ * have no corresponding PROC flag equivalent.
+ */
+#define PROCARRAY_PROC_FLAGS_MASK (PROCARRAY_VACUUM_FLAG | \
+ PROCARRAY_ANALYZE_FLAG | \
+ PROCARRAY_LOGICAL_DECODING_FLAG)
+
+/* Use the following flags as an input "flags" to GetOldestXmin function */
+/* Consider all backends except for logical decoding ones which manage xmin separately */
+#define PROCARRAY_FLAGS_DEFAULT PROCARRAY_LOGICAL_DECODING_FLAG
+/* Ignore vacuum backends */
+#define PROCARRAY_FLAGS_VACUUM PROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG
+/* Ignore analyze backends */
+#define PROCARRAY_FLAGS_ANALYZE PROCARRAY_FLAGS_DEFAULT | PROCARRAY_ANALYZE_FLAG
+/* Ignore both vacuum and analyze backends */
+#define PROCARRAY_FLAGS_VACUUM_ANALYZE PROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG | PROCARRAY_ANALYZE_FLAG
+
extern Size ProcArrayShmemSize(void);
extern void CreateSharedProcArray(void);
extern void ProcArrayAdd(PGPROC *proc);
@@ -81,11 +117,11 @@ extern RunningTransactions GetRunningTransactionData(void);
extern bool TransactionIdIsInProgress(TransactionId xid);
extern bool TransactionIdIsActive(TransactionId xid);
-extern TransactionId GetOldestXmin(Relation rel, bool ignoreVacuum);
-extern TransactionId GetOldestXminInternal(Relation rel, bool ignoreVacuum,
+extern TransactionId GetOldestXmin(Relation rel, int flags);
+extern TransactionId GetOldestXminInternal(Relation rel, int flags,
bool computeLocal, TransactionId lastGlobalXmin);
extern TransactionId GetOldestActiveTransactionId(void);
-extern TransactionId GetOldestSafeDecodingTransactionId(void);
+extern TransactionId GetOldestSafeDecodingTransactionId(bool catalogOnly);
extern VirtualTransactionId *GetVirtualXIDsDelayingChkpt(int *nvxids);
extern bool HaveVirtualXIDsDelayingChkpt(VirtualTransactionId *vxids, int nvxids);
@@ -103,6 +139,7 @@ extern pid_t CancelVirtualTransaction(VirtualTransactionId vxid, ProcSignalReaso
extern bool MinimumActiveBackends(int min);
extern int CountDBBackends(Oid databaseid);
+extern int CountDBConnections(Oid databaseid);
extern void CancelDBBackends(Oid databaseid, ProcSignalReason sigmode, bool conflictPending);
extern int CountUserBackends(Oid roleid);
extern bool CountOtherDBBackends(Oid databaseId,
diff --git a/src/include/storage/proclist.h b/src/include/storage/proclist.h
new file mode 100644
index 0000000000..9f22f3fd48
--- /dev/null
+++ b/src/include/storage/proclist.h
@@ -0,0 +1,208 @@
+/*-------------------------------------------------------------------------
+ *
+ * proclist.h
+ * operations on doubly-linked lists of pgprocnos
+ *
+ * The interface is similar to dlist from ilist.h, but uses pgprocno instead
+ * of pointers. This allows proclist_head to be mapped at different addresses
+ * in different backends.
+ *
+ * See proclist_types.h for the structs that these functions operate on. They
+ * are separated to break a header dependency cycle with proc.h.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * src/include/storage/proclist.h
+ *-------------------------------------------------------------------------
+ */
+#ifndef PROCLIST_H
+#define PROCLIST_H
+
+#include "storage/proc.h"
+#include "storage/proclist_types.h"
+
+/*
+ * Initialize a proclist.
+ */
+static inline void
+proclist_init(proclist_head *list)
+{
+ list->head = list->tail = INVALID_PGPROCNO;
+}
+
+/*
+ * Is the list empty?
+ */
+static inline bool
+proclist_is_empty(proclist_head *list)
+{
+ return list->head == INVALID_PGPROCNO;
+}
+
+/*
+ * Get a pointer to a proclist_node inside a given PGPROC, given a procno and
+ * an offset.
+ */
+static inline proclist_node *
+proclist_node_get(int procno, size_t node_offset)
+{
+ char *entry = (char *) GetPGProcByNumber(procno);
+
+ return (proclist_node *) (entry + node_offset);
+}
+
+/*
+ * Insert a node at the beginning of a list.
+ */
+static inline void
+proclist_push_head_offset(proclist_head *list, int procno, size_t node_offset)
+{
+ proclist_node *node = proclist_node_get(procno, node_offset);
+
+ if (list->head == INVALID_PGPROCNO)
+ {
+ Assert(list->tail == INVALID_PGPROCNO);
+ node->next = node->prev = INVALID_PGPROCNO;
+ list->head = list->tail = procno;
+ }
+ else
+ {
+ Assert(list->tail != INVALID_PGPROCNO);
+ Assert(list->head != procno);
+ Assert(list->tail != procno);
+ node->next = list->head;
+ proclist_node_get(node->next, node_offset)->prev = procno;
+ node->prev = INVALID_PGPROCNO;
+ list->head = procno;
+ }
+}
+
+/*
+ * Insert a node at the end of a list.
+ */
+static inline void
+proclist_push_tail_offset(proclist_head *list, int procno, size_t node_offset)
+{
+ proclist_node *node = proclist_node_get(procno, node_offset);
+
+ if (list->tail == INVALID_PGPROCNO)
+ {
+ Assert(list->head == INVALID_PGPROCNO);
+ node->next = node->prev = INVALID_PGPROCNO;
+ list->head = list->tail = procno;
+ }
+ else
+ {
+ Assert(list->head != INVALID_PGPROCNO);
+ Assert(list->head != procno);
+ Assert(list->tail != procno);
+ node->prev = list->tail;
+ proclist_node_get(node->prev, node_offset)->next = procno;
+ node->next = INVALID_PGPROCNO;
+ list->tail = procno;
+ }
+}
+
+/*
+ * Delete a node. The node must be in the list.
+ */
+static inline void
+proclist_delete_offset(proclist_head *list, int procno, size_t node_offset)
+{
+ proclist_node *node = proclist_node_get(procno, node_offset);
+
+ if (node->prev == INVALID_PGPROCNO)
+ list->head = node->next;
+ else
+ proclist_node_get(node->prev, node_offset)->next = node->next;
+
+ if (node->next == INVALID_PGPROCNO)
+ list->tail = node->prev;
+ else
+ proclist_node_get(node->next, node_offset)->prev = node->prev;
+
+ node->next = node->prev = INVALID_PGPROCNO;
+}
+
+/*
+ * Check if a node is currently in a list. It must be known that the node is
+ * not in any _other_ proclist that uses the same proclist_node, so that the
+ * only possibilities are that it is in this list or none.
+ */
+static inline bool
+proclist_contains_offset(proclist_head *list, int procno,
+ size_t node_offset)
+{
+ proclist_node *node = proclist_node_get(procno, node_offset);
+
+ /*
+ * If this is not a member of a proclist, then the next and prev pointers
+ * should be 0. Circular lists are not allowed so this condition is not
+ * confusable with a real pgprocno 0.
+ */
+ if (node->prev == 0 && node->next == 0)
+ return false;
+
+ /* If there is a previous node, then this node must be in the list. */
+ if (node->prev != INVALID_PGPROCNO)
+ return true;
+
+ /*
+ * There is no previous node, so the only way this node can be in the list
+ * is if it's the head node.
+ */
+ return list->head == procno;
+}
+
+/*
+ * Remove and return the first node from a list (there must be one).
+ */
+static inline PGPROC *
+proclist_pop_head_node_offset(proclist_head *list, size_t node_offset)
+{
+ PGPROC *proc;
+
+ Assert(!proclist_is_empty(list));
+ proc = GetPGProcByNumber(list->head);
+ proclist_delete_offset(list, list->head, node_offset);
+ return proc;
+}
+
+/*
+ * Helper macros to avoid repetition of offsetof(PGPROC, <member>).
+ * 'link_member' is the name of a proclist_node member in PGPROC.
+ */
+#define proclist_delete(list, procno, link_member) \
+ proclist_delete_offset((list), (procno), offsetof(PGPROC, link_member))
+#define proclist_push_head(list, procno, link_member) \
+ proclist_push_head_offset((list), (procno), offsetof(PGPROC, link_member))
+#define proclist_push_tail(list, procno, link_member) \
+ proclist_push_tail_offset((list), (procno), offsetof(PGPROC, link_member))
+#define proclist_pop_head_node(list, link_member) \
+ proclist_pop_head_node_offset((list), offsetof(PGPROC, link_member))
+#define proclist_contains(list, procno, link_member) \
+ proclist_contains_offset((list), (procno), offsetof(PGPROC, link_member))
+
+/*
+ * Iterate through the list pointed at by 'lhead', storing the current
+ * position in 'iter'. 'link_member' is the name of a proclist_node member in
+ * PGPROC. Access the current position with iter.cur.
+ *
+ * The only list modification allowed while iterating is deleting the current
+ * node with proclist_delete(list, iter.cur, node_offset).
+ */
+#define proclist_foreach_modify(iter, lhead, link_member) \
+ for (AssertVariableIsOfTypeMacro(iter, proclist_mutable_iter), \
+ AssertVariableIsOfTypeMacro(lhead, proclist_head *), \
+ (iter).cur = (lhead)->head, \
+ (iter).next = (iter).cur == INVALID_PGPROCNO ? INVALID_PGPROCNO : \
+ proclist_node_get((iter).cur, \
+ offsetof(PGPROC, link_member))->next; \
+ (iter).cur != INVALID_PGPROCNO; \
+ (iter).cur = (iter).next, \
+ (iter).next = (iter).cur == INVALID_PGPROCNO ? INVALID_PGPROCNO : \
+ proclist_node_get((iter).cur, \
+ offsetof(PGPROC, link_member))->next)
+
+#endif
diff --git a/src/include/storage/proclist_types.h b/src/include/storage/proclist_types.h
new file mode 100644
index 0000000000..716c4498d5
--- /dev/null
+++ b/src/include/storage/proclist_types.h
@@ -0,0 +1,45 @@
+/*-------------------------------------------------------------------------
+ *
+ * proclist_types.h
+ * doubly-linked lists of pgprocnos
+ *
+ * See proclist.h for functions that operate on these types.
+ *
+ * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * src/include/storage/proclist_types.h
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef PROCLIST_TYPES_H
+#define PROCLIST_TYPES_H
+
+/*
+ * A node in a list of processes.
+ */
+typedef struct proclist_node
+{
+ int next; /* pgprocno of the next PGPROC */
+ int prev; /* pgprocno of the prev PGPROC */
+} proclist_node;
+
+/*
+ * Head of a doubly-linked list of PGPROCs, identified by pgprocno.
+ */
+typedef struct proclist_head
+{
+ int head; /* pgprocno of the head PGPROC */
+ int tail; /* pgprocno of the tail PGPROC */
+} proclist_head;
+
+/*
+ * List iterator allowing some modifications while iterating.
+ */
+typedef struct proclist_mutable_iter
+{
+ int cur; /* pgprocno of the current PGPROC */
+ int next; /* pgprocno of the next PGPROC */
+} proclist_mutable_iter;
+
+#endif
diff --git a/src/include/storage/procsignal.h b/src/include/storage/procsignal.h
index 105fbaffea..67cb913829 100644
--- a/src/include/storage/procsignal.h
+++ b/src/include/storage/procsignal.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/procsignal.h
diff --git a/src/include/storage/reinit.h b/src/include/storage/reinit.h
index a228434dc4..8c1b178de4 100644
--- a/src/include/storage/reinit.h
+++ b/src/include/storage/reinit.h
@@ -4,7 +4,7 @@
* Reinitialization of unlogged relations
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/reinit.h
diff --git a/src/include/storage/relfilenode.h b/src/include/storage/relfilenode.h
index e51c259464..bdf3cecdfa 100644
--- a/src/include/storage/relfilenode.h
+++ b/src/include/storage/relfilenode.h
@@ -4,7 +4,7 @@
* Physical access information for relations.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/relfilenode.h
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 7aad2de43d..bbf505e246 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -86,7 +86,7 @@
* when using the SysV semaphore code.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/s_lock.h
@@ -706,29 +706,6 @@ typedef unsigned char slock_t;
#if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */
-#if defined(USE_UNIVEL_CC) /* Unixware compiler */
-#define HAS_TEST_AND_SET
-
-typedef unsigned char slock_t;
-
-#define TAS(lock) tas(lock)
-
-asm int
-tas(volatile slock_t *s_lock)
-{
-/* UNIVEL wants %mem in column 1, so we don't pgindent this file */
-%mem s_lock
- pushl %ebx
- movl s_lock, %ebx
- movl $255, %eax
- lock
- xchgb %al, (%ebx)
- popl %ebx
-}
-
-#endif /* defined(USE_UNIVEL_CC) */
-
-
#if defined(__hppa) || defined(__hppa__) /* HP PA-RISC, GCC and HP compilers */
/*
* HP's PA-RISC
@@ -856,7 +833,7 @@ extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with,
#endif
-#ifdef WIN32_ONLY_COMPILER
+#ifdef _MSC_VER
typedef LONG slock_t;
#define HAS_TEST_AND_SET
@@ -865,7 +842,7 @@ typedef LONG slock_t;
#define SPIN_DELAY() spin_delay()
/* If using Visual C++ on Win64, inline assembly is unavailable.
- * Use a _mm_pause instrinsic instead of rep nop.
+ * Use a _mm_pause intrinsic instead of rep nop.
*/
#if defined(_WIN64)
static __forceinline void
diff --git a/src/include/storage/shm_mq.h b/src/include/storage/shm_mq.h
index 7ea25397b9..7a37535ab3 100644
--- a/src/include/storage/shm_mq.h
+++ b/src/include/storage/shm_mq.h
@@ -3,7 +3,7 @@
* shm_mq.h
* single-reader, single-writer shared memory message queue
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/shm_mq.h
diff --git a/src/include/storage/shm_toc.h b/src/include/storage/shm_toc.h
index 6822f919c4..ae0a3878fe 100644
--- a/src/include/storage/shm_toc.h
+++ b/src/include/storage/shm_toc.h
@@ -12,7 +12,7 @@
* other data structure within the segment and only put the pointer to
* the data structure itself in the table of contents.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/shm_toc.h
diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h
index 6468e6627a..1961832c0f 100644
--- a/src/include/storage/shmem.h
+++ b/src/include/storage/shmem.h
@@ -11,7 +11,7 @@
* at the same address. This means shared memory pointers can be passed
* around directly between different processes.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/shmem.h
@@ -35,6 +35,8 @@ typedef struct SHM_QUEUE
extern void InitShmemAccess(void *seghdr);
extern void InitShmemAllocation(void);
extern void *ShmemAlloc(Size size);
+extern void *ShmemAllocNoError(Size size);
+extern void *ShmemAllocUnlocked(Size size);
extern bool ShmemAddrIsValid(const void *addr);
extern void InitShmemIndex(void);
extern HTAB *ShmemInitHash(const char *name, long init_size, long max_size,
diff --git a/src/include/storage/sinval.h b/src/include/storage/sinval.h
index 8d019dc0e7..6a3db9580f 100644
--- a/src/include/storage/sinval.h
+++ b/src/include/storage/sinval.h
@@ -4,7 +4,7 @@
* POSTGRES shared cache invalidation communication definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/sinval.h
@@ -23,6 +23,7 @@
* * invalidate a specific tuple in a specific catcache
* * invalidate all catcache entries from a given system catalog
* * invalidate a relcache entry for a specific logical relation
+ * * invalidate all relcache entries
* * invalidate an smgr cache entry for a specific physical relation
* * invalidate the mapped-relation mapping for a given database
* * invalidate any saved snapshot that might be used to scan a given relation
@@ -78,7 +79,7 @@ typedef struct
{
int8 id; /* type field --- must be first */
Oid dbId; /* database ID, or 0 if a shared relation */
- Oid relId; /* relation ID */
+ Oid relId; /* relation ID, or 0 if whole relcache */
} SharedInvalRelcacheMsg;
#define SHAREDINVALSMGR_ID (-3)
diff --git a/src/include/storage/sinvaladt.h b/src/include/storage/sinvaladt.h
index b27f7e806b..07ac2f8c85 100644
--- a/src/include/storage/sinvaladt.h
+++ b/src/include/storage/sinvaladt.h
@@ -12,7 +12,7 @@
* The struct type SharedInvalidationMessage, defining the contents of
* a single message, is defined in sinval.h.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/sinvaladt.h
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 7e384f6ea7..91a97f84b8 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/smgr.h
@@ -65,8 +65,12 @@ typedef struct SMgrRelationData
*/
int smgr_which; /* storage manager selector */
- /* for md.c; NULL for forks that are not open */
- struct _MdfdVec *md_fd[MAX_FORKNUM + 1];
+ /*
+ * for md.c; per-fork arrays of the number of open segments
+ * (md_num_open_segs) and the segments themselves (md_seg_fds).
+ */
+ int md_num_open_segs[MAX_FORKNUM + 1];
+ struct _MdfdVec *md_seg_fds[MAX_FORKNUM + 1];
/* if unowned, list link in list of all unowned SMgrRelations */
struct SMgrRelationData *next_unowned_reln;
@@ -147,10 +151,4 @@ extern void RememberFsyncRequest(RelFileNode rnode, ForkNumber forknum,
extern void ForgetRelationFsyncRequests(RelFileNode rnode, ForkNumber forknum);
extern void ForgetDatabaseFsyncRequests(Oid dbid);
-/* smgrtype.c */
-extern Datum smgrout(PG_FUNCTION_ARGS);
-extern Datum smgrin(PG_FUNCTION_ARGS);
-extern Datum smgreq(PG_FUNCTION_ARGS);
-extern Datum smgrne(PG_FUNCTION_ARGS);
-
#endif /* SMGR_H */
diff --git a/src/include/storage/spin.h b/src/include/storage/spin.h
index 50412258b9..8987c90537 100644
--- a/src/include/storage/spin.h
+++ b/src/include/storage/spin.h
@@ -41,7 +41,7 @@
* be again.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/spin.h
@@ -70,8 +70,8 @@ extern int SpinlockSemas(void);
extern Size SpinlockSemaSize(void);
#ifndef HAVE_SPINLOCKS
-extern void SpinlockSemaInit(PGSemaphore);
-extern PGSemaphore SpinlockSemaArray;
+extern void SpinlockSemaInit(void);
+extern PGSemaphore *SpinlockSemaArray;
#endif
#endif /* SPIN_H */
diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h
index dcebf72f85..3ecc446083 100644
--- a/src/include/storage/standby.h
+++ b/src/include/storage/standby.h
@@ -4,7 +4,7 @@
* Definitions for hot standby mode.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/standby.h
diff --git a/src/include/storage/standbydefs.h b/src/include/storage/standbydefs.h
index ea22d77e07..f8444c787a 100644
--- a/src/include/storage/standbydefs.h
+++ b/src/include/storage/standbydefs.h
@@ -4,7 +4,7 @@
* Frontend exposed definitions for hot standby mode.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/standbydefs.h
diff --git a/src/include/tcop/deparse_utility.h b/src/include/tcop/deparse_utility.h
index 046184d142..f0b25bea90 100644
--- a/src/include/tcop/deparse_utility.h
+++ b/src/include/tcop/deparse_utility.h
@@ -2,7 +2,7 @@
*
* deparse_utility.h
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tcop/deparse_utility.h
diff --git a/src/include/tcop/dest.h b/src/include/tcop/dest.h
index 746d106a39..622d35b346 100644
--- a/src/include/tcop/dest.h
+++ b/src/include/tcop/dest.h
@@ -58,7 +58,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tcop/dest.h
@@ -90,6 +90,7 @@ typedef enum
DestDebug, /* results go to debugging output */
DestRemote, /* results sent to frontend process */
DestRemoteExecute, /* sent to frontend, in Execute command */
+ DestRemoteSimple, /* sent to frontend, w/no catalog access */
DestSPI, /* results sent to SPI manager */
DestTuplestore, /* results sent to Tuplestore */
DestIntoRel, /* results sent to relation (SELECT INTO) */
diff --git a/src/include/tcop/fastpath.h b/src/include/tcop/fastpath.h
index df6234be89..81d94913db 100644
--- a/src/include/tcop/fastpath.h
+++ b/src/include/tcop/fastpath.h
@@ -3,7 +3,7 @@
* fastpath.h
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tcop/fastpath.h
@@ -16,6 +16,6 @@
#include "lib/stringinfo.h"
extern int GetOldFunctionMessage(StringInfo buf);
-extern int HandleFunctionRequest(StringInfo msgBuf);
+extern void HandleFunctionRequest(StringInfo msgBuf);
#endif /* FASTPATH_H */
diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h
index ba34a8446a..e8ec5d0f8f 100644
--- a/src/include/tcop/pquery.h
+++ b/src/include/tcop/pquery.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tcop/pquery.h
@@ -35,7 +35,7 @@ extern void PortalSetResultFormat(Portal portal, int nFormats,
int16 *formats);
extern bool PortalRun(Portal portal, long count, bool isTopLevel,
- DestReceiver *dest, DestReceiver *altdest,
+ bool run_once, DestReceiver *dest, DestReceiver *altdest,
char *completionTag);
extern uint64 PortalRunFetch(Portal portal,
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index 30ff4cba9b..a32735bd3f 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -4,7 +4,7 @@
* prototypes for postgres.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tcop/tcopprot.h
@@ -24,6 +24,7 @@
#include "nodes/plannodes.h"
#include "storage/procsignal.h"
#include "utils/guc.h"
+#include "utils/queryenvironment.h"
/* needed because of 'struct timeval' and 'struct rusage' */
#include <sys/time.h>
@@ -51,12 +52,15 @@ extern int log_statement;
extern List *pg_parse_query(const char *query_string);
extern List *pg_parse_query_get_source(const char *query_string, List **queries);
-extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
- Oid *paramTypes, int numParams);
-extern List *pg_analyze_and_rewrite_params(Node *parsetree,
+extern List *pg_analyze_and_rewrite(RawStmt *parsetree,
+ const char *query_string,
+ Oid *paramTypes, int numParams,
+ QueryEnvironment *queryEnv);
+extern List *pg_analyze_and_rewrite_params(RawStmt *parsetree,
const char *query_string,
ParserSetupHook parserSetup,
- void *parserSetupArg);
+ void *parserSetupArg,
+ QueryEnvironment *queryEnv);
extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
ParamListInfo boundParams);
extern List *pg_plan_queries(List *querytrees, int cursorOptions,
diff --git a/src/include/tcop/utility.h b/src/include/tcop/utility.h
index 15a8458280..d52f3e8525 100644
--- a/src/include/tcop/utility.h
+++ b/src/include/tcop/utility.h
@@ -4,7 +4,7 @@
* prototypes for utility.c.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tcop/utility.h
@@ -24,29 +24,26 @@ typedef enum
} ProcessUtilityContext;
/* Hook for plugins to get control in ProcessUtility() */
-typedef void (*ProcessUtility_hook_type) (Node *parsetree,
+typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt,
const char *queryString, ProcessUtilityContext context,
ParamListInfo params,
+ QueryEnvironment *queryEnv,
DestReceiver *dest,
-#ifdef PGXC
bool sentToRemote,
-#endif /* PGXC */
char *completionTag);
extern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;
-extern void ProcessUtility(Node *parsetree, const char *queryString,
+extern void ProcessUtility(PlannedStmt *pstmt, const char *queryString,
ProcessUtilityContext context, ParamListInfo params,
+ QueryEnvironment *queryEnv,
DestReceiver *dest,
-#ifdef PGXC
bool sentToRemote,
-#endif /* PGXC */
char *completionTag);
-extern void standard_ProcessUtility(Node *parsetree, const char *queryString,
+extern void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
ProcessUtilityContext context, ParamListInfo params,
+ QueryEnvironment *queryEnv,
DestReceiver *dest,
-#ifdef PGXC
bool sentToRemote,
-#endif /* PGXC */
char *completionTag);
extern bool UtilityReturnsTuples(Node *parsetree);
@@ -59,7 +56,7 @@ extern const char *CreateCommandTag(Node *parsetree);
extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
-extern bool CommandIsReadOnly(Node *parsetree);
+extern bool CommandIsReadOnly(PlannedStmt *pstmt);
#ifdef PGXC
extern bool pgxc_lock_for_utility_stmt(Node *parsetree);
diff --git a/src/include/tsearch/dicts/regis.h b/src/include/tsearch/dicts/regis.h
index 5bbfad1d95..7fdf82af65 100644
--- a/src/include/tsearch/dicts/regis.h
+++ b/src/include/tsearch/dicts/regis.h
@@ -4,7 +4,7 @@
*
* Declarations for fast regex subset, used by ISpell
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/tsearch/dicts/regis.h
*
diff --git a/src/include/tsearch/dicts/spell.h b/src/include/tsearch/dicts/spell.h
index d1df1f9f4b..3032d0b508 100644
--- a/src/include/tsearch/dicts/spell.h
+++ b/src/include/tsearch/dicts/spell.h
@@ -4,7 +4,7 @@
*
* Declarations for ISpell dictionary
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/tsearch/dicts/spell.h
*
@@ -147,7 +147,7 @@ typedef struct
} CMPDAffix;
/*
- * Type of encoding affix flags in Hunspel dictionaries
+ * Type of encoding affix flags in Hunspell dictionaries
*/
typedef enum
{
diff --git a/src/include/tsearch/ts_cache.h b/src/include/tsearch/ts_cache.h
index 379893365f..80b8a079ed 100644
--- a/src/include/tsearch/ts_cache.h
+++ b/src/include/tsearch/ts_cache.h
@@ -3,7 +3,7 @@
* ts_cache.h
* Tsearch related object caches.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/tsearch/ts_cache.h
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index 36cb4de40d..afcf2b93de 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -3,7 +3,7 @@
* ts_locale.h
* locale compatibility layer for tsearch
*
- * Copyright (c) 1998-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1998-2017, PostgreSQL Global Development Group
*
* src/include/tsearch/ts_locale.h
*
diff --git a/src/include/tsearch/ts_public.h b/src/include/tsearch/ts_public.h
index b75a078ec5..4c190b22e8 100644
--- a/src/include/tsearch/ts_public.h
+++ b/src/include/tsearch/ts_public.h
@@ -4,7 +4,7 @@
* Public interface to various tsearch modules, such as
* parsers and dictionaries.
*
- * Copyright (c) 1998-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1998-2017, PostgreSQL Global Development Group
*
* src/include/tsearch/ts_public.h
*
diff --git a/src/include/tsearch/ts_type.h b/src/include/tsearch/ts_type.h
index 5062aaafee..873e2e1856 100644
--- a/src/include/tsearch/ts_type.h
+++ b/src/include/tsearch/ts_type.h
@@ -3,7 +3,7 @@
* ts_type.h
* Definitions for the tsvector and tsquery types
*
- * Copyright (c) 1998-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1998-2017, PostgreSQL Global Development Group
*
* src/include/tsearch/ts_type.h
*
@@ -86,6 +86,15 @@ typedef struct
#define MAXNUMPOS (256)
#define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) )
+/*
+ * In case if a TSVector contains several parts and we want to treat them as
+ * separate, it's necessary to add an artificial increment to position of each
+ * lexeme from every next part. It's required to avoid the situation when
+ * tsquery can find a phrase consisting of lexemes from two of such parts.
+ * TS_JUMP defined a value of this increment.
+ */
+#define TS_JUMP 1
+
/* This struct represents a complete tsvector datum */
typedef struct
{
@@ -121,61 +130,6 @@ typedef TSVectorData *TSVector;
#define PG_GETARG_TSVECTOR_COPY(n) DatumGetTSVectorCopy(PG_GETARG_DATUM(n))
#define PG_RETURN_TSVECTOR(x) return TSVectorGetDatum(x)
-/*
- * I/O
- */
-extern Datum tsvectorin(PG_FUNCTION_ARGS);
-extern Datum tsvectorout(PG_FUNCTION_ARGS);
-extern Datum tsvectorsend(PG_FUNCTION_ARGS);
-extern Datum tsvectorrecv(PG_FUNCTION_ARGS);
-
-/*
- * operations with tsvector
- */
-extern Datum tsvector_lt(PG_FUNCTION_ARGS);
-extern Datum tsvector_le(PG_FUNCTION_ARGS);
-extern Datum tsvector_eq(PG_FUNCTION_ARGS);
-extern Datum tsvector_ne(PG_FUNCTION_ARGS);
-extern Datum tsvector_ge(PG_FUNCTION_ARGS);
-extern Datum tsvector_gt(PG_FUNCTION_ARGS);
-extern Datum tsvector_cmp(PG_FUNCTION_ARGS);
-
-extern Datum tsvector_length(PG_FUNCTION_ARGS);
-extern Datum tsvector_strip(PG_FUNCTION_ARGS);
-extern Datum tsvector_setweight(PG_FUNCTION_ARGS);
-extern Datum tsvector_setweight_by_filter(PG_FUNCTION_ARGS);
-extern Datum tsvector_concat(PG_FUNCTION_ARGS);
-extern Datum tsvector_delete_str(PG_FUNCTION_ARGS);
-extern Datum tsvector_delete_arr(PG_FUNCTION_ARGS);
-extern Datum tsvector_unnest(PG_FUNCTION_ARGS);
-extern Datum tsvector_to_array(PG_FUNCTION_ARGS);
-extern Datum array_to_tsvector(PG_FUNCTION_ARGS);
-extern Datum tsvector_filter(PG_FUNCTION_ARGS);
-extern Datum tsvector_update_trigger_byid(PG_FUNCTION_ARGS);
-extern Datum tsvector_update_trigger_bycolumn(PG_FUNCTION_ARGS);
-
-extern Datum ts_match_vq(PG_FUNCTION_ARGS);
-extern Datum ts_match_qv(PG_FUNCTION_ARGS);
-extern Datum ts_match_tt(PG_FUNCTION_ARGS);
-extern Datum ts_match_tq(PG_FUNCTION_ARGS);
-
-extern Datum ts_stat1(PG_FUNCTION_ARGS);
-extern Datum ts_stat2(PG_FUNCTION_ARGS);
-
-extern Datum ts_rank_tt(PG_FUNCTION_ARGS);
-extern Datum ts_rank_wtt(PG_FUNCTION_ARGS);
-extern Datum ts_rank_ttf(PG_FUNCTION_ARGS);
-extern Datum ts_rank_wttf(PG_FUNCTION_ARGS);
-extern Datum ts_rankcd_tt(PG_FUNCTION_ARGS);
-extern Datum ts_rankcd_wtt(PG_FUNCTION_ARGS);
-extern Datum ts_rankcd_ttf(PG_FUNCTION_ARGS);
-extern Datum ts_rankcd_wttf(PG_FUNCTION_ARGS);
-
-extern Datum tsmatchsel(PG_FUNCTION_ARGS);
-extern Datum tsmatchjoinsel(PG_FUNCTION_ARGS);
-
-extern Datum ts_typanalyze(PG_FUNCTION_ARGS);
-
/*
* TSQuery
@@ -294,38 +248,4 @@ typedef TSQueryData *TSQuery;
#define PG_GETARG_TSQUERY_COPY(n) DatumGetTSQueryCopy(PG_GETARG_DATUM(n))
#define PG_RETURN_TSQUERY(x) return TSQueryGetDatum(x)
-/*
- * I/O
- */
-extern Datum tsqueryin(PG_FUNCTION_ARGS);
-extern Datum tsqueryout(PG_FUNCTION_ARGS);
-extern Datum tsquerysend(PG_FUNCTION_ARGS);
-extern Datum tsqueryrecv(PG_FUNCTION_ARGS);
-
-/*
- * operations with tsquery
- */
-extern Datum tsquery_lt(PG_FUNCTION_ARGS);
-extern Datum tsquery_le(PG_FUNCTION_ARGS);
-extern Datum tsquery_eq(PG_FUNCTION_ARGS);
-extern Datum tsquery_ne(PG_FUNCTION_ARGS);
-extern Datum tsquery_ge(PG_FUNCTION_ARGS);
-extern Datum tsquery_gt(PG_FUNCTION_ARGS);
-extern Datum tsquery_cmp(PG_FUNCTION_ARGS);
-
-extern Datum tsquerytree(PG_FUNCTION_ARGS);
-extern Datum tsquery_numnode(PG_FUNCTION_ARGS);
-
-extern Datum tsquery_and(PG_FUNCTION_ARGS);
-extern Datum tsquery_or(PG_FUNCTION_ARGS);
-extern Datum tsquery_phrase(PG_FUNCTION_ARGS);
-extern Datum tsquery_phrase_distance(PG_FUNCTION_ARGS);
-extern Datum tsquery_not(PG_FUNCTION_ARGS);
-
-extern Datum tsquery_rewrite(PG_FUNCTION_ARGS);
-extern Datum tsquery_rewrite_query(PG_FUNCTION_ARGS);
-
-extern Datum tsq_mcontains(PG_FUNCTION_ARGS);
-extern Datum tsq_mcontained(PG_FUNCTION_ARGS);
-
#endif /* _PG_TSTYPE_H_ */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index e09a9c636f..20d90b12fd 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -3,7 +3,7 @@
* ts_utils.h
* helper utilities for tsearch
*
- * Copyright (c) 1998-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1998-2017, PostgreSQL Global Development Group
*
* src/include/tsearch/ts_utils.h
*
@@ -12,9 +12,9 @@
#ifndef _PG_TS_UTILS_H_
#define _PG_TS_UTILS_H_
-#include "tsearch/ts_type.h"
-#include "tsearch/ts_public.h"
#include "nodes/pg_list.h"
+#include "tsearch/ts_public.h"
+#include "tsearch/ts_type.h"
/*
* Common parse definitions for tsvector and tsquery
@@ -102,34 +102,80 @@ extern void hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query,
extern text *generateHeadline(HeadlineParsedText *prs);
/*
- * Common check function for tsvector @@ tsquery
+ * TSQuery execution support
+ *
+ * TS_execute() executes a tsquery against data that can be represented in
+ * various forms. The TSExecuteCallback callback function is called to check
+ * whether a given primitive tsquery value is matched in the data.
+ */
+
+/*
+ * struct ExecPhraseData is passed to a TSExecuteCallback function if we need
+ * lexeme position data (because of a phrase-match operator in the tsquery).
+ * The callback should fill in position data when it returns true (success).
+ * If it cannot return position data, it may leave "data" unchanged, but
+ * then the caller of TS_execute() must pass the TS_EXEC_PHRASE_NO_POS flag
+ * and must arrange for a later recheck with position data available.
+ *
+ * The reported lexeme positions must be sorted and unique. Callers must only
+ * consult the position bits of the pos array, ie, WEP_GETPOS(data->pos[i]).
+ * This allows the returned "pos" to point directly to the WordEntryPos
+ * portion of a tsvector value. If "allocated" is true then the pos array
+ * is palloc'd workspace and caller may free it when done.
+ *
+ * "negate" means that the pos array contains positions where the query does
+ * not match, rather than positions where it does. "width" is positive when
+ * the match is wider than one lexeme. Neither of these fields normally need
+ * to be touched by TSExecuteCallback functions; they are used for
+ * phrase-search processing within TS_execute.
+ *
+ * All fields of the ExecPhraseData struct are initially zeroed by caller.
*/
typedef struct ExecPhraseData
{
- int npos;
- bool allocated;
- WordEntryPos *pos;
+ int npos; /* number of positions reported */
+ bool allocated; /* pos points to palloc'd data? */
+ bool negate; /* positions are where query is NOT matched */
+ WordEntryPos *pos; /* ordered, non-duplicate lexeme positions */
+ int width; /* width of match in lexemes, less 1 */
} ExecPhraseData;
/*
- * Evaluates tsquery, flags are followe below
+ * Signature for TSQuery lexeme check functions
+ *
+ * arg: opaque value passed through from caller of TS_execute
+ * val: lexeme to test for presence of
+ * data: to be filled with lexeme positions; NULL if position data not needed
+ *
+ * Return TRUE if lexeme is present in data, else FALSE. If data is not
+ * NULL, it should be filled with lexeme positions, but function can leave
+ * it as zeroes if position data is not available.
*/
-extern bool TS_execute(QueryItem *curitem, void *checkval, uint32 flags,
- bool (*chkcond) (void *, QueryOperand *, ExecPhraseData *));
+typedef bool (*TSExecuteCallback) (void *arg, QueryOperand *val,
+ ExecPhraseData *data);
+/*
+ * Flag bits for TS_execute
+ */
#define TS_EXEC_EMPTY (0x00)
/*
- * if TS_EXEC_CALC_NOT is not set then NOT expression evaluated to be true,
- * used in cases where NOT cannot be accurately computed (GiST) or
- * it isn't important (ranking)
+ * If TS_EXEC_CALC_NOT is not set, then NOT expressions are automatically
+ * evaluated to be true. Useful in cases where NOT cannot be accurately
+ * computed (GiST) or it isn't important (ranking). From TS_execute's
+ * perspective, !CALC_NOT means that the TSExecuteCallback function might
+ * return false-positive indications of a lexeme's presence.
*/
#define TS_EXEC_CALC_NOT (0x01)
/*
- * Treat OP_PHRASE as OP_AND. Used when posiotional information is not
- * accessible, like in consistent methods of GIN/GiST indexes
+ * If TS_EXEC_PHRASE_NO_POS is set, allow OP_PHRASE to be executed lossily
+ * in the absence of position information: a TRUE result indicates that the
+ * phrase might be present. Without this flag, OP_PHRASE always returns
+ * false if lexeme position information is not available.
*/
-#define TS_EXEC_PHRASE_AS_AND (0x02)
+#define TS_EXEC_PHRASE_NO_POS (0x02)
+extern bool TS_execute(QueryItem *curitem, void *arg, uint32 flags,
+ TSExecuteCallback chkcond);
extern bool tsquery_requires_match(QueryItem *curitem);
/*
@@ -138,51 +184,6 @@ extern bool tsquery_requires_match(QueryItem *curitem);
extern TSVector make_tsvector(ParsedText *prs);
extern int32 tsCompareString(char *a, int lena, char *b, int lenb, bool prefix);
-extern Datum to_tsvector_byid(PG_FUNCTION_ARGS);
-extern Datum to_tsvector(PG_FUNCTION_ARGS);
-extern Datum to_tsquery_byid(PG_FUNCTION_ARGS);
-extern Datum to_tsquery(PG_FUNCTION_ARGS);
-extern Datum plainto_tsquery_byid(PG_FUNCTION_ARGS);
-extern Datum plainto_tsquery(PG_FUNCTION_ARGS);
-extern Datum phraseto_tsquery_byid(PG_FUNCTION_ARGS);
-extern Datum phraseto_tsquery(PG_FUNCTION_ARGS);
-
-/*
- * GiST support function
- */
-
-extern Datum gtsvector_compress(PG_FUNCTION_ARGS);
-extern Datum gtsvector_decompress(PG_FUNCTION_ARGS);
-extern Datum gtsvector_consistent(PG_FUNCTION_ARGS);
-extern Datum gtsvector_union(PG_FUNCTION_ARGS);
-extern Datum gtsvector_same(PG_FUNCTION_ARGS);
-extern Datum gtsvector_penalty(PG_FUNCTION_ARGS);
-extern Datum gtsvector_picksplit(PG_FUNCTION_ARGS);
-extern Datum gtsvector_consistent_oldsig(PG_FUNCTION_ARGS);
-
-/*
- * IO functions for pseudotype gtsvector
- * used internally in tsvector GiST opclass
- */
-extern Datum gtsvectorin(PG_FUNCTION_ARGS);
-extern Datum gtsvectorout(PG_FUNCTION_ARGS);
-
-/*
- * GIN support function
- */
-
-extern Datum gin_extract_tsvector(PG_FUNCTION_ARGS);
-extern Datum gin_cmp_tslexeme(PG_FUNCTION_ARGS);
-extern Datum gin_cmp_prefix(PG_FUNCTION_ARGS);
-extern Datum gin_extract_tsquery(PG_FUNCTION_ARGS);
-extern Datum gin_tsquery_consistent(PG_FUNCTION_ARGS);
-extern Datum gin_tsquery_triconsistent(PG_FUNCTION_ARGS);
-extern Datum gin_extract_tsvector_2args(PG_FUNCTION_ARGS);
-extern Datum gin_extract_tsquery_5args(PG_FUNCTION_ARGS);
-extern Datum gin_tsquery_consistent_6args(PG_FUNCTION_ARGS);
-extern Datum gin_extract_tsquery_oldsig(PG_FUNCTION_ARGS);
-extern Datum gin_tsquery_consistent_oldsig(PG_FUNCTION_ARGS);
-
/*
* Possible strategy numbers for indexes
* TSearchStrategyNumber - (tsvector|text) @@ tsquery
@@ -195,7 +196,7 @@ extern Datum gin_tsquery_consistent_oldsig(PG_FUNCTION_ARGS);
* TSQuery Utilities
*/
extern QueryItem *clean_NOT(QueryItem *ptr, int32 *len);
-extern TSQuery cleanup_fakeval_and_phrase(TSQuery in);
+extern TSQuery cleanup_tsquery_stopwords(TSQuery in);
typedef struct QTNode
{
@@ -236,76 +237,4 @@ extern TSQuerySign makeTSQuerySign(TSQuery a);
extern QTNode *findsubquery(QTNode *root, QTNode *ex, QTNode *subs,
bool *isfind);
-/*
- * TSQuery GiST support
- */
-extern Datum gtsquery_compress(PG_FUNCTION_ARGS);
-extern Datum gtsquery_decompress(PG_FUNCTION_ARGS);
-extern Datum gtsquery_consistent(PG_FUNCTION_ARGS);
-extern Datum gtsquery_union(PG_FUNCTION_ARGS);
-extern Datum gtsquery_same(PG_FUNCTION_ARGS);
-extern Datum gtsquery_penalty(PG_FUNCTION_ARGS);
-extern Datum gtsquery_picksplit(PG_FUNCTION_ARGS);
-extern Datum gtsquery_consistent_oldsig(PG_FUNCTION_ARGS);
-
-/*
- * Parser interface to SQL
- */
-extern Datum ts_token_type_byid(PG_FUNCTION_ARGS);
-extern Datum ts_token_type_byname(PG_FUNCTION_ARGS);
-extern Datum ts_parse_byid(PG_FUNCTION_ARGS);
-extern Datum ts_parse_byname(PG_FUNCTION_ARGS);
-
-/*
- * Default word parser
- */
-
-extern Datum prsd_start(PG_FUNCTION_ARGS);
-extern Datum prsd_nexttoken(PG_FUNCTION_ARGS);
-extern Datum prsd_end(PG_FUNCTION_ARGS);
-extern Datum prsd_headline(PG_FUNCTION_ARGS);
-extern Datum prsd_lextype(PG_FUNCTION_ARGS);
-
-/*
- * Dictionary interface to SQL
- */
-extern Datum ts_lexize(PG_FUNCTION_ARGS);
-
-/*
- * Simple built-in dictionary
- */
-extern Datum dsimple_init(PG_FUNCTION_ARGS);
-extern Datum dsimple_lexize(PG_FUNCTION_ARGS);
-
-/*
- * Synonym built-in dictionary
- */
-extern Datum dsynonym_init(PG_FUNCTION_ARGS);
-extern Datum dsynonym_lexize(PG_FUNCTION_ARGS);
-
-/*
- * ISpell dictionary
- */
-extern Datum dispell_init(PG_FUNCTION_ARGS);
-extern Datum dispell_lexize(PG_FUNCTION_ARGS);
-
-/*
- * Thesaurus
- */
-extern Datum thesaurus_init(PG_FUNCTION_ARGS);
-extern Datum thesaurus_lexize(PG_FUNCTION_ARGS);
-
-/*
- * headline
- */
-extern Datum ts_headline_byid_opt(PG_FUNCTION_ARGS);
-extern Datum ts_headline_byid(PG_FUNCTION_ARGS);
-extern Datum ts_headline(PG_FUNCTION_ARGS);
-extern Datum ts_headline_opt(PG_FUNCTION_ARGS);
-
-/*
- * current cfg
- */
-extern Datum get_current_ts_config(PG_FUNCTION_ARGS);
-
#endif /* _PG_TS_UTILS_H_ */
diff --git a/src/include/utils/.gitignore b/src/include/utils/.gitignore
index 808826d147..25db658da5 100644
--- a/src/include/utils/.gitignore
+++ b/src/include/utils/.gitignore
@@ -1,3 +1,4 @@
/fmgroids.h
+/fmgrprotos.h
/probes.h
/errcodes.h
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 4cc49f0c0c..2487020ec1 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -4,7 +4,7 @@
* Definition of (and support for) access control list data structures.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/acl.h
@@ -26,6 +26,7 @@
#include "access/htup.h"
#include "nodes/parsenodes.h"
+#include "parser/parse_node.h"
#include "utils/array.h"
#include "utils/snapshot.h"
@@ -191,6 +192,7 @@ typedef enum AclObjectKind
ACL_KIND_OPFAMILY, /* pg_opfamily */
ACL_KIND_COLLATION, /* pg_collation */
ACL_KIND_CONVERSION, /* pg_conversion */
+ ACL_KIND_STATISTICS, /* pg_statistic_ext */
ACL_KIND_TABLESPACE, /* pg_tablespace */
ACL_KIND_TSDICTIONARY, /* pg_ts_dict */
ACL_KIND_TSCONFIGURATION, /* pg_ts_config */
@@ -198,6 +200,8 @@ typedef enum AclObjectKind
ACL_KIND_FOREIGN_SERVER, /* pg_foreign_server */
ACL_KIND_EVENT_TRIGGER, /* pg_event_trigger */
ACL_KIND_EXTENSION, /* pg_extension */
+ ACL_KIND_PUBLICATION, /* pg_publication */
+ ACL_KIND_SUBSCRIPTION, /* pg_subscription */
MAX_ACL_KIND /* MUST BE LAST */
} AclObjectKind;
@@ -230,10 +234,10 @@ extern bool is_admin_of_role(Oid member, Oid role);
extern void check_is_member_of_role(Oid member, Oid role);
extern Oid get_role_oid(const char *rolename, bool missing_ok);
extern Oid get_role_oid_or_public(const char *rolename);
-extern Oid get_rolespec_oid(const Node *node, bool missing_ok);
-extern void check_rolespec_name(const Node *node, const char *detail_msg);
-extern HeapTuple get_rolespec_tuple(const Node *node);
-extern char *get_rolespec_name(const Node *node);
+extern Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok);
+extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
+extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
+extern char *get_rolespec_name(const RoleSpec *role);
extern void select_best_grantor(Oid roleId, AclMode privileges,
const Acl *acl, Oid ownerId,
@@ -242,24 +246,10 @@ extern void select_best_grantor(Oid roleId, AclMode privileges,
extern void initialize_acl(void);
/*
- * SQL functions (from acl.c)
- */
-extern Datum aclitemin(PG_FUNCTION_ARGS);
-extern Datum aclitemout(PG_FUNCTION_ARGS);
-extern Datum aclinsert(PG_FUNCTION_ARGS);
-extern Datum aclremove(PG_FUNCTION_ARGS);
-extern Datum aclcontains(PG_FUNCTION_ARGS);
-extern Datum makeaclitem(PG_FUNCTION_ARGS);
-extern Datum aclitem_eq(PG_FUNCTION_ARGS);
-extern Datum hash_aclitem(PG_FUNCTION_ARGS);
-extern Datum acldefault_sql(PG_FUNCTION_ARGS);
-extern Datum aclexplode(PG_FUNCTION_ARGS);
-
-/*
* prototypes for functions in aclchk.c
*/
extern void ExecuteGrantStmt(GrantStmt *stmt);
-extern void ExecAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *stmt);
+extern void ExecAlterDefaultPrivilegesStmt(ParseState *pstate, AlterDefaultPrivilegesStmt *stmt);
extern void RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid objid);
extern void RemoveDefaultACLById(Oid defaclOid);
@@ -311,6 +301,10 @@ extern void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind,
extern void aclcheck_error_type(AclResult aclerr, Oid typeOid);
+extern void recordExtObjInitPriv(Oid objoid, Oid classoid);
+extern void removeExtObjInitPriv(Oid objoid, Oid classoid);
+
+
/* ownercheck routines just return true (owner) or false (not) */
extern bool pg_class_ownercheck(Oid class_oid, Oid roleid);
extern bool pg_type_ownercheck(Oid type_oid, Oid roleid);
@@ -331,6 +325,9 @@ extern bool pg_foreign_data_wrapper_ownercheck(Oid srv_oid, Oid roleid);
extern bool pg_foreign_server_ownercheck(Oid srv_oid, Oid roleid);
extern bool pg_event_trigger_ownercheck(Oid et_oid, Oid roleid);
extern bool pg_extension_ownercheck(Oid ext_oid, Oid roleid);
+extern bool pg_publication_ownercheck(Oid pub_oid, Oid roleid);
+extern bool pg_subscription_ownercheck(Oid sub_oid, Oid roleid);
+extern bool pg_statistics_object_ownercheck(Oid stat_oid, Oid roleid);
extern bool has_createrole_privilege(Oid roleid);
extern bool has_bypassrls_privilege(Oid roleid);
diff --git a/src/include/utils/aclchk_internal.h b/src/include/utils/aclchk_internal.h
index 319a391246..0e50f73aab 100644
--- a/src/include/utils/aclchk_internal.h
+++ b/src/include/utils/aclchk_internal.h
@@ -2,7 +2,7 @@
*
* aclchk_internal.h
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/aclchk_internal.h
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index b62b08c482..552c08f0d5 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -36,7 +36,7 @@
*
* The OIDVECTOR and INT2VECTOR datatypes are storage-compatible with
* generic arrays, but they support only one-dimensional arrays with no
- * nulls (and no null bitmap).
+ * nulls (and no null bitmap). They don't support being toasted, either.
*
* There are also some "fixed-length array" datatypes, such as NAME and
* POINT. These are simply a sequence of a fixed number of items each
@@ -51,7 +51,7 @@
* arrays holding the elements.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/array.h
@@ -328,38 +328,6 @@ extern bool Array_nulls;
/*
* prototypes for functions defined in arrayfuncs.c
*/
-extern Datum array_in(PG_FUNCTION_ARGS);
-extern Datum array_out(PG_FUNCTION_ARGS);
-extern Datum array_recv(PG_FUNCTION_ARGS);
-extern Datum array_send(PG_FUNCTION_ARGS);
-extern Datum array_eq(PG_FUNCTION_ARGS);
-extern Datum array_ne(PG_FUNCTION_ARGS);
-extern Datum array_lt(PG_FUNCTION_ARGS);
-extern Datum array_gt(PG_FUNCTION_ARGS);
-extern Datum array_le(PG_FUNCTION_ARGS);
-extern Datum array_ge(PG_FUNCTION_ARGS);
-extern Datum btarraycmp(PG_FUNCTION_ARGS);
-extern Datum hash_array(PG_FUNCTION_ARGS);
-extern Datum arrayoverlap(PG_FUNCTION_ARGS);
-extern Datum arraycontains(PG_FUNCTION_ARGS);
-extern Datum arraycontained(PG_FUNCTION_ARGS);
-extern Datum array_ndims(PG_FUNCTION_ARGS);
-extern Datum array_dims(PG_FUNCTION_ARGS);
-extern Datum array_lower(PG_FUNCTION_ARGS);
-extern Datum array_upper(PG_FUNCTION_ARGS);
-extern Datum array_length(PG_FUNCTION_ARGS);
-extern Datum array_cardinality(PG_FUNCTION_ARGS);
-extern Datum array_larger(PG_FUNCTION_ARGS);
-extern Datum array_smaller(PG_FUNCTION_ARGS);
-extern Datum generate_subscripts(PG_FUNCTION_ARGS);
-extern Datum generate_subscripts_nodir(PG_FUNCTION_ARGS);
-extern Datum array_fill(PG_FUNCTION_ARGS);
-extern Datum array_fill_with_lower_bounds(PG_FUNCTION_ARGS);
-extern Datum array_unnest(PG_FUNCTION_ARGS);
-extern Datum array_remove(PG_FUNCTION_ARGS);
-extern Datum array_replace(PG_FUNCTION_ARGS);
-extern Datum width_bucket_array(PG_FUNCTION_ARGS);
-
extern void CopyArrayEls(ArrayType *array,
Datum *values,
bool *nulls,
@@ -475,31 +443,4 @@ extern ExpandedArrayHeader *DatumGetExpandedArrayX(Datum d,
extern AnyArrayType *DatumGetAnyArray(Datum d);
extern void deconstruct_expanded_array(ExpandedArrayHeader *eah);
-/*
- * prototypes for functions defined in array_userfuncs.c
- */
-extern Datum array_append(PG_FUNCTION_ARGS);
-extern Datum array_prepend(PG_FUNCTION_ARGS);
-extern Datum array_cat(PG_FUNCTION_ARGS);
-
-extern ArrayType *create_singleton_array(FunctionCallInfo fcinfo,
- Oid element_type,
- Datum element,
- bool isNull,
- int ndims);
-
-extern Datum array_agg_transfn(PG_FUNCTION_ARGS);
-extern Datum array_agg_finalfn(PG_FUNCTION_ARGS);
-extern Datum array_agg_array_transfn(PG_FUNCTION_ARGS);
-extern Datum array_agg_array_finalfn(PG_FUNCTION_ARGS);
-
-extern Datum array_position(PG_FUNCTION_ARGS);
-extern Datum array_position_start(PG_FUNCTION_ARGS);
-extern Datum array_positions(PG_FUNCTION_ARGS);
-
-/*
- * prototypes for functions defined in array_typanalyze.c
- */
-extern Datum array_typanalyze(PG_FUNCTION_ARGS);
-
#endif /* ARRAY_H */
diff --git a/src/include/utils/arrayaccess.h b/src/include/utils/arrayaccess.h
index 3ff49f12bc..6148bdf834 100644
--- a/src/include/utils/arrayaccess.h
+++ b/src/include/utils/arrayaccess.h
@@ -4,7 +4,7 @@
* Declarations for element-by-element access to Postgres arrays.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/arrayaccess.h
diff --git a/src/include/utils/ascii.h b/src/include/utils/ascii.h
index 1006d0d63e..3771e1acab 100644
--- a/src/include/utils/ascii.h
+++ b/src/include/utils/ascii.h
@@ -1,7 +1,7 @@
/*-----------------------------------------------------------------------
* ascii.h
*
- * Portions Copyright (c) 1999-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1999-2017, PostgreSQL Global Development Group
*
* src/include/utils/ascii.h
*
@@ -11,12 +11,6 @@
#ifndef _ASCII_H_
#define _ASCII_H_
-#include "fmgr.h"
-
-extern Datum to_ascii_encname(PG_FUNCTION_ARGS);
-extern Datum to_ascii_enc(PG_FUNCTION_ARGS);
-extern Datum to_ascii_default(PG_FUNCTION_ARGS);
-
extern void ascii_safe_strlcpy(char *dest, const char *src, size_t destsiz);
#endif /* _ASCII_H_ */
diff --git a/src/include/utils/attoptcache.h b/src/include/utils/attoptcache.h
index cf8ead006d..7f2334b4cd 100644
--- a/src/include/utils/attoptcache.h
+++ b/src/include/utils/attoptcache.h
@@ -3,7 +3,7 @@
* attoptcache.h
* Attribute options cache.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/attoptcache.h
diff --git a/src/include/utils/backend_random.h b/src/include/utils/backend_random.h
new file mode 100644
index 0000000000..31602f250d
--- /dev/null
+++ b/src/include/utils/backend_random.h
@@ -0,0 +1,19 @@
+/*-------------------------------------------------------------------------
+ *
+ * backend_random.h
+ * Declarations for backend random number generation
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ *
+ * src/include/utils/backend_random.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef BACKEND_RANDOM_H
+#define BACKEND_RANDOM_H
+
+extern Size BackendRandomShmemSize(void);
+extern void BackendRandomShmemInit(void);
+extern bool pg_backend_random(char *dst, int len);
+
+#endif /* BACKEND_RANDOM_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index fa7b940659..ea93c922f1 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/builtins.h
@@ -16,283 +16,34 @@
#define BUILTINS_H
#include "fmgr.h"
-#include "lib/stringinfo.h"
#include "nodes/parsenodes.h"
#ifdef PGXC
#include "lib/stringinfo.h"
#endif
-#include "utils/sortsupport.h"
-/*
- * Defined in adt/
- */
-
-/* acl.c */
-extern Datum has_any_column_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_any_column_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_any_column_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_any_column_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_any_column_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_any_column_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_name_name_name(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_name_name_attnum(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_name_id_name(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_name_id_attnum(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_id_name_name(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_id_name_attnum(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_id_id_name(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_id_id_attnum(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_name_attnum(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_column_privilege_id_attnum(PG_FUNCTION_ARGS);
-extern Datum has_table_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_table_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_table_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_table_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_table_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_table_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_sequence_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_sequence_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_sequence_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_sequence_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_sequence_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_sequence_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_database_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_database_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_database_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_database_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_database_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_database_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_foreign_data_wrapper_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_foreign_data_wrapper_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_foreign_data_wrapper_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_foreign_data_wrapper_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_foreign_data_wrapper_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_foreign_data_wrapper_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_function_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_function_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_function_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_function_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_function_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_function_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_language_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_language_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_language_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_language_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_language_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_language_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_schema_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_schema_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_schema_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_schema_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_schema_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_schema_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_server_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_server_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_server_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_server_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_server_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_server_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_tablespace_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_tablespace_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_tablespace_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_tablespace_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_tablespace_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_tablespace_privilege_id(PG_FUNCTION_ARGS);
-extern Datum has_type_privilege_name_name(PG_FUNCTION_ARGS);
-extern Datum has_type_privilege_name_id(PG_FUNCTION_ARGS);
-extern Datum has_type_privilege_id_name(PG_FUNCTION_ARGS);
-extern Datum has_type_privilege_id_id(PG_FUNCTION_ARGS);
-extern Datum has_type_privilege_name(PG_FUNCTION_ARGS);
-extern Datum has_type_privilege_id(PG_FUNCTION_ARGS);
-extern Datum pg_has_role_name_name(PG_FUNCTION_ARGS);
-extern Datum pg_has_role_name_id(PG_FUNCTION_ARGS);
-extern Datum pg_has_role_id_name(PG_FUNCTION_ARGS);
-extern Datum pg_has_role_id_id(PG_FUNCTION_ARGS);
-extern Datum pg_has_role_name(PG_FUNCTION_ARGS);
-extern Datum pg_has_role_id(PG_FUNCTION_ARGS);
-
-/* amutils.c */
-extern Datum pg_indexam_has_property(PG_FUNCTION_ARGS);
-extern Datum pg_index_has_property(PG_FUNCTION_ARGS);
-extern Datum pg_index_column_has_property(PG_FUNCTION_ARGS);
+#include "nodes/nodes.h"
+#include "utils/fmgrprotos.h"
/* bool.c */
-extern Datum boolin(PG_FUNCTION_ARGS);
-extern Datum boolout(PG_FUNCTION_ARGS);
-extern Datum boolrecv(PG_FUNCTION_ARGS);
-extern Datum boolsend(PG_FUNCTION_ARGS);
-extern Datum booltext(PG_FUNCTION_ARGS);
-extern Datum booleq(PG_FUNCTION_ARGS);
-extern Datum boolne(PG_FUNCTION_ARGS);
-extern Datum boollt(PG_FUNCTION_ARGS);
-extern Datum boolgt(PG_FUNCTION_ARGS);
-extern Datum boolle(PG_FUNCTION_ARGS);
-extern Datum boolge(PG_FUNCTION_ARGS);
-extern Datum booland_statefunc(PG_FUNCTION_ARGS);
-extern Datum boolor_statefunc(PG_FUNCTION_ARGS);
-extern Datum bool_accum(PG_FUNCTION_ARGS);
-extern Datum bool_accum_inv(PG_FUNCTION_ARGS);
-extern Datum bool_alltrue(PG_FUNCTION_ARGS);
-extern Datum bool_anytrue(PG_FUNCTION_ARGS);
extern bool parse_bool(const char *value, bool *result);
extern bool parse_bool_with_len(const char *value, size_t len, bool *result);
-/* char.c */
-extern Datum charin(PG_FUNCTION_ARGS);
-extern Datum charout(PG_FUNCTION_ARGS);
-extern Datum charrecv(PG_FUNCTION_ARGS);
-extern Datum charsend(PG_FUNCTION_ARGS);
-extern Datum chareq(PG_FUNCTION_ARGS);
-extern Datum charne(PG_FUNCTION_ARGS);
-extern Datum charlt(PG_FUNCTION_ARGS);
-extern Datum charle(PG_FUNCTION_ARGS);
-extern Datum chargt(PG_FUNCTION_ARGS);
-extern Datum charge(PG_FUNCTION_ARGS);
-extern Datum chartoi4(PG_FUNCTION_ARGS);
-extern Datum i4tochar(PG_FUNCTION_ARGS);
-extern Datum text_char(PG_FUNCTION_ARGS);
-extern Datum char_text(PG_FUNCTION_ARGS);
-
/* domains.c */
-extern Datum domain_in(PG_FUNCTION_ARGS);
-extern Datum domain_recv(PG_FUNCTION_ARGS);
extern void domain_check(Datum value, bool isnull, Oid domainType,
void **extra, MemoryContext mcxt);
extern int errdatatype(Oid datatypeOid);
extern int errdomainconstraint(Oid datatypeOid, const char *conname);
/* encode.c */
-extern Datum binary_encode(PG_FUNCTION_ARGS);
-extern Datum binary_decode(PG_FUNCTION_ARGS);
extern unsigned hex_encode(const char *src, unsigned len, char *dst);
extern unsigned hex_decode(const char *src, unsigned len, char *dst);
-/* enum.c */
-extern Datum enum_in(PG_FUNCTION_ARGS);
-extern Datum enum_out(PG_FUNCTION_ARGS);
-extern Datum enum_recv(PG_FUNCTION_ARGS);
-extern Datum enum_send(PG_FUNCTION_ARGS);
-extern Datum enum_lt(PG_FUNCTION_ARGS);
-extern Datum enum_le(PG_FUNCTION_ARGS);
-extern Datum enum_eq(PG_FUNCTION_ARGS);
-extern Datum enum_ne(PG_FUNCTION_ARGS);
-extern Datum enum_ge(PG_FUNCTION_ARGS);
-extern Datum enum_gt(PG_FUNCTION_ARGS);
-extern Datum enum_cmp(PG_FUNCTION_ARGS);
-extern Datum enum_smaller(PG_FUNCTION_ARGS);
-extern Datum enum_larger(PG_FUNCTION_ARGS);
-extern Datum enum_first(PG_FUNCTION_ARGS);
-extern Datum enum_last(PG_FUNCTION_ARGS);
-extern Datum enum_range_bounds(PG_FUNCTION_ARGS);
-extern Datum enum_range_all(PG_FUNCTION_ARGS);
-
/* int.c */
-extern Datum int2in(PG_FUNCTION_ARGS);
-extern Datum int2out(PG_FUNCTION_ARGS);
-extern Datum int2recv(PG_FUNCTION_ARGS);
-extern Datum int2send(PG_FUNCTION_ARGS);
-extern Datum int2vectorin(PG_FUNCTION_ARGS);
-extern Datum int2vectorout(PG_FUNCTION_ARGS);
-extern Datum int2vectorrecv(PG_FUNCTION_ARGS);
-extern Datum int2vectorsend(PG_FUNCTION_ARGS);
-extern Datum int2vectoreq(PG_FUNCTION_ARGS);
-extern Datum int4in(PG_FUNCTION_ARGS);
-extern Datum int4out(PG_FUNCTION_ARGS);
-extern Datum int4recv(PG_FUNCTION_ARGS);
-extern Datum int4send(PG_FUNCTION_ARGS);
-extern Datum i2toi4(PG_FUNCTION_ARGS);
-extern Datum i4toi2(PG_FUNCTION_ARGS);
-extern Datum int4_bool(PG_FUNCTION_ARGS);
-extern Datum bool_int4(PG_FUNCTION_ARGS);
-extern Datum int4eq(PG_FUNCTION_ARGS);
-extern Datum int4ne(PG_FUNCTION_ARGS);
-extern Datum int4lt(PG_FUNCTION_ARGS);
-extern Datum int4le(PG_FUNCTION_ARGS);
-extern Datum int4gt(PG_FUNCTION_ARGS);
-extern Datum int4ge(PG_FUNCTION_ARGS);
-extern Datum int2eq(PG_FUNCTION_ARGS);
-extern Datum int2ne(PG_FUNCTION_ARGS);
-extern Datum int2lt(PG_FUNCTION_ARGS);
-extern Datum int2le(PG_FUNCTION_ARGS);
-extern Datum int2gt(PG_FUNCTION_ARGS);
-extern Datum int2ge(PG_FUNCTION_ARGS);
-extern Datum int24eq(PG_FUNCTION_ARGS);
-extern Datum int24ne(PG_FUNCTION_ARGS);
-extern Datum int24lt(PG_FUNCTION_ARGS);
-extern Datum int24le(PG_FUNCTION_ARGS);
-extern Datum int24gt(PG_FUNCTION_ARGS);
-extern Datum int24ge(PG_FUNCTION_ARGS);
-extern Datum int42eq(PG_FUNCTION_ARGS);
-extern Datum int42ne(PG_FUNCTION_ARGS);
-extern Datum int42lt(PG_FUNCTION_ARGS);
-extern Datum int42le(PG_FUNCTION_ARGS);
-extern Datum int42gt(PG_FUNCTION_ARGS);
-extern Datum int42ge(PG_FUNCTION_ARGS);
-extern Datum int4um(PG_FUNCTION_ARGS);
-extern Datum int4up(PG_FUNCTION_ARGS);
-extern Datum int4pl(PG_FUNCTION_ARGS);
-extern Datum int4mi(PG_FUNCTION_ARGS);
-extern Datum int4mul(PG_FUNCTION_ARGS);
-extern Datum int4div(PG_FUNCTION_ARGS);
-extern Datum int4abs(PG_FUNCTION_ARGS);
-extern Datum int4inc(PG_FUNCTION_ARGS);
-extern Datum int2um(PG_FUNCTION_ARGS);
-extern Datum int2up(PG_FUNCTION_ARGS);
-extern Datum int2pl(PG_FUNCTION_ARGS);
-extern Datum int2mi(PG_FUNCTION_ARGS);
-extern Datum int2mul(PG_FUNCTION_ARGS);
-extern Datum int2div(PG_FUNCTION_ARGS);
-extern Datum int2abs(PG_FUNCTION_ARGS);
-extern Datum int24pl(PG_FUNCTION_ARGS);
-extern Datum int24mi(PG_FUNCTION_ARGS);
-extern Datum int24mul(PG_FUNCTION_ARGS);
-extern Datum int24div(PG_FUNCTION_ARGS);
-extern Datum int42pl(PG_FUNCTION_ARGS);
-extern Datum int42mi(PG_FUNCTION_ARGS);
-extern Datum int42mul(PG_FUNCTION_ARGS);
-extern Datum int42div(PG_FUNCTION_ARGS);
-extern Datum int4mod(PG_FUNCTION_ARGS);
-extern Datum int2mod(PG_FUNCTION_ARGS);
-extern Datum int2larger(PG_FUNCTION_ARGS);
-extern Datum int2smaller(PG_FUNCTION_ARGS);
-extern Datum int4larger(PG_FUNCTION_ARGS);
-extern Datum int4smaller(PG_FUNCTION_ARGS);
-
-extern Datum int4and(PG_FUNCTION_ARGS);
-extern Datum int4or(PG_FUNCTION_ARGS);
-extern Datum int4xor(PG_FUNCTION_ARGS);
-extern Datum int4not(PG_FUNCTION_ARGS);
-extern Datum int4shl(PG_FUNCTION_ARGS);
-extern Datum int4shr(PG_FUNCTION_ARGS);
-extern Datum int2and(PG_FUNCTION_ARGS);
-extern Datum int2or(PG_FUNCTION_ARGS);
-extern Datum int2xor(PG_FUNCTION_ARGS);
-extern Datum int2not(PG_FUNCTION_ARGS);
-extern Datum int2shl(PG_FUNCTION_ARGS);
-extern Datum int2shr(PG_FUNCTION_ARGS);
-extern Datum generate_series_int4(PG_FUNCTION_ARGS);
-extern Datum generate_series_step_int4(PG_FUNCTION_ARGS);
extern int2vector *buildint2vector(const int16 *int2s, int n);
/* name.c */
-extern Datum namein(PG_FUNCTION_ARGS);
-extern Datum nameout(PG_FUNCTION_ARGS);
-extern Datum namerecv(PG_FUNCTION_ARGS);
-extern Datum namesend(PG_FUNCTION_ARGS);
-extern Datum nameeq(PG_FUNCTION_ARGS);
-extern Datum namene(PG_FUNCTION_ARGS);
-extern Datum namelt(PG_FUNCTION_ARGS);
-extern Datum namele(PG_FUNCTION_ARGS);
-extern Datum namegt(PG_FUNCTION_ARGS);
-extern Datum namege(PG_FUNCTION_ARGS);
extern int namecpy(Name n1, Name n2);
extern int namestrcpy(Name name, const char *str);
extern int namestrcmp(Name name, const char *str);
-extern Datum current_user(PG_FUNCTION_ARGS);
-extern Datum session_user(PG_FUNCTION_ARGS);
-extern Datum current_schema(PG_FUNCTION_ARGS);
-extern Datum current_schemas(PG_FUNCTION_ARGS);
/* numutils.c */
extern int32 pg_atoi(const char *s, int size, int c);
@@ -303,47 +54,6 @@ extern char *pg_ltostr_zeropad(char *str, int32 value, int32 minwidth);
extern char *pg_ltostr(char *str, int32 value);
extern uint64 pg_strtouint64(const char *str, char **endptr, int base);
-/*
- * Per-opclass comparison functions for new btrees. These are
- * stored in pg_amproc; most are defined in access/nbtree/nbtcompare.c
- */
-extern Datum btboolcmp(PG_FUNCTION_ARGS);
-extern Datum btint2cmp(PG_FUNCTION_ARGS);
-extern Datum btint4cmp(PG_FUNCTION_ARGS);
-extern Datum btint8cmp(PG_FUNCTION_ARGS);
-extern Datum btfloat4cmp(PG_FUNCTION_ARGS);
-extern Datum btfloat8cmp(PG_FUNCTION_ARGS);
-extern Datum btint48cmp(PG_FUNCTION_ARGS);
-extern Datum btint84cmp(PG_FUNCTION_ARGS);
-extern Datum btint24cmp(PG_FUNCTION_ARGS);
-extern Datum btint42cmp(PG_FUNCTION_ARGS);
-extern Datum btint28cmp(PG_FUNCTION_ARGS);
-extern Datum btint82cmp(PG_FUNCTION_ARGS);
-extern Datum btfloat48cmp(PG_FUNCTION_ARGS);
-extern Datum btfloat84cmp(PG_FUNCTION_ARGS);
-extern Datum btoidcmp(PG_FUNCTION_ARGS);
-extern Datum btoidvectorcmp(PG_FUNCTION_ARGS);
-extern Datum btabstimecmp(PG_FUNCTION_ARGS);
-extern Datum btreltimecmp(PG_FUNCTION_ARGS);
-extern Datum bttintervalcmp(PG_FUNCTION_ARGS);
-extern Datum btcharcmp(PG_FUNCTION_ARGS);
-extern Datum btnamecmp(PG_FUNCTION_ARGS);
-extern Datum bttextcmp(PG_FUNCTION_ARGS);
-extern Datum bttextsortsupport(PG_FUNCTION_ARGS);
-
-/*
- * Per-opclass sort support functions for new btrees. Like the
- * functions above, these are stored in pg_amproc; most are defined in
- * access/nbtree/nbtcompare.c
- */
-extern Datum btint2sortsupport(PG_FUNCTION_ARGS);
-extern Datum btint4sortsupport(PG_FUNCTION_ARGS);
-extern Datum btint8sortsupport(PG_FUNCTION_ARGS);
-extern Datum btfloat4sortsupport(PG_FUNCTION_ARGS);
-extern Datum btfloat8sortsupport(PG_FUNCTION_ARGS);
-extern Datum btoidsortsupport(PG_FUNCTION_ARGS);
-extern Datum btnamesortsupport(PG_FUNCTION_ARGS);
-
/* float.c */
extern PGDLLIMPORT int extra_float_digits;
@@ -358,397 +68,21 @@ extern char *float8out_internal(double num);
extern int float4_cmp_internal(float4 a, float4 b);
extern int float8_cmp_internal(float8 a, float8 b);
-extern Datum float4in(PG_FUNCTION_ARGS);
-extern Datum float4out(PG_FUNCTION_ARGS);
-extern Datum float4recv(PG_FUNCTION_ARGS);
-extern Datum float4send(PG_FUNCTION_ARGS);
-extern Datum float8in(PG_FUNCTION_ARGS);
-extern Datum float8out(PG_FUNCTION_ARGS);
-extern Datum float8recv(PG_FUNCTION_ARGS);
-extern Datum float8send(PG_FUNCTION_ARGS);
-extern Datum float4abs(PG_FUNCTION_ARGS);
-extern Datum float4um(PG_FUNCTION_ARGS);
-extern Datum float4up(PG_FUNCTION_ARGS);
-extern Datum float4larger(PG_FUNCTION_ARGS);
-extern Datum float4smaller(PG_FUNCTION_ARGS);
-extern Datum float8abs(PG_FUNCTION_ARGS);
-extern Datum float8um(PG_FUNCTION_ARGS);
-extern Datum float8up(PG_FUNCTION_ARGS);
-extern Datum float8larger(PG_FUNCTION_ARGS);
-extern Datum float8smaller(PG_FUNCTION_ARGS);
-extern Datum float4pl(PG_FUNCTION_ARGS);
-extern Datum float4mi(PG_FUNCTION_ARGS);
-extern Datum float4mul(PG_FUNCTION_ARGS);
-extern Datum float4div(PG_FUNCTION_ARGS);
-extern Datum float8pl(PG_FUNCTION_ARGS);
-extern Datum float8mi(PG_FUNCTION_ARGS);
-extern Datum float8mul(PG_FUNCTION_ARGS);
-extern Datum float8div(PG_FUNCTION_ARGS);
-extern Datum float4eq(PG_FUNCTION_ARGS);
-extern Datum float4ne(PG_FUNCTION_ARGS);
-extern Datum float4lt(PG_FUNCTION_ARGS);
-extern Datum float4le(PG_FUNCTION_ARGS);
-extern Datum float4gt(PG_FUNCTION_ARGS);
-extern Datum float4ge(PG_FUNCTION_ARGS);
-extern Datum float8eq(PG_FUNCTION_ARGS);
-extern Datum float8ne(PG_FUNCTION_ARGS);
-extern Datum float8lt(PG_FUNCTION_ARGS);
-extern Datum float8le(PG_FUNCTION_ARGS);
-extern Datum float8gt(PG_FUNCTION_ARGS);
-extern Datum float8ge(PG_FUNCTION_ARGS);
-extern Datum ftod(PG_FUNCTION_ARGS);
-extern Datum i4tod(PG_FUNCTION_ARGS);
-extern Datum i2tod(PG_FUNCTION_ARGS);
-extern Datum dtof(PG_FUNCTION_ARGS);
-extern Datum dtoi4(PG_FUNCTION_ARGS);
-extern Datum dtoi2(PG_FUNCTION_ARGS);
-extern Datum i4tof(PG_FUNCTION_ARGS);
-extern Datum i2tof(PG_FUNCTION_ARGS);
-extern Datum ftoi4(PG_FUNCTION_ARGS);
-extern Datum ftoi2(PG_FUNCTION_ARGS);
-extern Datum dround(PG_FUNCTION_ARGS);
-extern Datum dceil(PG_FUNCTION_ARGS);
-extern Datum dfloor(PG_FUNCTION_ARGS);
-extern Datum dsign(PG_FUNCTION_ARGS);
-extern Datum dtrunc(PG_FUNCTION_ARGS);
-extern Datum dsqrt(PG_FUNCTION_ARGS);
-extern Datum dcbrt(PG_FUNCTION_ARGS);
-extern Datum dpow(PG_FUNCTION_ARGS);
-extern Datum dexp(PG_FUNCTION_ARGS);
-extern Datum dlog1(PG_FUNCTION_ARGS);
-extern Datum dlog10(PG_FUNCTION_ARGS);
-extern Datum dacos(PG_FUNCTION_ARGS);
-extern Datum dasin(PG_FUNCTION_ARGS);
-extern Datum datan(PG_FUNCTION_ARGS);
-extern Datum datan2(PG_FUNCTION_ARGS);
-extern Datum dcos(PG_FUNCTION_ARGS);
-extern Datum dcot(PG_FUNCTION_ARGS);
-extern Datum dsin(PG_FUNCTION_ARGS);
-extern Datum dtan(PG_FUNCTION_ARGS);
-extern Datum dacosd(PG_FUNCTION_ARGS);
-extern Datum dasind(PG_FUNCTION_ARGS);
-extern Datum datand(PG_FUNCTION_ARGS);
-extern Datum datan2d(PG_FUNCTION_ARGS);
-extern Datum dcosd(PG_FUNCTION_ARGS);
-extern Datum dcotd(PG_FUNCTION_ARGS);
-extern Datum dsind(PG_FUNCTION_ARGS);
-extern Datum dtand(PG_FUNCTION_ARGS);
-extern Datum degrees(PG_FUNCTION_ARGS);
-extern Datum dpi(PG_FUNCTION_ARGS);
-extern Datum radians(PG_FUNCTION_ARGS);
-extern Datum drandom(PG_FUNCTION_ARGS);
-extern Datum setseed(PG_FUNCTION_ARGS);
-extern Datum float8_combine(PG_FUNCTION_ARGS);
-extern Datum float8_accum(PG_FUNCTION_ARGS);
-extern Datum float4_accum(PG_FUNCTION_ARGS);
-extern Datum float8_avg(PG_FUNCTION_ARGS);
-extern Datum float8_var_pop(PG_FUNCTION_ARGS);
-extern Datum float8_var_samp(PG_FUNCTION_ARGS);
-extern Datum float8_stddev_pop(PG_FUNCTION_ARGS);
-extern Datum float8_stddev_samp(PG_FUNCTION_ARGS);
-extern Datum float8_regr_accum(PG_FUNCTION_ARGS);
-extern Datum float8_regr_combine(PG_FUNCTION_ARGS);
-extern Datum float8_regr_sxx(PG_FUNCTION_ARGS);
-extern Datum float8_regr_syy(PG_FUNCTION_ARGS);
-extern Datum float8_regr_sxy(PG_FUNCTION_ARGS);
-extern Datum float8_regr_avgx(PG_FUNCTION_ARGS);
-extern Datum float8_regr_avgy(PG_FUNCTION_ARGS);
-extern Datum float8_covar_pop(PG_FUNCTION_ARGS);
-extern Datum float8_covar_samp(PG_FUNCTION_ARGS);
-extern Datum float8_corr(PG_FUNCTION_ARGS);
-extern Datum float8_regr_r2(PG_FUNCTION_ARGS);
-extern Datum float8_regr_slope(PG_FUNCTION_ARGS);
-extern Datum float8_regr_intercept(PG_FUNCTION_ARGS);
-extern Datum float48pl(PG_FUNCTION_ARGS);
-extern Datum float48mi(PG_FUNCTION_ARGS);
-extern Datum float48mul(PG_FUNCTION_ARGS);
-extern Datum float48div(PG_FUNCTION_ARGS);
-extern Datum float84pl(PG_FUNCTION_ARGS);
-extern Datum float84mi(PG_FUNCTION_ARGS);
-extern Datum float84mul(PG_FUNCTION_ARGS);
-extern Datum float84div(PG_FUNCTION_ARGS);
-extern Datum float48eq(PG_FUNCTION_ARGS);
-extern Datum float48ne(PG_FUNCTION_ARGS);
-extern Datum float48lt(PG_FUNCTION_ARGS);
-extern Datum float48le(PG_FUNCTION_ARGS);
-extern Datum float48gt(PG_FUNCTION_ARGS);
-extern Datum float48ge(PG_FUNCTION_ARGS);
-extern Datum float84eq(PG_FUNCTION_ARGS);
-extern Datum float84ne(PG_FUNCTION_ARGS);
-extern Datum float84lt(PG_FUNCTION_ARGS);
-extern Datum float84le(PG_FUNCTION_ARGS);
-extern Datum float84gt(PG_FUNCTION_ARGS);
-extern Datum float84ge(PG_FUNCTION_ARGS);
-extern Datum width_bucket_float8(PG_FUNCTION_ARGS);
-
-/* dbsize.c */
-extern Datum pg_tablespace_size_oid(PG_FUNCTION_ARGS);
-extern Datum pg_tablespace_size_name(PG_FUNCTION_ARGS);
-extern Datum pg_database_size_oid(PG_FUNCTION_ARGS);
-extern Datum pg_database_size_name(PG_FUNCTION_ARGS);
-extern Datum pg_relation_size(PG_FUNCTION_ARGS);
-extern Datum pg_total_relation_size(PG_FUNCTION_ARGS);
-extern Datum pg_size_pretty(PG_FUNCTION_ARGS);
-extern Datum pg_size_pretty_numeric(PG_FUNCTION_ARGS);
-extern Datum pg_size_bytes(PG_FUNCTION_ARGS);
-extern Datum pg_table_size(PG_FUNCTION_ARGS);
-extern Datum pg_indexes_size(PG_FUNCTION_ARGS);
-extern Datum pg_relation_filenode(PG_FUNCTION_ARGS);
-extern Datum pg_filenode_relation(PG_FUNCTION_ARGS);
-extern Datum pg_relation_filepath(PG_FUNCTION_ARGS);
-
-/* genfile.c */
-extern Datum pg_stat_file(PG_FUNCTION_ARGS);
-extern Datum pg_stat_file_1arg(PG_FUNCTION_ARGS);
-extern Datum pg_read_file(PG_FUNCTION_ARGS);
-extern Datum pg_read_file_off_len(PG_FUNCTION_ARGS);
-extern Datum pg_read_file_all(PG_FUNCTION_ARGS);
-extern Datum pg_read_binary_file(PG_FUNCTION_ARGS);
-extern Datum pg_read_binary_file_off_len(PG_FUNCTION_ARGS);
-extern Datum pg_read_binary_file_all(PG_FUNCTION_ARGS);
-extern Datum pg_ls_dir(PG_FUNCTION_ARGS);
-extern Datum pg_ls_dir_1arg(PG_FUNCTION_ARGS);
-
-/* misc.c */
-extern Datum pg_num_nulls(PG_FUNCTION_ARGS);
-extern Datum pg_num_nonnulls(PG_FUNCTION_ARGS);
-extern Datum current_database(PG_FUNCTION_ARGS);
-extern Datum current_query(PG_FUNCTION_ARGS);
-extern Datum pg_cancel_backend(PG_FUNCTION_ARGS);
-extern Datum pg_terminate_backend(PG_FUNCTION_ARGS);
-extern Datum pg_reload_conf(PG_FUNCTION_ARGS);
-extern Datum pg_tablespace_databases(PG_FUNCTION_ARGS);
-extern Datum pg_tablespace_location(PG_FUNCTION_ARGS);
-extern Datum pg_rotate_logfile(PG_FUNCTION_ARGS);
-extern Datum pg_sleep(PG_FUNCTION_ARGS);
-extern Datum pg_get_keywords(PG_FUNCTION_ARGS);
-extern Datum pg_typeof(PG_FUNCTION_ARGS);
-extern Datum pg_collation_for(PG_FUNCTION_ARGS);
-extern Datum pg_relation_is_updatable(PG_FUNCTION_ARGS);
-extern Datum pg_column_is_updatable(PG_FUNCTION_ARGS);
-extern Datum parse_ident(PG_FUNCTION_ARGS);
-
/* oid.c */
-extern Datum oidin(PG_FUNCTION_ARGS);
-extern Datum oidout(PG_FUNCTION_ARGS);
-extern Datum oidrecv(PG_FUNCTION_ARGS);
-extern Datum oidsend(PG_FUNCTION_ARGS);
-extern Datum oideq(PG_FUNCTION_ARGS);
-extern Datum oidne(PG_FUNCTION_ARGS);
-extern Datum oidlt(PG_FUNCTION_ARGS);
-extern Datum oidle(PG_FUNCTION_ARGS);
-extern Datum oidge(PG_FUNCTION_ARGS);
-extern Datum oidgt(PG_FUNCTION_ARGS);
-extern Datum oidlarger(PG_FUNCTION_ARGS);
-extern Datum oidsmaller(PG_FUNCTION_ARGS);
-extern Datum oidvectorin(PG_FUNCTION_ARGS);
-extern Datum oidvectorout(PG_FUNCTION_ARGS);
-extern Datum oidvectorrecv(PG_FUNCTION_ARGS);
-extern Datum oidvectorsend(PG_FUNCTION_ARGS);
-extern Datum oidvectoreq(PG_FUNCTION_ARGS);
-extern Datum oidvectorne(PG_FUNCTION_ARGS);
-extern Datum oidvectorlt(PG_FUNCTION_ARGS);
-extern Datum oidvectorle(PG_FUNCTION_ARGS);
-extern Datum oidvectorge(PG_FUNCTION_ARGS);
-extern Datum oidvectorgt(PG_FUNCTION_ARGS);
extern oidvector *buildoidvector(const Oid *oids, int n);
extern Oid oidparse(Node *node);
-
-/* orderedsetaggs.c */
-extern Datum ordered_set_transition(PG_FUNCTION_ARGS);
-extern Datum ordered_set_transition_multi(PG_FUNCTION_ARGS);
-extern Datum percentile_disc_final(PG_FUNCTION_ARGS);
-extern Datum percentile_cont_float8_final(PG_FUNCTION_ARGS);
-extern Datum percentile_cont_interval_final(PG_FUNCTION_ARGS);
-extern Datum percentile_disc_multi_final(PG_FUNCTION_ARGS);
-extern Datum percentile_cont_float8_multi_final(PG_FUNCTION_ARGS);
-extern Datum percentile_cont_interval_multi_final(PG_FUNCTION_ARGS);
-extern Datum mode_final(PG_FUNCTION_ARGS);
-extern Datum hypothetical_rank_final(PG_FUNCTION_ARGS);
-extern Datum hypothetical_percent_rank_final(PG_FUNCTION_ARGS);
-extern Datum hypothetical_cume_dist_final(PG_FUNCTION_ARGS);
-extern Datum hypothetical_dense_rank_final(PG_FUNCTION_ARGS);
-
-/* pseudotypes.c */
-extern Datum cstring_in(PG_FUNCTION_ARGS);
-extern Datum cstring_out(PG_FUNCTION_ARGS);
-extern Datum cstring_recv(PG_FUNCTION_ARGS);
-extern Datum cstring_send(PG_FUNCTION_ARGS);
-extern Datum any_in(PG_FUNCTION_ARGS);
-extern Datum any_out(PG_FUNCTION_ARGS);
-extern Datum anyarray_in(PG_FUNCTION_ARGS);
-extern Datum anyarray_out(PG_FUNCTION_ARGS);
-extern Datum anyarray_recv(PG_FUNCTION_ARGS);
-extern Datum anyarray_send(PG_FUNCTION_ARGS);
-extern Datum anynonarray_in(PG_FUNCTION_ARGS);
-extern Datum anynonarray_out(PG_FUNCTION_ARGS);
-extern Datum anyenum_in(PG_FUNCTION_ARGS);
-extern Datum anyenum_out(PG_FUNCTION_ARGS);
-extern Datum anyrange_in(PG_FUNCTION_ARGS);
-extern Datum anyrange_out(PG_FUNCTION_ARGS);
-extern Datum void_in(PG_FUNCTION_ARGS);
-extern Datum void_out(PG_FUNCTION_ARGS);
-extern Datum void_recv(PG_FUNCTION_ARGS);
-extern Datum void_send(PG_FUNCTION_ARGS);
#ifdef PGXC
extern Datum pgxc_node_str (PG_FUNCTION_ARGS);
extern Datum pgxc_lock_for_backup (PG_FUNCTION_ARGS);
#endif
-extern Datum trigger_in(PG_FUNCTION_ARGS);
-extern Datum trigger_out(PG_FUNCTION_ARGS);
-extern Datum event_trigger_in(PG_FUNCTION_ARGS);
-extern Datum event_trigger_out(PG_FUNCTION_ARGS);
-extern Datum language_handler_in(PG_FUNCTION_ARGS);
-extern Datum language_handler_out(PG_FUNCTION_ARGS);
-extern Datum fdw_handler_in(PG_FUNCTION_ARGS);
-extern Datum fdw_handler_out(PG_FUNCTION_ARGS);
-extern Datum index_am_handler_in(PG_FUNCTION_ARGS);
-extern Datum index_am_handler_out(PG_FUNCTION_ARGS);
-extern Datum tsm_handler_in(PG_FUNCTION_ARGS);
-extern Datum tsm_handler_out(PG_FUNCTION_ARGS);
-extern Datum internal_in(PG_FUNCTION_ARGS);
-extern Datum internal_out(PG_FUNCTION_ARGS);
-extern Datum opaque_in(PG_FUNCTION_ARGS);
-extern Datum opaque_out(PG_FUNCTION_ARGS);
-extern Datum anyelement_in(PG_FUNCTION_ARGS);
-extern Datum anyelement_out(PG_FUNCTION_ARGS);
-extern Datum shell_in(PG_FUNCTION_ARGS);
-extern Datum shell_out(PG_FUNCTION_ARGS);
-extern Datum pg_node_tree_in(PG_FUNCTION_ARGS);
-extern Datum pg_node_tree_out(PG_FUNCTION_ARGS);
-extern Datum pg_node_tree_recv(PG_FUNCTION_ARGS);
-extern Datum pg_node_tree_send(PG_FUNCTION_ARGS);
-extern Datum pg_ddl_command_in(PG_FUNCTION_ARGS);
-extern Datum pg_ddl_command_out(PG_FUNCTION_ARGS);
-extern Datum pg_ddl_command_recv(PG_FUNCTION_ARGS);
-extern Datum pg_ddl_command_send(PG_FUNCTION_ARGS);
+extern int oid_cmp(const void *p1, const void *p2);
/* regexp.c */
-extern Datum nameregexeq(PG_FUNCTION_ARGS);
-extern Datum nameregexne(PG_FUNCTION_ARGS);
-extern Datum textregexeq(PG_FUNCTION_ARGS);
-extern Datum textregexne(PG_FUNCTION_ARGS);
-extern Datum nameicregexeq(PG_FUNCTION_ARGS);
-extern Datum nameicregexne(PG_FUNCTION_ARGS);
-extern Datum texticregexeq(PG_FUNCTION_ARGS);
-extern Datum texticregexne(PG_FUNCTION_ARGS);
-extern Datum textregexsubstr(PG_FUNCTION_ARGS);
-extern Datum textregexreplace_noopt(PG_FUNCTION_ARGS);
-extern Datum textregexreplace(PG_FUNCTION_ARGS);
-extern Datum similar_escape(PG_FUNCTION_ARGS);
-extern Datum regexp_matches(PG_FUNCTION_ARGS);
-extern Datum regexp_matches_no_flags(PG_FUNCTION_ARGS);
-extern Datum regexp_split_to_table(PG_FUNCTION_ARGS);
-extern Datum regexp_split_to_table_no_flags(PG_FUNCTION_ARGS);
-extern Datum regexp_split_to_array(PG_FUNCTION_ARGS);
-extern Datum regexp_split_to_array_no_flags(PG_FUNCTION_ARGS);
extern char *regexp_fixed_prefix(text *text_re, bool case_insensitive,
Oid collation, bool *exact);
-/* regproc.c */
-extern Datum regprocin(PG_FUNCTION_ARGS);
-extern Datum regprocout(PG_FUNCTION_ARGS);
-extern Datum to_regproc(PG_FUNCTION_ARGS);
-extern Datum to_regprocedure(PG_FUNCTION_ARGS);
-extern Datum regprocrecv(PG_FUNCTION_ARGS);
-extern Datum regprocsend(PG_FUNCTION_ARGS);
-extern Datum regprocedurein(PG_FUNCTION_ARGS);
-extern Datum regprocedureout(PG_FUNCTION_ARGS);
-extern Datum regprocedurerecv(PG_FUNCTION_ARGS);
-extern Datum regproceduresend(PG_FUNCTION_ARGS);
-extern Datum regoperin(PG_FUNCTION_ARGS);
-extern Datum regoperout(PG_FUNCTION_ARGS);
-extern Datum regoperrecv(PG_FUNCTION_ARGS);
-extern Datum regopersend(PG_FUNCTION_ARGS);
-extern Datum to_regoper(PG_FUNCTION_ARGS);
-extern Datum to_regoperator(PG_FUNCTION_ARGS);
-extern Datum regoperatorin(PG_FUNCTION_ARGS);
-extern Datum regoperatorout(PG_FUNCTION_ARGS);
-extern Datum regoperatorrecv(PG_FUNCTION_ARGS);
-extern Datum regoperatorsend(PG_FUNCTION_ARGS);
-extern Datum regclassin(PG_FUNCTION_ARGS);
-extern Datum regclassout(PG_FUNCTION_ARGS);
-extern Datum regclassrecv(PG_FUNCTION_ARGS);
-extern Datum regclasssend(PG_FUNCTION_ARGS);
-extern Datum to_regclass(PG_FUNCTION_ARGS);
-extern Datum regtypein(PG_FUNCTION_ARGS);
-extern Datum regtypeout(PG_FUNCTION_ARGS);
-extern Datum regtyperecv(PG_FUNCTION_ARGS);
-extern Datum regtypesend(PG_FUNCTION_ARGS);
-extern Datum to_regtype(PG_FUNCTION_ARGS);
-extern Datum regrolein(PG_FUNCTION_ARGS);
-extern Datum regroleout(PG_FUNCTION_ARGS);
-extern Datum regrolerecv(PG_FUNCTION_ARGS);
-extern Datum regrolesend(PG_FUNCTION_ARGS);
-extern Datum to_regrole(PG_FUNCTION_ARGS);
-extern Datum regnamespacein(PG_FUNCTION_ARGS);
-extern Datum regnamespaceout(PG_FUNCTION_ARGS);
-extern Datum regnamespacerecv(PG_FUNCTION_ARGS);
-extern Datum regnamespacesend(PG_FUNCTION_ARGS);
-extern Datum to_regnamespace(PG_FUNCTION_ARGS);
-extern Datum regconfigin(PG_FUNCTION_ARGS);
-extern Datum regconfigout(PG_FUNCTION_ARGS);
-extern Datum regconfigrecv(PG_FUNCTION_ARGS);
-extern Datum regconfigsend(PG_FUNCTION_ARGS);
-extern Datum regdictionaryin(PG_FUNCTION_ARGS);
-extern Datum regdictionaryout(PG_FUNCTION_ARGS);
-extern Datum regdictionaryrecv(PG_FUNCTION_ARGS);
-extern Datum regdictionarysend(PG_FUNCTION_ARGS);
-extern Datum text_regclass(PG_FUNCTION_ARGS);
-extern List *stringToQualifiedNameList(const char *string);
-extern char *format_procedure(Oid procedure_oid);
-extern char *format_procedure_qualified(Oid procedure_oid);
-extern void format_procedure_parts(Oid operator_oid, List **objnames,
- List **objargs);
-extern char *format_operator(Oid operator_oid);
-extern char *format_operator_qualified(Oid operator_oid);
-extern void format_operator_parts(Oid operator_oid, List **objnames,
- List **objargs);
-
-/* rowtypes.c */
-extern Datum record_in(PG_FUNCTION_ARGS);
-extern Datum record_out(PG_FUNCTION_ARGS);
-extern Datum record_recv(PG_FUNCTION_ARGS);
-extern Datum record_send(PG_FUNCTION_ARGS);
-extern Datum record_eq(PG_FUNCTION_ARGS);
-extern Datum record_ne(PG_FUNCTION_ARGS);
-extern Datum record_lt(PG_FUNCTION_ARGS);
-extern Datum record_gt(PG_FUNCTION_ARGS);
-extern Datum record_le(PG_FUNCTION_ARGS);
-extern Datum record_ge(PG_FUNCTION_ARGS);
-extern Datum btrecordcmp(PG_FUNCTION_ARGS);
-extern Datum record_image_eq(PG_FUNCTION_ARGS);
-extern Datum record_image_ne(PG_FUNCTION_ARGS);
-extern Datum record_image_lt(PG_FUNCTION_ARGS);
-extern Datum record_image_gt(PG_FUNCTION_ARGS);
-extern Datum record_image_le(PG_FUNCTION_ARGS);
-extern Datum record_image_ge(PG_FUNCTION_ARGS);
-extern Datum btrecordimagecmp(PG_FUNCTION_ARGS);
-
/* ruleutils.c */
extern bool quote_all_identifiers;
-extern Datum pg_get_ruledef(PG_FUNCTION_ARGS);
-extern Datum pg_get_ruledef_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_viewdef(PG_FUNCTION_ARGS);
-extern Datum pg_get_viewdef_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_viewdef_wrap(PG_FUNCTION_ARGS);
-extern Datum pg_get_viewdef_name(PG_FUNCTION_ARGS);
-extern Datum pg_get_viewdef_name_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_indexdef(PG_FUNCTION_ARGS);
-extern Datum pg_get_indexdef_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_triggerdef(PG_FUNCTION_ARGS);
-extern Datum pg_get_triggerdef_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_constraintdef(PG_FUNCTION_ARGS);
-extern Datum pg_get_constraintdef_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_expr(PG_FUNCTION_ARGS);
-extern Datum pg_get_expr_ext(PG_FUNCTION_ARGS);
-extern Datum pg_get_userbyid(PG_FUNCTION_ARGS);
-extern Datum pg_get_serial_sequence(PG_FUNCTION_ARGS);
-extern Datum pg_get_functiondef(PG_FUNCTION_ARGS);
-extern Datum pg_get_function_arguments(PG_FUNCTION_ARGS);
-extern Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS);
-extern Datum pg_get_function_result(PG_FUNCTION_ARGS);
-extern Datum pg_get_function_arg_default(PG_FUNCTION_ARGS);
#ifdef PGXC
extern void get_query_def_from_valuesList(Query *query, StringInfo buf);
extern void deparse_query(Query *query, StringInfo buf, List *parentnamespace,
@@ -762,66 +96,10 @@ extern const char *quote_identifier(const char *ident);
extern char *quote_qualified_identifier(const char *qualifier,
const char *ident);
-
-/* tid.c */
-extern Datum tidin(PG_FUNCTION_ARGS);
-extern Datum tidout(PG_FUNCTION_ARGS);
-extern Datum tidrecv(PG_FUNCTION_ARGS);
-extern Datum tidsend(PG_FUNCTION_ARGS);
-extern Datum tideq(PG_FUNCTION_ARGS);
-extern Datum tidne(PG_FUNCTION_ARGS);
-extern Datum tidlt(PG_FUNCTION_ARGS);
-extern Datum tidle(PG_FUNCTION_ARGS);
-extern Datum tidgt(PG_FUNCTION_ARGS);
-extern Datum tidge(PG_FUNCTION_ARGS);
-extern Datum bttidcmp(PG_FUNCTION_ARGS);
-extern Datum tidlarger(PG_FUNCTION_ARGS);
-extern Datum tidsmaller(PG_FUNCTION_ARGS);
-extern Datum currtid_byreloid(PG_FUNCTION_ARGS);
-extern Datum currtid_byrelname(PG_FUNCTION_ARGS);
-
/* varchar.c */
-extern Datum bpcharin(PG_FUNCTION_ARGS);
-extern Datum bpcharout(PG_FUNCTION_ARGS);
-extern Datum bpcharrecv(PG_FUNCTION_ARGS);
-extern Datum bpcharsend(PG_FUNCTION_ARGS);
-extern Datum bpchartypmodin(PG_FUNCTION_ARGS);
-extern Datum bpchartypmodout(PG_FUNCTION_ARGS);
-extern Datum bpchar(PG_FUNCTION_ARGS);
-extern Datum char_bpchar(PG_FUNCTION_ARGS);
-extern Datum name_bpchar(PG_FUNCTION_ARGS);
-extern Datum bpchar_name(PG_FUNCTION_ARGS);
-extern Datum bpchareq(PG_FUNCTION_ARGS);
-extern Datum bpcharne(PG_FUNCTION_ARGS);
-extern Datum bpcharlt(PG_FUNCTION_ARGS);
-extern Datum bpcharle(PG_FUNCTION_ARGS);
-extern Datum bpchargt(PG_FUNCTION_ARGS);
-extern Datum bpcharge(PG_FUNCTION_ARGS);
-extern Datum bpcharcmp(PG_FUNCTION_ARGS);
-extern Datum bpchar_sortsupport(PG_FUNCTION_ARGS);
-extern Datum bpchar_larger(PG_FUNCTION_ARGS);
-extern Datum bpchar_smaller(PG_FUNCTION_ARGS);
extern int bpchartruelen(char *s, int len);
-extern Datum bpcharlen(PG_FUNCTION_ARGS);
-extern Datum bpcharoctetlen(PG_FUNCTION_ARGS);
-extern Datum hashbpchar(PG_FUNCTION_ARGS);
-extern Datum bpchar_pattern_lt(PG_FUNCTION_ARGS);
-extern Datum bpchar_pattern_le(PG_FUNCTION_ARGS);
-extern Datum bpchar_pattern_gt(PG_FUNCTION_ARGS);
-extern Datum bpchar_pattern_ge(PG_FUNCTION_ARGS);
-extern Datum btbpchar_pattern_cmp(PG_FUNCTION_ARGS);
-extern Datum btbpchar_pattern_sortsupport(PG_FUNCTION_ARGS);
-
-extern Datum varcharin(PG_FUNCTION_ARGS);
-extern Datum varcharout(PG_FUNCTION_ARGS);
-extern Datum varcharrecv(PG_FUNCTION_ARGS);
-extern Datum varcharsend(PG_FUNCTION_ARGS);
-extern Datum varchartypmodin(PG_FUNCTION_ARGS);
-extern Datum varchartypmodout(PG_FUNCTION_ARGS);
-extern Datum varchar_transform(PG_FUNCTION_ARGS);
-extern Datum varchar(PG_FUNCTION_ARGS);
-/* varlena.c */
+/* popular functions from varlena.c */
extern text *cstring_to_text(const char *s);
extern text *cstring_to_text_with_len(const char *s, int len);
extern char *text_to_cstring(const text *t);
@@ -830,132 +108,8 @@ extern void text_to_cstring_buffer(const text *src, char *dst, size_t dst_len);
#define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s))
#define TextDatumGetCString(d) text_to_cstring((text *) DatumGetPointer(d))
-extern Datum textin(PG_FUNCTION_ARGS);
-extern Datum textout(PG_FUNCTION_ARGS);
-extern Datum textrecv(PG_FUNCTION_ARGS);
-extern Datum textsend(PG_FUNCTION_ARGS);
-extern Datum textcat(PG_FUNCTION_ARGS);
-extern Datum texteq(PG_FUNCTION_ARGS);
-extern Datum textne(PG_FUNCTION_ARGS);
-extern Datum text_lt(PG_FUNCTION_ARGS);
-extern Datum text_le(PG_FUNCTION_ARGS);
-extern Datum text_gt(PG_FUNCTION_ARGS);
-extern Datum text_ge(PG_FUNCTION_ARGS);
-extern Datum text_larger(PG_FUNCTION_ARGS);
-extern Datum text_smaller(PG_FUNCTION_ARGS);
-extern Datum text_pattern_lt(PG_FUNCTION_ARGS);
-extern Datum text_pattern_le(PG_FUNCTION_ARGS);
-extern Datum text_pattern_gt(PG_FUNCTION_ARGS);
-extern Datum text_pattern_ge(PG_FUNCTION_ARGS);
-extern Datum bttext_pattern_cmp(PG_FUNCTION_ARGS);
-extern Datum bttext_pattern_sortsupport(PG_FUNCTION_ARGS);
-extern Datum textlen(PG_FUNCTION_ARGS);
-extern Datum textoctetlen(PG_FUNCTION_ARGS);
-extern Datum textpos(PG_FUNCTION_ARGS);
-extern Datum text_substr(PG_FUNCTION_ARGS);
-extern Datum text_substr_no_len(PG_FUNCTION_ARGS);
-extern Datum textoverlay(PG_FUNCTION_ARGS);
-extern Datum textoverlay_no_len(PG_FUNCTION_ARGS);
-extern Datum name_text(PG_FUNCTION_ARGS);
-extern Datum text_name(PG_FUNCTION_ARGS);
-extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid);
-extern void varstr_sortsupport(SortSupport ssup, Oid collid, bool bpchar);
-extern int varstr_levenshtein(const char *source, int slen,
- const char *target, int tlen,
- int ins_c, int del_c, int sub_c,
- bool trusted);
-extern int varstr_levenshtein_less_equal(const char *source, int slen,
- const char *target, int tlen,
- int ins_c, int del_c, int sub_c,
- int max_d, bool trusted);
-extern List *textToQualifiedNameList(text *textval);
-extern bool SplitIdentifierString(char *rawstring, char separator,
- List **namelist);
-extern bool SplitDirectoriesString(char *rawstring, char separator,
- List **namelist);
-extern Datum replace_text(PG_FUNCTION_ARGS);
-extern text *replace_text_regexp(text *src_text, void *regexp,
- text *replace_text, bool glob);
-extern Datum split_text(PG_FUNCTION_ARGS);
-extern Datum text_to_array(PG_FUNCTION_ARGS);
-extern Datum array_to_text(PG_FUNCTION_ARGS);
-extern Datum text_to_array_null(PG_FUNCTION_ARGS);
-extern Datum array_to_text_null(PG_FUNCTION_ARGS);
-extern Datum to_hex32(PG_FUNCTION_ARGS);
-extern Datum to_hex64(PG_FUNCTION_ARGS);
-extern Datum md5_text(PG_FUNCTION_ARGS);
-extern Datum md5_bytea(PG_FUNCTION_ARGS);
-
-extern Datum unknownin(PG_FUNCTION_ARGS);
-extern Datum unknownout(PG_FUNCTION_ARGS);
-extern Datum unknownrecv(PG_FUNCTION_ARGS);
-extern Datum unknownsend(PG_FUNCTION_ARGS);
-
-extern Datum pg_column_size(PG_FUNCTION_ARGS);
-
-extern Datum bytea_string_agg_transfn(PG_FUNCTION_ARGS);
-extern Datum bytea_string_agg_finalfn(PG_FUNCTION_ARGS);
-extern Datum string_agg_transfn(PG_FUNCTION_ARGS);
-extern Datum string_agg_finalfn(PG_FUNCTION_ARGS);
-
-extern Datum text_concat(PG_FUNCTION_ARGS);
-extern Datum text_concat_ws(PG_FUNCTION_ARGS);
-extern Datum text_left(PG_FUNCTION_ARGS);
-extern Datum text_right(PG_FUNCTION_ARGS);
-extern Datum text_reverse(PG_FUNCTION_ARGS);
-extern Datum text_format(PG_FUNCTION_ARGS);
-extern Datum text_format_nv(PG_FUNCTION_ARGS);
-
-/* version.c */
-extern Datum pgsql_version(PG_FUNCTION_ARGS);
-
/* xid.c */
-extern Datum xidin(PG_FUNCTION_ARGS);
-extern Datum xidout(PG_FUNCTION_ARGS);
-extern Datum xidrecv(PG_FUNCTION_ARGS);
-extern Datum xidsend(PG_FUNCTION_ARGS);
-extern Datum xideq(PG_FUNCTION_ARGS);
-extern Datum xidneq(PG_FUNCTION_ARGS);
-extern Datum xid_age(PG_FUNCTION_ARGS);
-extern Datum mxid_age(PG_FUNCTION_ARGS);
extern int xidComparator(const void *arg1, const void *arg2);
-extern Datum cidin(PG_FUNCTION_ARGS);
-extern Datum cidout(PG_FUNCTION_ARGS);
-extern Datum cidrecv(PG_FUNCTION_ARGS);
-extern Datum cidsend(PG_FUNCTION_ARGS);
-extern Datum cideq(PG_FUNCTION_ARGS);
-
-/* like.c */
-extern Datum namelike(PG_FUNCTION_ARGS);
-extern Datum namenlike(PG_FUNCTION_ARGS);
-extern Datum nameiclike(PG_FUNCTION_ARGS);
-extern Datum nameicnlike(PG_FUNCTION_ARGS);
-extern Datum textlike(PG_FUNCTION_ARGS);
-extern Datum textnlike(PG_FUNCTION_ARGS);
-extern Datum texticlike(PG_FUNCTION_ARGS);
-extern Datum texticnlike(PG_FUNCTION_ARGS);
-extern Datum bytealike(PG_FUNCTION_ARGS);
-extern Datum byteanlike(PG_FUNCTION_ARGS);
-extern Datum like_escape(PG_FUNCTION_ARGS);
-extern Datum like_escape_bytea(PG_FUNCTION_ARGS);
-
-/* oracle_compat.c */
-extern Datum lower(PG_FUNCTION_ARGS);
-extern Datum upper(PG_FUNCTION_ARGS);
-extern Datum initcap(PG_FUNCTION_ARGS);
-extern Datum lpad(PG_FUNCTION_ARGS);
-extern Datum rpad(PG_FUNCTION_ARGS);
-extern Datum btrim(PG_FUNCTION_ARGS);
-extern Datum btrim1(PG_FUNCTION_ARGS);
-extern Datum byteatrim(PG_FUNCTION_ARGS);
-extern Datum ltrim(PG_FUNCTION_ARGS);
-extern Datum ltrim1(PG_FUNCTION_ARGS);
-extern Datum rtrim(PG_FUNCTION_ARGS);
-extern Datum rtrim1(PG_FUNCTION_ARGS);
-extern Datum translate(PG_FUNCTION_ARGS);
-extern Datum chr (PG_FUNCTION_ARGS);
-extern Datum repeat(PG_FUNCTION_ARGS);
-extern Datum ascii(PG_FUNCTION_ARGS);
/* inet_cidr_ntop.c */
extern char *inet_cidr_ntop(int af, const void *src, int bits,
@@ -966,385 +120,23 @@ extern int inet_net_pton(int af, const char *src,
void *dst, size_t size);
/* network.c */
-extern Datum inet_in(PG_FUNCTION_ARGS);
-extern Datum inet_out(PG_FUNCTION_ARGS);
-extern Datum inet_recv(PG_FUNCTION_ARGS);
-extern Datum inet_send(PG_FUNCTION_ARGS);
-extern Datum cidr_in(PG_FUNCTION_ARGS);
-extern Datum cidr_out(PG_FUNCTION_ARGS);
-extern Datum cidr_recv(PG_FUNCTION_ARGS);
-extern Datum cidr_send(PG_FUNCTION_ARGS);
-extern Datum network_cmp(PG_FUNCTION_ARGS);
-extern Datum network_lt(PG_FUNCTION_ARGS);
-extern Datum network_le(PG_FUNCTION_ARGS);
-extern Datum network_eq(PG_FUNCTION_ARGS);
-extern Datum network_ge(PG_FUNCTION_ARGS);
-extern Datum network_gt(PG_FUNCTION_ARGS);
-extern Datum network_ne(PG_FUNCTION_ARGS);
-extern Datum network_smaller(PG_FUNCTION_ARGS);
-extern Datum network_larger(PG_FUNCTION_ARGS);
-extern Datum hashinet(PG_FUNCTION_ARGS);
-extern Datum network_sub(PG_FUNCTION_ARGS);
-extern Datum network_subeq(PG_FUNCTION_ARGS);
-extern Datum network_sup(PG_FUNCTION_ARGS);
-extern Datum network_supeq(PG_FUNCTION_ARGS);
-extern Datum network_overlap(PG_FUNCTION_ARGS);
-extern Datum network_network(PG_FUNCTION_ARGS);
-extern Datum network_netmask(PG_FUNCTION_ARGS);
-extern Datum network_hostmask(PG_FUNCTION_ARGS);
-extern Datum network_masklen(PG_FUNCTION_ARGS);
-extern Datum network_family(PG_FUNCTION_ARGS);
-extern Datum network_broadcast(PG_FUNCTION_ARGS);
-extern Datum network_host(PG_FUNCTION_ARGS);
-extern Datum network_show(PG_FUNCTION_ARGS);
-extern Datum inet_abbrev(PG_FUNCTION_ARGS);
-extern Datum cidr_abbrev(PG_FUNCTION_ARGS);
extern double convert_network_to_scalar(Datum value, Oid typid);
-extern Datum inet_to_cidr(PG_FUNCTION_ARGS);
-extern Datum inet_set_masklen(PG_FUNCTION_ARGS);
-extern Datum cidr_set_masklen(PG_FUNCTION_ARGS);
extern Datum network_scan_first(Datum in);
extern Datum network_scan_last(Datum in);
-extern Datum inet_client_addr(PG_FUNCTION_ARGS);
-extern Datum inet_client_port(PG_FUNCTION_ARGS);
-extern Datum inet_server_addr(PG_FUNCTION_ARGS);
-extern Datum inet_server_port(PG_FUNCTION_ARGS);
-extern Datum inetnot(PG_FUNCTION_ARGS);
-extern Datum inetand(PG_FUNCTION_ARGS);
-extern Datum inetor(PG_FUNCTION_ARGS);
-extern Datum inetpl(PG_FUNCTION_ARGS);
-extern Datum inetmi_int8(PG_FUNCTION_ARGS);
-extern Datum inetmi(PG_FUNCTION_ARGS);
extern void clean_ipv6_addr(int addr_family, char *addr);
-extern Datum inet_same_family(PG_FUNCTION_ARGS);
-extern Datum inet_merge(PG_FUNCTION_ARGS);
-
-/* mac.c */
-extern Datum macaddr_in(PG_FUNCTION_ARGS);
-extern Datum macaddr_out(PG_FUNCTION_ARGS);
-extern Datum macaddr_recv(PG_FUNCTION_ARGS);
-extern Datum macaddr_send(PG_FUNCTION_ARGS);
-extern Datum macaddr_cmp(PG_FUNCTION_ARGS);
-extern Datum macaddr_lt(PG_FUNCTION_ARGS);
-extern Datum macaddr_le(PG_FUNCTION_ARGS);
-extern Datum macaddr_eq(PG_FUNCTION_ARGS);
-extern Datum macaddr_ge(PG_FUNCTION_ARGS);
-extern Datum macaddr_gt(PG_FUNCTION_ARGS);
-extern Datum macaddr_ne(PG_FUNCTION_ARGS);
-extern Datum macaddr_not(PG_FUNCTION_ARGS);
-extern Datum macaddr_and(PG_FUNCTION_ARGS);
-extern Datum macaddr_or(PG_FUNCTION_ARGS);
-extern Datum macaddr_trunc(PG_FUNCTION_ARGS);
-extern Datum hashmacaddr(PG_FUNCTION_ARGS);
/* numeric.c */
-extern Datum numeric_in(PG_FUNCTION_ARGS);
-extern Datum numeric_out(PG_FUNCTION_ARGS);
-extern Datum numeric_recv(PG_FUNCTION_ARGS);
-extern Datum numeric_send(PG_FUNCTION_ARGS);
-extern Datum numerictypmodin(PG_FUNCTION_ARGS);
-extern Datum numerictypmodout(PG_FUNCTION_ARGS);
-extern Datum numeric_transform(PG_FUNCTION_ARGS);
-extern Datum numeric (PG_FUNCTION_ARGS);
-extern Datum numeric_abs(PG_FUNCTION_ARGS);
-extern Datum numeric_uminus(PG_FUNCTION_ARGS);
-extern Datum numeric_uplus(PG_FUNCTION_ARGS);
-extern Datum numeric_sign(PG_FUNCTION_ARGS);
-extern Datum numeric_round(PG_FUNCTION_ARGS);
-extern Datum numeric_trunc(PG_FUNCTION_ARGS);
-extern Datum numeric_ceil(PG_FUNCTION_ARGS);
-extern Datum numeric_floor(PG_FUNCTION_ARGS);
-extern Datum numeric_sortsupport(PG_FUNCTION_ARGS);
-extern Datum numeric_cmp(PG_FUNCTION_ARGS);
-extern Datum numeric_eq(PG_FUNCTION_ARGS);
-extern Datum numeric_ne(PG_FUNCTION_ARGS);
-extern Datum numeric_gt(PG_FUNCTION_ARGS);
-extern Datum numeric_ge(PG_FUNCTION_ARGS);
-extern Datum numeric_lt(PG_FUNCTION_ARGS);
-extern Datum numeric_le(PG_FUNCTION_ARGS);
-extern Datum numeric_add(PG_FUNCTION_ARGS);
-extern Datum numeric_sub(PG_FUNCTION_ARGS);
-extern Datum numeric_mul(PG_FUNCTION_ARGS);
-extern Datum numeric_div(PG_FUNCTION_ARGS);
-extern Datum numeric_div_trunc(PG_FUNCTION_ARGS);
-extern Datum numeric_mod(PG_FUNCTION_ARGS);
-extern Datum numeric_inc(PG_FUNCTION_ARGS);
-extern Datum numeric_smaller(PG_FUNCTION_ARGS);
-extern Datum numeric_larger(PG_FUNCTION_ARGS);
-extern Datum numeric_fac(PG_FUNCTION_ARGS);
-extern Datum numeric_sqrt(PG_FUNCTION_ARGS);
-extern Datum numeric_exp(PG_FUNCTION_ARGS);
-extern Datum numeric_ln(PG_FUNCTION_ARGS);
-extern Datum numeric_log(PG_FUNCTION_ARGS);
-extern Datum numeric_power(PG_FUNCTION_ARGS);
-extern Datum numeric_scale(PG_FUNCTION_ARGS);
-extern Datum int4_numeric(PG_FUNCTION_ARGS);
-extern Datum numeric_int4(PG_FUNCTION_ARGS);
-extern Datum int8_numeric(PG_FUNCTION_ARGS);
-extern Datum numeric_int8(PG_FUNCTION_ARGS);
-extern Datum int2_numeric(PG_FUNCTION_ARGS);
-extern Datum numeric_int2(PG_FUNCTION_ARGS);
-extern Datum float8_numeric(PG_FUNCTION_ARGS);
-extern Datum numeric_float8(PG_FUNCTION_ARGS);
extern Datum numeric_float8_no_overflow(PG_FUNCTION_ARGS);
-extern Datum float4_numeric(PG_FUNCTION_ARGS);
-extern Datum numeric_float4(PG_FUNCTION_ARGS);
-extern Datum numeric_accum(PG_FUNCTION_ARGS);
-extern Datum numeric_combine(PG_FUNCTION_ARGS);
-extern Datum numeric_avg_accum(PG_FUNCTION_ARGS);
-extern Datum numeric_avg_combine(PG_FUNCTION_ARGS);
-extern Datum numeric_avg_serialize(PG_FUNCTION_ARGS);
-extern Datum numeric_avg_deserialize(PG_FUNCTION_ARGS);
-extern Datum numeric_serialize(PG_FUNCTION_ARGS);
-extern Datum numeric_deserialize(PG_FUNCTION_ARGS);
-extern Datum numeric_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int2_accum(PG_FUNCTION_ARGS);
-extern Datum int4_accum(PG_FUNCTION_ARGS);
-extern Datum int8_accum(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_combine(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_serialize(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_deserialize(PG_FUNCTION_ARGS);
-extern Datum int2_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int4_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int8_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int8_avg_accum(PG_FUNCTION_ARGS);
-extern Datum int8_avg_combine(PG_FUNCTION_ARGS);
-extern Datum int8_avg_serialize(PG_FUNCTION_ARGS);
-extern Datum int8_avg_deserialize(PG_FUNCTION_ARGS);
-extern Datum numeric_avg(PG_FUNCTION_ARGS);
-extern Datum numeric_sum(PG_FUNCTION_ARGS);
-extern Datum numeric_var_pop(PG_FUNCTION_ARGS);
-extern Datum numeric_var_samp(PG_FUNCTION_ARGS);
-extern Datum numeric_stddev_pop(PG_FUNCTION_ARGS);
-extern Datum numeric_stddev_samp(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_sum(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_avg(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_var_pop(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_var_samp(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_stddev_pop(PG_FUNCTION_ARGS);
-extern Datum numeric_poly_stddev_samp(PG_FUNCTION_ARGS);
-extern Datum int2_sum(PG_FUNCTION_ARGS);
-extern Datum int4_sum(PG_FUNCTION_ARGS);
-extern Datum int8_sum(PG_FUNCTION_ARGS);
-extern Datum int2_avg_accum(PG_FUNCTION_ARGS);
-extern Datum int4_avg_accum(PG_FUNCTION_ARGS);
-extern Datum int4_avg_combine(PG_FUNCTION_ARGS);
-extern Datum int2_avg_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int4_avg_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int8_avg_accum_inv(PG_FUNCTION_ARGS);
-extern Datum int8_avg(PG_FUNCTION_ARGS);
-extern Datum int2int4_sum(PG_FUNCTION_ARGS);
-extern Datum width_bucket_numeric(PG_FUNCTION_ARGS);
-extern Datum hash_numeric(PG_FUNCTION_ARGS);
-extern Datum generate_series_numeric(PG_FUNCTION_ARGS);
-extern Datum generate_series_step_numeric(PG_FUNCTION_ARGS);
-
-/* ri_triggers.c */
-extern Datum RI_FKey_check_ins(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_check_upd(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_noaction_del(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_noaction_upd(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_cascade_del(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_cascade_upd(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_restrict_del(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_restrict_upd(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_setnull_del(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_setnull_upd(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_setdefault_del(PG_FUNCTION_ARGS);
-extern Datum RI_FKey_setdefault_upd(PG_FUNCTION_ARGS);
-
-/* trigfuncs.c */
-extern Datum suppress_redundant_updates_trigger(PG_FUNCTION_ARGS);
-
-/* encoding support functions */
-extern Datum getdatabaseencoding(PG_FUNCTION_ARGS);
-extern Datum database_character_set(PG_FUNCTION_ARGS);
-extern Datum pg_client_encoding(PG_FUNCTION_ARGS);
-extern Datum PG_encoding_to_char(PG_FUNCTION_ARGS);
-extern Datum PG_char_to_encoding(PG_FUNCTION_ARGS);
-extern Datum PG_character_set_name(PG_FUNCTION_ARGS);
-extern Datum PG_character_set_id(PG_FUNCTION_ARGS);
-extern Datum pg_convert(PG_FUNCTION_ARGS);
-extern Datum pg_convert_to(PG_FUNCTION_ARGS);
-extern Datum pg_convert_from(PG_FUNCTION_ARGS);
-extern Datum length_in_encoding(PG_FUNCTION_ARGS);
-extern Datum pg_encoding_max_length_sql(PG_FUNCTION_ARGS);
/* format_type.c */
-extern Datum format_type(PG_FUNCTION_ARGS);
extern char *format_type_be(Oid type_oid);
extern char *format_type_be_qualified(Oid type_oid);
extern char *format_type_with_typemod(Oid type_oid, int32 typemod);
extern char *format_type_with_typemod_qualified(Oid type_oid, int32 typemod);
-extern Datum oidvectortypes(PG_FUNCTION_ARGS);
extern int32 type_maximum_size(Oid type_oid, int32 typemod);
/* quote.c */
-extern Datum quote_ident(PG_FUNCTION_ARGS);
-extern Datum quote_literal(PG_FUNCTION_ARGS);
extern char *quote_literal_cstr(const char *rawstr);
-extern Datum quote_nullable(PG_FUNCTION_ARGS);
-
-/* guc.c */
-extern Datum show_config_by_name(PG_FUNCTION_ARGS);
-extern Datum show_config_by_name_missing_ok(PG_FUNCTION_ARGS);
-extern Datum set_config_by_name(PG_FUNCTION_ARGS);
-extern Datum show_all_settings(PG_FUNCTION_ARGS);
-extern Datum show_all_file_settings(PG_FUNCTION_ARGS);
-
-/* pg_config.c */
-extern Datum pg_config(PG_FUNCTION_ARGS);
-
-/* pg_controldata.c */
-extern Datum pg_control_checkpoint(PG_FUNCTION_ARGS);
-extern Datum pg_control_system(PG_FUNCTION_ARGS);
-extern Datum pg_control_init(PG_FUNCTION_ARGS);
-extern Datum pg_control_recovery(PG_FUNCTION_ARGS);
-
-/* rls.c */
-extern Datum row_security_active(PG_FUNCTION_ARGS);
-extern Datum row_security_active_name(PG_FUNCTION_ARGS);
-
-/* lockfuncs.c */
-extern Datum pg_lock_status(PG_FUNCTION_ARGS);
-extern Datum pg_blocking_pids(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_lock_int8(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_xact_lock_int8(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_lock_shared_int8(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_xact_lock_shared_int8(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_lock_int8(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_xact_lock_int8(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_lock_shared_int8(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_xact_lock_shared_int8(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_unlock_int8(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_unlock_shared_int8(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_lock_int4(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_xact_lock_int4(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_lock_shared_int4(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_xact_lock_shared_int4(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_lock_int4(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_xact_lock_int4(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_lock_shared_int4(PG_FUNCTION_ARGS);
-extern Datum pg_try_advisory_xact_lock_shared_int4(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_unlock_int4(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_unlock_shared_int4(PG_FUNCTION_ARGS);
-extern Datum pg_advisory_unlock_all(PG_FUNCTION_ARGS);
-
-/* txid.c */
-extern Datum txid_snapshot_in(PG_FUNCTION_ARGS);
-extern Datum txid_snapshot_out(PG_FUNCTION_ARGS);
-extern Datum txid_snapshot_recv(PG_FUNCTION_ARGS);
-extern Datum txid_snapshot_send(PG_FUNCTION_ARGS);
-extern Datum txid_current(PG_FUNCTION_ARGS);
-extern Datum txid_current_snapshot(PG_FUNCTION_ARGS);
-extern Datum txid_snapshot_xmin(PG_FUNCTION_ARGS);
-extern Datum txid_snapshot_xmax(PG_FUNCTION_ARGS);
-extern Datum txid_snapshot_xip(PG_FUNCTION_ARGS);
-extern Datum txid_visible_in_snapshot(PG_FUNCTION_ARGS);
-
-/* uuid.c */
-extern Datum uuid_in(PG_FUNCTION_ARGS);
-extern Datum uuid_out(PG_FUNCTION_ARGS);
-extern Datum uuid_send(PG_FUNCTION_ARGS);
-extern Datum uuid_recv(PG_FUNCTION_ARGS);
-extern Datum uuid_lt(PG_FUNCTION_ARGS);
-extern Datum uuid_le(PG_FUNCTION_ARGS);
-extern Datum uuid_eq(PG_FUNCTION_ARGS);
-extern Datum uuid_ge(PG_FUNCTION_ARGS);
-extern Datum uuid_gt(PG_FUNCTION_ARGS);
-extern Datum uuid_ne(PG_FUNCTION_ARGS);
-extern Datum uuid_cmp(PG_FUNCTION_ARGS);
-extern Datum uuid_sortsupport(PG_FUNCTION_ARGS);
-extern Datum uuid_hash(PG_FUNCTION_ARGS);
-
-/* windowfuncs.c */
-extern Datum window_row_number(PG_FUNCTION_ARGS);
-extern Datum window_rank(PG_FUNCTION_ARGS);
-extern Datum window_dense_rank(PG_FUNCTION_ARGS);
-extern Datum window_percent_rank(PG_FUNCTION_ARGS);
-extern Datum window_cume_dist(PG_FUNCTION_ARGS);
-extern Datum window_ntile(PG_FUNCTION_ARGS);
-extern Datum window_lag(PG_FUNCTION_ARGS);
-extern Datum window_lag_with_offset(PG_FUNCTION_ARGS);
-extern Datum window_lag_with_offset_and_default(PG_FUNCTION_ARGS);
-extern Datum window_lead(PG_FUNCTION_ARGS);
-extern Datum window_lead_with_offset(PG_FUNCTION_ARGS);
-extern Datum window_lead_with_offset_and_default(PG_FUNCTION_ARGS);
-extern Datum window_first_value(PG_FUNCTION_ARGS);
-extern Datum window_last_value(PG_FUNCTION_ARGS);
-extern Datum window_nth_value(PG_FUNCTION_ARGS);
-
-/* access/spgist/spgquadtreeproc.c */
-extern Datum spg_quad_config(PG_FUNCTION_ARGS);
-extern Datum spg_quad_choose(PG_FUNCTION_ARGS);
-extern Datum spg_quad_picksplit(PG_FUNCTION_ARGS);
-extern Datum spg_quad_inner_consistent(PG_FUNCTION_ARGS);
-extern Datum spg_quad_leaf_consistent(PG_FUNCTION_ARGS);
-
-/* access/spgist/spgkdtreeproc.c */
-extern Datum spg_kd_config(PG_FUNCTION_ARGS);
-extern Datum spg_kd_choose(PG_FUNCTION_ARGS);
-extern Datum spg_kd_picksplit(PG_FUNCTION_ARGS);
-extern Datum spg_kd_inner_consistent(PG_FUNCTION_ARGS);
-
-/* access/spgist/spgtextproc.c */
-extern Datum spg_text_config(PG_FUNCTION_ARGS);
-extern Datum spg_text_choose(PG_FUNCTION_ARGS);
-extern Datum spg_text_picksplit(PG_FUNCTION_ARGS);
-extern Datum spg_text_inner_consistent(PG_FUNCTION_ARGS);
-extern Datum spg_text_leaf_consistent(PG_FUNCTION_ARGS);
-
-/* access/gin/ginarrayproc.c */
-extern Datum ginarrayextract(PG_FUNCTION_ARGS);
-extern Datum ginarrayextract_2args(PG_FUNCTION_ARGS);
-extern Datum ginqueryarrayextract(PG_FUNCTION_ARGS);
-extern Datum ginarrayconsistent(PG_FUNCTION_ARGS);
-extern Datum ginarraytriconsistent(PG_FUNCTION_ARGS);
-
-/* access/tablesample/bernoulli.c */
-extern Datum tsm_bernoulli_handler(PG_FUNCTION_ARGS);
-
-/* access/tablesample/system.c */
-extern Datum tsm_system_handler(PG_FUNCTION_ARGS);
-
-/* access/transam/twophase.c */
-extern Datum pg_prepared_xact(PG_FUNCTION_ARGS);
-
-/* access/transam/multixact.c */
-extern Datum pg_get_multixact_members(PG_FUNCTION_ARGS);
-
-/* access/transam/committs.c */
-extern Datum pg_xact_commit_timestamp(PG_FUNCTION_ARGS);
-extern Datum pg_last_committed_xact(PG_FUNCTION_ARGS);
-
-/* catalogs/dependency.c */
-extern Datum pg_describe_object(PG_FUNCTION_ARGS);
-extern Datum pg_identify_object(PG_FUNCTION_ARGS);
-extern Datum pg_identify_object_as_address(PG_FUNCTION_ARGS);
-
-/* catalog/objectaddress.c */
-extern Datum pg_get_object_address(PG_FUNCTION_ARGS);
-
-/* commands/constraint.c */
-extern Datum unique_key_recheck(PG_FUNCTION_ARGS);
-
-/* commands/event_trigger.c */
-extern Datum pg_event_trigger_dropped_objects(PG_FUNCTION_ARGS);
-extern Datum pg_event_trigger_table_rewrite_oid(PG_FUNCTION_ARGS);
-extern Datum pg_event_trigger_table_rewrite_reason(PG_FUNCTION_ARGS);
-extern Datum pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS);
-
-/* commands/extension.c */
-extern Datum pg_available_extensions(PG_FUNCTION_ARGS);
-extern Datum pg_available_extension_versions(PG_FUNCTION_ARGS);
-extern Datum pg_extension_update_paths(PG_FUNCTION_ARGS);
-extern Datum pg_extension_config_dump(PG_FUNCTION_ARGS);
-
-/* commands/prepare.c */
-extern Datum pg_prepared_statement(PG_FUNCTION_ARGS);
-
-/* utils/mmgr/portalmem.c */
-extern Datum pg_cursor(PG_FUNCTION_ARGS);
#ifdef PGXC
/* backend/pgxc/pool/poolutils.c */
diff --git a/src/include/utils/bytea.h b/src/include/utils/bytea.h
index c41e6b4b7a..818e65707f 100644
--- a/src/include/utils/bytea.h
+++ b/src/include/utils/bytea.h
@@ -4,7 +4,7 @@
* Declarations for BYTEA data type support.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/bytea.h
@@ -25,29 +25,4 @@ typedef enum
extern int bytea_output; /* ByteaOutputType, but int for GUC enum */
-/* functions are in utils/adt/varlena.c */
-extern Datum byteain(PG_FUNCTION_ARGS);
-extern Datum byteaout(PG_FUNCTION_ARGS);
-extern Datum bytearecv(PG_FUNCTION_ARGS);
-extern Datum byteasend(PG_FUNCTION_ARGS);
-extern Datum byteaoctetlen(PG_FUNCTION_ARGS);
-extern Datum byteaGetByte(PG_FUNCTION_ARGS);
-extern Datum byteaGetBit(PG_FUNCTION_ARGS);
-extern Datum byteaSetByte(PG_FUNCTION_ARGS);
-extern Datum byteaSetBit(PG_FUNCTION_ARGS);
-extern Datum byteaeq(PG_FUNCTION_ARGS);
-extern Datum byteane(PG_FUNCTION_ARGS);
-extern Datum bytealt(PG_FUNCTION_ARGS);
-extern Datum byteale(PG_FUNCTION_ARGS);
-extern Datum byteagt(PG_FUNCTION_ARGS);
-extern Datum byteage(PG_FUNCTION_ARGS);
-extern Datum byteacmp(PG_FUNCTION_ARGS);
-extern Datum bytea_sortsupport(PG_FUNCTION_ARGS);
-extern Datum byteacat(PG_FUNCTION_ARGS);
-extern Datum byteapos(PG_FUNCTION_ARGS);
-extern Datum bytea_substr(PG_FUNCTION_ARGS);
-extern Datum bytea_substr_no_len(PG_FUNCTION_ARGS);
-extern Datum byteaoverlay(PG_FUNCTION_ARGS);
-extern Datum byteaoverlay_no_len(PG_FUNCTION_ARGS);
-
#endif /* BYTEA_H */
diff --git a/src/include/utils/cash.h b/src/include/utils/cash.h
index 3a491f9231..84083677e1 100644
--- a/src/include/utils/cash.h
+++ b/src/include/utils/cash.h
@@ -22,52 +22,4 @@ typedef int64 Cash;
#define PG_GETARG_CASH(n) DatumGetCash(PG_GETARG_DATUM(n))
#define PG_RETURN_CASH(x) return CashGetDatum(x)
-extern Datum cash_in(PG_FUNCTION_ARGS);
-extern Datum cash_out(PG_FUNCTION_ARGS);
-extern Datum cash_recv(PG_FUNCTION_ARGS);
-extern Datum cash_send(PG_FUNCTION_ARGS);
-
-extern Datum cash_eq(PG_FUNCTION_ARGS);
-extern Datum cash_ne(PG_FUNCTION_ARGS);
-extern Datum cash_lt(PG_FUNCTION_ARGS);
-extern Datum cash_le(PG_FUNCTION_ARGS);
-extern Datum cash_gt(PG_FUNCTION_ARGS);
-extern Datum cash_ge(PG_FUNCTION_ARGS);
-extern Datum cash_cmp(PG_FUNCTION_ARGS);
-
-extern Datum cash_pl(PG_FUNCTION_ARGS);
-extern Datum cash_mi(PG_FUNCTION_ARGS);
-extern Datum cash_div_cash(PG_FUNCTION_ARGS);
-
-extern Datum cash_mul_flt8(PG_FUNCTION_ARGS);
-extern Datum flt8_mul_cash(PG_FUNCTION_ARGS);
-extern Datum cash_div_flt8(PG_FUNCTION_ARGS);
-
-extern Datum cash_mul_flt4(PG_FUNCTION_ARGS);
-extern Datum flt4_mul_cash(PG_FUNCTION_ARGS);
-extern Datum cash_div_flt4(PG_FUNCTION_ARGS);
-
-extern Datum cash_mul_int8(PG_FUNCTION_ARGS);
-extern Datum int8_mul_cash(PG_FUNCTION_ARGS);
-extern Datum cash_div_int8(PG_FUNCTION_ARGS);
-
-extern Datum cash_mul_int4(PG_FUNCTION_ARGS);
-extern Datum int4_mul_cash(PG_FUNCTION_ARGS);
-extern Datum cash_div_int4(PG_FUNCTION_ARGS);
-
-extern Datum cash_mul_int2(PG_FUNCTION_ARGS);
-extern Datum int2_mul_cash(PG_FUNCTION_ARGS);
-extern Datum cash_div_int2(PG_FUNCTION_ARGS);
-
-extern Datum cashlarger(PG_FUNCTION_ARGS);
-extern Datum cashsmaller(PG_FUNCTION_ARGS);
-
-extern Datum cash_words(PG_FUNCTION_ARGS);
-
-extern Datum cash_numeric(PG_FUNCTION_ARGS);
-extern Datum numeric_cash(PG_FUNCTION_ARGS);
-
-extern Datum int4_cash(PG_FUNCTION_ARGS);
-extern Datum int8_cash(PG_FUNCTION_ARGS);
-
#endif /* CASH_H */
diff --git a/src/include/utils/catcache.h b/src/include/utils/catcache.h
index 253c7b53ed..5add424e5e 100644
--- a/src/include/utils/catcache.h
+++ b/src/include/utils/catcache.h
@@ -10,7 +10,7 @@
* guarantee that there can only be one matching row for a key combination.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/catcache.h
@@ -52,6 +52,12 @@ typedef struct catcache
* heap scans */
bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */
dlist_head cc_lists; /* list of CatCList structs */
+ dlist_head *cc_bucket; /* hash buckets */
+
+ /*
+ * Keep these at the end, so that compiling catcache.c with CATCACHE_STATS
+ * doesn't break ABI for other modules
+ */
#ifdef CATCACHE_STATS
long cc_searches; /* total # searches against this cache */
long cc_hits; /* # of matches against existing entry */
@@ -66,7 +72,6 @@ typedef struct catcache
long cc_lsearches; /* total # list-searches */
long cc_lhits; /* # of matches against existing lists */
#endif
- dlist_head *cc_bucket; /* hash buckets */
} CatCache;
@@ -185,7 +190,7 @@ extern void ReleaseCatCacheList(CatCList *list);
extern void ResetCatalogCaches(void);
extern void CatalogCacheFlushCatalog(Oid catId);
-extern void CatalogCacheIdInvalidate(int cacheId, uint32 hashValue);
+extern void CatCacheInvalidate(CatCache *cache, uint32 hashValue);
extern void PrepareToInvalidateCacheTuple(Relation relation,
HeapTuple tuple,
HeapTuple newtuple,
diff --git a/src/include/utils/combocid.h b/src/include/utils/combocid.h
index 299b2edbfc..1cb0e74275 100644
--- a/src/include/utils/combocid.h
+++ b/src/include/utils/combocid.h
@@ -4,7 +4,7 @@
* Combo command ID support routines
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/combocid.h
diff --git a/src/include/utils/date.h b/src/include/utils/date.h
index 1b962af7d8..309a581853 100644
--- a/src/include/utils/date.h
+++ b/src/include/utils/date.h
@@ -4,7 +4,7 @@
* Definitions for the SQL "date" and "time" types.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/date.h
@@ -21,11 +21,7 @@
typedef int32 DateADT;
-#ifdef HAVE_INT64_TIMESTAMP
typedef int64 TimeADT;
-#else
-typedef float8 TimeADT;
-#endif
typedef struct
{
@@ -48,11 +44,9 @@ typedef struct
/*
* Macros for fmgr-callable functions.
*
- * For TimeADT, we make use of the same support routines as for float8 or int64.
- * Therefore TimeADT is pass-by-reference if and only if float8 or int64 is!
+ * For TimeADT, we make use of the same support routines as for int64.
+ * Therefore TimeADT is pass-by-reference if and only if int64 is!
*/
-#ifdef HAVE_INT64_TIMESTAMP
-
#define MAX_TIME_PRECISION 6
#define DatumGetDateADT(X) ((DateADT) DatumGetInt32(X))
@@ -62,22 +56,6 @@ typedef struct
#define DateADTGetDatum(X) Int32GetDatum(X)
#define TimeADTGetDatum(X) Int64GetDatum(X)
#define TimeTzADTPGetDatum(X) PointerGetDatum(X)
-#else /* !HAVE_INT64_TIMESTAMP */
-
-#define MAX_TIME_PRECISION 10
-
-/* round off to MAX_TIME_PRECISION decimal places */
-#define TIME_PREC_INV 10000000000.0
-#define TIMEROUND(j) (rint(((double) (j)) * TIME_PREC_INV) / TIME_PREC_INV)
-
-#define DatumGetDateADT(X) ((DateADT) DatumGetInt32(X))
-#define DatumGetTimeADT(X) ((TimeADT) DatumGetFloat8(X))
-#define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))
-
-#define DateADTGetDatum(X) Int32GetDatum(X)
-#define TimeADTGetDatum(X) Float8GetDatum(X)
-#define TimeTzADTPGetDatum(X) PointerGetDatum(X)
-#endif /* HAVE_INT64_TIMESTAMP */
#define PG_GETARG_DATEADT(n) DatumGetDateADT(PG_GETARG_DATUM(n))
#define PG_GETARG_TIMEADT(n) DatumGetTimeADT(PG_GETARG_DATUM(n))
@@ -89,120 +67,11 @@ typedef struct
/* date.c */
+extern int32 anytime_typmod_check(bool istz, int32 typmod);
extern double date2timestamp_no_overflow(DateADT dateVal);
extern void EncodeSpecialDate(DateADT dt, char *str);
-
-extern Datum date_in(PG_FUNCTION_ARGS);
-extern Datum date_out(PG_FUNCTION_ARGS);
-extern Datum date_recv(PG_FUNCTION_ARGS);
-extern Datum date_send(PG_FUNCTION_ARGS);
-extern Datum make_date(PG_FUNCTION_ARGS);
-extern Datum date_eq(PG_FUNCTION_ARGS);
-extern Datum date_ne(PG_FUNCTION_ARGS);
-extern Datum date_lt(PG_FUNCTION_ARGS);
-extern Datum date_le(PG_FUNCTION_ARGS);
-extern Datum date_gt(PG_FUNCTION_ARGS);
-extern Datum date_ge(PG_FUNCTION_ARGS);
-extern Datum date_cmp(PG_FUNCTION_ARGS);
-extern Datum date_sortsupport(PG_FUNCTION_ARGS);
-extern Datum date_finite(PG_FUNCTION_ARGS);
-extern Datum date_larger(PG_FUNCTION_ARGS);
-extern Datum date_smaller(PG_FUNCTION_ARGS);
-extern Datum date_mi(PG_FUNCTION_ARGS);
-extern Datum date_pli(PG_FUNCTION_ARGS);
-extern Datum date_mii(PG_FUNCTION_ARGS);
-extern Datum date_eq_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_ne_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_lt_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_le_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_gt_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_ge_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_cmp_timestamp(PG_FUNCTION_ARGS);
-extern Datum date_eq_timestamptz(PG_FUNCTION_ARGS);
-extern Datum date_ne_timestamptz(PG_FUNCTION_ARGS);
-extern Datum date_lt_timestamptz(PG_FUNCTION_ARGS);
-extern Datum date_le_timestamptz(PG_FUNCTION_ARGS);
-extern Datum date_gt_timestamptz(PG_FUNCTION_ARGS);
-extern Datum date_ge_timestamptz(PG_FUNCTION_ARGS);
-extern Datum date_cmp_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_eq_date(PG_FUNCTION_ARGS);
-extern Datum timestamp_ne_date(PG_FUNCTION_ARGS);
-extern Datum timestamp_lt_date(PG_FUNCTION_ARGS);
-extern Datum timestamp_le_date(PG_FUNCTION_ARGS);
-extern Datum timestamp_gt_date(PG_FUNCTION_ARGS);
-extern Datum timestamp_ge_date(PG_FUNCTION_ARGS);
-extern Datum timestamp_cmp_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_eq_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_ne_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_lt_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_le_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_gt_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_ge_date(PG_FUNCTION_ARGS);
-extern Datum timestamptz_cmp_date(PG_FUNCTION_ARGS);
-extern Datum date_pl_interval(PG_FUNCTION_ARGS);
-extern Datum date_mi_interval(PG_FUNCTION_ARGS);
-extern Datum date_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamp_date(PG_FUNCTION_ARGS);
-extern Datum date_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamptz_date(PG_FUNCTION_ARGS);
-extern Datum datetime_timestamp(PG_FUNCTION_ARGS);
-extern Datum abstime_date(PG_FUNCTION_ARGS);
-
-extern Datum time_in(PG_FUNCTION_ARGS);
-extern Datum time_out(PG_FUNCTION_ARGS);
-extern Datum time_recv(PG_FUNCTION_ARGS);
-extern Datum time_send(PG_FUNCTION_ARGS);
-extern Datum timetypmodin(PG_FUNCTION_ARGS);
-extern Datum timetypmodout(PG_FUNCTION_ARGS);
-extern Datum make_time(PG_FUNCTION_ARGS);
-extern Datum time_transform(PG_FUNCTION_ARGS);
-extern Datum time_scale(PG_FUNCTION_ARGS);
-extern Datum time_eq(PG_FUNCTION_ARGS);
-extern Datum time_ne(PG_FUNCTION_ARGS);
-extern Datum time_lt(PG_FUNCTION_ARGS);
-extern Datum time_le(PG_FUNCTION_ARGS);
-extern Datum time_gt(PG_FUNCTION_ARGS);
-extern Datum time_ge(PG_FUNCTION_ARGS);
-extern Datum time_cmp(PG_FUNCTION_ARGS);
-extern Datum time_hash(PG_FUNCTION_ARGS);
-extern Datum overlaps_time(PG_FUNCTION_ARGS);
-extern Datum time_larger(PG_FUNCTION_ARGS);
-extern Datum time_smaller(PG_FUNCTION_ARGS);
-extern Datum time_mi_time(PG_FUNCTION_ARGS);
-extern Datum timestamp_time(PG_FUNCTION_ARGS);
-extern Datum timestamptz_time(PG_FUNCTION_ARGS);
-extern Datum time_interval(PG_FUNCTION_ARGS);
-extern Datum interval_time(PG_FUNCTION_ARGS);
-extern Datum time_pl_interval(PG_FUNCTION_ARGS);
-extern Datum time_mi_interval(PG_FUNCTION_ARGS);
-extern Datum time_part(PG_FUNCTION_ARGS);
-
-extern Datum timetz_in(PG_FUNCTION_ARGS);
-extern Datum timetz_out(PG_FUNCTION_ARGS);
-extern Datum timetz_recv(PG_FUNCTION_ARGS);
-extern Datum timetz_send(PG_FUNCTION_ARGS);
-extern Datum timetztypmodin(PG_FUNCTION_ARGS);
-extern Datum timetztypmodout(PG_FUNCTION_ARGS);
-extern Datum timetz_scale(PG_FUNCTION_ARGS);
-extern Datum timetz_eq(PG_FUNCTION_ARGS);
-extern Datum timetz_ne(PG_FUNCTION_ARGS);
-extern Datum timetz_lt(PG_FUNCTION_ARGS);
-extern Datum timetz_le(PG_FUNCTION_ARGS);
-extern Datum timetz_gt(PG_FUNCTION_ARGS);
-extern Datum timetz_ge(PG_FUNCTION_ARGS);
-extern Datum timetz_cmp(PG_FUNCTION_ARGS);
-extern Datum timetz_hash(PG_FUNCTION_ARGS);
-extern Datum overlaps_timetz(PG_FUNCTION_ARGS);
-extern Datum timetz_larger(PG_FUNCTION_ARGS);
-extern Datum timetz_smaller(PG_FUNCTION_ARGS);
-extern Datum timetz_time(PG_FUNCTION_ARGS);
-extern Datum time_timetz(PG_FUNCTION_ARGS);
-extern Datum timestamptz_timetz(PG_FUNCTION_ARGS);
-extern Datum datetimetz_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timetz_part(PG_FUNCTION_ARGS);
-extern Datum timetz_zone(PG_FUNCTION_ARGS);
-extern Datum timetz_izone(PG_FUNCTION_ARGS);
-extern Datum timetz_pl_interval(PG_FUNCTION_ARGS);
-extern Datum timetz_mi_interval(PG_FUNCTION_ARGS);
+extern DateADT GetSQLCurrentDate(void);
+extern TimeTzADT *GetSQLCurrentTime(int32 typmod);
+extern TimeADT GetSQLLocalTime(int32 typmod);
#endif /* DATE_H */
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index c57dc05ff8..fb7885bf34 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -6,7 +6,7 @@
* including abstime, reltime, date, and time.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/datetime.h
@@ -244,23 +244,15 @@ do { \
} while(0)
/* TMODULO()
- * Like FMODULO(), but work on the timestamp datatype (either int64 or float8).
+ * Like FMODULO(), but work on the timestamp datatype (now always int64).
* We assume that int64 follows the C99 semantics for division (negative
* quotients truncate towards zero).
*/
-#ifdef HAVE_INT64_TIMESTAMP
#define TMODULO(t,q,u) \
do { \
(q) = ((t) / (u)); \
if ((q) != 0) (t) -= ((q) * (u)); \
} while(0)
-#else
-#define TMODULO(t,q,u) \
-do { \
- (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
- if ((q) != 0) (t) -= rint((q) * (u)); \
-} while(0)
-#endif
/*
* Date/time validation
@@ -346,7 +338,4 @@ extern TimeZoneAbbrevTable *ConvertTimeZoneAbbrevs(struct tzEntry *abbrevs,
int n);
extern void InstallTimeZoneAbbrevs(TimeZoneAbbrevTable *tbl);
-extern Datum pg_timezone_abbrevs(PG_FUNCTION_ARGS);
-extern Datum pg_timezone_names(PG_FUNCTION_ARGS);
-
#endif /* DATETIME_H */
diff --git a/src/include/utils/datum.h b/src/include/utils/datum.h
index 73ec689d3c..a8a9ea6d19 100644
--- a/src/include/utils/datum.h
+++ b/src/include/utils/datum.h
@@ -8,7 +8,7 @@
* of the Datum. (We do it this way because in most situations the caller
* can look up the info just once and use it for many per-datum operations.)
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/datum.h
diff --git a/src/include/utils/dsa.h b/src/include/utils/dsa.h
new file mode 100644
index 0000000000..f084443409
--- /dev/null
+++ b/src/include/utils/dsa.h
@@ -0,0 +1,125 @@
+/*-------------------------------------------------------------------------
+ *
+ * dsa.h
+ * Dynamic shared memory areas.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * IDENTIFICATION
+ * src/include/utils/dsa.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef DSA_H
+#define DSA_H
+
+#include "port/atomics.h"
+#include "storage/dsm.h"
+
+/* The opaque type used for an area. */
+struct dsa_area;
+typedef struct dsa_area dsa_area;
+
+/*
+ * If this system only uses a 32-bit value for Size, then use the 32-bit
+ * implementation of DSA. This limits the amount of DSA that can be created
+ * to something significantly less than the entire 4GB address space because
+ * the DSA pointer must encode both a segment identifier and an offset, but
+ * that shouldn't be a significant limitation in practice.
+ *
+ * If this system doesn't support atomic operations on 64-bit values, then
+ * we fall back to 32-bit dsa_pointer for lack of other options.
+ *
+ * For testing purposes, USE_SMALL_DSA_POINTER can be defined to force the use
+ * of 32-bit dsa_pointer even on systems capable of supporting a 64-bit
+ * dsa_pointer.
+ */
+#if SIZEOF_SIZE_T == 4 || !defined(PG_HAVE_ATOMIC_U64_SUPPORT) || \
+ defined(USE_SMALL_DSA_POINTER)
+#define SIZEOF_DSA_POINTER 4
+#else
+#define SIZEOF_DSA_POINTER 8
+#endif
+
+/*
+ * The type of 'relative pointers' to memory allocated by a dynamic shared
+ * area. dsa_pointer values can be shared with other processes, but must be
+ * converted to backend-local pointers before they can be dereferenced. See
+ * dsa_get_address. Also, an atomic version and appropriately sized atomic
+ * operations.
+ */
+#if SIZEOF_DSA_POINTER == 4
+typedef uint32 dsa_pointer;
+typedef pg_atomic_uint32 dsa_pointer_atomic;
+#define dsa_pointer_atomic_init pg_atomic_init_u32
+#define dsa_pointer_atomic_read pg_atomic_read_u32
+#define dsa_pointer_atomic_write pg_atomic_write_u32
+#define dsa_pointer_atomic_fetch_add pg_atomic_fetch_add_u32
+#define dsa_pointer_atomic_compare_exchange pg_atomic_compare_exchange_u32
+#define DSA_POINTER_FORMAT "%08x"
+#else
+typedef uint64 dsa_pointer;
+typedef pg_atomic_uint64 dsa_pointer_atomic;
+#define dsa_pointer_atomic_init pg_atomic_init_u64
+#define dsa_pointer_atomic_read pg_atomic_read_u64
+#define dsa_pointer_atomic_write pg_atomic_write_u64
+#define dsa_pointer_atomic_fetch_add pg_atomic_fetch_add_u64
+#define dsa_pointer_atomic_compare_exchange pg_atomic_compare_exchange_u64
+#define DSA_POINTER_FORMAT "%016" INT64_MODIFIER "x"
+#endif
+
+/* Flags for dsa_allocate_extended. */
+#define DSA_ALLOC_HUGE 0x01 /* allow huge allocation (> 1 GB) */
+#define DSA_ALLOC_NO_OOM 0x02 /* no failure if out-of-memory */
+#define DSA_ALLOC_ZERO 0x04 /* zero allocated memory */
+
+/* A sentinel value for dsa_pointer used to indicate failure to allocate. */
+#define InvalidDsaPointer ((dsa_pointer) 0)
+
+/* Check if a dsa_pointer value is valid. */
+#define DsaPointerIsValid(x) ((x) != InvalidDsaPointer)
+
+/* Allocate uninitialized memory with error on out-of-memory. */
+#define dsa_allocate(area, size) \
+ dsa_allocate_extended(area, size, 0)
+
+/* Allocate zero-initialized memory with error on out-of-memory. */
+#define dsa_allocate0(area, size) \
+ dsa_allocate_extended(area, size, DSA_ALLOC_ZERO)
+
+/*
+ * The type used for dsa_area handles. dsa_handle values can be shared with
+ * other processes, so that they can attach to them. This provides a way to
+ * share allocated storage with other processes.
+ *
+ * The handle for a dsa_area is currently implemented as the dsm_handle
+ * for the first DSM segment backing this dynamic storage area, but client
+ * code shouldn't assume that is true.
+ */
+typedef dsm_handle dsa_handle;
+
+extern void dsa_startup(void);
+
+extern dsa_area *dsa_create(int tranche_id);
+extern dsa_area *dsa_create_in_place(void *place, Size size,
+ int tranche_id, dsm_segment *segment);
+extern dsa_area *dsa_attach(dsa_handle handle);
+extern dsa_area *dsa_attach_in_place(void *place, dsm_segment *segment);
+extern void dsa_release_in_place(void *place);
+extern void dsa_on_dsm_detach_release_in_place(dsm_segment *, Datum);
+extern void dsa_on_shmem_exit_release_in_place(int, Datum);
+extern void dsa_pin_mapping(dsa_area *area);
+extern void dsa_detach(dsa_area *area);
+extern void dsa_pin(dsa_area *area);
+extern void dsa_unpin(dsa_area *area);
+extern void dsa_set_size_limit(dsa_area *area, Size limit);
+extern Size dsa_minimum_size(void);
+extern dsa_handle dsa_get_handle(dsa_area *area);
+extern dsa_pointer dsa_allocate_extended(dsa_area *area, Size size, int flags);
+extern void dsa_free(dsa_area *area, dsa_pointer dp);
+extern void *dsa_get_address(dsa_area *area, dsa_pointer dp);
+extern void dsa_trim(dsa_area *area);
+extern void dsa_dump(dsa_area *area);
+
+#endif /* DSA_H */
diff --git a/src/include/utils/dynahash.h b/src/include/utils/dynahash.h
index a0352eb7a7..eee5cce928 100644
--- a/src/include/utils/dynahash.h
+++ b/src/include/utils/dynahash.h
@@ -4,7 +4,7 @@
* POSTGRES dynahash.h file definitions
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/dynahash.h
diff --git a/src/include/utils/dynamic_loader.h b/src/include/utils/dynamic_loader.h
index 89c24b789a..987f21a362 100644
--- a/src/include/utils/dynamic_loader.h
+++ b/src/include/utils/dynamic_loader.h
@@ -4,7 +4,7 @@
*
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/dynamic_loader.h
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index d2ad6bae2c..b56e444b5e 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -4,7 +4,7 @@
* POSTGRES error reporting/logging definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/elog.h
@@ -260,12 +260,13 @@ extern int getinternalerrposition(void);
#else /* !HAVE__BUILTIN_CONSTANT_P */
#define elog(elevel, ...) \
do { \
- int elevel_; \
elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
- elevel_ = (elevel); \
- elog_finish(elevel_, __VA_ARGS__); \
- if (elevel_ >= ERROR) \
- pg_unreachable(); \
+ { \
+ const int elevel_ = (elevel); \
+ elog_finish(elevel_, __VA_ARGS__); \
+ if (elevel_ >= ERROR) \
+ pg_unreachable(); \
+ } \
} while(0)
#endif /* HAVE__BUILTIN_CONSTANT_P */
#else /* !HAVE__VA_ARGS */
diff --git a/src/include/utils/evtcache.h b/src/include/utils/evtcache.h
index 7c8da746fd..f6ea163df3 100644
--- a/src/include/utils/evtcache.h
+++ b/src/include/utils/evtcache.h
@@ -3,7 +3,7 @@
* evtcache.c
* Special-purpose cache for event trigger data.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
diff --git a/src/include/utils/expandeddatum.h b/src/include/utils/expandeddatum.h
index 47989a8cf2..f853a13e6e 100644
--- a/src/include/utils/expandeddatum.h
+++ b/src/include/utils/expandeddatum.h
@@ -34,7 +34,7 @@
* value if they fail partway through.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/expandeddatum.h
diff --git a/src/include/utils/fmgrtab.h b/src/include/utils/fmgrtab.h
index 81e844c392..414cd03952 100644
--- a/src/include/utils/fmgrtab.h
+++ b/src/include/utils/fmgrtab.h
@@ -3,7 +3,7 @@
* fmgrtab.h
* The function manager's table of internal functions.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/fmgrtab.h
diff --git a/src/include/utils/formatting.h b/src/include/utils/formatting.h
index 1f40f97d8e..8eaf2c3052 100644
--- a/src/include/utils/formatting.h
+++ b/src/include/utils/formatting.h
@@ -4,7 +4,7 @@
* src/include/utils/formatting.h
*
*
- * Portions Copyright (c) 1999-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1999-2017, PostgreSQL Global Development Group
*
* The PostgreSQL routines for a DateTime/int/float/numeric formatting,
* inspire with Oracle TO_CHAR() / TO_DATE() / TO_NUMBER() routines.
@@ -28,16 +28,4 @@ extern char *asc_tolower(const char *buff, size_t nbytes);
extern char *asc_toupper(const char *buff, size_t nbytes);
extern char *asc_initcap(const char *buff, size_t nbytes);
-extern Datum timestamp_to_char(PG_FUNCTION_ARGS);
-extern Datum timestamptz_to_char(PG_FUNCTION_ARGS);
-extern Datum interval_to_char(PG_FUNCTION_ARGS);
-extern Datum to_timestamp(PG_FUNCTION_ARGS);
-extern Datum to_date(PG_FUNCTION_ARGS);
-extern Datum numeric_to_number(PG_FUNCTION_ARGS);
-extern Datum numeric_to_char(PG_FUNCTION_ARGS);
-extern Datum int4_to_char(PG_FUNCTION_ARGS);
-extern Datum int8_to_char(PG_FUNCTION_ARGS);
-extern Datum float4_to_char(PG_FUNCTION_ARGS);
-extern Datum float8_to_char(PG_FUNCTION_ARGS);
-
#endif
diff --git a/src/include/utils/freepage.h b/src/include/utils/freepage.h
new file mode 100644
index 0000000000..78caa5369b
--- /dev/null
+++ b/src/include/utils/freepage.h
@@ -0,0 +1,99 @@
+/*-------------------------------------------------------------------------
+ *
+ * freepage.h
+ * Management of page-organized free memory.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/utils/freepage.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef FREEPAGE_H
+#define FREEPAGE_H
+
+#include "storage/lwlock.h"
+#include "utils/relptr.h"
+
+/* Forward declarations. */
+typedef struct FreePageSpanLeader FreePageSpanLeader;
+typedef struct FreePageBtree FreePageBtree;
+typedef struct FreePageManager FreePageManager;
+
+/*
+ * PostgreSQL normally uses 8kB pages for most things, but many common
+ * architecture/operating system pairings use a 4kB page size for memory
+ * allocation, so we do that here also.
+ */
+#define FPM_PAGE_SIZE 4096
+
+/*
+ * Each freelist except for the last contains only spans of one particular
+ * size. Everything larger goes on the last one. In some sense this seems
+ * like a waste since most allocations are in a few common sizes, but it
+ * means that small allocations can simply pop the head of the relevant list
+ * without needing to worry about whether the object we find there is of
+ * precisely the correct size (because we know it must be).
+ */
+#define FPM_NUM_FREELISTS 129
+
+/* Define relative pointer types. */
+relptr_declare(FreePageBtree, RelptrFreePageBtree);
+relptr_declare(FreePageManager, RelptrFreePageManager);
+relptr_declare(FreePageSpanLeader, RelptrFreePageSpanLeader);
+
+/* Everything we need in order to manage free pages (see freepage.c) */
+struct FreePageManager
+{
+ RelptrFreePageManager self;
+ RelptrFreePageBtree btree_root;
+ RelptrFreePageSpanLeader btree_recycle;
+ unsigned btree_depth;
+ unsigned btree_recycle_count;
+ Size singleton_first_page;
+ Size singleton_npages;
+ Size contiguous_pages;
+ bool contiguous_pages_dirty;
+ RelptrFreePageSpanLeader freelist[FPM_NUM_FREELISTS];
+#ifdef FPM_EXTRA_ASSERTS
+ /* For debugging only, pages put minus pages gotten. */
+ Size free_pages;
+#endif
+};
+
+/* Macros to convert between page numbers (expressed as Size) and pointers. */
+#define fpm_page_to_pointer(base, page) \
+ (AssertVariableIsOfTypeMacro(page, Size), \
+ (base) + FPM_PAGE_SIZE * (page))
+#define fpm_pointer_to_page(base, ptr) \
+ (((Size) (((char *) (ptr)) - (base))) / FPM_PAGE_SIZE)
+
+/* Macro to convert an allocation size to a number of pages. */
+#define fpm_size_to_pages(sz) \
+ (((sz) + FPM_PAGE_SIZE - 1) / FPM_PAGE_SIZE)
+
+/* Macros to check alignment of absolute and relative pointers. */
+#define fpm_pointer_is_page_aligned(base, ptr) \
+ (((Size) (((char *) (ptr)) - (base))) % FPM_PAGE_SIZE == 0)
+#define fpm_relptr_is_page_aligned(base, relptr) \
+ ((relptr).relptr_off % FPM_PAGE_SIZE == 0)
+
+/* Macro to find base address of the segment containing a FreePageManager. */
+#define fpm_segment_base(fpm) \
+ (((char *) fpm) - fpm->self.relptr_off)
+
+/* Macro to access a FreePageManager's largest consecutive run of pages. */
+#define fpm_largest(fpm) \
+ (fpm->contiguous_pages)
+
+/* Functions to manipulate the free page map. */
+extern void FreePageManagerInitialize(FreePageManager *fpm, char *base);
+extern bool FreePageManagerGet(FreePageManager *fpm, Size npages,
+ Size *first_page);
+extern void FreePageManagerPut(FreePageManager *fpm, Size first_page,
+ Size npages);
+extern char *FreePageManagerDump(FreePageManager *fpm);
+
+#endif /* FREEPAGE_H */
diff --git a/src/include/utils/geo_decls.h b/src/include/utils/geo_decls.h
index fe9bc60782..9b530dbe3d 100644
--- a/src/include/utils/geo_decls.h
+++ b/src/include/utils/geo_decls.h
@@ -3,7 +3,7 @@
* geo_decls.h - Declarations for various 2D constructs.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/geo_decls.h
@@ -175,270 +175,12 @@ typedef struct
/*
- * in geo_ops.h
+ * in geo_ops.c
*/
-/* public point routines */
-extern Datum point_in(PG_FUNCTION_ARGS);
-extern Datum point_out(PG_FUNCTION_ARGS);
-extern Datum point_recv(PG_FUNCTION_ARGS);
-extern Datum point_send(PG_FUNCTION_ARGS);
-extern Datum construct_point(PG_FUNCTION_ARGS);
-extern Datum point_left(PG_FUNCTION_ARGS);
-extern Datum point_right(PG_FUNCTION_ARGS);
-extern Datum point_above(PG_FUNCTION_ARGS);
-extern Datum point_below(PG_FUNCTION_ARGS);
-extern Datum point_vert(PG_FUNCTION_ARGS);
-extern Datum point_horiz(PG_FUNCTION_ARGS);
-extern Datum point_eq(PG_FUNCTION_ARGS);
-extern Datum point_ne(PG_FUNCTION_ARGS);
-extern Datum point_distance(PG_FUNCTION_ARGS);
-extern Datum point_slope(PG_FUNCTION_ARGS);
-extern Datum point_add(PG_FUNCTION_ARGS);
-extern Datum point_sub(PG_FUNCTION_ARGS);
-extern Datum point_mul(PG_FUNCTION_ARGS);
-extern Datum point_div(PG_FUNCTION_ARGS);
-
-/* private routines */
+/* private point routines */
extern double point_dt(Point *pt1, Point *pt2);
extern double point_sl(Point *pt1, Point *pt2);
extern double pg_hypot(double x, double y);
-/* public lseg routines */
-extern Datum lseg_in(PG_FUNCTION_ARGS);
-extern Datum lseg_out(PG_FUNCTION_ARGS);
-extern Datum lseg_recv(PG_FUNCTION_ARGS);
-extern Datum lseg_send(PG_FUNCTION_ARGS);
-extern Datum lseg_intersect(PG_FUNCTION_ARGS);
-extern Datum lseg_parallel(PG_FUNCTION_ARGS);
-extern Datum lseg_perp(PG_FUNCTION_ARGS);
-extern Datum lseg_vertical(PG_FUNCTION_ARGS);
-extern Datum lseg_horizontal(PG_FUNCTION_ARGS);
-extern Datum lseg_eq(PG_FUNCTION_ARGS);
-extern Datum lseg_ne(PG_FUNCTION_ARGS);
-extern Datum lseg_lt(PG_FUNCTION_ARGS);
-extern Datum lseg_le(PG_FUNCTION_ARGS);
-extern Datum lseg_gt(PG_FUNCTION_ARGS);
-extern Datum lseg_ge(PG_FUNCTION_ARGS);
-extern Datum lseg_construct(PG_FUNCTION_ARGS);
-extern Datum lseg_length(PG_FUNCTION_ARGS);
-extern Datum lseg_distance(PG_FUNCTION_ARGS);
-extern Datum lseg_center(PG_FUNCTION_ARGS);
-extern Datum lseg_interpt(PG_FUNCTION_ARGS);
-extern Datum dist_pl(PG_FUNCTION_ARGS);
-extern Datum dist_ps(PG_FUNCTION_ARGS);
-extern Datum dist_ppath(PG_FUNCTION_ARGS);
-extern Datum dist_pb(PG_FUNCTION_ARGS);
-extern Datum dist_sl(PG_FUNCTION_ARGS);
-extern Datum dist_sb(PG_FUNCTION_ARGS);
-extern Datum dist_lb(PG_FUNCTION_ARGS);
-extern Datum close_lseg(PG_FUNCTION_ARGS);
-extern Datum close_pl(PG_FUNCTION_ARGS);
-extern Datum close_ps(PG_FUNCTION_ARGS);
-extern Datum close_pb(PG_FUNCTION_ARGS);
-extern Datum close_sl(PG_FUNCTION_ARGS);
-extern Datum close_sb(PG_FUNCTION_ARGS);
-extern Datum close_ls(PG_FUNCTION_ARGS);
-extern Datum close_lb(PG_FUNCTION_ARGS);
-extern Datum on_pl(PG_FUNCTION_ARGS);
-extern Datum on_ps(PG_FUNCTION_ARGS);
-extern Datum on_pb(PG_FUNCTION_ARGS);
-extern Datum on_ppath(PG_FUNCTION_ARGS);
-extern Datum on_sl(PG_FUNCTION_ARGS);
-extern Datum on_sb(PG_FUNCTION_ARGS);
-extern Datum inter_sl(PG_FUNCTION_ARGS);
-extern Datum inter_sb(PG_FUNCTION_ARGS);
-extern Datum inter_lb(PG_FUNCTION_ARGS);
-
-/* public line routines */
-extern Datum line_in(PG_FUNCTION_ARGS);
-extern Datum line_out(PG_FUNCTION_ARGS);
-extern Datum line_recv(PG_FUNCTION_ARGS);
-extern Datum line_send(PG_FUNCTION_ARGS);
-extern Datum line_interpt(PG_FUNCTION_ARGS);
-extern Datum line_distance(PG_FUNCTION_ARGS);
-extern Datum line_construct_pp(PG_FUNCTION_ARGS);
-extern Datum line_intersect(PG_FUNCTION_ARGS);
-extern Datum line_parallel(PG_FUNCTION_ARGS);
-extern Datum line_perp(PG_FUNCTION_ARGS);
-extern Datum line_vertical(PG_FUNCTION_ARGS);
-extern Datum line_horizontal(PG_FUNCTION_ARGS);
-extern Datum line_eq(PG_FUNCTION_ARGS);
-
-/* public box routines */
-extern Datum box_in(PG_FUNCTION_ARGS);
-extern Datum box_out(PG_FUNCTION_ARGS);
-extern Datum box_recv(PG_FUNCTION_ARGS);
-extern Datum box_send(PG_FUNCTION_ARGS);
-extern Datum box_same(PG_FUNCTION_ARGS);
-extern Datum box_overlap(PG_FUNCTION_ARGS);
-extern Datum box_left(PG_FUNCTION_ARGS);
-extern Datum box_overleft(PG_FUNCTION_ARGS);
-extern Datum box_right(PG_FUNCTION_ARGS);
-extern Datum box_overright(PG_FUNCTION_ARGS);
-extern Datum box_below(PG_FUNCTION_ARGS);
-extern Datum box_overbelow(PG_FUNCTION_ARGS);
-extern Datum box_above(PG_FUNCTION_ARGS);
-extern Datum box_overabove(PG_FUNCTION_ARGS);
-extern Datum box_contained(PG_FUNCTION_ARGS);
-extern Datum box_contain(PG_FUNCTION_ARGS);
-extern Datum box_contain_pt(PG_FUNCTION_ARGS);
-extern Datum box_below_eq(PG_FUNCTION_ARGS);
-extern Datum box_above_eq(PG_FUNCTION_ARGS);
-extern Datum box_lt(PG_FUNCTION_ARGS);
-extern Datum box_gt(PG_FUNCTION_ARGS);
-extern Datum box_eq(PG_FUNCTION_ARGS);
-extern Datum box_le(PG_FUNCTION_ARGS);
-extern Datum box_ge(PG_FUNCTION_ARGS);
-extern Datum box_area(PG_FUNCTION_ARGS);
-extern Datum box_width(PG_FUNCTION_ARGS);
-extern Datum box_height(PG_FUNCTION_ARGS);
-extern Datum box_distance(PG_FUNCTION_ARGS);
-extern Datum box_center(PG_FUNCTION_ARGS);
-extern Datum box_intersect(PG_FUNCTION_ARGS);
-extern Datum box_diagonal(PG_FUNCTION_ARGS);
-extern Datum points_box(PG_FUNCTION_ARGS);
-extern Datum box_add(PG_FUNCTION_ARGS);
-extern Datum box_sub(PG_FUNCTION_ARGS);
-extern Datum box_mul(PG_FUNCTION_ARGS);
-extern Datum box_div(PG_FUNCTION_ARGS);
-extern Datum point_box(PG_FUNCTION_ARGS);
-extern Datum boxes_bound_box(PG_FUNCTION_ARGS);
-
-/* public path routines */
-extern Datum path_area(PG_FUNCTION_ARGS);
-extern Datum path_in(PG_FUNCTION_ARGS);
-extern Datum path_out(PG_FUNCTION_ARGS);
-extern Datum path_recv(PG_FUNCTION_ARGS);
-extern Datum path_send(PG_FUNCTION_ARGS);
-extern Datum path_n_lt(PG_FUNCTION_ARGS);
-extern Datum path_n_gt(PG_FUNCTION_ARGS);
-extern Datum path_n_eq(PG_FUNCTION_ARGS);
-extern Datum path_n_le(PG_FUNCTION_ARGS);
-extern Datum path_n_ge(PG_FUNCTION_ARGS);
-extern Datum path_inter(PG_FUNCTION_ARGS);
-extern Datum path_distance(PG_FUNCTION_ARGS);
-extern Datum path_length(PG_FUNCTION_ARGS);
-
-extern Datum path_isclosed(PG_FUNCTION_ARGS);
-extern Datum path_isopen(PG_FUNCTION_ARGS);
-extern Datum path_npoints(PG_FUNCTION_ARGS);
-
-extern Datum path_close(PG_FUNCTION_ARGS);
-extern Datum path_open(PG_FUNCTION_ARGS);
-extern Datum path_add(PG_FUNCTION_ARGS);
-extern Datum path_add_pt(PG_FUNCTION_ARGS);
-extern Datum path_sub_pt(PG_FUNCTION_ARGS);
-extern Datum path_mul_pt(PG_FUNCTION_ARGS);
-extern Datum path_div_pt(PG_FUNCTION_ARGS);
-
-extern Datum path_center(PG_FUNCTION_ARGS);
-extern Datum path_poly(PG_FUNCTION_ARGS);
-
-/* public polygon routines */
-extern Datum poly_in(PG_FUNCTION_ARGS);
-extern Datum poly_out(PG_FUNCTION_ARGS);
-extern Datum poly_recv(PG_FUNCTION_ARGS);
-extern Datum poly_send(PG_FUNCTION_ARGS);
-extern Datum poly_left(PG_FUNCTION_ARGS);
-extern Datum poly_overleft(PG_FUNCTION_ARGS);
-extern Datum poly_right(PG_FUNCTION_ARGS);
-extern Datum poly_overright(PG_FUNCTION_ARGS);
-extern Datum poly_below(PG_FUNCTION_ARGS);
-extern Datum poly_overbelow(PG_FUNCTION_ARGS);
-extern Datum poly_above(PG_FUNCTION_ARGS);
-extern Datum poly_overabove(PG_FUNCTION_ARGS);
-extern Datum poly_same(PG_FUNCTION_ARGS);
-extern Datum poly_overlap(PG_FUNCTION_ARGS);
-extern Datum poly_contain(PG_FUNCTION_ARGS);
-extern Datum poly_contained(PG_FUNCTION_ARGS);
-extern Datum poly_contain_pt(PG_FUNCTION_ARGS);
-extern Datum pt_contained_poly(PG_FUNCTION_ARGS);
-extern Datum poly_distance(PG_FUNCTION_ARGS);
-extern Datum poly_npoints(PG_FUNCTION_ARGS);
-extern Datum poly_center(PG_FUNCTION_ARGS);
-extern Datum poly_box(PG_FUNCTION_ARGS);
-extern Datum poly_path(PG_FUNCTION_ARGS);
-extern Datum box_poly(PG_FUNCTION_ARGS);
-
-/* public circle routines */
-extern Datum circle_in(PG_FUNCTION_ARGS);
-extern Datum circle_out(PG_FUNCTION_ARGS);
-extern Datum circle_recv(PG_FUNCTION_ARGS);
-extern Datum circle_send(PG_FUNCTION_ARGS);
-extern Datum circle_same(PG_FUNCTION_ARGS);
-extern Datum circle_overlap(PG_FUNCTION_ARGS);
-extern Datum circle_overleft(PG_FUNCTION_ARGS);
-extern Datum circle_left(PG_FUNCTION_ARGS);
-extern Datum circle_right(PG_FUNCTION_ARGS);
-extern Datum circle_overright(PG_FUNCTION_ARGS);
-extern Datum circle_contained(PG_FUNCTION_ARGS);
-extern Datum circle_contain(PG_FUNCTION_ARGS);
-extern Datum circle_below(PG_FUNCTION_ARGS);
-extern Datum circle_above(PG_FUNCTION_ARGS);
-extern Datum circle_overbelow(PG_FUNCTION_ARGS);
-extern Datum circle_overabove(PG_FUNCTION_ARGS);
-extern Datum circle_eq(PG_FUNCTION_ARGS);
-extern Datum circle_ne(PG_FUNCTION_ARGS);
-extern Datum circle_lt(PG_FUNCTION_ARGS);
-extern Datum circle_gt(PG_FUNCTION_ARGS);
-extern Datum circle_le(PG_FUNCTION_ARGS);
-extern Datum circle_ge(PG_FUNCTION_ARGS);
-extern Datum circle_contain_pt(PG_FUNCTION_ARGS);
-extern Datum pt_contained_circle(PG_FUNCTION_ARGS);
-extern Datum circle_add_pt(PG_FUNCTION_ARGS);
-extern Datum circle_sub_pt(PG_FUNCTION_ARGS);
-extern Datum circle_mul_pt(PG_FUNCTION_ARGS);
-extern Datum circle_div_pt(PG_FUNCTION_ARGS);
-extern Datum circle_diameter(PG_FUNCTION_ARGS);
-extern Datum circle_radius(PG_FUNCTION_ARGS);
-extern Datum circle_distance(PG_FUNCTION_ARGS);
-extern Datum dist_pc(PG_FUNCTION_ARGS);
-extern Datum dist_cpoint(PG_FUNCTION_ARGS);
-extern Datum dist_cpoly(PG_FUNCTION_ARGS);
-extern Datum dist_ppoly(PG_FUNCTION_ARGS);
-extern Datum dist_polyp(PG_FUNCTION_ARGS);
-extern Datum circle_center(PG_FUNCTION_ARGS);
-extern Datum cr_circle(PG_FUNCTION_ARGS);
-extern Datum box_circle(PG_FUNCTION_ARGS);
-extern Datum circle_box(PG_FUNCTION_ARGS);
-extern Datum poly_circle(PG_FUNCTION_ARGS);
-extern Datum circle_poly(PG_FUNCTION_ARGS);
-extern Datum circle_area(PG_FUNCTION_ARGS);
-
-/* support routines for the GiST access method (access/gist/gistproc.c) */
-extern Datum gist_box_compress(PG_FUNCTION_ARGS);
-extern Datum gist_box_decompress(PG_FUNCTION_ARGS);
-extern Datum gist_box_union(PG_FUNCTION_ARGS);
-extern Datum gist_box_picksplit(PG_FUNCTION_ARGS);
-extern Datum gist_box_consistent(PG_FUNCTION_ARGS);
-extern Datum gist_box_penalty(PG_FUNCTION_ARGS);
-extern Datum gist_box_same(PG_FUNCTION_ARGS);
-extern Datum gist_box_fetch(PG_FUNCTION_ARGS);
-extern Datum gist_poly_compress(PG_FUNCTION_ARGS);
-extern Datum gist_poly_consistent(PG_FUNCTION_ARGS);
-extern Datum gist_poly_distance(PG_FUNCTION_ARGS);
-extern Datum gist_circle_compress(PG_FUNCTION_ARGS);
-extern Datum gist_circle_consistent(PG_FUNCTION_ARGS);
-extern Datum gist_circle_distance(PG_FUNCTION_ARGS);
-extern Datum gist_point_compress(PG_FUNCTION_ARGS);
-extern Datum gist_point_consistent(PG_FUNCTION_ARGS);
-extern Datum gist_point_distance(PG_FUNCTION_ARGS);
-extern Datum gist_point_fetch(PG_FUNCTION_ARGS);
-
-/* utils/adt/geo_spgist.c */
-Datum spg_box_quad_config(PG_FUNCTION_ARGS);
-Datum spg_box_quad_choose(PG_FUNCTION_ARGS);
-Datum spg_box_quad_picksplit(PG_FUNCTION_ARGS);
-Datum spg_box_quad_inner_consistent(PG_FUNCTION_ARGS);
-Datum spg_box_quad_leaf_consistent(PG_FUNCTION_ARGS);
-
-/* geo_selfuncs.c */
-extern Datum areasel(PG_FUNCTION_ARGS);
-extern Datum areajoinsel(PG_FUNCTION_ARGS);
-extern Datum positionsel(PG_FUNCTION_ARGS);
-extern Datum positionjoinsel(PG_FUNCTION_ARGS);
-extern Datum contsel(PG_FUNCTION_ARGS);
-extern Datum contjoinsel(PG_FUNCTION_ARGS);
-
#endif /* GEO_DECLS_H */
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 23288d9806..144281aa24 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -5,7 +5,7 @@
* backend/utils/misc/guc-file.l
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Copyright (c) 2000-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2000-2017, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* src/include/utils/guc.h
@@ -219,13 +219,13 @@ typedef enum
#define GUC_UNIT_KB 0x1000 /* value is in kilobytes */
#define GUC_UNIT_BLOCKS 0x2000 /* value is in blocks */
#define GUC_UNIT_XBLOCKS 0x3000 /* value is in xlog blocks */
-#define GUC_UNIT_XSEGS 0x4000 /* value is in xlog segments */
-#define GUC_UNIT_MEMORY 0xF000 /* mask for KB, BLOCKS, XBLOCKS */
+#define GUC_UNIT_MB 0x4000 /* value is in megabytes */
+#define GUC_UNIT_MEMORY 0xF000 /* mask for size-related units */
#define GUC_UNIT_MS 0x10000 /* value is in milliseconds */
#define GUC_UNIT_S 0x20000 /* value is in seconds */
#define GUC_UNIT_MIN 0x30000 /* value is in minutes */
-#define GUC_UNIT_TIME 0xF0000 /* mask for MS, S, MIN */
+#define GUC_UNIT_TIME 0xF0000 /* mask for time-related units */
#define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME)
@@ -250,7 +250,6 @@ extern bool log_remotesubplan_stats;
extern PGDLLIMPORT bool check_function_bodies;
extern bool default_with_oids;
-extern bool SQL_inheritance;
extern int log_min_error_statement;
extern int log_min_messages;
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index 329fc5f90c..1057e55f76 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -5,7 +5,7 @@
*
* See src/backend/utils/misc/README for design notes.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/utils/guc_tables.h
*
@@ -72,6 +72,7 @@ enum config_group
REPLICATION_SENDING,
REPLICATION_MASTER,
REPLICATION_STANDBY,
+ REPLICATION_SUBSCRIBERS,
QUERY_TUNING,
QUERY_TUNING_METHOD,
QUERY_TUNING_COST,
diff --git a/src/include/utils/help_config.h b/src/include/utils/help_config.h
index 565fdd96fc..3f433d10d7 100644
--- a/src/include/utils/help_config.h
+++ b/src/include/utils/help_config.h
@@ -3,7 +3,7 @@
* help_config.h
* Interface to the --help-config option of main.c
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/utils/help_config.h
*
diff --git a/src/include/utils/hsearch.h b/src/include/utils/hsearch.h
index 007ba2c69b..7964087161 100644
--- a/src/include/utils/hsearch.h
+++ b/src/include/utils/hsearch.h
@@ -4,7 +4,7 @@
* exported definitions for utils/hash/dynahash.c; see notes therein
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/hsearch.h
diff --git a/src/include/utils/index_selfuncs.h b/src/include/utils/index_selfuncs.h
index a03e12f518..17d165ca65 100644
--- a/src/include/utils/index_selfuncs.h
+++ b/src/include/utils/index_selfuncs.h
@@ -9,7 +9,7 @@
* If you make it depend on anything besides access/amapi.h, that's likely
* a mistake.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/index_selfuncs.h
@@ -28,41 +28,47 @@ extern void brincostestimate(struct PlannerInfo *root,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
extern void btcostestimate(struct PlannerInfo *root,
struct IndexPath *path,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
extern void hashcostestimate(struct PlannerInfo *root,
struct IndexPath *path,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
extern void gistcostestimate(struct PlannerInfo *root,
struct IndexPath *path,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
extern void spgcostestimate(struct PlannerInfo *root,
struct IndexPath *path,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
extern void gincostestimate(struct PlannerInfo *root,
struct IndexPath *path,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity,
- double *indexCorrelation);
+ double *indexCorrelation,
+ double *indexPages);
#endif /* INDEX_SELFUNCS_H */
diff --git a/src/include/utils/inet.h b/src/include/utils/inet.h
index 2fe3ca8c3c..7dc179e255 100644
--- a/src/include/utils/inet.h
+++ b/src/include/utils/inet.h
@@ -4,7 +4,7 @@
* Declarations for operations on INET datatypes.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/inet.h
@@ -28,10 +28,12 @@ typedef struct
} inet_struct;
/*
+ * We use these values for the "family" field.
+ *
* Referencing all of the non-AF_INET types to AF_INET lets us work on
* machines which may not have the appropriate address family (like
* inet6 addresses when AF_INET6 isn't present) but doesn't cause a
- * dump/reload requirement. Existing databases used AF_INET for the family
+ * dump/reload requirement. Pre-7.4 databases used AF_INET for the family
* type on disk.
*/
#define PGSQL_AF_INET (AF_INET + 0)
@@ -100,42 +102,48 @@ typedef struct macaddr
} macaddr;
/*
+ * This is the internal storage format for MAC8 addresses:
+ */
+typedef struct macaddr8
+{
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} macaddr8;
+
+/*
* fmgr interface macros
*/
-#define DatumGetInetP(X) ((inet *) PG_DETOAST_DATUM(X))
#define DatumGetInetPP(X) ((inet *) PG_DETOAST_DATUM_PACKED(X))
#define InetPGetDatum(X) PointerGetDatum(X)
-#define PG_GETARG_INET_P(n) DatumGetInetP(PG_GETARG_DATUM(n))
#define PG_GETARG_INET_PP(n) DatumGetInetPP(PG_GETARG_DATUM(n))
#define PG_RETURN_INET_P(x) return InetPGetDatum(x)
+/* obsolescent variants */
+#define DatumGetInetP(X) ((inet *) PG_DETOAST_DATUM(X))
+#define PG_GETARG_INET_P(n) DatumGetInetP(PG_GETARG_DATUM(n))
+
/* macaddr is a fixed-length pass-by-reference datatype */
#define DatumGetMacaddrP(X) ((macaddr *) DatumGetPointer(X))
#define MacaddrPGetDatum(X) PointerGetDatum(X)
#define PG_GETARG_MACADDR_P(n) DatumGetMacaddrP(PG_GETARG_DATUM(n))
#define PG_RETURN_MACADDR_P(x) return MacaddrPGetDatum(x)
+/* macaddr8 is a fixed-length pass-by-reference datatype */
+#define DatumGetMacaddr8P(X) ((macaddr8 *) DatumGetPointer(X))
+#define Macaddr8PGetDatum(X) PointerGetDatum(X)
+#define PG_GETARG_MACADDR8_P(n) DatumGetMacaddr8P(PG_GETARG_DATUM(n))
+#define PG_RETURN_MACADDR8_P(x) return Macaddr8PGetDatum(x)
+
/*
* Support functions in network.c
*/
+extern inet *cidr_set_masklen_internal(const inet *src, int bits);
extern int bitncmp(const unsigned char *l, const unsigned char *r, int n);
extern int bitncommon(const unsigned char *l, const unsigned char *r, int n);
-/*
- * GiST support functions in network_gist.c
- */
-extern Datum inet_gist_fetch(PG_FUNCTION_ARGS);
-extern Datum inet_gist_consistent(PG_FUNCTION_ARGS);
-extern Datum inet_gist_union(PG_FUNCTION_ARGS);
-extern Datum inet_gist_compress(PG_FUNCTION_ARGS);
-extern Datum inet_gist_decompress(PG_FUNCTION_ARGS);
-extern Datum inet_gist_penalty(PG_FUNCTION_ARGS);
-extern Datum inet_gist_picksplit(PG_FUNCTION_ARGS);
-extern Datum inet_gist_same(PG_FUNCTION_ARGS);
-
-/*
- * Estimation functions in network_selfuncs.c
- */
-extern Datum networksel(PG_FUNCTION_ARGS);
-extern Datum networkjoinsel(PG_FUNCTION_ARGS);
-
#endif /* INET_H */
diff --git a/src/include/utils/int8.h b/src/include/utils/int8.h
index 2bafa2dc2d..c58ee048cf 100644
--- a/src/include/utils/int8.h
+++ b/src/include/utils/int8.h
@@ -4,7 +4,7 @@
* Declarations for operations on 64-bit integers.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/int8.h
@@ -20,110 +20,6 @@
#ifndef INT8_H
#define INT8_H
-#include "fmgr.h"
-
-
extern bool scanint8(const char *str, bool errorOK, int64 *result);
-extern Datum int8in(PG_FUNCTION_ARGS);
-extern Datum int8out(PG_FUNCTION_ARGS);
-extern Datum int8recv(PG_FUNCTION_ARGS);
-extern Datum int8send(PG_FUNCTION_ARGS);
-
-extern Datum int8eq(PG_FUNCTION_ARGS);
-extern Datum int8ne(PG_FUNCTION_ARGS);
-extern Datum int8lt(PG_FUNCTION_ARGS);
-extern Datum int8gt(PG_FUNCTION_ARGS);
-extern Datum int8le(PG_FUNCTION_ARGS);
-extern Datum int8ge(PG_FUNCTION_ARGS);
-
-extern Datum int84eq(PG_FUNCTION_ARGS);
-extern Datum int84ne(PG_FUNCTION_ARGS);
-extern Datum int84lt(PG_FUNCTION_ARGS);
-extern Datum int84gt(PG_FUNCTION_ARGS);
-extern Datum int84le(PG_FUNCTION_ARGS);
-extern Datum int84ge(PG_FUNCTION_ARGS);
-
-extern Datum int48eq(PG_FUNCTION_ARGS);
-extern Datum int48ne(PG_FUNCTION_ARGS);
-extern Datum int48lt(PG_FUNCTION_ARGS);
-extern Datum int48gt(PG_FUNCTION_ARGS);
-extern Datum int48le(PG_FUNCTION_ARGS);
-extern Datum int48ge(PG_FUNCTION_ARGS);
-
-extern Datum int82eq(PG_FUNCTION_ARGS);
-extern Datum int82ne(PG_FUNCTION_ARGS);
-extern Datum int82lt(PG_FUNCTION_ARGS);
-extern Datum int82gt(PG_FUNCTION_ARGS);
-extern Datum int82le(PG_FUNCTION_ARGS);
-extern Datum int82ge(PG_FUNCTION_ARGS);
-
-extern Datum int28eq(PG_FUNCTION_ARGS);
-extern Datum int28ne(PG_FUNCTION_ARGS);
-extern Datum int28lt(PG_FUNCTION_ARGS);
-extern Datum int28gt(PG_FUNCTION_ARGS);
-extern Datum int28le(PG_FUNCTION_ARGS);
-extern Datum int28ge(PG_FUNCTION_ARGS);
-
-extern Datum int8um(PG_FUNCTION_ARGS);
-extern Datum int8up(PG_FUNCTION_ARGS);
-extern Datum int8pl(PG_FUNCTION_ARGS);
-extern Datum int8mi(PG_FUNCTION_ARGS);
-extern Datum int8mul(PG_FUNCTION_ARGS);
-extern Datum int8div(PG_FUNCTION_ARGS);
-extern Datum int8abs(PG_FUNCTION_ARGS);
-extern Datum int8mod(PG_FUNCTION_ARGS);
-extern Datum int8inc(PG_FUNCTION_ARGS);
-extern Datum int8dec(PG_FUNCTION_ARGS);
-extern Datum int8inc_any(PG_FUNCTION_ARGS);
-extern Datum int8inc_float8_float8(PG_FUNCTION_ARGS);
-extern Datum int8dec_any(PG_FUNCTION_ARGS);
-extern Datum int8larger(PG_FUNCTION_ARGS);
-extern Datum int8smaller(PG_FUNCTION_ARGS);
-
-extern Datum int8and(PG_FUNCTION_ARGS);
-extern Datum int8or(PG_FUNCTION_ARGS);
-extern Datum int8xor(PG_FUNCTION_ARGS);
-extern Datum int8not(PG_FUNCTION_ARGS);
-extern Datum int8shl(PG_FUNCTION_ARGS);
-extern Datum int8shr(PG_FUNCTION_ARGS);
-
-extern Datum int84pl(PG_FUNCTION_ARGS);
-extern Datum int84mi(PG_FUNCTION_ARGS);
-extern Datum int84mul(PG_FUNCTION_ARGS);
-extern Datum int84div(PG_FUNCTION_ARGS);
-
-extern Datum int48pl(PG_FUNCTION_ARGS);
-extern Datum int48mi(PG_FUNCTION_ARGS);
-extern Datum int48mul(PG_FUNCTION_ARGS);
-extern Datum int48div(PG_FUNCTION_ARGS);
-
-extern Datum int82pl(PG_FUNCTION_ARGS);
-extern Datum int82mi(PG_FUNCTION_ARGS);
-extern Datum int82mul(PG_FUNCTION_ARGS);
-extern Datum int82div(PG_FUNCTION_ARGS);
-
-extern Datum int28pl(PG_FUNCTION_ARGS);
-extern Datum int28mi(PG_FUNCTION_ARGS);
-extern Datum int28mul(PG_FUNCTION_ARGS);
-extern Datum int28div(PG_FUNCTION_ARGS);
-
-extern Datum int48(PG_FUNCTION_ARGS);
-extern Datum int84(PG_FUNCTION_ARGS);
-
-extern Datum int28(PG_FUNCTION_ARGS);
-extern Datum int82(PG_FUNCTION_ARGS);
-
-extern Datum i8tod(PG_FUNCTION_ARGS);
-extern Datum dtoi8(PG_FUNCTION_ARGS);
-
-extern Datum i8tof(PG_FUNCTION_ARGS);
-extern Datum ftoi8(PG_FUNCTION_ARGS);
-
-extern Datum i8tooid(PG_FUNCTION_ARGS);
-extern Datum oidtoi8(PG_FUNCTION_ARGS);
-
-extern Datum generate_series_int8(PG_FUNCTION_ARGS);
-extern Datum generate_series_step_int8(PG_FUNCTION_ARGS);
-
#endif /* INT8_H */
diff --git a/src/include/utils/inval.h b/src/include/utils/inval.h
index 122fef29c8..afbe354b4d 100644
--- a/src/include/utils/inval.h
+++ b/src/include/utils/inval.h
@@ -4,7 +4,7 @@
* POSTGRES cache invalidation dispatcher definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/inval.h
@@ -43,6 +43,8 @@ extern void CacheInvalidateCatalog(Oid catalogId);
extern void CacheInvalidateRelcache(Relation relation);
+extern void CacheInvalidateRelcacheAll(void);
+
extern void CacheInvalidateRelcacheByTuple(HeapTuple classTuple);
extern void CacheInvalidateRelcacheByRelid(Oid relid);
diff --git a/src/include/utils/json.h b/src/include/utils/json.h
index 9dd9dff2f6..0a749b90c8 100644
--- a/src/include/utils/json.h
+++ b/src/include/utils/json.h
@@ -3,7 +3,7 @@
* json.h
* Declarations for JSON data type support.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/json.h
@@ -14,73 +14,9 @@
#ifndef JSON_H
#define JSON_H
-#include "fmgr.h"
#include "lib/stringinfo.h"
/* functions in json.c */
-extern Datum json_in(PG_FUNCTION_ARGS);
-extern Datum json_out(PG_FUNCTION_ARGS);
-extern Datum json_recv(PG_FUNCTION_ARGS);
-extern Datum json_send(PG_FUNCTION_ARGS);
-extern Datum array_to_json(PG_FUNCTION_ARGS);
-extern Datum array_to_json_pretty(PG_FUNCTION_ARGS);
-extern Datum row_to_json(PG_FUNCTION_ARGS);
-extern Datum row_to_json_pretty(PG_FUNCTION_ARGS);
-extern Datum to_json(PG_FUNCTION_ARGS);
-
-extern Datum json_agg_transfn(PG_FUNCTION_ARGS);
-extern Datum json_agg_finalfn(PG_FUNCTION_ARGS);
-
-extern Datum json_object_agg_finalfn(PG_FUNCTION_ARGS);
-extern Datum json_object_agg_transfn(PG_FUNCTION_ARGS);
-
-extern Datum json_build_object(PG_FUNCTION_ARGS);
-extern Datum json_build_object_noargs(PG_FUNCTION_ARGS);
-extern Datum json_build_array(PG_FUNCTION_ARGS);
-extern Datum json_build_array_noargs(PG_FUNCTION_ARGS);
-
-extern Datum json_object(PG_FUNCTION_ARGS);
-extern Datum json_object_two_arg(PG_FUNCTION_ARGS);
-
extern void escape_json(StringInfo buf, const char *str);
-extern Datum json_typeof(PG_FUNCTION_ARGS);
-
-/* functions in jsonfuncs.c */
-extern Datum json_object_field(PG_FUNCTION_ARGS);
-extern Datum json_object_field_text(PG_FUNCTION_ARGS);
-extern Datum json_array_element(PG_FUNCTION_ARGS);
-extern Datum json_array_element_text(PG_FUNCTION_ARGS);
-extern Datum json_extract_path(PG_FUNCTION_ARGS);
-extern Datum json_extract_path_text(PG_FUNCTION_ARGS);
-extern Datum json_object_keys(PG_FUNCTION_ARGS);
-extern Datum json_array_length(PG_FUNCTION_ARGS);
-extern Datum json_each(PG_FUNCTION_ARGS);
-extern Datum json_each_text(PG_FUNCTION_ARGS);
-extern Datum json_array_elements(PG_FUNCTION_ARGS);
-extern Datum json_array_elements_text(PG_FUNCTION_ARGS);
-extern Datum json_populate_record(PG_FUNCTION_ARGS);
-extern Datum json_populate_recordset(PG_FUNCTION_ARGS);
-extern Datum json_to_record(PG_FUNCTION_ARGS);
-extern Datum json_to_recordset(PG_FUNCTION_ARGS);
-extern Datum json_strip_nulls(PG_FUNCTION_ARGS);
-
-extern Datum jsonb_object_field(PG_FUNCTION_ARGS);
-extern Datum jsonb_object_field_text(PG_FUNCTION_ARGS);
-extern Datum jsonb_array_element(PG_FUNCTION_ARGS);
-extern Datum jsonb_array_element_text(PG_FUNCTION_ARGS);
-extern Datum jsonb_extract_path(PG_FUNCTION_ARGS);
-extern Datum jsonb_extract_path_text(PG_FUNCTION_ARGS);
-extern Datum jsonb_object_keys(PG_FUNCTION_ARGS);
-extern Datum jsonb_array_length(PG_FUNCTION_ARGS);
-extern Datum jsonb_each(PG_FUNCTION_ARGS);
-extern Datum jsonb_each_text(PG_FUNCTION_ARGS);
-extern Datum jsonb_array_elements_text(PG_FUNCTION_ARGS);
-extern Datum jsonb_array_elements(PG_FUNCTION_ARGS);
-extern Datum jsonb_populate_record(PG_FUNCTION_ARGS);
-extern Datum jsonb_populate_recordset(PG_FUNCTION_ARGS);
-extern Datum jsonb_to_record(PG_FUNCTION_ARGS);
-extern Datum jsonb_to_recordset(PG_FUNCTION_ARGS);
-extern Datum jsonb_strip_nulls(PG_FUNCTION_ARGS);
-
#endif /* JSON_H */
diff --git a/src/include/utils/jsonapi.h b/src/include/utils/jsonapi.h
index b041fa4ed3..44ee36931e 100644
--- a/src/include/utils/jsonapi.h
+++ b/src/include/utils/jsonapi.h
@@ -3,7 +3,7 @@
* jsonapi.h
* Declarations for JSON API support.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/jsonapi.h
@@ -14,6 +14,7 @@
#ifndef JSONAPI_H
#define JSONAPI_H
+#include "jsonb.h"
#include "lib/stringinfo.h"
typedef enum
@@ -127,8 +128,23 @@ extern JsonLexContext *makeJsonLexContextCstringLen(char *json,
/*
* Utility function to check if a string is a valid JSON number.
*
- * str agrument does not need to be nul-terminated.
+ * str argument does not need to be nul-terminated.
*/
extern bool IsValidJsonNumber(const char *str, int len);
+/* an action that will be applied to each value in iterate_json(b)_string_vaues functions */
+typedef void (*JsonIterateStringValuesAction) (void *state, char *elem_value, int elem_len);
+
+/* an action that will be applied to each value in transform_json(b)_string_values functions */
+typedef text *(*JsonTransformStringValuesAction) (void *state, char *elem_value, int elem_len);
+
+extern void iterate_jsonb_string_values(Jsonb *jb, void *state,
+ JsonIterateStringValuesAction action);
+extern void iterate_json_string_values(text *json, void *action_state,
+ JsonIterateStringValuesAction action);
+extern Jsonb *transform_jsonb_string_values(Jsonb *jsonb, void *action_state,
+ JsonTransformStringValuesAction transform_action);
+extern text *transform_json_string_values(text *json, void *action_state,
+ JsonTransformStringValuesAction transform_action);
+
#endif /* JSONAPI_H */
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index fa52afcb5c..411e158d6c 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -3,7 +3,7 @@
* jsonb.h
* Declarations for jsonb data type support.
*
- * Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1996-2017, PostgreSQL Global Development Group
*
* src/include/utils/jsonb.h
*
@@ -205,6 +205,12 @@ typedef struct JsonbContainer
#define JB_FOBJECT 0x20000000
#define JB_FARRAY 0x40000000
+/* convenience macros for accessing a JsonbContainer struct */
+#define JsonContainerSize(jc) ((jc)->header & JB_CMASK)
+#define JsonContainerIsScalar(jc) (((jc)->header & JB_FSCALAR) != 0)
+#define JsonContainerIsObject(jc) (((jc)->header & JB_FOBJECT) != 0)
+#define JsonContainerIsArray(jc) (((jc)->header & JB_FARRAY) != 0)
+
/* The top-level on-disk format for a jsonb datum. */
typedef struct
{
@@ -213,12 +219,26 @@ typedef struct
} Jsonb;
/* convenience macros for accessing the root container in a Jsonb datum */
-#define JB_ROOT_COUNT(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_CMASK)
-#define JB_ROOT_IS_SCALAR(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FSCALAR)
-#define JB_ROOT_IS_OBJECT(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FOBJECT)
-#define JB_ROOT_IS_ARRAY(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FARRAY)
+#define JB_ROOT_COUNT(jbp_) (*(uint32 *) VARDATA(jbp_) & JB_CMASK)
+#define JB_ROOT_IS_SCALAR(jbp_) ((*(uint32 *) VARDATA(jbp_) & JB_FSCALAR) != 0)
+#define JB_ROOT_IS_OBJECT(jbp_) ((*(uint32 *) VARDATA(jbp_) & JB_FOBJECT) != 0)
+#define JB_ROOT_IS_ARRAY(jbp_) ((*(uint32 *) VARDATA(jbp_) & JB_FARRAY) != 0)
+enum jbvType
+{
+ /* Scalar types */
+ jbvNull = 0x0,
+ jbvString,
+ jbvNumeric,
+ jbvBool,
+ /* Composite types */
+ jbvArray = 0x10,
+ jbvObject,
+ /* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
+ jbvBinary
+};
+
/*
* JsonbValue: In-memory representation of Jsonb. This is a convenient
* deserialized representation, that can easily support using the "val"
@@ -227,19 +247,7 @@ typedef struct
*/
struct JsonbValue
{
- enum
- {
- /* Scalar types */
- jbvNull = 0x0,
- jbvString,
- jbvNumeric,
- jbvBool,
- /* Composite types */
- jbvArray = 0x10,
- jbvObject,
- /* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
- jbvBinary
- } type; /* Influences sort order */
+ enum jbvType type; /* Influences sort order */
union
{
@@ -343,73 +351,6 @@ typedef struct JsonbIterator
struct JsonbIterator *parent;
} JsonbIterator;
-/* I/O routines */
-extern Datum jsonb_in(PG_FUNCTION_ARGS);
-extern Datum jsonb_out(PG_FUNCTION_ARGS);
-extern Datum jsonb_recv(PG_FUNCTION_ARGS);
-extern Datum jsonb_send(PG_FUNCTION_ARGS);
-extern Datum jsonb_typeof(PG_FUNCTION_ARGS);
-
-/* generator routines */
-extern Datum to_jsonb(PG_FUNCTION_ARGS);
-
-extern Datum jsonb_build_object(PG_FUNCTION_ARGS);
-extern Datum jsonb_build_object_noargs(PG_FUNCTION_ARGS);
-extern Datum jsonb_build_array(PG_FUNCTION_ARGS);
-extern Datum jsonb_build_array_noargs(PG_FUNCTION_ARGS);
-extern Datum jsonb_object(PG_FUNCTION_ARGS);
-extern Datum jsonb_object_two_arg(PG_FUNCTION_ARGS);
-
-/* jsonb_agg, json_object_agg functions */
-extern Datum jsonb_agg_transfn(PG_FUNCTION_ARGS);
-extern Datum jsonb_agg_finalfn(PG_FUNCTION_ARGS);
-extern Datum jsonb_object_agg_transfn(PG_FUNCTION_ARGS);
-extern Datum jsonb_object_agg_finalfn(PG_FUNCTION_ARGS);
-
-/* Indexing-related ops */
-extern Datum jsonb_exists(PG_FUNCTION_ARGS);
-extern Datum jsonb_exists_any(PG_FUNCTION_ARGS);
-extern Datum jsonb_exists_all(PG_FUNCTION_ARGS);
-extern Datum jsonb_contains(PG_FUNCTION_ARGS);
-extern Datum jsonb_contained(PG_FUNCTION_ARGS);
-extern Datum jsonb_ne(PG_FUNCTION_ARGS);
-extern Datum jsonb_lt(PG_FUNCTION_ARGS);
-extern Datum jsonb_gt(PG_FUNCTION_ARGS);
-extern Datum jsonb_le(PG_FUNCTION_ARGS);
-extern Datum jsonb_ge(PG_FUNCTION_ARGS);
-extern Datum jsonb_eq(PG_FUNCTION_ARGS);
-extern Datum jsonb_cmp(PG_FUNCTION_ARGS);
-extern Datum jsonb_hash(PG_FUNCTION_ARGS);
-
-/* GIN support functions for jsonb_ops */
-extern Datum gin_compare_jsonb(PG_FUNCTION_ARGS);
-extern Datum gin_extract_jsonb(PG_FUNCTION_ARGS);
-extern Datum gin_extract_jsonb_query(PG_FUNCTION_ARGS);
-extern Datum gin_consistent_jsonb(PG_FUNCTION_ARGS);
-extern Datum gin_triconsistent_jsonb(PG_FUNCTION_ARGS);
-
-/* GIN support functions for jsonb_path_ops */
-extern Datum gin_extract_jsonb_path(PG_FUNCTION_ARGS);
-extern Datum gin_extract_jsonb_query_path(PG_FUNCTION_ARGS);
-extern Datum gin_consistent_jsonb_path(PG_FUNCTION_ARGS);
-extern Datum gin_triconsistent_jsonb_path(PG_FUNCTION_ARGS);
-
-/* pretty printer, returns text */
-extern Datum jsonb_pretty(PG_FUNCTION_ARGS);
-
-/* concatenation */
-extern Datum jsonb_concat(PG_FUNCTION_ARGS);
-
-/* deletion */
-extern Datum jsonb_delete(PG_FUNCTION_ARGS);
-extern Datum jsonb_delete_idx(PG_FUNCTION_ARGS);
-extern Datum jsonb_delete_path(PG_FUNCTION_ARGS);
-
-/* replacement */
-extern Datum jsonb_set(PG_FUNCTION_ARGS);
-
-/* insert after or before (for arrays) */
-extern Datum jsonb_insert(PG_FUNCTION_ARGS);
/* Support functions */
extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
diff --git a/src/include/utils/logtape.h b/src/include/utils/logtape.h
index fa1e992082..e802c4b213 100644
--- a/src/include/utils/logtape.h
+++ b/src/include/utils/logtape.h
@@ -5,7 +5,7 @@
*
* See logtape.c for explanations.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/logtape.h
@@ -31,11 +31,13 @@ extern size_t LogicalTapeRead(LogicalTapeSet *lts, int tapenum,
void *ptr, size_t size);
extern void LogicalTapeWrite(LogicalTapeSet *lts, int tapenum,
void *ptr, size_t size);
-extern void LogicalTapeRewind(LogicalTapeSet *lts, int tapenum, bool forWrite);
+extern void LogicalTapeRewindForRead(LogicalTapeSet *lts, int tapenum,
+ size_t buffer_size);
+extern void LogicalTapeRewindForWrite(LogicalTapeSet *lts, int tapenum);
extern void LogicalTapeFreeze(LogicalTapeSet *lts, int tapenum);
-extern bool LogicalTapeBackspace(LogicalTapeSet *lts, int tapenum,
+extern size_t LogicalTapeBackspace(LogicalTapeSet *lts, int tapenum,
size_t size);
-extern bool LogicalTapeSeek(LogicalTapeSet *lts, int tapenum,
+extern void LogicalTapeSeek(LogicalTapeSet *lts, int tapenum,
long blocknum, int offset);
extern void LogicalTapeTell(LogicalTapeSet *lts, int tapenum,
long *blocknum, int *offset);
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index f72233c335..8da59bbf3e 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -4,7 +4,7 @@
* Convenience routines for common queries in the system catalog cache.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/lsyscache.h
@@ -36,6 +36,28 @@ typedef enum IOFuncSelector
IOFunc_send
} IOFuncSelector;
+/* Flag bits for get_attstatsslot */
+#define ATTSTATSSLOT_VALUES 0x01
+#define ATTSTATSSLOT_NUMBERS 0x02
+
+/* Result struct for get_attstatsslot */
+typedef struct AttStatsSlot
+{
+ /* Always filled: */
+ Oid staop; /* Actual staop for the found slot */
+ /* Filled if ATTSTATSSLOT_VALUES is specified: */
+ Oid valuetype; /* Actual datatype of the values */
+ Datum *values; /* slot's "values" array, or NULL if none */
+ int nvalues; /* length of values[], or 0 */
+ /* Filled if ATTSTATSSLOT_NUMBERS is specified: */
+ float4 *numbers; /* slot's "numbers" array, or NULL if none */
+ int nnumbers; /* length of numbers[], or 0 */
+
+ /* Remaining fields are private to get_attstatsslot/free_attstatsslot */
+ void *values_arr; /* palloc'd values array, if any */
+ void *numbers_arr; /* palloc'd numbers array, if any */
+} AttStatsSlot;
+
/* Hook for plugins to get control in get_attavgwidth() */
typedef int32 (*get_attavgwidth_hook_type) (Oid relid, AttrNumber attnum);
extern PGDLLIMPORT get_attavgwidth_hook_type get_attavgwidth_hook;
@@ -65,6 +87,7 @@ extern Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype,
extern char *get_attname(Oid relid, AttrNumber attnum);
extern char *get_relid_attribute_name(Oid relid, AttrNumber attnum);
extern AttrNumber get_attnum(Oid relid, const char *attname);
+extern char get_attidentity(Oid relid, AttrNumber attnum);
extern Oid get_atttype(Oid relid, AttrNumber attnum);
extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
extern void get_atttypetypmodcoll(Oid relid, AttrNumber attnum,
@@ -167,18 +190,13 @@ extern bool is_pgxc_nodeprimary(Oid nodeid);
extern Oid get_pgxc_groupoid(const char *groupname);
extern int get_pgxc_groupmembers(Oid groupid, Oid **members);
extern int get_pgxc_classnodes(Oid tableid, Oid **nodes);
+extern char * get_pgxc_groupname(Oid groupid);
#endif
extern int32 get_typavgwidth(Oid typid, int32 typmod);
extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
-extern bool get_attstatsslot(HeapTuple statstuple,
- Oid atttype, int32 atttypmod,
- int reqkind, Oid reqop,
- Oid *actualop,
- Datum **values, int *nvalues,
- float4 **numbers, int *nnumbers);
-extern void free_attstatsslot(Oid atttype,
- Datum *values, int nvalues,
- float4 *numbers, int nnumbers);
+extern bool get_attstatsslot(AttStatsSlot *sslot, HeapTuple statstuple,
+ int reqkind, Oid reqop, int flags);
+extern void free_attstatsslot(AttStatsSlot *sslot);
extern char *get_namespace_name(Oid nspid);
#ifdef XCP
extern Oid get_namespaceid(const char *nspname);
diff --git a/src/include/utils/memdebug.h b/src/include/utils/memdebug.h
index 96b5baf5a0..206e6ce002 100644
--- a/src/include/utils/memdebug.h
+++ b/src/include/utils/memdebug.h
@@ -7,7 +7,7 @@
* empty definitions for Valgrind client request macros we use.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/memdebug.h
@@ -31,4 +31,52 @@
#define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size) do {} while (0)
#endif
+
+#ifdef CLOBBER_FREED_MEMORY
+
+/* Wipe freed memory for debugging purposes */
+static inline void
+wipe_mem(void *ptr, size_t size)
+{
+ VALGRIND_MAKE_MEM_UNDEFINED(ptr, size);
+ memset(ptr, 0x7F, size);
+ VALGRIND_MAKE_MEM_NOACCESS(ptr, size);
+}
+
+#endif /* CLOBBER_FREED_MEMORY */
+
+#ifdef MEMORY_CONTEXT_CHECKING
+
+static inline void
+set_sentinel(void *base, Size offset)
+{
+ char *ptr = (char *) base + offset;
+
+ VALGRIND_MAKE_MEM_UNDEFINED(ptr, 1);
+ *ptr = 0x7E;
+ VALGRIND_MAKE_MEM_NOACCESS(ptr, 1);
+}
+
+static inline bool
+sentinel_ok(const void *base, Size offset)
+{
+ const char *ptr = (const char *) base + offset;
+ bool ret;
+
+ VALGRIND_MAKE_MEM_DEFINED(ptr, 1);
+ ret = *ptr == 0x7E;
+ VALGRIND_MAKE_MEM_NOACCESS(ptr, 1);
+
+ return ret;
+}
+
+#endif /* MEMORY_CONTEXT_CHECKING */
+
+#ifdef RANDOMIZE_ALLOCATED_MEMORY
+
+void randomize_mem(char *ptr, size_t size);
+
+#endif /* RANDOMIZE_ALLOCATED_MEMORY */
+
+
#endif /* MEMDEBUG_H */
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h
index ae07705b6b..58e816d8e9 100644
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -7,7 +7,7 @@
* of the API of the memory management subsystem.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/memutils.h
@@ -45,27 +45,6 @@
#define AllocHugeSizeIsValid(size) ((Size) (size) <= MaxAllocHugeSize)
-/*
- * All chunks allocated by any memory context manager are required to be
- * preceded by a StandardChunkHeader at a spacing of STANDARDCHUNKHEADERSIZE.
- * A currently-allocated chunk must contain a backpointer to its owning
- * context as well as the allocated size of the chunk. The backpointer is
- * used by pfree() and repalloc() to find the context to call. The allocated
- * size is not absolutely essential, but it's expected to be needed by any
- * reasonable implementation.
- */
-typedef struct StandardChunkHeader
-{
- MemoryContext context; /* owning context */
- Size size; /* size of data space allocated in chunk */
-#ifdef MEMORY_CONTEXT_CHECKING
- /* when debugging memory usage, also store actual requested size */
- Size requested_size;
-#endif
-} StandardChunkHeader;
-
-#define STANDARDCHUNKHEADERSIZE MAXALIGN(sizeof(StandardChunkHeader))
-
/*
* Standard top-level memory contexts.
@@ -100,7 +79,6 @@ extern void MemoryContextDeleteChildren(MemoryContext context);
extern void MemoryContextSetParent(MemoryContext context,
MemoryContext new_parent);
extern Size GetMemoryChunkSpace(void *pointer);
-extern MemoryContext GetMemoryChunkContext(void *pointer);
extern MemoryContext MemoryContextGetParent(MemoryContext context);
extern bool MemoryContextIsEmpty(MemoryContext context);
extern void MemoryContextStats(MemoryContext context);
@@ -114,6 +92,42 @@ extern void MemoryContextCheck(MemoryContext context);
extern bool MemoryContextContains(MemoryContext context, void *pointer);
/*
+ * GetMemoryChunkContext
+ * Given a currently-allocated chunk, determine the context
+ * it belongs to.
+ *
+ * All chunks allocated by any memory context manager are required to be
+ * preceded by the corresponding MemoryContext stored, without padding, in the
+ * preceding sizeof(void*) bytes. A currently-allocated chunk must contain a
+ * backpointer to its owning context. The backpointer is used by pfree() and
+ * repalloc() to find the context to call.
+ */
+#ifndef FRONTEND
+static inline MemoryContext
+GetMemoryChunkContext(void *pointer)
+{
+ MemoryContext context;
+
+ /*
+ * Try to detect bogus pointers handed to us, poorly though we can.
+ * Presumably, a pointer that isn't MAXALIGNED isn't pointing at an
+ * allocated chunk.
+ */
+ Assert(pointer != NULL);
+ Assert(pointer == (void *) MAXALIGN(pointer));
+
+ /*
+ * OK, it's probably safe to look at the context.
+ */
+ context = *(MemoryContext *) (((char *) pointer) - sizeof(void *));
+
+ AssertArg(MemoryContextIsValid(context));
+
+ return context;
+}
+#endif
+
+/*
* This routine handles the context-type-independent part of memory
* context creation. It's intended to be called from context-type-
* specific creation routines, and noplace else.
@@ -135,6 +149,12 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
Size initBlockSize,
Size maxBlockSize);
+/* slab.c */
+extern MemoryContext SlabContextCreate(MemoryContext parent,
+ const char *name,
+ Size blockSize,
+ Size chunkSize);
+
/*
* Recommended default alloc parameters, suitable for "ordinary" contexts
* that might hold quite a lot of data.
@@ -142,14 +162,26 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
#define ALLOCSET_DEFAULT_MINSIZE 0
#define ALLOCSET_DEFAULT_INITSIZE (8 * 1024)
#define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024)
+#define ALLOCSET_DEFAULT_SIZES \
+ ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
/*
- * Recommended alloc parameters for "small" contexts that are not expected
+ * Recommended alloc parameters for "small" contexts that are never expected
* to contain much data (for example, a context to contain a query plan).
*/
#define ALLOCSET_SMALL_MINSIZE 0
#define ALLOCSET_SMALL_INITSIZE (1 * 1024)
#define ALLOCSET_SMALL_MAXSIZE (8 * 1024)
+#define ALLOCSET_SMALL_SIZES \
+ ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE
+
+/*
+ * Recommended alloc parameters for contexts that should start out small,
+ * but might sometimes grow big.
+ */
+#define ALLOCSET_START_SMALL_SIZES \
+ ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
+
/*
* Threshold above which a request in an AllocSet context is certain to be
@@ -159,4 +191,7 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
*/
#define ALLOCSET_SEPARATE_THRESHOLD 8192
+#define SLAB_DEFAULT_BLOCK_SIZE (8 * 1024)
+#define SLAB_LARGE_BLOCK_SIZE (8 * 1024 * 1024)
+
#endif /* MEMUTILS_H */
diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h
index d06f6f82e7..4b0706a316 100644
--- a/src/include/utils/nabstime.h
+++ b/src/include/utils/nabstime.h
@@ -4,7 +4,7 @@
* Definitions for the "new" abstime code.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/nabstime.h
@@ -96,69 +96,6 @@ typedef TimeIntervalData *TimeInterval;
((bool) (((RelativeTime) (time)) != INVALID_RELTIME))
-/*
- * nabstime.c prototypes
- */
-extern Datum abstimein(PG_FUNCTION_ARGS);
-extern Datum abstimeout(PG_FUNCTION_ARGS);
-extern Datum abstimerecv(PG_FUNCTION_ARGS);
-extern Datum abstimesend(PG_FUNCTION_ARGS);
-
-extern Datum abstimeeq(PG_FUNCTION_ARGS);
-extern Datum abstimene(PG_FUNCTION_ARGS);
-extern Datum abstimelt(PG_FUNCTION_ARGS);
-extern Datum abstimegt(PG_FUNCTION_ARGS);
-extern Datum abstimele(PG_FUNCTION_ARGS);
-extern Datum abstimege(PG_FUNCTION_ARGS);
-extern Datum abstime_finite(PG_FUNCTION_ARGS);
-
-extern Datum timestamp_abstime(PG_FUNCTION_ARGS);
-extern Datum abstime_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_abstime(PG_FUNCTION_ARGS);
-extern Datum abstime_timestamptz(PG_FUNCTION_ARGS);
-
-extern Datum reltimein(PG_FUNCTION_ARGS);
-extern Datum reltimeout(PG_FUNCTION_ARGS);
-extern Datum reltimerecv(PG_FUNCTION_ARGS);
-extern Datum reltimesend(PG_FUNCTION_ARGS);
-extern Datum tintervalin(PG_FUNCTION_ARGS);
-extern Datum tintervalout(PG_FUNCTION_ARGS);
-extern Datum tintervalrecv(PG_FUNCTION_ARGS);
-extern Datum tintervalsend(PG_FUNCTION_ARGS);
-extern Datum interval_reltime(PG_FUNCTION_ARGS);
-extern Datum reltime_interval(PG_FUNCTION_ARGS);
-extern Datum mktinterval(PG_FUNCTION_ARGS);
-extern Datum timepl(PG_FUNCTION_ARGS);
-extern Datum timemi(PG_FUNCTION_ARGS);
-
-extern Datum intinterval(PG_FUNCTION_ARGS);
-extern Datum tintervalrel(PG_FUNCTION_ARGS);
-extern Datum timenow(PG_FUNCTION_ARGS);
-extern Datum reltimeeq(PG_FUNCTION_ARGS);
-extern Datum reltimene(PG_FUNCTION_ARGS);
-extern Datum reltimelt(PG_FUNCTION_ARGS);
-extern Datum reltimegt(PG_FUNCTION_ARGS);
-extern Datum reltimele(PG_FUNCTION_ARGS);
-extern Datum reltimege(PG_FUNCTION_ARGS);
-extern Datum tintervalsame(PG_FUNCTION_ARGS);
-extern Datum tintervaleq(PG_FUNCTION_ARGS);
-extern Datum tintervalne(PG_FUNCTION_ARGS);
-extern Datum tintervallt(PG_FUNCTION_ARGS);
-extern Datum tintervalgt(PG_FUNCTION_ARGS);
-extern Datum tintervalle(PG_FUNCTION_ARGS);
-extern Datum tintervalge(PG_FUNCTION_ARGS);
-extern Datum tintervalleneq(PG_FUNCTION_ARGS);
-extern Datum tintervallenne(PG_FUNCTION_ARGS);
-extern Datum tintervallenlt(PG_FUNCTION_ARGS);
-extern Datum tintervallengt(PG_FUNCTION_ARGS);
-extern Datum tintervallenle(PG_FUNCTION_ARGS);
-extern Datum tintervallenge(PG_FUNCTION_ARGS);
-extern Datum tintervalct(PG_FUNCTION_ARGS);
-extern Datum tintervalov(PG_FUNCTION_ARGS);
-extern Datum tintervalstart(PG_FUNCTION_ARGS);
-extern Datum tintervalend(PG_FUNCTION_ARGS);
-extern Datum timeofday(PG_FUNCTION_ARGS);
-
/* non-fmgr-callable support routines */
extern AbsoluteTime GetCurrentAbsoluteTime(void);
extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm * tm, char **tzn);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 6c1808ec71..0ab57d7025 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -5,7 +5,7 @@
*
* Original coding 1998, Jan Wieck. Heavily revised 2003, Tom Lane.
*
- * Copyright (c) 1998-2016, PostgreSQL Global Development Group
+ * Copyright (c) 1998-2017, PostgreSQL Global Development Group
*
* src/include/utils/numeric.h
*
diff --git a/src/include/utils/palloc.h b/src/include/utils/palloc.h
index 9be59d1055..2e07bd57ad 100644
--- a/src/include/utils/palloc.h
+++ b/src/include/utils/palloc.h
@@ -18,7 +18,7 @@
* everything that should be freed. See utils/mmgr/README for more info.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/palloc.h
@@ -127,6 +127,8 @@ extern char *MemoryContextStrdup(MemoryContext context, const char *string);
extern char *pstrdup(const char *in);
extern char *pnstrdup(const char *in, Size len);
+extern char *pchomp(const char *in);
+
/* sprintf into a palloc'd buffer --- these are in psprintf.c */
extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2);
extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
diff --git a/src/include/utils/pg_crc.h b/src/include/utils/pg_crc.h
index a9401f9bd7..2fe083850a 100644
--- a/src/include/utils/pg_crc.h
+++ b/src/include/utils/pg_crc.h
@@ -26,7 +26,7 @@
*
* The CRC-32C variant is in port/pg_crc32c.h.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/pg_crc.h
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h
index 0a4b9f7bd2..f0acc86b88 100644
--- a/src/include/utils/pg_locale.h
+++ b/src/include/utils/pg_locale.h
@@ -4,7 +4,7 @@
*
* src/include/utils/pg_locale.h
*
- * Copyright (c) 2002-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2002-2017, PostgreSQL Global Development Group
*
*-----------------------------------------------------------------------
*/
@@ -12,10 +12,12 @@
#ifndef _PG_LOCALE_
#define _PG_LOCALE_
-#include <locale.h>
#if defined(LOCALE_T_IN_XLOCALE) || defined(WCSTOMBS_L_IN_XLOCALE)
#include <xlocale.h>
#endif
+#ifdef USE_ICU
+#include <unicode/ucol.h>
+#endif
#include "utils/guc.h"
@@ -62,17 +64,38 @@ extern void cache_locale_time(void);
* We define our own wrapper around locale_t so we can keep the same
* function signatures for all builds, while not having to create a
* fake version of the standard type locale_t in the global namespace.
- * The fake version of pg_locale_t can be checked for truth; that's
- * about all it will be needed for.
+ * pg_locale_t is occasionally checked for truth, so make it a pointer.
*/
+struct pg_locale_struct
+{
+ char provider;
+ union
+ {
#ifdef HAVE_LOCALE_T
-typedef locale_t pg_locale_t;
-#else
-typedef int pg_locale_t;
+ locale_t lt;
+#endif
+#ifdef USE_ICU
+ struct
+ {
+ const char *locale;
+ UCollator *ucol;
+ } icu;
#endif
+ int dummy; /* in case we have neither LOCALE_T nor ICU */
+ } info;
+};
+
+typedef struct pg_locale_struct *pg_locale_t;
extern pg_locale_t pg_newlocale_from_collation(Oid collid);
+extern char *get_collation_actual_version(char collprovider, const char *collcollate);
+
+#ifdef USE_ICU
+extern int32_t icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes);
+extern int32_t icu_from_uchar(char **result, UChar *buff_uchar, int32_t len_uchar);
+#endif
+
/* These functions convert from/to libc's wchar_t, *not* pg_wchar_t */
#ifdef USE_WIDE_UPPER_LOWER
extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen,
diff --git a/src/include/utils/pg_lsn.h b/src/include/utils/pg_lsn.h
index 772fd6adf5..6f038e9e14 100644
--- a/src/include/utils/pg_lsn.h
+++ b/src/include/utils/pg_lsn.h
@@ -5,7 +5,7 @@
* PostgreSQL.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/pg_lsn.h
@@ -18,22 +18,6 @@
#include "fmgr.h"
#include "access/xlogdefs.h"
-extern Datum pg_lsn_in(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_out(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_recv(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_send(PG_FUNCTION_ARGS);
-
-extern Datum pg_lsn_eq(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_ne(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_lt(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_gt(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_le(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_ge(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_cmp(PG_FUNCTION_ARGS);
-extern Datum pg_lsn_hash(PG_FUNCTION_ARGS);
-
-extern Datum pg_lsn_mi(PG_FUNCTION_ARGS);
-
#define DatumGetLSN(X) ((XLogRecPtr) DatumGetInt64(X))
#define LSNGetDatum(X) (Int64GetDatum((int64) (X)))
diff --git a/src/include/utils/pg_rusage.h b/src/include/utils/pg_rusage.h
index 7c264eb6b1..48a74e90ba 100644
--- a/src/include/utils/pg_rusage.h
+++ b/src/include/utils/pg_rusage.h
@@ -4,7 +4,7 @@
* header file for resource usage measurement support routines
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/pg_rusage.h
diff --git a/src/include/utils/plancache.h b/src/include/utils/plancache.h
index 41b10ab372..fbb271ed1c 100644
--- a/src/include/utils/plancache.h
+++ b/src/include/utils/plancache.h
@@ -6,7 +6,7 @@
* See plancache.c for comments.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/plancache.h
@@ -18,6 +18,10 @@
#include "access/tupdesc.h"
#include "nodes/params.h"
+#include "utils/queryenvironment.h"
+
+/* Forward declaration, to avoid including parsenodes.h here */
+struct RawStmt;
#define CACHEDPLANSOURCE_MAGIC 195726186
#define CACHEDPLAN_MAGIC 953717834
@@ -77,7 +81,7 @@
typedef struct CachedPlanSource
{
int magic; /* should equal CACHEDPLANSOURCE_MAGIC */
- Node *raw_parse_tree; /* output of raw_parser(), or NULL */
+ struct RawStmt *raw_parse_tree; /* output of raw_parser(), or NULL */
const char *query_string; /* source text of query */
const char *commandTag; /* command tag (a constant!), or NULL */
Oid *param_types; /* array of parameter type OIDs, or NULL */
@@ -130,8 +134,7 @@ typedef struct CachedPlanSource
typedef struct CachedPlan
{
int magic; /* should equal CACHEDPLAN_MAGIC */
- List *stmt_list; /* list of statement nodes (PlannedStmts and
- * bare utility statements) */
+ List *stmt_list; /* list of PlannedStmts */
bool is_oneshot; /* is it a "oneshot" plan? */
bool is_saved; /* is CachedPlan in a long-lived context? */
bool is_valid; /* is the stmt_list currently valid? */
@@ -148,13 +151,13 @@ typedef struct CachedPlan
extern void InitPlanCache(void);
extern void ResetPlanCache(void);
-extern CachedPlanSource *CreateCachedPlan(Node *raw_parse_tree,
+extern CachedPlanSource *CreateCachedPlan(struct RawStmt *raw_parse_tree,
const char *query_string,
#ifdef PGXC
const char *stmt_name,
#endif
const char *commandTag);
-extern CachedPlanSource *CreateOneShotCachedPlan(Node *raw_parse_tree,
+extern CachedPlanSource *CreateOneShotCachedPlan(struct RawStmt *raw_parse_tree,
const char *query_string,
const char *commandTag);
extern void CompleteCachedPlan(CachedPlanSource *plansource,
@@ -177,11 +180,13 @@ extern CachedPlanSource *CopyCachedPlan(CachedPlanSource *plansource);
extern bool CachedPlanIsValid(CachedPlanSource *plansource);
-extern List *CachedPlanGetTargetList(CachedPlanSource *plansource);
+extern List *CachedPlanGetTargetList(CachedPlanSource *plansource,
+ QueryEnvironment *queryEnv);
extern CachedPlan *GetCachedPlan(CachedPlanSource *plansource,
ParamListInfo boundParams,
- bool useResOwner);
+ bool useResOwner,
+ QueryEnvironment *queryEnv);
extern void ReleaseCachedPlan(CachedPlan *plan, bool useResOwner);
#ifdef XCP
extern void SetRemoteSubplan(CachedPlanSource *plansource,
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index ba11a5cf5f..c9ce886483 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -37,7 +37,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/portal.h
@@ -138,14 +138,16 @@ typedef struct PortalData
/* The query or queries the portal will execute */
const char *sourceText; /* text of query (as of 8.4, never NULL) */
const char *commandTag; /* command tag for original query */
- List *stmts; /* PlannedStmts and/or utility statements */
+ List *stmts; /* list of PlannedStmts */
CachedPlan *cplan; /* CachedPlan, if stmts are from one */
ParamListInfo portalParams; /* params to pass to query */
+ QueryEnvironment *queryEnv; /* environment for query */
/* Features/options */
PortalStrategy strategy; /* see above */
int cursorOptions; /* DECLARE CURSOR option bits */
+ bool run_once; /* portal will only be run once */
/* Status data */
PortalStatus status; /* see above */
@@ -209,7 +211,6 @@ typedef struct PortalData
*/
#define PortalGetQueryDesc(portal) ((portal)->queryDesc)
#define PortalGetHeapMemory(portal) ((portal)->heap)
-#define PortalGetPrimaryStmt(portal) PortalListGetPrimaryStmt((portal)->stmts)
/* Prototypes for functions in utils/mmgr/portalmem.c */
@@ -240,7 +241,7 @@ extern void PortalDefineQuery(Portal portal,
const char *commandTag,
List *stmts,
CachedPlan *cplan);
-extern Node *PortalListGetPrimaryStmt(List *stmts);
+extern PlannedStmt *PortalGetPrimaryStmt(Portal portal);
extern void PortalCreateHoldStore(Portal portal);
extern void PortalHashTableDeleteAll(void);
#ifdef XCP
diff --git a/src/include/utils/queryenvironment.h b/src/include/utils/queryenvironment.h
new file mode 100644
index 0000000000..291b6fdbc2
--- /dev/null
+++ b/src/include/utils/queryenvironment.h
@@ -0,0 +1,74 @@
+/*-------------------------------------------------------------------------
+ *
+ * queryenvironment.h
+ * Access to functions to mutate the query environment and retrieve the
+ * actual data related to entries (if any).
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/utils/queryenvironment.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef QUERYENVIRONMENT_H
+#define QUERYENVIRONMENT_H
+
+#include "access/tupdesc.h"
+
+
+typedef enum EphemeralNameRelationType
+{
+ ENR_NAMED_TUPLESTORE /* named tuplestore relation; e.g., deltas */
+} EphemeralNameRelationType;
+
+/*
+ * Some ephemeral named relations must match some relation (e.g., trigger
+ * transition tables), so to properly handle cached plans and DDL, we should
+ * carry the OID of that relation. In other cases an ENR might be independent
+ * of any relation which is stored in the system catalogs, so we need to be
+ * able to directly store the TupleDesc. We never need both.
+ */
+typedef struct EphemeralNamedRelationMetadataData
+{
+ char *name; /* name used to identify the relation */
+
+ /* only one of the next two fields should be used */
+ Oid reliddesc; /* oid of relation to get tupdesc */
+ TupleDesc tupdesc; /* description of result rows */
+
+ EphemeralNameRelationType enrtype; /* to identify type of relation */
+ double enrtuples; /* estimated number of tuples */
+} EphemeralNamedRelationMetadataData;
+
+typedef EphemeralNamedRelationMetadataData *EphemeralNamedRelationMetadata;
+
+/*
+ * Ephemeral Named Relation data; used for parsing named relations not in the
+ * catalog, like transition tables in AFTER triggers.
+ */
+typedef struct EphemeralNamedRelationData
+{
+ EphemeralNamedRelationMetadataData md;
+ void *reldata; /* structure for execution-time access to data */
+} EphemeralNamedRelationData;
+
+typedef EphemeralNamedRelationData *EphemeralNamedRelation;
+
+/*
+ * This is an opaque structure outside of queryenvironment.c itself. The
+ * intention is to be able to change the implementation or add new context
+ * features without needing to change existing code for use of existing
+ * features.
+ */
+typedef struct QueryEnvironment QueryEnvironment;
+
+
+extern QueryEnvironment *create_queryEnv(void);
+extern EphemeralNamedRelationMetadata get_visible_ENR_metadata(QueryEnvironment *queryEnv, const char *refname);
+extern void register_ENR(QueryEnvironment *queryEnv, EphemeralNamedRelation enr);
+extern void unregister_ENR(QueryEnvironment *queryEnv, const char *name);
+extern EphemeralNamedRelation get_ENR(QueryEnvironment *queryEnv, const char *name);
+extern TupleDesc ENRMetadataGetTupDesc(EphemeralNamedRelationMetadata enrmd);
+
+#endif /* QUERYENVIRONMENT_H */
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h
index a774ca0e80..abb2223ec5 100644
--- a/src/include/utils/rangetypes.h
+++ b/src/include/utils/rangetypes.h
@@ -4,7 +4,7 @@
* Declarations for Postgres range types.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/rangetypes.h
@@ -92,45 +92,8 @@ typedef struct
* prototypes for functions defined in rangetypes.c
*/
-/* I/O */
-extern Datum range_in(PG_FUNCTION_ARGS);
-extern Datum range_out(PG_FUNCTION_ARGS);
-extern Datum range_recv(PG_FUNCTION_ARGS);
-extern Datum range_send(PG_FUNCTION_ARGS);
-
-/* constructors */
-extern Datum range_constructor2(PG_FUNCTION_ARGS);
-extern Datum range_constructor3(PG_FUNCTION_ARGS);
-
-/* range -> subtype */
-extern Datum range_lower(PG_FUNCTION_ARGS);
-extern Datum range_upper(PG_FUNCTION_ARGS);
-
-/* range -> bool */
-extern Datum range_empty(PG_FUNCTION_ARGS);
-extern Datum range_lower_inc(PG_FUNCTION_ARGS);
-extern Datum range_upper_inc(PG_FUNCTION_ARGS);
-extern Datum range_lower_inf(PG_FUNCTION_ARGS);
-extern Datum range_upper_inf(PG_FUNCTION_ARGS);
-
-/* range, element -> bool */
-extern Datum range_contains_elem(PG_FUNCTION_ARGS);
-extern Datum elem_contained_by_range(PG_FUNCTION_ARGS);
-
extern bool range_contains_elem_internal(TypeCacheEntry *typcache, RangeType *r, Datum val);
-/* range, range -> bool */
-extern Datum range_eq(PG_FUNCTION_ARGS);
-extern Datum range_ne(PG_FUNCTION_ARGS);
-extern Datum range_contains(PG_FUNCTION_ARGS);
-extern Datum range_contained_by(PG_FUNCTION_ARGS);
-extern Datum range_before(PG_FUNCTION_ARGS);
-extern Datum range_after(PG_FUNCTION_ARGS);
-extern Datum range_adjacent(PG_FUNCTION_ARGS);
-extern Datum range_overlaps(PG_FUNCTION_ARGS);
-extern Datum range_overleft(PG_FUNCTION_ARGS);
-extern Datum range_overright(PG_FUNCTION_ARGS);
-
/* internal versions of the above */
extern bool range_eq_internal(TypeCacheEntry *typcache, RangeType *r1,
RangeType *r2);
@@ -153,38 +116,6 @@ extern bool range_overleft_internal(TypeCacheEntry *typcache, RangeType *r1,
extern bool range_overright_internal(TypeCacheEntry *typcache, RangeType *r1,
RangeType *r2);
-/* range, range -> range */
-extern Datum range_minus(PG_FUNCTION_ARGS);
-extern Datum range_union(PG_FUNCTION_ARGS);
-extern Datum range_intersect(PG_FUNCTION_ARGS);
-
-/* BTree support */
-extern Datum range_cmp(PG_FUNCTION_ARGS);
-extern Datum range_lt(PG_FUNCTION_ARGS);
-extern Datum range_le(PG_FUNCTION_ARGS);
-extern Datum range_ge(PG_FUNCTION_ARGS);
-extern Datum range_gt(PG_FUNCTION_ARGS);
-
-/* Hash support */
-extern Datum hash_range(PG_FUNCTION_ARGS);
-
-/* ANALYZE support */
-extern Datum range_typanalyze(PG_FUNCTION_ARGS);
-extern Datum rangesel(PG_FUNCTION_ARGS);
-
-/* Canonical functions */
-extern Datum int4range_canonical(PG_FUNCTION_ARGS);
-extern Datum int8range_canonical(PG_FUNCTION_ARGS);
-extern Datum daterange_canonical(PG_FUNCTION_ARGS);
-
-/* Subtype Difference functions */
-extern Datum int4range_subdiff(PG_FUNCTION_ARGS);
-extern Datum int8range_subdiff(PG_FUNCTION_ARGS);
-extern Datum numrange_subdiff(PG_FUNCTION_ARGS);
-extern Datum daterange_subdiff(PG_FUNCTION_ARGS);
-extern Datum tsrange_subdiff(PG_FUNCTION_ARGS);
-extern Datum tstzrange_subdiff(PG_FUNCTION_ARGS);
-
/* assorted support functions */
extern TypeCacheEntry *range_get_typcache(FunctionCallInfo fcinfo,
Oid rngtypid);
@@ -205,15 +136,4 @@ extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1,
RangeBound bound2);
extern RangeType *make_empty_range(TypeCacheEntry *typcache);
-/* GiST support (in rangetypes_gist.c) */
-extern Datum range_gist_consistent(PG_FUNCTION_ARGS);
-extern Datum range_gist_compress(PG_FUNCTION_ARGS);
-extern Datum range_gist_decompress(PG_FUNCTION_ARGS);
-extern Datum range_gist_fetch(PG_FUNCTION_ARGS);
-extern Datum range_gist_union(PG_FUNCTION_ARGS);
-extern Datum range_merge(PG_FUNCTION_ARGS);
-extern Datum range_gist_penalty(PG_FUNCTION_ARGS);
-extern Datum range_gist_picksplit(PG_FUNCTION_ARGS);
-extern Datum range_gist_same(PG_FUNCTION_ARGS);
-
#endif /* RANGETYPES_H */
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h
new file mode 100644
index 0000000000..ba46bd7d58
--- /dev/null
+++ b/src/include/utils/regproc.h
@@ -0,0 +1,28 @@
+/*-------------------------------------------------------------------------
+ *
+ * regproc.h
+ * Functions for the built-in types regproc, regclass, regtype, etc.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/utils/regproc.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef REGPROC_H
+#define REGPROC_H
+
+#include "nodes/pg_list.h"
+
+extern List *stringToQualifiedNameList(const char *string);
+extern char *format_procedure(Oid procedure_oid);
+extern char *format_procedure_qualified(Oid procedure_oid);
+extern void format_procedure_parts(Oid operator_oid, List **objnames,
+ List **objargs);
+extern char *format_operator(Oid operator_oid);
+extern char *format_operator_qualified(Oid operator_oid);
+extern void format_operator_parts(Oid operator_oid, List **objnames,
+ List **objargs);
+
+#endif
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 6145b0ecc1..dd5de58fef 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -5,7 +5,7 @@
*
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -20,6 +20,7 @@
#include "access/xlog.h"
#include "catalog/pg_class.h"
#include "catalog/pg_index.h"
+#include "catalog/pg_publication.h"
#include "fmgr.h"
#include "nodes/bitmapset.h"
#include "pgxc/locator.h"
@@ -47,6 +48,35 @@ typedef struct LockInfoData
typedef LockInfoData *LockInfo;
+/*
+ * Information about the partition key of a relation
+ */
+typedef struct PartitionKeyData
+{
+ char strategy; /* partitioning strategy */
+ int16 partnatts; /* number of columns in the partition key */
+ AttrNumber *partattrs; /* attribute numbers of columns in the
+ * partition key */
+ List *partexprs; /* list of expressions in the partitioning
+ * key, or NIL */
+
+ Oid *partopfamily; /* OIDs of operator families */
+ Oid *partopcintype; /* OIDs of opclass declared input data types */
+ FmgrInfo *partsupfunc; /* lookup info for support funcs */
+
+ /* Partitioning collation per attribute */
+ Oid *partcollation;
+
+ /* Type information per attribute */
+ Oid *parttypid;
+ int32 *parttypmod;
+ int16 *parttyplen;
+ bool *parttypbyval;
+ char *parttypalign;
+ Oid *parttypcoll;
+} PartitionKeyData;
+
+typedef struct PartitionKeyData *PartitionKey;
/*
* Here are the contents of a relation cache entry.
@@ -64,6 +94,7 @@ typedef struct RelationData
bool rd_isvalid; /* relcache entry is valid */
char rd_indexvalid; /* state of rd_indexlist: 0 = not valid, 1 =
* valid, 2 = temporarily forced */
+ bool rd_statvalid; /* is rd_statlist valid? */
/*
* rd_createSubid is the ID of the highest subtransaction the rel has
@@ -96,16 +127,29 @@ typedef struct RelationData
List *rd_fkeylist; /* list of ForeignKeyCacheInfo (see below) */
bool rd_fkeyvalid; /* true if list has been computed */
+ MemoryContext rd_partkeycxt; /* private memory cxt for the below */
+ struct PartitionKeyData *rd_partkey; /* partition key, or NULL */
+ MemoryContext rd_pdcxt; /* private context for partdesc */
+ struct PartitionDescData *rd_partdesc; /* partitions, or NULL */
+ List *rd_partcheck; /* partition CHECK quals */
+
/* data managed by RelationGetIndexList: */
List *rd_indexlist; /* list of OIDs of indexes on relation */
Oid rd_oidindex; /* OID of unique index on OID, if any */
+ Oid rd_pkindex; /* OID of primary key, if any */
Oid rd_replidindex; /* OID of replica identity index, if any */
+ /* data managed by RelationGetStatExtList: */
+ List *rd_statlist; /* list of OIDs of extended stats */
+
/* data managed by RelationGetIndexAttrBitmap: */
Bitmapset *rd_indexattr; /* identifies columns used in indexes */
Bitmapset *rd_keyattr; /* cols that can be ref'd by foreign keys */
+ Bitmapset *rd_pkattr; /* cols included in primary key */
Bitmapset *rd_idattr; /* included in replica identity index */
+ PublicationActions *rd_pubactions; /* publication actions */
+
/*
* rd_options is set whenever rd_rel is loaded into the relcache entry.
* Note that you can NOT look into rd_rel for this data. NULL means "use
@@ -275,7 +319,9 @@ typedef struct StdRdOptions
* from the pov of logical decoding. Note multiple eval of argument!
*/
#define RelationIsUsedAsCatalogTable(relation) \
- ((relation)->rd_options ? \
+ ((relation)->rd_options && \
+ ((relation)->rd_rel->relkind == RELKIND_RELATION || \
+ (relation)->rd_rel->relkind == RELKIND_MATVIEW) ? \
((StdRdOptions *) (relation)->rd_options)->user_catalog_table : false)
/*
@@ -585,9 +631,64 @@ typedef struct ViewOptions
RelationNeedsWAL(relation) && \
!IsCatalogRelation(relation))
+/*
+ * RelationGetPartitionKey
+ * Returns the PartitionKey of a relation
+ */
+#define RelationGetPartitionKey(relation) ((relation)->rd_partkey)
+
+/*
+ * PartitionKey inquiry functions
+ */
+static inline int
+get_partition_strategy(PartitionKey key)
+{
+ return key->strategy;
+}
+
+static inline int
+get_partition_natts(PartitionKey key)
+{
+ return key->partnatts;
+}
+
+static inline List *
+get_partition_exprs(PartitionKey key)
+{
+ return key->partexprs;
+}
+
+/*
+ * PartitionKey inquiry functions - one column
+ */
+static inline int16
+get_partition_col_attnum(PartitionKey key, int col)
+{
+ return key->partattrs[col];
+}
+
+static inline Oid
+get_partition_col_typid(PartitionKey key, int col)
+{
+ return key->parttypid[col];
+}
+
+static inline int32
+get_partition_col_typmod(PartitionKey key, int col)
+{
+ return key->parttypmod[col];
+}
+
+/*
+ * RelationGetPartitionDesc
+ * Returns partition descriptor for a relation.
+ */
+#define RelationGetPartitionDesc(relation) ((relation)->rd_partdesc)
+
/* routines in utils/cache/relcache.c */
extern void RelationIncrementReferenceCount(Relation rel);
extern void RelationDecrementReferenceCount(Relation rel);
extern bool RelationHasUnloggedIndex(Relation rel);
+extern List *RelationGetRepsetList(Relation rel);
#endif /* REL_H */
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index 6ea7dd2510..81af3aebb8 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -4,7 +4,7 @@
* Relation descriptor cache definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/relcache.h
@@ -39,7 +39,9 @@ extern void RelationClose(Relation relation);
*/
extern List *RelationGetFKeyList(Relation relation);
extern List *RelationGetIndexList(Relation relation);
+extern List *RelationGetStatExtList(Relation relation);
extern Oid RelationGetOidIndex(Relation relation);
+extern Oid RelationGetPrimaryKeyIndex(Relation relation);
extern Oid RelationGetReplicaIndex(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);
extern List *RelationGetIndexPredicate(Relation relation);
@@ -48,6 +50,7 @@ typedef enum IndexAttrBitmapKind
{
INDEX_ATTR_BITMAP_ALL,
INDEX_ATTR_BITMAP_KEY,
+ INDEX_ATTR_BITMAP_PRIMARY_KEY,
INDEX_ATTR_BITMAP_IDENTITY_KEY
} IndexAttrBitmapKind;
@@ -64,6 +67,10 @@ extern void RelationSetIndexList(Relation relation,
extern void RelationInitIndexAccessInfo(Relation relation);
+/* caller must include pg_publication.h */
+struct PublicationActions;
+extern struct PublicationActions *GetRelationPublicationActions(Relation relation);
+
/*
* Routines to support ereport() reports of relation-related errors
*/
diff --git a/src/include/utils/relfilenodemap.h b/src/include/utils/relfilenodemap.h
index e3e14feea5..0827ff3db8 100644
--- a/src/include/utils/relfilenodemap.h
+++ b/src/include/utils/relfilenodemap.h
@@ -3,7 +3,7 @@
* relfilenodemap.h
* relfilenode to oid mapping cache.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/relfilenodemap.h
diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h
index 22c5118ded..8fb2879ff9 100644
--- a/src/include/utils/relmapper.h
+++ b/src/include/utils/relmapper.h
@@ -4,7 +4,7 @@
* Catalog-to-filenode mapping
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/relmapper.h
diff --git a/src/include/utils/relptr.h b/src/include/utils/relptr.h
new file mode 100644
index 0000000000..1e5e622150
--- /dev/null
+++ b/src/include/utils/relptr.h
@@ -0,0 +1,77 @@
+/*-------------------------------------------------------------------------
+ *
+ * relptr.h
+ * This file contains basic declarations for relative pointers.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/utils/relptr.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RELPTR_H
+#define RELPTR_H
+
+/*
+ * Relative pointers are intended to be used when storing an address that may
+ * be relative either to the base of the process's address space or some
+ * dynamic shared memory segment mapped therein.
+ *
+ * The idea here is that you declare a relative pointer as relptr(type)
+ * and then use relptr_access to dereference it and relptr_store to change
+ * it. The use of a union here is a hack, because what's stored in the
+ * relptr is always a Size, never an actual pointer. But including a pointer
+ * in the union allows us to use stupid macro tricks to provide some measure
+ * of type-safety.
+ */
+#define relptr(type) union { type *relptr_type; Size relptr_off; }
+
+/*
+ * pgindent gets confused by declarations that use "relptr(type)" directly,
+ * so preferred style is to write
+ * typedef struct ... SomeStruct;
+ * relptr_declare(SomeStruct, RelptrSomeStruct);
+ * and then declare pointer variables as "RelptrSomeStruct someptr".
+ */
+#define relptr_declare(type, relptrtype) \
+ typedef relptr(type) relptrtype
+
+#ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P
+#define relptr_access(base, rp) \
+ (AssertVariableIsOfTypeMacro(base, char *), \
+ (__typeof__((rp).relptr_type)) ((rp).relptr_off == 0 ? NULL : \
+ (base + (rp).relptr_off)))
+#else
+/*
+ * If we don't have __builtin_types_compatible_p, assume we might not have
+ * __typeof__ either.
+ */
+#define relptr_access(base, rp) \
+ (AssertVariableIsOfTypeMacro(base, char *), \
+ (void *) ((rp).relptr_off == 0 ? NULL : (base + (rp).relptr_off)))
+#endif
+
+#define relptr_is_null(rp) \
+ ((rp).relptr_off == 0)
+
+#ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P
+#define relptr_store(base, rp, val) \
+ (AssertVariableIsOfTypeMacro(base, char *), \
+ AssertVariableIsOfTypeMacro(val, __typeof__((rp).relptr_type)), \
+ (rp).relptr_off = ((val) == NULL ? 0 : ((char *) (val)) - (base)))
+#else
+/*
+ * If we don't have __builtin_types_compatible_p, assume we might not have
+ * __typeof__ either.
+ */
+#define relptr_store(base, rp, val) \
+ (AssertVariableIsOfTypeMacro(base, char *), \
+ (rp).relptr_off = ((val) == NULL ? 0 : ((char *) (val)) - (base)))
+#endif
+
+#define relptr_copy(rp1, rp2) \
+ ((rp1).relptr_off = (rp2).relptr_off)
+
+#endif /* RELPTR_H */
diff --git a/src/include/utils/reltrigger.h b/src/include/utils/reltrigger.h
index e87f2283ec..65d6ecb30a 100644
--- a/src/include/utils/reltrigger.h
+++ b/src/include/utils/reltrigger.h
@@ -4,7 +4,7 @@
* POSTGRES relation trigger definitions.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/reltrigger.h
@@ -39,6 +39,8 @@ typedef struct Trigger
int16 *tgattr;
char **tgargs;
char *tgqual;
+ char *tgoldtable;
+ char *tgnewtable;
} Trigger;
typedef struct TriggerDesc
@@ -68,6 +70,11 @@ typedef struct TriggerDesc
/* there are no row-level truncate triggers */
bool trig_truncate_before_statement;
bool trig_truncate_after_statement;
+ /* Is there at least one trigger specifying each transition relation? */
+ bool trig_insert_new_table;
+ bool trig_update_old_table;
+ bool trig_update_new_table;
+ bool trig_delete_old_table;
} TriggerDesc;
#endif /* RELTRIGGER_H */
diff --git a/src/include/utils/resowner.h b/src/include/utils/resowner.h
index c5abac23a7..ff785e3a3e 100644
--- a/src/include/utils/resowner.h
+++ b/src/include/utils/resowner.h
@@ -9,7 +9,7 @@
* See utils/resowner/README for more info.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/resowner.h
diff --git a/src/include/utils/resowner_private.h b/src/include/utils/resowner_private.h
index 1fffec520c..2f763d7539 100644
--- a/src/include/utils/resowner_private.h
+++ b/src/include/utils/resowner_private.h
@@ -6,7 +6,7 @@
* See utils/resowner/README for more info.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/resowner_private.h
diff --git a/src/include/utils/rls.h b/src/include/utils/rls.h
index 29d17a4bf5..fa2c44e160 100644
--- a/src/include/utils/rls.h
+++ b/src/include/utils/rls.h
@@ -4,7 +4,7 @@
* Header file for Row Level Security (RLS) utility commands to be used
* with the rowsecurity feature.
*
- * Copyright (c) 2007-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2007-2017, PostgreSQL Global Development Group
*
* src/include/utils/rls.h
*
diff --git a/src/include/utils/ruleutils.h b/src/include/utils/ruleutils.h
index cec24184b0..42fc872c4a 100644
--- a/src/include/utils/ruleutils.h
+++ b/src/include/utils/ruleutils.h
@@ -3,7 +3,7 @@
* ruleutils.h
* Declarations for ruleutils.c
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/ruleutils.h
@@ -21,6 +21,8 @@
extern char *pg_get_indexdef_string(Oid indexrelid);
extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
+extern char *pg_get_partkeydef_columns(Oid relid, bool pretty);
+
extern char *pg_get_constraintdef_command(Oid constraintId);
extern char *deparse_expression(Node *expr, List *dpcontext,
bool forceprefix, bool showimplicit);
diff --git a/src/include/utils/sampling.h b/src/include/utils/sampling.h
index 2b914ebc3e..7edfc4a44d 100644
--- a/src/include/utils/sampling.h
+++ b/src/include/utils/sampling.h
@@ -3,7 +3,7 @@
* sampling.h
* definitions for sampling functions
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/sampling.h
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index 8e0d317468..958bdba455 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -5,7 +5,7 @@
* infrastructure for selectivity and cost estimation.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/selfuncs.h
@@ -72,9 +72,10 @@ typedef struct VariableStatData
/* NB: if statsTuple!=NULL, it must be freed when caller is done */
void (*freefunc) (HeapTuple tuple); /* how to free statsTuple */
Oid vartype; /* exposed type of expression */
- Oid atttype; /* type to pass to get_attstatsslot */
- int32 atttypmod; /* typmod to pass to get_attstatsslot */
+ Oid atttype; /* actual type (after stripping relabel) */
+ int32 atttypmod; /* actual typmod (after stripping relabel) */
bool isunique; /* matches unique index or DISTINCT clause */
+ bool acl_ok; /* result of ACL check on table or column */
} VariableStatData;
#define ReleaseVariableStats(vardata) \
@@ -153,6 +154,7 @@ extern PGDLLIMPORT get_index_stats_hook_type get_index_stats_hook;
extern void examine_variable(PlannerInfo *root, Node *node, int varRelid,
VariableStatData *vardata);
+extern bool statistic_proc_security_check(VariableStatData *vardata, Oid func_oid);
extern bool get_restriction_variable(PlannerInfo *root, List *args,
int varRelid,
VariableStatData *vardata, Node **other,
@@ -180,32 +182,6 @@ extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt,
extern Const *make_greater_string(const Const *str_const, FmgrInfo *ltproc,
Oid collation);
-extern Datum eqsel(PG_FUNCTION_ARGS);
-extern Datum neqsel(PG_FUNCTION_ARGS);
-extern Datum scalarltsel(PG_FUNCTION_ARGS);
-extern Datum scalargtsel(PG_FUNCTION_ARGS);
-extern Datum regexeqsel(PG_FUNCTION_ARGS);
-extern Datum icregexeqsel(PG_FUNCTION_ARGS);
-extern Datum likesel(PG_FUNCTION_ARGS);
-extern Datum iclikesel(PG_FUNCTION_ARGS);
-extern Datum regexnesel(PG_FUNCTION_ARGS);
-extern Datum icregexnesel(PG_FUNCTION_ARGS);
-extern Datum nlikesel(PG_FUNCTION_ARGS);
-extern Datum icnlikesel(PG_FUNCTION_ARGS);
-
-extern Datum eqjoinsel(PG_FUNCTION_ARGS);
-extern Datum neqjoinsel(PG_FUNCTION_ARGS);
-extern Datum scalarltjoinsel(PG_FUNCTION_ARGS);
-extern Datum scalargtjoinsel(PG_FUNCTION_ARGS);
-extern Datum regexeqjoinsel(PG_FUNCTION_ARGS);
-extern Datum icregexeqjoinsel(PG_FUNCTION_ARGS);
-extern Datum likejoinsel(PG_FUNCTION_ARGS);
-extern Datum iclikejoinsel(PG_FUNCTION_ARGS);
-extern Datum regexnejoinsel(PG_FUNCTION_ARGS);
-extern Datum icregexnejoinsel(PG_FUNCTION_ARGS);
-extern Datum nlikejoinsel(PG_FUNCTION_ARGS);
-extern Datum icnlikejoinsel(PG_FUNCTION_ARGS);
-
extern Selectivity boolvarsel(PlannerInfo *root, Node *arg, int varRelid);
extern Selectivity booltestsel(PlannerInfo *root, BoolTestType booltesttype,
Node *arg, int varRelid,
@@ -245,7 +221,5 @@ extern Selectivity scalararraysel_containment(PlannerInfo *root,
Node *leftop, Node *rightop,
Oid elemtype, bool isEquality, bool useOr,
int varRelid);
-extern Datum arraycontsel(PG_FUNCTION_ARGS);
-extern Datum arraycontjoinsel(PG_FUNCTION_ARGS);
#endif /* SELFUNCS_H */
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 9e3827249e..2a3f8eca34 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -3,7 +3,7 @@
* snapmgr.h
* POSTGRES snapshot manager
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/snapmgr.h
@@ -51,14 +51,14 @@ extern PGDLLIMPORT int old_snapshot_threshold;
extern Size SnapMgrShmemSize(void);
extern void SnapMgrInit(void);
-extern int64 GetSnapshotCurrentTimestamp(void);
-extern int64 GetOldSnapshotThresholdTimestamp(void);
+extern TimestampTz GetSnapshotCurrentTimestamp(void);
+extern TimestampTz GetOldSnapshotThresholdTimestamp(void);
extern bool FirstSnapshotSet;
extern TransactionId TransactionXmin;
extern TransactionId RecentXmin;
-extern TransactionId RecentGlobalXmin;
+extern PGDLLIMPORT TransactionId RecentGlobalXmin;
extern TransactionId RecentGlobalDataXmin;
extern Snapshot GetTransactionSnapshot(void);
@@ -69,6 +69,7 @@ extern Snapshot GetOldestSnapshot(void);
extern Snapshot GetCatalogSnapshot(Oid relid);
extern Snapshot GetNonHistoricCatalogSnapshot(Oid relid);
extern void InvalidateCatalogSnapshot(void);
+extern void InvalidateCatalogSnapshotConditionally(void);
extern void PushActiveSnapshot(Snapshot snapshot);
extern void PushCopiedSnapshot(Snapshot snapshot);
@@ -84,16 +85,16 @@ extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner);
extern void AtSubCommit_Snapshot(int level);
extern void AtSubAbort_Snapshot(int level);
-extern void AtEOXact_Snapshot(bool isCommit);
+extern void AtEOXact_Snapshot(bool isCommit, bool resetXmin);
-extern Datum pg_export_snapshot(PG_FUNCTION_ARGS);
extern void ImportSnapshot(const char *idstr);
extern bool XactHasExportedSnapshots(void);
extern void DeleteAllExportedSnapshotFiles(void);
extern bool ThereAreNoPriorRegisteredSnapshots(void);
extern TransactionId TransactionIdLimitedForOldSnapshots(TransactionId recentXmin,
Relation relation);
-extern void MaintainOldSnapshotTimeMapping(int64 whenTaken, TransactionId xmin);
+extern void MaintainOldSnapshotTimeMapping(TimestampTz whenTaken,
+ TransactionId xmin);
extern char *ExportSnapshot(Snapshot snapshot);
diff --git a/src/include/utils/snapshot.h b/src/include/utils/snapshot.h
index 7cc6f3894d..a981d90616 100644
--- a/src/include/utils/snapshot.h
+++ b/src/include/utils/snapshot.h
@@ -3,7 +3,7 @@
* snapshot.h
* POSTGRES snapshot definition
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -16,6 +16,7 @@
#include "access/htup.h"
#include "access/xlogdefs.h"
+#include "datatype/timestamp.h"
#include "lib/pairingheap.h"
#include "storage/buf.h"
@@ -111,7 +112,7 @@ typedef struct SnapshotData
uint32 regd_count; /* refcount on RegisteredSnapshots */
pairingheap_node ph_node; /* link in the RegisteredSnapshots heap */
- int64 whenTaken; /* timestamp when snapshot was taken */
+ TimestampTz whenTaken; /* timestamp when snapshot was taken */
XLogRecPtr lsn; /* position in the WAL stream when taken */
} SnapshotData;
diff --git a/src/include/utils/sortsupport.h b/src/include/utils/sortsupport.h
index 0ef76c8ccf..9ca8fe86ae 100644
--- a/src/include/utils/sortsupport.h
+++ b/src/include/utils/sortsupport.h
@@ -42,7 +42,7 @@
* function for such cases, but probably not any other acceleration method.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/sortsupport.h
diff --git a/src/include/utils/spccache.h b/src/include/utils/spccache.h
index e0e42e99c8..26f88da0b2 100644
--- a/src/include/utils/spccache.h
+++ b/src/include/utils/spccache.h
@@ -3,7 +3,7 @@
* spccache.h
* Tablespace cache.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/spccache.h
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 5a16368f12..2bbc93a975 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -6,7 +6,7 @@
* See also lsyscache.h, which provides convenience routines for
* common cache-lookup operations.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
@@ -81,6 +81,7 @@ enum SysCacheIdentifier
PGXCNODEOID,
PGXCNODEIDENTIFIER,
#endif
+ PARTRELID,
PROCNAMEARGSNSP,
PROCOID,
RANGETYPE,
@@ -88,8 +89,18 @@ enum SysCacheIdentifier
RELOID,
REPLORIGIDENT,
REPLORIGNAME,
+ PUBLICATIONOID,
+ PUBLICATIONNAME,
+ PUBLICATIONREL,
+ PUBLICATIONRELMAP,
RULERELNAME,
+ SEQRELID,
+ STATEXTNAMENSP,
+ STATEXTOID,
STATRELATTINH,
+ SUBSCRIPTIONOID,
+ SUBSCRIPTIONNAME,
+ SUBSCRIPTIONRELMAP,
TABLESPACEOID,
TRFOID,
TRFTYPELANG,
@@ -106,6 +117,8 @@ enum SysCacheIdentifier
TYPEOID,
USERMAPPINGOID,
USERMAPPINGUSERSERVER
+
+#define SysCacheSize (USERMAPPINGUSERSERVER + 1)
};
extern void InitCatalogCache(void);
@@ -138,6 +151,8 @@ struct catclist;
extern struct catclist *SearchSysCacheList(int cacheId, int nkeys,
Datum key1, Datum key2, Datum key3, Datum key4);
+extern void SysCacheInvalidate(int cacheId, uint32 hashValue);
+
extern bool RelationInvalidatesSnapshotsOnly(Oid relid);
extern bool RelationHasSysCache(Oid relid);
extern bool RelationSupportsSysCache(Oid relid);
diff --git a/src/include/utils/timeout.h b/src/include/utils/timeout.h
index 260c013960..aa816334c0 100644
--- a/src/include/utils/timeout.h
+++ b/src/include/utils/timeout.h
@@ -4,7 +4,7 @@
* Routines to multiplex SIGALRM interrupts for multiple timeout reasons.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/timeout.h
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index 3e8f4855d0..5e7e353b73 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -3,7 +3,7 @@
* timestamp.h
* Definitions for the SQL "timestamp" and "interval" types.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/timestamp.h
@@ -20,12 +20,9 @@
/*
* Macros for fmgr-callable functions.
*
- * For Timestamp, we make use of the same support routines as for int64
- * or float8. Therefore Timestamp is pass-by-reference if and only if
- * int64 or float8 is!
+ * For Timestamp, we make use of the same support routines as for int64.
+ * Therefore Timestamp is pass-by-reference if and only if int64 is!
*/
-#ifdef HAVE_INT64_TIMESTAMP
-
#define DatumGetTimestamp(X) ((Timestamp) DatumGetInt64(X))
#define DatumGetTimestampTz(X) ((TimestampTz) DatumGetInt64(X))
#define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X))
@@ -41,24 +38,6 @@
#define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x)
#define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x)
#define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x)
-#else /* !HAVE_INT64_TIMESTAMP */
-
-#define DatumGetTimestamp(X) ((Timestamp) DatumGetFloat8(X))
-#define DatumGetTimestampTz(X) ((TimestampTz) DatumGetFloat8(X))
-#define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X))
-
-#define TimestampGetDatum(X) Float8GetDatum(X)
-#define TimestampTzGetDatum(X) Float8GetDatum(X)
-#define IntervalPGetDatum(X) PointerGetDatum(X)
-
-#define PG_GETARG_TIMESTAMP(n) DatumGetTimestamp(PG_GETARG_DATUM(n))
-#define PG_GETARG_TIMESTAMPTZ(n) DatumGetTimestampTz(PG_GETARG_DATUM(n))
-#define PG_GETARG_INTERVAL_P(n) DatumGetIntervalP(PG_GETARG_DATUM(n))
-
-#define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x)
-#define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x)
-#define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x)
-#endif /* HAVE_INT64_TIMESTAMP */
#define TIMESTAMP_MASK(b) (1 << (b))
@@ -73,11 +52,7 @@
#define INTERVAL_PRECISION(t) ((t) & INTERVAL_PRECISION_MASK)
#define INTERVAL_RANGE(t) (((t) >> 16) & INTERVAL_RANGE_MASK)
-#ifdef HAVE_INT64_TIMESTAMP
#define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) * (int64) 1000))
-#else
-#define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) / 1000.0))
-#endif
#ifdef PGXC
#define InvalidGlobalTimestamp ((TimestampTz) 0)
@@ -91,155 +66,19 @@ extern TimestampTz PgStartTime;
extern TimestampTz PgReloadTime;
-/*
- * timestamp.c prototypes
- */
-
-extern Datum timestamp_in(PG_FUNCTION_ARGS);
-extern Datum timestamp_out(PG_FUNCTION_ARGS);
-extern Datum timestamp_recv(PG_FUNCTION_ARGS);
-extern Datum timestamp_send(PG_FUNCTION_ARGS);
-extern Datum timestamptypmodin(PG_FUNCTION_ARGS);
-extern Datum timestamptypmodout(PG_FUNCTION_ARGS);
-extern Datum timestamp_transform(PG_FUNCTION_ARGS);
-extern Datum timestamp_scale(PG_FUNCTION_ARGS);
-extern Datum timestamp_eq(PG_FUNCTION_ARGS);
-extern Datum timestamp_ne(PG_FUNCTION_ARGS);
-extern Datum timestamp_lt(PG_FUNCTION_ARGS);
-extern Datum timestamp_le(PG_FUNCTION_ARGS);
-extern Datum timestamp_ge(PG_FUNCTION_ARGS);
-extern Datum timestamp_gt(PG_FUNCTION_ARGS);
-extern Datum timestamp_finite(PG_FUNCTION_ARGS);
-extern Datum timestamp_cmp(PG_FUNCTION_ARGS);
-extern Datum timestamp_sortsupport(PG_FUNCTION_ARGS);
-extern Datum timestamp_hash(PG_FUNCTION_ARGS);
-extern Datum timestamp_smaller(PG_FUNCTION_ARGS);
-extern Datum timestamp_larger(PG_FUNCTION_ARGS);
-
-extern Datum timestamp_eq_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_ne_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_lt_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_le_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_gt_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_ge_timestamptz(PG_FUNCTION_ARGS);
-extern Datum timestamp_cmp_timestamptz(PG_FUNCTION_ARGS);
-
-extern Datum make_timestamp(PG_FUNCTION_ARGS);
-extern Datum make_timestamptz(PG_FUNCTION_ARGS);
-extern Datum make_timestamptz_at_timezone(PG_FUNCTION_ARGS);
-extern Datum float8_timestamptz(PG_FUNCTION_ARGS);
-
-extern Datum timestamptz_eq_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_ne_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_lt_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_le_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_gt_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_ge_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_cmp_timestamp(PG_FUNCTION_ARGS);
-
-extern Datum interval_in(PG_FUNCTION_ARGS);
-extern Datum interval_out(PG_FUNCTION_ARGS);
-extern Datum interval_recv(PG_FUNCTION_ARGS);
-extern Datum interval_send(PG_FUNCTION_ARGS);
-extern Datum intervaltypmodin(PG_FUNCTION_ARGS);
-extern Datum intervaltypmodout(PG_FUNCTION_ARGS);
-extern Datum interval_transform(PG_FUNCTION_ARGS);
-extern Datum interval_scale(PG_FUNCTION_ARGS);
-extern Datum interval_eq(PG_FUNCTION_ARGS);
-extern Datum interval_ne(PG_FUNCTION_ARGS);
-extern Datum interval_lt(PG_FUNCTION_ARGS);
-extern Datum interval_le(PG_FUNCTION_ARGS);
-extern Datum interval_ge(PG_FUNCTION_ARGS);
-extern Datum interval_gt(PG_FUNCTION_ARGS);
-extern Datum interval_finite(PG_FUNCTION_ARGS);
-extern Datum interval_cmp(PG_FUNCTION_ARGS);
-extern Datum interval_hash(PG_FUNCTION_ARGS);
-extern Datum interval_smaller(PG_FUNCTION_ARGS);
-extern Datum interval_larger(PG_FUNCTION_ARGS);
-extern Datum interval_justify_interval(PG_FUNCTION_ARGS);
-extern Datum interval_justify_hours(PG_FUNCTION_ARGS);
-extern Datum interval_justify_days(PG_FUNCTION_ARGS);
-extern Datum make_interval(PG_FUNCTION_ARGS);
-
-extern Datum timestamp_trunc(PG_FUNCTION_ARGS);
-extern Datum interval_trunc(PG_FUNCTION_ARGS);
-extern Datum timestamp_part(PG_FUNCTION_ARGS);
-extern Datum interval_part(PG_FUNCTION_ARGS);
-extern Datum timestamp_zone_transform(PG_FUNCTION_ARGS);
-extern Datum timestamp_zone(PG_FUNCTION_ARGS);
-extern Datum timestamp_izone_transform(PG_FUNCTION_ARGS);
-extern Datum timestamp_izone(PG_FUNCTION_ARGS);
-extern Datum timestamp_timestamptz(PG_FUNCTION_ARGS);
-
-extern Datum timestamptz_in(PG_FUNCTION_ARGS);
-extern Datum timestamptz_out(PG_FUNCTION_ARGS);
-extern Datum timestamptz_recv(PG_FUNCTION_ARGS);
-extern Datum timestamptz_send(PG_FUNCTION_ARGS);
-extern Datum timestamptztypmodin(PG_FUNCTION_ARGS);
-extern Datum timestamptztypmodout(PG_FUNCTION_ARGS);
-extern Datum timestamptz_scale(PG_FUNCTION_ARGS);
-extern Datum timestamptz_timestamp(PG_FUNCTION_ARGS);
-extern Datum timestamptz_zone(PG_FUNCTION_ARGS);
-extern Datum timestamptz_izone(PG_FUNCTION_ARGS);
-extern Datum timestamptz_timestamptz(PG_FUNCTION_ARGS);
-
-extern Datum interval_um(PG_FUNCTION_ARGS);
-extern Datum interval_pl(PG_FUNCTION_ARGS);
-extern Datum interval_mi(PG_FUNCTION_ARGS);
-extern Datum interval_mul(PG_FUNCTION_ARGS);
-extern Datum mul_d_interval(PG_FUNCTION_ARGS);
-extern Datum interval_div(PG_FUNCTION_ARGS);
-extern Datum interval_accum(PG_FUNCTION_ARGS);
-#ifdef PGXC
-extern Datum interval_collect(PG_FUNCTION_ARGS);
-#endif
-extern Datum interval_combine(PG_FUNCTION_ARGS);
-extern Datum interval_accum_inv(PG_FUNCTION_ARGS);
-extern Datum interval_avg(PG_FUNCTION_ARGS);
-
-extern Datum timestamp_mi(PG_FUNCTION_ARGS);
-extern Datum timestamp_pl_interval(PG_FUNCTION_ARGS);
-extern Datum timestamp_mi_interval(PG_FUNCTION_ARGS);
-extern Datum timestamp_age(PG_FUNCTION_ARGS);
-extern Datum overlaps_timestamp(PG_FUNCTION_ARGS);
-
-extern Datum timestamptz_pl_interval(PG_FUNCTION_ARGS);
-extern Datum timestamptz_mi_interval(PG_FUNCTION_ARGS);
-extern Datum timestamptz_age(PG_FUNCTION_ARGS);
-extern Datum timestamptz_trunc(PG_FUNCTION_ARGS);
-extern Datum timestamptz_part(PG_FUNCTION_ARGS);
-
-extern Datum now(PG_FUNCTION_ARGS);
-extern Datum statement_timestamp(PG_FUNCTION_ARGS);
-extern Datum clock_timestamp(PG_FUNCTION_ARGS);
-
-extern Datum pg_postmaster_start_time(PG_FUNCTION_ARGS);
-extern Datum pg_conf_load_time(PG_FUNCTION_ARGS);
-
-extern Datum generate_series_timestamp(PG_FUNCTION_ARGS);
-extern Datum generate_series_timestamptz(PG_FUNCTION_ARGS);
-
/* Internal routines (not fmgr-callable) */
+extern int32 anytimestamp_typmod_check(bool istz, int32 typmod);
+
extern TimestampTz GetCurrentTimestamp(void);
+extern TimestampTz GetSQLCurrentTimestamp(int32 typmod);
+extern Timestamp GetSQLLocalTimestamp(int32 typmod);
extern void TimestampDifference(TimestampTz start_time, TimestampTz stop_time,
long *secs, int *microsecs);
extern bool TimestampDifferenceExceeds(TimestampTz start_time,
TimestampTz stop_time,
int msec);
-/*
- * Prototypes for functions to deal with integer timestamps, when the native
- * format is float timestamps.
- */
-#ifndef HAVE_INT64_TIMESTAMP
-extern int64 GetCurrentIntegerTimestamp(void);
-extern TimestampTz IntegerTimestampToTimestampTz(int64 timestamp);
-#else
-#define GetCurrentIntegerTimestamp() GetCurrentTimestamp()
-#define IntegerTimestampToTimestampTz(timestamp) (timestamp)
-#endif
-
extern TimestampTz time_t_to_timestamptz(pg_time_t tm);
extern pg_time_t timestamptz_to_time_t(TimestampTz t);
diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h
index fafe1bd862..f39f21bb64 100644
--- a/src/include/utils/tqual.h
+++ b/src/include/utils/tqual.h
@@ -5,7 +5,7 @@
*
* Should be moved/renamed... - vadim 07/28/98
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/tqual.h
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index ac46f90c4a..d6be7fe826 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -11,7 +11,7 @@
* algorithm.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/tuplesort.h
@@ -76,7 +76,9 @@ extern Tuplesortstate *tuplesort_begin_index_btree(Relation heapRel,
int workMem, bool randomAccess);
extern Tuplesortstate *tuplesort_begin_index_hash(Relation heapRel,
Relation indexRel,
- uint32 hash_mask,
+ uint32 high_mask,
+ uint32 low_mask,
+ uint32 max_buckets,
int workMem, bool randomAccess);
extern Tuplesortstate *tuplesort_begin_datum(Oid datumType,
Oid sortOperator, Oid sortCollation,
@@ -104,11 +106,9 @@ extern void tuplesort_putdatum(Tuplesortstate *state, Datum val,
extern void tuplesort_performsort(Tuplesortstate *state);
extern bool tuplesort_gettupleslot(Tuplesortstate *state, bool forward,
- TupleTableSlot *slot, Datum *abbrev);
-extern HeapTuple tuplesort_getheaptuple(Tuplesortstate *state, bool forward,
- bool *should_free);
-extern IndexTuple tuplesort_getindextuple(Tuplesortstate *state, bool forward,
- bool *should_free);
+ bool copy, TupleTableSlot *slot, Datum *abbrev);
+extern HeapTuple tuplesort_getheaptuple(Tuplesortstate *state, bool forward);
+extern IndexTuple tuplesort_getindextuple(Tuplesortstate *state, bool forward);
extern bool tuplesort_getdatum(Tuplesortstate *state, bool forward,
Datum *val, bool *isNull, Datum *abbrev);
diff --git a/src/include/utils/tuplestore.h b/src/include/utils/tuplestore.h
index 1eecc89bcf..aef4fc9840 100644
--- a/src/include/utils/tuplestore.h
+++ b/src/include/utils/tuplestore.h
@@ -22,7 +22,7 @@
* so that there is a check to prevent attempted access to system columns.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/tuplestore.h
@@ -79,6 +79,8 @@ extern bool tuplestore_advance(Tuplestorestate *state, bool forward);
extern bool tuplestore_skiptuples(Tuplestorestate *state,
int64 ntuples, bool forward);
+extern int64 tuplestore_tuple_count(Tuplestorestate *state);
+
extern bool tuplestore_ateof(Tuplestorestate *state);
extern void tuplestore_rescan(Tuplestorestate *state);
diff --git a/src/include/utils/typcache.h b/src/include/utils/typcache.h
index c72efcccb1..1bf94e2548 100644
--- a/src/include/utils/typcache.h
+++ b/src/include/utils/typcache.h
@@ -6,7 +6,7 @@
* The type cache exists to speed lookup of certain information about data
* types that is not directly available from a type's pg_type row.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/typcache.h
@@ -131,9 +131,10 @@ typedef struct DomainConstraintRef
{
List *constraints; /* list of DomainConstraintState nodes */
MemoryContext refctx; /* context holding DomainConstraintRef */
+ TypeCacheEntry *tcache; /* typcache entry for domain type */
+ bool need_exprstate; /* does caller need check_exprstate? */
/* Management data --- treat these fields as private to typcache.c */
- TypeCacheEntry *tcache; /* owning typcache entry */
DomainConstraintCache *dcc; /* current constraints, or NULL if none */
MemoryContextCallback callback; /* used to release refcount when done */
} DomainConstraintRef;
@@ -142,7 +143,7 @@ typedef struct DomainConstraintRef
extern TypeCacheEntry *lookup_type_cache(Oid type_id, int flags);
extern void InitDomainConstraintRef(Oid type_id, DomainConstraintRef *ref,
- MemoryContext refctx);
+ MemoryContext refctx, bool need_exprstate);
extern void UpdateDomainConstraintRef(DomainConstraintRef *ref);
diff --git a/src/include/utils/tzparser.h b/src/include/utils/tzparser.h
index eea8ffcfa4..c22467de1a 100644
--- a/src/include/utils/tzparser.h
+++ b/src/include/utils/tzparser.h
@@ -3,7 +3,7 @@
* tzparser.h
* Timezone offset file parsing definitions.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/tzparser.h
diff --git a/src/include/utils/uuid.h b/src/include/utils/uuid.h
index 897382f2e5..9e62d81c3d 100644
--- a/src/include/utils/uuid.h
+++ b/src/include/utils/uuid.h
@@ -5,7 +5,7 @@
* to avoid conflicts with any uuid_t type that might be defined by
* the system headers.
*
- * Copyright (c) 2007-2016, PostgreSQL Global Development Group
+ * Copyright (c) 2007-2017, PostgreSQL Global Development Group
*
* src/include/utils/uuid.h
*
@@ -14,11 +14,13 @@
#ifndef UUID_H
#define UUID_H
-/* guid size in bytes */
+/* uuid size in bytes */
#define UUID_LEN 16
-/* opaque struct; defined in uuid.c */
-typedef struct pg_uuid_t pg_uuid_t;
+typedef struct pg_uuid_t
+{
+ unsigned char data[UUID_LEN];
+} pg_uuid_t;
/* fmgr interface macros */
#define UUIDPGetDatum(X) PointerGetDatum(X)
diff --git a/src/include/utils/varbit.h b/src/include/utils/varbit.h
index 5d5c9f38fa..2a4ec67698 100644
--- a/src/include/utils/varbit.h
+++ b/src/include/utils/varbit.h
@@ -5,7 +5,7 @@
*
* Code originally contributed by Adriaan Joubert.
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/varbit.h
@@ -66,50 +66,4 @@ typedef struct
/* Mask that will cover exactly one byte, i.e. BITS_PER_BYTE bits */
#define BITMASK 0xFF
-
-extern Datum bit_in(PG_FUNCTION_ARGS);
-extern Datum bit_out(PG_FUNCTION_ARGS);
-extern Datum bit_recv(PG_FUNCTION_ARGS);
-extern Datum bit_send(PG_FUNCTION_ARGS);
-extern Datum bittypmodin(PG_FUNCTION_ARGS);
-extern Datum bittypmodout(PG_FUNCTION_ARGS);
-extern Datum varbit_in(PG_FUNCTION_ARGS);
-extern Datum varbit_out(PG_FUNCTION_ARGS);
-extern Datum varbit_recv(PG_FUNCTION_ARGS);
-extern Datum varbit_send(PG_FUNCTION_ARGS);
-extern Datum varbittypmodin(PG_FUNCTION_ARGS);
-extern Datum varbittypmodout(PG_FUNCTION_ARGS);
-extern Datum bit(PG_FUNCTION_ARGS);
-extern Datum varbit_transform(PG_FUNCTION_ARGS);
-extern Datum varbit(PG_FUNCTION_ARGS);
-extern Datum biteq(PG_FUNCTION_ARGS);
-extern Datum bitne(PG_FUNCTION_ARGS);
-extern Datum bitlt(PG_FUNCTION_ARGS);
-extern Datum bitle(PG_FUNCTION_ARGS);
-extern Datum bitgt(PG_FUNCTION_ARGS);
-extern Datum bitge(PG_FUNCTION_ARGS);
-extern Datum bitcmp(PG_FUNCTION_ARGS);
-
-/* avoid the names bitand and bitor, since they are C++ keywords */
-extern Datum bit_and(PG_FUNCTION_ARGS);
-extern Datum bit_or(PG_FUNCTION_ARGS);
-extern Datum bitxor(PG_FUNCTION_ARGS);
-extern Datum bitnot(PG_FUNCTION_ARGS);
-extern Datum bitshiftleft(PG_FUNCTION_ARGS);
-extern Datum bitshiftright(PG_FUNCTION_ARGS);
-extern Datum bitcat(PG_FUNCTION_ARGS);
-extern Datum bitsubstr(PG_FUNCTION_ARGS);
-extern Datum bitsubstr_no_len(PG_FUNCTION_ARGS);
-extern Datum bitoverlay(PG_FUNCTION_ARGS);
-extern Datum bitoverlay_no_len(PG_FUNCTION_ARGS);
-extern Datum bitlength(PG_FUNCTION_ARGS);
-extern Datum bitoctetlength(PG_FUNCTION_ARGS);
-extern Datum bitfromint4(PG_FUNCTION_ARGS);
-extern Datum bittoint4(PG_FUNCTION_ARGS);
-extern Datum bitfromint8(PG_FUNCTION_ARGS);
-extern Datum bittoint8(PG_FUNCTION_ARGS);
-extern Datum bitposition(PG_FUNCTION_ARGS);
-extern Datum bitsetbit(PG_FUNCTION_ARGS);
-extern Datum bitgetbit(PG_FUNCTION_ARGS);
-
#endif
diff --git a/src/include/utils/varlena.h b/src/include/utils/varlena.h
new file mode 100644
index 0000000000..cab82ee888
--- /dev/null
+++ b/src/include/utils/varlena.h
@@ -0,0 +1,37 @@
+/*-------------------------------------------------------------------------
+ *
+ * varlena.h
+ * Functions for the variable-length built-in types.
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/utils/varlena.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef VARLENA_H
+#define VARLENA_H
+
+#include "nodes/pg_list.h"
+#include "utils/sortsupport.h"
+
+extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid);
+extern void varstr_sortsupport(SortSupport ssup, Oid collid, bool bpchar);
+extern int varstr_levenshtein(const char *source, int slen,
+ const char *target, int tlen,
+ int ins_c, int del_c, int sub_c,
+ bool trusted);
+extern int varstr_levenshtein_less_equal(const char *source, int slen,
+ const char *target, int tlen,
+ int ins_c, int del_c, int sub_c,
+ int max_d, bool trusted);
+extern List *textToQualifiedNameList(text *textval);
+extern bool SplitIdentifierString(char *rawstring, char separator,
+ List **namelist);
+extern bool SplitDirectoriesString(char *rawstring, char separator,
+ List **namelist);
+extern text *replace_text_regexp(text *src_text, void *regexp,
+ text *replace_text, bool glob);
+
+#endif
diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h
index 2eab8a5c2d..195b9b3a97 100644
--- a/src/include/utils/xml.h
+++ b/src/include/utils/xml.h
@@ -4,7 +4,7 @@
* Declarations for XML data type support.
*
*
- * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/xml.h
@@ -18,6 +18,7 @@
#include "fmgr.h"
#include "nodes/execnodes.h"
#include "nodes/primnodes.h"
+#include "executor/tablefunc.h"
typedef struct varlena xmltype;
@@ -52,39 +53,6 @@ typedef struct PgXmlErrorContext PgXmlErrorContext;
#define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n))
#define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x)
-extern Datum xml_in(PG_FUNCTION_ARGS);
-extern Datum xml_out(PG_FUNCTION_ARGS);
-extern Datum xml_recv(PG_FUNCTION_ARGS);
-extern Datum xml_send(PG_FUNCTION_ARGS);
-extern Datum xmlcomment(PG_FUNCTION_ARGS);
-extern Datum xmlconcat2(PG_FUNCTION_ARGS);
-extern Datum texttoxml(PG_FUNCTION_ARGS);
-extern Datum xmltotext(PG_FUNCTION_ARGS);
-extern Datum xmlvalidate(PG_FUNCTION_ARGS);
-extern Datum xpath(PG_FUNCTION_ARGS);
-extern Datum xpath_exists(PG_FUNCTION_ARGS);
-extern Datum xmlexists(PG_FUNCTION_ARGS);
-extern Datum xml_is_well_formed(PG_FUNCTION_ARGS);
-extern Datum xml_is_well_formed_document(PG_FUNCTION_ARGS);
-extern Datum xml_is_well_formed_content(PG_FUNCTION_ARGS);
-
-extern Datum table_to_xml(PG_FUNCTION_ARGS);
-extern Datum query_to_xml(PG_FUNCTION_ARGS);
-extern Datum cursor_to_xml(PG_FUNCTION_ARGS);
-extern Datum table_to_xmlschema(PG_FUNCTION_ARGS);
-extern Datum query_to_xmlschema(PG_FUNCTION_ARGS);
-extern Datum cursor_to_xmlschema(PG_FUNCTION_ARGS);
-extern Datum table_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
-extern Datum query_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
-
-extern Datum schema_to_xml(PG_FUNCTION_ARGS);
-extern Datum schema_to_xmlschema(PG_FUNCTION_ARGS);
-extern Datum schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
-
-extern Datum database_to_xml(PG_FUNCTION_ARGS);
-extern Datum database_to_xmlschema(PG_FUNCTION_ARGS);
-extern Datum database_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
-
extern void pg_xml_init_library(void);
extern PgXmlErrorContext *pg_xml_init(PgXmlStrictness strictness);
extern void pg_xml_done(PgXmlErrorContext *errcxt, bool isError);
@@ -93,7 +61,9 @@ extern void xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode,
const char *msg);
extern xmltype *xmlconcat(List *args);
-extern xmltype *xmlelement(XmlExprState *xmlExpr, ExprContext *econtext);
+extern xmltype *xmlelement(XmlExpr *xexpr,
+ Datum *named_argvalue, bool *named_argnull,
+ Datum *argvalue, bool *argnull);
extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace);
extern xmltype *xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null);
extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
@@ -109,4 +79,6 @@ extern int xmlbinary; /* XmlBinaryType, but int for guc enum */
extern int xmloption; /* XmlOptionType, but int for guc enum */
+extern const TableFuncRoutine XmlTableRoutine;
+
#endif /* XML_H */
diff --git a/src/include/windowapi.h b/src/include/windowapi.h
index dc693cc13c..481ebe06cf 100644
--- a/src/include/windowapi.h
+++ b/src/include/windowapi.h
@@ -19,7 +19,7 @@
* function in nodeWindowAgg.c for details.
*
*
- * Portions Copyright (c) 2000-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 2000-2017, PostgreSQL Global Development Group
*
* src/include/windowapi.h
*