From 0cfc87bd32822e5ba22d8c2b1a26fa60f63ad7fa Mon Sep 17 00:00:00 2001
From: rudb <office@database.ru>
Date: Fri, 19 Jun 2026 15:11:53 +0000
Subject: [PATCH] СУБД RuDB - релиз 2
---
src/backend/utils/dbms/dbms_json/dbms_json.hpp | 24
contrib/pldotnet/dotnet_src/Templates/UserFunctionProject.tfsproj | 58
contrib/postgis/postgis/gserialized_typmod.c | 4
src/test/regress/expected/opr_sanity.out | 13
src/backend/utils/Makefile | 2
src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.cpp | 1176
contrib/postgis/liblwgeom/lwin_twkb.c | 2
distr/ALT/11/cr_service.sh | 7
contrib/postgis/raster/rt_core/rt_wkb.c | 6
src/backend/parser/parse_func.c | 1
contrib/postgis/doc/release_notes.xml | 21
contrib/postgis/configure.ac | 10
src/backend/utils/dbms/dbms_transaction/dbms_transaction.cpp | 300
src/backend/utils/dbms/owa_match/owa_match.cpp | 143
src/test/regress/sql/dbms_jsno_get_veiw_sql.sql | 118
contrib/postgis/regress/loader/ReprojectPtsD.select.sql | 1
contrib/pldotnet/tests/csharp/DotNetTestProject/CSharpTest.csproj | 48
contrib/pldotnet/tests/xUnit/PlDotNetTest.csproj | 52
src/backend/utils/dbms/owa_util/owa_util.hpp | 79
src/backend/utils/dbms/dbms_trace/dbms_trace.hpp | 184
src/backend/utils/dbms/dbms_system/dbms_system.hpp | 101
src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.hpp | 243
contrib/pldotnet/tests/fsharp/DotNetTestProject/Program.fs | 380
contrib/postgis/raster/rt_pg/rtpg_gdal.c | 2
src/test/regress/expected/dbms_file_transfer.out | 125
src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.hpp | 364
contrib/postgis/doc/po/LINGUAS | 1
src/include/dbms/htp.h | 173
contrib/postgis/NEWS | 69
src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.hpp | 34
distr/ASTRA/1.8/mkcontrol.sh | 192
src/backend/utils/dbms/dbms_db_version/dbms_db_version.cpp | 268
src/test/regress/expected/dbms_sqlset.out | 627
src/backend/utils/dbms/dbms_ash/dbms_ash.hpp | 556
contrib/postgis/ChangeLog | 232
contrib/postgis/liblwgeom/gserialized2.c | 45
contrib/postgis/liblwgeom/lwin_wkt_lex.c | 92
src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.cpp | 115
contrib/postgis/Version.config | 3
src/backend/utils/dbms/dbms_json_schema/vendor/json-validator.cpp | 1472
src/test/regress/sql/htp.sql | 163
src/test/regress/expected/owa_cache.out | 617
contrib/postgis/libpgcommon/lwgeom_pg.h | 4
src/backend/utils/dbms/htf/htf.hpp | 115
contrib/postgis/libpgcommon/lwgeom_pg.c | 14
contrib/procdate/expected/proc_date.out | 244
src/test/regress/sql/owa_cookie.sql | 188
src/include/dbms/owa_text.h | 36
contrib/procdate/sql/proc_date.sql | 166
full_build.sh | 58
src/test/regress/sql/owa_cache.sql | 561
src/test/regress/sql/dbms_sqlset.sql | 468
src/test/regress/sql/dbms_warning.sql | 154
src/backend/utils/dbms/dbms_tns/dbms_tns.cpp | 894
src/test/regress/sql/dbms_system.sql | 137
src/test/regress/expected/htp.out | 1246
doc/Руководство_пользователя_RuDB.pdf | 0
src/test/regress/sql/dbms_file_transfer.sql | 69
src/test/regress/sql/dbms_ddl.sql | 6
contrib/pg_wait_sampling/LICENSE | 22
src/pl/plpgsql/src/pl_comp.c | 77
contrib/postgis/topology/sql/cleanup/RemoveUnusedPrimitives.sql.in | 3
src/include/catalog/pg_proc.dat | 6191 +++
contrib/postgis/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in | 19
contrib/postgis/postgis/mvt.c | 2
src/test/regress/expected/dbms_json_schema.out | 120
contrib/postgis/deps/flatgeobuf/include/flatbuffers/flatbuffer_builder.h | 6
src/test/regress/sql/owa_cookie_constraints_oracle.sql | 334
src/test/regress/expected/dbms_stat_funcs.out | 649
src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_validate_report_oracle.sql | 119
src/include/dbms/owa_pattern.h | 55
src/backend/utils/dbms/dbms_warning/dbms_warning.hpp | 155
src/test/regress/expected/dbms_db_version.out | 73
src/backend/utils/dbms/dbms_json_schema/vendor/string-format-check.cpp | 414
src/test/regress/expected/dbms_ddl.out | 11
contrib/postgis/extensions/postgis_tiger_geocoder/Makefile.in | 39
contrib/postgis/sfcgal/regress/sfcgal_v2_expected | 2
src/test/regress/sql/is_valid_function_oracle.sql | 101
src/test/regress/sql/owa_cookie_oracle.sql | 186
src/test/regress/sql/owa_pattern.sql | 1
.gitignore | 68
src/include/utils/dbms_warning.h | 23
contrib/postgis/liblwgeom/ptarray.c | 10
src/test/regress/expected/dbms_xmlstore.out | 20
src/backend/utils/dbms/dbms_json/dbms_json.cpp | 2132 +
contrib/postgis/postgis/lwgeom_in_geohash.c | 7
.abi-compliance-history | 82
contrib/pg_query_state/meson.build | 2
contrib/pldotnet/tests/fsharp/DotNetTestProject/FSharpTest.fsproj | 44
contrib/pldotnet/tests/xUnit/PlDotNetTest.cs | 1272
src/backend/utils/dbms/utl_gdk/utl_gdk.cpp | 1299
contrib/postgis/postgis/postgis.sql.in | 2
src/backend/utils/dbms/dbms_json_schema/vendor/json-schema-draft7.json.cpp | 185
distr/UBUNTU/24/mkcontrol.sh | 209
.dir-locals.el | 19
src/include/common/coder.hpp | 18
src/test/regress/sql/dbms_stat_funcs.sql | 689
src/backend/utils/dbms/owa_text/owa_text.cpp | 508
src/include/dbms/owa.h | 116
src/test/regress/sql/dbms_db_version.sql | 37
configure | 268
contrib/postgis/liblwgeom/cunit/cu_ptarray.c | 11
src/backend/utils/dbms/dbms_warning/dbms_warning_errors.hpp | 20
src/backend/utils/dbms/owa/owa_cache.cpp | 770
src/backend/utils/dbms/htf/htf_common.cpp | 997
src/test/regress/expected/htf.out | 618
contrib/postgis/raster/rt_pg/rtpg_geometry.c | 5
src/backend/utils/dbms/dbms_ddl/dbms_ddl.hpp | 37
src/backend/utils/dbms/dbms_system/dbms_system.cpp | 776
src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.hpp | 19
src/backend/utils/dbms/htp/htp.cpp | 3703 ++
src/test/regress/sql/dbms_json.sql | 225
.gitattributes | 40
src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.cpp | 1675
src/backend/utils/dbms/owa_util/owa_util.cpp | 1504
src/backend/utils/coder.c | 237
src/backend/utils/dbms/nlohmann/json-schema.hpp | 198
src/backend/utils/dbms/dbms_trace/dbms_trace.cpp | 724
src/test/regress/expected/utl_gdk.out | 243
src/backend/utils/misc/guc_tables.c | 12
src/backend/utils/adt/string_array.c | 232
src/backend/utils/dbms/dbms_json/dbms_json_oracle.sql | 127
contrib/pldotnet/tests/csharp/DotNetTestProject/Program.cs | 1378
contrib/postgis/sfcgal/regress/sfcgal_v2.sql | 2
src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.cpp | 792
db_cr_all.sh | 108
contrib/postgis/raster/rt_pg/rtpg_create.c | 4
src/backend/utils/dbms/dbms_db_version/dbms_db_version.hpp | 103
contrib/pldotnet/docs/references.bib | 76
contrib/postgis/extensions/address_standardizer/parseaddress-api.c | 4
contrib/postgis/postgis/lwgeom_in_gml.c | 21
contrib/postgis/loader/shpcommon.c | 1
contrib/postgis/postgis/Makefile.in | 1
full_build_db_create_run_tests.sh | 111
contrib/pldotnet/dotnet_src/FSharp/PlDotNET.FSharp.fsproj | 48
src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.hpp | 41
contrib/postgis/liblwgeom/cunit/cu_gserialized2.c | 56
contrib/postgis/liblwgeom/lwutil.c | 4
src/test/regress/expected/owa_pattern.out | 6
src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.hpp | 37
src/backend/utils/dbms/owa_pattern/owa_pattern.cpp | 2642 +
contrib/postgis/postgis/geography_centroid.c | 10
contrib/postgis/extensions/postgis_extension_helper_uninstall.sql | 1
contrib/postgis/doc/Makefile.in | 2
src/backend/utils/dbms/dbms_warning/dbms_warning_errors.cpp | 38
src/test/regress/sql/is_valid_function.sql | 96
src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.cpp | 1376
src/test/regress/expected/owa_cookie.out | 239
contrib/postgis/topology/test/regress/fix_topogeometry_columns.sql | 3
src/backend/utils/dbms/htf/htf.cpp | 2062 +
contrib/postgis/liblwgeom/lwin_wkb.c | 8
contrib/postgis/raster/rt_core/rt_geometry.c | 60
contrib/postgis/doc/developer.md | 8
contrib/postgis/extensions/postgis_extension_helper.sql.in | 67
contrib/pg_hint_plan/sql/init_new.sql | 2
src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.hpp | 130
src/test/regress/expected/dbms_json.out | 370
src/test/regress/expected/dbms_xmlsave.out | 20
src/test/regress/expected/dbms_warning.out | 459
src/backend/catalog/system_functions.sql | 435
contrib/postgis/raster/rt_core/rt_statistics.c | 6
contrib/postgis/postgis/lwgeom_functions_analytic.c | 3
src/include/utils/coder.h | 20
src/test/regress/sql/owa_cookie_constraints.sql | 234
contrib/postgis/raster/rt_pg/rtpg_internal.c | 2
contrib/postgis/topology/test/regress/fix_topogeometry_columns_expected | 8
src/common/coder.cpp | 321
src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.hpp | 53
contrib/postgis/loader/pgsql2shp-core.c | 8
src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.cpp | 762
src/backend/utils/dbms/dbms_ddl/dbms_ddl.cpp | 599
src/backend/catalog/system_views.sql | 42
src/test/regress/sql/dbms_trace.sql | 400
src/backend/utils/dbms/owa/owa_cookie.cpp | 883
contrib/postgis/postgis/flatgeobuf.c | 4
src/test/regress/sql/utl_gdk.sql | 45
src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_is_valid_oracle.sql | 81
src/test/regress/sql/dbms_xmlsave.sql | 20
src/test/regress/expected/rules.out | 19
.cirrus.tasks.yml | 962
src/backend/utils/dbms/utl_gdk/utl_gdk.hpp | 107
contrib/postgis/doc/po/uk/Makefile.in | 4
.editorconfig | 176
contrib/postgis/regress/loader/ReprojectPtsGeogD.select.sql | 1
src/include/pg_config.h.in | 6
contrib/postgis/diasoft_version.info | 6
contrib/postgis/topology/test/regress/removeunusedprimitives.sql | 26
src/test/regress/sql/htf.sql | 103
src/backend/utils/dbms/dbms_ash/dbms_ash.cpp | 709
contrib/pg_hint_plan/expected/init_new.out | 2
src/test/regress/sql/owa_cache_oracle.sql | 623
.mailmap | 1
src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.cpp | 544
contrib/pg_query_state/Makefile | 2
distr/readme.md | 10
src/backend/utils/dbms/htf/htf_common.hpp | 121
.cirrus.yml | 91
src/test/regress/expected/owa_cookie_constraints.out | 286
src/backend/utils/dbms/dbms_tns/dbms_tns.hpp | 57
src/test/regress/expected/dbms_system.out | 275
src/test/regress/expected/dbms_trace.out | 537
.cirrus.star | 143
contrib/postgis/extensions/upgradeable_versions.mk | 9
src/backend/utils/dbms/Makefile | 348
distr/ALT/11/cr_spec.sh | 3
contrib/postgis/extensions/address_standardizer/standard.c | 3
src/bin/pg_amcheck/pg_amcheck.c | 9
.git-blame-ignore-revs | 393
src/test/regress/sql/utl_file.sql | 7
contrib/postgis/README.postgis | 4
contrib/pg_query_state/LICENSE | 22
contrib/postgis/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in | 19
contrib/postgis/raster/rt_core/rt_raster.c | 3
src/backend/utils/dbms/dbms_warning/dbms_warning.cpp | 581
src/test/regress/expected/dbms_tns.out | 479
contrib/postgis/.codespell.ignore | 2
src/test/regress/expected/utl_file.out | 6
contrib/postgis/doc/po/uk/postgis-manual.po | 46197 +++++++++++++++++++++++++
src/backend/utils/dbms/package_methods_reference.ru.adoc | 1204
contrib/postgis/postgis/lwgeom_inout.c | 4
src/backend/utils/dbms/dbms_json_schema/vendor/json-uri.cpp | 159
contrib/pg_hint_plan/docs/make.bat | 70
configure.ac | 35
src/test/regress/parallel_schedule | 5
contrib/postgis/liblwgeom/lwgeom_log.h | 5
src/backend/utils/dbms/dbms_transaction/dbms_transaction.hpp | 44
src/test/regress/sql/dbms_json_schema.sql | 63
src/test/regress/regress.c | 37
src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.cpp | 1088
src/backend/utils/dbms/nlohmann/json.hpp | 6
src/test/regress/sql/dbms_tns.sql | 173
src/test/regress/sql/dbms_xmlstore.sql | 20
contrib/postgis/extensions/postgis_topology/Makefile.in | 1
contrib/postgis/liblwgeom/lwalgorithm.c | 24
contrib/postgis/extensions/address_standardizer/std_pg_hash.c | 4
235 files changed, 107,596 insertions(+), 2,799 deletions(-)
diff --git a/.abi-compliance-history b/.abi-compliance-history
new file mode 100644
index 0000000..58c0b0d
--- /dev/null
+++ b/.abi-compliance-history
@@ -0,0 +1,82 @@
+# Reference point for ABI compliance checks
+#
+# This file lists commits on the current branch that break ABI compatibility in
+# ways that have been deemed acceptable (e.g., removing an extern function with
+# no third-party uses). The primary intent of this file is to control the ABI
+# compliance checks on the buildfarm, but it also serves as a central location
+# to document the justification for each.
+#
+# In general, entries should be added reactively after an abi-compliance-check
+# buildfarm failure. It is important to verify the details of the breakage
+# match expectations, as the first entry listed will become the updated ABI
+# baseline point.
+#
+# Add new entries by adding the output of the following to the top of the file:
+#
+# $ git log --pretty=format:"%H%n#%n# %s%n# %cd%n#%n# <ADD JUSTIFICATION HERE>" $ABIBREAKGITHASH -1 --date=iso
+#
+# Be sure to replace "<ADD JUSTIFICATION HERE>" with details of your change and
+# why it is deemed acceptable.
+
+33e3de6d77e87d6c3c6f8f878dd8de42d37c3b8f
+#
+# Add file_extend_method=posix_fallocate,write_zeros.
+# 2026-02-06 17:38:39 +1300
+#
+# Modifying GUC tables isn't really an ABI break: the relevant object has
+# incomplete type so its layout is unknown to other C translation units.
+#
+# Discussion: https://www.postgresql.org/message-id/flat/e1f0cd3b-0164-45f5-9705-e922e59df90f%40dunslane.net#8a350b54012c0042f9869d288e978cfe
+
+492a69e1407029f8c673484f44aa719a63323d77
+#
+# Reject ADD CONSTRAINT NOT NULL if name mismatches existing constraint
+# 2026-02-03 12:33:29 +0100
+#
+# This commit added the constraint name as a parameter to
+# AdjustNotNullInheritance(), which it needed to verify that the new name
+# matches the existing one. PGXN contained no calls to that function.
+
+c6ce4dcf9d3b7a8a89aca386124c473f98fc329e
+#
+# Fix trigger transition table capture for MERGE in CTE queries.
+# 2026-01-24 11:30:48 +0000
+#
+# This commit changed the TransitionCaptureState structure, replacing
+# the "tcs_private" field with 3 separate fields. This structure can
+# only be built using MakeTransitionCaptureState(), and PGXN contained
+# no calls to MakeTransitionCaptureState() or uses of the
+# TransitionCaptureState structure.
+
+bae8ca82fd00603ebafa0658640d6e4dfe20af92
+#
+# Revisit cosmetics of "For inplace update, send nontransactional invalidations."
+# 2025-12-15 12:19:53 -0800
+#
+# This removed a CacheInvalidateHeapTupleInplace() parameter. PGXN contained
+# no calls to that function.
+
+00eb646ea43410e5df77fed96f4a981e66811796
+#
+# Check for CREATE privilege on the schema in CREATE STATISTICS.
+# 2025-11-10 09:00:00 -0600
+#
+# This commit added a parameter to CreateStatistics(). We are unaware of any
+# impacted third-party code.
+
+c8af5019bee5c57502db830f8005a01cba60fee0
+#
+# Fix lookups in pg_{clear,restore}_{attribute,relation}_stats().
+# 2025-10-15 12:47:33 -0500
+#
+# This commit replaced two functions related to lookups/privilege checks for
+# the new stats stuff in v18 with RangeVarGetRelidExtended(). These functions
+# were not intended for use elsewhere, exist in exactly one release (18.0), and
+# do not have any known third-party callers.
+
+9bbcec6030a2744d83311370ec92213fbd76e514
+#
+# Translation updates
+# 2025-09-22 14:18:56 +0200
+#
+# This is the original ABI baseline point for REL_18_STABLE.
diff --git a/.cirrus.star b/.cirrus.star
new file mode 100644
index 0000000..e9bb672
--- /dev/null
+++ b/.cirrus.star
@@ -0,0 +1,143 @@
+"""Additional CI configuration, using the starlark language. See
+https://cirrus-ci.org/guide/programming-tasks/#introduction-into-starlark
+
+See also the starlark specification at
+https://github.com/bazelbuild/starlark/blob/master/spec.md
+
+See also .cirrus.yml and src/tools/ci/README
+"""
+
+load("cirrus", "env", "fs", "re", "yaml")
+
+
+def main():
+ """The main function is executed by cirrus-ci after loading .cirrus.yml and can
+ extend the CI definition further.
+
+ As documented in .cirrus.yml, the final CI configuration is composed of
+
+ 1) the contents of .cirrus.yml
+
+ 2) computed environment variables
+
+ 3) if defined, the contents of the file referenced by the, repository
+ level, REPO_CI_CONFIG_GIT_URL variable (see
+ https://cirrus-ci.org/guide/programming-tasks/#fs for the accepted
+ format)
+
+ 4) .cirrus.tasks.yml
+ """
+
+ output = ""
+
+ # 1) is evaluated implicitly
+
+
+ # Add 2)
+ additional_env = compute_environment_vars()
+ env_fmt = """
+###
+# Computed environment variables start here
+###
+{0}
+###
+# Computed environment variables end here
+###
+"""
+ output += env_fmt.format(yaml.dumps({'env': additional_env}))
+
+
+ # Add 3)
+ repo_config_url = env.get("REPO_CI_CONFIG_GIT_URL")
+ if repo_config_url != None:
+ print("loading additional configuration from \"{}\"".format(repo_config_url))
+ output += config_from(repo_config_url)
+ else:
+ output += "\n# REPO_CI_CONFIG_URL was not set\n"
+
+
+ # Add 4)
+ output += config_from(".cirrus.tasks.yml")
+
+
+ return output
+
+
+def compute_environment_vars():
+ cenv = {}
+
+ ###
+ # Some tasks are manually triggered by default because they might use too
+ # many resources for users of free Cirrus credits, but they can be
+ # triggered automatically by naming them in an environment variable e.g.
+ # REPO_CI_AUTOMATIC_TRIGGER_TASKS="task_name other_task" under "Repository
+ # Settings" on Cirrus CI's website.
+
+ default_manual_trigger_tasks = ['mingw', 'netbsd', 'openbsd']
+
+ repo_ci_automatic_trigger_tasks = env.get('REPO_CI_AUTOMATIC_TRIGGER_TASKS', '')
+ for task in default_manual_trigger_tasks:
+ name = 'CI_TRIGGER_TYPE_' + task.upper()
+ if repo_ci_automatic_trigger_tasks.find(task) != -1:
+ value = 'automatic'
+ else:
+ value = 'manual'
+ cenv[name] = value
+ ###
+
+ ###
+ # Parse "ci-os-only:" tag in commit message and set
+ # CI_{$OS}_ENABLED variable for each OS
+
+ # We want to disable SanityCheck if testing just a specific OS. This
+ # shortens push-wait-for-ci cycle time a bit when debugging operating
+ # system specific failures. Just treating it as an OS in that case
+ # suffices.
+
+ operating_systems = [
+ 'compilerwarnings',
+ 'freebsd',
+ 'linux',
+ 'macos',
+ 'mingw',
+ 'netbsd',
+ 'openbsd',
+ 'sanitycheck',
+ 'windows',
+ ]
+ commit_message = env.get('CIRRUS_CHANGE_MESSAGE')
+ match_re = r"(^|.*\n)ci-os-only: ([^\n]+)($|\n.*)"
+
+ # re.match() returns an array with a tuple of (matched-string, match_1, ...)
+ m = re.match(match_re, commit_message)
+ if m and len(m) > 0:
+ os_only = m[0][2]
+ os_only_list = re.split(r'[, ]+', os_only)
+ else:
+ os_only_list = operating_systems
+
+ for os in operating_systems:
+ os_enabled = os in os_only_list
+ cenv['CI_{0}_ENABLED'.format(os.upper())] = os_enabled
+ ###
+
+ return cenv
+
+
+def config_from(config_src):
+ """return contents of config file `config_src`, surrounded by markers
+ indicating start / end of the included file
+ """
+
+ config_contents = fs.read(config_src)
+ config_fmt = """
+
+###
+# contents of config file `{0}` start here
+###
+{1}
+###
+# contents of config file `{0}` end here
+###
+"""
+ return config_fmt.format(config_src, config_contents)
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
new file mode 100644
index 0000000..1f32c53
--- /dev/null
+++ b/.cirrus.tasks.yml
@@ -0,0 +1,962 @@
+# CI configuration file for CI utilizing cirrus-ci.org
+#
+# For instructions on how to enable the CI integration in a repository and
+# further details, see src/tools/ci/README
+#
+#
+# NB: Different tasks intentionally test with different, non-default,
+# configurations, to increase the chance of catching problems. Each task with
+# non-obvious non-default documents their oddity at the top of the task,
+# prefixed by "SPECIAL:".
+
+
+env:
+ # The lower depth accelerates git clone. Use a bit of depth so that
+ # concurrent tasks and retrying older jobs have a chance of working.
+ CIRRUS_CLONE_DEPTH: 500
+ # Useful to be able to analyse what in a script takes long
+ CIRRUS_LOG_TIMESTAMP: true
+
+ CCACHE_MAXSIZE: "250M"
+
+ # target to test, for all but windows
+ CHECK: check-world PROVE_FLAGS=$PROVE_FLAGS
+ CHECKFLAGS: -Otarget
+ PROVE_FLAGS: --timer
+ # Build test dependencies as part of the build step, to see compiler
+ # errors/warnings in one place.
+ MBUILD_TARGET: all testprep
+ MTEST_ARGS: --print-errorlogs --no-rebuild -C build
+ PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
+ TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
+ PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
+
+
+# What files to preserve in case tests fail
+on_failure_ac: &on_failure_ac
+ log_artifacts:
+ paths:
+ - "**/*.log"
+ - "**/*.diffs"
+ - "**/regress_log_*"
+ type: text/plain
+
+on_failure_meson: &on_failure_meson
+ testrun_artifacts:
+ paths:
+ - "build*/testrun/**/*.log"
+ - "build*/testrun/**/*.diffs"
+ - "build*/testrun/**/regress_log_*"
+ type: text/plain
+
+ # In theory it'd be nice to upload the junit files meson generates, so that
+ # cirrus will nicely annotate the commit. Unfortunately the files don't
+ # contain identifiable file + line numbers right now, so the annotations
+ # don't end up useful. We could probably improve on that with a some custom
+ # conversion script, but ...
+ meson_log_artifacts:
+ path: "build*/meson-logs/*.txt"
+ type: text/plain
+
+
+# To avoid unnecessarily spinning up a lot of VMs / containers for entirely
+# broken commits, have a minimal task that all others depend on.
+#
+# SPECIAL:
+# - Builds with --auto-features=disabled and thus almost no enabled
+# dependencies
+task:
+ name: SanityCheck
+
+ # If a specific OS is requested, don't run the sanity check. This shortens
+ # push-wait-for-ci cycle time a bit when debugging operating system specific
+ # failures. Uses skip instead of only_if, as cirrus otherwise warns about
+ # only_if conditions not matching.
+ skip: $CI_SANITYCHECK_ENABLED == false
+
+ env:
+ CPUS: 4
+ BUILD_JOBS: 8
+ TEST_JOBS: 8
+ IMAGE_FAMILY: pg-ci-trixie
+ CCACHE_DIR: ${CIRRUS_WORKING_DIR}/ccache_dir
+ # no options enabled, should be small
+ CCACHE_MAXSIZE: "150M"
+
+ # While containers would start up a bit quicker, building is a bit
+ # slower. This way we don't have to maintain a container image.
+ <<: *linux_task_template
+
+ ccache_cache:
+ folder: $CCACHE_DIR
+
+ create_user_script: |
+ useradd -m postgres
+ chown -R postgres:postgres .
+ mkdir -p ${CCACHE_DIR}
+ chown -R postgres:postgres ${CCACHE_DIR}
+ echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
+ su postgres -c "ulimit -l -H && ulimit -l -S"
+ # Can't change container's kernel.core_pattern. Postgres user can't write
+ # to / normally. Change that.
+ chown root:postgres /
+ chmod g+rwx /
+
+ configure_script: |
+ su postgres <<-EOF
+ set -e
+ meson setup \
+ --buildtype=debug \
+ --auto-features=disabled \
+ -Dtap_tests=enabled \
+ build
+ EOF
+ build_script: |
+ su postgres <<-EOF
+ set -e
+ ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
+ EOF
+ upload_caches: ccache
+
+ # Run a minimal set of tests. The main regression tests take too long for
+ # this purpose. For now this is a random quick pg_regress style test, and a
+ # tap test that exercises both a frontend binary and the backend.
+ test_minimal_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited
+ meson test $MTEST_ARGS --suite setup
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
+ cube/regress pg_ctl/001_start_stop
+ EOF
+
+ on_failure:
+ <<: *on_failure_meson
+ cores_script: |
+ mkdir -m 770 /tmp/cores
+ find / -maxdepth 1 -type f -name 'core*' -exec mv '{}' /tmp/cores/ \;
+ src/tools/ci/cores_backtrace.sh linux /tmp/cores
+
+
+# SPECIAL:
+# - Uses postgres specific CPPFLAGS that increase test coverage
+# - Specifies configuration options that test reading/writing/copying of node trees
+# - Specifies debug_parallel_query=regress, to catch related issues during CI
+# - Also runs tests against a running postgres instance, see test_running_script
+task:
+ name: FreeBSD - Meson
+
+ env:
+ CPUS: 4
+ BUILD_JOBS: 4
+ TEST_JOBS: 8
+ IMAGE_FAMILY: pg-ci-freebsd
+ DISK_SIZE: 50
+
+ CCACHE_DIR: /tmp/ccache_dir
+ CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
+ CFLAGS: -Og -ggdb
+
+ # Several buildfarm animals enable these options. Without testing them
+ # during CI, it would be easy to cause breakage on the buildfarm with CI
+ # passing.
+ PG_TEST_INITDB_EXTRA_OPTS: >-
+ -c debug_copy_parse_plan_trees=on
+ -c debug_write_read_parse_plan_trees=on
+ -c debug_raw_expression_coverage_test=on
+ -c debug_parallel_query=regress
+ PG_TEST_PG_UPGRADE_MODE: --link
+
+ <<: *freebsd_task_template
+
+ depends_on: SanityCheck
+ only_if: $CI_FREEBSD_ENABLED
+
+ sysinfo_script: |
+ id
+ uname -a
+ ulimit -a -H && ulimit -a -S
+ export
+
+ ccache_cache:
+ folder: $CCACHE_DIR
+ setup_ram_disk_script: src/tools/ci/gcp_ram_disk.sh
+ create_user_script: |
+ pw useradd postgres
+ chown -R postgres:postgres .
+ mkdir -p ${CCACHE_DIR}
+ chown -R postgres:postgres ${CCACHE_DIR}
+ setup_core_files_script: |
+ mkdir -m 770 /tmp/cores
+ chown root:postgres /tmp/cores
+ sysctl kern.corefile='/tmp/cores/%N.%P.core'
+ setup_additional_packages_script: |
+ #pkg install -y ...
+
+ # NB: Intentionally build without -Dllvm. The freebsd image size is already
+ # large enough to make VM startup slow, and even without llvm freebsd
+ # already takes longer than other platforms except for windows.
+ configure_script: |
+ su postgres <<-EOF
+ set -e
+ meson setup \
+ --buildtype=debug \
+ -Dcassert=true -Dinjection_points=true \
+ -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
+ -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
+ build
+ EOF
+ build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
+ upload_caches: ccache
+
+ test_world_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
+ EOF
+
+ # test runningcheck, freebsd chosen because it's currently fast enough
+ test_running_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited
+ meson test $MTEST_ARGS --quiet --suite setup
+ export LD_LIBRARY_PATH="$(pwd)/build/tmp_install/usr/local/pgsql/lib/:$LD_LIBRARY_PATH"
+ mkdir -p build/testrun
+ build/tmp_install/usr/local/pgsql/bin/initdb -N build/runningcheck --no-instructions -A trust
+ echo "include '$(pwd)/src/tools/ci/pg_ci_base.conf'" >> build/runningcheck/postgresql.conf
+ build/tmp_install/usr/local/pgsql/bin/pg_ctl -c -o '-c fsync=off' -D build/runningcheck -l build/testrun/runningcheck.log start
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS} --setup running
+ build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop
+ EOF
+
+ on_failure:
+ # if the server continues running, it often causes cirrus-ci to fail
+ # during upload, as it doesn't expect artifacts to change size
+ stop_running_script: |
+ su postgres <<-EOF
+ set -e
+ build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
+ EOF
+ <<: *on_failure_meson
+ cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
+
+
+task:
+ depends_on: SanityCheck
+
+ env:
+ # Below are experimentally derived to be a decent choice.
+ CPUS: 4
+ BUILD_JOBS: 8
+ TEST_JOBS: 8
+
+ # Default working directory is /tmp, but its total size (1.2 GB) is not
+ # enough, so different working and cache directory are set.
+ CIRRUS_WORKING_DIR: /home/postgres/postgres
+ CCACHE_DIR: /home/postgres/cache
+
+ PATH: /usr/sbin:$PATH
+ CORE_DUMP_DIR: /var/crash
+
+ matrix:
+ - name: NetBSD - Meson
+ # See REPO_CI_AUTOMATIC_TRIGGER_TASKS in .cirrus.star
+ trigger_type: $CI_TRIGGER_TYPE_NETBSD
+ only_if: $CI_NETBSD_ENABLED
+ env:
+ OS_NAME: netbsd
+ IMAGE_FAMILY: pg-ci-netbsd-postgres
+ PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/pkg/lib/pkgconfig'
+ # initdb fails with: 'invalid locale settings' error on NetBSD.
+ # Force 'LANG' and 'LC_*' variables to be 'C'.
+ # See https://postgr.es/m/2490325.1734471752%40sss.pgh.pa.us
+ LANG: "C"
+ LC_ALL: "C"
+ # -Duuid is not set for the NetBSD, see the comment below, above
+ # configure_script, for more information.
+ setup_additional_packages_script: |
+ #pkgin -y install ...
+ <<: *netbsd_task_template
+
+ - name: OpenBSD - Meson
+ # See REPO_CI_AUTOMATIC_TRIGGER_TASKS in .cirrus.star
+ trigger_type: $CI_TRIGGER_TYPE_OPENBSD
+ only_if: $CI_OPENBSD_ENABLED
+ env:
+ OS_NAME: openbsd
+ IMAGE_FAMILY: pg-ci-openbsd-postgres
+ PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig'
+ UUID: -Duuid=e2fs
+ TCL: -Dtcl_version=tcl86
+ CORE_DUMP_EXECUTABLE_DIR: $CIRRUS_WORKING_DIR/build/tmp_install/usr/local/pgsql/bin
+ setup_additional_packages_script: |
+ #pkg_add -I ...
+ # Always core dump to ${CORE_DUMP_DIR}
+ set_core_dump_script: sysctl -w kern.nosuidcoredump=2
+ <<: *openbsd_task_template
+
+ sysinfo_script: |
+ locale
+ id
+ uname -a
+ ulimit -a -H && ulimit -a -S
+ env
+
+ ccache_cache:
+ folder: $CCACHE_DIR
+ setup_ram_disk_script: src/tools/ci/gcp_ram_disk.sh
+ create_user_script: |
+ useradd postgres
+ chown -R postgres:users /home/postgres
+ mkdir -p ${CCACHE_DIR}
+ chown -R postgres:users ${CCACHE_DIR}
+ setup_core_files_script: |
+ mkdir -p ${CORE_DUMP_DIR}
+ chmod -R 770 ${CORE_DUMP_DIR}
+ chown -R postgres:users ${CORE_DUMP_DIR}
+
+ # -Duuid=bsd is not set since 'bsd' uuid option
+ # is not working on NetBSD & OpenBSD. See
+ # https://www.postgresql.org/message-id/17358-89806e7420797025@postgresql.org
+ # And other uuid options are not available on NetBSD.
+ configure_script: |
+ su postgres <<-EOF
+ set -e
+ meson setup \
+ --buildtype=debugoptimized \
+ --pkg-config-path ${PKGCONFIG_PATH} \
+ -Dcassert=true -Dinjection_points=true \
+ -Dssl=openssl ${UUID} ${TCL} \
+ -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
+ build
+ EOF
+
+ build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
+ upload_caches: ccache
+
+ test_world_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
+ EOF
+
+ on_failure:
+ <<: *on_failure_meson
+ cores_script: |
+ # Although we try to configure the OS to core dump inside
+ # ${CORE_DUMP_DIR}, they may not obey this. So, move core files to the
+ # ${CORE_DUMP_DIR} directory.
+ find build/ -type f -name '*.core' -exec mv '{}' ${CORE_DUMP_DIR} \;
+ src/tools/ci/cores_backtrace.sh ${OS_NAME} ${CORE_DUMP_DIR} ${CORE_DUMP_EXECUTABLE_DIR}
+
+
+# configure feature flags, shared between the task running the linux tests and
+# the CompilerWarnings task
+LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
+ --with-gssapi
+ --with-icu
+ --with-ldap
+ --with-libcurl
+ --with-libxml
+ --with-libxslt
+ --with-llvm
+ --with-lz4
+ --with-pam
+ --with-perl
+ --with-python
+ --with-selinux
+ --with-ssl=openssl
+ --with-systemd
+ --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
+ --with-uuid=ossp
+ --with-zstd
+
+LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
+ -Dllvm=enabled
+ -Duuid=e2fs
+
+
+# Check SPECIAL in the matrix: below
+task:
+ env:
+ CPUS: 4
+ BUILD_JOBS: 4
+ TEST_JOBS: 8 # experimentally derived to be a decent choice
+ IMAGE_FAMILY: pg-ci-trixie
+
+ CCACHE_DIR: /tmp/ccache_dir
+ DEBUGINFOD_URLS: "https://debuginfod.debian.net"
+
+ # Enable a reasonable set of sanitizers. Use the linux task for that, as
+ # it's one of the fastest tasks (without sanitizers). Also several of the
+ # sanitizers work best on linux.
+ #
+ # The overhead of alignment sanitizer is low, undefined behaviour has
+ # moderate overhead. Test alignment sanitizer in the meson task, as it
+ # does both 32 and 64 bit builds and is thus more likely to expose
+ # alignment bugs.
+ #
+ # Address sanitizer in contrast is somewhat expensive. Enable it in the
+ # autoconf task, as the meson task tests both 32 and 64bit.
+ #
+ # disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
+ # print_stacktraces=1,verbosity=2, duh
+ # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
+ UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
+ ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0:detect_stack_use_after_return=0
+
+ # SANITIZER_FLAGS is set in the tasks below
+ CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
+ CXXFLAGS: $CFLAGS
+ LDFLAGS: $SANITIZER_FLAGS
+ CC: ccache gcc
+ CXX: ccache g++
+
+ LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
+ LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
+
+ <<: *linux_task_template
+
+ depends_on: SanityCheck
+ only_if: $CI_LINUX_ENABLED
+
+ ccache_cache:
+ folder: ${CCACHE_DIR}
+
+ sysinfo_script: |
+ id
+ uname -a
+ cat /proc/cmdline
+ ulimit -a -H && ulimit -a -S
+ export
+ create_user_script: |
+ useradd -m postgres
+ chown -R postgres:postgres .
+ mkdir -p ${CCACHE_DIR}
+ chown -R postgres:postgres ${CCACHE_DIR}
+ echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
+ su postgres -c "ulimit -l -H && ulimit -l -S"
+ setup_core_files_script: |
+ mkdir -m 770 /tmp/cores
+ chown root:postgres /tmp/cores
+ sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
+
+ setup_hosts_file_script: |
+ cat >> /etc/hosts <<-EOF
+ 127.0.0.1 pg-loadbalancetest
+ 127.0.0.2 pg-loadbalancetest
+ 127.0.0.3 pg-loadbalancetest
+ EOF
+
+ setup_additional_packages_script: |
+ #apt-get update
+ #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
+
+ matrix:
+ # SPECIAL:
+ # - Uses address sanitizer, sanitizer failures are typically printed in
+ # the server log
+ # - Configures postgres with a small segment size
+ - name: Linux - Debian Trixie - Autoconf
+
+ env:
+ SANITIZER_FLAGS: -fsanitize=address
+ PG_TEST_PG_COMBINEBACKUP_MODE: --copy-file-range
+
+ # Normally, the "relation segment" code basically has no coverage in our
+ # tests, because we (quite reasonably) don't generate tables large
+ # enough in tests. We've had plenty bugs that we didn't notice due the
+ # code not being exercised much. Thus specify a very small segment size
+ # here. Use a non-power-of-two segment size, given we currently allow
+ # that.
+ configure_script: |
+ su postgres <<-EOF
+ set -e
+ ./configure \
+ --enable-cassert --enable-injection-points --enable-debug \
+ --enable-tap-tests --enable-nls \
+ --with-segsize-blocks=6 \
+ --with-libnuma \
+ --with-liburing \
+ \
+ ${LINUX_CONFIGURE_FEATURES} \
+ \
+ CLANG="ccache clang"
+ EOF
+ build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
+ upload_caches: ccache
+
+ test_world_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited # default is 0
+ make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
+ EOF
+
+ on_failure:
+ <<: *on_failure_ac
+
+ # SPECIAL:
+ # - Uses undefined behaviour and alignment sanitizers, sanitizer failures
+ # are typically printed in the server log
+ # - Test both 64bit and 32 bit builds
+ # - uses io_method=io_uring
+ - name: Linux - Debian Trixie - Meson
+
+ env:
+ CCACHE_MAXSIZE: "400M" # tests two different builds
+ SANITIZER_FLAGS: -fsanitize=alignment,undefined
+ PG_TEST_INITDB_EXTRA_OPTS: >-
+ -c io_method=io_uring
+
+ configure_script: |
+ su postgres <<-EOF
+ set -e
+ meson setup \
+ --buildtype=debug \
+ -Dcassert=true -Dinjection_points=true \
+ ${LINUX_MESON_FEATURES} \
+ build
+ EOF
+
+ # Also build & test in a 32bit build - it's gotten rare to test that
+ # locally.
+ configure_32_script: |
+ su postgres <<-EOF
+ set -e
+ export CC='ccache gcc -m32'
+ meson setup \
+ --buildtype=debug \
+ -Dcassert=true -Dinjection_points=true \
+ ${LINUX_MESON_FEATURES} \
+ -Dllvm=disabled \
+ --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
+ -DPERL=perl5.40-i386-linux-gnu \
+ -Dlibnuma=disabled \
+ build-32
+ EOF
+
+ build_script: |
+ su postgres <<-EOF
+ set -e
+ ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
+ ninja -C build -t missingdeps
+ EOF
+
+ build_32_script: |
+ su postgres <<-EOF
+ set -e
+ ninja -C build-32 -j${BUILD_JOBS} ${MBUILD_TARGET}
+ ninja -C build -t missingdeps
+ EOF
+
+ upload_caches: ccache
+
+ test_world_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
+ EOF
+ # so that we don't upload 64bit logs if 32bit fails
+ rm -rf build/
+
+ # There's currently no coverage of icu with LANG=C in the buildfarm. We
+ # can easily provide some here by running one of the sets of tests that
+ # way. Newer versions of python insist on changing the LC_CTYPE away
+ # from C, prevent that with PYTHONCOERCECLOCALE.
+ test_world_32_script: |
+ su postgres <<-EOF
+ set -e
+ ulimit -c unlimited
+ PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
+ EOF
+
+ on_failure:
+ <<: *on_failure_meson
+
+ on_failure:
+ cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
+
+
+# NB: macOS is by far the most expensive OS to run CI for, therefore no
+# expensive additional checks should be added.
+#
+# SPECIAL:
+# - Enables --clone for pg_upgrade and pg_combinebackup
+task:
+ name: macOS - Sequoia - Meson
+
+ env:
+ CPUS: 4 # always get that much for cirrusci macOS instances
+ BUILD_JOBS: $CPUS
+ # Test performance regresses noticeably when using all cores. 8 seems to
+ # work OK. See
+ # https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
+ TEST_JOBS: 8
+ IMAGE: ghcr.io/cirruslabs/macos-runner:sequoia
+
+ CIRRUS_WORKING_DIR: ${HOME}/pgsql/
+ CCACHE_DIR: ${HOME}/ccache
+ MACPORTS_CACHE: ${HOME}/macports-cache
+
+ MACOS_PACKAGE_LIST: >-
+ ccache
+ icu
+ kerberos5
+ lz4
+ meson
+ openldap
+ openssl
+ p5.34-io-tty
+ p5.34-ipc-run
+ python312
+ tcl
+ zstd
+
+ CC: ccache cc
+ CXX: ccache c++
+ CFLAGS: -Og -ggdb
+ CXXFLAGS: -Og -ggdb
+
+ PG_TEST_PG_UPGRADE_MODE: --clone
+ PG_TEST_PG_COMBINEBACKUP_MODE: --clone
+
+ <<: *macos_task_template
+
+ depends_on: SanityCheck
+ only_if: $CI_MACOS_ENABLED
+
+ sysinfo_script: |
+ id
+ uname -a
+ ulimit -a -H && ulimit -a -S
+ export
+
+ setup_core_files_script:
+ - mkdir ${HOME}/cores
+ - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
+
+ # Use macports, even though homebrew is installed. The installation
+ # of the additional packages we need would take quite a while with
+ # homebrew, even if we cache the downloads. We can't cache all of
+ # homebrew, because it's already large. So we use macports. To cache
+ # the installation we create a .dmg file that we mount if it already
+ # exists.
+ # XXX: The reason for the direct p5.34* references is that we'd need
+ # the large macport tree around to figure out that p5-io-tty is
+ # actually p5.34-io-tty. Using the unversioned name works, but
+ # updates macports every time.
+ macports_cache:
+ folder: ${MACPORTS_CACHE}
+ fingerprint_script: |
+ # Reinstall packages if the OS major version, the list of the packages
+ # to install or the MacPorts install script changes.
+ sw_vers -productVersion | sed 's/\..*//'
+ echo $MACOS_PACKAGE_LIST
+ md5 src/tools/ci/ci_macports_packages.sh
+ reupload_on_changes: true
+ setup_additional_packages_script: |
+ sh src/tools/ci/ci_macports_packages.sh $MACOS_PACKAGE_LIST
+ # system python doesn't provide headers
+ sudo /opt/local/bin/port select python3 python312
+ # Make macports install visible for subsequent steps
+ echo PATH=/opt/local/sbin/:/opt/local/bin/:$PATH >> $CIRRUS_ENV
+ upload_caches: macports
+
+ ccache_cache:
+ folder: $CCACHE_DIR
+ configure_script: |
+ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
+ meson setup \
+ --buildtype=debug \
+ -Dextra_include_dirs=/opt/local/include \
+ -Dextra_lib_dirs=/opt/local/lib \
+ -Dcassert=true -Dinjection_points=true \
+ -Duuid=e2fs -Ddtrace=auto \
+ build
+
+ build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
+ upload_caches: ccache
+
+ test_world_script: |
+ ulimit -c unlimited # default is 0
+ ulimit -n 1024 # default is 256, pretty low
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
+
+ on_failure:
+ <<: *on_failure_meson
+ cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
+
+
+WINDOWS_ENVIRONMENT_BASE: &WINDOWS_ENVIRONMENT_BASE
+ env:
+ # Half the allowed per-user CPU cores
+ CPUS: 4
+
+ # The default cirrus working dir is in a directory msbuild complains about
+ CIRRUS_WORKING_DIR: "c:/cirrus"
+ # git's tar doesn't deal with drive letters, see
+ # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
+ TAR: "c:/windows/system32/tar.exe"
+ # Avoids port conflicts between concurrent tap test runs
+ PG_TEST_USE_UNIX_SOCKETS: 1
+ PG_REGRESS_SOCK_DIR: "c:/cirrus/"
+ DISK_SIZE: 50
+ IMAGE_FAMILY: pg-ci-windows-ci
+
+ sysinfo_script: |
+ chcp
+ systeminfo
+ powershell -Command get-psdrive -psprovider filesystem
+ set
+
+
+task:
+ name: Windows - Server 2022, VS 2019 - Meson & ninja
+ << : *WINDOWS_ENVIRONMENT_BASE
+
+ env:
+ TEST_JOBS: 8 # wild guess, data based value welcome
+
+ # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
+ # prevents crash reporting from working unless binaries do SetErrorMode()
+ # themselves. Furthermore, it appears that either python or, more likely,
+ # the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very
+ # occasionally *trigger* a crash on process exit - which is hard to debug,
+ # given that it explicitly prevents crash dumps from working...
+ # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
+ CIRRUS_WINDOWS_ERROR_MODE: 0x8001
+
+ <<: *windows_task_template
+
+ depends_on: SanityCheck
+ only_if: $CI_WINDOWS_ENABLED
+
+ setup_additional_packages_script: |
+ REM choco install -y --no-progress ...
+
+ setup_hosts_file_script: |
+ echo 127.0.0.1 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
+ echo 127.0.0.2 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
+ echo 127.0.0.3 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
+ type c:\Windows\System32\Drivers\etc\hosts
+
+ configure_script: |
+ vcvarsall x64
+ meson setup --backend ninja --buildtype debug -Dcassert=true -Dinjection_points=true -Db_pch=true -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% build
+
+ build_script: |
+ vcvarsall x64
+ ninja -C build %MBUILD_TARGET%
+ ninja -C build -t missingdeps
+
+ check_world_script: |
+ vcvarsall x64
+ meson test %MTEST_ARGS% --num-processes %TEST_JOBS%
+
+ on_failure:
+ <<: *on_failure_meson
+ crashlog_artifacts:
+ path: "crashlog-*.txt"
+ type: text/plain
+
+
+task:
+ << : *WINDOWS_ENVIRONMENT_BASE
+ name: Windows - Server 2022, MinGW64 - Meson
+
+ # See REPO_CI_AUTOMATIC_TRIGGER_TASKS in .cirrus.star.
+ trigger_type: $CI_TRIGGER_TYPE_MINGW
+
+ depends_on: SanityCheck
+ only_if: $CI_MINGW_ENABLED
+
+ env:
+ TEST_JOBS: 4 # higher concurrency causes occasional failures
+ CCACHE_DIR: C:/msys64/ccache
+ CCACHE_MAXSIZE: "500M"
+ CCACHE_SLOPPINESS: pch_defines,time_macros
+ CCACHE_DEPEND: 1
+ # for some reason mingw plpython cannot find its installation without this
+ PYTHONHOME: C:/msys64/ucrt64
+ # prevents MSYS bash from resetting error mode
+ MSYS: winjitdebug
+ # Start bash in current working directory
+ CHERE_INVOKING: 1
+ BASH: C:\msys64\usr\bin\bash.exe -l
+
+ <<: *windows_task_template
+
+ ccache_cache:
+ folder: ${CCACHE_DIR}
+
+ setup_additional_packages_script: |
+ REM C:\msys64\usr\bin\pacman.exe -S --noconfirm ...
+
+ mingw_info_script: |
+ %BASH% -c "where gcc"
+ %BASH% -c "gcc --version"
+ %BASH% -c "where perl"
+ %BASH% -c "perl --version"
+
+ # disable -Dnls as the number of files it creates cause a noticable slowdown
+ configure_script: |
+ %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
+
+ build_script: |
+ %BASH% -c "ninja -C build ${MBUILD_TARGET}"
+
+ upload_caches: ccache
+
+ test_world_script: |
+ %BASH% -c "meson test %MTEST_ARGS% --num-processes %TEST_JOBS%"
+
+ on_failure:
+ <<: *on_failure_meson
+ crashlog_artifacts:
+ path: "crashlog-*.txt"
+ type: text/plain
+
+
+task:
+ name: CompilerWarnings
+
+ # To limit unnecessary work only run this once the SanityCheck
+ # succeeds. This is particularly important for this task as we intentionally
+ # use always: to continue after failures.
+ depends_on: SanityCheck
+ only_if: $CI_COMPILERWARNINGS_ENABLED
+
+ env:
+ CPUS: 4
+ BUILD_JOBS: 4
+ IMAGE_FAMILY: pg-ci-trixie
+
+ # Use larger ccache cache, as this task compiles with multiple compilers /
+ # flag combinations
+ CCACHE_MAXSIZE: "1G"
+ CCACHE_DIR: "/tmp/ccache_dir"
+
+ LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
+ LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
+
+ <<: *linux_task_template
+
+ sysinfo_script: |
+ id
+ uname -a
+ cat /proc/cmdline
+ ulimit -a -H && ulimit -a -S
+ gcc -v
+ clang -v
+ export
+
+ ccache_cache:
+ folder: $CCACHE_DIR
+
+ setup_additional_packages_script: |
+ #apt-get update
+ #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
+
+ ###
+ # Test that code can be built with gcc/clang without warnings
+ ###
+
+ setup_script: echo "COPT=-Werror" > src/Makefile.custom
+
+ # Trace probes have a history of getting accidentally broken. Use the
+ # different compilers to build with different combinations of dtrace on/off
+ # and cassert on/off.
+
+ # gcc, cassert off, dtrace on
+ always:
+ gcc_warning_script: |
+ time ./configure \
+ --cache gcc.cache \
+ --enable-dtrace \
+ ${LINUX_CONFIGURE_FEATURES} \
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
+ make -s -j${BUILD_JOBS} clean
+ time make -s -j${BUILD_JOBS} world-bin
+
+ # gcc, cassert on, dtrace off
+ always:
+ gcc_a_warning_script: |
+ time ./configure \
+ --cache gcc.cache \
+ --enable-cassert \
+ ${LINUX_CONFIGURE_FEATURES} \
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
+ make -s -j${BUILD_JOBS} clean
+ time make -s -j${BUILD_JOBS} world-bin
+
+ # clang, cassert off, dtrace off
+ always:
+ clang_warning_script: |
+ time ./configure \
+ --cache clang.cache \
+ ${LINUX_CONFIGURE_FEATURES} \
+ CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
+ make -s -j${BUILD_JOBS} clean
+ time make -s -j${BUILD_JOBS} world-bin
+
+ # clang, cassert on, dtrace on
+ always:
+ clang_a_warning_script: |
+ time ./configure \
+ --cache clang.cache \
+ --enable-cassert \
+ --enable-dtrace \
+ ${LINUX_CONFIGURE_FEATURES} \
+ CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
+ make -s -j${BUILD_JOBS} clean
+ time make -s -j${BUILD_JOBS} world-bin
+
+ # cross-compile to windows
+ always:
+ mingw_cross_warning_script: |
+ time ./configure \
+ --host=x86_64-w64-mingw32ucrt \
+ --enable-cassert \
+ --without-icu \
+ CC="ccache x86_64-w64-mingw32ucrt-gcc" \
+ CXX="ccache x86_64-w64-mingw32ucrt-g++"
+ make -s -j${BUILD_JOBS} clean
+ time make -s -j${BUILD_JOBS} world-bin
+
+ ###
+ # Verify docs can be built
+ ###
+ # XXX: Only do this if there have been changes in doc/ since last build
+ always:
+ docs_build_script: |
+ time ./configure \
+ --cache gcc.cache \
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
+ make -s -j${BUILD_JOBS} clean
+ time make -s -j${BUILD_JOBS} -C doc
+
+ ###
+ # Verify headerscheck / cpluspluscheck succeed
+ #
+ # - Don't use ccache, the files are uncacheable, polluting ccache's
+ # cache
+ # - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
+ ###
+ always:
+ headers_headerscheck_script: |
+ time ./configure \
+ ${LINUX_CONFIGURE_FEATURES} \
+ --quiet \
+ CC="gcc" CXX"=g++" CLANG="clang"
+ make -s -j${BUILD_JOBS} clean
+ time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
+ headers_cpluspluscheck_script: |
+ time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
+
+ always:
+ upload_caches: ccache
diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644
index 0000000..3f75852
--- /dev/null
+++ b/.cirrus.yml
@@ -0,0 +1,91 @@
+# CI configuration file for CI utilizing cirrus-ci.org
+#
+# For instructions on how to enable the CI integration in a repository and
+# further details, see src/tools/ci/README
+#
+#
+# The actual CI tasks are defined in .cirrus.tasks.yml. To make the compute
+# resources for CI configurable on a repository level, the "final" CI
+# configuration is the combination of:
+#
+# 1) the contents of this file
+#
+# 2) computed environment variables
+#
+# Used to enable/disable tasks based on the execution environment. See
+# .cirrus.star: compute_environment_vars()
+#
+# 3) if defined, the contents of the file referenced by the, repository
+# level, REPO_CI_CONFIG_GIT_URL variable (see
+# https://cirrus-ci.org/guide/programming-tasks/#fs for the accepted
+# format)
+#
+# This allows running tasks in a different execution environment than the
+# default, e.g. to have sufficient resources for cfbot.
+#
+# 4) .cirrus.tasks.yml
+#
+# This composition is done by .cirrus.star
+
+
+env:
+ # Source of images / containers
+ GCP_PROJECT: pg-ci-images
+ IMAGE_PROJECT: $GCP_PROJECT
+ CONTAINER_REPO: us-docker.pkg.dev/${GCP_PROJECT}/ci
+ DISK_SIZE: 25
+
+
+# Define how to run various types of tasks.
+
+# VMs provided by cirrus-ci. Each user has a limited number of "free" credits
+# for testing.
+cirrus_community_vm_template: &cirrus_community_vm_template
+ compute_engine_instance:
+ image_project: $IMAGE_PROJECT
+ image: family/$IMAGE_FAMILY
+ platform: $PLATFORM
+ cpu: $CPUS
+ disk: $DISK_SIZE
+
+
+default_linux_task_template: &linux_task_template
+ env:
+ PLATFORM: linux
+ <<: *cirrus_community_vm_template
+
+
+default_freebsd_task_template: &freebsd_task_template
+ env:
+ PLATFORM: freebsd
+ <<: *cirrus_community_vm_template
+
+default_netbsd_task_template: &netbsd_task_template
+ env:
+ PLATFORM: netbsd
+ <<: *cirrus_community_vm_template
+
+default_openbsd_task_template: &openbsd_task_template
+ env:
+ PLATFORM: openbsd
+ <<: *cirrus_community_vm_template
+
+
+default_windows_task_template: &windows_task_template
+ env:
+ PLATFORM: windows
+ <<: *cirrus_community_vm_template
+
+
+# macos workers provided by cirrus-ci
+default_macos_task_template: &macos_task_template
+ env:
+ PLATFORM: macos
+ macos_instance:
+ image: $IMAGE
+
+
+# Contents of REPO_CI_CONFIG_GIT_URL, if defined, will be inserted here,
+# followed by the contents .cirrus.tasks.yml. This allows
+# REPO_CI_CONFIG_GIT_URL to override how the task types above will be
+# executed, e.g. using a custom compute account or permanent workers.
diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000..ab6208b
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,19 @@
+;; see also src/tools/editors/emacs.samples for more complete settings
+
+((c-mode . ((c-basic-offset . 4)
+ (c-file-style . "bsd")
+ (fill-column . 78)
+ (indent-tabs-mode . t)
+ (tab-width . 4)))
+ (nxml-mode . ((fill-column . 78)
+ (indent-tabs-mode . nil)))
+ (perl-mode . ((perl-indent-level . 4)
+ (perl-continued-statement-offset . 2)
+ (perl-continued-brace-offset . -2)
+ (perl-brace-offset . 0)
+ (perl-brace-imaginary-offset . 0)
+ (perl-label-offset . -2)
+ (indent-tabs-mode . t)
+ (tab-width . 4)))
+ (sgml-mode . ((fill-column . 78)
+ (indent-tabs-mode . nil))))
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..e20d15d
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,176 @@
+root = true
+
+[*]
+indent_size = tab
+
+[*]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = unset
+tab_width = unset
+
+[*.[chly]]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = tab
+tab_width = 4
+
+[*.cpp]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = tab
+tab_width = 4
+
+[*.pl]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = tab
+tab_width = 4
+
+[*.pm]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = tab
+tab_width = 4
+
+[*.po]
+trim_trailing_whitespace = true
+insert_final_newline = unset
+indent_style = space
+tab_width = unset
+
+[*.py]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+tab_width = unset
+indent_size = 4
+
+[*.sgml]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+tab_width = unset
+indent_size = 1
+
+[*.xml]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+tab_width = unset
+indent_size = 2
+
+[*.xsl]
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+tab_width = unset
+indent_size = 1
+
+[*.data]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[contrib/pgcrypto/sql/pgp-armor.sql]
+trim_trailing_whitespace = unset
+insert_final_newline = true
+indent_style = unset
+tab_width = unset
+
+[src/backend/catalog/sql_features.txt]
+trim_trailing_whitespace = unset
+insert_final_newline = true
+indent_style = unset
+tab_width = unset
+
+[*.out]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/interfaces/ecpg/test/expected/*]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[configure]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[ppport.h]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/backend/jit/llvm/SectionMemoryManager.cpp]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/backend/jit/llvm/SectionMemoryManager.LICENSE]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/backend/regex/COPYRIGHT]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/backend/snowball/libstemmer/*.c]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/backend/utils/mb/Unicode/*-std.txt]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/include/jit/SectionMemoryManager.h]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/include/snowball/libstemmer/*]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/timezone/data/*]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/tools/pg_bsd_indent/*]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/tools/pg_bsd_indent/tests/*]
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+
+[src/tools/pg_bsd_indent/*.[ch]]
+trim_trailing_whitespace = unset
+insert_final_newline = unset
+indent_style = unset
+tab_width = 8
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000..88aa34a
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,393 @@
+# As of git 2.23, git-blame supports ignoring specific commits. This is useful
+# with commits that make bulk formatting changes without truly changing any
+# code.
+#
+# This file lists ignorable pgindent, pgperltidy, and reformat-dat-files
+# related commits only. Please don't add commits that are not in this
+# category.
+#
+# You can use the ignore list file by running:
+#
+# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
+#
+# Add new entries by adding the output of the following to the top of the file:
+#
+# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso
+
+2795f5a5428fd292996fd155f16a57b0db3df8f4 # 2025-10-21 09:56:26 -0500
+# Re-pgindent brin.c.
+
+17a5ca58eb119a33e81e57b72618236538932167 # 2025-09-13 14:50:02 -0500
+# Re-pgindent nbtpreprocesskeys.c after commit 796962922e.
+
+07448b3969d55a2081cdafafc23f68df3392f220 # 2025-07-01 15:24:19 +0200
+# Fix indentation in pg_numa code
+
+b27644bade0348d0dafd3036c47880a349fe9332 # 2025-06-15 13:04:24 -0400
+# Sync typedefs.list with the buildfarm.
+
+4672b6223910687b2aab075bcd2dd54ce90d5171 # 2025-06-01 14:55:24 -0400
+# Run pgindent on the previous commit.
+
+918e7287ed20eb1fe280ab6c4056ccf94dcd53a8 # 2025-04-30 19:18:30 +1200
+# Fix broken indentation
+
+e1a8b1ad587112e67fdc5aa7b388631dde4dbdda # 2025-04-04 09:38:22 -0500
+# Re-pgindent pg_largeobject.c after commit 0d6c477664.
+
+796bdda484c838313959f65e2b700f14ac7c0e66 # 2025-03-18 09:02:36 -0400
+# Fix indentation again.
+
+203c1b4cc49455364b6bcab8034900d1c016b9cd # 2025-03-17 16:06:17 -0400
+# Fix indentation.
+
+b955df443405e056fd9047ef819a1465654f9d79 # 2025-03-13 12:41:44 +1300
+# Fix indentation issue
+
+76aa615943049c04efd36ab4765c06eda89cdfea # 2025-01-31 16:44:24 +0900
+# Fix bad indentation introduced in commit d47cbf474
+
+6e826278f1ebd9967c0f8adda29c8960a812e344 # 2025-01-13 11:27:32 +0900
+# Fix pgindent damage
+
+301de6a6f609cb3ad2d9d31fd8db9ae6c71e6dea # 2024-12-25 17:55:42 +0100
+# Partial pgindent of .l and .y files
+
+53dcba9be5746cc126bdb949bf81c29ea2cfc24d # 2024-11-21 21:40:17 +0100
+# pgindent run
+
+a7f2f6adc240a2823c2344b89e90bb630dea8803 # 2024-10-16 12:21:13 -0700
+# Whitespace fixup from generated unicode tables.
+
+7f7474a8e4002ac9fd4979cc7b16b50b70b70c28 # 2024-09-27 11:14:31 -0400
+# Reindent pg_verifybackup.c.
+
+7229ebe011dff3f418251a4836f6d098923aa1e1 # 2024-08-26 16:16:12 -0700
+# Fix identation.
+
+2b03cfeea47834913ff769124f4deba88140f662 # 2024-08-21 09:58:11 -0400
+# Fix pgindent damage
+
+97add39c038bbdb9082b416ddf04cd20b0d20bf5 # 2024-08-15 11:41:46 -0400
+# Clean up indentation and whitespace inconsistencies in ecpg.
+
+8de5ca1dc9fa809102acd1983ee19159d0bc469f # 2024-08-12 10:57:03 +0300
+# Fix bad indentation introduced in commit f011e82c2c
+
+c883453cb29cb40c1e59c3c54d159c5e744da8a9 # 2024-07-26 12:00:04 -0400
+# Fix indentation.
+
+47ecbfdfcc71e41d7dcc35f0be04f8adbe88397f # 2024-07-15 15:17:04 -0700
+# Fix bad indentation introduced in 43cd30bcd1c
+
+b48f275f18d7da4f4863888ad047cbd699698880 # 2024-06-28 10:51:05 -0400
+# pgindent, because I forgot to do that.
+
+da256a4a7fdcca35fe7ca808686ad3de6ee22306 # 2024-05-14 16:34:50 -0400
+# Pre-beta mechanical code beautification.
+
+64e401b62b1559d617db5c1e1070d7a05e794c27 # 2024-03-25 14:18:33 +0100
+# Fix indentation from a11f330b5
+
+0984a3b851abe89bec6c3eff51b03038808e1997 # 2024-03-05 11:16:23 -0800
+# Run pgindent again on the same file.
+
+b406af1806e9fc5c090e58282c7d98f22a4b397f # 2024-03-05 10:58:24 -0800
+# Run pgindent for commit ef4cfdce0e.
+
+dd7ea37c435e10f9c5aa3fb257a05c08814a4ad2 # 2024-03-04 14:37:35 -0500
+# Fix pgindent damage.
+
+3d47b75546d1ef70145f58e162a96f7e0c649389 # 2024-02-22 08:00:58 +0100
+# pgindent fix
+
+49e7c6f78ed608c5d5454080ae19c0e7f1b09a04 # 2024-02-09 11:05:01 +0900
+# Fix indentation of copyto.c
+
+96c019ffa3f883d139709ea0cfe76dc1bce0f1f8 # 2024-01-13 13:54:11 -0500
+# Re-pgindent catcache.c after previous commit.
+
+611806cd726fc92989ac918eac48fd8d684869c7 # 2023-10-26 09:20:54 +0200
+# Add trailing commas to enum definitions
+
+e9718b4bd3e4234ffd5a4907a903367fc483c843 # 2023-10-16 09:36:31 +0900
+# Fix code indentation violations in e83d1b0c40cc
+
+01529c7040088db2718628d0814058598152bd39 # 2023-10-16 13:32:41 +1300
+# Fix comment from commit 22655aa231.
+
+b6a77c6a6ccf698787201b001cbbbf9c89fe5715 # 2023-10-11 17:14:31 -0400
+# Reindent comment in GenericXLogFinish().
+
+bc6041b61f6678d32a5cfb70744653cd8f8d01c0 # 2023-08-30 15:56:22 +0900
+# Fix code indentation vioaltion introduced in commit 3c662643c4.
+
+89be0b89ae60c63856fd26d82a104781540e2312 # 2023-08-15 17:45:00 +0900
+# Fix code indentation vioaltion introduced in commit 9e9931d2b.
+
+5dc456b7dda4f7d0d7735b066607c190c74d174a # 2023-08-11 20:43:34 +0900
+# Fix code indentation violations introduced by recent commit
+
+62e9af4c63fbd36fb9af8450fb44bece76d7766f # 2023-07-25 12:35:58 +0530
+# Fix code indentation vioaltion introduced in commit d38ad8e31d.
+
+4e465aac36ce9a9533c68dbdc83e67579880e628 # 2023-07-18 14:04:31 +0900
+# Fix indentation in twophase.c
+
+328f492d2565cfbe383f13a69425d751fd79415f # 2023-07-13 22:26:10 +0900
+# Fix code indentation violation in commit b6e1157e7d
+
+69a674a170058e63e8178aec8a36a673efce8801 # 2023-07-06 11:49:18 +0530
+# Fix code indentation vioaltion introduced in commit cc32ec24fd.
+
+a4cfeeca5a97f2b5969c31aa69ba775af95ee5a3 # 2023-07-03 12:47:49 +0200
+# Fix code indentation violations
+
+b334612b8aee9f9a34378982d8938b201dfad323 # 2023-06-20 09:50:43 -0400
+# Pre-beta2 mechanical code beautification.
+
+0245f8db36f375326c2bae0c3420d3c77714e72d # 2023-05-19 17:24:48 -0400
+# Pre-beta mechanical code beautification.
+
+b6dfee28f2b44e28b123b77a91fb05c47da63501 # 2023-03-09 15:09:45 +0900
+# Run pgindent on libpq's fe-auth.c, fe-auth-scram.c and fe-connect.c
+
+250c8ee07ede8a104ae1471f6ebca204d94267dd # 2023-01-13 15:23:17 -0800
+# Manual cleanup and pgindent of pgstat and bufmgr related code
+
+b2e6e768230be334b12dae536ba4c147fba4e9c9 # 2022-09-08 14:01:13 +0700
+# Run perltidy over Catalog.pm
+
+82d0ffae3219e4bc153a1306ce23013d168e04a2 # 2022-06-30 11:03:03 -0400
+# pgindent run prior to branching v15.
+
+23e7b38bfe396f919fdb66057174d29e17086418 # 2022-05-12 15:17:30 -0400
+# Pre-beta mechanical code beautification.
+
+a3a75b982b5bb6fba95ad8b3d48e70439dcd2329 # 2022-03-19 11:42:22 -0700
+# pgstat: run pgindent on pgstat.c/h.
+
+d231be00cbf29bf24e5b4fc79e587982bbc00ebb # 2022-02-16 09:22:34 +0200
+# Run pgindent on xlog.c.
+
+e1c1c30f635390b6a3ae4993e8cac213a33e6e3f # 2021-06-28 11:05:54 -0400
+# Pre branch pgindent / pgperltidy run
+
+def5b065ff22a16a80084587613599fe15627213 # 2021-05-12 13:14:10 -0400
+# Initial pgindent and pgperltidy run for v14.
+
+ed43677e20369040ca4e50c698010c39d5ac0f47 # 2021-01-19 08:10:13 +0530
+# pgindent worker.c.
+
+8b411b8ff41566a1aa601d1f05aeebbebbdb4a54 # 2021-01-13 16:14:38 -0500
+# Run reformat-dat-files to declutter the catalog data files.
+
+b5d69b7c22ee4c44b8bb99cfa0466ffaf3b5fab9 # 2020-06-07 16:57:08 -0400
+# pgindent run prior to branching v13.
+
+fa27dd40d5c5f56a1ee837a75c97549e992e32a4 # 2020-05-16 11:54:51 -0400
+# Run pgindent with new pg_bsd_indent version 2.1.1.
+
+e02ad575d8ab6b44500d2a3fd8c3212345e3aa2b # 2020-05-16 11:49:14 -0400
+# Final pgindent run with pg_bsd_indent version 2.1.
+
+5cbfce562f7cd2aab0cdc4694ce298ec3567930e # 2020-05-14 13:06:50 -0400
+# Initial pgindent and pgperltidy run for v13.
+
+b78542b9e975494bba6db2d2802439c3328d5ef7 # 2020-02-15 14:58:30 -0500
+# Run "make reformat-dat-files".
+
+c9d29775195922136c09cc980bb1b7091bf3d859 # 2020-01-30 13:42:14 -0300
+# Clean up newlines following left parentheses
+
+9e1c9f959422192bbe1b842a2a1ffaf76b080196 # 2019-07-01 12:37:52 -0400
+# pgindent run prior to branching v12.
+
+db6e2b4c52ade524f3db419d75084728e96e1f9c # 2019-05-22 13:36:19 -0400
+# Initial pgperltidy run for v12.
+
+8255c7a5eeba8f1a38b7a431c04909bde4f5e67d # 2019-05-22 13:04:48 -0400
+# Phase 2 pgindent run for v12.
+
+be76af171cdb3e7465c4ef234af403f97ad79b7b # 2019-05-22 12:55:34 -0400
+# Initial pgindent run for v12.
+
+d8421390996dcd762383a28e57d1f3f16cc5f76f # 2018-06-30 12:28:55 -0400
+# perltidy run prior to branching
+
+1e9c8580904625576871eeb2efec7f04d4c3bc1c # 2018-06-30 12:25:49 -0400
+# pgindent run prior to branching
+
+bdf46af748d0f15f257c99bf06e9e25aba6a24f9 # 2018-04-26 14:47:16 -0400
+# Post-feature-freeze pgindent run.
+
+f04d4ac919b9ae9b57e977523e4b40979aa8b951 # 2018-04-25 14:00:19 -0400
+# Reindent Perl files with perltidy version 20170521.
+
+eaedf0df7197b21182f6c341a44e4fdaa3cd6ea6 # 2017-11-29 09:24:24 -0500
+# Update typedefs.list and re-run pgindent
+
+21d304dfedb4f26d0d6587d9ac39b1b5c499bb55 # 2017-08-14 17:29:33 -0400
+# Final pgindent + perltidy run for v10.
+
+382ceffdf7f620d8f2d50e451b4167d291ae2348 # 2017-06-21 15:35:54 -0400
+# Phase 3 of pgindent updates.
+
+c7b8998ebbf310a156aa38022555a24d98fdbfb4 # 2017-06-21 15:19:25 -0400
+# Phase 2 of pgindent updates.
+
+e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 # 2017-06-21 14:39:04 -0400
+# Initial pgindent run with pg_bsd_indent version 2.0.
+
+9ef2dbefc7fb3ac22e1528bc22a41a5c6c6a9539 # 2017-06-21 14:09:24 -0400
+# Final pgindent run with old pg_bsd_indent (version 1.3).
+
+651902deb1551db8b401fdeab9bdb8a61cee7f9f # 2017-06-13 13:05:59 -0400
+# Re-run pgindent.
+
+ce554810329b9b8e862eade08b598148931eb456 # 2017-05-17 19:01:23 -0400
+# Post-PG 10 beta1 pgperltidy run
+
+a6fd7b7a5f7bf3a8aa3f3d076cf09d922c1c6dd2 # 2017-05-17 16:31:56 -0400
+# Post-PG 10 beta1 pgindent run
+
+b5bce6c1ec6061c8a4f730d927e162db7e2ce365 # 2016-08-15 13:42:51 -0400
+# Final pgindent + perltidy run for 9.6.
+
+3be0a62ffe58f0753d190cbe22acbeb8b4926b85 # 2016-06-12 04:19:56 -0400
+# Finish pgindent run for 9.6: Perl files.
+
+4bc424b968058c7f0aa685821d7039e86faac99c # 2016-06-09 18:02:36 -0400
+# pgindent run for 9.6
+
+de94e2af184e25576b13cbda8cf825118835d1cd # 2016-04-06 11:34:02 -0400
+# Run pgindent on a batch of (mostly-planner-related) source files.
+
+be060cbcd42737693f6fd425db4c139121181cce # 2016-03-09 13:51:11 -0500
+# Re-pgindent vacuumlazy.c.
+
+0231f838565d2921a0960407c4240237ba1d56ae # 2016-02-08 15:17:40 -0500
+# Re-pgindent varlena.c.
+
+d0cd7bda97a626049aa7d247374909c52399c413 # 2016-02-04 22:30:08 -0500
+# postgres_fdw: pgindent run.
+
+8d290c8ec6c182a4df1d089c21fe84c7912f01fe # 2016-01-17 19:13:18 -0500
+# Re-pgindent a few files.
+
+befa3e648ce018d84cd2a0df701927c56fe3da4e # 2015-05-24 21:45:01 -0400
+# Revert 9.5 pgindent changes to atomics directory files
+
+807b9e0dff663c5da875af7907a5106c0ff90673 # 2015-05-23 21:35:49 -0400
+# pgindent run for 9.5
+
+785941cdc359c6e595201ffb0df9d28f3f7173a4 # 2015-03-26 14:03:25 -0400
+# Tweak __attribute__-wrapping macros for better pgindent results.
+
+7584649a1c58029a83a7a57d74cedcf1af434c97 # 2014-10-17 12:19:05 -0400
+# Re-pgindent src/bin/pg_dump/*.
+
+84288a86ac74dbeae486b6ff699c017f7d9517bb # 2014-05-06 20:39:28 -0400
+# With ecpg exclusion removed, re-run pgindent for 9.4
+
+0a7832005792fa6dad171f9cadb8d587fe0dd800 # 2014-05-06 12:12:18 -0400
+# pgindent run for 9.4
+
+9af4159fce6654aa0e081b00d02bca40b978745c # 2013-05-29 16:58:43 -0400
+# pgindent run for release 9.3 This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
+
+927d61eeff78363ea3938c818d07e511ebaf75cf # 2012-06-10 15:20:04 -0400
+# Run pgindent on 9.2 source tree in preparation for first 9.3 commit-fest.
+
+6560407c7db2c7e32926a46f5fb52175ac10d9e5 # 2011-06-09 14:32:50 -0400
+# Pgindent run before 9.1 beta2.
+
+bf50caf105a901c4f83ac1df3cdaf910c26694a4 # 2011-04-10 11:42:00 -0400
+# pgindent run before PG 9.1 beta 1.
+
+239d769e7e05e0a5ef3bd6828e93e22ef3962780 # 2010-07-06 19:19:02 +0000
+# pgindent run for 9.0, second run
+
+65e806cba1f0f154d51caa7478e7192ce58d1056 # 2010-02-26 02:01:40 +0000
+# pgindent run for 9.0
+
+d7471402794266078953f1bd113dab4913d631a1 # 2009-06-11 14:49:15 +0000
+# 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list provided by Andrew.
+
+f6e8730d11ddfc720eda1dde23794d262ad8cc08 # 2007-11-15 22:25:18 +0000
+# Re-run pgindent with updated list of typedefs. (Updated README should avoid this problem in the future.)
+
+fdf5a5efb7b28c13085fe7313658de8d7b9914f6 # 2007-11-15 21:14:46 +0000
+# pgindent run for 8.3.
+
+f99a569a2ee3763b4ae174e81250c95ca0fdcbb6 # 2006-10-04 00:30:14 +0000
+# pgindent run for 8.2.
+
+436a2956d80db29ac1dff640b631620d856b4f70 # 2005-11-22 18:17:34 +0000
+# Re-run pgindent, fixing a problem where comment lines after a blank comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting).
+
+1dc34982511d91ef8a2b71bdcb870f067c1b3da9 # 2005-10-15 02:49:52 +0000
+# Standard pgindent run for 8.1.
+
+b3364fc81b78538006da3b3ad5680530d2af8c47 # 2005-09-22 20:44:36 +0000
+# pgindent new GIST index code, per request from Tom.
+
+15d3f9f6b7849a70281f151f0def7a6d335767d7 # 2004-08-30 02:54:42 +0000
+# Another pgindent run with lib typedefs added.
+
+b6b71b85bc45b49005b5aec87cba2c33fc8baf49 # 2004-08-29 05:07:03 +0000
+# Pgindent run for 8.0.
+
+46785776c42143af8f5433bb580ff13f2a9f65e1 # 2003-08-08 21:42:59 +0000
+# Another pgindent run with updated typedefs.
+
+089003fb462fcce46c02bf47322b429f73c33c50 # 2003-08-04 00:43:34 +0000
+# pgindent run.
+
+e50f52a074bdf0d6a9dc384840e641c4c0b0bb1a # 2002-09-04 20:31:48 +0000
+# pgindent run.
+
+ea08e6cd5542cb269ecd3e735f1dfa3bb61fbc4f # 2001-11-05 17:46:40 +0000
+# New pgindent run with fixes suggested by Tom. Patch manually reviewed, initdb/regression tests pass.
+
+6783b2372ef13c141649840a836ff0a954ea1d4d # 2001-10-28 06:26:15 +0000
+# Another pgindent run. Fixes enum indenting, and improves #endif spacing. Also adds space for one-line comments.
+
+b81844b1738c584d92330a5ccd0fbd8b603d2886 # 2001-10-25 05:50:21 +0000
+# pgindent run on all C files. Java run to follow. initdb/regression tests pass.
+
+0686d49da0a34ad92f61f791ea1039dec5d20f41 # 2001-03-22 06:16:21 +0000
+# Remove dashes in comments that don't need them, rewrap with pgindent.
+
+9e1552607a9dc6bc23e43d46770a9063ade4f3f0 # 2001-03-22 04:01:46 +0000
+# pgindent run. Make it all clean.
+
+52f77df613cea1803ce86321c37229626d9f213c # 2000-04-12 17:17:23 +0000
+# Ye-old pgindent run. Same 4-space tabs.
+
+fcff1cdf4eadbc6dcba4b9a2cd09f38f466ffa31 # 1999-05-25 22:43:53 +0000
+# Another pgindent run. Sorry folks.
+
+07842084fe3e11041f83563c851236395f481470 # 1999-05-25 16:15:34 +0000
+# pgindent run over code.
+
+fa1a8d6a97068295fe30ac646aec7493a6305bc2 # 1998-09-01 04:40:42 +0000
+# OK, folks, here is the pgindent output.
+
+af74855a608da4cd7ef88ceb2241ec1c75537f39 # 1998-09-01 03:29:17 +0000
+# Renaming cleanup, no pgindent yet.
+
+a32450a5855eed4bfd756ef292ee45d3c754665b # 1998-02-26 04:46:47 +0000
+# pgindent run before 6.3 release, with Thomas' requested changes.
+
+59f6a57e59fe8353f9edaa3703516ea67e06672b # 1997-09-08 21:56:23 +0000
+# Used modified version of indent that understands over 100 typedefs.
+
+075cede74858a9a04e97097b1ccd555121516c20 # 1997-09-08 20:59:27 +0000
+# Add typdefs to pgindent run.
+
+319dbfa7364721d3343af03a7ce063c2a2c9d385 # 1997-09-08 02:41:22 +0000
+# Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting.
+
+1ccd423235a48739d6f7a4d7889705b5f9ecc69b # 1997-09-07 05:04:48 +0000
+# Massive commit to run PGINDENT on all *.c and *.h files.
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..4e26bbf
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,40 @@
+# IMPORTANT: After updating this file, also run src/tools/generate_editorconfig.py
+
+* whitespace=space-before-tab,trailing-space
+*.[chly] whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
+*.cpp whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
+*.pl whitespace=space-before-tab,trailing-space,tabwidth=4
+*.pm whitespace=space-before-tab,trailing-space,tabwidth=4
+*.po whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eof
+*.py whitespace=space-before-tab,trailing-space,tab-in-indent
+*.sgml whitespace=space-before-tab,trailing-space,tab-in-indent
+*.xml whitespace=space-before-tab,trailing-space,tab-in-indent
+*.xsl whitespace=space-before-tab,trailing-space,tab-in-indent
+
+# Avoid confusing ASCII underlines with leftover merge conflict markers
+README conflict-marker-size=48
+README.* conflict-marker-size=48
+
+# Certain data files that contain special whitespace, and other special cases
+*.data -whitespace
+contrib/pgcrypto/sql/pgp-armor.sql whitespace=-blank-at-eol
+src/backend/catalog/sql_features.txt whitespace=space-before-tab,blank-at-eof,-blank-at-eol
+
+# Test output files that contain extra whitespace
+*.out -whitespace
+src/interfaces/ecpg/test/expected/* -whitespace
+
+# These files are maintained or generated elsewhere. We take them as is.
+configure -whitespace
+ppport.h -whitespace
+src/backend/jit/llvm/SectionMemoryManager.cpp -whitespace
+src/backend/jit/llvm/SectionMemoryManager.LICENSE -whitespace
+src/backend/regex/COPYRIGHT -whitespace
+src/backend/snowball/libstemmer/*.c -whitespace
+src/backend/utils/mb/Unicode/*-std.txt -whitespace
+src/include/jit/SectionMemoryManager.h -whitespace
+src/include/snowball/libstemmer/* -whitespace
+src/timezone/data/* -whitespace
+src/tools/pg_bsd_indent/* -whitespace
+src/tools/pg_bsd_indent/tests/* -whitespace
+src/tools/pg_bsd_indent/*.[ch] whitespace=-blank-at-eol,-blank-at-eof,tabwidth=8
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..150bec6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,68 @@
+# This file contains ignores for build artifacts from standard builds.
+# Auxiliary files from local workflows, your preferred editor, etc. should
+# be ignored locally using $GIT_DIR/info/exclude or ~/.gitexclude.
+
+# Global excludes across all subdirectories
+*.o
+*.obj
+*.bc
+*.so
+*.so.[0-9]
+*.so.[0-9].[0-9]
+*.so.[0-9].[0-9][0-9]
+*.dylib
+*.dll
+*.exp
+*.a
+*.mo
+*.pot
+objfiles.txt
+.deps/
+*.gcno
+*.gcda
+*.gcov
+*.gcov.out
+lcov*.info
+coverage/
+coverage-html-stamp
+*.vcproj
+*.vcxproj
+win32ver.rc
+*.exe
+lib*dll.def
+lib*.pc
+.vscode
+*.su
+
+# Local excludes in root directory
+/GNUmakefile
+/config.cache
+/config.log
+/config.status
+/pgsql.sln
+/pgsql.sln.cache
+/Debug/
+/Release/
+/tmp_install/
+/portlock/
+build_report.log
+results/
+tmp_check/
+tmp_install/
+*.diffs
+*.log
+regression.out
+hist.txt
+mk_all.sh
+shist.txt
+rudb_data1.tar.gz
+
+# pg_dgrid build artifacts
+/pg_dgrid/client/dgridc
+/pg_dgrid/dgrid.ld.so.conf
+/pg_dgrid/libs/lib/*.so.*.*.*
+/pg_dgrid/server/config/dgridd.service
+/pg_dgrid/server/dgridd
+
+
+.cursorrules
\ No newline at end of file
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..22d95d3
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1 @@
+Álvaro Herrera <alvherre@alvh.no-ip.org>
diff --git a/configure b/configure
index a6c2460..adaa3c5 100755
--- a/configure
+++ b/configure
@@ -649,6 +649,7 @@
CFLAGS_CRC
LIBOBJS
OPENSSL
+PCRE2
ZSTD
LZ4
UUID_LIBS
@@ -696,6 +697,9 @@
STRIP
LDFLAGS_SL
LDFLAGS_EX
+PCRE2_LIBS
+PCRE2_CFLAGS
+with_pcre2
ZSTD_LIBS
ZSTD_CFLAGS
with_zstd
@@ -885,6 +889,7 @@
with_zlib
with_lz4
with_zstd
+with_pcre2
with_ssl
with_openssl
enable_largefile
@@ -922,6 +927,8 @@
LZ4_LIBS
ZSTD_CFLAGS
ZSTD_LIBS
+PCRE2_CFLAGS
+PCRE2_LIBS
LDFLAGS_EX
LDFLAGS_SL
PERL
@@ -1605,6 +1612,7 @@
--without-zlib do not use Zlib
--with-lz4 build with LZ4 support
--with-zstd build with ZSTD support
+ --with-pcre2 build with PCRE2 support
--with-ssl=LIB use LIB for SSL/TLS support (openssl)
--with-openssl obsolete spelling of --with-ssl=openssl
@@ -1650,6 +1658,9 @@
LZ4_LIBS linker flags for LZ4, overriding pkg-config
ZSTD_CFLAGS C compiler flags for ZSTD, overriding pkg-config
ZSTD_LIBS linker flags for ZSTD, overriding pkg-config
+ PCRE2_CFLAGS
+ C compiler flags for PCRE2, overriding pkg-config
+ PCRE2_LIBS linker flags for PCRE2, overriding pkg-config
LDFLAGS_EX extra linker flags for linking executables only
LDFLAGS_SL extra linker flags for linking shared libraries only
PERL Perl program
@@ -9823,6 +9834,148 @@
esac
done
fi
+
+#
+# PCRE2
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PCRE2 support" >&5
+$as_echo_n "checking whether to build with PCRE2 support... " >&6; }
+
+
+
+# Check whether --with-pcre2 was given.
+if test "${with_pcre2+set}" = set; then :
+ withval=$with_pcre2;
+ case $withval in
+ yes)
+
+$as_echo "#define USE_PCRE2 1" >>confdefs.h
+
+ ;;
+ no)
+ :
+ ;;
+ *)
+ as_fn_error $? "no argument expected for --with-pcre2 option" "$LINENO" 5
+ ;;
+ esac
+
+else
+ with_pcre2=no
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pcre2" >&5
+$as_echo "$with_pcre2" >&6; }
+
+if test "$with_pcre2" = yes; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpcre2-8" >&5
+$as_echo_n "checking for libpcre2-8... " >&6; }
+
+if test -n "$PCRE2_CFLAGS"; then
+ pkg_cv_PCRE2_CFLAGS="$PCRE2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libpcre2-8") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_PCRE2_CFLAGS=`$PKG_CONFIG --cflags "libpcre2-8" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$PCRE2_LIBS"; then
+ pkg_cv_PCRE2_LIBS="$PCRE2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libpcre2-8") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_PCRE2_LIBS=`$PKG_CONFIG --libs "libpcre2-8" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ PCRE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre2-8" 2>&1`
+ else
+ PCRE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre2-8" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$PCRE2_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (libpcre2-8) were not met:
+
+$PCRE2_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables PCRE2_CFLAGS
+and PCRE2_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables PCRE2_CFLAGS
+and PCRE2_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ PCRE2_CFLAGS=$pkg_cv_PCRE2_CFLAGS
+ PCRE2_LIBS=$pkg_cv_PCRE2_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+ # We only care about -I, -D, and -L switches;
+ # note that -lpcre2-8 will be added by AC_CHECK_LIB below.
+ for pgac_option in $PCRE2_CFLAGS; do
+ case $pgac_option in
+ -I*|-D*) INCLUDES="$INCLUDES $pgac_option";;
+ esac
+ done
+ INCLUDES="$INCLUDES -DPCRE2_CODE_UNIT_WIDTH=8"
+ for pgac_option in $PCRE2_LIBS; do
+ case $pgac_option in
+ -L*) LIBDIRS="$LIBDIRS $pgac_option";;
+ esac
+ done
+fi
+
#
# Assignments
#
@@ -13439,6 +13592,56 @@
fi
+if test "$with_pcre2" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre2_compile_8 in -lpcre2-8" >&5
+$as_echo_n "checking for pcre2_compile_8 in -lpcre2-8... " >&6; }
+if ${ac_cv_lib_pcre2_8_pcre2_compile_8+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcre2-8 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pcre2_compile_8 ();
+int
+main ()
+{
+return pcre2_compile_8 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pcre2_8_pcre2_compile_8=yes
+else
+ ac_cv_lib_pcre2_8_pcre2_compile_8=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre2_8_pcre2_compile_8" >&5
+$as_echo "$ac_cv_lib_pcre2_8_pcre2_compile_8" >&6; }
+if test "x$ac_cv_lib_pcre2_8_pcre2_compile_8" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPCRE2_8 1
+_ACEOF
+
+ LIBS="-lpcre2-8 $LIBS"
+
+else
+ as_fn_error $? "library 'pcre2-8' is required for PCRE2 support" "$LINENO" 5
+fi
+
+fi
+
# Note: We can test for libldap_r only after we know PTHREAD_LIBS
if test "$with_ldap" = yes ; then
_LIBS="$LIBS"
@@ -14134,6 +14337,71 @@
fi
+if test -z "$PCRE2"; then
+ for ac_prog in pcre2
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PCRE2+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PCRE2 in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PCRE2="$PCRE2" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PCRE2="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PCRE2=$ac_cv_path_PCRE2
+if test -n "$PCRE2"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCRE2" >&5
+$as_echo "$PCRE2" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$PCRE2" && break
+done
+
+else
+ # Report the value of PCRE2 in configure's output in all cases.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCRE2" >&5
+$as_echo_n "checking for PCRE2... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCRE2" >&5
+$as_echo "$PCRE2" >&6; }
+fi
+
+if test "$with_pcre2" = yes; then
+ ac_fn_c_check_header_mongrel "$LINENO" "pcre2.h" "ac_cv_header_pcre2_h" "$ac_includes_default"
+if test "x$ac_cv_header_pcre2_h" = xyes; then :
+
+else
+ as_fn_error $? "pcre2.h header file is required for PCRE2" "$LINENO" 5
+fi
+
+
+fi
+
if test "$with_gssapi" = yes ; then
for ac_header in gssapi/gssapi.h
do :
diff --git a/configure.ac b/configure.ac
index 3b87da0..8c1a4b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1189,6 +1189,32 @@
esac
done
fi
+
+#
+# PCRE2
+#
+AC_MSG_CHECKING([whether to build with PCRE2 support])
+PGAC_ARG_BOOL(with, pcre2, no, [build with PCRE2 support],
+ [AC_DEFINE([USE_PCRE2], 1, [Define to 1 to build with PCRE2 support (--with-pcre2)])])
+AC_MSG_RESULT([$with_pcre2])
+AC_SUBST(with_pcre2)
+if test "$with_pcre2" = yes; then
+ PKG_CHECK_MODULES(PCRE2, libpcre2-8)
+ # We only care about -I, -D, and -L switches;
+ # note that -lpcre2-8 will be added by AC_CHECK_LIB below.
+ for pgac_option in $PCRE2_CFLAGS; do
+ case $pgac_option in
+ -I*|-D*) INCLUDES="$INCLUDES $pgac_option";;
+ esac
+ done
+ INCLUDES="$INCLUDES -DPCRE2_CODE_UNIT_WIDTH=8"
+ for pgac_option in $PCRE2_LIBS; do
+ case $pgac_option in
+ -L*) LIBDIRS="$LIBDIRS $pgac_option";;
+ esac
+ done
+fi
+
#
# Assignments
#
@@ -1438,6 +1464,10 @@
AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
fi
+if test "$with_pcre2" = yes ; then
+ AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [], [AC_MSG_ERROR([library 'pcre2-8' is required for PCRE2 support])])
+fi
+
# Note: We can test for libldap_r only after we know PTHREAD_LIBS
if test "$with_ldap" = yes ; then
_LIBS="$LIBS"
@@ -1580,6 +1610,11 @@
AC_CHECK_HEADER(zstd.h, [], [AC_MSG_ERROR([zstd.h header file is required for ZSTD])])
fi
+PGAC_PATH_PROGS(PCRE2, pcre2)
+if test "$with_pcre2" = yes; then
+ AC_CHECK_HEADER(pcre2.h, [], [AC_MSG_ERROR([pcre2.h header file is required for PCRE2])])
+fi
+
if test "$with_gssapi" = yes ; then
AC_CHECK_HEADERS(gssapi/gssapi.h, [],
[AC_CHECK_HEADERS(gssapi.h, [], [AC_MSG_ERROR([gssapi.h header file is required for GSSAPI])])])
diff --git a/contrib/pg_hint_plan/docs/make.bat b/contrib/pg_hint_plan/docs/make.bat
index 954237b..32bb245 100644
--- a/contrib/pg_hint_plan/docs/make.bat
+++ b/contrib/pg_hint_plan/docs/make.bat
@@ -1,35 +1,35 @@
-@ECHO OFF
-
-pushd %~dp0
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set SOURCEDIR=.
-set BUILDDIR=_build
-
-%SPHINXBUILD% >NUL 2>NUL
-if errorlevel 9009 (
- echo.
- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
- echo.installed, then set the SPHINXBUILD environment variable to point
- echo.to the full path of the 'sphinx-build' executable. Alternatively you
- echo.may add the Sphinx directory to PATH.
- echo.
- echo.If you don't have Sphinx installed, grab it from
- echo.https://www.sphinx-doc.org/
- exit /b 1
-)
-
-if "%1" == "" goto help
-
-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
-goto end
-
-:help
-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
-
-:end
-popd
+@ECHO OFF
+
+pushd %~dp0
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set SOURCEDIR=.
+set BUILDDIR=_build
+
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+ echo.
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+ echo.installed, then set the SPHINXBUILD environment variable to point
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
+ echo.may add the Sphinx directory to PATH.
+ echo.
+ echo.If you don't have Sphinx installed, grab it from
+ echo.https://www.sphinx-doc.org/
+ exit /b 1
+)
+
+if "%1" == "" goto help
+
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+
+:end
+popd
diff --git a/contrib/pg_hint_plan/expected/init_new.out b/contrib/pg_hint_plan/expected/init_new.out
index 55f2625..a0f7ade 100644
--- a/contrib/pg_hint_plan/expected/init_new.out
+++ b/contrib/pg_hint_plan/expected/init_new.out
@@ -18,7 +18,7 @@
create table tab17(c17 integer);
create table tab18(c18 integer);
create table tab19(c19 integer);
-
+
create index idx0 on tab0 (c0);
create index idx1 on tab1 (c1);
create index idx2 on tab2 (c2);
diff --git a/contrib/pg_hint_plan/sql/init_new.sql b/contrib/pg_hint_plan/sql/init_new.sql
index ee82243..dee1b3f 100644
--- a/contrib/pg_hint_plan/sql/init_new.sql
+++ b/contrib/pg_hint_plan/sql/init_new.sql
@@ -19,7 +19,7 @@
create table tab17(c17 integer);
create table tab18(c18 integer);
create table tab19(c19 integer);
-
+
create index idx0 on tab0 (c0);
create index idx1 on tab1 (c1);
create index idx2 on tab2 (c2);
diff --git a/contrib/pg_query_state/LICENSE b/contrib/pg_query_state/LICENSE
index a1b3a2e..a9b474c 100644
--- a/contrib/pg_query_state/LICENSE
+++ b/contrib/pg_query_state/LICENSE
@@ -1,11 +1,11 @@
-pg_query_state is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
-
-Copyright (c) 2016-2025, Postgres Professional
-Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
-Portions Copyright (c) 1994, The Regents of the University of California
-
-Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
-
-IN NO EVENT SHALL POSTGRES PROFESSIONAL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF POSTGRES PROFESSIONAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-POSTGRES PROFESSIONAL SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND POSTGRES PROFESSIONAL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+pg_query_state is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
+
+Copyright (c) 2016-2025, Postgres Professional
+Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL POSTGRES PROFESSIONAL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF POSTGRES PROFESSIONAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+POSTGRES PROFESSIONAL SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND POSTGRES PROFESSIONAL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
diff --git a/contrib/pg_query_state/Makefile b/contrib/pg_query_state/Makefile
index ea4e976..0c07818 100644
--- a/contrib/pg_query_state/Makefile
+++ b/contrib/pg_query_state/Makefile
@@ -5,8 +5,6 @@
OBJS = pg_query_state.o signal_handler.o $(WIN32RES)
EXTENSION = pg_query_state
EXTVERSION = 1.2
-DATA = pg_query_state--1.0--1.1.sql \
- pg_query_state--1.1--1.2.sql
DATA_built = $(EXTENSION)--$(EXTVERSION).sql
PGFILEDESC = "pg_query_state - facility to track progress of plan execution"
diff --git a/contrib/pg_query_state/meson.build b/contrib/pg_query_state/meson.build
index 17e2cd8..6e3c784 100644
--- a/contrib/pg_query_state/meson.build
+++ b/contrib/pg_query_state/meson.build
@@ -32,8 +32,6 @@
install_data(
'pg_query_state.control',
- 'pg_query_state--1.0--1.1.sql',
- 'pg_query_state--1.1--1.2.sql',
kwargs: contrib_data_args,
)
diff --git a/contrib/pg_wait_sampling/LICENSE b/contrib/pg_wait_sampling/LICENSE
index a7f7741..46c4b8f 100644
--- a/contrib/pg_wait_sampling/LICENSE
+++ b/contrib/pg_wait_sampling/LICENSE
@@ -1,11 +1,11 @@
-pg_wait_sampling is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
-
-Copyright (c) 2015-2025, Postgres Professional
-Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
-Portions Copyright (c) 1994, The Regents of the University of California
-
-Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
-
-IN NO EVENT SHALL POSTGRES PROFESSIONAL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF POSTGRES PROFESSIONAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-POSTGRES PROFESSIONAL SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND POSTGRES PROFESSIONAL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+pg_wait_sampling is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
+
+Copyright (c) 2015-2025, Postgres Professional
+Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL POSTGRES PROFESSIONAL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF POSTGRES PROFESSIONAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+POSTGRES PROFESSIONAL SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND POSTGRES PROFESSIONAL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
diff --git a/contrib/pldotnet/docs/references.bib b/contrib/pldotnet/docs/references.bib
index b6d1024..6655fc0 100644
--- a/contrib/pldotnet/docs/references.bib
+++ b/contrib/pldotnet/docs/references.bib
@@ -1,39 +1,39 @@
-@online{PostgreSQL2022,
- author = {PostgreSQL},
- title = {{PostgreSQL 15 - Documentation}},
- year = 2022,
- url = {https://www.postgresql.org/docs/15/intro-whatis.html},
- urldate = {2022-12-30}
-}
-
-@online{DotNet2023,
- author = {Microsoft},
- title = {{What is .Net?}},
- year = 2023,
- url = {https://dotnet.microsoft.com/en-us/learn/dotnet/what-is-dotnet},
- urldate = {2023-01-10}
-}
-
-@online{PLJava,
- author = {Tada AB},
- title = {{PL/Java: stored procedures, triggers, and functions for PostgreSQL}},
- year = 2023,
- url = {https://tada.github.io/pljava/},
- urldate = {2023-01-10}
-}
-
-@online{PLLua,
- author = {RhodiumToad},
- title = {{pllua: Embeds Lua into PostgreSQL as a procedural language module}},
- year = 2023,
- url = {https://github.com/pllua/pllua},
- urldate = {2023-01-10}
-}
-
-@online{PLR,
- author = {Joseph E. Conway},
- title = {{PL/R - R Procedural Language for PostgreSQL}},
- year = 2023,
- url = {https://github.com/postgres-plr/plr},
- urldate = {2023-01-10}
+@online{PostgreSQL2022,
+ author = {PostgreSQL},
+ title = {{PostgreSQL 15 - Documentation}},
+ year = 2022,
+ url = {https://www.postgresql.org/docs/15/intro-whatis.html},
+ urldate = {2022-12-30}
+}
+
+@online{DotNet2023,
+ author = {Microsoft},
+ title = {{What is .Net?}},
+ year = 2023,
+ url = {https://dotnet.microsoft.com/en-us/learn/dotnet/what-is-dotnet},
+ urldate = {2023-01-10}
+}
+
+@online{PLJava,
+ author = {Tada AB},
+ title = {{PL/Java: stored procedures, triggers, and functions for PostgreSQL}},
+ year = 2023,
+ url = {https://tada.github.io/pljava/},
+ urldate = {2023-01-10}
+}
+
+@online{PLLua,
+ author = {RhodiumToad},
+ title = {{pllua: Embeds Lua into PostgreSQL as a procedural language module}},
+ year = 2023,
+ url = {https://github.com/pllua/pllua},
+ urldate = {2023-01-10}
+}
+
+@online{PLR,
+ author = {Joseph E. Conway},
+ title = {{PL/R - R Procedural Language for PostgreSQL}},
+ year = 2023,
+ url = {https://github.com/postgres-plr/plr},
+ urldate = {2023-01-10}
}
\ No newline at end of file
diff --git a/contrib/pldotnet/dotnet_src/FSharp/PlDotNET.FSharp.fsproj b/contrib/pldotnet/dotnet_src/FSharp/PlDotNET.FSharp.fsproj
index 015a512..f774aa6 100644
--- a/contrib/pldotnet/dotnet_src/FSharp/PlDotNET.FSharp.fsproj
+++ b/contrib/pldotnet/dotnet_src/FSharp/PlDotNET.FSharp.fsproj
@@ -1,24 +1,24 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <Authors>Brick Abode</Authors>
- <Description>PlDotNET.FSharp includes classes and methods for dynamically compiling F# code.</Description>
- <TargetFramework>$(TargetFramework)</TargetFramework>
- <EnableDynamicLoading>true</EnableDynamicLoading>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
-
- <ItemGroup>
- <Compile Include="VirtualFileSystem.fs" />
- <Compile Include="FSharpCompiler.fs" />
- </ItemGroup>
-
- <ItemGroup>
- <PackageReference Include="FSharp.Compiler.Service" Version="41.0.7" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\Common\PlDotNET.Common.csproj" />
- </ItemGroup>
-
-</Project>
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <Authors>Brick Abode</Authors>
+ <Description>PlDotNET.FSharp includes classes and methods for dynamically compiling F# code.</Description>
+ <TargetFramework>$(TargetFramework)</TargetFramework>
+ <EnableDynamicLoading>true</EnableDynamicLoading>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Compile Include="VirtualFileSystem.fs" />
+ <Compile Include="FSharpCompiler.fs" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="FSharp.Compiler.Service" Version="41.0.7" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Common\PlDotNET.Common.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/contrib/pldotnet/dotnet_src/Templates/UserFunctionProject.tfsproj b/contrib/pldotnet/dotnet_src/Templates/UserFunctionProject.tfsproj
index 09823de..b7fb95c 100644
--- a/contrib/pldotnet/dotnet_src/Templates/UserFunctionProject.tfsproj
+++ b/contrib/pldotnet/dotnet_src/Templates/UserFunctionProject.tfsproj
@@ -1,29 +1,29 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>$TargetFramework$</TargetFramework>
- <ImplicitUsings>enable</ImplicitUsings>
- <Nullable>enable</Nullable>
- </PropertyGroup>
-
- <ItemGroup>
- <Compile Include="Program.fs" />
- </ItemGroup>
-
- <ItemGroup>
- <Reference Include="PlDotNET.Common">
- <HintPath>$PlDotNET.Common.dll$</HintPath>
- </Reference>
- <Reference Include="Npgsql">
- <HintPath>$Npgsql.dll$</HintPath>
- </Reference>
- <Reference Include="NpgsqlTypes">
- <HintPath>$NpgsqlTypes.dll$</HintPath>
- </Reference>
- </ItemGroup>
-
- <PropertyGroup>
- <CodeAnalysisRuleSet>stylecop.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
-
-</Project>
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>$TargetFramework$</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Compile Include="Program.fs" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Reference Include="PlDotNET.Common">
+ <HintPath>$PlDotNET.Common.dll$</HintPath>
+ </Reference>
+ <Reference Include="Npgsql">
+ <HintPath>$Npgsql.dll$</HintPath>
+ </Reference>
+ <Reference Include="NpgsqlTypes">
+ <HintPath>$NpgsqlTypes.dll$</HintPath>
+ </Reference>
+ </ItemGroup>
+
+ <PropertyGroup>
+ <CodeAnalysisRuleSet>stylecop.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+
+</Project>
diff --git a/contrib/pldotnet/tests/csharp/DotNetTestProject/CSharpTest.csproj b/contrib/pldotnet/tests/csharp/DotNetTestProject/CSharpTest.csproj
index 9cd1c81..61bc266 100644
--- a/contrib/pldotnet/tests/csharp/DotNetTestProject/CSharpTest.csproj
+++ b/contrib/pldotnet/tests/csharp/DotNetTestProject/CSharpTest.csproj
@@ -1,24 +1,24 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>$(TargetFramework)</TargetFramework>
- <ImplicitUsings>enable</ImplicitUsings>
- <Nullable>enable</Nullable>
- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All">
- <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
- <PrivateAssets>all</PrivateAssets>
- </PackageReference>
- </ItemGroup>
-
- <PropertyGroup>
- <CodeAnalysisRuleSet>..\..\..\dotnet_src\stylecop.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\..\..\dotnet_src\npgsql\src\Npgsql\Npgsql.csproj" />
- </ItemGroup>
-</Project>
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>$(TargetFramework)</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
+ </ItemGroup>
+
+ <PropertyGroup>
+ <CodeAnalysisRuleSet>..\..\..\dotnet_src\stylecop.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\dotnet_src\npgsql\src\Npgsql\Npgsql.csproj" />
+ </ItemGroup>
+</Project>
diff --git a/contrib/pldotnet/tests/csharp/DotNetTestProject/Program.cs b/contrib/pldotnet/tests/csharp/DotNetTestProject/Program.cs
index 1cf86ad..102cb19 100644
--- a/contrib/pldotnet/tests/csharp/DotNetTestProject/Program.cs
+++ b/contrib/pldotnet/tests/csharp/DotNetTestProject/Program.cs
@@ -1,689 +1,689 @@
-// <copyright file="Program.cs" company="Brick Abode">
-//
-// PL/.NET (pldotnet) - PostgreSQL support for .NET C# and F# as
-// procedural languages (PL)
-//
-//
-// Copyright (c) 2023 Brick Abode
-//
-// This code is subject to the terms of the PostgreSQL License.
-// The full text of the license can be found in the LICENSE file
-// at the top level of the pldotnet repository.
-//
-// </copyright>
-
-using System;
-using System.Collections;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.Text;
-using NpgsqlTypes;
-
-#pragma warning disable CS8602
-#pragma warning disable CS8625
-#pragma warning disable CS8605
-#pragma warning disable CS8600
-
-namespace TestDLLFunctions
-{
- public class TestClass
- {
- public static int FlatArray(Array originalArray, ref Array flatArray, int[] auxiliar = null, int contEl = 0, int loc = 1)
- {
- if (contEl >= originalArray.Length)
- {
- return contEl;
- }
- else if (contEl == 0 || auxiliar == null)
- {
- auxiliar = new int[originalArray.Rank];
- }
-
- int ndim = originalArray.Rank;
- int[] dim = new int[ndim];
- for (int i = 0; i < ndim; i++)
- {
- dim[i] = originalArray.GetLength(i);
- }
-
- if (loc == 1)
- {
- for (int i = 0; i < dim[ndim - loc]; i++)
- {
- flatArray.SetValue(originalArray.GetValue(auxiliar), contEl++);
- auxiliar[ndim - loc] += 1;
- }
- }
-
- for (int i = 1; i < loc; i++)
- {
- auxiliar[ndim - loc] += 1;
- if (auxiliar[ndim - loc] < dim[ndim - loc])
- {
- contEl = FlatArray(originalArray, ref flatArray, auxiliar, contEl, i);
- }
- }
-
- auxiliar[ndim - loc] = 0;
- contEl = FlatArray(originalArray, ref flatArray, auxiliar, contEl, ++loc);
- return contEl;
- }
-
- public static BitArray? modifybit(BitArray? a)
- {
- if (a == null)
- {
- return null;
- }
-
- a[0] = !a[0];
- a[^1] = !a[^1];
- return a;
- }
-
- public static BitArray? modifyvarbit(BitArray? a)
- {
- if (a == null)
- {
- return null;
- }
-
- a[0] = !a[0];
- a[^1] = !a[^1];
- return a;
- }
-
- public static bool? booleanand(bool? a, bool? b)
- {
- a ??= false;
- b ??= false;
-
- return a & b;
- }
-
- public static byte[]? byteaconversions(byte[]? a, byte[]? b)
- {
- UTF8Encoding utf8_e = new();
- if (a == null && b == null)
- {
- return null;
- }
-
- if (a == null)
- {
- return b;
- }
-
- if (b == null)
- {
- return a;
- }
-
- string s1 = utf8_e.GetString(a, 0, a.Length);
- string s2 = utf8_e.GetString(b, 0, b.Length);
- string result = s1 + " " + s2;
- return utf8_e.GetBytes(result);
- }
-
- public static DateTime? setnewdate(DateTime? orig_timestamp, DateOnly? new_date)
- {
- if (orig_timestamp == null)
- {
- orig_timestamp = new DateTime(2022, 1, 1, 8, 30, 20);
- }
-
- if (new_date == null)
- {
- new_date = new DateOnly(2023, 12, 25);
- }
-
- int new_day = ((DateOnly)new_date).Day;
- int new_month = ((DateOnly)new_date).Month;
- int new_year = ((DateOnly)new_date).Year;
- DateTime new_timestamp = new(new_year, new_month, new_day, ((DateTime)orig_timestamp).Hour, ((DateTime)orig_timestamp).Minute, ((DateTime)orig_timestamp).Second);
- return new_timestamp;
- }
-
- public static double? sumdoublearray(Array doubles)
- {
- Array flatten_doubles = Array.CreateInstance(typeof(object), doubles.Length);
- TestClass.FlatArray(doubles, ref flatten_doubles);
- double double_sum = 0;
- for (int i = 0; i < flatten_doubles.Length; i++)
- {
- if (flatten_doubles.GetValue(i) == null)
- {
- continue;
- }
-
- double_sum += (double)flatten_doubles.GetValue(i);
- }
-
- return double_sum;
- }
-
- public static double? sumdouble(double? a, double? b)
- {
- a ??= 0;
- b ??= 0;
- return a + b;
- }
-
- public static short? sum2smallint(short? a, short? b)
- {
- a ??= 0;
- b ??= 0;
- return (short)(a + b); // C# requires short cast
- }
-
- public static int? sum2integer(int? a, int? b)
- {
- a ??= 0;
- b ??= 0;
- return a + b;
- }
-
- public static long? sum2bigint(long? a, long? b)
- {
- a ??= 0;
- b ??= 0;
- return a + b;
- }
-
- public static Array? updatearraypolygonindex(Array values_array, NpgsqlPolygon desired, Array index)
- {
- int[] arrayInteger = index.Cast<int>().ToArray();
- values_array.SetValue(desired, arrayInteger);
- return values_array;
- }
-
- public static Array? updatejsonarrayindex(Array values_array, string desired, Array index)
- {
- int[] arrayInteger = index.Cast<int>().ToArray();
- values_array.SetValue(desired, arrayInteger);
- return values_array;
- }
-
- public static Array? increasemoney(Array values_array)
- {
- Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
- TestClass.FlatArray(values_array, ref flatten_values);
- for (int i = 0; i < flatten_values.Length; i++)
- {
- if (flatten_values.GetValue(i) == null)
- {
- continue;
- }
-
- decimal orig_value = (decimal)flatten_values.GetValue(i);
- decimal new_value = orig_value + 1;
- flatten_values.SetValue((decimal)new_value, i);
- }
-
- return flatten_values;
- }
-
- public static Array? increasemacaddress8(Array values_array)
- {
- Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
- TestClass.FlatArray(values_array, ref flatten_values);
- for (int i = 0; i < flatten_values.Length; i++)
- {
- if (flatten_values.GetValue(i) == null)
- {
- continue;
- }
-
- PhysicalAddress orig_value = (PhysicalAddress)flatten_values.GetValue(i);
- byte[] bytes = orig_value.GetAddressBytes();
- bytes[0] += 1;
- PhysicalAddress new_value = new(bytes);
- flatten_values.SetValue((PhysicalAddress)new_value, i);
- }
-
- return flatten_values;
- }
-
- public static Array? increasecidraddress(Array values_array)
- {
- Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
- TestClass.FlatArray(values_array, ref flatten_values);
- for (int i = 0; i < flatten_values.Length; i++)
- {
- if (flatten_values.GetValue(i) == null)
- {
- continue;
- }
-
- (IPAddress address, int netmask) = ((IPAddress Address, int Netmask))flatten_values.GetValue(i);
- byte[] bytes = address.GetAddressBytes();
- bytes[0] += 1;
- (IPAddress Address, int Netmask) new_value = (new IPAddress(bytes), netmask);
- flatten_values.SetValue(((IPAddress Address, int Netmask))new_value, i);
- }
-
- return flatten_values;
- }
-
- public static Array? increaseint8ranges(Array values_array)
- {
- Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
- TestClass.FlatArray(values_array, ref flatten_values);
- for (int i = 0; i < flatten_values.Length; i++)
- {
- if (flatten_values.GetValue(i) == null)
- {
- continue;
- }
-
- NpgsqlRange<long> orig_value = (NpgsqlRange<long>)flatten_values.GetValue(i);
- NpgsqlRange<long> new_value = new(orig_value.LowerBound + 1, orig_value.LowerBoundIsInclusive, orig_value.LowerBoundInfinite, orig_value.UpperBound + 1, orig_value.UpperBoundIsInclusive, orig_value.UpperBoundInfinite);
- flatten_values.SetValue((NpgsqlRange<long>)new_value, i);
- }
-
- return flatten_values;
- }
-
- public static Array? increasedateonlyranges(Array values_array)
- {
- Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
- TestClass.FlatArray(values_array, ref flatten_values);
- for (int i = 0; i < flatten_values.Length; i++)
- {
- if (flatten_values.GetValue(i) == null)
- {
- continue;
- }
-
- NpgsqlRange<DateOnly> orig_value = (NpgsqlRange<DateOnly>)flatten_values.GetValue(i);
-
- NpgsqlRange<DateOnly> new_value = new(orig_value.LowerBound.AddDays(1), orig_value.LowerBoundIsInclusive, orig_value.LowerBoundInfinite, orig_value.UpperBound.AddDays(1), orig_value.UpperBoundIsInclusive, orig_value.UpperBoundInfinite);
- flatten_values.SetValue((NpgsqlRange<DateOnly>)new_value, i);
- }
-
- return flatten_values;
- }
-
- public static string? concatenatevarchars(string? a, string? b, string? c)
- {
- a ??= string.Empty;
- b ??= string.Empty;
- c ??= string.Empty;
- return (a + " " + b + " " + c).ToUpper();
- }
-
- public static Guid? combineuuids(Guid? a, Guid? b)
- {
- if (a == null)
- {
- a = new Guid("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11");
- }
-
- if (b == null)
- {
- b = new Guid("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11");
- }
-
- string aStr = a.ToString();
- string bStr = b.ToString();
- var aList = aStr.Split('-');
- var bList = bStr.Split('-');
- string newUuuidStr = aList[0] + aList[1] + aList[2] + bList[3] + bList[4];
- return new Guid(newUuuidStr);
- }
- }
-}
-
-namespace TestDLLFunctions.OtherTests
-{
- public class TestClass
- {
- public static NpgsqlPoint? middlePointStrict(NpgsqlPoint pointa, NpgsqlPoint pointb)
- {
- double x = (pointa.X + pointb.X) * 0.5;
- double y = (pointa.Y + pointb.Y) * 0.5;
- var new_point = new NpgsqlPoint(x, y);
-
- return new_point;
- }
-
- public static NpgsqlPoint? middlePointDefault(NpgsqlPoint? pointa, NpgsqlPoint? pointb)
- {
- if (pointa == null)
- {
- pointa = new NpgsqlPoint(0, 0);
- }
-
- if (pointb == null)
- {
- pointb = new NpgsqlPoint(0, 0);
- }
-
- double x = (((NpgsqlPoint)pointa).X + ((NpgsqlPoint)pointb).X) * 0.5;
- double y = (((NpgsqlPoint)pointa).Y + ((NpgsqlPoint)pointb).Y) * 0.5;
- var new_point = new NpgsqlPoint(x, y);
-
- return new_point;
- }
- }
-
- public class InoutTests
- {
- public static void inoutBasic0(ref int? argument_0)
- {
- if (argument_0 != 0)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- argument_0 = 1;
- }
-
- public static void inoutBasic1(out int? argument_0)
- {
- argument_0 = 1;
- }
-
- public static void inputNull1(ref int? argument_0)
- {
- if (argument_0 is null)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- argument_0 = null;
- }
-
- public static void inputNull2(ref int? argument_0)
- {
- if (argument_0 != null)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- argument_0 = 3;
- }
-
- public static void inputNull3(out int? argument_0)
- {
- argument_0 = null;
- }
-
- public static void inputNull4(ref int? argument_0, int? argument_1)
- {
- if (argument_0 is null)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- if (argument_1 != 3)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- argument_0 = null;
- }
-
- public static void inputNull5(ref int? argument_0, int? argument_1)
- {
- if (argument_0 != null)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- if (argument_1 != 3)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- argument_0 = 3;
- }
-
- public static void inputNull6(int? argument_0, out int? argument_1)
- {
- if (argument_0 == 1)
- {
- argument_1 = null;
- }
- else if (argument_0 == 2)
- {
- argument_1 = 2;
- }
- else
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
- }
-
- public static void inoutMultiarg1(int? argument_0, ref int? argument_1, int? argument_2, out int? argument_3, out int? argument_4, ref int? argument_5, int? argument_6, out int? argument_7)
- {
- if (argument_0 != 0)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- if (argument_1 != 1)
- {
- throw new SystemException($"Failed assertion: argument_1 = {argument_1}");
- }
-
- argument_1 = 2;
- if (argument_2 != 2)
- {
- throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
- }
-
- argument_3 = 4;
- argument_4 = 5;
- if (argument_5 != null)
- {
- throw new SystemException($"Failed assertion: argument_5 = {argument_5}");
- }
-
- argument_5 = 6;
- if (argument_6 != 6)
- {
- throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
- }
-
- argument_7 = null;
- }
-
- public static void inoutMultiarg2(ref int? argument_0, out int? argument_1, ref int? argument_2, ref int? argument_3, int? argument_4, out int? argument_5, int? argument_6, out int? argument_7)
- {
- if (argument_0 != null)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- argument_0 = 1;
- argument_1 = 2;
- if (argument_2 != 2)
- {
- throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
- }
-
- argument_2 = 3;
- if (argument_3 != 3)
- {
- throw new SystemException($"Failed assertion: argument_3 = {argument_3}");
- }
-
- argument_3 = null;
- if (argument_4 != 4)
- {
- throw new SystemException($"Failed assertion: argument_4 = {argument_4}");
- }
-
- argument_5 = 6;
- if (argument_6 != 6)
- {
- throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
- }
-
- argument_7 = 8;
- }
-
- public static void inoutMultiarg3(out int? argument_0, int? argument_1, int? argument_2, out int? argument_3, ref int? argument_4, out int? argument_5, int? argument_6, ref int? argument_7)
- {
- argument_0 = null;
- if (argument_1 != 1)
- {
- throw new SystemException($"Failed assertion: argument_1 = {argument_1}");
- }
-
- if (argument_2 != 2)
- {
- throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
- }
-
- argument_3 = 4;
- if (argument_4 != 4)
- {
- throw new SystemException($"Failed assertion: argument_4 = {argument_4}");
- }
-
- argument_4 = 5;
- argument_5 = 6;
- if (argument_6 != 6)
- {
- throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
- }
-
- if (argument_7 != 7)
- {
- throw new SystemException($"Failed assertion: argument_7 = {argument_7}");
- }
-
- argument_7 = 8;
- }
-
- public static void inoutMultiarg4(int argument_0, ref int? argument_1, int argument_2, out int? argument_3, out int? argument_4, ref int? argument_5, ref int? argument_6, int argument_7)
- {
- if (argument_0 != 0)
- {
- throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
- }
-
- if (argument_1 != 1)
- {
- throw new SystemException($"Failed assertion: argument_1 = {argument_1}");
- }
-
- argument_1 = 2;
- if (argument_2 != 2)
- {
- throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
- }
-
- argument_3 = 4;
- argument_4 = 5;
- if (argument_5 != 5)
- {
- throw new SystemException($"Failed assertion: argument_5 = {argument_5}");
- }
-
- argument_5 = null;
- if (argument_6 != 6)
- {
- throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
- }
-
- argument_6 = 7;
- if (argument_7 != 7)
- {
- throw new SystemException($"Failed assertion: argument_7 = {argument_7}");
- }
- }
-
- public static void inoutArray10(ref Array? values_array, out int? nulls)
- {
- Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
- TestDLLFunctions.TestClass.FlatArray(values_array, ref flatten_values);
- nulls = 0;
- for (int i = 0; i < flatten_values.Length; i++)
- {
- if (flatten_values.GetValue(i) == null)
- {
- nulls++;
- continue;
- }
-
- PhysicalAddress orig_value = (PhysicalAddress)flatten_values.GetValue(i);
- byte[] bytes = orig_value.GetAddressBytes();
- bytes[0] += 1;
- PhysicalAddress new_value = new(bytes);
- flatten_values.SetValue((PhysicalAddress)new_value, i);
- }
-
- values_array = flatten_values;
- }
-
- public static void inoutArray11(out Array? values_array, PhysicalAddress address, int count)
- {
- Array output = Array.CreateInstance(typeof(object), count);
- for (int i = 0; i < count; i++)
- {
- output.SetValue((PhysicalAddress)address, i);
- }
-
- values_array = output;
- }
-
- public static void inoutSimple10(out int? checksum, (IPAddress Address, int Netmask) address)
- {
- int i;
-
- // get bytes
- byte[] bytes = address.Address.GetAddressBytes();
-
- // compute checksum
- checksum = 0;
- for (i = 0; i < bytes.Length; i++)
- {
- checksum += bytes[i];
- }
- }
-
- public static void inoutSimple20(ref (IPAddress Address, int Netmask)? address, int pos, int delta)
- {
- // compute new address
- (IPAddress address1, int netmask) = address ?? (IPAddress.Parse("1.1.1.1"), 8);
- byte[] bytes = address1.GetAddressBytes();
- bytes[pos] += (byte)delta;
- address = (new IPAddress(bytes), netmask);
- }
-
- public static void inoutSimple30(out int? checksum, ref (IPAddress Address, int Netmask)? address, int pos, int delta)
- {
- int i;
-
- // compute new address
- (IPAddress address1, int netmask) = address ?? (IPAddress.Parse("1.1.1.1"), 8);
- byte[] bytes = address1.GetAddressBytes();
- bytes[pos] += (byte)delta;
- address = (new IPAddress(bytes), netmask);
-
- // compute checksum
- checksum = 0;
- for (i = 0; i < bytes.Length; i++)
- {
- checksum += bytes[i];
- }
- }
-
- public static void inoutObject10(string? a, ref string? b)
- {
- a ??= string.Empty;
- b ??= string.Empty;
- b = a + " " + b;
- }
-
- public static void inoutObject20(string? a, string? b, out string? c)
- {
- a ??= string.Empty;
- b ??= string.Empty;
- c = a + " " + b;
- }
- }
-}
+// <copyright file="Program.cs" company="Brick Abode">
+//
+// PL/.NET (pldotnet) - PostgreSQL support for .NET C# and F# as
+// procedural languages (PL)
+//
+//
+// Copyright (c) 2023 Brick Abode
+//
+// This code is subject to the terms of the PostgreSQL License.
+// The full text of the license can be found in the LICENSE file
+// at the top level of the pldotnet repository.
+//
+// </copyright>
+
+using System;
+using System.Collections;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.Text;
+using NpgsqlTypes;
+
+#pragma warning disable CS8602
+#pragma warning disable CS8625
+#pragma warning disable CS8605
+#pragma warning disable CS8600
+
+namespace TestDLLFunctions
+{
+ public class TestClass
+ {
+ public static int FlatArray(Array originalArray, ref Array flatArray, int[] auxiliar = null, int contEl = 0, int loc = 1)
+ {
+ if (contEl >= originalArray.Length)
+ {
+ return contEl;
+ }
+ else if (contEl == 0 || auxiliar == null)
+ {
+ auxiliar = new int[originalArray.Rank];
+ }
+
+ int ndim = originalArray.Rank;
+ int[] dim = new int[ndim];
+ for (int i = 0; i < ndim; i++)
+ {
+ dim[i] = originalArray.GetLength(i);
+ }
+
+ if (loc == 1)
+ {
+ for (int i = 0; i < dim[ndim - loc]; i++)
+ {
+ flatArray.SetValue(originalArray.GetValue(auxiliar), contEl++);
+ auxiliar[ndim - loc] += 1;
+ }
+ }
+
+ for (int i = 1; i < loc; i++)
+ {
+ auxiliar[ndim - loc] += 1;
+ if (auxiliar[ndim - loc] < dim[ndim - loc])
+ {
+ contEl = FlatArray(originalArray, ref flatArray, auxiliar, contEl, i);
+ }
+ }
+
+ auxiliar[ndim - loc] = 0;
+ contEl = FlatArray(originalArray, ref flatArray, auxiliar, contEl, ++loc);
+ return contEl;
+ }
+
+ public static BitArray? modifybit(BitArray? a)
+ {
+ if (a == null)
+ {
+ return null;
+ }
+
+ a[0] = !a[0];
+ a[^1] = !a[^1];
+ return a;
+ }
+
+ public static BitArray? modifyvarbit(BitArray? a)
+ {
+ if (a == null)
+ {
+ return null;
+ }
+
+ a[0] = !a[0];
+ a[^1] = !a[^1];
+ return a;
+ }
+
+ public static bool? booleanand(bool? a, bool? b)
+ {
+ a ??= false;
+ b ??= false;
+
+ return a & b;
+ }
+
+ public static byte[]? byteaconversions(byte[]? a, byte[]? b)
+ {
+ UTF8Encoding utf8_e = new();
+ if (a == null && b == null)
+ {
+ return null;
+ }
+
+ if (a == null)
+ {
+ return b;
+ }
+
+ if (b == null)
+ {
+ return a;
+ }
+
+ string s1 = utf8_e.GetString(a, 0, a.Length);
+ string s2 = utf8_e.GetString(b, 0, b.Length);
+ string result = s1 + " " + s2;
+ return utf8_e.GetBytes(result);
+ }
+
+ public static DateTime? setnewdate(DateTime? orig_timestamp, DateOnly? new_date)
+ {
+ if (orig_timestamp == null)
+ {
+ orig_timestamp = new DateTime(2022, 1, 1, 8, 30, 20);
+ }
+
+ if (new_date == null)
+ {
+ new_date = new DateOnly(2023, 12, 25);
+ }
+
+ int new_day = ((DateOnly)new_date).Day;
+ int new_month = ((DateOnly)new_date).Month;
+ int new_year = ((DateOnly)new_date).Year;
+ DateTime new_timestamp = new(new_year, new_month, new_day, ((DateTime)orig_timestamp).Hour, ((DateTime)orig_timestamp).Minute, ((DateTime)orig_timestamp).Second);
+ return new_timestamp;
+ }
+
+ public static double? sumdoublearray(Array doubles)
+ {
+ Array flatten_doubles = Array.CreateInstance(typeof(object), doubles.Length);
+ TestClass.FlatArray(doubles, ref flatten_doubles);
+ double double_sum = 0;
+ for (int i = 0; i < flatten_doubles.Length; i++)
+ {
+ if (flatten_doubles.GetValue(i) == null)
+ {
+ continue;
+ }
+
+ double_sum += (double)flatten_doubles.GetValue(i);
+ }
+
+ return double_sum;
+ }
+
+ public static double? sumdouble(double? a, double? b)
+ {
+ a ??= 0;
+ b ??= 0;
+ return a + b;
+ }
+
+ public static short? sum2smallint(short? a, short? b)
+ {
+ a ??= 0;
+ b ??= 0;
+ return (short)(a + b); // C# requires short cast
+ }
+
+ public static int? sum2integer(int? a, int? b)
+ {
+ a ??= 0;
+ b ??= 0;
+ return a + b;
+ }
+
+ public static long? sum2bigint(long? a, long? b)
+ {
+ a ??= 0;
+ b ??= 0;
+ return a + b;
+ }
+
+ public static Array? updatearraypolygonindex(Array values_array, NpgsqlPolygon desired, Array index)
+ {
+ int[] arrayInteger = index.Cast<int>().ToArray();
+ values_array.SetValue(desired, arrayInteger);
+ return values_array;
+ }
+
+ public static Array? updatejsonarrayindex(Array values_array, string desired, Array index)
+ {
+ int[] arrayInteger = index.Cast<int>().ToArray();
+ values_array.SetValue(desired, arrayInteger);
+ return values_array;
+ }
+
+ public static Array? increasemoney(Array values_array)
+ {
+ Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
+ TestClass.FlatArray(values_array, ref flatten_values);
+ for (int i = 0; i < flatten_values.Length; i++)
+ {
+ if (flatten_values.GetValue(i) == null)
+ {
+ continue;
+ }
+
+ decimal orig_value = (decimal)flatten_values.GetValue(i);
+ decimal new_value = orig_value + 1;
+ flatten_values.SetValue((decimal)new_value, i);
+ }
+
+ return flatten_values;
+ }
+
+ public static Array? increasemacaddress8(Array values_array)
+ {
+ Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
+ TestClass.FlatArray(values_array, ref flatten_values);
+ for (int i = 0; i < flatten_values.Length; i++)
+ {
+ if (flatten_values.GetValue(i) == null)
+ {
+ continue;
+ }
+
+ PhysicalAddress orig_value = (PhysicalAddress)flatten_values.GetValue(i);
+ byte[] bytes = orig_value.GetAddressBytes();
+ bytes[0] += 1;
+ PhysicalAddress new_value = new(bytes);
+ flatten_values.SetValue((PhysicalAddress)new_value, i);
+ }
+
+ return flatten_values;
+ }
+
+ public static Array? increasecidraddress(Array values_array)
+ {
+ Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
+ TestClass.FlatArray(values_array, ref flatten_values);
+ for (int i = 0; i < flatten_values.Length; i++)
+ {
+ if (flatten_values.GetValue(i) == null)
+ {
+ continue;
+ }
+
+ (IPAddress address, int netmask) = ((IPAddress Address, int Netmask))flatten_values.GetValue(i);
+ byte[] bytes = address.GetAddressBytes();
+ bytes[0] += 1;
+ (IPAddress Address, int Netmask) new_value = (new IPAddress(bytes), netmask);
+ flatten_values.SetValue(((IPAddress Address, int Netmask))new_value, i);
+ }
+
+ return flatten_values;
+ }
+
+ public static Array? increaseint8ranges(Array values_array)
+ {
+ Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
+ TestClass.FlatArray(values_array, ref flatten_values);
+ for (int i = 0; i < flatten_values.Length; i++)
+ {
+ if (flatten_values.GetValue(i) == null)
+ {
+ continue;
+ }
+
+ NpgsqlRange<long> orig_value = (NpgsqlRange<long>)flatten_values.GetValue(i);
+ NpgsqlRange<long> new_value = new(orig_value.LowerBound + 1, orig_value.LowerBoundIsInclusive, orig_value.LowerBoundInfinite, orig_value.UpperBound + 1, orig_value.UpperBoundIsInclusive, orig_value.UpperBoundInfinite);
+ flatten_values.SetValue((NpgsqlRange<long>)new_value, i);
+ }
+
+ return flatten_values;
+ }
+
+ public static Array? increasedateonlyranges(Array values_array)
+ {
+ Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
+ TestClass.FlatArray(values_array, ref flatten_values);
+ for (int i = 0; i < flatten_values.Length; i++)
+ {
+ if (flatten_values.GetValue(i) == null)
+ {
+ continue;
+ }
+
+ NpgsqlRange<DateOnly> orig_value = (NpgsqlRange<DateOnly>)flatten_values.GetValue(i);
+
+ NpgsqlRange<DateOnly> new_value = new(orig_value.LowerBound.AddDays(1), orig_value.LowerBoundIsInclusive, orig_value.LowerBoundInfinite, orig_value.UpperBound.AddDays(1), orig_value.UpperBoundIsInclusive, orig_value.UpperBoundInfinite);
+ flatten_values.SetValue((NpgsqlRange<DateOnly>)new_value, i);
+ }
+
+ return flatten_values;
+ }
+
+ public static string? concatenatevarchars(string? a, string? b, string? c)
+ {
+ a ??= string.Empty;
+ b ??= string.Empty;
+ c ??= string.Empty;
+ return (a + " " + b + " " + c).ToUpper();
+ }
+
+ public static Guid? combineuuids(Guid? a, Guid? b)
+ {
+ if (a == null)
+ {
+ a = new Guid("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11");
+ }
+
+ if (b == null)
+ {
+ b = new Guid("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11");
+ }
+
+ string aStr = a.ToString();
+ string bStr = b.ToString();
+ var aList = aStr.Split('-');
+ var bList = bStr.Split('-');
+ string newUuuidStr = aList[0] + aList[1] + aList[2] + bList[3] + bList[4];
+ return new Guid(newUuuidStr);
+ }
+ }
+}
+
+namespace TestDLLFunctions.OtherTests
+{
+ public class TestClass
+ {
+ public static NpgsqlPoint? middlePointStrict(NpgsqlPoint pointa, NpgsqlPoint pointb)
+ {
+ double x = (pointa.X + pointb.X) * 0.5;
+ double y = (pointa.Y + pointb.Y) * 0.5;
+ var new_point = new NpgsqlPoint(x, y);
+
+ return new_point;
+ }
+
+ public static NpgsqlPoint? middlePointDefault(NpgsqlPoint? pointa, NpgsqlPoint? pointb)
+ {
+ if (pointa == null)
+ {
+ pointa = new NpgsqlPoint(0, 0);
+ }
+
+ if (pointb == null)
+ {
+ pointb = new NpgsqlPoint(0, 0);
+ }
+
+ double x = (((NpgsqlPoint)pointa).X + ((NpgsqlPoint)pointb).X) * 0.5;
+ double y = (((NpgsqlPoint)pointa).Y + ((NpgsqlPoint)pointb).Y) * 0.5;
+ var new_point = new NpgsqlPoint(x, y);
+
+ return new_point;
+ }
+ }
+
+ public class InoutTests
+ {
+ public static void inoutBasic0(ref int? argument_0)
+ {
+ if (argument_0 != 0)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ argument_0 = 1;
+ }
+
+ public static void inoutBasic1(out int? argument_0)
+ {
+ argument_0 = 1;
+ }
+
+ public static void inputNull1(ref int? argument_0)
+ {
+ if (argument_0 is null)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ argument_0 = null;
+ }
+
+ public static void inputNull2(ref int? argument_0)
+ {
+ if (argument_0 != null)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ argument_0 = 3;
+ }
+
+ public static void inputNull3(out int? argument_0)
+ {
+ argument_0 = null;
+ }
+
+ public static void inputNull4(ref int? argument_0, int? argument_1)
+ {
+ if (argument_0 is null)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ if (argument_1 != 3)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ argument_0 = null;
+ }
+
+ public static void inputNull5(ref int? argument_0, int? argument_1)
+ {
+ if (argument_0 != null)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ if (argument_1 != 3)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ argument_0 = 3;
+ }
+
+ public static void inputNull6(int? argument_0, out int? argument_1)
+ {
+ if (argument_0 == 1)
+ {
+ argument_1 = null;
+ }
+ else if (argument_0 == 2)
+ {
+ argument_1 = 2;
+ }
+ else
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+ }
+
+ public static void inoutMultiarg1(int? argument_0, ref int? argument_1, int? argument_2, out int? argument_3, out int? argument_4, ref int? argument_5, int? argument_6, out int? argument_7)
+ {
+ if (argument_0 != 0)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ if (argument_1 != 1)
+ {
+ throw new SystemException($"Failed assertion: argument_1 = {argument_1}");
+ }
+
+ argument_1 = 2;
+ if (argument_2 != 2)
+ {
+ throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
+ }
+
+ argument_3 = 4;
+ argument_4 = 5;
+ if (argument_5 != null)
+ {
+ throw new SystemException($"Failed assertion: argument_5 = {argument_5}");
+ }
+
+ argument_5 = 6;
+ if (argument_6 != 6)
+ {
+ throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
+ }
+
+ argument_7 = null;
+ }
+
+ public static void inoutMultiarg2(ref int? argument_0, out int? argument_1, ref int? argument_2, ref int? argument_3, int? argument_4, out int? argument_5, int? argument_6, out int? argument_7)
+ {
+ if (argument_0 != null)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ argument_0 = 1;
+ argument_1 = 2;
+ if (argument_2 != 2)
+ {
+ throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
+ }
+
+ argument_2 = 3;
+ if (argument_3 != 3)
+ {
+ throw new SystemException($"Failed assertion: argument_3 = {argument_3}");
+ }
+
+ argument_3 = null;
+ if (argument_4 != 4)
+ {
+ throw new SystemException($"Failed assertion: argument_4 = {argument_4}");
+ }
+
+ argument_5 = 6;
+ if (argument_6 != 6)
+ {
+ throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
+ }
+
+ argument_7 = 8;
+ }
+
+ public static void inoutMultiarg3(out int? argument_0, int? argument_1, int? argument_2, out int? argument_3, ref int? argument_4, out int? argument_5, int? argument_6, ref int? argument_7)
+ {
+ argument_0 = null;
+ if (argument_1 != 1)
+ {
+ throw new SystemException($"Failed assertion: argument_1 = {argument_1}");
+ }
+
+ if (argument_2 != 2)
+ {
+ throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
+ }
+
+ argument_3 = 4;
+ if (argument_4 != 4)
+ {
+ throw new SystemException($"Failed assertion: argument_4 = {argument_4}");
+ }
+
+ argument_4 = 5;
+ argument_5 = 6;
+ if (argument_6 != 6)
+ {
+ throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
+ }
+
+ if (argument_7 != 7)
+ {
+ throw new SystemException($"Failed assertion: argument_7 = {argument_7}");
+ }
+
+ argument_7 = 8;
+ }
+
+ public static void inoutMultiarg4(int argument_0, ref int? argument_1, int argument_2, out int? argument_3, out int? argument_4, ref int? argument_5, ref int? argument_6, int argument_7)
+ {
+ if (argument_0 != 0)
+ {
+ throw new SystemException($"Failed assertion: argument_0 = {argument_0}");
+ }
+
+ if (argument_1 != 1)
+ {
+ throw new SystemException($"Failed assertion: argument_1 = {argument_1}");
+ }
+
+ argument_1 = 2;
+ if (argument_2 != 2)
+ {
+ throw new SystemException($"Failed assertion: argument_2 = {argument_2}");
+ }
+
+ argument_3 = 4;
+ argument_4 = 5;
+ if (argument_5 != 5)
+ {
+ throw new SystemException($"Failed assertion: argument_5 = {argument_5}");
+ }
+
+ argument_5 = null;
+ if (argument_6 != 6)
+ {
+ throw new SystemException($"Failed assertion: argument_6 = {argument_6}");
+ }
+
+ argument_6 = 7;
+ if (argument_7 != 7)
+ {
+ throw new SystemException($"Failed assertion: argument_7 = {argument_7}");
+ }
+ }
+
+ public static void inoutArray10(ref Array? values_array, out int? nulls)
+ {
+ Array flatten_values = Array.CreateInstance(typeof(object), values_array.Length);
+ TestDLLFunctions.TestClass.FlatArray(values_array, ref flatten_values);
+ nulls = 0;
+ for (int i = 0; i < flatten_values.Length; i++)
+ {
+ if (flatten_values.GetValue(i) == null)
+ {
+ nulls++;
+ continue;
+ }
+
+ PhysicalAddress orig_value = (PhysicalAddress)flatten_values.GetValue(i);
+ byte[] bytes = orig_value.GetAddressBytes();
+ bytes[0] += 1;
+ PhysicalAddress new_value = new(bytes);
+ flatten_values.SetValue((PhysicalAddress)new_value, i);
+ }
+
+ values_array = flatten_values;
+ }
+
+ public static void inoutArray11(out Array? values_array, PhysicalAddress address, int count)
+ {
+ Array output = Array.CreateInstance(typeof(object), count);
+ for (int i = 0; i < count; i++)
+ {
+ output.SetValue((PhysicalAddress)address, i);
+ }
+
+ values_array = output;
+ }
+
+ public static void inoutSimple10(out int? checksum, (IPAddress Address, int Netmask) address)
+ {
+ int i;
+
+ // get bytes
+ byte[] bytes = address.Address.GetAddressBytes();
+
+ // compute checksum
+ checksum = 0;
+ for (i = 0; i < bytes.Length; i++)
+ {
+ checksum += bytes[i];
+ }
+ }
+
+ public static void inoutSimple20(ref (IPAddress Address, int Netmask)? address, int pos, int delta)
+ {
+ // compute new address
+ (IPAddress address1, int netmask) = address ?? (IPAddress.Parse("1.1.1.1"), 8);
+ byte[] bytes = address1.GetAddressBytes();
+ bytes[pos] += (byte)delta;
+ address = (new IPAddress(bytes), netmask);
+ }
+
+ public static void inoutSimple30(out int? checksum, ref (IPAddress Address, int Netmask)? address, int pos, int delta)
+ {
+ int i;
+
+ // compute new address
+ (IPAddress address1, int netmask) = address ?? (IPAddress.Parse("1.1.1.1"), 8);
+ byte[] bytes = address1.GetAddressBytes();
+ bytes[pos] += (byte)delta;
+ address = (new IPAddress(bytes), netmask);
+
+ // compute checksum
+ checksum = 0;
+ for (i = 0; i < bytes.Length; i++)
+ {
+ checksum += bytes[i];
+ }
+ }
+
+ public static void inoutObject10(string? a, ref string? b)
+ {
+ a ??= string.Empty;
+ b ??= string.Empty;
+ b = a + " " + b;
+ }
+
+ public static void inoutObject20(string? a, string? b, out string? c)
+ {
+ a ??= string.Empty;
+ b ??= string.Empty;
+ c = a + " " + b;
+ }
+ }
+}
diff --git a/contrib/pldotnet/tests/fsharp/DotNetTestProject/FSharpTest.fsproj b/contrib/pldotnet/tests/fsharp/DotNetTestProject/FSharpTest.fsproj
index 21dc537..568856f 100644
--- a/contrib/pldotnet/tests/fsharp/DotNetTestProject/FSharpTest.fsproj
+++ b/contrib/pldotnet/tests/fsharp/DotNetTestProject/FSharpTest.fsproj
@@ -1,22 +1,22 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>$(TargetFramework)</TargetFramework>
- <ImplicitUsings>enable</ImplicitUsings>
- <Nullable>enable</Nullable>
- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
- </PropertyGroup>
-
- <ItemGroup>
- <Compile Include="Program.fs" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\..\..\dotnet_src\npgsql\src\Npgsql\Npgsql.csproj" />
- </ItemGroup>
-
- <PropertyGroup>
- <CodeAnalysisRuleSet>stylecop.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
-
-</Project>
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>$(TargetFramework)</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Compile Include="Program.fs" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\dotnet_src\npgsql\src\Npgsql\Npgsql.csproj" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <CodeAnalysisRuleSet>stylecop.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+
+</Project>
diff --git a/contrib/pldotnet/tests/fsharp/DotNetTestProject/Program.fs b/contrib/pldotnet/tests/fsharp/DotNetTestProject/Program.fs
index 0b7c381..ba5b054 100644
--- a/contrib/pldotnet/tests/fsharp/DotNetTestProject/Program.fs
+++ b/contrib/pldotnet/tests/fsharp/DotNetTestProject/Program.fs
@@ -1,191 +1,191 @@
-// <copyright file="Program.fs" company="Brick Abode">
-//
-// PL/.NET (pldotnet) - PostgreSQL support for .NET C# and F# as
-// procedural languages (PL)
-//
-//
-// Copyright (c) 2023 Brick Abode
-//
-// This code is subject to the terms of the PostgreSQL License.
-// The full text of the license can be found in the LICENSE file
-// at the top level of the pldotnet repository.
-//
-// </copyright>
-
-namespace TestFSharpDLLFunctions
-
-open System
-open System.Collections
-open System.Net
-open System.Net.NetworkInformation
-open System.Text
-open NpgsqlTypes
-
-#nowarn "3391"
-
-type TestFSharpClass() =
- static member sum2SmallIntFSharp (a: int16) (b: int16) : Nullable<int16> =
- Nullable (a+b)
-
- static member mult2IntFSharp (a: Nullable<int>) (b: Nullable<int>) : Nullable<int> =
- match (a.HasValue, b.HasValue) with
- | (false, false) -> System.Nullable()
- | (true, false) -> a.Value
- | (false, true) -> b.Value
- | (true, true) -> Nullable (a.Value*b.Value)
-
- static member createDateFSharp (year: Nullable<int>) (month: Nullable<int>) (day: Nullable<int>) : Nullable<DateOnly> =
- match (year.HasValue, month.HasValue, day.HasValue) with
- | (true, true, true) -> new DateOnly(year.Value, month.Value, day.Value)
- | _ -> System.Nullable()
-
- static member addMinutes (time: Nullable<TimeOnly>) (minutes: Nullable<int>) : Nullable<TimeOnly> =
- match (time.HasValue, minutes.HasValue) with
- | (true, true) ->
- (time.Value).AddMinutes(double minutes.Value)
- | (true, false) -> time
- | _ ->
- let auxTime = new TimeOnly(0, 30, 20)
- auxTime.AddMinutes(double minutes.Value)
-
- static member concatenateString (a: string) (b: string) : string =
- match (a = null, b = null) with
- | (false, false) -> a + " " + b
- | (false, true) -> a
- | (true, false) -> b
- | _ -> null
-
- static member modifyStringArray (a: Array) (b: string) : Array =
- let dim = a.Rank
- match dim with
- | 1 ->
- a.SetValue(b, 0) |> ignore
- a
- | 2 ->
- a.SetValue(b, 0, 0) |> ignore
- a
- | 3 ->
- a.SetValue(b, 0, 0, 0) |> ignore
- a
- | _ -> a
-
- static member modifyTimestampArray (a: Array) (b: Nullable<DateTime>) : Array =
- let dim = a.Rank
- let newValue =
- match b.HasValue with
- | true -> b.Value
- | false -> new DateTime(2022, 11, 15, 13, 23, 45)
-
- match dim with
- | 1 ->
- a.SetValue(newValue, 0) |> ignore
- a
- | 2 ->
- a.SetValue(newValue, 0, 0) |> ignore
- a
- | 3 ->
- a.SetValue(newValue, 0, 0, 0) |> ignore
- a
- | _ -> a
-
- static member modifyFloat4ArrayFSharp (a: Array) (b: float32) : Array =
- let dim = a.Rank
- match dim with
- | 1 ->
- a.SetValue(b, 0) |> ignore
- a
- | 2 ->
- a.SetValue(b, 0, 0) |> ignore
- a
- | 3 ->
- a.SetValue(b, 0, 0, 0) |> ignore
- a
- | _ -> a
-
- static member modifyFloat8ArrayFSharp (a: Array) (b: Nullable<float>) : Array =
- let dim = a.Rank
- let newValue =
- match b.HasValue with
- | true -> b.Value
- | false -> 0.0
- match dim with
- | 1 ->
- a.SetValue(newValue, 0) |> ignore
- a
- | 2 ->
- a.SetValue(newValue, 0, 0) |> ignore
- a
- | 3 ->
- a.SetValue(newValue, 0, 0, 0) |> ignore
- a
- | _ -> a
-
-type InoutTestsFSharpClass() =
-
- static member fsInoutAllthreeS (a: int) (b: int) : Nullable<int> * Nullable<int> =
- Nullable(b+1), Nullable(a+b)
-
- static member fsInoutAllthree (a: Nullable<int>) (b: Nullable<int>) : Nullable<int> * Nullable<int> =
- if a.HasValue && b.HasValue then
- Nullable(a.Value + 1), Nullable(a.Value + b.Value)
- else
- Nullable(), Nullable()
-
- static member fsInoutAllthreearray (a: int) (b: int) : Nullable<int> * Array =
- let c = b + 1
- let arr = Array.CreateInstance(typeof<int16>, 3, 3)
- arr.SetValue((int16)a, 0, 0)
- arr.SetValue((int16)a, 1, 1)
- arr.SetValue((int16)a, 2, 2)
- Nullable(c), arr
-
- static member inoutMultiarg1FsS (a0: int) (a1: int) (a2: int) (a5: int) (a6: int) : Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> =
- if a0 <> 0 then
- raise <| SystemException("Failed assertion: a0")
- if a1 <> 1 then
- raise <| SystemException("Failed assertion: a1")
- if a2 <> 2 then
- raise <| SystemException("Failed assertion: a2")
- if a5 <> 5 then
- raise <| SystemException("Failed assertion: a5")
- if a6 <> 6 then
- raise <| SystemException("Failed assertion: a6")
-
- (Nullable(2), Nullable(4), Nullable(5), Nullable(6), Nullable(7))
-
- static member inoutMultiarg1Fs (a0: Nullable<int>) (a1: Nullable<int>) (a2: Nullable<int>) (a5: Nullable<int>) (a6: Nullable<int>) : Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> =
- if a0.HasValue && a0.Value <> 0 then
- raise <| SystemException("Failed assertion: a0")
- if a1.HasValue && a1.Value <> 1 then
- raise <| SystemException("Failed assertion: a1")
- if a2.HasValue && a2.Value <> 2 then
- raise <| SystemException("Failed assertion: a2")
- if a5.HasValue then
- raise <| SystemException("Failed assertion: a5")
- if a6.HasValue && a6.Value <> 6 then
- raise <| SystemException("Failed assertion: a6")
-
- (Nullable(2), Nullable(4), Nullable(5), Nullable(6), Nullable())
-
- static member inoutMrray10FsS (input_array: Array) : Array =
- let count = input_array.Length
- let output = Array.CreateInstance(typeof<obj>, count)
- for i = 0 to count - 1 do
- output.SetValue(input_array.GetValue(i), i)
- if count > 3 then
- output.SetValue(Nullable() :> obj, 3)
- output
-
- static member inoutMrray11FsS (address: PhysicalAddress) (count: int) : Array =
- let output = Array.CreateInstance(typeof<obj>, count)
- for i = 0 to count - 1 do
- output.SetValue(address :> obj, i)
- if count > 3 then
- output.SetValue(Nullable() :> obj, 3)
- output
-
- static member inoutMbject10Fs (a: string) (b: string) : string =
- a + " " + b;
-
- static member inoutMbject20Fs (a: string) (b: string) : string =
+// <copyright file="Program.fs" company="Brick Abode">
+//
+// PL/.NET (pldotnet) - PostgreSQL support for .NET C# and F# as
+// procedural languages (PL)
+//
+//
+// Copyright (c) 2023 Brick Abode
+//
+// This code is subject to the terms of the PostgreSQL License.
+// The full text of the license can be found in the LICENSE file
+// at the top level of the pldotnet repository.
+//
+// </copyright>
+
+namespace TestFSharpDLLFunctions
+
+open System
+open System.Collections
+open System.Net
+open System.Net.NetworkInformation
+open System.Text
+open NpgsqlTypes
+
+#nowarn "3391"
+
+type TestFSharpClass() =
+ static member sum2SmallIntFSharp (a: int16) (b: int16) : Nullable<int16> =
+ Nullable (a+b)
+
+ static member mult2IntFSharp (a: Nullable<int>) (b: Nullable<int>) : Nullable<int> =
+ match (a.HasValue, b.HasValue) with
+ | (false, false) -> System.Nullable()
+ | (true, false) -> a.Value
+ | (false, true) -> b.Value
+ | (true, true) -> Nullable (a.Value*b.Value)
+
+ static member createDateFSharp (year: Nullable<int>) (month: Nullable<int>) (day: Nullable<int>) : Nullable<DateOnly> =
+ match (year.HasValue, month.HasValue, day.HasValue) with
+ | (true, true, true) -> new DateOnly(year.Value, month.Value, day.Value)
+ | _ -> System.Nullable()
+
+ static member addMinutes (time: Nullable<TimeOnly>) (minutes: Nullable<int>) : Nullable<TimeOnly> =
+ match (time.HasValue, minutes.HasValue) with
+ | (true, true) ->
+ (time.Value).AddMinutes(double minutes.Value)
+ | (true, false) -> time
+ | _ ->
+ let auxTime = new TimeOnly(0, 30, 20)
+ auxTime.AddMinutes(double minutes.Value)
+
+ static member concatenateString (a: string) (b: string) : string =
+ match (a = null, b = null) with
+ | (false, false) -> a + " " + b
+ | (false, true) -> a
+ | (true, false) -> b
+ | _ -> null
+
+ static member modifyStringArray (a: Array) (b: string) : Array =
+ let dim = a.Rank
+ match dim with
+ | 1 ->
+ a.SetValue(b, 0) |> ignore
+ a
+ | 2 ->
+ a.SetValue(b, 0, 0) |> ignore
+ a
+ | 3 ->
+ a.SetValue(b, 0, 0, 0) |> ignore
+ a
+ | _ -> a
+
+ static member modifyTimestampArray (a: Array) (b: Nullable<DateTime>) : Array =
+ let dim = a.Rank
+ let newValue =
+ match b.HasValue with
+ | true -> b.Value
+ | false -> new DateTime(2022, 11, 15, 13, 23, 45)
+
+ match dim with
+ | 1 ->
+ a.SetValue(newValue, 0) |> ignore
+ a
+ | 2 ->
+ a.SetValue(newValue, 0, 0) |> ignore
+ a
+ | 3 ->
+ a.SetValue(newValue, 0, 0, 0) |> ignore
+ a
+ | _ -> a
+
+ static member modifyFloat4ArrayFSharp (a: Array) (b: float32) : Array =
+ let dim = a.Rank
+ match dim with
+ | 1 ->
+ a.SetValue(b, 0) |> ignore
+ a
+ | 2 ->
+ a.SetValue(b, 0, 0) |> ignore
+ a
+ | 3 ->
+ a.SetValue(b, 0, 0, 0) |> ignore
+ a
+ | _ -> a
+
+ static member modifyFloat8ArrayFSharp (a: Array) (b: Nullable<float>) : Array =
+ let dim = a.Rank
+ let newValue =
+ match b.HasValue with
+ | true -> b.Value
+ | false -> 0.0
+ match dim with
+ | 1 ->
+ a.SetValue(newValue, 0) |> ignore
+ a
+ | 2 ->
+ a.SetValue(newValue, 0, 0) |> ignore
+ a
+ | 3 ->
+ a.SetValue(newValue, 0, 0, 0) |> ignore
+ a
+ | _ -> a
+
+type InoutTestsFSharpClass() =
+
+ static member fsInoutAllthreeS (a: int) (b: int) : Nullable<int> * Nullable<int> =
+ Nullable(b+1), Nullable(a+b)
+
+ static member fsInoutAllthree (a: Nullable<int>) (b: Nullable<int>) : Nullable<int> * Nullable<int> =
+ if a.HasValue && b.HasValue then
+ Nullable(a.Value + 1), Nullable(a.Value + b.Value)
+ else
+ Nullable(), Nullable()
+
+ static member fsInoutAllthreearray (a: int) (b: int) : Nullable<int> * Array =
+ let c = b + 1
+ let arr = Array.CreateInstance(typeof<int16>, 3, 3)
+ arr.SetValue((int16)a, 0, 0)
+ arr.SetValue((int16)a, 1, 1)
+ arr.SetValue((int16)a, 2, 2)
+ Nullable(c), arr
+
+ static member inoutMultiarg1FsS (a0: int) (a1: int) (a2: int) (a5: int) (a6: int) : Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> =
+ if a0 <> 0 then
+ raise <| SystemException("Failed assertion: a0")
+ if a1 <> 1 then
+ raise <| SystemException("Failed assertion: a1")
+ if a2 <> 2 then
+ raise <| SystemException("Failed assertion: a2")
+ if a5 <> 5 then
+ raise <| SystemException("Failed assertion: a5")
+ if a6 <> 6 then
+ raise <| SystemException("Failed assertion: a6")
+
+ (Nullable(2), Nullable(4), Nullable(5), Nullable(6), Nullable(7))
+
+ static member inoutMultiarg1Fs (a0: Nullable<int>) (a1: Nullable<int>) (a2: Nullable<int>) (a5: Nullable<int>) (a6: Nullable<int>) : Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> =
+ if a0.HasValue && a0.Value <> 0 then
+ raise <| SystemException("Failed assertion: a0")
+ if a1.HasValue && a1.Value <> 1 then
+ raise <| SystemException("Failed assertion: a1")
+ if a2.HasValue && a2.Value <> 2 then
+ raise <| SystemException("Failed assertion: a2")
+ if a5.HasValue then
+ raise <| SystemException("Failed assertion: a5")
+ if a6.HasValue && a6.Value <> 6 then
+ raise <| SystemException("Failed assertion: a6")
+
+ (Nullable(2), Nullable(4), Nullable(5), Nullable(6), Nullable())
+
+ static member inoutMrray10FsS (input_array: Array) : Array =
+ let count = input_array.Length
+ let output = Array.CreateInstance(typeof<obj>, count)
+ for i = 0 to count - 1 do
+ output.SetValue(input_array.GetValue(i), i)
+ if count > 3 then
+ output.SetValue(Nullable() :> obj, 3)
+ output
+
+ static member inoutMrray11FsS (address: PhysicalAddress) (count: int) : Array =
+ let output = Array.CreateInstance(typeof<obj>, count)
+ for i = 0 to count - 1 do
+ output.SetValue(address :> obj, i)
+ if count > 3 then
+ output.SetValue(Nullable() :> obj, 3)
+ output
+
+ static member inoutMbject10Fs (a: string) (b: string) : string =
+ a + " " + b;
+
+ static member inoutMbject20Fs (a: string) (b: string) : string =
a + " " + b;
\ No newline at end of file
diff --git a/contrib/pldotnet/tests/xUnit/PlDotNetTest.cs b/contrib/pldotnet/tests/xUnit/PlDotNetTest.cs
index aeff4f6..08a27b1 100644
--- a/contrib/pldotnet/tests/xUnit/PlDotNetTest.cs
+++ b/contrib/pldotnet/tests/xUnit/PlDotNetTest.cs
@@ -1,638 +1,638 @@
-using DotNetEnv;
-using Npgsql;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.Reflection;
-using System.Text;
-using Xunit;
-
-[Collection("Sequential")]
-public class PlDotNetTest
-{
- protected SqlFunctionInfo? FunctionInfo;
-
- string DatabaseConnectionString =
- Environment.GetEnvironmentVariable("DATABASE_CONNECTION_STRING") + ";Include Error Detail=true"
- ?? throw new InvalidOperationException("DATABASE_CONNECTION_STRING not set.");
-
- int TestCount = 0;
-
- public enum LanguageType
- {
- PlcSharp,
- PlfSharp,
- PlPython,
- PlR,
- PlPgSQL,
- PlV8,
- PlTCL,
- PlLua,
- PlPerl
- }
-
- public enum SqlTestType
- {
- Function,
- Procedure,
- DoBlock
- }
-
- public Dictionary<SqlTestType, string> TestTypeMap = new Dictionary<SqlTestType, string>
- {
- { SqlTestType.Function, "FUNCTION" },
- { SqlTestType.Procedure, "PROCEDURE" },
- { SqlTestType.DoBlock, "DO BLOCK" }
- };
-
- public class SqlFunctionInfo
- {
- // New properties for dynamic SQL construction
-
- public string CteStatement { get; set; } = string.Empty;
- public string CustomAssertion { get; set; } = string.Empty; // For complex assertion logic
- public string QuerySuffix { get; set; } = string.Empty; // For additional WHERE, LIMIT, etc.
- public SqlTestType TestType { get; set; } = SqlTestType.Function;
- public string Name { get; set; } = string.Empty;
- public List<FunctionArgument> Arguments { get; set; } = new List<FunctionArgument>();
- public string ReturnType { get; set; } = string.Empty;
- public string Body { get; set; } = string.Empty;
- public LanguageType Language { get; set; }
- public bool IsStrict { get; set; }
- public string FunctionName { get; set; } = string.Empty;
- public string TestName { get; set; } = string.Empty;
- public string FeatureName { get; set; } = string.Empty;
- public string InputStr { get; set; } = string.Empty;
- public string ExpectedResult { get; set; } = string.Empty;
- public string CastFunctionAs { get; set; } = string.Empty;
-
- public int? TestId { get; set; }
-
- public bool FunctionCreatedSuccessfully { get; set; } = false;
-
- public bool TestInsertedSuccessfully { get; set; } = false;
-
- public string SqlFunctionDefinition { get; set; } = string.Empty;
-
- public string SqlFunctionCall { get; set; } = string.Empty;
-
- public string LanguageString
- {
- get
- {
- return Language switch
- {
- LanguageType.PlcSharp => "plcsharp",
- LanguageType.PlfSharp => "plfsharp",
- LanguageType.PlPython => "plpython3u",
- LanguageType.PlR => "plr",
- LanguageType.PlPgSQL => "plpgsql",
- LanguageType.PlV8 => "plv8",
- LanguageType.PlTCL => "pltcl",
- LanguageType.PlLua => "pllua",
- LanguageType.PlPerl => "plperl",
- _ => throw new System.NotImplementedException()
- };
- }
- }
-
- public SqlFunctionInfo() { }
- }
-
- public class FunctionArgument
- {
- public string Name { get; set; }
- public string Type { get; set; }
-
- public FunctionArgument(string name, string type)
- {
- Name = name;
- Type = type;
- }
- }
-
- public class TestQueryParameters
- {
- public List<(string Name, string Query)> Ctes { get; set; } =
- new List<(string Name, string Query)>();
- public string TestCategory { get; set; } = string.Empty;
- public string TestName { get; set; } = string.Empty;
- public string Assertion { get; set; } = string.Empty;
- public string FinalSelect { get; set; } = string.Empty;
- }
-
- /// <summary>
- /// Constructs and returns the SQL definition of a function based on the provided SqlFunctionInfo.
- /// </summary>
- /// <param name="functionInfo">The information about the SQL function.</param>
- /// <returns>A string representing the SQL definition of the function.</returns>
- /// <remarks>
- /// The method uses the properties of the SqlFunctionInfo object to create a SQL CREATE OR REPLACE FUNCTION statement.
- /// If the IsStrict property of the SqlFunctionInfo object is true, the "STRICT" keyword is added to the SQL definition.
- /// </remarks>
- public virtual string GetFunctionDefinition(SqlFunctionInfo functionInfo)
- {
- var arguments = string.Join(
- ", ",
- functionInfo.Arguments.Select(arg => $"{arg.Name} {arg.Type}")
- );
-
- string methodKeyword =
- functionInfo.TestType == SqlTestType.Function ? "FUNCTION" : "PROCEDURE";
-
- string strictKeyword = functionInfo.IsStrict ? "STRICT" : "";
-
- // Conditionally build the returnTypeString
- string returnTypeString = string.IsNullOrEmpty(functionInfo.ReturnType)
- ? string.Empty
- : $"RETURNS {functionInfo.ReturnType}";
-
- return $@"CREATE OR REPLACE {methodKeyword} {functionInfo.Name}({arguments})
-{returnTypeString} AS $$
- {functionInfo.Body}
-$$ LANGUAGE {functionInfo.LanguageString} {strictKeyword};";
- }
-
- public virtual string GetFunctionCall(SqlFunctionInfo functionInfo, bool forceCte = false)
- {
- if (functionInfo.TestType == SqlTestType.Procedure)
- {
- return $"CALL {functionInfo.Name}({functionInfo.InputStr});";
- }
-
- return TestResultStrategyFactory.GetStrategy(functionInfo, forceCte).BuildInsertSql(functionInfo);
- }
-
- public interface ITestResultStrategy
- {
- // AppliesTo determines if the strategy should be used for the given functionInfo
- bool AppliesTo(SqlFunctionInfo functionInfo);
-
- // BuildInsertSql returns the SQL code to insert the test result
- string BuildInsertSql(SqlFunctionInfo functionInfo);
- }
-
- public class DefaultTestResultStrategy : ITestResultStrategy
- {
- public bool AppliesTo(SqlFunctionInfo functionInfo)
- {
- return true;
- }
-
- public string BuildInsertSql(SqlFunctionInfo functionInfo)
- {
- string functionCall = $"{functionInfo.Name}({functionInfo.InputStr})";
-
- string cast = !string.IsNullOrWhiteSpace(functionInfo.CastFunctionAs)
- ? $"CAST({functionCall} AS {functionInfo.CastFunctionAs})"
- : functionCall;
-
- string nullComparison =
- functionInfo.ExpectedResult == "= null"
- ? "IS NULL"
- : $"{cast} {functionInfo.ExpectedResult}";
-
- if (string.IsNullOrWhiteSpace(functionInfo.ExpectedResult))
- {
- nullComparison = "IS NOT NULL";
- }
-
- string sqlCode =
- $@"INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
- VALUES ('{functionInfo.FeatureName}', '{functionInfo.TestName}', {nullComparison})
- RETURNING id;";
-
- return sqlCode;
- }
- }
-
- // public class CteTestResultStrategy : ITestResultStrategy
- // {
- // public bool AppliesTo(SqlFunctionInfo functionInfo)
- // {
- // // This strategy applies if a CTE statement is defined
- // return !string.IsNullOrWhiteSpace(functionInfo.CteStatement);
- // }
-
- // public string BuildInsertSql(SqlFunctionInfo functionInfo)
- // {
- // // Use the provided CTE statement directly in the SQL command construction
- // string sqlCode =
- // $@"
- // {functionInfo.CteStatement}
- // INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
- // SELECT '{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionInfo.CustomAssertion} FROM cte {functionInfo.QuerySuffix} RETURNING id;";
-
- // return sqlCode;
- // }
- // }
-
- // Defines a class CteTestResultStrategy that implements the ITestResultStrategy interface.
- public class CteTestResultStrategy : ITestResultStrategy
- {
- // Determines if the strategy applies to the given SQL function based on the presence of a CTE statement.
-
- public bool AppliesTo(SqlFunctionInfo functionInfo)
- {
- // Returns true if the CteStatement property of functionInfo is not null or whitespace, indicating
- // this strategy should be used for functions with CTEs.
- return !string.IsNullOrWhiteSpace(functionInfo.CteStatement);
- }
-
- // Builds an SQL INSERT statement using the information provided in the SqlFunctionInfo parameter.
- public string BuildInsertSql(SqlFunctionInfo functionInfo)
- {
- // Extracts the name of the CTE from its SQL statement to use in the final query.
- string cteName = ExtractCteName(functionInfo.CteStatement)!;
-
- // Constructs an SQL statement that includes the CTE statement and an INSERT INTO operation.
- // The INSERT operation adds a new row into the automated_test_results table with details from the functionInfo parameter
- // and selects values from the CTE defined earlier, applying any specified query suffix. Finally, it returns the id of the inserted row.
- string sqlCode =
- $@"
-{functionInfo.CteStatement}
-INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
-SELECT '{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionInfo.CustomAssertion} FROM {cteName} {functionInfo.QuerySuffix} RETURNING id;";
-
- // Returns the constructed SQL code.
- return sqlCode;
- }
-
- // A private helper method to extract the name of the CTE from its SQL statement.
- private string? ExtractCteName(string cteStatement)
- {
- // Uses a regular expression to find the CTE name in the CTE statement by looking for the pattern
- // that follows "WITH" and precedes "AS". Assumes the CTE name is a single word (\w+).
- var match = System.Text.RegularExpressions.Regex.Match(
- cteStatement,
- @"WITH\s+(\w+)\s+AS"
- );
- // If the pattern is found, the CTE name is returned.
- if (match.Success)
- {
- return match.Groups[1].Value;
- }
- // If the pattern is not found, returns null indicating no CTE name could be extracted.
- return null;
- }
- }
-
- // public class CteTestResultStrategy : ITestResultStrategy
- // {
- // public bool AppliesTo(SqlFunctionInfo functionInfo)
- // {
- // // This strategy applies if a CTE statement is defined and not empty.
- // return !string.IsNullOrWhiteSpace(functionInfo.CteStatement);
- // }
-
- // public string BuildInsertSql(SqlFunctionInfo functionInfo)
- // {
- // // Directly prepend the CTE statement to the SQL command
- // string sqlCode =
- // $@"
- // {functionInfo.cteStatement}
- // INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
- // SELECT '{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionInfo.CustomAssertion} RETURNING id;";
-
- // return sqlCode;
- // }
- // }
-
- public class JsonOrXmlTestResultStrategy : ITestResultStrategy
- {
- public bool AppliesTo(SqlFunctionInfo functionInfo)
- {
- return (
- functionInfo.ReturnType != null
- && (
- functionInfo.ReturnType.IndexOf("JSON", StringComparison.OrdinalIgnoreCase)
- >= 0
- || functionInfo.ReturnType.IndexOf(
- "XML",
- StringComparison.OrdinalIgnoreCase
- ) >= 0
- )
- )
- || (
- functionInfo.ExpectedResult != null
- && functionInfo.ExpectedResult.IndexOf(
- "::JSON::TEXT",
- StringComparison.OrdinalIgnoreCase
- ) >= 0
- );
- }
-
- public string BuildInsertSql(SqlFunctionInfo functionInfo)
- {
- string functionCall = $"{functionInfo.Name}({functionInfo.InputStr})::TEXT";
- string expectedResult = functionInfo.ExpectedResult + "::TEXT";
-
- string sqlCode =
- $@" INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
- VALUES ('{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionCall} {expectedResult})
- RETURNING id;";
- return sqlCode;
- }
- }
-
- public class TestResultStrategyFactory
- {
- private static readonly List<ITestResultStrategy> Strategies = new List<ITestResultStrategy>
- {
- new CteTestResultStrategy(),
- new JsonOrXmlTestResultStrategy(),
- new DefaultTestResultStrategy()
- };
-
- public static ITestResultStrategy GetStrategy(
- SqlFunctionInfo functionInfo,
- bool forceCte = false
- )
- {
- if (forceCte)
- {
- return Strategies[0];
- }
- return Strategies.FirstOrDefault(strategy => strategy.AppliesTo(functionInfo))
- ?? new DefaultTestResultStrategy();
- }
- }
-
- /// <summary>
- /// Executes the provided SQL command that is expected to return an integer ID.
- /// This is typically used with SQL INSERT commands that use the RETURNING clause
- /// to return the ID of the newly inserted row.
- /// </summary>
- /// <param name="sqlCode">The SQL code to execute.</param>
- /// <returns>The retrieved integer ID if the command executed successfully and returned a value,
- /// null otherwise.</returns>
- protected int? ExecuteSqlReturnId(string sqlCode)
- {
- StringBuilder messages = new StringBuilder();
- Exception exception = null!;
-
- try
- {
- using var connection = new NpgsqlConnection(DatabaseConnectionString);
- connection.Open();
+using DotNetEnv;
+using Npgsql;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Reflection;
+using System.Text;
+using Xunit;
+
+[Collection("Sequential")]
+public class PlDotNetTest
+{
+ protected SqlFunctionInfo? FunctionInfo;
+
+ string DatabaseConnectionString =
+ Environment.GetEnvironmentVariable("DATABASE_CONNECTION_STRING") + ";Include Error Detail=true"
+ ?? throw new InvalidOperationException("DATABASE_CONNECTION_STRING not set.");
+
+ int TestCount = 0;
+
+ public enum LanguageType
+ {
+ PlcSharp,
+ PlfSharp,
+ PlPython,
+ PlR,
+ PlPgSQL,
+ PlV8,
+ PlTCL,
+ PlLua,
+ PlPerl
+ }
+
+ public enum SqlTestType
+ {
+ Function,
+ Procedure,
+ DoBlock
+ }
+
+ public Dictionary<SqlTestType, string> TestTypeMap = new Dictionary<SqlTestType, string>
+ {
+ { SqlTestType.Function, "FUNCTION" },
+ { SqlTestType.Procedure, "PROCEDURE" },
+ { SqlTestType.DoBlock, "DO BLOCK" }
+ };
+
+ public class SqlFunctionInfo
+ {
+ // New properties for dynamic SQL construction
+
+ public string CteStatement { get; set; } = string.Empty;
+ public string CustomAssertion { get; set; } = string.Empty; // For complex assertion logic
+ public string QuerySuffix { get; set; } = string.Empty; // For additional WHERE, LIMIT, etc.
+ public SqlTestType TestType { get; set; } = SqlTestType.Function;
+ public string Name { get; set; } = string.Empty;
+ public List<FunctionArgument> Arguments { get; set; } = new List<FunctionArgument>();
+ public string ReturnType { get; set; } = string.Empty;
+ public string Body { get; set; } = string.Empty;
+ public LanguageType Language { get; set; }
+ public bool IsStrict { get; set; }
+ public string FunctionName { get; set; } = string.Empty;
+ public string TestName { get; set; } = string.Empty;
+ public string FeatureName { get; set; } = string.Empty;
+ public string InputStr { get; set; } = string.Empty;
+ public string ExpectedResult { get; set; } = string.Empty;
+ public string CastFunctionAs { get; set; } = string.Empty;
+
+ public int? TestId { get; set; }
+
+ public bool FunctionCreatedSuccessfully { get; set; } = false;
+
+ public bool TestInsertedSuccessfully { get; set; } = false;
+
+ public string SqlFunctionDefinition { get; set; } = string.Empty;
+
+ public string SqlFunctionCall { get; set; } = string.Empty;
+
+ public string LanguageString
+ {
+ get
+ {
+ return Language switch
+ {
+ LanguageType.PlcSharp => "plcsharp",
+ LanguageType.PlfSharp => "plfsharp",
+ LanguageType.PlPython => "plpython3u",
+ LanguageType.PlR => "plr",
+ LanguageType.PlPgSQL => "plpgsql",
+ LanguageType.PlV8 => "plv8",
+ LanguageType.PlTCL => "pltcl",
+ LanguageType.PlLua => "pllua",
+ LanguageType.PlPerl => "plperl",
+ _ => throw new System.NotImplementedException()
+ };
+ }
+ }
+
+ public SqlFunctionInfo() { }
+ }
+
+ public class FunctionArgument
+ {
+ public string Name { get; set; }
+ public string Type { get; set; }
+
+ public FunctionArgument(string name, string type)
+ {
+ Name = name;
+ Type = type;
+ }
+ }
+
+ public class TestQueryParameters
+ {
+ public List<(string Name, string Query)> Ctes { get; set; } =
+ new List<(string Name, string Query)>();
+ public string TestCategory { get; set; } = string.Empty;
+ public string TestName { get; set; } = string.Empty;
+ public string Assertion { get; set; } = string.Empty;
+ public string FinalSelect { get; set; } = string.Empty;
+ }
+
+ /// <summary>
+ /// Constructs and returns the SQL definition of a function based on the provided SqlFunctionInfo.
+ /// </summary>
+ /// <param name="functionInfo">The information about the SQL function.</param>
+ /// <returns>A string representing the SQL definition of the function.</returns>
+ /// <remarks>
+ /// The method uses the properties of the SqlFunctionInfo object to create a SQL CREATE OR REPLACE FUNCTION statement.
+ /// If the IsStrict property of the SqlFunctionInfo object is true, the "STRICT" keyword is added to the SQL definition.
+ /// </remarks>
+ public virtual string GetFunctionDefinition(SqlFunctionInfo functionInfo)
+ {
+ var arguments = string.Join(
+ ", ",
+ functionInfo.Arguments.Select(arg => $"{arg.Name} {arg.Type}")
+ );
+
+ string methodKeyword =
+ functionInfo.TestType == SqlTestType.Function ? "FUNCTION" : "PROCEDURE";
+
+ string strictKeyword = functionInfo.IsStrict ? "STRICT" : "";
+
+ // Conditionally build the returnTypeString
+ string returnTypeString = string.IsNullOrEmpty(functionInfo.ReturnType)
+ ? string.Empty
+ : $"RETURNS {functionInfo.ReturnType}";
+
+ return $@"CREATE OR REPLACE {methodKeyword} {functionInfo.Name}({arguments})
+{returnTypeString} AS $$
+ {functionInfo.Body}
+$$ LANGUAGE {functionInfo.LanguageString} {strictKeyword};";
+ }
+
+ public virtual string GetFunctionCall(SqlFunctionInfo functionInfo, bool forceCte = false)
+ {
+ if (functionInfo.TestType == SqlTestType.Procedure)
+ {
+ return $"CALL {functionInfo.Name}({functionInfo.InputStr});";
+ }
+
+ return TestResultStrategyFactory.GetStrategy(functionInfo, forceCte).BuildInsertSql(functionInfo);
+ }
+
+ public interface ITestResultStrategy
+ {
+ // AppliesTo determines if the strategy should be used for the given functionInfo
+ bool AppliesTo(SqlFunctionInfo functionInfo);
+
+ // BuildInsertSql returns the SQL code to insert the test result
+ string BuildInsertSql(SqlFunctionInfo functionInfo);
+ }
+
+ public class DefaultTestResultStrategy : ITestResultStrategy
+ {
+ public bool AppliesTo(SqlFunctionInfo functionInfo)
+ {
+ return true;
+ }
+
+ public string BuildInsertSql(SqlFunctionInfo functionInfo)
+ {
+ string functionCall = $"{functionInfo.Name}({functionInfo.InputStr})";
+
+ string cast = !string.IsNullOrWhiteSpace(functionInfo.CastFunctionAs)
+ ? $"CAST({functionCall} AS {functionInfo.CastFunctionAs})"
+ : functionCall;
+
+ string nullComparison =
+ functionInfo.ExpectedResult == "= null"
+ ? "IS NULL"
+ : $"{cast} {functionInfo.ExpectedResult}";
+
+ if (string.IsNullOrWhiteSpace(functionInfo.ExpectedResult))
+ {
+ nullComparison = "IS NOT NULL";
+ }
+
+ string sqlCode =
+ $@"INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
+ VALUES ('{functionInfo.FeatureName}', '{functionInfo.TestName}', {nullComparison})
+ RETURNING id;";
+
+ return sqlCode;
+ }
+ }
+
+ // public class CteTestResultStrategy : ITestResultStrategy
+ // {
+ // public bool AppliesTo(SqlFunctionInfo functionInfo)
+ // {
+ // // This strategy applies if a CTE statement is defined
+ // return !string.IsNullOrWhiteSpace(functionInfo.CteStatement);
+ // }
+
+ // public string BuildInsertSql(SqlFunctionInfo functionInfo)
+ // {
+ // // Use the provided CTE statement directly in the SQL command construction
+ // string sqlCode =
+ // $@"
+ // {functionInfo.CteStatement}
+ // INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
+ // SELECT '{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionInfo.CustomAssertion} FROM cte {functionInfo.QuerySuffix} RETURNING id;";
+
+ // return sqlCode;
+ // }
+ // }
+
+ // Defines a class CteTestResultStrategy that implements the ITestResultStrategy interface.
+ public class CteTestResultStrategy : ITestResultStrategy
+ {
+ // Determines if the strategy applies to the given SQL function based on the presence of a CTE statement.
+
+ public bool AppliesTo(SqlFunctionInfo functionInfo)
+ {
+ // Returns true if the CteStatement property of functionInfo is not null or whitespace, indicating
+ // this strategy should be used for functions with CTEs.
+ return !string.IsNullOrWhiteSpace(functionInfo.CteStatement);
+ }
+
+ // Builds an SQL INSERT statement using the information provided in the SqlFunctionInfo parameter.
+ public string BuildInsertSql(SqlFunctionInfo functionInfo)
+ {
+ // Extracts the name of the CTE from its SQL statement to use in the final query.
+ string cteName = ExtractCteName(functionInfo.CteStatement)!;
+
+ // Constructs an SQL statement that includes the CTE statement and an INSERT INTO operation.
+ // The INSERT operation adds a new row into the automated_test_results table with details from the functionInfo parameter
+ // and selects values from the CTE defined earlier, applying any specified query suffix. Finally, it returns the id of the inserted row.
+ string sqlCode =
+ $@"
+{functionInfo.CteStatement}
+INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
+SELECT '{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionInfo.CustomAssertion} FROM {cteName} {functionInfo.QuerySuffix} RETURNING id;";
+
+ // Returns the constructed SQL code.
+ return sqlCode;
+ }
+
+ // A private helper method to extract the name of the CTE from its SQL statement.
+ private string? ExtractCteName(string cteStatement)
+ {
+ // Uses a regular expression to find the CTE name in the CTE statement by looking for the pattern
+ // that follows "WITH" and precedes "AS". Assumes the CTE name is a single word (\w+).
+ var match = System.Text.RegularExpressions.Regex.Match(
+ cteStatement,
+ @"WITH\s+(\w+)\s+AS"
+ );
+ // If the pattern is found, the CTE name is returned.
+ if (match.Success)
+ {
+ return match.Groups[1].Value;
+ }
+ // If the pattern is not found, returns null indicating no CTE name could be extracted.
+ return null;
+ }
+ }
+
+ // public class CteTestResultStrategy : ITestResultStrategy
+ // {
+ // public bool AppliesTo(SqlFunctionInfo functionInfo)
+ // {
+ // // This strategy applies if a CTE statement is defined and not empty.
+ // return !string.IsNullOrWhiteSpace(functionInfo.CteStatement);
+ // }
+
+ // public string BuildInsertSql(SqlFunctionInfo functionInfo)
+ // {
+ // // Directly prepend the CTE statement to the SQL command
+ // string sqlCode =
+ // $@"
+ // {functionInfo.cteStatement}
+ // INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
+ // SELECT '{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionInfo.CustomAssertion} RETURNING id;";
+
+ // return sqlCode;
+ // }
+ // }
+
+ public class JsonOrXmlTestResultStrategy : ITestResultStrategy
+ {
+ public bool AppliesTo(SqlFunctionInfo functionInfo)
+ {
+ return (
+ functionInfo.ReturnType != null
+ && (
+ functionInfo.ReturnType.IndexOf("JSON", StringComparison.OrdinalIgnoreCase)
+ >= 0
+ || functionInfo.ReturnType.IndexOf(
+ "XML",
+ StringComparison.OrdinalIgnoreCase
+ ) >= 0
+ )
+ )
+ || (
+ functionInfo.ExpectedResult != null
+ && functionInfo.ExpectedResult.IndexOf(
+ "::JSON::TEXT",
+ StringComparison.OrdinalIgnoreCase
+ ) >= 0
+ );
+ }
+
+ public string BuildInsertSql(SqlFunctionInfo functionInfo)
+ {
+ string functionCall = $"{functionInfo.Name}({functionInfo.InputStr})::TEXT";
+ string expectedResult = functionInfo.ExpectedResult + "::TEXT";
+
+ string sqlCode =
+ $@" INSERT INTO automated_test_results (FEATURE, TEST_NAME, RESULT)
+ VALUES ('{functionInfo.FeatureName}', '{functionInfo.TestName}', {functionCall} {expectedResult})
+ RETURNING id;";
+ return sqlCode;
+ }
+ }
+
+ public class TestResultStrategyFactory
+ {
+ private static readonly List<ITestResultStrategy> Strategies = new List<ITestResultStrategy>
+ {
+ new CteTestResultStrategy(),
+ new JsonOrXmlTestResultStrategy(),
+ new DefaultTestResultStrategy()
+ };
+
+ public static ITestResultStrategy GetStrategy(
+ SqlFunctionInfo functionInfo,
+ bool forceCte = false
+ )
+ {
+ if (forceCte)
+ {
+ return Strategies[0];
+ }
+ return Strategies.FirstOrDefault(strategy => strategy.AppliesTo(functionInfo))
+ ?? new DefaultTestResultStrategy();
+ }
+ }
+
+ /// <summary>
+ /// Executes the provided SQL command that is expected to return an integer ID.
+ /// This is typically used with SQL INSERT commands that use the RETURNING clause
+ /// to return the ID of the newly inserted row.
+ /// </summary>
+ /// <param name="sqlCode">The SQL code to execute.</param>
+ /// <returns>The retrieved integer ID if the command executed successfully and returned a value,
+ /// null otherwise.</returns>
+ protected int? ExecuteSqlReturnId(string sqlCode)
+ {
+ StringBuilder messages = new StringBuilder();
+ Exception exception = null!;
+
+ try
+ {
+ using var connection = new NpgsqlConnection(DatabaseConnectionString);
+ connection.Open();
connection.Notice += (sender, e) =>
- {
- messages.AppendLine($"{e.Notice.MessageText}");
- };
- using var command = new NpgsqlCommand(sqlCode, connection);
- command.CommandType = CommandType.Text;
- using var reader = command.ExecuteReader();
- if (reader.Read())
- {
- return reader.GetInt32(0);
- }
- return null;
- }
- catch (Exception ex)
- {
- exception = ex;
- return null;
- }
- finally
- {
- LogTestExecutionDetails(exception, messages);
- }
- }
-
- /// <summary>
- /// Fetches the test result for the given function info based on its test ID.
- /// </summary>
- /// <param name="functionInfo">Information about the test whose result is to be fetched.</param>
- /// <returns>The test result if found; null otherwise.</returns>
- public bool? FetchTestResult(SqlFunctionInfo functionInfo)
- {
- if (!functionInfo.TestId.HasValue)
- {
- // Console.WriteLine("TestId is not set.");
- return null;
- }
-
- string sqlSelect =
- $@"
-SELECT RESULT
-FROM automated_test_results
-WHERE id = {functionInfo.TestId.Value};";
-
- object? result = ExecuteSql(sqlSelect);
-
- if (result is bool booleanResult)
- {
- return booleanResult;
- }
-
- return null;
- }
-
- /// <summary>
- /// Logs the execution details of a test, including any exception and SQL messages.
- /// </summary>
- /// <param name="exception">The exception that occurred during the test execution.</param>
- /// <param name="elogMessages">The SQL messages generated during the test execution.</param>
- protected void LogTestExecutionDetails(Exception exception, StringBuilder elogMessages)
- {
- if (elogMessages.Length > 0 || exception != null)
- {
- Console.WriteLine($"[START SQL EXECUTION DETAILS - TEST {TestCount}]");
- if (exception != null)
- {
- Console.WriteLine($"SQL Error:\n{exception.Message}");
- }
- if (elogMessages.Length > 0)
- {
- Console.WriteLine($"SQL Messages:\n{elogMessages.ToString().Trim()}");
- }
- Console.WriteLine($"[END SQL EXECUTION DETAILS - TEST {TestCount}]");
- }
- }
-
- /// <summary>
- /// Executes the provided SQL command.
- /// It returns true for successful execution
- /// and false for failures.
- /// </summary>
- /// <param name="sqlCode">The SQL code to execute.</param>
- /// <returns>It returns true for successful execution,
- /// and false otherwise.</returns>
- protected bool ExecuteSql(string sqlCode)
- {
- StringBuilder messages = new StringBuilder();
- Exception exception = null!;
-
- try
- {
- using var connection = new NpgsqlConnection(DatabaseConnectionString);
- connection.Open();
+ {
+ messages.AppendLine($"{e.Notice.MessageText}");
+ };
+ using var command = new NpgsqlCommand(sqlCode, connection);
+ command.CommandType = CommandType.Text;
+ using var reader = command.ExecuteReader();
+ if (reader.Read())
+ {
+ return reader.GetInt32(0);
+ }
+ return null;
+ }
+ catch (Exception ex)
+ {
+ exception = ex;
+ return null;
+ }
+ finally
+ {
+ LogTestExecutionDetails(exception, messages);
+ }
+ }
+
+ /// <summary>
+ /// Fetches the test result for the given function info based on its test ID.
+ /// </summary>
+ /// <param name="functionInfo">Information about the test whose result is to be fetched.</param>
+ /// <returns>The test result if found; null otherwise.</returns>
+ public bool? FetchTestResult(SqlFunctionInfo functionInfo)
+ {
+ if (!functionInfo.TestId.HasValue)
+ {
+ // Console.WriteLine("TestId is not set.");
+ return null;
+ }
+
+ string sqlSelect =
+ $@"
+SELECT RESULT
+FROM automated_test_results
+WHERE id = {functionInfo.TestId.Value};";
+
+ object? result = ExecuteSql(sqlSelect);
+
+ if (result is bool booleanResult)
+ {
+ return booleanResult;
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Logs the execution details of a test, including any exception and SQL messages.
+ /// </summary>
+ /// <param name="exception">The exception that occurred during the test execution.</param>
+ /// <param name="elogMessages">The SQL messages generated during the test execution.</param>
+ protected void LogTestExecutionDetails(Exception exception, StringBuilder elogMessages)
+ {
+ if (elogMessages.Length > 0 || exception != null)
+ {
+ Console.WriteLine($"[START SQL EXECUTION DETAILS - TEST {TestCount}]");
+ if (exception != null)
+ {
+ Console.WriteLine($"SQL Error:\n{exception.Message}");
+ }
+ if (elogMessages.Length > 0)
+ {
+ Console.WriteLine($"SQL Messages:\n{elogMessages.ToString().Trim()}");
+ }
+ Console.WriteLine($"[END SQL EXECUTION DETAILS - TEST {TestCount}]");
+ }
+ }
+
+ /// <summary>
+ /// Executes the provided SQL command.
+ /// It returns true for successful execution
+ /// and false for failures.
+ /// </summary>
+ /// <param name="sqlCode">The SQL code to execute.</param>
+ /// <returns>It returns true for successful execution,
+ /// and false otherwise.</returns>
+ protected bool ExecuteSql(string sqlCode)
+ {
+ StringBuilder messages = new StringBuilder();
+ Exception exception = null!;
+
+ try
+ {
+ using var connection = new NpgsqlConnection(DatabaseConnectionString);
+ connection.Open();
connection.Notice += (sender, e) =>
- {
- messages.AppendLine($"{e.Notice.MessageText}");
- };
-
- using var command = new NpgsqlCommand(sqlCode, connection);
- // command.CommandType = CommandType.Text;
- if (sqlCode.TrimStart().StartsWith("SELECT", StringComparison.OrdinalIgnoreCase))
- {
- using var reader = command.ExecuteReader();
- if (reader.Read())
- {
- object value = reader.GetValue(0);
- if (value is bool booleanValue)
- {
- return booleanValue;
- }
- }
- return false;
- }
- else
- {
- command.ExecuteNonQuery();
- return true;
- }
- }
- catch (Exception ex)
- {
- exception = ex;
- return false;
- }
- finally
- {
- LogTestExecutionDetails(exception, messages);
- }
- }
-
- /// <summary>
- /// Executes a generic test for the provided SQL function, logs the test result, and asserts the success of each step.
- /// <para>This method performs the following actions and validations:</para>
- /// <para>1. Sets up the function information based on the provided parameters.</para>
- /// <para>2. Attempts to define the function in the database.</para>
- /// <para>3. Validates (via assertion) that the function was successfully created.</para>
- /// <para>4. Inserts the test result for the defined function into the database.</para>
- /// <para>5. Validates (via assertion) that the test result was successfully inserted.</para>
- /// <para>6. Fetches the test result from the database.</para>
- /// <para>7. Validates (via assertion) that a test result was retrieved.</para>
- /// <para>8. Validates (via assertion) that the retrieved test result matches the expected result.</para>
- /// </summary>
- /// <param name="functionName">Name of the SQL function to test.</param>
- /// <param name="featureName">Feature associated with the test.</param>
- /// <param name="input">Input string for the SQL function.</param>
- /// <param name="expectedResult">Expected result string for the SQL function.</param>
- public void RunGenericTest(
- string featureName,
- string testName,
- string input,
- string expectedResult
- )
- {
- RunTest(
- featureName: featureName,
- testName: testName,
- input: input,
- expectedResult: expectedResult
- );
- }
-
- public void RunTestWithSuffix(
- string featureName,
- string testName,
- string cteStatement,
- string customAssertion,
- string querySuffix = null!,
- bool forceCte = false
- )
- {
- RunTest(
- featureName: featureName,
- testName: testName,
- cteStatement: cteStatement,
- customAssertion: customAssertion,
- querySuffix: querySuffix,
- forceCte: forceCte
- );
- }
-
- public void RunTest(
- string featureName,
- string testName,
- string input = "",
- string expectedResult = "",
- string cteStatement = "",
- string customAssertion = "",
- string querySuffix = "",
- bool forceCte = false
- )
- {
- TestCount++;
- Console.WriteLine(
- $"[START TEST {TestCount}] Running test {testName} for feature {featureName}."
- );
-
- if (FunctionInfo == null)
- {
- Assert.Fail("FunctionInfo is null, test cannot proceed.");
- return;
- }
-
- // Set up the FunctionInfo object with the provided parameters
- FunctionInfo.TestName = testName;
- FunctionInfo.FeatureName = featureName;
- FunctionInfo.InputStr = input;
- FunctionInfo.ExpectedResult = expectedResult;
- FunctionInfo.CteStatement = cteStatement; // Updated to use the full CTE statement
- FunctionInfo.CustomAssertion = customAssertion;
- FunctionInfo.QuerySuffix = querySuffix;
-
- // Combine pieces of FunctionInfo to create SQL codes
- FunctionInfo.SqlFunctionDefinition = GetFunctionDefinition(FunctionInfo);
- FunctionInfo.SqlFunctionCall = GetFunctionCall(FunctionInfo, forceCte);
- Console.WriteLine(
- $"[START SQL FUNCTION - TEST {TestCount}]\n```sql\n{FunctionInfo.SqlFunctionDefinition}\n```\n[END SQL FUNCTION - TEST {TestCount}]\n"
- );
- Console.WriteLine(
- $"[START SQL CALL FUNCTION - TEST {TestCount}]\n```sql\n{FunctionInfo.SqlFunctionCall}\n```\n[END SQL CALL FUNCTION - TEST {TestCount}]"
- );
-
- // Create the function in the PostgreSQL database
- FunctionInfo.FunctionCreatedSuccessfully = ExecuteSql(FunctionInfo.SqlFunctionDefinition);
- Assert.True(
- FunctionInfo.FunctionCreatedSuccessfully,
- $"[COMPILATION ERROR] Test {TestCount} failed to create function in the PostgreSQL database."
- );
-
- if (FunctionInfo.TestType == SqlTestType.Procedure)
- {
- bool? procedureResult = ExecuteSql(FunctionInfo.SqlFunctionCall);
- Assert.True(
- procedureResult.HasValue && procedureResult.Value,
- $"[EXECUTION ERROR] Test {TestCount} failed to execute procedure test."
- );
- Console.WriteLine($"[END TEST {TestCount}] Test {testName} executed successfully.\n");
- return;
- }
-
- // Call test and insert the test result into the PostgreSQL table
- FunctionInfo.TestId = ExecuteSqlReturnId(FunctionInfo.SqlFunctionCall);
-
- Assert.True(
- FunctionInfo.TestId.HasValue,
- $"[EXECUTION ERROR] Test {TestCount} failed to execute test and insert test result into table."
- );
-
- // Fetch the test result from the PostgreSQL table and validate it
- bool? testResult = FetchTestResult(FunctionInfo);
- Assert.True(
- testResult.HasValue,
- $"[UNEXPECTED ERROR] Test {TestCount} failed to get the test result value."
- );
- Assert.True(
- testResult.Value,
- $"[ASSERTION ERROR] Test {TestCount} returned unexpected result."
- );
-
- Console.WriteLine($"[END TEST {TestCount}] Test {testName} executed successfully.\n");
- }
-}
+ {
+ messages.AppendLine($"{e.Notice.MessageText}");
+ };
+
+ using var command = new NpgsqlCommand(sqlCode, connection);
+ // command.CommandType = CommandType.Text;
+ if (sqlCode.TrimStart().StartsWith("SELECT", StringComparison.OrdinalIgnoreCase))
+ {
+ using var reader = command.ExecuteReader();
+ if (reader.Read())
+ {
+ object value = reader.GetValue(0);
+ if (value is bool booleanValue)
+ {
+ return booleanValue;
+ }
+ }
+ return false;
+ }
+ else
+ {
+ command.ExecuteNonQuery();
+ return true;
+ }
+ }
+ catch (Exception ex)
+ {
+ exception = ex;
+ return false;
+ }
+ finally
+ {
+ LogTestExecutionDetails(exception, messages);
+ }
+ }
+
+ /// <summary>
+ /// Executes a generic test for the provided SQL function, logs the test result, and asserts the success of each step.
+ /// <para>This method performs the following actions and validations:</para>
+ /// <para>1. Sets up the function information based on the provided parameters.</para>
+ /// <para>2. Attempts to define the function in the database.</para>
+ /// <para>3. Validates (via assertion) that the function was successfully created.</para>
+ /// <para>4. Inserts the test result for the defined function into the database.</para>
+ /// <para>5. Validates (via assertion) that the test result was successfully inserted.</para>
+ /// <para>6. Fetches the test result from the database.</para>
+ /// <para>7. Validates (via assertion) that a test result was retrieved.</para>
+ /// <para>8. Validates (via assertion) that the retrieved test result matches the expected result.</para>
+ /// </summary>
+ /// <param name="functionName">Name of the SQL function to test.</param>
+ /// <param name="featureName">Feature associated with the test.</param>
+ /// <param name="input">Input string for the SQL function.</param>
+ /// <param name="expectedResult">Expected result string for the SQL function.</param>
+ public void RunGenericTest(
+ string featureName,
+ string testName,
+ string input,
+ string expectedResult
+ )
+ {
+ RunTest(
+ featureName: featureName,
+ testName: testName,
+ input: input,
+ expectedResult: expectedResult
+ );
+ }
+
+ public void RunTestWithSuffix(
+ string featureName,
+ string testName,
+ string cteStatement,
+ string customAssertion,
+ string querySuffix = null!,
+ bool forceCte = false
+ )
+ {
+ RunTest(
+ featureName: featureName,
+ testName: testName,
+ cteStatement: cteStatement,
+ customAssertion: customAssertion,
+ querySuffix: querySuffix,
+ forceCte: forceCte
+ );
+ }
+
+ public void RunTest(
+ string featureName,
+ string testName,
+ string input = "",
+ string expectedResult = "",
+ string cteStatement = "",
+ string customAssertion = "",
+ string querySuffix = "",
+ bool forceCte = false
+ )
+ {
+ TestCount++;
+ Console.WriteLine(
+ $"[START TEST {TestCount}] Running test {testName} for feature {featureName}."
+ );
+
+ if (FunctionInfo == null)
+ {
+ Assert.Fail("FunctionInfo is null, test cannot proceed.");
+ return;
+ }
+
+ // Set up the FunctionInfo object with the provided parameters
+ FunctionInfo.TestName = testName;
+ FunctionInfo.FeatureName = featureName;
+ FunctionInfo.InputStr = input;
+ FunctionInfo.ExpectedResult = expectedResult;
+ FunctionInfo.CteStatement = cteStatement; // Updated to use the full CTE statement
+ FunctionInfo.CustomAssertion = customAssertion;
+ FunctionInfo.QuerySuffix = querySuffix;
+
+ // Combine pieces of FunctionInfo to create SQL codes
+ FunctionInfo.SqlFunctionDefinition = GetFunctionDefinition(FunctionInfo);
+ FunctionInfo.SqlFunctionCall = GetFunctionCall(FunctionInfo, forceCte);
+ Console.WriteLine(
+ $"[START SQL FUNCTION - TEST {TestCount}]\n```sql\n{FunctionInfo.SqlFunctionDefinition}\n```\n[END SQL FUNCTION - TEST {TestCount}]\n"
+ );
+ Console.WriteLine(
+ $"[START SQL CALL FUNCTION - TEST {TestCount}]\n```sql\n{FunctionInfo.SqlFunctionCall}\n```\n[END SQL CALL FUNCTION - TEST {TestCount}]"
+ );
+
+ // Create the function in the PostgreSQL database
+ FunctionInfo.FunctionCreatedSuccessfully = ExecuteSql(FunctionInfo.SqlFunctionDefinition);
+ Assert.True(
+ FunctionInfo.FunctionCreatedSuccessfully,
+ $"[COMPILATION ERROR] Test {TestCount} failed to create function in the PostgreSQL database."
+ );
+
+ if (FunctionInfo.TestType == SqlTestType.Procedure)
+ {
+ bool? procedureResult = ExecuteSql(FunctionInfo.SqlFunctionCall);
+ Assert.True(
+ procedureResult.HasValue && procedureResult.Value,
+ $"[EXECUTION ERROR] Test {TestCount} failed to execute procedure test."
+ );
+ Console.WriteLine($"[END TEST {TestCount}] Test {testName} executed successfully.\n");
+ return;
+ }
+
+ // Call test and insert the test result into the PostgreSQL table
+ FunctionInfo.TestId = ExecuteSqlReturnId(FunctionInfo.SqlFunctionCall);
+
+ Assert.True(
+ FunctionInfo.TestId.HasValue,
+ $"[EXECUTION ERROR] Test {TestCount} failed to execute test and insert test result into table."
+ );
+
+ // Fetch the test result from the PostgreSQL table and validate it
+ bool? testResult = FetchTestResult(FunctionInfo);
+ Assert.True(
+ testResult.HasValue,
+ $"[UNEXPECTED ERROR] Test {TestCount} failed to get the test result value."
+ );
+ Assert.True(
+ testResult.Value,
+ $"[ASSERTION ERROR] Test {TestCount} returned unexpected result."
+ );
+
+ Console.WriteLine($"[END TEST {TestCount}] Test {testName} executed successfully.\n");
+ }
+}
diff --git a/contrib/pldotnet/tests/xUnit/PlDotNetTest.csproj b/contrib/pldotnet/tests/xUnit/PlDotNetTest.csproj
index 6159a16..d723a11 100644
--- a/contrib/pldotnet/tests/xUnit/PlDotNetTest.csproj
+++ b/contrib/pldotnet/tests/xUnit/PlDotNetTest.csproj
@@ -1,26 +1,26 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>$(TargetFramework)</TargetFramework>
- <ImplicitUsings>enable</ImplicitUsings>
- <Nullable>enable</Nullable>
-
- <IsPackable>false</IsPackable>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="DotNetEnv" Version="3.1.1" />
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
- <PackageReference Include="Npgsql" Version="9.0.3" />
- <PackageReference Include="xunit" Version="2.9.3" />
- <PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
- <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
- <PrivateAssets>all</PrivateAssets>
- </PackageReference>
- <PackageReference Include="coverlet.collector" Version="6.0.4">
- <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
- <PrivateAssets>all</PrivateAssets>
- </PackageReference>
- </ItemGroup>
-
-</Project>
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>$(TargetFramework)</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+
+ <IsPackable>false</IsPackable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="DotNetEnv" Version="3.1.1" />
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
+ <PackageReference Include="Npgsql" Version="9.0.3" />
+ <PackageReference Include="xunit" Version="2.9.3" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
+ <PackageReference Include="coverlet.collector" Version="6.0.4">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
+ </ItemGroup>
+
+</Project>
diff --git a/contrib/postgis/.codespell.ignore b/contrib/postgis/.codespell.ignore
index e75d0d6..de287e7 100644
--- a/contrib/postgis/.codespell.ignore
+++ b/contrib/postgis/.codespell.ignore
@@ -35,5 +35,3 @@
unknwn
nin
msdos
-Koordinates
-Pease
diff --git a/contrib/postgis/ChangeLog b/contrib/postgis/ChangeLog
index bda9607..876aa76 100644
--- a/contrib/postgis/ChangeLog
+++ b/contrib/postgis/ChangeLog
@@ -1,165 +1,125 @@
-2026-02-09 Regina Obe <lr@pcorp.us>
+2025-11-13 Paul Ramsey <pramsey@cleverelephant.ca>
- * doc/release_notes.xml: Fix missing </para>
+ * .gitignore, NEWS, README.postgis, Version.config,
+ doc/release_notes.xml, extensions/upgradeable_versions.mk: Prepare
+ for 3.6.1 release
-2026-02-09 Regina Obe <lr@pcorp.us>
+2025-11-12 Regina Obe <lr@pcorp.us>
- * NEWS, README.postgis, Version.config, doc/release_notes.xml,
- extensions/upgradeable_versions.mk: Prep for PostGIS 3.6.2 release
+ * NEWS, doc/extras_topology.xml, topology/Makefile.in,
+ topology/sql/manage/FixCorruptTopoGeometryColumn.sql.in,
+ topology/test/regress/fix_topogeometry_columns.sql,
+ topology/test/regress/fix_topogeometry_columns_expected,
+ topology/test/regress/hooks/hook-after-upgrade-topology.sql,
+ topology/test/tests.mk, topology/topology.sql.in:
+ topology.FixCorruptTopoGeometryColumn to fix corruption caused by
+ 3.6.0 upgrade - Add function - Add tests - Add docs - Add NEWS References #5983 for PostGIS 3.6.1
-2026-02-09 Regina Obe <lr@pcorp.us>
+2025-11-10 Regina Obe <lr@pcorp.us>
- * .cirrus.yml: FIXES TO CIRRUS CI - Get rid of $NCPU and put in a 2 instead and lower the ram.
- References #6047 for PostGIS 3.6.2 - Change FreeBSD to 14.3, 14.2 is no longer available
-
-2026-02-09 Regina Obe <lr@pcorp.us>
-
- * extensions/postgis_extension_helper.sql.in,
- extensions/postgis_extension_helper_uninstall.sql,
+ * NEWS, doc/installation.xml,
extensions/postgis_tiger_geocoder/Makefile.in,
- extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sq
- l.in, extensions/postgis_topology/Makefile.in,
- extensions/postgis_topology/sql_bits/remove_from_extension.sql.in:
- Remove postgis_extension_remove_objects Closes #5853 for PostGIS
- 3.6.2 Fix postgis_tiger_geocoder upgrade for PostgreSQL < 16 Closes #6032
- for PostGIS 3.6.2
+ extras/tiger_geocoder/tiger_loader_2025.sql: Revise
+ postgis_tiger_geocoder to use tiger 2025 data Closes #6013 for
+ PostGIS 3.6.1
-2026-02-02 Maksim Korotkov <m.korotkov@postgrespro.ru>
+2025-11-07 Paul Ramsey <pramsey@cleverelephant.ca>
- * postgis/flatgeobuf.c: Fix memory allocation size for arrays in
- flatgeobuf_decode_row The original code incorrectly allocated memory
- for pointers instead of the actual types, potentially causing buffer
- overflows or memory corruption since it was allocating insufficient
- memory (size of pointer instead of size of Datum/bool). Found by PostgesPro. Fixes: 3ae2c5844 ("FlatGeobuf format
- input/output") Signed-off-by: Maksim Korotkov
- <m.korotkov@postgrespro.ru>
+ * NEWS: News entry for #6012
-2026-01-27 Paul Ramsey <pramsey@cleverelephant.ca>
+2025-11-07 Paul Ramsey <pramsey@cleverelephant.ca>
- * postgis/gserialized_typmod.c: Fix mixed declarations mistake
+ * liblwgeom/lwcircstring.c: fix memory leak, references #6012
-2026-01-27 bdreiss <bd_reiss@gmx.at>
+2025-11-07 Darafei Praliaskouski <me@komzpa.net>
- * postgis/gserialized_typmod.c: The geodetic flag was queried after
- gser has been freed ################################################### BUG REPORT
- ################################################## ### DESCRITPION ### The geodetic flag was queried after gser has been freed in line 143,
- leading to a use-after-free bug. This means the behaviour is
- undefined and it is not clear, which branch will be taken (and
- therefor, whether geometry or geography is returned). Below you find
- the output from gdb can be seen, that confirms that a) the point is
- indeed inserted with the wrong flag and b) also after selecting the
- point from the table remains unset. Issues when using SQL could not
- be produced. ### SETUP IN PG ### CREATE EXTENSION postgis; CREATE TABLE test_geog (id SERIAL PRIMARY
- KEY, geog geography(POINT, 4326)); INSERT INTO test_geog (geog)
- VALUES (ST_GeogFromText('SRID=4326;POINT(-77.0092 38.889588)')); ### GDB OUPUT AND STEPS TO REPRODUCE ### postgres@localhost:~$ gdb --args /usr/local/pgsql/bin/postgres
- --single -D $PGDATA postgres (gdb) break gserialized_typmod.c:143 (gdb) break gserialized_typmod.c:150 (gdb) break geography_out (gdb) run backend> INSERT INTO test_geog (geog) VALUES
- (ST_GeogFromText('SRID=4326;MULTIPOINT EMPTY')); Breakpoint 1,
- postgis_valid_typmod (gser=0x58f991a3f378, typmod=1107460) at
- gserialized_typmod.c:143 143 gserialized_typmod.c: No such file
- or directory. (gdb) call gserialized_is_geodetic(gser) $1 = 1 (gdb) c Continuing. Breakpoint 2, postgis_valid_typmod (gser=0x58f991a8e150,
- typmod=1107460) at gserialized_typmod.c:151 151 in
- gserialized_typmod.c (gdb) call gserialized_is_geodetic(gser) $2 = 0 (gdb) c Continuing. backend> backend> INSERT INTO test_geog (geog)
- VALUES (ST_GeogFromText('SRID=4326;POINT(-77.0092 38.889588)')); Breakpoint 2, postgis_valid_typmod (gser=0x58f991a3dca8,
- typmod=1107460) at gserialized_typmod.c:151 151 in
- gserialized_typmod.c (gdb) call gserialized_is_geodetic(gser) $4 = 1 (gdb) c Continuing. backend> backend> select geog from test_geog
- where id=1; 1: geog (typeid = 14296, len = -1, typmod = 1107460, byval =
- f) ---- Breakpoint 3, geography_out (fcinfo=0x7ffe871b40e0) at
- /usr/local/pgsql/include/server/postgres.h:319 319
- return (Pointer) X; (gdb) set $gser = (GSERIALIZED *) pg_detoast_datum((void *)
- fcinfo->args[0].value) (gdb) call gserialized_is_geodetic($gser) $7 = 0 (gdb) c Continuing. 1: geog =
- "0101000020E6100000000000000000F87F000000000000F87F"
- (typeid = 14296, len = -1, typmod = 1107460, byval = f) ----
- backend> select geog from test_geog where id=2; 1: geog (typeid = 14296, len = -1, typmod = 1107460,
- byval = f) ---- Breakpoint 3, geography_out (fcinfo=0x7ffe871b40e0) at
- /usr/local/pgsql/include/server/postgres.h:319 319
- return (Pointer) X; (gdb) set $gser = (GSERIALIZED *) pg_detoast_datum((void *)
- fcinfo->args[0].value) (gdb) call gserialized_is_geodetic($gser) $8 = 1 (gdb) c Continuing. 1: geog =
- "0101000020E6100000E3C798BB964053C000750305DE714340"
- (typeid = 14296, len = -1, typmod = 1107460, byval = f) ----
- backend> ### INFO ### postgres=# SELECT version(); version
+ * NEWS: Touch up NEWS Closes #5984
- --------------------------------------------------------------------------------------------------- PostgreSQL 18.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian
- 12.2.0-14+deb12u1) 12.2.0, 64-bit (1 row) postgres=# SELECT postgis_full_version();
- postgis_full_version
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------------------------------------------------------------------------------- POSTGIS="3.6.1 f533623" [EXTENSION] PGSQL="180"
- GEOS="3.11.1-CAPI-1.17.1" PROJ="9.1.1 NETWORK_ENABLED=OFF
- URL_ENDPOINT=https://cdn.proj.org
- USER_WRITABLE_DIRECTORY=/home/postgres/.loc al/share/proj
- DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.1.1)
- LIBXML="2.9.14" LIBJSON="0.16" LIBPROTOBUF="1.4.1" WAGYU="0.5.0
- (Internal)" (1 row) COMPILE FLAGS USED: CC=clang ./configure --with-pgconfig=/usr/bin/pg_config CFLAGS="-O0
- -g -fsanitize=address -fno-omit-frame-pointer"
- LDFLAGS="-fsanitize=address"
- ###############################################################################################################
+2025-10-30 Darafei Praliaskouski <me@komzpa.net>
-2026-01-26 Maksim Korotkov <m.korotkov@postgrespro.ru>
+ * postgis/cunit/cu_tester.c, postgis/gserialized_estimate.c,
+ postgis/gserialized_estimate_support.h: Guard against histogram axis
+ dimension underflow References #5959 References #5984
- * postgis/geography_centroid.c: Replace check for avoiding NULL
- dereference Fixes: 9726c4770 ("missed file commit for ST_Centroid Geography
- support references #2951") Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
+2025-10-30 Darafei Praliaskouski <me@komzpa.net>
-2026-01-20 Paul Ramsey <pramsey@cleverelephant.ca>
+ * NEWS, configure.ac, postgis/cunit/Makefile.in,
+ postgis/cunit/cu_tester.c, postgis/gserialized_estimate.c,
+ postgis/gserialized_estimate_support.h: Prevent histogram target
+ overflow when analysing massive tables Add CUnit tests for overflow scenarios Closes #5959
- * NEWS: News item for 680639af5
+2025-10-15 Paul Ramsey <pramsey@cleverelephant.ca>
-2026-01-20 Maksim Korotkov <m.korotkov@postgrespro.ru>
+ * NEWS, postgis/postgis.sql.in: ST_ForcePolygonCCW should not flip
+ lines, closes #5754
- * extensions/address_standardizer/standard.c: Avoid potential NULL
- dereference in std_free() After check against NULL the pointer std
- -> pagc_p was used unsafely. Found by PostgresPro with Svace Static Analyzer. Fixes: c6091a4bb
+2025-10-09 Regina Obe <lr@pcorp.us>
+
+ * NEWS: Add credits. References #5998 for PostGIS 3.6.1
+
+2025-10-07 Regina Obe <lr@pcorp.us>
+
+ * extras/tiger_geocoder/geocode_settings.sql,
+ extras/tiger_geocoder/pagc_normalize/pagc_tables.sql,
+ extras/tiger_geocoder/tiger_loader_2012.sql,
+ extras/tiger_geocoder/tiger_loader_2013.sql,
+ extras/tiger_geocoder/tiger_loader_2014.sql,
+ extras/tiger_geocoder/tiger_loader_2015.sql,
+ extras/tiger_geocoder/tiger_loader_2016.sql,
+ extras/tiger_geocoder/tiger_loader_2017.sql,
+ extras/tiger_geocoder/tiger_loader_2018.sql,
+ extras/tiger_geocoder/tiger_loader_2019.sql,
+ extras/tiger_geocoder/tiger_loader_2020.sql,
+ extras/tiger_geocoder/tiger_loader_2021.sql,
+ extras/tiger_geocoder/tiger_loader_2022.sql,
+ extras/tiger_geocoder/tiger_loader_2023.sql,
+ extras/tiger_geocoder/tiger_loader_2024.sql: TIGER EXTENSION
+ SECURITY fix - Ensure tables are created by tiger extension and bale if not. Patch provided by Andrey Borodin (Yandex) - Don't create tiger_data as that gets created on first load of
+ data and shouldn't be part of the extension References #5998 for PostGIS 3.6.1
+
+2025-10-09 Regina Obe <lr@pcorp.us>
+
+ * ci/winnie/package_postgis.sh, ci/winnie/regress_postgis.sh,
+ ci/winnie/winnie_common.sh: Cleanup winnie ci building
+
+2025-10-08 Paul Ramsey <pramsey@cleverelephant.ca>
+
+ * liblwgeom/measures.c, liblwgeom/measures.h: Avoid possible null
+ pointer dereference. Closes #6000
+
+2025-10-08 Paul Ramsey <pramsey@cleverelephant.ca>
+
+ * postgis/lwgeom_transform.c: Add in headers for Pg19 build
+
+2025-09-24 Nikolai B <nikolai-b@users.noreply.github.com>
+
+ * doc/introduction.xml, doc/reference_overlay.xml: doc(St_Subdivide)
+ mention potential changes in geography Closes
+ https://github.com/postgis/postgis/pull/831 for PostGIS 3.6.1 Patch provided by Nikolai Berkoff
+
+2025-10-07 Maksim Korotkov <m.korotkov@postgrespro.ru>
+
+ * extensions/address_standardizer/standard.c: address_standardizer:
+ fixed memory leak The memory was not released in case of error
+ handling. Found by PostgresPro with Svace static analyzer Fixes: c6091a4bb
("Prep to move address_standardizer into extensions folder")
Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
-2026-01-16 Loïc Bartoletti <loic.bartoletti@oslandia.com>
+2025-10-07 Paul Ramsey <pramsey@cleverelephant.ca>
- * sfcgal/regress/sfcgal_v2.sql, sfcgal/regress/sfcgal_v2_expected:
- test(sfcgal): Fix Buffer3D tests against SFCGAL 2.3.0 SFCGAL 2.3.0 improves sphere generation using icosahedron algorithm
- to avoid float issue. The geometry is slightly different and test
- must be adapted accordingly.
+ * doc/reference_coverage.xml: Fix definition of ST_CoverageClean
+ parameter order
-2026-01-14 Sandro Santilli <strk@kbt.io>
+2025-10-06 Paul Ramsey <pramsey@cleverelephant.ca>
- * .codespell.ignore: Add surnames to spellcheck ignore list
+ * NEWS, postgis/lwgeom_geos.c: Consistent clipping of MULTI/POINT
+ (Paul Ramsey) References #5962
-2026-01-14 Sandro Santilli <strk@kbt.io>
+2025-10-06 Paul Ramsey <pramsey@cleverelephant.ca>
- * liblwgeom/lwalgorithm.c: Stop using a tolerance for point-same
- functions References #6023 in 3.6 branch (3.6.2dev) This is partially reverting 80eefad13bd00d1e56d2bec36cd5140f87775ce4
+ * liblwgeom/cunit/cu_measures.c, liblwgeom/lwalgorithm.c: Fix
+ raycast for linestrings, references #5989
-2026-01-13 Sandro Santilli <strk@kbt.io>
+2025-10-03 Paul Ramsey <pramsey@cleverelephant.ca>
- * NEWS: Add missing NEWS item
-
-2026-01-13 Sandro Santilli <strk@kbt.io>
-
- * liblwgeom/cunit/cu_ptarray.c, liblwgeom/ptarray.c: Fix robustness
- issue in ptarray_contains_point References #6023 in 3.6 branch (3.6.2dev) Includes unit test
-
-2025-12-22 Sandro Santilli <strk@kbt.io>
-
- * NEWS, doc/developer.md: Fix some spelling typos
-
-2025-12-22 Sandro Santilli <strk@kbt.io>
-
- * NEWS, topology/sql/cleanup/RemoveUnusedPrimitives.sql.in,
- topology/test/regress/removeunusedprimitives.sql: Fix
- RemoveUnusedPrimitives without "topology" in search_path Includes regression test. References #6027 in stable-3.6 branch (3.6.2dev)
-
-2025-12-15 Paul Ramsey <pramsey@cleverelephant.ca>
-
- * NEWS, liblwgeom/cunit/cu_gserialized2.c,
- liblwgeom/gserialized2.c, liblwgeom/lwin_wkb.c: Convert
- POLYGON(EMPTY) a polygon with an empty ring into POLYGON EMPTY a
- polygon with no rings, in the WKB input routine. Handle any existing
- POLYGON(EMPTY) in the gserialized_is_empty routine. References #6028
-
-2025-11-30 Regina Obe <lr@pcorp.us>
-
- * .drone-1.0.yml, .woodpecker/regress.yml: Get rid of drone and
- refine wood-pecker to include removed drone items
-
-2025-11-19 Paul Ramsey <pramsey@cleverelephant.ca>
-
- * schema qualify call in ST_MPointFromText, references #6020
-
+ * Restore history to NEWS file
diff --git a/contrib/postgis/NEWS b/contrib/postgis/NEWS
index 72a5e5b..adbfb2b 100644
--- a/contrib/postgis/NEWS
+++ b/contrib/postgis/NEWS
@@ -1,35 +1,4 @@
-PostGIS 3.6.2
-2026/02/09
-
-This version requires PostgreSQL 12-18, GEOS 3.8 or higher, and Proj 6.1+.
-To take advantage of all features, GEOS 3.14+ is needed.
-To take advantage of all SFCGAL features, SFCGAL 2.2+ is needed.
-
-If you are upgrading postgis_topology from a version before 3.6.1 and
-have topogeometry columns, make sure to run after the upgrade to fix
-topogeometry corruption:
-
- SELECT topology.FixCorruptTopoGeometryColumn(
- schema_name, table_name, feature_column
- ) FROM topology.layer;
-
-* Fixes *
-
-- #6023, Fix robustness issue in ptarray_contains_point (Sandro Santilli)
-- #6027, Fix RemoveUnusedPrimitives without topology in search_path
- (Sandro Santilli)
-- #6019, make clean does not remove cunit generated files
- (Bas Couwenberg)
-- #6020, schema qualify call in ST_MPointFromText (Paul Ramsey)
-- #6028, crash indexing malformed empty polygon (Paul Ramsey)
-- GH-841, small memory leak in address_standardizer (Maxim Korotkov)
-- #5853, Issue with topology and tiger geocoder upgrade scripts
- (Regina Obe, Spencer Bryson)
-- #6032, Fix postgis_tiger_geocoder upgrade for PostgreSQL < 16
- (Regina Obe)
-
-
PostGIS 3.6.1
2025/11/13
@@ -234,7 +203,7 @@
This version requires PostgreSQL 12-16, GEOS 3.6 or higher, and Proj 6.1+.
To take advantage of all features, GEOS 3.12+ is needed.
-To take advantage of all SFCGAL features, SFCGAL 1.4.1+ is needed.
+To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
Many thanks to our translation teams, in particular:
@@ -420,7 +389,7 @@
we have decided to disable the feature by default
until we get more user testing
as to the true impact of real-world queries.
-If you are running PG14+, you can re-enable it by doing
+If you are running PG14+, you can reenable it by doing
ALTER OPERATOR FAMILY gist_geometry_ops_2d USING gist
ADD FUNCTION 11 (geometry)
@@ -565,7 +534,7 @@
- #4710, ST_ClusterKMeans now works with 3D geometries (Darafei Praliaskouski)
- #4801, ST_ClusterKMeans supports weights in POINT[Z]M geometries
(Darafei Praliaskouski)
- - #4805, _ST_SortableHash exposed to work around parallel sorting performance issue
+ - #4805, _ST_SortableHash exposed to work around parallel soring performance issue
in Postgres. If your table is huge, use ORDER BY _ST_SortableHash(geom)
instead of ORDER BY geom to make parallel sort faster (Darafei Praliaskouski)
- #4625, Correlation statistics now calculated.
@@ -577,7 +546,7 @@
- #4789, Sped up TopoJSON output for areal TopoGeometry with
many holes (Sandro Santilli)
- #4758, Improved topology noding robustness (Sandro Santilli)
- - Make ST_Subdivide interruptible (Sandro Santilli)
+ - Make ST_Subdivide interruptable (Sandro Santilli)
- #4660, Changes in double / coordinate printing (Raúl Marín)
- Use the shortest representation (enough to guarantee roundtrip).
- Uses scientific notation for absolute numbers smaller than 1e-8.
@@ -640,7 +609,7 @@
and postgis.backend switch (Darafei Praliaskouski)
- #4267, Enable Proj 6 deprecated APIs (Darafei Praliaskouski, Raúl Marín)
- #4268, Bump minimum SFCGAL version to 1.3.1 (Darafei Praliaskouski)
- - #4331, ST_3DMakeBox now returns error instead of a minuscule box (Regina Obe)
+ - #4331, ST_3DMakeBox now returns error instead of a miniscule box (Regina Obe)
- #4342, Removed "versioned" variants of ST_AsGeoJSON and ST_AsKML (Paul Ramsey)
- #4356, ST_Accum removed. Use array_agg instead. (Darafei Praliaskouski)
- #4414, Include version number in address_standardizer lib (Raúl Marín)
@@ -1530,7 +1499,7 @@
- #2026, ST_Union(raster) now unions all bands of all rasters
- #2089, liblwgeom: lwgeom_set_handlers replaces lwgeom_init_allocators.
- #2150, regular_blocking is no longer a constraint. column of same name
- in raster_columns now checks for existence of spatially_unique
+ in raster_columns now checks for existance of spatially_unique
and coverage_tile constraints
- ST_Intersects(raster, geometry) behaves in the same manner as
ST_Intersects(geometry, raster).
@@ -1616,8 +1585,8 @@
- #2302, ST_Roughness for raster (Nathaniel Clay)
- #2290, ST_ColorMap(raster) to generate RGBA bands
- #2254, Add SFCGAL backend support.
- (Backend selection through postgis.backend var)
- Functions available both through GEOS or SFCGAL:
+ (Backend selection throught postgis.backend var)
+ Functions available both throught GEOS or SFCGAL:
ST_Intersects, ST_3DIntersects, ST_Intersection, ST_Area,
ST_Distance, ST_3DDistance
New functions available only with SFCGAL backend:
@@ -1959,7 +1928,7 @@
(eg CREATE TABLE t (g GEOMETRY(Polgyon, 4326)))
- ST_AsBinary and ST_AsText now return 3D/4D results in ISO SQL/MM
format when called on 3D/4D features.
- - The "unknown SRID" is now 0, not -1.
+ - The "unknonwn SRID" is now 0, not -1.
(eg ST_SRID(ST_GeomFromText('POINT(0 0)')) returns 0)
- ST_NumGeometries returns 1 for singletons. ST_GeometryN returns the
the geometry for singletons.
@@ -2392,7 +2361,7 @@
PostGIS 1.3.0
2007/08/09
- - Began migration of functions to the SQL-MM-centric naming convention
+ - Began migration of functions to the SQL-MM-centric naming convension
using the spatial type (SP) prefix
- Performance enhancements:
- Created cached and indexed point-in-polygon short-circuits
@@ -2501,7 +2470,7 @@
PostGIS 1.1.2
2006/03/30
- - Regress tests can now be run *before* postgis installation
+ - Regress tests can now be run *before* postgis intallation
- BUGFIX in SnapToGrid() computation of output bounding box
- More portable ./configure script
- Changed ./run_test script to have more sane default behaviour
@@ -2551,7 +2520,7 @@
- Bug fixes:
- Fixed memory leak in polygonize()
- - Fixed bug in lwgeom_as_anytype cast functions
+ - Fixed bug in lwgeom_as_anytype cast funcions
- Fixed USE_GEOS, USE_PROJ and USE_STATS elements
of postgis_version() output to always reflect
library state.
@@ -2561,7 +2530,7 @@
- Changed Z() function to return NULL if requested
dimension is not available
- - Performance improvements:
+ - Peformance improvements:
- Much faster transform() function, caching proj4 objects
- Removed automatic call to fix_geometry_columns() in
AddGeometryColumns() and update_geometry_stats()
@@ -2681,7 +2650,7 @@
- NEW -p flag for shp2pgsql
- BUGFIX in transform() releasing random memory address
- BUGFIX in force_3dm() allocating less memory then required
- - NEW chapter about OGC compliance enforcement
+ - NEW chapter about OGC compliancy enforcement
- BUGFIX in shp2pgsql escape of values starting with "'" or "\t"
- NEW autoconf support for JTS lib
- BUGFIX in estimator testers (support for LWGEOM and schema parsing)
@@ -2710,7 +2679,7 @@
- jdbc2: code cleanups, Makefile improvements
- FLEX & YACC variables set *after* pgsql Makefile.global
is included and only if the pgsql *stripped* version
- evaluates to the empty string
+ evaulates to the empty string
- added already generated parser in release
- build scripts refinements
- MultiLine handling BUG fix in loader and dumper
@@ -2780,10 +2749,10 @@
- Objects are all now "lightweight" with a smaller disk
and index representation. Large databases should see a moderate
to large performance increase.
- - Objects now have a hexadecimal canonical representation.
+ - Objects now have a hexidecimal canonical representation.
To see a "user friendly" version of the objects use the
AsText() function.
- - The loader and dumper use the hexadecimal canonical representation,
+ - The loader and dumper use the hexidecimal canonical representation,
so coordinate drift due to floating point string parsing is now
eliminated.
- New functions: UpdateGeometrySRID(), AsGML(), SnapToGrid(),
@@ -2939,7 +2908,7 @@
- xmin(),ymin(),zmin(),xmax(),ymax(),zmax() functions
- Bug Fixes
- transform() more graceful when grid shifts are missing
- - setsrid() made cacheable
+ - setsrid() made cachable
- patches to loader/dumper
@@ -3082,5 +3051,3 @@
- truely_inside()
- rtree index support functions
- gist index support functions
-
-
diff --git a/contrib/postgis/README.postgis b/contrib/postgis/README.postgis
index 1a057a1..bdd3945 100644
--- a/contrib/postgis/README.postgis
+++ b/contrib/postgis/README.postgis
@@ -1,8 +1,8 @@
PostGIS - Geographic Information Systems Extensions to PostgreSQL
=================================================================
-:Version: 3.6.2
-:Date: 2026-02-09
+:Version: 3.6.1
+:Date: 2025-11-13
:Website: https://postgis.net
This distribution contains a module which implements GIS simple features, ties
diff --git a/contrib/postgis/Version.config b/contrib/postgis/Version.config
index cbd7709..0b2f402 100644
--- a/contrib/postgis/Version.config
+++ b/contrib/postgis/Version.config
@@ -5,7 +5,7 @@
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_VERSION=6
-POSTGIS_MICRO_VERSION=2
+POSTGIS_MICRO_VERSION=1
# Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev)
# when changing POSTGIS_MINOR_VERSION
@@ -19,4 +19,3 @@
# Revision of current interface, set to 0 when adding an interface
# or increment when just changing implementations.
LIBLWGEOM_IFACE_REV=0
-
diff --git a/contrib/postgis/configure.ac b/contrib/postgis/configure.ac
index 12e26a0..8ee0950 100644
--- a/contrib/postgis/configure.ac
+++ b/contrib/postgis/configure.ac
@@ -1653,7 +1653,7 @@
dnl Extract the linker and include flags
LIBGDAL_LDFLAGS=`$GDAL_CONFIG --libs`
- dnl LIBGDAL_DEPLIBS_LDFLAGS=`$GDAL_CONFIG --dep-libs`
+ LIBGDAL_DEPLIBS_LDFLAGS=`$GDAL_CONFIG --dep-libs`
LIBGDAL_CFLAGS=`$GDAL_CONFIG --cflags`
CPPFLAGS_SAVE="$CPPFLAGS"
@@ -1667,23 +1667,23 @@
fi
LIBS_SAVE="$LIBS"
- LIBS="$LIBGDAL_LDFLAGS"
+ LIBS="$LIBGDAL_LDFLAGS $LIBGDAL_DEPLIBS_LDFLAGS"
dnl Check headers file
AC_CHECK_HEADERS(
- [gdal.h ogr_api.h cpl_conv.h],
+ [gdal/gdal.h gdal/ogr_api.h gdal/cpl_conv.h], # <<<diasoft #BUILD_UPDATE>>>
[],
[AC_MSG_ERROR([could not find GDAL headers])])
dnl Ensure we can link against gdal
AC_SEARCH_LIBS([GDALAllRegister], [gdal], [], [AC_MSG_ERROR([could not find GDAL])], [])
- LIBS="$LIBGDAL_LDFLAGS"
+ LIBS="$LIBGDAL_LDFLAGS $LIBGDAL_DEPLIBS_LDFLAGS"
dnl Ensure we can link against ogr
AC_SEARCH_LIBS([OGRRegisterAll], [gdal], [], [AC_MSG_ERROR([could not find OGR])], [])
- LIBS="$LIBGDAL_LDFLAGS"
+ LIBS="$LIBGDAL_LDFLAGS $LIBGDAL_DEPLIBS_LDFLAGS"
CPPFLAGS="$CPPFLAGS_SAVE"
CFLAGS="$CFLAGS_SAVE"
CC="$CC_SAVE"
diff --git a/contrib/postgis/deps/flatgeobuf/include/flatbuffers/flatbuffer_builder.h b/contrib/postgis/deps/flatgeobuf/include/flatbuffers/flatbuffer_builder.h
index cf9d88f..92f7582 100644
--- a/contrib/postgis/deps/flatgeobuf/include/flatbuffers/flatbuffer_builder.h
+++ b/contrib/postgis/deps/flatgeobuf/include/flatbuffers/flatbuffer_builder.h
@@ -48,16 +48,14 @@
const T *data(const std::vector<T, Alloc> &v) {
// Eventually the returned pointer gets passed down to memcpy, so
// we need it to be non-null to avoid undefined behavior.
- alignas(T) static uint8_t t;
-
+ alignas(T) static uint8_t t; /*#<<<DIA_SVACE_MAJOR>>>*/
return v.empty() ? reinterpret_cast<const T *>(&t) : &v.front();
}
template<typename T, typename Alloc = std::allocator<T>>
T *data(std::vector<T, Alloc> &v) {
// Eventually the returned pointer gets passed down to memcpy, so
// we need it to be non-null to avoid undefined behavior.
- alignas(T) static uint8_t t;
-
+ alignas(T) static uint8_t t; /*#<<<DIA_SVACE_MAJOR>>*/
return v.empty() ? reinterpret_cast<T *>(&t) : &v.front();
}
diff --git a/contrib/postgis/diasoft_version.info b/contrib/postgis/diasoft_version.info
new file mode 100644
index 0000000..d18a364
--- /dev/null
+++ b/contrib/postgis/diasoft_version.info
@@ -0,0 +1,6 @@
+postgis version: 3.6.1
+plpgsql_check_url: https://gitea.osgeo.org/postgis/postgis/src/tag/3.6.1
+
+# Теги
+-- #BUILD_UPDATE - доработки для сборки в рамках Q.Database
+-- #DIA_LOCALLE_FIX - исправление локализации. Список языков для перевода в LINGUAS синхронизирован с doc/Makefile.in
diff --git a/contrib/postgis/doc/Makefile.in b/contrib/postgis/doc/Makefile.in
index ff81f32..d478245 100644
--- a/contrib/postgis/doc/Makefile.in
+++ b/contrib/postgis/doc/Makefile.in
@@ -21,7 +21,7 @@
# that we could produce a large number of files (think chunked HTML)
#
-translations = it_IT pt_BR fr es pl ka ko_KR da de ja ru zh_Hans ro sv
+translations = it_IT pt_BR fr es pl ka ko_KR da de ja ru zh_Hans ro sv uk
PACKAGE_TARNAME = @PACKAGE_TARNAME@
diff --git a/contrib/postgis/doc/developer.md b/contrib/postgis/doc/developer.md
index 95da883..480007f 100644
--- a/contrib/postgis/doc/developer.md
+++ b/contrib/postgis/doc/developer.md
@@ -203,7 +203,7 @@
with a dependency library higher than X? Where X is some version of a dependency library.
Dependency guards need to be put in both the C library files and our test files.
-On some occasions where we need to do something different based on version of PostgreSQL,
+On some occassions where we need to do something different based on version of PostgreSQL,
you'll see guards in the SQL files as well.
We have guards in place in the code to handle these for dependency libraries
@@ -273,9 +273,3 @@
but instead of doing something functional, will output an error that the extension needs to be compiled
with lib xxx or higher. Also the function has to be available in the C lib, as such the guarding is always done
on the C lib side and very rarely on the sql files.
-
-
-
-
-
-
diff --git a/contrib/postgis/doc/po/LINGUAS b/contrib/postgis/doc/po/LINGUAS
new file mode 100644
index 0000000..a2bf0a6
--- /dev/null
+++ b/contrib/postgis/doc/po/LINGUAS
@@ -0,0 +1 @@
+it_IT pt_BR fr es pl ka ko_KR da de ja ru zh_Hans ro sv uk # #DIA_LOCALLE_FIX
diff --git a/contrib/postgis/doc/po/uk/Makefile.in b/contrib/postgis/doc/po/uk/Makefile.in
new file mode 100644
index 0000000..2d5c266
--- /dev/null
+++ b/contrib/postgis/doc/po/uk/Makefile.in
@@ -0,0 +1,4 @@
+include @srcdir@/../Makefile.local
+DBLATEX_EXTRA_OPTIONS = -b xetex
+DOCSUFFIX=-uk
+srcdir=@srcdir@
diff --git a/contrib/postgis/doc/po/uk/postgis-manual.po b/contrib/postgis/doc/po/uk/postgis-manual.po
new file mode 100644
index 0000000..196c213
--- /dev/null
+++ b/contrib/postgis/doc/po/uk/postgis-manual.po
@@ -0,0 +1,46197 @@
+# SOME DESCRIPTIVE TITLE.
+# Denys Kovshun <deniskovshun@gmail.com>, 2025.
+# Weblate <noreply-mt-weblate@weblate.org>, 2025.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
+"POT-Creation-Date: 2025-07-20 04:11+0000\n"
+"PO-Revision-Date: 2025-08-31 21:47+0000\n"
+"Last-Translator: Denys Kovshun <deniskovshun@gmail.com>\n"
+"Language-Team: Ukrainian <https://weblate.osgeo.org/projects/postgis/"
+"postgis-manual/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 5.4.3\n"
+
+#. Tag: chapter
+#, no-c-format
+msgid "&database_tuning;"
+msgstr "&database_tuning;"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Administration"
+msgstr "Адміністрування PostGIS"
+
+#. Tag: title
+#, no-c-format
+msgid "Configuring raster support"
+msgstr "Налаштування підтримки растрів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you enabled raster support you may want to read below how to properly "
+"configure it."
+msgstr ""
+"Якщо ви увімкнули підтримку растрів, ви можете прочитати нижче, як правильно "
+"її налаштувати."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As of PostGIS 2.1.3, out-of-db rasters and all raster drivers are disabled "
+"by default. In order to re-enable these, you need to set the following "
+"environment variables <varname>POSTGIS_GDAL_ENABLED_DRIVERS</varname> and "
+"<varname>POSTGIS_ENABLE_OUTDB_RASTERS</varname> in the server environment. "
+"For PostGIS 2.2, you can use the more cross-platform approach of setting the "
+"corresponding <xref linkend=\"PostGIS_GUC\"/>."
+msgstr ""
+"Починаючи з версії PostGIS 2.1.3, растри поза базою даних та всі растрові "
+"драйвери стандартно вимкнено. Для того, щоб їх увімкнути, вам потрібно "
+"встановити наступні змінні оточення <varname>POSTGIS_GDAL_ENABLED_DRIVERS</"
+"varname> та <varname>POSTGIS_ENABLE_OUTDB_RASTERS</varname> у серверному "
+"середовищі. Для PostGIS 2.2 ви можете скористатися більш кросплатформним "
+"підходом, встановивши відповідні <xref linkend=\"PostGIS_GUC\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "If you want to enable offline raster:"
+msgstr "Якщо ви хочете увімкнути офлайн-растр:"
+
+#. Tag: para
+#, no-c-format
+msgid "Any other setting or no setting at all will disable out of db rasters."
+msgstr ""
+"Будь-який інший параметр або відсутність параметра взагалі вимкне растри з "
+"db."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In order to enable all GDAL drivers available in your GDAL install, set this "
+"environment variable as follows"
+msgstr ""
+"Щоб увімкнути всі драйвери GDAL, доступні у вашому встановленні GDAL, "
+"встановіть цю змінну оточення наступним чином"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you want to only enable specific drivers, set your environment variable "
+"as follows:"
+msgstr ""
+"Якщо ви хочете увімкнути лише певні драйвери, налаштуйте змінну оточення "
+"наступним чином:"
+
+#. Tag: para
+#, no-c-format
+msgid "If you are on windows, do not quote the driver list"
+msgstr "Якщо ви використовуєте Windows не беріть перелік драйверів в лапки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Setting environment variables varies depending on OS. For PostgreSQL "
+"installed on Ubuntu or Debian via apt-postgresql, the preferred way is to "
+"edit <filename>/etc/postgresql/<replaceable>10</replaceable>/"
+"<replaceable>main</replaceable>/environment</filename> where 10 refers to "
+"version of PostgreSQL and main refers to the cluster."
+msgstr ""
+"Налаштування змінних оточення залежить від операційної системи. Для "
+"PostgreSQL, встановленого на Ubuntu або Debian за допомогою apt-postgresql, "
+"найкращим способом є редагування <filename>/etc/postgresql/"
+"<replaceable>10</replaceable>/<replaceable>main</replaceable>/environment</"
+"filename>, де 10 позначає версію PostgreSQL, а main — кластер."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"On windows, if you are running as a service, you can set via System "
+"variables which for Windows 7 you can get to by right-clicking on Computer-"
+">Properties Advanced System Settings or in explorer navigating to "
+"<varname>Control Panel\\All Control Panel Items\\System</varname>. Then "
+"clicking <emphasis>Advanced System Settings ->Advanced->Environment "
+"Variables</emphasis> and adding new system variables."
+msgstr ""
+"У Windows, якщо ви запускаєте службу, ви можете встановити системні змінні, "
+"до яких у Windows 7 можна потрапити, клацнувши правою кнопкою миші на "
+"Компʼютер - Властивості - Додаткові параметри системи або в провіднику "
+"перейшовши до <varname>Панель керування\\Всі елементи панелі "
+"керування\\Система</varname>. Потім натисніть <emphasis>Додаткові системні "
+"налаштування ->Додаткові ->Змінні середовища</emphasis> і додайте нові "
+"системні змінні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After you set the environment variables, you'll need to restart your "
+"PostgreSQL service for the changes to take effect."
+msgstr ""
+"Після того, як ви встановите змінні оточення, вам потрібно буде "
+"перезапустити службу PostgreSQL, щоб зміни набули чинності."
+
+#. Tag: title
+#, no-c-format
+msgid "Creating spatial databases"
+msgstr "Створення просторових баз даних"
+
+#. Tag: title
+#, no-c-format
+msgid "Spatially enable database using EXTENSION"
+msgstr "Активувати просторове розширення в базі данних за допомогою EXTENSION"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are using PostgreSQL 9.1+ and have compiled and installed the "
+"extensions/postgis modules, you can turn a database into a spatial one using "
+"the EXTENSION mechanism."
+msgstr ""
+"Якщо ви використовуєте PostgreSQL 9.1+ і скомпілювали та встановили модулі "
+"extensions/postgis, ви можете перетворити базу даних на просторову за "
+"допомогою механізму EXTENSION."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Core postgis extension includes geometry, geography, spatial_ref_sys and all "
+"the functions and comments. Raster and topology are packaged as a separate "
+"extension."
+msgstr ""
+"Основне розширення PostGIS включає геометрію, географію, spatial_ref_sys та "
+"всі функції і коментарі. Растр і топологія упаковані як окреме розширення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Run the following SQL snippet in the database you want to enable spatially:"
+msgstr ""
+"Виконайте наступний фрагмент SQL-коду в базі даних, яку ви хочете активувати "
+"просторове розширення:"
+
+#. Tag: title
+#, no-c-format
+msgid "Spatially enable database without using EXTENSION (discouraged)"
+msgstr ""
+"Активувати просторове розширення бази даних без використання EXTENSION (не "
+"рекомендується)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is generally only needed if you cannot or don't want to get PostGIS "
+"installed in the PostgreSQL extension directory (for example during testing, "
+"development or in a restricted environment)."
+msgstr ""
+"Зазвичай це потрібно лише в тому випадку, якщо ви не можете або не хочете "
+"встановлювати PostGIS у каталозі розширень PostgreSQL (наприклад, під час "
+"тестування, розробки або в обмеженому середовищі)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adding PostGIS objects and function definitions into your database is done "
+"by loading the various sql files located in <filename>[prefix]/share/"
+"contrib</filename> as specified during the build phase."
+msgstr ""
+"Додавання об'єктів PostGIS та визначень функцій до вашої бази даних "
+"здійснюється шляхом завантаження різних файлів sql, розташованих у "
+"<filename>[prefix]/share/contrib</filename>, як зазначено під час фази "
+"побудови."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The core PostGIS objects (geometry and geography types, and their support "
+"functions) are in the <filename>postgis.sql</filename> script. Raster "
+"objects are in the <filename>rtpostgis.sql</filename> script. Topology "
+"objects are in the <filename>topology.sql</filename> script."
+msgstr ""
+"Основні об'єкти PostGIS (типи геометрії та географії, а також функції їх "
+"підтримки) містяться у скрипті <filename>postgis.sql</filename>. Растрові "
+"об'єкти містяться у скрипті <filename>rtpostgis.sql</filename>. Топологічні "
+"об'єкти містяться у скрипті <filename>topology.sql</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For a complete set of EPSG coordinate system definition identifiers, you can "
+"also load the <filename>spatial_ref_sys.sql</filename> definitions file and "
+"populate the <varname>spatial_ref_sys</varname> table. This will permit you "
+"to perform ST_Transform() operations on geometries."
+msgstr ""
+"Для отримання повного набору ідентифікаторів визначення системи координат "
+"EPSG ви також можете завантажити файл визначень <filename>spatial_ref_sys."
+"sql</filename> і заповнити таблицю <varname>spatial_ref_sys</varname>. Це "
+"дозволить вам виконувати операції ST_Transform() над геометріями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you wish to add comments to the PostGIS functions, you can find them in "
+"the <filename>postgis_comments.sql</filename> script. Comments can be viewed "
+"by simply typing <command>\\dd [function_name]</command> from a "
+"<command>psql</command> terminal window."
+msgstr ""
+"Якщо ви бажаєте додати коментарі до функцій PostGIS, ви можете знайти їх у "
+"скрипті <filename>postgis_comments.sql</filename>. Коментарі можна "
+"переглянути, просто ввівши <command>\\dd [function_name]</command> у вікні "
+"терміналу <command>psql</command>."
+
+#. Tag: para
+#, no-c-format
+msgid "Run the following Shell commands in your terminal:"
+msgstr "Виконайте наступні команди Shell у терміналі:"
+
+#. Tag: title
+#, no-c-format
+msgid "Upgrading spatial databases"
+msgstr "Оновлення просторових баз даних"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Upgrading existing spatial databases can be tricky as it requires "
+"replacement or introduction of new PostGIS object definitions."
+msgstr ""
+"Оновлення існуючих просторових баз даних може бути складним, оскільки "
+"вимагає заміни або впровадження нових визначень об'єктів PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unfortunately not all definitions can be easily replaced in a live database, "
+"so sometimes your best bet is a dump/reload process."
+msgstr ""
+"На жаль, не всі визначення можна легко замінити в активній базі даних, тому "
+"іноді найкращим варіантом є процес дампа/перезавантаження."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS provides a SOFT UPGRADE procedure for minor or bugfix releases, and "
+"a HARD UPGRADE procedure for major releases."
+msgstr ""
+"PostGIS надає процедуру SOFT UPGRADE для незначних випусків або випусків з "
+"виправленням помилок, а також процедуру HARD UPGRADE для основних випусків."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Before attempting to upgrade PostGIS, it is always worth to backup your "
+"data. If you use the -Fc flag to pg_dump you will always be able to restore "
+"the dump with a HARD UPGRADE."
+msgstr ""
+"Перед тим, як спробувати оновити PostGIS, завжди варто зробити резервну "
+"копію ваших даних. Якщо ви використовуєте прапор -Fc для pg_dump, ви завжди "
+"зможете відновити дамп за допомогою HARD UPGRADE."
+
+#. Tag: title
+#, no-c-format
+msgid "Soft upgrade"
+msgstr "М'яке оновлення"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you installed your database using extensions, you'll need to upgrade "
+"using the extension model as well. If you installed using the old sql script "
+"way, you are advised to switch your install to extensions because the script "
+"way is no longer supported."
+msgstr ""
+"Якщо ви встановили базу даних за допомогою розширень, вам також потрібно "
+"буде оновити її за допомогою моделі розширень. Якщо ви встановили базу даних "
+"за допомогою старого скрипту sql, рекомендуємо перейти на розширення, "
+"оскільки скрипт більше не підтримується."
+
+#. Tag: title
+#, no-c-format
+msgid "Soft Upgrade 9.1+ using extensions"
+msgstr "М'яке оновлення 9.1+ за допомогою розширень"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you originally installed PostGIS with extensions, then you need to "
+"upgrade using extensions as well. Doing a minor upgrade with extensions, is "
+"fairly painless."
+msgstr ""
+"Якщо ви спочатку встановили PostGIS з розширеннями, то вам потрібно також "
+"оновити розширення. Незначне оновлення з розширеннями є досить простим."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are running PostGIS 3 or above, then you should use the <xref "
+"linkend=\"PostGIS_Extensions_Upgrade\"/> function to upgrade to the latest "
+"version you have installed."
+msgstr ""
+"Якщо ви використовуєте PostGIS 3 або вище, то вам слід скористатися функцією "
+"<xref linkend=\"PostGIS_Extensions_Upgrade\"/>, щоб оновити систему до "
+"останньої версії, яку ви встановили."
+
+#. Tag: para
+#, no-c-format
+msgid "If you are running PostGIS 2.5 or lower, then do the following:"
+msgstr ""
+"Якщо ви використовуєте PostGIS 2.5 або нижчу версію, виконайте наступні дії:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you have multiple versions of PostGIS installed, and you don't want to "
+"upgrade to the latest, you can explicitly specify the version as follows:"
+msgstr ""
+"Якщо у вас встановлено кілька версій PostGIS і ви не хочете оновлювати їх до "
+"останньої версії, ви можете явно вказати версію наступним чином:"
+
+#. Tag: para
+#, no-c-format
+msgid "If you get an error notice something like:"
+msgstr "Якщо ви отримаєте повідомлення про помилку, схоже на таке:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Then you'll need to backup your database, create a fresh one as described in "
+"<xref linkend=\"create_new_db_extensions\"/> and then restore your backup on "
+"top of this new database."
+msgstr ""
+"Потім вам потрібно буде створити резервну копію вашої бази даних, створити "
+"нову, як описано в <xref linkend=\"create_new_db_extensions\"/>, а потім "
+"відновити резервну копію на цій новій базі даних."
+
+#. Tag: para
+#, no-c-format
+msgid "If you get a notice message like:"
+msgstr "Якщо ви отримаєте таке повідомлення:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Then everything is already up to date and you can safely ignore it. "
+"<emphasis role=\"bold\">UNLESS</emphasis> you're attempting to upgrade from "
+"an development version to the next (which doesn't get a new version number); "
+"in that case you can append \"next\" to the version string, and next time "
+"you'll need to drop the \"next\" suffix again:"
+msgstr ""
+"Тоді все вже оновлено і ви можете сміливо ігнорувати це. <emphasis role="
+"\"bold\">ЗА ВИНЯТКОМ</emphasis> випадків, коли ви намагаєтеся оновити версію "
+"з розробницької до наступної (яка не отримує нового номера версії); в цьому "
+"випадку ви можете додати \"next\" до рядка версії, а наступного разу вам "
+"потрібно буде знову видалити суфікс \"next\":"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you installed PostGIS originally without a version specified, you can "
+"often skip the reinstallation of postgis extension before restoring since "
+"the backup just has <code>CREATE EXTENSION postgis</code> and thus picks up "
+"the newest latest version during restore."
+msgstr ""
+"Якщо ви спочатку встановили PostGIS без вказання версії, то часто можна "
+"пропустити перевстановлення розширення postgis перед відновленням, оскільки "
+"резервна копія містить лише <code>CREATE EXTENSION postgis</code> і, отже, "
+"під час відновлення вибирає найновішу версію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are upgrading PostGIS extension from a version prior to 3.0.0, you "
+"will have a new extension <emphasis>postgis_raster</emphasis> which you can "
+"safely drop, if you don't need raster support. You can drop as follows:"
+msgstr ""
+"Якщо ви оновлюєте розширення PostGIS з версії до 3.0.0, у вас з’явиться нове "
+"розширення <emphasis>postgis_raster</emphasis>, яке можна безпечно видалити, "
+"якщо вам не потрібна підтримка растрових даних. Видалити його можна так:"
+
+#. Tag: title
+#, no-c-format
+msgid "Soft Upgrade Pre 9.1+ or without extensions"
+msgstr "М'яке оновлення до версії 9.1+ або без розширень"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section applies only to those who installed PostGIS not using "
+"extensions. If you have extensions and try to upgrade with this approach "
+"you'll get messages like:"
+msgstr ""
+"Цей розділ стосується лише тих, хто встановив PostGIS без використання "
+"розширень. Якщо у вас є розширення і ви спробуєте оновити систему за "
+"допомогою цього підходу, ви отримаєте такі повідомлення:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: if you are moving from PostGIS 1.* to PostGIS 2.* or from PostGIS 2.* "
+"prior to r7409, you cannot use this procedure but would rather need to do a "
+"<link linkend=\"hard_upgrade\">HARD UPGRADE</link>."
+msgstr ""
+"ПРИМІТКА: якщо ви переходите з PostGIS 1.* на PostGIS 2.* або з PostGIS 2.* "
+"до версії r7409, ви не можете використовувати цю процедуру, а повинні "
+"виконати <link linkend=\"hard_upgrade\">ЖОРСТКЕ ОНОВЛЕННЯ</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After compiling and installing (make install) you should find a set of "
+"<filename>*_upgrade.sql</filename> files in the installation folders. You "
+"can list them all with:"
+msgstr ""
+"Після компіляції та встановлення (make install) ви повинні знайти набір "
+"файлів <filename>*_upgrade.sql</filename> в папках інсталяції. Ви можете "
+"перелічити їх усі за допомогою:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Load them all in turn, starting from <filename>postgis_upgrade.sql</"
+"filename>."
+msgstr ""
+"Завантажте їх по черзі, починаючи з <filename>postgis_upgrade.sql</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The same procedure applies to raster, topology and sfcgal extensions, with "
+"upgrade files named <filename>rtpostgis_upgrade.sql</filename>, "
+"<filename>topology_upgrade.sql</filename> and <filename>sfcgal_upgrade.sql</"
+"filename> respectively. If you need them:"
+msgstr ""
+"Така сама процедура застосовується до розширень raster, topology та sfcgal, "
+"з файлами оновлення, що мають назви <filename>rtpostgis_upgrade.sql</"
+"filename>, <filename>topology_upgrade.sql</filename> та "
+"<filename>sfcgal_upgrade.sql</filename> відповідно. Якщо вони вам потрібні:"
+
+#. Tag: para
+#, no-c-format
+msgid "You are advised to switch to an extension based install by running"
+msgstr ""
+"Рекомендується перейти на інсталяцію на основі розширення, виконавши команду"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you can't find the <filename>postgis_upgrade.sql</filename> specific for "
+"upgrading your version you are using a version too early for a soft upgrade "
+"and need to do a <link linkend=\"hard_upgrade\">HARD UPGRADE</link>."
+msgstr ""
+"Якщо ви не можете знайти файл <filename>postgis_upgrade.sql</filename>, "
+"призначений для оновлення вашої версії, це означає, що ви використовуєте "
+"версію, яка є занадто ранньою для м'якого оновлення, і вам потрібно виконати "
+"<link linkend=\"hard_upgrade\">ЖОРСТКЕ ОНОВЛЕННЯ</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <xref linkend=\"PostGIS_Full_Version\"/> function should inform you "
+"about the need to run this kind of upgrade using a \"procs need upgrade\" "
+"message."
+msgstr ""
+"Функція <xref linkend=\"PostGIS_Full_Version\"/> повинна повідомити вас про "
+"необхідність виконання такого оновлення за допомогою повідомлення \"procs "
+"need upgrade\" (процедури потребують оновлення)."
+
+#. Tag: title
+#, no-c-format
+msgid "Hard upgrade"
+msgstr "Жорстке оновлення"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By HARD UPGRADE we mean full dump/reload of postgis-enabled databases. You "
+"need a HARD UPGRADE when PostGIS objects' internal storage changes or when "
+"SOFT UPGRADE is not possible. The <link linkend=\"release_notes\">Release "
+"Notes</link> appendix reports for each version whether you need a dump/"
+"reload (HARD UPGRADE) to upgrade."
+msgstr ""
+"Під HARD UPGRADE ми маємо на увазі повне скидання/перезавантаження баз даних "
+"з підтримкою PostGIS. HARD UPGRADE необхідний, коли змінюється внутрішнє "
+"зберігання об'єктів PostGIS або коли SOFT UPGRADE неможливий. У додатку "
+"<link linkend=\"release_notes\">Release Notes</link> для кожної версії "
+"вказано, чи потрібно для оновлення виконувати скидання/перезавантаження ("
+"HARD UPGRADE)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The dump/reload process is assisted by the postgis_restore script which "
+"takes care of skipping from the dump all definitions which belong to PostGIS "
+"(including old ones), allowing you to restore your schemas and data into a "
+"database with PostGIS installed without getting duplicate symbol errors or "
+"bringing forward deprecated objects."
+msgstr ""
+"Процес вивантаження/перезавантаження здійснюється за допомогою скрипта "
+"postgis_restore, який пропускає з вивантаження всіх визначень, що належать "
+"до PostGIS (включаючи старі), що дозволяє відновити схеми та дані в базі "
+"даних з встановленим PostGIS без помилок дублювання символів або перенесення "
+"застарілих об'єктів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Supplementary instructions for windows users are available at <link xlink:"
+"href=\"http://trac.osgeo.org/postgis/wiki/UsersWikiWinUpgrade\">Windows Hard "
+"upgrade</link>."
+msgstr ""
+"Додаткові інструкції для користувачів Windows доступні за посиланням <link "
+"xlink:href=\"http://trac.osgeo.org/postgis/wiki/UsersWikiWinUpgrade\">Windows "
+"Hard upgrade</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "The Procedure is as follows:"
+msgstr "Процедура виглядає наступним чином:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a \"custom-format\" dump of the database you want to upgrade (let's "
+"call it <varname>olddb</varname>) include binary blobs (-b) and verbose (-v) "
+"output. The user can be the owner of the db, need not be postgres super "
+"account."
+msgstr ""
+"Створіть дамп бази даних, яку ви хочете оновити, у \"власному форматі\" ("
+"назвемо його <varname>olddb</varname>), включіть бінарні блоки (-b) та "
+"детальний вивід (-v). Користувач може бути власником бази даних, не "
+"обов'язково мати супер-акаунт postgres."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Do a fresh install of PostGIS in a new database -- we'll refer to this "
+"database as <varname>newdb</varname>. Please refer to <xref "
+"linkend=\"create_new_db\"/> and <xref linkend=\"create_new_db_extensions\"/> "
+"for instructions on how to do this."
+msgstr ""
+"Виконайте нову інсталяцію PostGIS у новій базі даних — ми будемо називати цю "
+"базу даних <varname>newdb</varname>. Інструкції щодо виконання цієї операції "
+"див. у розділах <xref linkend=\"create_new_db\"/> та <xref linkend="
+"\"create_new_db_extensions\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The spatial_ref_sys entries found in your dump will be restored, but they "
+"will not override existing ones in spatial_ref_sys. This is to ensure that "
+"fixes in the official set will be properly propagated to restored databases. "
+"If for any reason you really want your own overrides of standard entries "
+"just don't load the spatial_ref_sys.sql file when creating the new db."
+msgstr ""
+"Записи spatial_ref_sys, знайдені у вашому дампі, будуть відновлені, але вони "
+"не замінять існуючі записи в spatial_ref_sys. Це зроблено для того, щоб "
+"виправлення в офіційному наборі були правильно передані до відновлених баз "
+"даних. Якщо з якоїсь причини ви дійсно хочете замінити стандартні записи "
+"своїми власними, просто не завантажуйте файл spatial_ref_sys.sql під час "
+"створення нової бази даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If your database is really old or you know you've been using long deprecated "
+"functions in your views and functions, you might need to load "
+"<filename>legacy.sql</filename> for all your functions and views etc. to "
+"properly come back. Only do this if _really_ needed. Consider upgrading your "
+"views and functions before dumping instead, if possible. The deprecated "
+"functions can be later removed by loading <filename>uninstall_legacy.sql</"
+"filename>."
+msgstr ""
+"Якщо ваша база даних дуже стара або ви знаєте, що використовуєте давно "
+"застарілі функції у своїх представлень та функціях, можливо, вам доведеться "
+"завантажити <filename>legacy.sql</filename>, щоб усі ваші функції, "
+"представлень тощо знову працювали належним чином. Робіть це лише у разі "
+"_реальної_ необхідності. Якщо можливо, замість цього розгляньте можливість "
+"оновлення своїх представлень та функцій перед вивантаженням. Застарілі "
+"функції можна пізніше видалити, завантаживши <filename>uninstall_legacy."
+"sql</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Restore your backup into your fresh <varname>newdb</varname> database using "
+"postgis_restore. Unexpected errors, if any, will be printed to the standard "
+"error stream by psql. Keep a log of those."
+msgstr ""
+"Відновіть резервну копію у новій базі даних <varname>newdb</varname> за "
+"допомогою postgis_restore. Несподівані помилки, якщо такі будуть, будуть "
+"виведені psql у стандартний потік помилок. Зберігайте їх у журналі."
+
+#. Tag: para
+#, no-c-format
+msgid "Errors may arise in the following cases:"
+msgstr "Помилки можуть виникати в таких випадках:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Some of your views or functions make use of deprecated PostGIS objects. In "
+"order to fix this you may try loading <filename>legacy.sql</filename> script "
+"prior to restore or you'll have to restore to a version of PostGIS which "
+"still contains those objects and try a migration again after porting your "
+"code. If the <filename>legacy.sql</filename> way works for you, don't forget "
+"to fix your code to stop using deprecated functions and drop them loading "
+"<filename>uninstall_legacy.sql</filename>."
+msgstr ""
+"Деякі з ваших представлень або функцій використовують застарілі об'єкти "
+"PostGIS. Щоб виправити це, ви можете спробувати завантажити скрипт "
+"<filename>legacy.sql</filename> перед відновленням або вам доведеться "
+"відновити версію PostGIS, яка все ще містить ці об'єкти, і спробувати "
+"міграцію знову після перенесення вашого коду. Якщо спосіб <filename>legacy."
+"sql</filename> працює для вас, не забудьте виправити свій код, щоб припинити "
+"використання застарілих функцій, і видалити їх, завантаживши "
+"<filename>uninstall_legacy.sql</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Some custom records of spatial_ref_sys in dump file have an invalid SRID "
+"value. Valid SRID values are bigger than 0 and smaller than 999000. Values "
+"in the 999000.999999 range are reserved for internal use while values > "
+"999999 can't be used at all. All your custom records with invalid SRIDs will "
+"be retained, with those > 999999 moved into the reserved range, but the "
+"spatial_ref_sys table would lose a check constraint guarding for that "
+"invariant to hold and possibly also its primary key ( when multiple invalid "
+"SRIDS get converted to the same reserved SRID value )."
+msgstr ""
+"Деякі користувацькі записи spatial_ref_sys у файлі дампа мають недійсне "
+"значення SRID. Дійсні значення SRID більші за 0 і менші за 999000. Значення "
+"в діапазоні 999000.999999 зарезервовані для внутрішнього використання, а "
+"значення > 999999 не можуть використовуватися взагалі. Усі ваші "
+"користувацькі записи з недійсними SRID будуть збережені, а ті, що > "
+"999999, будуть переміщені в зарезервований діапазон, але таблиця "
+"spatial_ref_sys втратить обмеження перевірки, що захищає цю інваріантність, "
+"а також, можливо, і свій первинний ключ (коли кілька недійсних SRID "
+"перетворюються на одне й те саме зарезервоване значення SRID)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In order to fix this you should copy your custom SRS to a SRID with a valid "
+"value (maybe in the 910000..910999 range), convert all your tables to the "
+"new srid (see <xref linkend=\"UpdateGeometrySRID\"/>), delete the invalid "
+"entry from spatial_ref_sys and re-construct the check(s) with:"
+msgstr ""
+"Щоб виправити цю ситуацію, слід скопіювати власний SRS до SRID із дійсним "
+"значенням (можливо, в діапазоні 910000..910999), перетворити всі таблиці на "
+"новий srid (див. <xref linkend=\"UpdateGeometrySRID\"/>), видалити недійсний "
+"запис із spatial_ref_sys і повторно створити перевірку (перевірки) за "
+"допомогою:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are upgrading an old database containing french <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/Institut_g%C3%A9ographique_national\"> "
+"IGN </link> cartography, you will have probably SRIDs out of range and you "
+"will see, when importing your database, issues like this :"
+msgstr ""
+"Якщо ви оновлюєте стару базу даних, що містить французьку <link "
+"xlink:href=\"https://en.wikipedia.org/wiki/"
+"Institut_g%C3%A9ographique_national\"> IGN </link> картографію, у вас, "
+"ймовірно, будуть SRID поза діапазоном, і під час імпортування бази даних ви "
+"побачите такі проблеми:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In this case, you can try following steps : first throw out completely the "
+"IGN from the sql which is resulting from postgis_restore. So, after having "
+"run :"
+msgstr ""
+"У цьому випадку ви можете спробувати виконати наступні кроки: спочатку "
+"повністю видаліть IGN із sql, що є результатом postgis_restore. Отже, після "
+"виконання:"
+
+#. Tag: para
+#, no-c-format
+msgid "run this command :"
+msgstr "виконайте цю команду:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create then your newdb, activate the required Postgis extensions, and insert "
+"properly the french system IGN with : <link xlink:href=\"https://raw."
+"githubusercontent.com/Remi-C/IGN_spatial_ref_for_PostGIS/master/"
+"Put_IGN_SRS_into_Postgis.sql\"> this script </link> After these operations, "
+"import your data :"
+msgstr ""
+"Створіть нову базу даних newdb, активуйте необхідні розширення Postgis і "
+"правильно вставте французьку систему IGN за допомогою: <link "
+"xlink:href=\"https://raw.githubusercontent.com/Remi-C/"
+"IGN_spatial_ref_for_PostGIS/master/Put_IGN_SRS_into_Postgis.sql\"> цього "
+"скрипту </link> Після цих операцій імпортуйте свої дані:"
+
+#. Tag: title
+#, no-c-format
+msgid "Performance Tuning"
+msgstr "Налаштування продуктивності"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tuning for PostGIS performance is much like tuning for any PostgreSQL "
+"workload. The only additional consideration is that geometries and rasters "
+"are usually large, so memory-related optimizations generally have more of an "
+"impact on PostGIS than other types of PostgreSQL queries."
+msgstr ""
+"Налаштування продуктивності PostGIS дуже схоже на налаштування будь-якого "
+"робочого навантаження PostgreSQL. Єдиним додатковим моментом, який слід "
+"врахувати, є те, що геометрії та растри зазвичай мають великий розмір, тому "
+"оптимізації, пов'язані з пам'яттю, зазвичай мають більший вплив на PostGIS, "
+"ніж на інші типи запитів PostgreSQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For general details about optimizing PostgreSQL, refer to <link xlink:"
+"href=\"https://wiki.postgresql.org/wiki/"
+"Tuning_Your_PostgreSQL_Server\">Tuning your PostgreSQL Server</link>."
+msgstr ""
+"Загальні відомості про оптимізацію PostgreSQL див. у розділі <link "
+"xlink:href=\"https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server\"
+">Налаштування сервера PostgreSQL</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For PostgreSQL 9.4+ configuration can be set at the server level without "
+"touching <code>postgresql.conf</code> or <code>postgresql.auto.conf</code> "
+"by using the <code>ALTER SYSTEM</code> command."
+msgstr ""
+"У PostgreSQL версії 9.4 і вище конфігурацію можна встановити на рівні "
+"сервера без редагування файлів <code>postgresql.conf</code> або "
+"<code>postgresql.auto.conf</code> за допомогою команди <code>ALTER "
+"SYSTEM</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In addition to the Postgres settings, PostGIS has some custom settings which "
+"are listed in <xref linkend=\"PostGIS_GUC\"/>."
+msgstr ""
+"Окрім налаштувань Postgres, PostGIS має деякі власні налаштування, які "
+"перелічені в <xref linkend=\"PostGIS_GUC\"/>."
+
+#. Tag: title
+#, no-c-format
+msgid "Startup"
+msgstr "Запуск"
+
+#. Tag: para
+#, no-c-format
+msgid "These settings are configured in <code>postgresql.conf</code>:"
+msgstr "Ці налаштування конфігуруються в <code>postgresql.conf</code>:"
+
+#. Tag: link
+#, no-c-format
+msgid "constraint_exclusion"
+msgstr "constraint_exclusion"
+
+#. Tag: para
+#, no-c-format
+msgid "Default: partition"
+msgstr "За замовчуванням: partition"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is generally used for table partitioning. The default for this is set "
+"to \"partition\" which is ideal for PostgreSQL 8.4 and above since it will "
+"force the planner to only analyze tables for constraint consideration if "
+"they are in an inherited hierarchy and not pay the planner penalty otherwise."
+msgstr ""
+"Зазвичай використовується для розділення таблиць. За замовчуванням "
+"встановлено значення \"partition\", яке ідеально підходить для PostgreSQL 8.4 "
+"і вище, оскільки змушує планувальник аналізувати таблиці на предмет обмежень "
+"тільки в тому випадку, якщо вони знаходяться в успадкованій ієрархії, і не "
+"застосовувати штрафні санкції до планувальника в інших випадках."
+
+#. Tag: link
+#, no-c-format
+msgid "shared_buffers"
+msgstr "shared_buffers"
+
+#. Tag: para
+#, no-c-format
+msgid "Default: ~128MB in PostgreSQL 9.6"
+msgstr "За замовчуванням: ~128 МБ у PostgreSQL 9.6"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Set to about 25% to 40% of available RAM. On windows you may not be able to "
+"set as high."
+msgstr ""
+"Встановіть приблизно 25% до 40% доступної оперативної пам'яті. У Windows ви "
+"не зможете встановити таке високе значення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://www.postgresql.org/docs/current/static/runtime-"
+"config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</link> "
+"This setting is only available for PostgreSQL 9.4+. For PostgreSQL 9.6+ this "
+"setting has additional importance in that it controls the max number of "
+"processes you can have for parallel queries."
+msgstr ""
+"<link xlink:href=\"https://www.postgresql.org/docs/current/static/runtime-"
+"config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</link> "
+"Цей параметр доступний тільки для PostgreSQL 9.4+. Для PostgreSQL 9.6+ це "
+"налаштування має додаткове значення, оскільки воно контролює максимальну "
+"кількість процесів, які можна використовувати для паралельних запитів."
+
+#. Tag: para
+#, no-c-format
+msgid "Default: 8"
+msgstr "За замовчуванням: 8"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the maximum number of background processes that the system can support. "
+"This parameter can only be set at server start."
+msgstr ""
+"Встановлює максимальну кількість фонових процесів, які може підтримувати "
+"система. Цей параметр можна встановити тільки під час запуску сервера."
+
+#. Tag: title
+#, no-c-format
+msgid "Runtime"
+msgstr "Час роботи"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.postgresql.org/docs/current/static/runtime-"
+"config-resource.html#GUC-WORK-MEM\">work_mem</link> - sets the size of "
+"memory used for sort operations and complex queries"
+msgstr ""
+"<link xlink:href=\"http://www.postgresql.org/docs/current/static/runtime-"
+"config-resource.html#GUC-WORK-MEM\">work_mem</link> - встановлює розмір "
+"пам'яті, що використовується для операцій сортування та складних запитів"
+
+#. Tag: para
+#, no-c-format
+msgid "Default: 1-4MB"
+msgstr "За замовчуванням: 1-4 МБ"
+
+#. Tag: para
+#, no-c-format
+msgid "Adjust up for large dbs, complex queries, lots of RAM"
+msgstr ""
+"Налаштуйте для великих баз даних, складних запитів, великого обсягу "
+"оперативної пам'яті"
+
+#. Tag: para
+#, no-c-format
+msgid "Adjust down for many concurrent users or low RAM."
+msgstr ""
+"Зменште налаштування для великої кількості одночасних користувачів або малої "
+"оперативної пам'яті."
+
+#. Tag: para
+#, no-c-format
+msgid "If you have lots of RAM and few developers:"
+msgstr "Якщо у вас багато оперативної пам'яті і мало розробників:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.postgresql.org/docs/current/static/runtime-"
+"config-resource.html#GUC-MAINTENANCE-WORK-MEM\">maintenance_work_mem</link> "
+"- the memory size used for VACUUM, CREATE INDEX, etc."
+msgstr ""
+"<link xlink:href=\"http://www.postgresql.org/docs/current/static/runtime-"
+"config-resource.html#GUC-MAINTENANCE-WORK-MEM\">maintenance_work_mem</link> - "
+"розмір пам'яті, що використовується для VACUUM, CREATE INDEX тощо."
+
+#. Tag: para
+#, no-c-format
+msgid "Default: 16-64MB"
+msgstr "За замовчуванням: 16-64 МБ"
+
+#. Tag: para
+#, no-c-format
+msgid "Generally too low - ties up I/O, locks objects while swapping memory"
+msgstr ""
+"Зазвичай занадто низький - блокує введення-виведення, блокує об'єкти під час "
+"обміну пам'яттю"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Recommend 32MB to 1GB on production servers w/lots of RAM, but depends on "
+"the # of concurrent users. If you have lots of RAM and few developers:"
+msgstr ""
+"Рекомендуємо від 32 МБ до 1 ГБ на виробничих серверах з великим об'ємом "
+"оперативної пам'яті, але це залежить від кількості одночасних користувачів. "
+"Якщо у вас багато оперативної пам'яті і мало розробників:"
+
+#. Tag: link
+#, no-c-format
+msgid "max_parallel_workers_per_gather"
+msgstr "max_parallel_workers_per_gather"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This setting is only available for PostgreSQL 9.6+ and will only affect "
+"PostGIS 2.3+, since only PostGIS 2.3+ supports parallel queries. If set to "
+"higher than 0, then some queries such as those involving relation functions "
+"like <code>ST_Intersects</code> can use multiple processes and can run more "
+"than twice as fast when doing so. If you have a lot of processors to spare, "
+"you should change the value of this to as many processors as you have. Also "
+"make sure to bump up <code>max_worker_processes</code> to at least as high "
+"as this number."
+msgstr ""
+"Це налаштування доступне лише у PostgreSQL версії 9.6 і вище та впливає лише "
+"на PostGIS 2.3 і новіші версії, оскільки тільки PostGIS 2.3 і вище підтримує "
+"паралельні запити. Якщо встановити значення більше за 0, деякі запити, "
+"наприклад ті, що використовують реляційні функції, як-от "
+"<code>ST_Intersects</code>, можуть виконуватись із використанням кількох "
+"процесів і працювати більш ніж удвічі швидше. Якщо у вас багато вільних "
+"процесорів, варто встановити це значення рівним кількості наявних "
+"процесорів. Також переконайтеся, що параметр <code>max_worker_processes</"
+"code> встановлений принаймні на таке саме значення."
+
+#. Tag: para
+#, no-c-format
+msgid "Default: 0"
+msgstr "За замовчуванням: 0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the maximum number of workers that can be started by a single "
+"<varname>Gather</varname> node. Parallel workers are taken from the pool of "
+"processes established by <varname>max_worker_processes</varname>. Note that "
+"the requested number of workers may not actually be available at run time. "
+"If this occurs, the plan will run with fewer workers than expected, which "
+"may be inefficient. Setting this value to 0, which is the default, disables "
+"parallel query execution."
+msgstr ""
+"Встановлює максимальну кількість воркерів, які може запустити один вузол "
+"<varname>Gather</varname>. Паралельні воркери беруться з пулу процесів, "
+"створеного параметром <varname>max_worker_processes</varname>. Зауважте, що "
+"запитувана кількість воркерів може бути недоступною під час виконання. Якщо "
+"це станеться, план виконання буде працювати з меншою кількістю воркерів, ніж "
+"очікувалося, що може призвести до неефективності. Встановлення цього "
+"значення в 0, що є значенням за замовчуванням, вимикає виконання паралельних "
+"запитів."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Extras"
+msgstr "Додаткові функції PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This chapter documents features found in the extras folder of the PostGIS "
+"source tarballs and source repository. These are not always packaged with "
+"PostGIS binary releases, but are usually PL/pgSQL based or standard shell "
+"scripts that can be run as is."
+msgstr ""
+"У цьому розділі описано функції, що містяться в папці extras архівів "
+"вихідного коду PostGIS та репозиторії вихідного коду. Вони не завжди входять "
+"до складу бінарних випусків PostGIS, але зазвичай є скриптами на основі PL/"
+"pgSQL або стандартними скриптами оболонки, які можна запускати без змін."
+
+#. Tag: chapter
+#, no-c-format
+msgid "&extras_address_standardizer; &extras_tigergeocoder;"
+msgstr "&extras_address_standardizer; &extras_tigergeocoder;"
+
+#. Tag: title
+#, no-c-format
+msgid "Address Standardizer"
+msgstr "Стандартизатор адрес"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a fork of the <link xlink:href=\"http://www.pagcgeo.org/docs/html/"
+"pagc-11.html\">PAGC standardizer</link> (original code for this portion was "
+"<link xlink:href=\"http://sourceforge.net/p/pagc/code/360/tree/branches/sew-"
+"refactor/postgresql\">PAGC PostgreSQL Address Standardizer</link>)."
+msgstr ""
+"Це є форком <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-11.html\"
+">стандартизатора PAGC</link> (оригінальний код для цієї частини був <link "
+"xlink:href=\"http://sourceforge.net/p/pagc/code/360/tree/branches/"
+"sew-refactor/postgresql\">стандартизатором адрес PAGC PostgreSQL</link>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The address standardizer is a single line address parser that takes an input "
+"address and normalizes it based on a set of rules stored in a table and "
+"helper lex and gaz tables."
+msgstr ""
+"Стандартизатор адрес — це однорядковий аналізатор адрес, який приймає вхідну "
+"адресу та нормалізує її на основі набору правил, що зберігаються в таблиці "
+"та допоміжних таблицях lex і gaz."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The code is built into a single PostgreSQL extension library called "
+"<code>address_standardizer</code> which can be installed with <code>CREATE "
+"EXTENSION address_standardizer;</code>. In addition to the "
+"address_standardizer extension, a sample data extension called "
+"<code>address_standardizer_data_us</code> extensions is built, which "
+"contains gaz, lex, and rules tables for US data. This extensions can be "
+"installed via: <code>CREATE EXTENSION address_standardizer_data_us;</code>"
+msgstr ""
+"Код упакований в одну бібліотеку розширення PostgreSQL під назвою "
+"<code>address_standardizer</code>, яке можна встановити за допомогою команди "
+"<code>CREATE EXTENSION address_standardizer;</code>. Окрім розширення "
+"address_standardizer, також створене прикладне розширення з даними — "
+"<code>address_standardizer_data_us</code>, яке містить таблиці gaz, lex і "
+"rules для даних США. Це розширення можна встановити командою: <code>CREATE "
+"EXTENSION address_standardizer_data_us;</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The code for this extension can be found in the PostGIS <filename>extensions/"
+"address_standardizer</filename> and is currently self-contained."
+msgstr ""
+"Код цього розширення можна знайти в PostGIS <filename>extensions/"
+"address_standardizer</filename> і на даний момент він є самостійним."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For installation instructions refer to: <xref "
+"linkend=\"installing_pagc_address_standardizer\"/>."
+msgstr ""
+"Інструкції з установки див.: <xref "
+"linkend=\"installing_pagc_address_standardizer\"/>."
+
+#. Tag: title
+#, no-c-format
+msgid "How the Parser Works"
+msgstr "Як працює парсер"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The parser works from right to left looking first at the macro elements for "
+"postcode, state/province, city, and then looks micro elements to determine "
+"if we are dealing with a house number street or intersection or landmark. It "
+"currently does not look for a country code or name, but that could be "
+"introduced in the future."
+msgstr ""
+"Парсер працює справа наліво, спочатку перевіряючи макроелементи для "
+"поштового індексу, штату/провінції, міста, а потім перевіряє мікроелементи, "
+"щоб визначити, чи маємо ми справу з номером будинку, вулицею, перехрестям "
+"або орієнтиром. Наразі він не перевіряє код країни або назву, але це може "
+"бути додано в майбутньому."
+
+#. Tag: term
+#, no-c-format
+msgid "Country code"
+msgstr "Код країни"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Assumed to be US or CA based on: postcode as US or Canada state/province as "
+"US or Canada else US"
+msgstr ""
+"Вважається, що місцезнаходження — США або Канада, на підставі: поштового "
+"індексу США або Канади, штату/провінції США або Канади, в іншому випадку — "
+"США"
+
+#. Tag: term
+#, no-c-format
+msgid "Postcode/zipcode"
+msgstr "Поштовий індекс"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These are recognized using Perl compatible regular expressions. These regexs "
+"are currently in the parseaddress-api.c and are relatively simple to make "
+"changes to if needed."
+msgstr ""
+"Вони розпізнаються за допомогою регулярних виразів, сумісних з Perl. Ці "
+"регулярні вирази наразі знаходяться у файлі parseaddress-api.c і їх відносно "
+"просто змінити, якщо це необхідно."
+
+#. Tag: term
+#, no-c-format
+msgid "State/province"
+msgstr "Штат/провінція"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These are recognized using Perl compatible regular expressions. These regexs "
+"are currently in the parseaddress-api.c but could get moved into includes in "
+"the future for easier maintenance."
+msgstr ""
+"Вони розпізнаються за допомогою регулярних виразів, сумісних з Perl. Ці "
+"регулярні вирази наразі знаходяться в parseaddress-api.c, але в майбутньому "
+"можуть бути переміщені в includes для полегшення обслуговування."
+
+#. Tag: title
+#, no-c-format
+msgid "Address Standardizer Types"
+msgstr "Типи стандартизаторів адрес"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the PostgreSQL data types installed by Address "
+"Standardizer extension. Note we describe the casting behavior of these which "
+"is very important especially when designing your own functions."
+msgstr ""
+"У цьому розділі наведені типи даних PostgreSQL, встановлені розширенням "
+"Address Standardizer. Зверніть увагу, що ми описуємо поведінку приведення "
+"типів (casting), що є особливо важливим при розробці власних функцій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A composite type that consists of the elements of an address. This is the "
+"return type for <varname>standardize_address</varname> function."
+msgstr ""
+"Композитний тип, що складається з елементів адреси. Це тип повернення для "
+"функції <varname>standardize_address</varname>."
+
+#. Tag: title
+#, no-c-format
+msgid "Description"
+msgstr "Опис"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A composite type that consists of elements of an address. This is the return "
+"type for <xref linkend=\"standardize_address\"/> function. Some descriptions "
+"for elements are borrowed from <link xlink:href=\"http://www.pagcgeo.org/"
+"docs/html/pagc-12.html#ss12.1\">PAGC Postal Attributes</link>."
+msgstr ""
+"Композитний тип, що складається з елементів адреси. Це тип повернення для "
+"функції <xref linkend=\"standardize_address\"/>. Деякі описи елементів "
+"запозичені з <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#ss12.1\">PAGC Postal Attributes</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The token numbers denote the output reference number in the <xref "
+"linkend=\"rulestab\"/>."
+msgstr ""
+"Номери токенів позначають вихідний номер посилання в <xref linkend=\"rulestab\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "&address_standardizer_required;"
+msgstr "&address_standardizer_required;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>0</code>): Refers to building number or name. "
+"Unparsed building identifiers and types. Generally blank for most addresses."
+msgstr ""
+"є текстом (номер токена <code>0</code>): Позначає номер або назву будівлі. "
+"Нерозбірні ідентифікатори та типи будівель. Зазвичай для більшості адрес це "
+"поле залишається порожнім."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is a text (token number <code>1</code>): This is the street number on a "
+"street. Example <emphasis>75</emphasis> in <code>75 State Street</code>."
+msgstr ""
+"є текстом (номер токена <code>1</code>): Це номер будинку на вулиці. Приклад "
+"<emphasis>75</emphasis> в <code>75 State Street</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>2</code>): STREET NAME PRE-DIRECTIONAL such as "
+"North, South, East, West etc."
+msgstr ""
+"є текстом (номер токена <code>2</code>): НАЗВА ВУЛИЦІ ПЕРЕД НАПРЯМКОМ, "
+"наприклад North, South, East, West тощо."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>3</code>): STREET NAME PRE-MODIFIER Example "
+"<emphasis>OLD</emphasis> in <code>3715 OLD HIGHWAY 99</code>."
+msgstr ""
+"є текстом (номер токена <code>3</code>): ПРЕДМОДИФІКАТОР НАЗВИ ВУЛИЦІ "
+"Приклад <emphasis>OLD</emphasis> в <code>3715 OLD HIGHWAY 99</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "is text (token number <code>4</code>): STREET PREFIX TYPE"
+msgstr "є текстом (номер токена <code>4</code>): ПРЕФІКС ВУЛИЦІ ТИП"
+
+#. Tag: para
+#, no-c-format
+msgid "is text (token number <code>5</code>): STREET NAME"
+msgstr "є текстом (номер токена <code>5</code>): НАЗВА ВУЛИЦІ"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>6</code>): STREET POST TYPE e.g. St, Ave, Cir. A "
+"street type following the root street name. Example <emphasis>STREET</"
+"emphasis> in <code>75 State Street</code>."
+msgstr ""
+"є текстом (номер токена <code>6</code>): ТИП ВУЛИЦІ, наприклад St, Ave, Cir. "
+"Тип вулиці, що йде після основної назви вулиці. Приклад <emphasis>STREET</"
+"emphasis> в <code>75 State Street</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>7</code>): STREET POST-DIRECTIONAL A directional "
+"modifier that follows the street name.. Example <emphasis>WEST</emphasis> in "
+"<code>3715 TENTH AVENUE WEST</code>."
+msgstr ""
+"є текстом (номер токена <code>7</code>): STREET POST-DIRECTIONAL Модифікатор "
+"напрямку, що стоїть після назви вулиці. Приклад <emphasis>WEST</emphasis> в "
+"<code>3715 TENTH AVENUE WEST</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>8</code>): RURAL ROUTE . Example <emphasis>7</"
+"emphasis> in <code>RR 7</code>."
+msgstr ""
+"є текстом (номер токена <code>8</code>): СІЛЬСЬКИЙ МАРШРУТ . Приклад "
+"<emphasis>7</emphasis> в <code>RR 7</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "is text: Extra information like Floor number."
+msgstr "є текстом: Додаткова інформація, така як номер поверху."
+
+#. Tag: para
+#, no-c-format
+msgid "is text (token number <code>10</code>): Example Boston."
+msgstr "є текстом (номер токена <code>10</code>): Приклад Бостон."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text (token number <code>11</code>): Example <code>MASSACHUSETTS</code>"
+msgstr ""
+"є текстом (номер токена <code>11</code>): (Приклад <code>MASSACHUSETTS</code>"
+
+#. Tag: para
+#, no-c-format
+msgid "is text (token number <code>12</code>): Example <code>USA</code>"
+msgstr "є текстом (номер токена <code>12</code>): Приклад <code>США</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text POSTAL CODE (ZIP CODE) (token number <code>13</code>): Example "
+"<code>02109</code>"
+msgstr ""
+"є текстом ПОШТОВИЙ ІНДЕКС (ЗІП-КОД) (номер токена <code>13</code>): Приклад "
+"<code>02109</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text POSTAL BOX NUMBER (token number <code>14 and 15</code>): Example "
+"<code>02109</code>"
+msgstr ""
+"є текстом НОМЕР ПОШТОВОЇ СКРИНЬКИ (номер токена <code>14 та 15</code>): "
+"Приклад <code>02109</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is text Apartment number or Suite Number (token number <code>17</code>): "
+"Example <emphasis>3B</emphasis> in <code>APT 3B</code>."
+msgstr ""
+"є текстом Номер квартири або номер люкса (номер токена <code>17</code>): "
+"Приклад <emphasis>3B</emphasis> в <code>APT 3B</code>."
+
+#. Tag: title
+#, no-c-format
+msgid "Address Standardizer Tables"
+msgstr "Таблиці стандартизації адрес"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the PostgreSQL table formats used by the "
+"address_standardizer for normalizing addresses. Note that these tables do "
+"not need to be named the same as what is referenced here. You can have "
+"different lex, gaz, rules tables for each country for example or for your "
+"custom geocoder. The names of these tables get passed into the address "
+"standardizer functions."
+msgstr ""
+"У цьому розділі перелічено формати таблиць PostgreSQL, які використовує "
+"address_standardizer для нормалізації адрес. Зверніть увагу, що ці таблиці "
+"не обов'язково мають мати ті самі назви, що й зазначені тут. Наприклад, ви "
+"можете мати різні таблиці lex, gaz, rules для кожної країни або для вашого "
+"власного геокодера. Назви цих таблиць передаються у функції стандартизатора "
+"адрес."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The packaged extension <varname>address_standardizer_data_us</varname> "
+"contains data for standardizing US addresses."
+msgstr ""
+"Розширення <varname>address_standardizer_data_us</varname> містить дані для "
+"стандартизації адрес у США."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"The rules table contains a set of rules that maps address input sequence "
+"tokens to standardized output sequence. A rule is defined as a set of input "
+"tokens followed by -1 (terminator) followed by set of output tokens followed "
+"by -1 followed by number denoting kind of rule followed by ranking of rule."
+msgstr ""
+"Таблиця правил містить набір правил, які відображають токени вхідної "
+"послідовності адрес на стандартизовану вихідну послідовність. Правило "
+"визначається як набір вхідних токенів, за якими слідує -1 (термінатор), за "
+"яким слідує набір вихідних токенів, за яким слідує -1, за яким слідує число, "
+"що позначає тип правила, за яким слідує рейтинг правила."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A rules table must have at least the following columns, though you are "
+"allowed to add more for your own uses."
+msgstr ""
+"Таблиця правил повинна містити принаймні такі стовпці, хоча ви можете "
+"додавати інші для власних потреб."
+
+#. Tag: para
+#, no-c-format
+msgid "Primary key of table"
+msgstr "Первинний ключ таблиці"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"text field denoting the rule. Details at <link xlink:href=\"http://www."
+"pagcgeo.org/docs/html/pagc-12.html#--r-rec--\">PAGC Address Standardizer "
+"Rule records</link>."
+msgstr ""
+"текстове поле, що позначає правило. Детальніше див. <link xlink:href=\"http://www."
+"pagcgeo.org/docs/html/pagc-12.html#--r-rec--\">Записи "
+"правил стандартизації адрес PAGC</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A rule consists of a set of non-negative integers representing input tokens, "
+"terminated by a -1, followed by an equal number of non-negative integers "
+"representing postal attributes, terminated by a -1, followed by an integer "
+"representing a rule type, followed by an integer representing the rank of "
+"the rule. The rules are ranked from 0 (lowest) to 17 (highest)."
+msgstr ""
+"Правило складається з набору невід'ємних цілих чисел, що представляють "
+"вхідні маркери, закінчується -1, за яким слідує така ж кількість невід'ємних "
+"цілих чисел, що представляють поштові атрибути, закінчується -1, за яким "
+"слідує ціле число, що представляє тип правила, за яким слідує ціле число, що "
+"представляє ранг правила. Правила ранжуються від 0 (найнижчий) до 17 "
+"(найвищий)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"So for example the rule <code>2 0 2 22 3 -1 5 5 6 7 3 -1 2 6</code> maps to "
+"sequence of output tokens <emphasis>TYPE NUMBER TYPE DIRECT QUALIF</"
+"emphasis> to the output sequence <emphasis>STREET STREET SUFTYP SUFDIR "
+"QUALIF</emphasis>. The rule is an ARC_C rule of rank 6."
+msgstr ""
+"Так, наприклад, правило <code>2 0 2 22 3 -1 5 5 6 7 3 -1 2 6</code> "
+"відображається на послідовність вихідних токенів <emphasis>TYPE NUMBER TYPE "
+"DIRECT QUALIF</emphasis> у вихідну послідовність <emphasis>STREET STREET "
+"SUFTYP SUFDIR QUALIF</emphasis>. Це правило є правилом ARC_C рангу 6."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Numbers for corresponding output tokens are listed in <xref "
+"linkend=\"stdaddr\"/>."
+msgstr ""
+"Номери відповідних вихідних токенів наведені в <xref linkend=\"stdaddr\"/>."
+
+#. Tag: title
+#, no-c-format
+msgid "Input Tokens"
+msgstr "Вхідні токени"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Each rule starts with a set of input tokens followed by a terminator "
+"<code>-1</code>. Valid input tokens excerpted from <link xlink:href=\"http://"
+"www.pagcgeo.org/docs/html/pagc-12.html#ss12.2\">PAGC Input Tokens</link> are "
+"as follows:"
+msgstr ""
+"Кожне правило починається з набору вхідних токенів, за якими слідує "
+"роздільник <code>-1</code>. Дієві вхідні токени, взяті з <link "
+"xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12.html#ss12.2\">PAGC Input "
+"Tokens</link>, наведені нижче:"
+
+#. Tag: emphasis
+#, no-c-format
+msgid "Form-Based Input Tokens"
+msgstr "Токени введення на основі форм"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(13). The ampersand (&) is frequently used to abbreviate the word "
+"\"and\"."
+msgstr ""
+"(13). Символ амперсанд (&) часто використовується для скорочення слова "
+"\"and\"."
+
+#. Tag: para
+#, no-c-format
+msgid "(9). A punctuation character."
+msgstr "(9). Розділовий знак."
+
+#. Tag: para
+#, no-c-format
+msgid "(21). A sequence of two letters. Often used as identifiers."
+msgstr ""
+"(21). Послідовність двох літер. Часто використовується як ідентифікатор."
+
+#. Tag: para
+#, no-c-format
+msgid "(25). Fractions are sometimes used in civic numbers or unit numbers."
+msgstr ""
+"(25). Дроби іноді використовуються в цивільних числах або числах одиниць."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(23). An alphanumeric string that contains both letters and digits. Used for "
+"identifiers."
+msgstr ""
+"(23). Алфавітно-цифровий рядок, що містить як літери, так і цифри. "
+"Використовується для ідентифікаторів."
+
+#. Tag: para
+#, no-c-format
+msgid "(0). A string of digits."
+msgstr "(0). Ряд цифр."
+
+#. Tag: para
+#, no-c-format
+msgid "(15). Representations such as First or 1st. Often used in street names."
+msgstr ""
+"(15). Такі позначення, як \"Перший\" або \"1-й\". Часто використовуються в "
+"назвах вулиць."
+
+#. Tag: para
+#, no-c-format
+msgid "(18). A single letter."
+msgstr "(18). Одна літера."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(1). A word is a string of letters of arbitrary length. A single letter can "
+"be both a SINGLE and a WORD."
+msgstr ""
+"(1). Слово — це послідовність літер довільної довжини. Окрема літера може "
+"бути як SINGLE так і WORD."
+
+#. Tag: emphasis
+#, no-c-format
+msgid "Function-based Input Tokens"
+msgstr "Функціональні вхідні токени"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(14). Words used to denote post office boxes. For example <emphasis>Box</"
+"emphasis> or <emphasis>PO Box</emphasis>."
+msgstr ""
+"(14). Слова, що використовуються для позначення поштових скриньок. "
+"Наприклад, <emphasis>Box</emphasis> або <emphasis>PO Box</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(19). Words used to denote buildings or building complexes, usually as a "
+"prefix. For example: <emphasis>Tower</emphasis> in <emphasis>Tower 7A</"
+"emphasis>."
+msgstr ""
+"(19). Слова, що використовуються для позначення будівель або будівельних "
+"комплексів, зазвичай як префікс. Наприклад: <emphasis>Вежа</emphasis> в "
+"<emphasis>Вежа 7A</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(24). Words and abbreviations used to denote buildings or building "
+"complexes, usually as a suffix. For example: <emphasis>Shopping Centre</"
+"emphasis>."
+msgstr ""
+"(24). Слова та абревіатури, що використовуються для позначення будівель або "
+"будівельних комплексів, зазвичай як суфікс. Наприклад: <emphasis>Торговий "
+"центр</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(22). Words used to denote directions, for example <emphasis>North</"
+"emphasis>."
+msgstr ""
+"(22). Слова, що використовуються для позначення напрямків, наприклад "
+"<emphasis>Північ</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid "(20). Words used to denote milepost addresses."
+msgstr ""
+"(20). Слова, що використовуються для позначення адрес кілометрових стовпців."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(6). Words and abbreviations used to denote highways and roads. For example: "
+"the <emphasis>Interstate</emphasis> in <emphasis>Interstate 5</emphasis>"
+msgstr ""
+"(6). Слова та абревіатури, що використовуються для позначення "
+"автомагістралей та доріг. Наприклад: <emphasis>Interstate</emphasis> в "
+"<emphasis>Interstate 5</emphasis>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(8). Words and abbreviations used to denote rural routes. <emphasis>RR</"
+"emphasis>."
+msgstr ""
+"(8). Слова та абревіатури, що використовуються для позначення приміських "
+"маршрутів. <emphasis>RR</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(2). Words and abbreviations used to denote street types. For example: "
+"<emphasis>ST</emphasis> or <emphasis>AVE</emphasis>."
+msgstr ""
+"(2). Слова та абревіатури, що використовуються для позначення типів вулиць. "
+"Наприклад: <emphasis>ST</emphasis> або <emphasis>AVE</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(16). Words and abbreviations used to denote internal subaddresses. For "
+"example, <emphasis>APT</emphasis> or <emphasis>UNIT</emphasis>."
+msgstr ""
+"(16). Слова та абревіатури, що використовуються для позначення внутрішніх "
+"підадрес. Наприклад, <emphasis>APT</emphasis> або <emphasis>UNIT</emphasis>."
+
+#. Tag: emphasis
+#, no-c-format
+msgid "Postal Type Input Tokens"
+msgstr "Токени введення поштового типу"
+
+#. Tag: para
+#, no-c-format
+msgid "(28). A 5 digit number. Identifies a Zip Code"
+msgstr "(28). 5-значний номер. Ідентифікує поштовий індекс"
+
+#. Tag: para
+#, no-c-format
+msgid "(29). A 4 digit number. Identifies ZIP4."
+msgstr "(29). 4-значний номер. Ідентифікує ZIP4."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(27). A 3 character sequence of letter number letter. Identifies an FSA, the "
+"first 3 characters of a Canadian postal code."
+msgstr ""
+"(27). Послідовність з 3 символів, що складається з літери, цифри та літери. "
+"Ідентифікує FSA, перші 3 символи канадського поштового індексу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(26). A 3 character sequence of number letter number. Identifies an LDU, the "
+"last 3 characters of a Canadian postal code."
+msgstr ""
+"(26). Послідовність з 3 символів, що складається з цифри, літери та цифри. "
+"Ідентифікує LDU, останні 3 символи канадського поштового індексу."
+
+#. Tag: emphasis
+#, no-c-format
+msgid "Stopwords"
+msgstr "Стоп-слова"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"STOPWORDS combine with WORDS. In rules a string of multiple WORDs and "
+"STOPWORDs will be represented by a single WORD token."
+msgstr ""
+"СТОПСЛОВА поєднуються зі СЛОВАМИ. У правилах послідовність декількох СЛІВ і "
+"СТОПСЛІВ буде представлена одним токеном СЛОВА."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(7). A word with low lexical significance, that can be omitted in parsing. "
+"For example: <emphasis>THE</emphasis>."
+msgstr ""
+"(7). Слово з низьким лексичним значенням, яке можна опустити при розборі. "
+"Наприклад: <emphasis>THE</emphasis>."
+
+#. Tag: title
+#, no-c-format
+msgid "Output Tokens"
+msgstr "Вихідні токени"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After the first -1 (terminator), follows the output tokens and their order, "
+"followed by a terminator <code>-1</code>. Numbers for corresponding output "
+"tokens are listed in <xref linkend=\"stdaddr\"/>. What are allowed is "
+"dependent on kind of rule. Output tokens valid for each rule type are listed "
+"in <xref linkend=\"rule_types_rank\"/>."
+msgstr ""
+"Після першого -1 (роздільника) йдуть вихідні маркери та їх порядок, а потім "
+"термінатор <code>-1</code>. Номери відповідних вихідних маркерів наведені в "
+"<xref linkend=\"stdaddr\"/>. Допустимі значення залежать від типу правила. "
+"Вихідні маркери, допустимі для кожного типу правила, наведені в <xref "
+"linkend=\"rule_types_rank\"/>."
+
+#. Tag: title
+#, no-c-format
+msgid "Rule Types and Rank"
+msgstr "Типи правил та їхній ранг"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The final part of the rule is the rule type which is denoted by one of the "
+"following, followed by a rule rank. The rules are ranked from 0 (lowest) to "
+"17 (highest)."
+msgstr ""
+"Остання частина правила - це тип правила, який позначається одним із "
+"наступних символів, за яким слідує рангове значення правила. Правила "
+"ранжуються від 0 (найнижче) до 17 (найвище)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number = \"<emphasis role=\"bold\">0</emphasis>\"). The class of "
+"rules for parsing MACRO clauses such as <emphasis>PLACE STATE ZIP</emphasis>"
+msgstr ""
+"(номер токена = \"<emphasis role=\"bold\">0</emphasis>\"). Клас правил для "
+"розбору MACRO класів, таких як <emphasis>PLACE STATE ZIP</emphasis>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\"><varname>MACRO_C</varname> output tokens</emphasis> "
+"(excerpted from <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--\">http://www.pagcgeo.org/docs/html/pagc-12.html#--r-typ--</"
+"link>."
+msgstr ""
+"<emphasis role=\"bold\"><varname>MACRO_C</varname> вихідні токени</emphasis> ("
+"витяг з <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--\">http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "(token number \"10\"). Example \"Albany\""
+msgstr "(токен номер \"10\"). Приклад \"Albany\""
+
+#. Tag: para
+#, no-c-format
+msgid "(token number \"11\"). Example \"NY\""
+msgstr "(токен номер \"11\"). Приклад \"NY\""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number \"12\"). This attribute is not used in most reference files. "
+"Example \"USA\""
+msgstr ""
+"(токен номер \"12\"). Цей атрибут не використовується в більшості файлів "
+"посилань. Приклад \"USA\""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number \"13\"). (SADS elements \"ZIP CODE\" , \"PLUS 4\" ). This "
+"attribute is used for both the US Zip and the Canadian Postal Codes."
+msgstr ""
+"(токен номер \"13\"). (Елементи SADS \"ZIP CODE\" , \"PLUS 4\" ). Цей атрибут "
+"використовується як для поштових індексів США, так і для поштових індексів "
+"Канади."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number = \"<emphasis role=\"bold\">1</emphasis>\"). The class of "
+"rules for parsing full MICRO clauses (such as House, street, sufdir, predir, "
+"pretyp, suftype, qualif) (ie ARC_C plus CIVIC_C). These rules are not used "
+"in the build phase."
+msgstr ""
+"(номер токена = \"<emphasis role=\"bold\">1</emphasis>\"). Клас правил для "
+"розбору повних клаузул MICRO (таких як House, street, sufdir, predir, "
+"pretyp, suftype, qualif) (тобто ARC_C плюс CIVIC_C). Ці правила не "
+"використовуються на етапі побудови."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\"><varname>MICRO_C</varname> output tokens</emphasis> "
+"(excerpted from <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--\">http://www.pagcgeo.org/docs/html/pagc-12.html#--r-typ--</"
+"link>."
+msgstr ""
+"<emphasis role=\"bold\"><varname>MICRO_C</varname> вихідні токени</emphasis> ("
+"витяг з <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--\">http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number = \"<emphasis role=\"bold\">2</emphasis>\"). The class of "
+"rules for parsing MICRO clauses, excluding the HOUSE attribute. As such uses "
+"same set of output tokens as MICRO_C minus the HOUSE token."
+msgstr ""
+"(номер маркера = \"<emphasis role=\"bold\">2</emphasis>\"). Клас правил для "
+"розбору клаузул MICRO, за винятком атрибуту HOUSE. Як такий, використовує "
+"той самий набір вихідних маркерів, що й MICRO_C, за винятком маркера HOUSE."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number = \"<emphasis role=\"bold\">3</emphasis>\"). The class of "
+"rules for parsing the HOUSE attribute."
+msgstr ""
+"(номер токена = \"<emphasis role=\"bold\">3</emphasis>\"). Клас правил для "
+"розбору атрибуту HOUSE."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number = \"<emphasis role=\"bold\">4</emphasis>\"). The class of "
+"rules for parsing EXTRA attributes - attributes excluded from geocoding. "
+"These rules are not used in the build phase."
+msgstr ""
+"(номер токена = \"<emphasis role=\"bold\">4</emphasis>\"). Клас правил для "
+"розбору атрибутів EXTRA - атрибутів, виключених з геокодування. Ці правила "
+"не використовуються на етапі побудови."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\"><varname>EXTRA_C</varname> output tokens</emphasis> "
+"(excerpted from <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--\">http://www.pagcgeo.org/docs/html/pagc-12.html#--r-typ--</"
+"link>."
+msgstr ""
+"<emphasis role=\"bold\"><varname>EXTRA_C</varname> вихідні токени</emphasis> ("
+"витяг з <link xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--\">http://www.pagcgeo.org/docs/html/pagc-12."
+"html#--r-typ--</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "(token number <code>0</code>): Unparsed building identifiers and types."
+msgstr ""
+"(токен номер <code>0</code>): Нерозпізнані ідентифікатори та типи будівель."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number <code>14</code>): The <emphasis role=\"bold\">BOX</emphasis> "
+"in <code>BOX 3B</code>"
+msgstr ""
+"(токен номер <code>14</code>): <emphasis role=\"bold\">БОКС</emphasis> в "
+"<code>БОКС 3B</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number <code>15</code>): The <emphasis role=\"bold\">3B</emphasis> in "
+"<code>BOX 3B</code>"
+msgstr ""
+"(токен номер <code>15</code>): <emphasis role=\"bold\">3B</emphasis> в "
+"<code>BOX 3B</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number <code>8</code>): The <emphasis role=\"bold\">RR</emphasis> in "
+"<code>RR 7</code>"
+msgstr ""
+"(токен номер <code>8</code>): <emphasis role=\"bold\">RR</emphasis> в "
+"<code>RR 7</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number <code>16</code>): The <emphasis role=\"bold\">APT</emphasis> "
+"in <code>APT 3B</code>"
+msgstr ""
+"(токен номер <code>16</code>): <emphasis role=\"bold\">APT</emphasis> в "
+"<code>APT 3B</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(token number <code>17</code>): The <emphasis role=\"bold\">3B</emphasis> in "
+"<code>APT 3B</code>"
+msgstr ""
+"(токен номер <code>17</code>): <emphasis role=\"bold\">3B</emphasis> в "
+"<code>APT 3B</code>"
+
+#. Tag: para
+#, no-c-format
+msgid "(token number <code>9</code>): An otherwise unclassified output."
+msgstr ""
+"(токен номер <code>9</code>): Вихідні дані, які не підлягають класифікації."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A lex table is used to classify alphanumeric input and associate that input "
+"with (a) input tokens ( See <xref linkend=\"rule_input_tokens\"/>) and (b) "
+"standardized representations."
+msgstr ""
+"Таблиця lex використовується для класифікації алфавітно-цифрового вводу та "
+"пов'язування цього вводу з (а) вхідними токенами (див. <xref linkend="
+"\"rule_input_tokens\"/>) та (б) стандартизованими представленнями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A lex (short for lexicon) table is used to classify alphanumeric input and "
+"associate that input with <xref linkend=\"rule_input_tokens\"/> and (b) "
+"standardized representations. Things you will find in these tables are "
+"<code>ONE</code> mapped to stdword: <code>1</code>."
+msgstr ""
+"Таблиця lex (скорочення від lexicon) використовується для класифікації "
+"алфавітно-цифрового вводу та пов'язування цього вводу з <xref linkend="
+"\"rule_input_tokens\"/> та (b) стандартизованими представленнями. У цих "
+"таблицях ви знайдете <code>ONE</code>, що відповідає stdword: <code>1</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "A lex has at least the following columns in the table. You may add"
+msgstr "Lex має принаймні такі стовпці в таблиці. Ви можете додати"
+
+#. Tag: para
+#, no-c-format
+msgid "integer: definition number?"
+msgstr "integer: definition number?"
+
+#. Tag: para
+#, no-c-format
+msgid "text: the input word"
+msgstr "text: вхідне слово"
+
+#. Tag: para
+#, no-c-format
+msgid "text: the standardized replacement word"
+msgstr "text: вхідне слово стандартизоване слово-замінник"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"integer: the kind of word it is. Only if it is used in this context will it "
+"be replaced. Refer to <link xlink:href=\"http://www.pagcgeo.org/docs/html/"
+"pagc-12.html#--i-tok--\">PAGC Tokens</link>."
+msgstr ""
+"integer: тип слова. Замінюється тільки в цьому контексті. Див. <link "
+"xlink:href=\"http://www.pagcgeo.org/docs/html/pagc-12.html#--i-tok--\">Токени "
+"PAGC</link>."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A gaz table is used to standardize place names and associate that input with "
+"(a) input tokens ( See <xref linkend=\"rule_input_tokens\"/>) and (b) "
+"standardized representations."
+msgstr ""
+"Таблиця gaz використовується для стандартизації географічних назв та "
+"пов'язування цих даних з (а) вхідними токенами (див. <xref linkend="
+"\"rule_input_tokens\"/>) та (б) стандартизованими представленнями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A gaz (short for gazeteer) table is used to standardize place names and "
+"associate that input with <xref linkend=\"rule_input_tokens\"/> and (b) "
+"standardized representations. For example if you are in US, you may load "
+"these with State Names and associated abbreviations."
+msgstr ""
+"Таблиця gaz (скорочення від gazeteer) використовується для стандартизації "
+"назв місць та пов'язування цих даних з <xref linkend=\"rule_input_tokens\"/> "
+"та (b) стандартизованими представленнями. Наприклад, якщо ви перебуваєте в "
+"США, ви можете завантажити ці дані разом із назвами штатів та відповідними "
+"абревіатурами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A gaz table has at least the following columns in the table. You may add "
+"more columns if you wish for your own purposes."
+msgstr ""
+"Таблиця gaz має принаймні такі стовпці. Ви можете додати більше стовпців, "
+"якщо це необхідно для ваших потреб."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"integer: definition number? - identifier used for that instance of the word"
+msgstr ""
+"integer: definition number? - ідентифікатор, що використовується для цього "
+"екземпляра слова"
+
+#. Tag: title
+#, no-c-format
+msgid "Address Standardizer Functions"
+msgstr "Функції стандартизації адреси"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a json formatted text listing the parse tokens and standardizations"
+msgstr ""
+"Повертає текст у форматі json із переліком розібраних токенів та "
+"стандартизацій"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a function for debugging address standardizer rules and lex/gaz "
+"mappings. It returns a json formatted text that includes the matching rules, "
+"mapping of tokens, and best standardized address <xref linkend=\"stdaddr\"/> "
+"form of an input address utilizing <xref linkend=\"lextab\"/> table name, "
+"<xref linkend=\"gaztab\"/>, and <xref linkend=\"rulestab\"/> table names and "
+"an address."
+msgstr ""
+"Це функція для налагодження правил стандартизації адрес та відповідності "
+"лексичних одиниць (lex/gaz). Вона повертає текст у форматі json, що містить "
+"правила відповідності, відображення токенів та найкращу стандартизовану "
+"адресу <xref linkend=\"stdaddr\"/> у вигляді вхідної адреси з використанням "
+"<xref linkend=\"lextab\"/>імен таблиць, <xref linkend=\"gaztab\"/>та <xref "
+"linkend=\"rulestab\"/>імен таблиць та адреси."
+
+#. Tag: para
+#, no-c-format
+msgid "For single line addresses use just <varname>micro</varname>"
+msgstr "Для однорядкових адрес використовуйте лише <varname>micro</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For two line address A <varname>micro</varname> consisting of standard first "
+"line of postal address e.g. <code>house_num street</code>, and a macro "
+"consisting of standard postal second line of an address e.g <code>city, "
+"state postal_code country</code>."
+msgstr ""
+"Для дворядкової адреси A <varname>micro</varname>, що складається зі "
+"стандартного першого рядка поштової адреси, наприклад <code>house_num "
+"street</code>, та макросу, що складається зі стандартного другого рядка "
+"поштової адреси, наприклад <code>city, state postal_code country</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "Elements returned in the json document are"
+msgstr "Елементи, що повертаються в документі json, є такими"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For each word in the input address, returns the position of the word, token "
+"categorization of the word, and the standard word it is mapped to. Note that "
+"for some input words, you might get back multiple records because some "
+"inputs can be categorized as more than one thing."
+msgstr ""
+"Для кожного слова у вхідній адресі повертає позицію слова, категоризацію "
+"лексеми слова та стандартне слово, до якого воно відноситься. Зверніть "
+"увагу, що для деяких вхідних слів ви можете отримати кілька записів, "
+"оскільки деякі вхідні дані можуть бути віднесені до декількох категорій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The set of rules matching the input and the corresponding score for each. "
+"The first rule (highest scoring) is what is used for standardization"
+msgstr ""
+"Набір правил, що відповідають вхідним даним, та відповідний бал для кожного "
+"з них. Перше правило (з найвищим балом) використовується для стандартизації"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The standardized address elements <xref linkend=\"stdaddr\"/> that would be "
+"returned when running <xref linkend=\"standardize_address\"/>"
+msgstr ""
+"Стандартизовані елементи адреси <xref linkend=\"stdaddr\"/>, які будуть "
+"повернуті при виконанні <xref linkend=\"standardize_address\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.4.0"
+msgstr "Доступність: 3.4.0"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples"
+msgstr "Приклади"
+
+#. Tag: para
+#, no-c-format
+msgid "Using address_standardizer_data_us extension"
+msgstr "Використання розширення address_standardizer_data_us"
+
+#. Tag: para
+#, no-c-format
+msgid "Variant 1: Single line address and returning the input tokens"
+msgstr "Варіант 1: Адреса в одному рядку та повернення вхідних токенів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 2: Multi line address and returning first rule input mappings and "
+"score"
+msgstr ""
+"Варіант 2: Багаторядкова адреса та повернення перших правил введення та "
+"оцінок"
+
+#. Tag: title
+#, no-c-format
+msgid "See Also"
+msgstr "Див. також"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"rulestab\"/>, <xref linkend=\"lextab\"/>, <xref "
+"linkend=\"gaztab\"/>, <xref linkend=\"Pagc_Normalize_Address\"/>"
+msgstr ""
+", <xref linkend=\"rulestab\"/>, <xref linkend=\"lextab\"/>, <xref linkend="
+"\"gaztab\"/>, <xref linkend=\"Pagc_Normalize_Address\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Takes a 1 line address and breaks into parts"
+msgstr "Бере 1-рядкову адресу і розбиває на частини"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns takes an address as input, and returns a record output consisting of "
+"fields <emphasis>num</emphasis>, <emphasis>street</emphasis>, "
+"<emphasis>street2</emphasis>, <emphasis>address1</emphasis>, <emphasis>city</"
+"emphasis>, <emphasis>state</emphasis>, <emphasis>zip</emphasis>, "
+"<emphasis>zipplus</emphasis>, <emphasis>country</emphasis>."
+msgstr ""
+"Повертає адресу як вхідні дані та повертає запис, що складається з полів "
+"<emphasis>num</emphasis>, <emphasis>street</emphasis>, <emphasis>street2</"
+"emphasis>, <emphasis>address1</emphasis>, <emphasis>city</emphasis>, "
+"<emphasis>state</emphasis>, <emphasis>zip</emphasis>, <emphasis>zipplus</"
+"emphasis>, <emphasis>country</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.2.0"
+msgstr "Доступність: 2.2.0"
+
+#. Tag: para
+#, no-c-format
+msgid "Single Address"
+msgstr "Одинарна адреса"
+
+#. Tag: para
+#, no-c-format
+msgid "Table of addresses"
+msgstr "Таблиця адрес"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns an stdaddr form of an input address utilizing lex, gaz, and rule "
+"tables."
+msgstr ""
+"Повертає форму stdaddr вхідної адреси, використовуючи таблиці lex, gaz та "
+"rule."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an <xref linkend=\"stdaddr\"/> form of an input address utilizing "
+"<xref linkend=\"lextab\"/> table name, <xref linkend=\"gaztab\"/>, and <xref "
+"linkend=\"rulestab\"/> table names and an address."
+msgstr ""
+"Повертає <xref linkend=\"stdaddr\"/>форму вхідної адреси, використовуючи "
+"<xref linkend=\"lextab\"/>ім'я таблиці, <xref linkend=\"gaztab\"/>та <xref "
+"linkend=\"rulestab\"/>імена таблиць та адресу."
+
+#. Tag: para
+#, no-c-format
+msgid "Variant 1: Takes an address as a single line."
+msgstr "Варіант 1: Приймає адресу в одному рядку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 2: Takes an address as 2 parts. A <varname>micro</varname> "
+"consisting of standard first line of postal address e.g. <code>house_num "
+"street</code>, and a macro consisting of standard postal second line of an "
+"address e.g <code>city, state postal_code country</code>."
+msgstr ""
+"Варіант 2: Приймає адресу у вигляді 2 частин. A <varname>micro</varname>, що "
+"складається зі стандартного першого рядка поштової адреси, наприклад "
+"<code>house_num street</code>, та макросу, що складається зі стандартного "
+"другого рядка поштової адреси, наприклад <code>city, state postal_code "
+"country</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 1: Single line address. This doesn't work well with non-US addresses"
+msgstr "Варіант 1: Адреса в одному рядку. Це не працює з адресами за межами США"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using tables packaged with tiger geocoder. This example only works if you "
+"installed <varname>postgis_tiger_geocoder</varname>."
+msgstr ""
+"Використання таблиць, що входять до складу геокодера tiger. Цей приклад "
+"працює тільки в тому випадку, якщо ви встановили "
+"<varname>postgis_tiger_geocoder</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Make easier to read we'll dump output using hstore extension CREATE "
+"EXTENSION hstore; you need to install"
+msgstr ""
+"Щоб полегшити читання, ми будемо виводити дані за допомогою розширення "
+"hstore CREATE EXTENSION hstore; вам потрібно встановити"
+
+#. Tag: para
+#, no-c-format
+msgid "Variant 2: As a two part Address"
+msgstr "Варіант 2: Як адреса, що складається з двох частин"
+
+#. Tag: title
+#, no-c-format
+msgid "History Tracking"
+msgstr "Відстеження історії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Suppose you have a table of data that represents the current state of a "
+"particular geographic feature. A parcels table, or a roads table, or a fruit "
+"trees table, whatever. Generally, GIS tools understand a table as a single "
+"entity into which they can update, insert and delete rows from. How you do "
+"allow common GIS tools to work against your data, while maintaining an audit "
+"trail of what changes have been made, by whom, and what the past state of "
+"the data is?"
+msgstr ""
+"Припустимо, ви маєте таблицю даних, яка відображає поточний стан певного "
+"географічного об'єкта. Таблиця ділянок, таблиця доріг, таблиця фруктових "
+"дерев тощо. Зазвичай інструменти ГІС сприймають таблицю як єдиний об'єкт, в "
+"якому можна оновлювати, вставляти та видаляти рядки. Як дозволити звичайним "
+"інструментам ГІС працювати з вашими даними, зберігаючи при цьому журнал "
+"змін, які були внесені, хто їх вніс та який був попередній стан даних?"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This <varname>history_table</varname> extra module provides some utility "
+"functions for creating and maintaining history."
+msgstr ""
+"Цей додатковий модуль <varname>history_table</varname> надає деякі корисні "
+"функції для створення та ведення історії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>history_table</varname> was also packaged in PostGIS 1.5, but "
+"added to the documentation in PostGIS 2.0. This package is written in "
+"plpgsql and located in the <varname>extras/history_table</varname> of "
+"PostGIS source tar balls and source repository."
+msgstr ""
+"<varname>history_table</varname> також було включено до PostGIS 1.5, але "
+"додано до документації в PostGIS 2.0. Цей пакет написано мовою plpgsql і "
+"розміщено в <varname>extras/history_table</varname> архівів вихідного коду "
+"PostGIS та репозиторію вихідного коду."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you have a table 'roads', this module will maintain a 'roads_history' "
+"side table, which contains all the columns of the parent table, and the "
+"following additional columns:"
+msgstr ""
+"Якщо у вас є таблиця \"roads\", цей модуль буде вести додаткову таблицю "
+"\"roads_history\", яка містить усі стовпці батьківської таблиці та наступні "
+"додаткові стовпці:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When you insert a new record into 'roads' a record is automatically inserted "
+"into 'roads_history', with the 'date_added' filled in the 'date_deleted' set "
+"to NULL, a unique 'history_id', a 'last_operation' of 'INSERT' and "
+"'active_user' set."
+msgstr ""
+"Коли ви вставляєте новий запис у \"roads\", запис автоматично вставляється у "
+"\"roads_history\", з заповненим полем \"date_added\", полем \"date_deleted\", "
+"встановленим на NULL, унікальним \"history_id\", \"last_operation\" з \"INSERT\" "
+"та \"active_user\"."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When you delete a record in 'roads', the record in the history table is "
+"*not* deleted, but the 'date_deleted' is set to the current date."
+msgstr ""
+"Коли ви видаляєте запис у \"roads\", запис у таблиці історії *не* видаляється, "
+"але \"date_deleted\" встановлюється на поточну дату."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When you update a record in 'roads', the current record has 'date_deleted' "
+"filled in and a new record is created with the 'date_added' set and "
+"'date_deleted' NULL."
+msgstr ""
+"Коли ви оновлюєте запис у \"roads\", у поточному записі заповнюється поле "
+"\"date_deleted\" і створюється новий запис із полем \"date_added\" та полем "
+"\"date_deleted\" із значенням NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"With this information maintained, it is possible to retrieve the history of "
+"any record in the roads table:"
+msgstr ""
+"Зберігаючи цю інформацію, можна отримати історію будь-якого запису в таблиці "
+"roads:"
+
+#. Tag: para
+#, no-c-format
+msgid "Or, to retrieve a view of the roads table at any point in the past:"
+msgstr "Або, щоб отримати перегляд таблиці доріг в будь-який момент в минулому:"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a table that will hold some interesting values for managing history "
+"tables."
+msgstr ""
+"Створює таблицю, яка буде містити деякі цікаві значення для управління "
+"таблицями історії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a table that will hold some interesting values for managing history "
+"tables. Creates a table called <varname>historic_information</varname>"
+msgstr ""
+"Створює таблицю, яка буде містити деякі цікаві значення для управління "
+"таблицями історії. Створює таблицю з назвою "
+"<varname>historic_information</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5.0"
+msgstr "Доступність: 1.5.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Registers a table in the history_information table for tracking and also "
+"adds in side line history table and insert, update, delete rules on the "
+"table."
+msgstr ""
+"Реєструє таблицю в таблиці history_information для відстеження, а також "
+"додає в side line history таблицю та правила вставки, оновлення та видалення "
+"в таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Registers a table in the history_information table for tracking and also "
+"adds in side line history table with same name as table but prefixed with "
+"<varname>history</varname> in the same schema as the original table. Puts in "
+"insert, update, delete rules on the table. Any inserts,updates,deletes of "
+"the geometry are recorded in the history table."
+msgstr ""
+"Реєструє таблицю в таблиці history_information для відстеження, а також "
+"додає в side line history таблицю з тим самим іменем, що й таблиця, але з "
+"префіксом <varname>history</varname> в тій самій схемі, що й оригінальна "
+"таблиця. Встановлює правила вставки, оновлення та видалення для таблиці. "
+"Будь-які вставки, оновлення та видалення геометрії записуються в таблицю "
+"історії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function currently relies on a geometry column being registered in "
+"<varname>geometry_columns</varname> and fails if the geometry column is not "
+"present in <varname>geometry_columns</varname> table."
+msgstr ""
+"Ця функція наразі залежить від того, чи зареєстровано стовпець геометрії в "
+"<varname>geometry_columns</varname>, і не працює, якщо стовпець геометрії "
+"відсутній у таблиці <varname>geometry_columns</varname>."
+
+#. Tag: title
+#, no-c-format
+msgid "Tiger Geocoder"
+msgstr "Геокодер Tiger"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A plpgsql based geocoder written to work with the <link xlink:href=\"https://"
+"www2.census.gov/geo/tiger/\">TIGER (Topologically Integrated Geographic "
+"Encoding and Referencing system ) / Line and Master Address database export</"
+"link> released by the US Census Bureau."
+msgstr ""
+"Геокодер на основі plpgsql, написаний для роботи з <link "
+"xlink:href=\"https://www2.census.gov/geo/tiger/\">TIGER (Topologically "
+"Integrated Geographic Encoding and Referencing system ) / Line and Master "
+"Address database export</link>, випущеним Бюро перепису населення США."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are four components to the geocoder: the data loader functions, the "
+"address normalizer, the address geocoder, and the reverse geocoder."
+msgstr ""
+"Геокодер складається з чотирьох компонентів: функції завантаження даних, "
+"нормалізатор адрес, геокодер адрес та зворотний геокодер."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Although it is designed specifically for the US, a lot of the concepts and "
+"functions are applicable and can be adapted to work with other country "
+"address and road networks."
+msgstr ""
+"Хоча ця програма розроблена спеціально для США, багато її концепцій та "
+"функцій можна застосувати та адаптувати до адресних та дорожніх мереж інших "
+"країн."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The script builds a schema called <varname>tiger</varname> to house all the "
+"tiger related functions, reusable lookup data such as road type prefixes, "
+"suffixes, states, various control tables for managing data load, and "
+"skeleton base tables from which all the tiger loaded tables inherit from."
+msgstr ""
+"Скрипт створює схему під назвою <varname>tiger</varname> для розміщення всіх "
+"функцій, пов'язаних з тиграми, даних для багаторазового використання, таких "
+"як префікси типів доріг, суфікси, стани, різні таблиці управління для "
+"керування завантаженням даних, а також базові таблиці-скелети, від яких "
+"успадковуються всі завантажені таблиці тигрів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Another schema called <varname>tiger_data</varname> is also created which "
+"houses all the census data for each state that the loader downloads from "
+"Census site and loads into the database. In the current model, each set of "
+"state tables is prefixed with the state code e.g <varname>ma_addr</varname>, "
+"<varname>ma_edges</varname> etc with constraints to enforce only that state "
+"data. Each of these tables inherits from the tables <varname>addr</varname>, "
+"<varname>faces</varname>, <varname>edges</varname>, etc located in the "
+"<varname>tiger schema</varname>."
+msgstr ""
+"Також створюється інша схема під назвою <varname>tiger_data</varname>, яка "
+"містить усі дані перепису населення для кожного штату, які завантажувач "
+"завантажує з веб-сайту Census і завантажує в базу даних. У поточній моделі "
+"кожен набір таблиць штатів має префікс з кодом штату, наприклад "
+"<varname>ma_addr</varname>, <varname>ma_edges</varname> тощо, з обмеженнями, "
+"що застосовуються лише до даних цього штату. Кожна з цих таблиць успадковує "
+"таблиці <varname>addr</varname>, <varname>faces</varname>, <varname>edges</"
+"varname> тощо, розташовані в схемі <varname>tiger schema</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All the geocode functions only reference the base tables, so there is no "
+"requirement that the data schema be called <varname>tiger_data</varname> or "
+"that data can't be further partitioned into other schemas -- e.g a different "
+"schema for each state, as long as all the tables inherit from the tables in "
+"the <varname>tiger</varname> schema."
+msgstr ""
+"Усі функції геокодування посилаються лише на базові таблиці, тому немає "
+"вимоги, щоб схема даних називалася <varname>tiger_data</varname> або щоб "
+"дані не могли бути додатково розділені на інші схеми, наприклад, окрема "
+"схема для кожного штату, за умови, що всі таблиці успадковують таблиці зі "
+"схеми <varname>tiger</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For instructions on how to enable the extension in your database and also to "
+"load data using it, refer to <xref "
+"linkend=\"install_tiger_geocoder_extension\"/>."
+msgstr ""
+"Інструкції щодо увімкнення розширення у вашій базі даних, а також "
+"завантаження даних за його допомогою, див. <xref linkend="
+"\"install_tiger_geocoder_extension\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are using tiger geocoder (tiger_2010), you can upgrade the scripts "
+"using the accompanying upgrade_geocoder.bat / .sh scripts in extras/tiger. "
+"One major change between <varname>tiger_2010</varname> and "
+"<varname>tiger_2011+</varname> is that the <varname>county</varname> and "
+"<varname>state</varname> tables are no longer broken out by state. If you "
+"have data from tiger_2010 and want to replace with tiger_2015, refer to "
+"<xref linkend=\"upgrade_tiger_geocoder\"/>"
+msgstr ""
+"Якщо ви використовуєте геокодер tiger (tiger_2010), ви можете оновити "
+"скрипти за допомогою супровідних скриптів upgrade_geocoder.bat / .sh у папці "
+"extras/tiger. Одне з основних змін між <varname>tiger_2010</varname> та "
+"<varname>tiger_2011+</varname> полягає в тому, що таблиці <varname>county</"
+"varname> та <varname>state</varname> більше не розділені за штатами. Якщо у "
+"вас є дані з tiger_2010 і ви хочете замінити їх на tiger_2015, зверніться до "
+"<xref linkend=\"upgrade_tiger_geocoder\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"New in PostGIS 2.2.0 release is support for Tiger 2015 data and inclusion of "
+"Address Standardizer as part of PostGIS."
+msgstr ""
+"Нововведенням у версії PostGIS 2.2.0 є підтримка даних Tiger 2015 та "
+"включення стандартизатора адрес до складу PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"New in PostGIS 2.1.0 release is ability to install tiger geocoder with "
+"PostgreSQL extension model if you are running PostgreSQL 9.1+. Refer to "
+"<xref linkend=\"install_tiger_geocoder_extension\"/> for details."
+msgstr ""
+"Новою функцією у версії PostGIS 2.1.0 є можливість інсталяції геокодера "
+"tiger із розширенням PostgreSQL, якщо ви використовуєте PostgreSQL 9.1+. "
+"Детальнішу інформацію див. у <xref linkend=\"install_tiger_geocoder_extension"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <xref linkend=\"Pagc_Normalize_Address\"/> function as a drop in "
+"replacement for in-built <xref linkend=\"Normalize_Address\"/>. Refer to "
+"<xref linkend=\"installing_pagc_address_standardizer\"/> for compile and "
+"installation instructions."
+msgstr ""
+"Функція <xref linkend=\"Pagc_Normalize_Address\"/>замінює вбудовану функцію "
+"<xref linkend=\"Normalize_Address\"/>. Інструкції щодо компіляції та "
+"встановлення див. у <xref linkend=\"installing_pagc_address_standardizer\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Design:"
+msgstr "Дизайн:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The goal of this project is to build a fully functional geocoder that can "
+"process an arbitrary United States address string and using normalized TIGER "
+"census data, produce a point geometry and rating reflecting the location of "
+"the given address and likeliness of the location. The higher the rating "
+"number the worse the result."
+msgstr ""
+"Метою цього проекту є створення повністю функціонального геокодера, який "
+"може обробляти довільний рядок адреси в США і, використовуючи нормалізовані "
+"дані перепису TIGER, створювати геометрію точки та оцінку, що відображає "
+"місцезнаходження заданої адреси та ймовірність її розташування. Чим вищий "
+"рейтинг, тим гірший результат."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>reverse_geocode</varname> function, introduced in PostGIS 2.0.0 "
+"is useful for deriving the street address and cross streets of a GPS "
+"location."
+msgstr ""
+"Функція <varname>reverse_geocode</varname>, введена в PostGIS 2.0.0, корисна "
+"для отримання адреси вулиці та перехресних вулиць з GPS-координат."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geocoder should be simple for anyone familiar with PostGIS to install "
+"and use, and should be easily installable and usable on all platforms "
+"supported by PostGIS."
+msgstr ""
+"Геокодер повинен бути простим для встановлення та використання будь-яким "
+"користувачем, знайомим з PostGIS, а також легко встановлюватися та працювати "
+"на всіх платформах, що підтримуються PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It should be robust enough to function properly despite formatting and "
+"spelling errors."
+msgstr ""
+"Він повинен бути достатньо надійним, щоб працювати належним чином, "
+"незважаючи на помилки форматування та орфографії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It should be extensible enough to be used with future data updates, or "
+"alternate data sources with a minimum of coding changes."
+msgstr ""
+"Він повинен бути достатньо розширюваним, щоб його можна було використовувати "
+"з майбутніми оновленнями даних або альтернативними джерелами даних з "
+"мінімальними змінами в коді."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>tiger</varname> schema must be added to the database search "
+"path for the functions to work properly."
+msgstr ""
+"Щоб функції працювали належним чином, схема <varname>tiger</varname> повинна "
+"бути додана до шляху пошуку бази даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are a couple other open source geocoders for PostGIS, that unlike "
+"tiger geocoder have the advantage of multi-country geocoding support"
+msgstr ""
+"Існує ще кілька відкритих геокодерів для PostGIS, які, на відміну від tiger "
+"geocoder, мають перевагу у вигляді підтримки геокодування для різних країн"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://wiki.openstreetmap.org/wiki/Nominatim\">Nominatim</"
+"link> uses OpenStreetMap gazeteer formatted data. It requires osm2pgsql for "
+"loading the data, PostgreSQL 8.4+ and PostGIS 1.5+ to function. It is "
+"packaged as a webservice interface and seems designed to be called as a "
+"webservice. Just like the tiger geocoder, it has both a geocoder and a "
+"reverse geocoder component. From the documentation, it is unclear if it has "
+"a pure SQL interface like the tiger geocoder, or if a good deal of the logic "
+"is implemented in the web interface."
+msgstr ""
+"<link xlink:href=\"http://wiki.openstreetmap.org/wiki/Nominatim\">Nominatim</"
+"link> використовує дані у форматі OpenStreetMap gazeteer. Для завантаження "
+"даних необхідні osm2pgsql, PostgreSQL 8.4+ та PostGIS 1.5+. Програма "
+"упакована як веб-інтерфейс і, судячи з усього, призначена для виклику як веб-"
+"сервіс. Так само, як і геокодер tiger, він має компоненти геокодера та "
+"зворотного геокодера. З документації не зрозуміло, чи має він чистий "
+"інтерфейс SQL, як геокодер tiger, чи значна частина логіки реалізована у "
+"веб-інтерфейсі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.gisgraphy.com/\">GIS Graphy</link> also "
+"utilizes PostGIS and like Nominatim works with OpenStreetMap (OSM) data. It "
+"comes with a loader to load OSM data and similar to Nominatim is capable of "
+"geocoding not just US. Much like Nominatim, it runs as a webservice and "
+"relies on Java 1.5, Servlet apps, Solr. GisGraphy is cross-platform and also "
+"has a reverse geocoder among some other neat features."
+msgstr ""
+"<link xlink:href=\"http://www.gisgraphy.com/\">GIS Graphy</link> також "
+"використовує PostGIS і, як і Nominatim, працює з даними OpenStreetMap (OSM). "
+"Він постачається з завантажувачем для завантаження даних OSM і, подібно до "
+"Nominatim, здатний геокодувати не тільки США. Подібно до Nominatim, він "
+"працює як веб-сервіс і використовує Java 1.5, додатки Servlet, Solr. "
+"GisGraphy є кросплатформовим і має, серед інших корисних функцій, зворотний "
+"геокодер."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Generates a script that drops all non-primary key and non-unique "
+"indexes on tiger schema and user specified schema. Defaults schema to "
+"<varname>tiger_data</varname> if no schema is specified.</refpurpose>"
+msgstr ""
+"<refpurpose>Створює скрипт, який видаляє всі не первинні ключі та не "
+"унікальні індекси зі схеми tiger та схеми, вказаної користувачем. Якщо схема "
+"не вказана, за замовчуванням використовується схема "
+"<varname>tiger_data</varname>.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Generates a script that drops all non-primary key and non-unique "
+"indexes on tiger schema and user specified schema. Defaults schema to "
+"<varname>tiger_data</varname> if no schema is specified.</para>"
+msgstr ""
+"<para>Створює скрипт, який видаляє всі не первинні ключі та не унікальні "
+"індекси у схемі tiger та схемі, вказаній користувачем. Якщо схема не "
+"вказана, за замовчуванням використовується схема "
+"<varname>tiger_data</varname></para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is useful for minimizing index bloat that may confuse the query planner "
+"or take up unnecessary space. Use in combination with <xref "
+"linkend=\"Install_Missing_Indexes\"/> to add just the indexes used by the "
+"geocoder."
+msgstr ""
+"Це корисно для мінімізації роздуття індексу, яке може заплутати планувальник "
+"запитів або зайняти зайвий простір. Використовуйте разом з <xref linkend="
+"\"Install_Missing_Indexes\"/>, щоб додати тільки індекси, які "
+"використовуються геокодером."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0"
+msgstr "Доступність: 2.0.0"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Missing_Indexes_Generate_Script\"/>"
+msgstr ", <xref linkend=\"Missing_Indexes_Generate_Script\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Generates a script that drops all tables in the specified schema that start "
+"with <varname>county_all</varname>, <varname>state_all</varname> or state "
+"code followed by <varname>county</varname> or <varname>state</varname>."
+msgstr ""
+"Створює скрипт, який видаляє всі таблиці у вказаній схемі, що починаються з "
+"<varname>county_all</varname>, <varname>state_all</varname> або коду штату, "
+"за яким слідує <varname>county</varname> або <varname>state</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates a script that drops all tables in the specified schema that start "
+"with <varname>county_all</varname>, <varname>state_all</varname> or state "
+"code followed by <varname>county</varname> or <varname>state</varname>. This "
+"is needed if you are upgrading from <varname>tiger_2010</varname> to "
+"<varname>tiger_2011</varname> data."
+msgstr ""
+"Створює скрипт, який видаляє всі таблиці у вказаній схемі, що починаються з "
+"<varname>county_all</varname>, <varname>state_all</varname> або коду штату, "
+"за яким слідує <varname>county</varname> або <varname>state</varname>. Це "
+"потрібно, якщо ви оновлюєте дані з <varname>tiger_2010</varname> до "
+"<varname>tiger_2011</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.1.0"
+msgstr "Доступність: 2.1.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Generates a script that drops all tables in the specified schema that are "
+"prefixed with the state abbreviation. Defaults schema to "
+"<varname>tiger_data</varname> if no schema is specified."
+msgstr ""
+"Створює скрипт, який видаляє всі таблиці у вказаній схемі, що мають префікс "
+"у вигляді абревіатури стану. Якщо схема не вказана, за замовчуванням "
+"використовується схема <varname>tiger_data</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates a script that drops all tables in the specified schema that are "
+"prefixed with the state abbreviation. Defaults schema to "
+"<varname>tiger_data</varname> if no schema is specified. This function is "
+"useful for dropping tables of a state just before you reload a state in case "
+"something went wrong during your previous load."
+msgstr ""
+"Створює скрипт, який видаляє всі таблиці у вказаній схемі, що мають префікс "
+"з абревіатурою стану. Якщо схема не вказана, за замовчуванням "
+"використовується схема <varname>tiger_data</varname>. Ця функція корисна для "
+"видалення таблиць стану безпосередньо перед перезавантаженням стану на "
+"випадок, якщо під час попереднього завантаження сталася помилка."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes in an address as a string (or other normalized address) and outputs a "
+"set of possible locations which include a point geometry in NAD 83 long lat, "
+"a normalized address for each, and the rating. The lower the rating the more "
+"likely the match. Results are sorted by lowest rating first. Can optionally "
+"pass in maximum results, defaults to 10, and restrict_region (defaults to "
+"NULL)"
+msgstr ""
+"Приймає адресу у вигляді рядка (або іншої нормалізованої адреси) і виводить "
+"набір можливих місць, що включають геометрію точки в NAD 83 long lat, "
+"нормалізовану адресу для кожного з них та рейтинг. Чим нижчий рейтинг, тим "
+"більша ймовірність збігу. Результати сортуються за найнижчим рейтингом. "
+"Можна додатково передати максимальну кількість результатів (за замовчуванням "
+"10) та обмежити регіон (за замовчуванням NULL)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes in an address as a string (or already normalized address) and outputs "
+"a set of possible locations which include a point geometry in NAD 83 long "
+"lat, a <varname>normalized_address</varname> (addy) for each, and the "
+"rating. The lower the rating the more likely the match. Results are sorted "
+"by lowest rating first. Uses Tiger data (edges,faces,addr), PostgreSQL fuzzy "
+"string matching (soundex,levenshtein) and PostGIS line interpolation "
+"functions to interpolate address along the Tiger edges. The higher the "
+"rating the less likely the geocode is right. The geocoded point is defaulted "
+"to offset 10 meters from center-line off to side (L/R) of street address is "
+"located on."
+msgstr ""
+"Приймає адресу у вигляді рядка (або вже нормалізовану адресу) і виводить "
+"набір можливих місць, що включають геометрію точки в NAD 83 long lat, "
+"<varname>normalized_address</varname> (addy) для кожного з них та рейтинг. "
+"Чим нижчий рейтинг, тим більша ймовірність збігу. Результати сортуються за "
+"найнижчим рейтингом. Використовує дані Tiger (краї, грані, адреси), нечітке "
+"зіставлення рядків PostgreSQL (soundex, levenshtein) та функції інтерполяції "
+"ліній PostGIS для інтерполяції адреси вздовж країв Tiger. Чим вищий рейтинг, "
+"тим менша ймовірність правильності геокоду. Геокодована точка за "
+"замовчуванням зміщена на 10 метрів від центральної лінії в бік (L/R) від "
+"адреси вулиці, на якій вона розташована."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 to support Tiger 2010 structured data and revised some logic "
+"to improve speed, accuracy of geocoding, and to offset point from centerline "
+"to side of street address is located on. The new parameter "
+"<varname>max_results</varname> useful for specifying number of best results "
+"or just returning the best result."
+msgstr ""
+"Покращено: 2.0.0 для підтримки структурованих даних Tiger 2010 та "
+"переглянуто деякі логічні алгоритми для підвищення швидкості, точності "
+"геокодування та зміщення точки від центральної лінії до сторони вулиці, на "
+"якій розташована адреса. Новий параметр <varname>max_results</varname> "
+"корисний для вказання кількості найкращих результатів або для повернення "
+"лише найкращого результату."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Basic"
+msgstr "Приклади: Базові"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The below examples timings are on a 3.0 GHZ single processor Windows 7 "
+"machine with 2GB ram running PostgreSQL 9.1rc1/PostGIS 2.0 loaded with all "
+"of MA,MN,CA, RI state Tiger data loaded."
+msgstr ""
+"Наведені нижче приклади часу виконання були отримані на однопроцесорному "
+"комп'ютері з частотою 3,0 ГГц, операційною системою Windows 7, 2 ГБ "
+"оперативної пам'яті та встановленим програмним забезпеченням PostgreSQL 9."
+"1rc1/PostGIS 2.0, завантаженим усіма даними про штати Массачусетс, "
+"Міннесота, Каліфорнія та Род-Айленд, отриманими з Tiger."
+
+#. Tag: para
+#, no-c-format
+msgid "Exact matches are faster to compute (61ms)"
+msgstr "Точні збіги обчислюються швидше (61 мс)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Even if zip is not passed in the geocoder can guess (took about 122-150 ms)"
+msgstr ""
+"Навіть якщо zip-код не передається, геокодер може вгадати (займає близько "
+"122-150 мс)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Can handle misspellings and provides more than one possible solution with "
+"ratings and takes longer (500ms)."
+msgstr ""
+"Може обробляти орфографічні помилки та надає кілька можливих рішень з "
+"оцінками, але працює довше (500 мс)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using to do a batch geocode of addresses. Easiest is to set "
+"<varname>max_results=1</varname>. Only process those not yet geocoded (have "
+"no rating)."
+msgstr ""
+"Використовується для пакетного геокодування адрес. Найпростіше встановити "
+"<varname>max_results=1</varname>. Обробляються тільки ті, що ще не "
+"геокодовані (не мають рейтингу)."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Using Geometry filter"
+msgstr "Приклади: Використання фільтра \"Geometry\""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"Pprint_Addy\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_SnapToGrid\"/>, <xref linkend=\"ST_X\"/>, <xref "
+"linkend=\"ST_Y\"/>"
+msgstr ""
+", <xref linkend=\"Pprint_Addy\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_SnapToGrid\"/>, <xref linkend=\"ST_X\"/>, <xref linkend=\"ST_Y\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes in 2 streets that intersect and a state, city, zip, and outputs a set "
+"of possible locations on the first cross street that is at the intersection, "
+"also includes a geomout as the point location in NAD 83 long lat, a "
+"<varname>normalized_address</varname> (addy) for each location, and the "
+"rating. The lower the rating the more likely the match. Results are sorted "
+"by lowest rating first. Can optionally pass in maximum results, defaults to "
+"10. Uses Tiger data (edges, faces, addr), PostgreSQL fuzzy string matching "
+"(soundex, levenshtein)."
+msgstr ""
+"Приймає 2 перехресні вулиці, штат, місто, поштовий індекс і видає набір "
+"можливих місць на першій перехресній вулиці, що знаходиться на перехресті, а "
+"також включає геокоординати як точку розташування в NAD 83 long lat, "
+"<varname>normalized_address</varname> (адреса) для кожного місця та рейтинг. "
+"Чим нижчий рейтинг, тим більша ймовірність збігу. Результати сортуються за "
+"найнижчим рейтингом. Можна вказати максимальну кількість результатів, за "
+"замовчуванням — 10. Використовує дані Tiger (краї, грані, адреси), нечітке "
+"зіставлення рядків PostgreSQL (soundex, levenshtein)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes in 2 streets that intersect and a state, city, zip, and outputs a set "
+"of possible locations on the first cross street that is at the intersection, "
+"also includes a point geometry in NAD 83 long lat, a normalized address for "
+"each location, and the rating. The lower the rating the more likely the "
+"match. Results are sorted by lowest rating first. Can optionally pass in "
+"maximum results, defaults to 10. Returns <varname>normalized_address</"
+"varname> (addy) for each, geomout as the point location in nad 83 long lat, "
+"and the rating. The lower the rating the more likely the match. Results are "
+"sorted by lowest rating first. Uses Tiger data (edges,faces,addr), "
+"PostgreSQL fuzzy string matching (soundex,levenshtein)"
+msgstr ""
+"Приймає 2 перехресні вулиці, штат, місто, поштовий індекс і виводить набір "
+"можливих місць на першій перехресній вулиці, що знаходиться на перехресті, а "
+"також включає геометрію точки в NAD 83 long lat, нормалізовану адресу для "
+"кожного місця та рейтинг. Чим нижчий рейтинг, тим більша ймовірність збігу. "
+"Результати сортуються за найнижчим рейтингом. Можна опціонально передати "
+"максимальну кількість результатів, за замовчуванням 10. Повертає "
+"<varname>normalized_address</varname> (addy) для кожного, geomout як точку "
+"розташування в NAD 83 long lat та рейтинг. Чим нижчий рейтинг, тим більша "
+"ймовірність збігу. Результати сортуються за найнижчим рейтингом. "
+"Використовує дані Tiger (краї, грані, адреси), нечітке зіставлення рядків "
+"PostgreSQL (soundex, levenshtein)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The below examples timings are on a 3.0 GHZ single processor Windows 7 "
+"machine with 2GB ram running PostgreSQL 9.0/PostGIS 1.5 loaded with all of "
+"MA state Tiger data loaded. Currently a bit slow (3000 ms)"
+msgstr ""
+"Наведені нижче приклади часу виконання отримані на однопроцесорному "
+"комп'ютері з частотою 3,0 ГГц, ОС Windows 7, 2 ГБ оперативної пам'яті, "
+"PostgreSQL 9.0/PostGIS 1.5 та всіма даними про тигрів штату Массачусетс. "
+"Наразі трохи повільно (3000 мс)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Testing on Windows 2003 64-bit 8GB on PostGIS 2.0 PostgreSQL 64-bit Tiger "
+"2011 data loaded -- (41ms)"
+msgstr ""
+"Тестування на Windows 2003 64-біт 8 ГБ на PostGIS 2.0 PostgreSQL 64-біт "
+"Tiger 2011 дані завантажено -- (41 мс)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Even if zip is not passed in the geocoder can guess (took about 3500 ms on "
+"the windows 7 box), on the windows 2003 64-bit 741 ms"
+msgstr ""
+"Навіть якщо zip не передається, геокодер може вгадати (на комп'ютері з "
+"Windows 7 це зайняло близько 3500 мс), на Windows 2003 64-біт — 741 мс"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Pprint_Addy\"/>, <xref linkend=\"ST_AsText\"/>"
+msgstr ", <xref linkend=\"Pprint_Addy\"/>, <xref linkend=\"ST_AsText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns value of specific setting stored in tiger.geocode_settings table."
+msgstr ""
+"Повертає значення конкретного параметра, збереженого в таблиці tiger."
+"geocode_settings."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns value of specific setting stored in tiger.geocode_settings table. "
+"Settings allow you to toggle debugging of functions. Later plans will be to "
+"control rating with settings. Current list of settings are as follows:"
+msgstr ""
+"Повертає значення конкретного параметра, збереженого в таблиці "
+"tiger.geocode_settings. Параметри дозволяють вмикати та вимикати "
+"налагодження функцій. У майбутньому планується контролювати рейтинг за "
+"допомогою параметрів. Поточний список параметрів такий:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 : default settings are now kept in a table called "
+"geocode_settings_default. Use customized settingsa are in geocode_settings "
+"and only contain those that have been set by user."
+msgstr ""
+"Змінено: 2.2.0: стандартні налаштування тепер зберігаються в таблиці під "
+"назвою geocode_settings_default. Налаштування, що були змінені користувачем, "
+"зберігаються в geocode_settings і містять лише ті налаштування, які були "
+"встановлені користувачем."
+
+#. Tag: title
+#, fuzzy, no-c-format
+msgid "Example return debugging setting"
+msgstr "Приклад повернення параметрів налагодження"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns census tract or field from tract table of where the geometry is "
+"located. Default to returning short name of tract."
+msgstr ""
+"Повертає переписний район або поле з таблиці районів, де розташована "
+"геометрія. За замовчуванням повертається коротка назва району."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given a geometry will return the census tract location of that geometry. NAD "
+"83 long lat is assumed if no spatial ref sys is specified."
+msgstr ""
+"За заданою геометрією поверне місце розташування переписної ділянки цієї "
+"геометрії. Якщо просторова система координат не вказана, використовується "
+"NAD 83 (довгота, широта)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function uses the census <varname>tract</varname> which is not loaded "
+"by default. If you have already loaded your state table, you can load tract "
+"as well as bg, and tabblock using the <xref "
+"linkend=\"Loader_Generate_Census_Script\"/> script."
+msgstr ""
+"Ця функція використовує перепис <varname>tract</varname>, який за "
+"замовчуванням не завантажується. Якщо ви вже завантажили таблицю штатів, ви "
+"можете завантажити tract, а також bg і tabblock за допомогою скрипту <xref "
+"linkend=\"Loader_Generate_Census_Script\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you have not loaded your state data yet and want these additional tables "
+"loaded, do the following"
+msgstr ""
+"Якщо ви ще не завантажили дані про свій штат і хочете завантажити ці "
+"додаткові таблиці, виконайте наступні дії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"then they will be included by the <xref linkend=\"Loader_Generate_Script\"/>."
+msgstr ""
+"тоді вони будуть включені за допомогою <xref linkend=\"Loader_Generate_Script"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ">"
+msgstr ">"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Finds all tables with key columns used in geocoder joins and filter "
+"conditions that are missing used indexes on those columns and will add them."
+msgstr ""
+"Знаходить усі таблиці з ключовими стовпцями, що використовуються в "
+"з'єднаннях геокодера та умовах фільтрації, в яких відсутні використовувані "
+"індекси для цих стовпців, і додає їх."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Finds all tables in <varname>tiger</varname> and <varname>tiger_data</"
+"varname> schemas with key columns used in geocoder joins and filters that "
+"are missing indexes on those columns and will output the SQL DDL to define "
+"the index for those tables and then execute the generated script. This is a "
+"helper function that adds new indexes needed to make queries faster that may "
+"have been missing during the load process. This function is a companion to "
+"<xref linkend=\"Missing_Indexes_Generate_Script\"/> that in addition to "
+"generating the create index script, also executes it. It is called as part "
+"of the <filename>update_geocode.sql</filename> upgrade script."
+msgstr ""
+"Знаходить усі таблиці в схемах <varname>tiger</varname> та "
+"<varname>tiger_data</varname> із ключовими стовпцями, що використовуються в "
+"з'єднаннях та фільтрах геокодера, для яких відсутні індекси в цих стовпцях, "
+"і виводить SQL DDL для визначення індексу для цих таблиць, а потім виконує "
+"згенерований скрипт. Це допоміжна функція, яка додає нові індекси, необхідні "
+"для пришвидшення запитів, які могли бути відсутні під час процесу "
+"завантаження. Ця функція є доповненням до <xref linkend="
+"\"Missing_Indexes_Generate_Script\"/>, яка, крім створення скрипту для "
+"створення індексу, також виконує його. Вона викликається як частина скрипту "
+"оновлення <filename>update_geocode.sql</filename>."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Generates a shell script for the specified platform for the specified states "
+"that will download Tiger census state tract, bg, and tabblocks data tables, "
+"stage and load into <varname>tiger_data</varname> schema. Each state script "
+"is returned as a separate record."
+msgstr ""
+"Створює скрипт оболонки для вказаної платформи для вказаних штатів, який "
+"завантажить таблиці даних Tiger census state tract, bg та tabblocks, "
+"підготує та завантажить їх у схему <varname>tiger_data</varname>. Кожен "
+"скрипт штату повертається як окремий запис."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates a shell script for the specified platform for the specified states "
+"that will download Tiger data census state <varname>tract</varname>, block "
+"groups <varname>bg</varname>, and <varname>tabblocks</varname> data tables, "
+"stage and load into <varname>tiger_data</varname> schema. Each state script "
+"is returned as a separate record."
+msgstr ""
+"Створює скрипт оболонки для вказаної платформи для вказаних станів, який "
+"завантажить дані перепису Tiger <varname>tract</varname>, групи блоків "
+"<varname>bg</varname> та таблиці даних <varname>tabblocks</varname>, "
+"розмістить їх у схемі <varname>tiger_data</varname> та завантажить. Кожен "
+"скрипт стану повертається як окремий запис."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It uses unzip on Linux (7-zip on Windows by default) and wget to do the "
+"downloading. It uses <xref linkend=\"shp2pgsql_usage\"/> to load in the "
+"data. Note the smallest unit it does is a whole state. It will only process "
+"the files in the staging and temp folders."
+msgstr ""
+"Для завантаження використовується програма unzip в Linux (7-zip в Windows за "
+"замовчуванням) та wget. Для завантаження даних використовується <xref "
+"linkend=\"shp2pgsql_usage\"/>. Зверніть увагу, що найменша одиниця, яку "
+"обробляє програма, — це цілий штат. Програма обробляє лише файли в папках "
+"staging та temp."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It uses the following control tables to control the process and different OS "
+"shell syntax variations."
+msgstr ""
+"Для управління процесом і різними варіантами синтаксису оболонки ОС "
+"використовуються наступні таблиці управління."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>loader_variables</varname> keeps track of various variables such as "
+"census site, year, data and staging schemas"
+msgstr ""
+"<varname>loader_variables</varname> відстежує різні змінні, такі як місце "
+"перепису, рік, дані та схеми підготовки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>loader_platform</varname> profiles of various platforms and where "
+"the various executables are located. Comes with windows and linux. More can "
+"be added."
+msgstr ""
+"<varname>loader_platform</varname> профілі різних платформ і розташування "
+"різних виконуваних файлів. Поставляється з Windows і Linux. Можна додати "
+"інші."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>loader_lookuptables</varname> each record defines a kind of table "
+"(state, county), whether to process records in it and how to load them in. "
+"Defines the steps to import data, stage data, add, removes columns, indexes, "
+"and constraints for each. Each table is prefixed with the state and inherits "
+"from a table in the tiger schema. e.g. creates <varname>tiger_data.ma_faces</"
+"varname> which inherits from <varname>tiger.faces</varname>"
+msgstr ""
+"<varname>loader_lookuptables</varname> кожен запис визначає тип таблиці ("
+"штат, округ), чи обробляти записи в ній і як їх завантажувати. Визначає "
+"кроки для імпорту даних, підготовки даних, додавання, видалення стовпців, "
+"індексів та обмежень для кожного з них. Кожна таблиця має префікс із "
+"зазначенням стану та успадковує таблицю зі схеми tiger. Наприклад, "
+"створюється <varname>tiger_data.ma_faces</varname>, яка успадковує "
+"<varname>tiger.faces</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"includes this logic, but if you installed tiger geocoder prior to PostGIS "
+"2.0.0 alpha5, you'll need to run this on the states you have already done to "
+"get these additional tables."
+msgstr ""
+"включає цю логіку, але якщо ви встановили tiger geocoder до PostGIS 2.0.0 "
+"alpha5, вам потрібно буде запустити це на штатах, які ви вже обробили, щоб "
+"отримати ці додаткові таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generate script to load up data for select states in Windows shell script "
+"format."
+msgstr ""
+"Створити скрипт для завантаження даних для вибраних штатів у форматі скрипту "
+"оболонки Windows."
+
+#. Tag: para
+#, no-c-format
+msgid "Generate sh script"
+msgstr "Створити скрипт sh"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Generates a shell script for the specified platform for the specified states "
+"that will download Tiger data, stage and load into <varname>tiger_data</"
+"varname> schema. Each state script is returned as a separate record. Latest "
+"version supports Tiger 2010 structural changes and also loads census tract, "
+"block groups, and blocks tables."
+msgstr ""
+"Створює скрипт оболонки для вказаної платформи для вказаних станів, який "
+"завантажить дані Tiger, підготує та завантажить у схему <varname>tiger_data</"
+"varname>. Кожен скрипт стану повертається як окремий запис. Остання версія "
+"підтримує структурні зміни Tiger 2010, а також завантажує таблиці перепису, "
+"групи блоків та блоки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates a shell script for the specified platform for the specified states "
+"that will download Tiger data, stage and load into <varname>tiger_data</"
+"varname> schema. Each state script is returned as a separate record."
+msgstr ""
+"Створює скрипт оболонки для вказаної платформи для вказаних станів, який "
+"завантажить дані Tiger, підготує та завантажить у схему <varname>tiger_data</"
+"varname>. Кожен скрипт стану повертається як окремий запис."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It uses unzip on Linux (7-zip on Windows by default) and wget to do the "
+"downloading. It uses <xref linkend=\"shp2pgsql_usage\"/> to load in the "
+"data. Note the smallest unit it does is a whole state, but you can overwrite "
+"this by downloading the files yourself. It will only process the files in "
+"the staging and temp folders."
+msgstr ""
+"Для завантаження використовується програма unzip в Linux (7-zip в Windows за "
+"замовчуванням) та wget. Для завантаження даних використовується <xref "
+"linkend=\"shp2pgsql_usage\"/>. Зверніть увагу, що найменша одиниця, яку "
+"обробляє програма, — це весь штат, але ви можете замінити це, завантаживши "
+"файли самостійно. Програма обробляє лише файли в папках staging та temp."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 2.0.0 to support Tiger 2010 structured data and load census "
+"tract (tract), block groups (bg), and blocks (tabblocks) tables ."
+msgstr ""
+"Доступність: 2.0.0 для підтримки структурованих даних Tiger 2010 та "
+"завантаження таблиць перепису населення (tract), груп кварталів (bg) та "
+"кварталів (tabblocks)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are using pgAdmin 3, be warned that by default pgAdmin 3 truncates "
+"long text. To fix, change <emphasis>File -> Options -> Query Tool -"
+"> Query Editor - > Max. characters per column</emphasis> to larger "
+"than 50000 characters."
+msgstr ""
+"Якщо ви використовуєте pgAdmin 3, майте на увазі, що за замовчуванням "
+"pgAdmin 3 обрізає довгий текст. Щоб виправити це, змініть <emphasis>Файл "
+"-> Параметри -> Інструмент запитів -> Редактор запитів - >Макс. "
+"кількість символів у стовпці</emphasis> на значення, більше 50000 символів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using psql where gistest is your database and <filename>/gisdata/data_load."
+"sh</filename> is the file to create with the shell commands to run."
+msgstr ""
+"Використовуючи psql, де gistest — ваша база даних, а <filename>/gisdata/"
+"data_load.sh</filename> — файл, який потрібно створити за допомогою команд "
+"оболонки, що виконуються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generate script to load up data for 2 states in Windows shell script format."
+msgstr ""
+"Створити скрипт для завантаження даних для 2 штатів у форматі скрипту "
+"оболонки Windows."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"Loader_Generate_Nation_Script\"/>, <xref "
+"linkend=\"Drop_State_Tables_Generate_Script\"/>"
+msgstr ""
+", <xref linkend=\"Loader_Generate_Nation_Script\"/>, <xref linkend="
+"\"Drop_State_Tables_Generate_Script\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Generates a shell script for the specified platform that loads in the county "
+"and state lookup tables."
+msgstr ""
+"Створює скрипт оболонки для вказаної платформи, який завантажує таблиці "
+"пошуку округів та штатів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates a shell script for the specified platform that loads in the "
+"<varname>county_all</varname>, <varname>county_all_lookup</varname>, "
+"<varname>state_all</varname> tables into <varname>tiger_data</varname> "
+"schema. These inherit respectively from the <varname>county</varname>, "
+"<varname>county_lookup</varname>, <varname>state</varname> tables in "
+"<varname>tiger</varname> schema."
+msgstr ""
+"Створює скрипт оболонки для вказаної платформи, який завантажує таблиці "
+"<varname>county_all</varname>, <varname>county_all_lookup</varname>, "
+"<varname>state_all</varname> у схему <varname>tiger_data</varname>. Вони "
+"успадковуються відповідно від таблиць <varname>county</varname>, "
+"<varname>county_lookup</varname>, <varname>state</varname> у схемі "
+"<varname>tiger</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It uses unzip on Linux (7-zip on Windows by default) and wget to do the "
+"downloading. It uses <xref linkend=\"shp2pgsql_usage\"/> to load in the data."
+msgstr ""
+"Для завантаження використовується програма unzip в Linux (7-zip в Windows за "
+"замовчуванням) та wget. Для завантаження даних використовується <xref "
+"linkend=\"shp2pgsql_usage\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It uses the following control tables <varname>tiger.loader_platform</"
+"varname>, <varname>tiger.loader_variables</varname>, and <varname>tiger."
+"loader_lookuptables</varname> to control the process and different OS shell "
+"syntax variations."
+msgstr ""
+"Він використовує наступні таблиці керування <varname>tiger.loader_platform</"
+"varname>, <varname>tiger.loader_variables</varname> та <varname>tiger."
+"loader_lookuptables</varname> для керування процесом та різними варіаціями "
+"синтаксису оболонки ОС."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>loader_platform</varname> profiles of various platforms and where "
+"the various executables are located. Comes with windows and linux/unix. More "
+"can be added."
+msgstr ""
+"<varname>loader_platform</varname> профілі різних платформ та розташування "
+"різних виконуваних файлів. Поставляється з Windows та Linux/Unix. Можна "
+"додати більше."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.4.1 zip code 5 tabulation area (zcta5) load step was fixed and "
+"when enabled, zcta5 data is loaded as a single table called zcta5_all as "
+"part of the nation script load."
+msgstr ""
+"Покращено: 2.4.1 виправлено завантаження кроку табуляції поштового індексу 5 "
+"(zcta5) і, коли ця опція увімкнена, дані zcta5 завантажуються як одна "
+"таблиця під назвою zcta5_all у складі завантаження скрипту країни."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you want zip code 5 tabulation area (zcta5) to be included in your nation "
+"script load, do the following:"
+msgstr ""
+"Якщо ви хочете, щоб область табуляції поштового індексу 5 (zcta5) була "
+"включена в завантаження скрипту вашої країни, виконайте наступні дії:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you were running <varname>tiger_2010</varname> version and you want to "
+"reload as state with newer tiger data, you'll need to for the very first "
+"load generate and run drop statements <xref "
+"linkend=\"Drop_Nation_Tables_Generate_Script\"/> before you run this script."
+msgstr ""
+"Якщо ви використовували версію <varname>tiger_2010</varname> і хочете "
+"перезавантажити стан з новими даними tiger, перед запуском цього скрипта вам "
+"потрібно буде створити та виконати команди drop <xref linkend="
+"\"Drop_Nation_Tables_Generate_Script\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Generate script script to load nation data Windows."
+msgstr "Створити скрипт для завантаження національних даних Windows."
+
+#. Tag: para
+#, no-c-format
+msgid "Generate script to load up data for Linux/Unix systems."
+msgstr "Створити скрипт для завантаження даних для систем Linux/Unix."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Drop_Nation_Tables_Generate_Script\"/>"
+msgstr ", <xref linkend=\"Drop_Nation_Tables_Generate_Script\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Finds all tables with key columns used in geocoder joins that are missing "
+"indexes on those columns and will output the SQL DDL to define the index for "
+"those tables."
+msgstr ""
+"Знаходить усі таблиці з ключовими стовпцями, що використовуються в "
+"з'єднаннях геокодера, в яких відсутні індекси для цих стовпців, і виводить "
+"SQL DDL для визначення індексу для цих таблиць."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Finds all tables in <varname>tiger</varname> and <varname>tiger_data</"
+"varname> schemas with key columns used in geocoder joins that are missing "
+"indexes on those columns and will output the SQL DDL to define the index for "
+"those tables. This is a helper function that adds new indexes needed to make "
+"queries faster that may have been missing during the load process. As the "
+"geocoder is improved, this function will be updated to accommodate new "
+"indexes being used. If this function outputs nothing, it means all your "
+"tables have what we think are the key indexes already in place."
+msgstr ""
+"Знаходить усі таблиці в схемах <varname>tiger</varname> та "
+"<varname>tiger_data</varname> із ключовими стовпцями, що використовуються в "
+"з'єднаннях геокодера, для яких відсутні індекси в цих стовпцях, і виводить "
+"SQL DDL для визначення індексу для цих таблиць. Це допоміжна функція, яка "
+"додає нові індекси, необхідні для прискорення запитів, які могли бути "
+"відсутні під час процесу завантаження. У міру вдосконалення геокодера ця "
+"функція буде оновлюватися для врахування нових індексів, що "
+"використовуються. Якщо ця функція не виводить нічого, це означає, що всі "
+"ваші таблиці вже мають, на нашу думку, необхідні ключові індекси."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Install_Missing_Indexes\"/>"
+msgstr ", <xref linkend=\"Install_Missing_Indexes\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Given a textual street address, returns a composite <varname>norm_addy</"
+"varname> type that has road suffix, prefix and type standardized, street, "
+"streetname etc. broken into separate fields. This function will work with "
+"just the lookup data packaged with the tiger_geocoder (no need for tiger "
+"census data)."
+msgstr ""
+"За заданою текстовою адресою повертає комбінований тип <varname>norm_addy</"
+"varname>, що містить стандартизовані суфікс, префікс і тип дороги, вулицю, "
+"назву вулиці тощо, розділені на окремі поля. Ця функція працює лише з даними "
+"пошуку, що містяться в пакеті tiger_geocoder (дані перепису населення tiger "
+"не потрібні)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given a textual street address, returns a composite <varname>norm_addy</"
+"varname> type that has road suffix, prefix and type standardized, street, "
+"streetname etc. broken into separate fields. This is the first step in the "
+"geocoding process to get all addresses into normalized postal form. No other "
+"data is required aside from what is packaged with the geocoder."
+msgstr ""
+"За заданою текстовою адресою повертає комбінований тип <varname>norm_addy</"
+"varname>, що містить стандартизовані суфікси, префікси та типи доріг, "
+"вулиці, назви вулиць тощо, розділені на окремі поля. Це перший крок у "
+"процесі геокодування, що дозволяє перетворити всі адреси у стандартизований "
+"поштовий формат. Крім даних, що містяться в пакеті геокодера, ніякі інші "
+"дані не потрібні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function just uses the various direction/state/suffix lookup tables "
+"preloaded with the tiger_geocoder and located in the <varname>tiger</"
+"varname> schema, so it doesn't need you to download tiger census data or any "
+"other additional data to make use of it. You may find the need to add more "
+"abbreviations or alternative namings to the various lookup tables in the "
+"<varname>tiger</varname> schema."
+msgstr ""
+"Ця функція просто використовує різні таблиці пошуку напрямків/станів/"
+"суфіксів, попередньо завантажені за допомогою tiger_geocoder і розташовані в "
+"схемі <varname>tiger</varname>, тому для її використання не потрібно "
+"завантажувати дані перепису tiger або будь-які інші додаткові дані. Можливо, "
+"вам знадобиться додати більше скорочень або альтернативних назв до різних "
+"таблиць пошуку в схемі <varname>tiger</varname>."
+
+#. Tag: para
+#, fuzzy, no-c-format
+msgid ""
+"It uses various control lookup tables located in <varname>tiger</varname> "
+"schema to normalize the input address."
+msgstr ""
+"Він використовує різні таблиці контролю, розташовані в схемі <varname>tiger</"
+"varname>, для нормалізації вхідної адреси."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Fields in the <varname>norm_addy</varname> type object returned by this "
+"function in this order where () indicates a field required by the geocoder, "
+"[] indicates an optional field:"
+msgstr ""
+"Поля в об'єкті типу <varname>norm_addy</varname>, що повертається цією "
+"функцією в такому порядку, де () позначає поле, необхідне для геокодера, [] "
+"позначає необов'язкове поле:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(address) [predirAbbrev] (streetName) [streetTypeAbbrev] [postdirAbbrev] "
+"[internal] [location] [stateAbbrev] [zip] [parsed] [zip4] "
+"[address_alphanumeric]"
+msgstr ""
+"(address) [predirAbbrev] (streetName) [streetTypeAbbrev] [postdirAbbrev] "
+"[internal] [location] [stateAbbrev] [zip] [parsed] [zip4] "
+"[address_alphanumeric]"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.4.0 norm_addy object includes additional fields zip4 and "
+"address_alphanumeric."
+msgstr ""
+"Покращено: об'єкт norm_addy версії 2.4.0 містить додаткові поля zip4 та "
+"address_alphanumeric."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>address</varname> is an integer: The street number"
+msgstr "<varname>address</varname> є цілим числом: номер будинку"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>predirAbbrev</varname> is varchar: Directional prefix of road such "
+"as N, S, E, W etc. These are controlled using the <varname>direction_lookup</"
+"varname> table."
+msgstr ""
+"<varname>predirAbbrev</varname> є varchar: напрямний префікс дороги, такий "
+"як N, S, E, W тощо. Вони контролюються за допомогою таблиці "
+"<varname>direction_lookup</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>streetName</varname> varchar"
+msgstr "<varname>streetName</varname> varchar"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>streetTypeAbbrev</varname> varchar abbreviated version of street "
+"type: e.g. St, Ave, Cir. These are controlled using the "
+"<varname>street_type_lookup</varname> table."
+msgstr ""
+"<varname>streetTypeAbbrev</varname> varchar скорочена версія типу вулиці: "
+"наприклад, St, Ave, Cir. Вони контролюються за допомогою таблиці "
+"<varname>street_type_lookup</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>postdirAbbrev</varname> varchar abbreviated directional suffice of "
+"road N, S, E, W etc. These are controlled using the "
+"<varname>direction_lookup</varname> table."
+msgstr ""
+"<varname>postdirAbbrev</varname> varchar скорочений напрямний суфікс дороги "
+"N, S, E, W тощо. Вони контролюються за допомогою таблиці "
+"<varname>direction_lookup</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>internal</varname> varchar internal address such as an apartment or "
+"suite number."
+msgstr ""
+"<varname>internal</varname> varchar внутрішня адреса, така як номер квартири "
+"або номер кімнати."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>location</varname> varchar usually a city or governing province."
+msgstr ""
+"<varname>location</varname> varchar зазвичай місто або адміністративна "
+"область."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>stateAbbrev</varname> varchar two character US State. e.g MA, NY, "
+"MI. These are controlled by the <varname>state_lookup</varname> table."
+msgstr ""
+"<varname>stateAbbrev</varname> varchar два символи, штат США. Наприклад, MA, "
+"NY, MI. Вони контролюються таблицею <varname>state_lookup</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>zip</varname> varchar 5-digit zipcode. e.g. 02109."
+msgstr ""
+"<varname>zip</varname> varchar 5-значний поштовий індекс. Наприклад, 02109."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>parsed</varname> boolean - denotes if address was formed from "
+"normalize process. The normalize_address function sets this to true before "
+"returning the address."
+msgstr ""
+"<varname>parsed</varname> boolean - позначає, чи адреса була сформована в "
+"результаті процесу нормалізації. Функція normalize_address встановлює це "
+"значення на true перед поверненням адреси."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>zip4</varname> last 4 digits of a 9 digit zip code. Availability: "
+"PostGIS 2.4.0."
+msgstr ""
+"<varname>zip4</varname> останні 4 цифри 9-значного поштового індексу. "
+"Доступність: PostGIS 2.4.0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>address_alphanumeric</varname> Full street number even if it has "
+"alpha characters like 17R. Parsing of this is better using <xref "
+"linkend=\"Pagc_Normalize_Address\"/> function. Availability: PostGIS 2.4.0."
+msgstr ""
+"<varname>address_alphanumeric</varname> Повний номер вулиці, навіть якщо він "
+"містить літери, наприклад 17R. Розбір цього краще виконувати за допомогою "
+"функції <xref linkend=\"Pagc_Normalize_Address\"/>. Доступність: PostGIS 2.4."
+"0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Output select fields. Use <xref linkend=\"Pprint_Addy\"/> if you want a "
+"pretty textual output."
+msgstr ""
+"Поля вибору виводу. Використовуйте <xref linkend=\"Pprint_Addy\"/>, якщо "
+"хочете отримати гарний текстовий вивід."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Pprint_Addy\"/>"
+msgstr ", <xref linkend=\"Pprint_Addy\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Given a textual street address, returns a composite <varname>norm_addy</"
+"varname> type that has road suffix, prefix and type standardized, street, "
+"streetname etc. broken into separate fields. This function will work with "
+"just the lookup data packaged with the tiger_geocoder (no need for tiger "
+"census data). Requires address_standardizer extension."
+msgstr ""
+"За заданою текстовою адресою повертає комбінований тип <varname>norm_addy</"
+"varname>, що містить стандартизовані суфікс, префікс і тип дороги, вулицю, "
+"назву вулиці тощо, розділені на окремі поля. Ця функція працює лише з даними "
+"пошуку, що містяться в пакеті tiger_geocoder (дані перепису населення tiger "
+"не потрібні). Потрібне розширення address_standardizer."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function just uses the various pagc_* lookup tables preloaded with the "
+"tiger_geocoder and located in the <varname>tiger</varname> schema, so it "
+"doesn't need you to download tiger census data or any other additional data "
+"to make use of it. You may find the need to add more abbreviations or "
+"alternative namings to the various lookup tables in the <varname>tiger</"
+"varname> schema."
+msgstr ""
+"Ця функція використовує різні таблиці пошуку pagc_*, попередньо завантажені "
+"за допомогою tiger_geocoder і розташовані в схемі <varname>tiger</varname>, "
+"тому для її використання не потрібно завантажувати дані перепису tiger або "
+"будь-які інші додаткові дані. Можливо, вам знадобиться додати більше "
+"скорочень або альтернативних назв до різних таблиць пошуку в схемі "
+"<varname>tiger</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are slight variations in casing and formatting over the <xref "
+"linkend=\"Normalize_Address\"/>."
+msgstr ""
+"Існують незначні відмінності в оформленні та форматуванні посилання <xref "
+"linkend=\"Normalize_Address\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(address) [predirAbbrev] (streetName) [streetTypeAbbrev] [postdirAbbrev] "
+"[internal] [location] [stateAbbrev] [zip]"
+msgstr ""
+"(address) [predirAbbrev] (streetName) [streetTypeAbbrev] [postdirAbbrev] "
+"[internal] [location] [stateAbbrev] [zip]"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The native standardaddr of address_standardizer extension is at this time a "
+"bit richer than norm_addy since its designed to support international "
+"addresses (including country). standardaddr equivalent fields are:"
+msgstr ""
+"На даний момент стандартний формат standardaddr розширення "
+"address_standardizer є дещо багатшим за norm_addy, оскільки він розроблений "
+"для підтримки міжнародних адрес (включно з країною). Еквівалентними полями "
+"standardaddr є:"
+
+#. Tag: para
+#, no-c-format
+msgid "house_num,predir, name, suftype, sufdir, unit, city, state, postcode"
+msgstr "house_num,predir, name, suftype, sufdir, unit, city, state, postcode"
+
+#. Tag: para
+#, no-c-format
+msgid "Single call example"
+msgstr "Приклад одного виклику"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Batch call. There are currently speed issues with the way "
+"postgis_tiger_geocoder wraps the address_standardizer. These will hopefully "
+"be resolved in later editions. To work around them, if you need speed for "
+"batch geocoding to call generate a normaddy in batch mode, you are "
+"encouraged to directly call the address_standardizer standardize_address "
+"function as shown below which is similar exercise to what we did in <xref "
+"linkend=\"Normalize_Address\"/> that uses data created in <xref "
+"linkend=\"Geocode\"/>."
+msgstr ""
+"Пакетний виклик. Наразі існують проблеми зі швидкістю роботи "
+"postgis_tiger_geocoder при обробці address_standardizer. Сподіваємося, що ці "
+"проблеми будуть вирішені в наступних версіях. Щоб обійти ці проблеми, якщо "
+"вам потрібна швидкість для пакетного геокодування, щоб викликати normaddy в "
+"пакетному режимі, рекомендуємо безпосередньо викликати функцію "
+"standardize_address address_standardizer, як показано нижче, що схоже на те, "
+"що ми робили в <xref linkend=\"Normalize_Address\"/>, яке використовує дані, "
+"створені в <xref linkend=\"Geocode\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Geocode\"/>"
+msgstr ", <xref linkend=\"Geocode\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Given a <varname>norm_addy</varname> composite type object, returns a pretty "
+"print representation of it. Usually used in conjunction with "
+"normalize_address."
+msgstr ""
+"За заданого об'єкта складеного типу <varname>norm_addy</varname> повертає "
+"його представлення у вигляді зручного для друку формату. Зазвичай "
+"використовується разом із нормалізацією адреси."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given a <varname>norm_addy</varname> composite type object, returns a pretty "
+"print representation of it. No other data is required aside from what is "
+"packaged with the geocoder."
+msgstr ""
+"За заданого об'єкта складеного типу <varname>norm_addy</varname> повертає "
+"його представлення у вигляді зручного для друку формату. Крім даних, що "
+"містяться в геокодері, ніякі інші дані не потрібні."
+
+#. Tag: para
+#, no-c-format
+msgid "Usually used in conjunction with <xref linkend=\"Normalize_Address\"/>."
+msgstr ""
+"Зазвичай використовується разом з <xref linkend=\"Normalize_Address\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Pretty print a single address"
+msgstr "Красивий вивід однієї адреси"
+
+#. Tag: para
+#, no-c-format
+msgid "Pretty print address a table of addresses"
+msgstr "Красивий вивід таблиці адрес"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes a geometry point in a known spatial ref sys and returns a record "
+"containing an array of theoretically possible addresses and an array of "
+"cross streets. If include_strnum_range = true, includes the street range in "
+"the cross streets."
+msgstr ""
+"Бере геометричну точку в відомій просторовій системі координат і повертає "
+"запис, що містить масив теоретично можливих адрес і масив перехресних "
+"вулиць. Якщо include_strnum_range = true, включає діапазон вулиць у "
+"перехресні вулиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes a geometry point in a known spatial ref and returns a record "
+"containing an array of theoretically possible addresses and an array of "
+"cross streets. If include_strnum_range = true, includes the street range in "
+"the cross streets. include_strnum_range defaults to false if not passed in. "
+"Addresses are sorted according to which road a point is closest to so first "
+"address is most likely the right one."
+msgstr ""
+"Бере геометричну точку в відомій просторовій системі координат і повертає "
+"запис, що містить масив теоретично можливих адрес і масив перехресних "
+"вулиць. Якщо include_strnum_range = true, включає діапазон вулиць у "
+"перехресні вулиці. include_strnum_range за замовчуванням має значення false, "
+"якщо не передано. Адреси сортуються залежно від того, до якої дороги точка "
+"найближча, тому перша адреса, найімовірніше, є правильною."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Why do we say theoretical instead of actual addresses. The Tiger data "
+"doesn't have real addresses, but just street ranges. As such the theoretical "
+"address is an interpolated address based on the street ranges. Like for "
+"example interpolating one of my addresses returns a 26 Court St. and 26 "
+"Court Sq., though there is no such place as 26 Court Sq. This is because a "
+"point may be at a corner of 2 streets and thus the logic interpolates along "
+"both streets. The logic also assumes addresses are equally spaced along a "
+"street, which of course is wrong since you can have a municipal building "
+"taking up a good chunk of the street range and the rest of the buildings are "
+"clustered at the end."
+msgstr ""
+"Чому ми говоримо \"теоретичні\", а не \"фактичні адреси\"? Дані Tiger не містять "
+"реальних адрес, а лише діапазони вулиць. Таким чином, теоретична адреса є "
+"інтерпольованою адресою, що базується на діапазонах вулиць. Наприклад, "
+"інтерполяція однієї з моїх адрес дає результат 26 Court St. і 26 Court Sq., "
+"хоча такого місця як 26 Court Sq. не існує. Це відбувається тому, що точка "
+"може знаходитися на розі двох вулиць, і тому логіка інтерполює вздовж обох "
+"вулиць. Логіка також передбачає, що адреси розташовані на рівній відстані "
+"вздовж вулиці, що, звичайно, є неправильним, оскільки муніципальна будівля "
+"може займати значну частину вулиці, а решта будівель скупчені в кінці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note: Hmm this function relies on Tiger data. If you have not loaded data "
+"covering the region of this point, then hmm you will get a record filled "
+"with NULLS."
+msgstr ""
+"Примітка: Ця функція використовує дані Tiger. Якщо ви не завантажили дані, "
+"що охоплюють регіон цієї точки, ви отримаєте запис, заповнений нульовими "
+"значеннями."
+
+#. Tag: para
+#, no-c-format
+msgid "Returned elements of the record are as follows:"
+msgstr "Повернені елементи запису мають такий вигляд:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>intpt</varname> is an array of points: These are the center line "
+"points on the street closest to the input point. There are as many points as "
+"there are addresses."
+msgstr ""
+"<varname>intpt</varname> — масив точок: це точки центральної лінії вулиці, "
+"найближчі до вхідної точки. Кількість точок дорівнює кількості адрес."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>addy</varname> is an array of norm_addy (normalized addresses): "
+"These are an array of possible addresses that fit the input point. The first "
+"one in the array is most likely. Generally there should be only one, except "
+"in the case when a point is at the corner of 2 or 3 streets, or the point is "
+"somewhere on the road and not off to the side."
+msgstr ""
+"<varname>addy</varname> — масив norm_addy (нормалізованих адрес): це масив "
+"можливих адрес, які відповідають вхідній точці. Перша в масиві — "
+"найімовірніша. Зазвичай має бути тільки одна, за винятком випадків, коли "
+"точка знаходиться на розі 2 або 3 вулиць, або точка знаходиться десь на "
+"дорозі, а не збоку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>street</varname> an array of varchar: These are cross streets (or "
+"the street) (streets that intersect or are the street the point is projected "
+"to be on)."
+msgstr ""
+"<varname>street</varname> масив varchar: це перехресні вулиці (або вулиця) ("
+"вулиці, що перетинаються або є вулицею, на яку проектується точка)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.4.1 if optional zcta5 dataset is loaded, the reverse_geocode "
+"function can resolve to state and zip even if the specific state data is not "
+"loaded. Refer to <xref linkend=\"Loader_Generate_Nation_Script\"/> for "
+"details on loading zcta5 data."
+msgstr ""
+"Покращено: 2.4.1 якщо завантажено опціональний набір даних zcta5, функція "
+"reverse_geocode може визначити штат і поштовий індекс, навіть якщо дані про "
+"конкретний штат не завантажено. Докладніші відомості про завантаження даних "
+"zcta5 див. у <xref linkend=\"Loader_Generate_Nation_Script\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example of a point at the corner of two streets, but closest to one. This is "
+"approximate location of MIT: 77 Massachusetts Ave, Cambridge, MA 02139 Note "
+"that although we don't have 3 streets, PostgreSQL will just return null for "
+"entries above our upper bound so safe to use. This includes street ranges"
+msgstr ""
+"Приклад точки на розі двох вулиць, але найближчої до однієї з них. Це "
+"приблизне місцезнаходження MIT: 77 Massachusetts Ave, Cambridge, MA 02139 "
+"Зверніть увагу, що хоча у нас немає 3 вулиць, PostgreSQL просто поверне null "
+"для записів, що перевищують нашу верхню межу, тому використовувати це "
+"безпечно. Сюди входять діапазони вулиць"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Here we choose not to include the address ranges for the cross streets and "
+"picked a location really really close to a corner of 2 streets thus could be "
+"known by two different addresses."
+msgstr ""
+"Тут ми вирішили не вказувати діапазони адрес для перехресних вулиць і "
+"вибрали місце, яке знаходиться дуже близько до перехрестя двох вулиць, тому "
+"його можна знайти за двома різними адресами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For this one we reuse our geocoded example from <xref linkend=\"Geocode\"/> "
+"and we only want the primary address and at most 2 cross streets."
+msgstr ""
+"Для цього ми повторно використовуємо наш геокодований приклад з <xref "
+"linkend=\"Geocode\"/> і нам потрібна тільки основна адреса і максимум 2 "
+"перехресні вулиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"Geocode\"/>, <xref "
+"linkend=\"Loader_Generate_Nation_Script\"/>"
+msgstr ""
+", <xref linkend=\"Geocode\"/>, <xref linkend=\"Loader_Generate_Nation_Script"
+"\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Loads a defined region of tiger data into a PostGIS Topology and "
+"transforming the tiger data to spatial reference of the topology and "
+"snapping to the precision tolerance of the topology."
+msgstr ""
+"Завантажує визначену область tiger даних у топологію PostGIS, перетворює "
+"tiger дані на просторові посилання топології та прив'язує їх до допусків "
+"точності топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Loads a defined region of tiger data into a PostGIS Topology. The faces, "
+"nodes and edges are transformed to the spatial reference system of the "
+"target topology and points are snapped to the tolerance of the target "
+"topology. The created faces, nodes, edges maintain the same ids as the "
+"original Tiger data faces, nodes, edges so that datasets can be in the "
+"future be more easily reconciled with tiger data. Returns summary details "
+"about the process."
+msgstr ""
+"Завантажує визначену область даних Tiger у топологію PostGIS. Поверхні, "
+"вузли та ребра перетворюються у просторову систему координат цільової "
+"топології, а точки прив'язуються до допусків цільової топології. Створені "
+"поверхні, вузли та ребра зберігають ті самі ідентифікатори, що й оригінальні "
+"поверхні, вузли та ребра даних Tiger, щоб у майбутньому набори даних можна "
+"було легше узгодити з даними Tiger. Повертає зведену інформацію про процес."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This would be useful for example for redistricting data where you require "
+"the newly formed polygons to follow the center lines of streets and for the "
+"resulting polygons not to overlap."
+msgstr ""
+"Це може бути корисно, наприклад, для перерозподілу даних, коли потрібно, щоб "
+"новостворені полігони відповідали центральним лініям вулиць і не перекривали "
+"один одного."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function relies on Tiger data as well as the installation of the "
+"PostGIS topology module. For more information, refer to <xref "
+"linkend=\"Topology\"/> and <xref linkend=\"installation_configuration\"/>. "
+"If you have not loaded data covering the region of interest, then no "
+"topology records will be created. This function will also fail if you have "
+"not created a topology using the topology functions."
+msgstr ""
+"Ця функція використовує дані Tiger, а також вимагає встановлення модуля "
+"топології PostGIS. Для отримання додаткової інформації див. <xref linkend="
+"\"Topology\"/> та <xref linkend=\"installation_configuration\"/>. Якщо ви не "
+"завантажили дані, що охоплюють область, яка вас цікавить, записи топології "
+"не будуть створені. Ця функція також не працюватиме, якщо ви не створили "
+"топологію за допомогою функцій топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Most topology validation errors are a result of tolerance issues where after "
+"transformation the edges points don't quite line up or overlap. To remedy "
+"the situation you may want to increase or lower the precision if you get "
+"topology validation failures."
+msgstr ""
+"Більшість помилок перевірки топології є наслідком проблем з толерантністю, "
+"коли після перетворення точки країв не збігаються або перекриваються. Щоб "
+"виправити ситуацію, можна збільшити або зменшити точність, якщо виникають "
+"помилки перевірки топології."
+
+#. Tag: para
+#, no-c-format
+msgid "Required arguments:"
+msgstr "Необхідні аргументи:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>topo_name</varname> The name of an existing PostGIS topology to "
+"load data into."
+msgstr ""
+"<varname>topo_name</varname> Назва існуючої топології PostGIS, в яку "
+"потрібно завантажити дані."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>region_type</varname> The type of bounding region. Currently only "
+"<varname>place</varname> and <varname>county</varname> are supported. Plan "
+"is to have several more. This is the table to look into to define the region "
+"bounds. e.g <varname>tiger.place</varname>, <varname>tiger.county</varname>"
+msgstr ""
+"<varname>region_type</varname> Тип обмежувальної області. Наразі "
+"підтримуються лише <varname>place</varname> та <varname>county</varname>. "
+"Планується додати ще кілька. Ця таблиця використовується для визначення меж "
+"регіону. Наприклад, <varname>tiger.place</varname>, <varname>tiger."
+"county</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>region_id</varname> This is what TIGER calls the geoid. It is the "
+"unique identifier of the region in the table. For place it is the "
+"<varname>plcidfp</varname> column in <varname>tiger.place</varname>. For "
+"county it is the <varname>cntyidfp</varname> column in <varname>tiger."
+"county</varname>"
+msgstr ""
+"<varname>region_id</varname> Це те, що TIGER називає геоїдом. Це унікальний "
+"ідентифікатор регіону в таблиці. Для місця це стовпець <varname>plcidfp</"
+"varname> у таблиці <varname>tiger.place</varname>. Для округу це стовпець "
+"<varname>cntyidfp</varname> у таблиці <varname>tiger.county</varname>"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Boston, Massachusetts Topology"
+msgstr "Приклад: Топологія Бостона та Массачусетс"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a topology for Boston, Massachusetts in Mass State Plane Feet (2249) "
+"with tolerance 0.25 feet and then load in Boston city tiger faces, edges, "
+"nodes."
+msgstr ""
+"Створіть топологію для Бостона, штат Массачусетс, у системі Mass State Plane "
+"Feet (2249) з допуском 0,25 футів, а потім завантажте грані, ребра та вузли "
+"міста Бостон у форматі Tiger."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Suffolk, Massachusetts Topology"
+msgstr "Приклад: Топологія Суффолка та Массачусетс"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a topology for Suffolk, Massachusetts in Mass State Plane Meters "
+"(26986) with tolerance 0.25 meters and then load in Suffolk county tiger "
+"faces, edges, nodes."
+msgstr ""
+"Створіть топологію для Суффолка, штат Массачусетс, в системі координат Mass "
+"State Plane Meters (26986) з похибкою 0,25 метра, а потім завантажте грані, "
+"ребра та вузли тигрової моделі округу Суффолк."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CreateTopoGeom\"/>, <xref linkend=\"TopologySummary\"/>, "
+"<xref linkend=\"ValidateTopology\"/>"
+msgstr ""
+", <xref linkend=\"CreateTopoGeom\"/>, <xref linkend=\"TopologySummary\"/>, "
+"<xref linkend=\"ValidateTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Sets a setting that affects behavior of geocoder functions."
+msgstr "Встановлює налаштування, що впливає на поведінку функцій геокодера."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets value of specific setting stored in <varname>tiger.geocode_settings</"
+"varname> table. Settings allow you to toggle debugging of functions. Later "
+"plans will be to control rating with settings. Current list of settings are "
+"listed in <xref linkend=\"Get_Geocode_Setting\"/>."
+msgstr ""
+"Встановлює значення конкретного параметра, збереженого в таблиці "
+"<varname>tiger.geocode_settings</varname>. Параметри дозволяють вмикати та "
+"вимикати налагодження функцій. У майбутньому планується контролювати рейтинг "
+"за допомогою параметрів. Поточний список параметрів наведено в <xref linkend="
+"\"Get_Geocode_Setting\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you run <xref linkend=\"Geocode\"/> when this function is true, the "
+"NOTICE log will output timing and queries."
+msgstr ""
+"Якщо ви запустите <xref linkend=\"Geocode\"/>, коли ця функція має значення "
+"true, у журналі NOTICE буде виведено час виконання та запити."
+
+#. Tag: title
+#, no-c-format
+msgid "Topology"
+msgstr "Топологія"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS Topology types and functions are used to manage topological "
+"objects such as faces, edges and nodes."
+msgstr ""
+"Типи та функції топології PostGIS використовуються для управління "
+"топологічними об'єктами, такими як грані, ребра та вузли."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sandro Santilli's presentation at PostGIS Day Paris 2011 conference gives a "
+"good synopsis of PostGIS Topology and where it is headed <link xlink:"
+"href=\"http://strk.kbt.io/projects/postgis/Paris2011_TopologyWithPostGIS_2_0."
+"pdf\">Topology with PostGIS 2.0 slide deck</link>."
+msgstr ""
+"Презентація Сандро Сантіллі на конференції PostGIS Day Paris 2011 містить "
+"хороший огляд топології PostGIS та її перспектив <link "
+"xlink:href=\"http://strk.kbt.io/projects/postgis/"
+"Paris2011_TopologyWithPostGIS_2_0.pdf\">Топологія з PostGIS 2.0, "
+"презентація</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Vincent Picavet provides a good synopsis and overview of what is Topology, "
+"how is it used, and various FOSS4G tools that support it in <link xlink:"
+"href=\"https://gitlab.com/Oslandia/documentation/presentations/-/blob/"
+"master/2012/pgconf_eu_2012/pgconfeu2012_vincent_picavet_postgis_topology."
+"pdf\">PostGIS Topology PGConf EU 2012</link>."
+msgstr ""
+"Вінсент Пікавет надає хороший огляд та узагальнення того, що таке топологія, "
+"як вона використовується, а також різних інструментів FOSS4G, які її "
+"підтримують, у <link xlink:href=\"https://gitlab.com/Oslandia/documentation/"
+"presentations/-/blob/master/2012/pgconf_eu_2012/"
+"pgconfeu2012_vincent_picavet_postgis_topology.pdf\">PostGIS Topology PGConf "
+"EU 2012</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An example of a topologically based GIS database is the <link xlink:"
+"href=\"https://www.census.gov/geo/maps-data/data/tiger.html\">US Census "
+"Topologically Integrated Geographic Encoding and Referencing System (TIGER)</"
+"link> database. If you want to experiment with PostGIS topology and need "
+"some data, check out <xref linkend=\"Topology_Load_Tiger\"/>."
+msgstr ""
+"Прикладом топологічної бази даних ГІС є база даних <link "
+"xlink:href=\"https://www.census.gov/geo/maps-data/data/tiger.html\">US Census "
+"Topologically Integrated Geographic Encoding and Referencing System (TIGER)</"
+"link> (Топологічно інтегрована система географічного кодування та посилань "
+"перепису населення США). Якщо ви хочете поекспериментувати з топологією "
+"PostGIS і вам потрібні дані, перегляньте <xref linkend=\"Topology_Load_Tiger"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS topology module has existed in prior versions of PostGIS but was "
+"never part of the Official PostGIS documentation. In PostGIS 2.0.0 major "
+"cleanup is going on to remove use of all deprecated functions in it, fix "
+"known usability issues, better document the features and functions, add new "
+"functions, and enhance to closer conform to SQL-MM standards."
+msgstr ""
+"Модуль топології PostGIS існував у попередніх версіях PostGIS, але ніколи не "
+"був частиною офіційної документації PostGIS. У PostGIS 2.0.0 проводиться "
+"основне очищення з метою видалення всіх застарілих функцій, виправлення "
+"відомих проблем з користуванням, покращення документації щодо можливостей та "
+"функцій, додавання нових функцій та вдосконалення для більшої відповідності "
+"стандартам SQL-MM."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Details of this project can be found at <link xlink:href=\"http://trac.osgeo."
+"org/postgis/wiki/UsersWikiPostgisTopology\">PostGIS Topology Wiki</link>"
+msgstr ""
+"Детальнішу інформацію про цей проект можна знайти за посиланням <link "
+"xlink:href=\"http://trac.osgeo.org/postgis/wiki/UsersWikiPostgisTopology\""
+">PostGIS Topology Wiki</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All functions and tables associated with this module are installed in a "
+"schema called <varname>topology</varname>."
+msgstr ""
+"Усі функції та таблиці, пов'язані з цим модулем, встановлюються у схемі під "
+"назвою <varname>topology</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Functions that are defined in SQL/MM standard are prefixed with ST_ and "
+"functions specific to PostGIS are not prefixed."
+msgstr ""
+"Функції, які визначені в стандарті SQL/MM, мають префікс ST_, а функції, "
+"специфічні для PostGIS, не мають префікса."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Topology support is build by default starting with PostGIS 2.0, and can be "
+"disabled specifying --without-topology configure option at build time as "
+"described in <xref linkend=\"postgis_installation\"/>"
+msgstr ""
+"Підтримка топології вбудована за замовчуванням, починаючи з PostGIS 2.0, і "
+"може бути вимкнена, вказавши опцію --without-topology під час компіляції, як "
+"описано в <xref linkend=\"postgis_installation\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Types"
+msgstr "Типи топології"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the PostgreSQL data types installed by PostGIS Topology. "
+"Note we describe the casting behavior of these which is very important "
+"especially when designing your own functions."
+msgstr ""
+"У цьому розділі перелічено типи даних PostgreSQL, встановлені PostGIS "
+"Topology. Зверніть увагу, що ми описуємо поведінку цих типів при "
+"перетворенні, що є дуже важливим, особливо при розробці власних функцій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "A composite type that consists of a sequence number and an edge number."
+msgstr "Комбінований тип, що складається з порядкового номера та номера ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A composite type that consists of a sequence number and an edge number. This "
+"is the return type for <varname>ST_GetFaceEdges</varname> and "
+"<varname>GetNodeEdges</varname> functions."
+msgstr ""
+"Композитний тип, що складається з порядкового номера та номера ребра. Це тип "
+"повернення для функцій <varname>ST_GetFaceEdges</varname> та "
+"<varname>GetNodeEdges</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>sequence</varname> is an integer: Refers to a topology defined in "
+"the topology.topology table which defines the topology schema and srid."
+msgstr ""
+"<varname>sequence</varname> integer: Посилається на топологію, визначену в "
+"таблиці topology.topology, яка визначає схему топології та srid."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>edge</varname> is an integer: The identifier of an edge."
+msgstr "<varname>edge</varname> integer: ідентифікатор ребра."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "A composite type representing a topologically defined geometry."
+msgstr "Композитний тип, що представляє топологічно визначену геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A composite type that refers to a topology geometry in a specific topology "
+"layer, having a specific type and a specific id. The elements of a "
+"TopoGeometry are the properties: topology_id, layer_id, id integer, type "
+"integer."
+msgstr ""
+"Композитний тип, що посилається на геометрію топології в конкретному шарі "
+"топології, має конкретний тип і конкретний ідентифікатор. Елементами "
+"TopoGeometry є властивості: topology_id, layer_id, id integer, type integer."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>topology_id</varname> is an integer: Refers to a topology defined "
+"in the topology.topology table which defines the topology schema and srid."
+msgstr ""
+"<varname>topology_id</varname> integer: Посилається на топологію, визначену "
+"в таблиці topology.topology, яка визначає схему топології та srid."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>layer_id</varname> is an integer: The layer_id in the layers table "
+"that the TopoGeometry belongs to. The combination of topology_id, layer_id "
+"provides a unique reference in the topology.layers table."
+msgstr ""
+"<varname>layer_id</varname> integer: layer_id у таблиці шарів, до якої "
+"належить TopoGeometry. Поєднання topology_id та layer_id забезпечує "
+"унікальне посилання в таблиці topology.layers."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>id</varname> is an integer: The id is the autogenerated sequence "
+"number that uniquely defines the topogeometry in the respective topology "
+"layer."
+msgstr ""
+"<varname>id</varname> integer: id — це автоматично згенерований порядковий "
+"номер, який однозначно визначає топогеометрію у відповідному шарі топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>type</varname> integer between 1 - 4 that defines the geometry "
+"type: 1:[multi]point, 2:[multi]line, 3:[multi]poly, 4:collection"
+msgstr ""
+"<varname>type</varname> integer від 1 до 4, що визначає тип геометрії: "
+"1:[multi]point, 2:[multi]line, 3:[multi]poly, 4:collection"
+
+#. Tag: title
+#, no-c-format
+msgid "Casting Behavior"
+msgstr "Поведінка при приведення типів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the automatic as well as explicit casts allowed for this "
+"data type"
+msgstr ""
+"У цьому розділі перелічено автоматичні та явні приведення типів, дозволені "
+"для цього типу даних"
+
+#. Tag: entry
+#, no-c-format
+msgid "Cast To"
+msgstr "Приведення типів в"
+
+#. Tag: entry
+#, no-c-format
+msgid "Behavior"
+msgstr "Поведінка"
+
+#. Tag: entry
+#, no-c-format
+msgid "geometry"
+msgstr "geometry"
+
+#. Tag: entry
+#, no-c-format
+msgid "automatic"
+msgstr "автоматичне"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A composite type that consists of an error message and id1 and id2 to denote "
+"location of error. This is the return type for <varname>ValidateTopology</"
+"varname>."
+msgstr ""
+"Комбінований тип, що складається з повідомлення про помилку та "
+"ідентифікаторів id1 та id2 для позначення місця помилки. Це тип повернення "
+"для <varname>ValidateTopology</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A composite type that consists of an error message and two integers. The "
+"<xref linkend=\"ValidateTopology\"/> function returns a set of these to "
+"denote validation errors and the id1 and id2 to denote the ids of the "
+"topology objects involved in the error."
+msgstr ""
+"Композитний тип, що складається з повідомлення про помилку та двох цілих "
+"чисел. Функція <xref linkend=\"ValidateTopology\"/> повертає набір таких "
+"елементів для позначення помилок перевірки, а також ідентифікатори id1 та "
+"id2 для позначення ідентифікаторів об'єктів топології, пов'язаних із "
+"помилкою."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>error</varname> is varchar: Denotes type of error."
+msgstr "<varname>error</varname> є varchar: Позначає тип помилки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Current error descriptors are: coincident nodes, edge crosses node, edge not "
+"simple, edge end node geometry mismatch, edge start node geometry mismatch, "
+"face overlaps face,face within face,"
+msgstr ""
+"Поточні описи помилок: збіжні вузли, перетин ребер з вузлами, не прості "
+"ребра, невідповідність геометрії кінцевих вузлів ребер, невідповідність "
+"геометрії початкових вузлів ребер, перекриття граней, грань всередині грані,"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>id1</varname> is an integer: Denotes identifier of edge / face / "
+"nodes in error."
+msgstr ""
+"<varname>id1</varname> integer позначає ідентифікатор ребра / грані / "
+"вузлів, що містить помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>id2</varname> is an integer: For errors that involve 2 objects "
+"denotes the secondary edge / or node"
+msgstr ""
+"<varname>id2</varname> integer: для помилок, що стосуються 2 об'єктів, "
+"позначає вторинний край / або вузол"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Domains"
+msgstr "Топологічні домени"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the PostgreSQL domains installed by PostGIS Topology. "
+"Domains can be used like object types as return objects of functions or "
+"table columns. The distinction between a domain and a type is that a domain "
+"is an existing type with a check constraint bound to it."
+msgstr ""
+"У цьому розділі перелічено домени PostgreSQL, встановлені PostGIS Topology. "
+"Домени можна використовувати як типи об'єктів, наприклад, як об'єкти, що "
+"повертаються функціями, або стовпці таблиць. Відмінність домену від типу "
+"полягає в тому, що домен — це існуючий тип, до якого прив'язано обмеження "
+"перевірки."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"An array of 2 integers generally used to identify a TopoGeometry component."
+msgstr ""
+"Масив із 2 цілих чисел, що зазвичай використовується для ідентифікації "
+"компонента TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An array of 2 integers used to represent one component of a simple or "
+"hierarchical <xref linkend=\"topogeometry\"/>."
+msgstr ""
+"Масив із 2 цілих чисел, що використовується для представлення одного "
+"компонента простого або ієрархічного <xref linkend=\"topogeometry\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the case of a simple TopoGeometry the first element of the array "
+"represents the identifier of a topological primitive and the second element "
+"represents its type (1:node, 2:edge, 3:face). In the case of a hierarchical "
+"TopoGeometry the first element of the array represents the identifier of a "
+"child TopoGeometry and the second element represents its layer identifier."
+msgstr ""
+"У випадку простої TopoGeometry перший елемент масиву представляє "
+"ідентифікатор топологічного примітиву, а другий елемент представляє його тип "
+"(1:вузол, 2:ребро, 3:грань). У випадку ієрархічної TopoGeometry перший "
+"елемент масиву представляє ідентифікатор дочірньої TopoGeometry, а другий "
+"елемент представляє ідентифікатор її шару."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For any given hierarchical TopoGeometry all child TopoGeometry elements will "
+"come from the same child layer, as specified in the topology.layer record "
+"for the layer of the TopoGeometry being defined."
+msgstr ""
+"Для будь-якої ієрархічної TopoGeometry всі дочірні елементи TopoGeometry "
+"будуть походити з того самого дочірнього шару, як зазначено в записі "
+"topology.layer для шару TopoGeometry, що визначається."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"topoelementarray\"/>, <xref linkend=\"topogeometry\"/>, "
+"<xref linkend=\"TopoGeom_addElement\"/>, <xref "
+"linkend=\"TopoGeom_remElement\"/>"
+msgstr ""
+", <xref linkend=\"topoelementarray\"/>, <xref linkend=\"topogeometry\"/>, "
+"<xref linkend=\"TopoGeom_addElement\"/>, <xref linkend=\"TopoGeom_remElement"
+"\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "An array of TopoElement objects."
+msgstr "Масив об'єктів TopoElement."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An array of 1 or more TopoElement objects, generally used to pass around "
+"components of TopoGeometry objects."
+msgstr ""
+"Масив з 1 або більше об'єктів TopoElement, який зазвичай використовується "
+"для передачі компонентів об'єктів TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"GetTopoGeomElementArray\"/>, <xref "
+"linkend=\"TopoElementArray_Agg\"/>"
+msgstr ""
+", <xref linkend=\"GetTopoGeomElementArray\"/>, <xref linkend="
+"\"TopoElementArray_Agg\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology and TopoGeometry Management"
+msgstr "Управління топологією та топогеометрією"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the Topology functions for building new Topology schemas, "
+"validating topologies, and managing TopoGeometry Columns"
+msgstr ""
+"У цьому розділі перелічено функції топології для створення нових схем "
+"топології, перевірки топологій та управління стовпцями TopoGeometry"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds a topogeometry column to an existing table, registers this new column "
+"as a layer in topology.layer and returns the new layer_id."
+msgstr ""
+"Додає стовпець топогеометрії до існуючої таблиці, реєструє цей новий "
+"стовпець як шар у topology.layer і повертає новий layer_id."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Each TopoGeometry object belongs to a specific Layer of a specific Topology. "
+"Before creating a TopoGeometry object you need to create its TopologyLayer. "
+"A Topology Layer is an association of a feature-table with the topology. It "
+"also contain type and hierarchy information. We create a layer using the "
+"AddTopoGeometryColumn() function:"
+msgstr ""
+"Кожен об'єкт TopoGeometry належить до певного шару певної топології. Перед "
+"створенням об'єкта TopoGeometry потрібно створити його TopologyLayer. "
+"Топологічний шар — це зв'язок таблиці об'єктів з топологією. Він також "
+"містить інформацію про тип та ієрархію. Ми створюємо шар за допомогою "
+"функції AddTopoGeometryColumn():"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function will both add the requested column to the table and add a "
+"record to the topology.layer table with all the given info."
+msgstr ""
+"Ця функція додасть запитуваний стовпець до таблиці та додасть запис до "
+"таблиці topology.layer з усією наданою інформацією."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you don't specify [child_layer] (or set it to NULL) this layer would "
+"contain Basic TopoGeometries (composed by primitive topology elements). "
+"Otherwise this layer will contain hierarchical TopoGeometries (composed by "
+"TopoGeometries from the child_layer)."
+msgstr ""
+"Якщо ви не вкажете [child_layer] (або встановите його значення NULL), цей "
+"шар буде містити базові топогеометрії (складені з примітивних топологічних "
+"елементів). В іншому випадку цей шар буде містити ієрархічні топогеометрії ("
+"складені з топогеометрій з child_layer)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once the layer is created (its id is returned by the AddTopoGeometryColumn "
+"function) you're ready to construct TopoGeometry objects in it"
+msgstr ""
+"Після створення шару (його ідентифікатор повертається функцією "
+"AddTopoGeometryColumn) ви готові до побудови об'єктів TopoGeometry в ньому"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Valid <varname>feature_type</varname>s are: POINT, MULTIPOINT, LINE, "
+"MULTILINE, POLYGON, MULTIPOLYGON, COLLECTION"
+msgstr ""
+"Дійсні <varname>feature_type</varname>s: POINT, MULTIPOINT, LINE, MULTILINE, "
+"POLYGON, MULTIPOLYGON, COLLECTION"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1"
+msgstr "Доступність: 1.1"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"toTopoGeom\"/>, <xref linkend=\"CreateTopology\"/>, <xref "
+"linkend=\"CreateTopoGeom\"/>"
+msgstr ""
+", <xref linkend=\"toTopoGeom\"/>, <xref linkend=\"CreateTopology\"/>, <xref "
+"linkend=\"CreateTopoGeom\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Renames a topogeometry column"
+msgstr "Перейменовує стовпець топогеометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function changes the name of an existing TopoGeometry column ensuring "
+"metadata information about it is updated accordingly."
+msgstr ""
+"Ця функція змінює назву існуючого стовпця TopoGeometry, забезпечуючи "
+"відповідне оновлення метаданих про нього."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RenameTopology\"/>"
+msgstr ", <xref linkend=\"RenameTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Use with caution: Drops a topology schema and deletes its reference from "
+"topology.topology table and references to tables in that schema from the "
+"geometry_columns table."
+msgstr ""
+"Використовуйте з обережністю: видаляє схему топології та її посилання з "
+"таблиці topology.topology, а також посилання на таблиці в цій схемі з "
+"таблиці geometry_columns."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Drops a topology schema and deletes its reference from topology.topology "
+"table and references to tables in that schema from the geometry_columns "
+"table. This function should be USED WITH CAUTION, as it could destroy data "
+"you care about. If the schema does not exist, it just removes reference "
+"entries the named schema."
+msgstr ""
+"Видаляє схему топології та її посилання з таблиці topology.topology, а також "
+"посилання на таблиці в цій схемі з таблиці geometry_columns. Цю функцію слід "
+"ВИКОРИСТОВУВАТИ З ОБЕРЕЖНІСТЮ, оскільки вона може знищити важливі для вас "
+"дані. Якщо схема не існує, вона просто видаляє записи посилань на вказану "
+"схему."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Cascade drops the ma_topo schema and removes all references to it in "
+"topology.topology and geometry_columns."
+msgstr ""
+"Cascade видаляє схему ma_topo та всі посилання на неї в topology.topology та "
+"geometry_columns."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Renames a topology"
+msgstr "Перейменовує топологію"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Renames a topology schema, updating its metadata record in the "
+"<varname>topology.topology</varname> table."
+msgstr ""
+"Перейменовує схему топології, оновлюючи запис метаданих у таблиці "
+"<varname>topology.topology</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rename a topology from <varname>topo_stage</varname> to <varname>topo_prod</"
+"varname>."
+msgstr ""
+"Перейменуйте топологію з <varname>topo_stage</varname> на "
+"<varname>topo_prod</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RenameTopoGeometryColumn\"/>"
+msgstr ", <xref linkend=\"RenameTopoGeometryColumn\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Drops the topogeometry column from the table named <varname>table_name</"
+"varname> in schema <varname>schema_name</varname> and unregisters the "
+"columns from topology.layer table."
+msgstr ""
+"Видаляє стовпець топогеометрії з таблиці з назвою <varname>table_name</"
+"varname> у схемі <varname>schema_name</varname> та скасовує реєстрацію "
+"стовпців у таблиці topology.layer."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Drops the topogeometry column from the table named <varname>table_name</"
+"varname> in schema <varname>schema_name</varname> and unregisters the "
+"columns from topology.layer table. Returns summary of drop status. NOTE: it "
+"first sets all values to NULL before dropping to bypass referential "
+"integrity checks."
+msgstr ""
+"Видаляє стовпець топогеометрії з таблиці з назвою <varname>table_name</"
+"varname> у схемі <varname>schema_name</varname> та скасовує реєстрацію "
+"стовпців у таблиці topology.layer. Повертає підсумок стану видалення. "
+"ПРИМІТКА: перед видаленням спочатку встановлює всі значення на NULL, щоб "
+"обійти перевірки цілісності посилань."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds missing entries to topology.layer table by reading metadata from topo "
+"tables."
+msgstr ""
+"Додає відсутні записи до таблиці topology.layer, зчитуючи метадані з таблиць "
+"topo."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds missing entries to the <varname>topology.layer</varname> table by "
+"inspecting topology constraints on tables. This function is useful for "
+"fixing up entries in topology catalog after restores of schemas with topo "
+"data."
+msgstr ""
+"Додає відсутні записи до таблиці <varname>topology.layer</varname>, "
+"перевіряючи обмеження топології в таблицях. Ця функція корисна для "
+"виправлення записів у каталозі топології після відновлення схем із даними "
+"топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It returns the list of entries created. Returned columns are "
+"<varname>schema_name</varname>, <varname>table_name</varname>, "
+"<varname>feature_column</varname>."
+msgstr ""
+"Повертає список створених записів. Повертаються стовпці "
+"<varname>schema_name</varname>, <varname>table_name</varname>, "
+"<varname>feature_column</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.3.0"
+msgstr "Доступність: 2.3.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Takes a topology name and provides summary totals of types of "
+"objects in topology.</refpurpose>"
+msgstr ""
+"<refpurpose>Бере ім'я топології та надає підсумкові суми типів об'єктів у "
+"топології.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Takes a topology name and provides summary totals of types of objects "
+"in topology.</para>"
+msgstr ""
+"<para>Бере ім'я топології та надає підсумкові суми типів об'єктів у "
+"топології.</para>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of validatetopology_returntype objects detailing issues with "
+"topology."
+msgstr ""
+"Повертає набір об'єктів validated_topology_returntype, що детально описують "
+"проблеми з топологією."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of <xref linkend=\"validatetopology_returntype\"/> objects "
+"detailing issues with topology, optionally limiting the check to the area "
+"specified by the <varname>bbox</varname> parameter."
+msgstr ""
+"Повертає набір об'єктів <xref linkend=\"validatetopology_returntype\"/>, що "
+"детально описують проблеми з топологією, за бажанням обмежуючи перевірку "
+"областю, вказаною параметром <varname>bbox</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"List of possible errors, what they mean and what the returned ids represent "
+"are displayed below:"
+msgstr ""
+"Нижче наведено перелік можливих помилок, їх значення та значення повернених "
+"ідентифікаторів:"
+
+#. Tag: entry
+#, no-c-format
+msgid "Error"
+msgstr "Error"
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>id1</entry>"
+msgstr "<entry>id1</entry>"
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>id2</entry>"
+msgstr "<entry>id2</entry>"
+
+#. Tag: entry
+#, no-c-format
+msgid "Meaning"
+msgstr "Meaning"
+
+#. Tag: entry
+#, no-c-format
+msgid "coincident nodes"
+msgstr "coincident nodes"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of first node."
+msgstr "Ідентифікатор першого вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of second node."
+msgstr "Ідентифікатор другого вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid "Two nodes have the same geometry."
+msgstr "Два вузли мають однакову геометрію."
+
+#. Tag: entry
+#, no-c-format
+msgid "edge crosses node"
+msgstr "edge crosses node"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the edge."
+msgstr "Ідентифікатор ребра."
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the node."
+msgstr "Ідентифікатор вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid "An edge has a node in its interior. See <xref linkend=\"ST_Relate\"/>."
+msgstr ""
+"Ребро має вузол у своїй внутрішній частині. Див. <xref linkend=\"ST_Relate\""
+"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "invalid edge"
+msgstr "invalid edge"
+
+#. Tag: entry
+#, no-c-format
+msgid "An edge geometry is invalid. See <xref linkend=\"ST_IsValid\"/>."
+msgstr "Геометрія ребра недійсна. Див. <xref linkend=\"ST_IsValid\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "edge not simple"
+msgstr "edge not simple"
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"An edge geometry has self-intersections. See <xref linkend=\"ST_IsSimple\"/>."
+msgstr "Геометрія ребра має самоперетини. Див. <xref linkend=\"ST_IsSimple\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "edge crosses edge"
+msgstr "edge crosses edge"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of first edge."
+msgstr "Ідентифікатор першого ребра."
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of second edge."
+msgstr "Ідентифікатор другого ребра."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"Two edges have an interior intersection. See <xref linkend=\"ST_Relate\"/>."
+msgstr "Дві ребра мають внутрішнє перетин. Див. <xref linkend=\"ST_Relate\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "edge start node geometry mismatch"
+msgstr "edge start node geometry mismatch"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the indicated start node."
+msgstr "Ідентифікатор вказаного початкового вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"The geometry of the node indicated as the starting node for an edge does not "
+"match the first point of the edge geometry. See <xref "
+"linkend=\"ST_StartPoint\"/>."
+msgstr ""
+"Геометрія вузла, вказаного як початковий вузол для ребра, не відповідає "
+"першій точці геометрії ребра. Див. <xref linkend=\"ST_StartPoint\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "edge end node geometry mismatch"
+msgstr "edge end node geometry mismatch"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the indicated end node."
+msgstr "Ідентифікатор вказаного кінцевого вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"The geometry of the node indicated as the ending node for an edge does not "
+"match the last point of the edge geometry. See <xref linkend=\"ST_EndPoint\"/"
+">."
+msgstr ""
+"Геометрія вузла, вказаного як кінцевий вузол для ребра, не відповідає "
+"останній точці геометрії ребра. Див. <xref linkend=\"ST_EndPoint\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "face without edges"
+msgstr "face without edges"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the orphaned face."
+msgstr "Ідентифікатор \"осиротілої\" грані."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"No edge reports an existing face on either of its sides (left_face, "
+"right_face)."
+msgstr ""
+"Жодне ребро не повідомляє про наявність грані з будь-якого боку (left_face, "
+"right_face)."
+
+#. Tag: entry
+#, no-c-format
+msgid "face has no rings"
+msgstr "face has no rings"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the partially-defined face."
+msgstr "Ідентифікатор частково визначеної грані."
+
+#. Tag: entry
+#, no-c-format
+msgid "Edges reporting a face on their sides do not form a ring."
+msgstr "Ребра, що утворюють грань на своїх боках, не утворюють кільця."
+
+#. Tag: entry
+#, no-c-format
+msgid "face has wrong mbr"
+msgstr "face has wrong mbr"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the face with wrong mbr cache."
+msgstr "Ідентифікатор грані з неправильним кешем mbr."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"Minimum bounding rectangle of a face does not match minimum bounding box of "
+"the collection of edges reporting the face on their sides."
+msgstr ""
+"Мінімальна обмежувальна рамка грані не збігається з мінімальною "
+"обмежувальною рамкою сукупності ребер, що утворюють грань по своїх сторонах."
+
+#. Tag: entry
+#, no-c-format
+msgid "hole not in advertised face"
+msgstr "hole not in advertised face"
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"Signed identifier of an edge, identifying the ring. See <xref "
+"linkend=\"GetRingEdges\"/>."
+msgstr ""
+"Підписаний ідентифікатор ребра, що ідентифікує кільце. Див. <xref linkend="
+"\"GetRingEdges\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"A ring of edges reporting a face on its exterior is contained in different "
+"face."
+msgstr ""
+"Кільце ребер, що утворюють грань на зовнішній поверхні, міститься в іншій "
+"грані."
+
+#. Tag: entry
+#, no-c-format
+msgid "not-isolated node has not- containing_face"
+msgstr "not-isolated node has not- containing_face"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the ill-defined node."
+msgstr "Ідентифікатор неправильно визначеного вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"A node which is reported as being on the boundary of one or more edges is "
+"indicating a containing face."
+msgstr ""
+"Вузол, який повідомляється як такий, що знаходиться на межі одного або "
+"декількох ребер, вказує на вмістну грань."
+
+#. Tag: entry
+#, no-c-format
+msgid "isolated node has containing_face"
+msgstr "isolated node has containing_face"
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"A node which is not reported as being on the boundary of any edges is "
+"lacking the indication of a containing face."
+msgstr ""
+"Вузол, який не вказаний як такий, що знаходиться на межі будь-яких ребер, не "
+"має позначення грані, що його містить."
+
+#. Tag: entry
+#, no-c-format
+msgid "isolated node has wrong containing_face"
+msgstr "isolated node has wrong containing_face"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the misrepresented node."
+msgstr "Ідентифікатор неправильно представленого вузла."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"A node which is not reported as being on the boundary of any edges indicates "
+"a containing face which is not the actual face containing it. See <xref "
+"linkend=\"GetFaceContainingPoint\"/>."
+msgstr ""
+"Вузол, який не вказаний як такий, що знаходиться на межі будь-яких ребер, "
+"вказує на грань, що його містить, яка не є фактичною гранью, що його "
+"містить. Див. <xref linkend=\"GetFaceContainingPoint\"/>."
+
+#. Tag: entry
+#, no-c-format
+msgid "invalid next_right_edge"
+msgstr "invalid next_right_edge"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the misrepresented edge."
+msgstr "Ідентифікатор неправильно представленого ребра."
+
+#. Tag: entry
+#, no-c-format
+msgid "Signed id of the edge which should be indicated as the next right edge."
+msgstr ""
+"Підписаний ідентифікатор ребра, яке слід вказати як наступне праве ребро."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"The edge indicated as the next edge encountered walking on the right side of "
+"an edge is wrong."
+msgstr ""
+"Ребро, позначене як наступне ребро, на яке натрапляєш, рухаючись праворуч "
+"від ребра, є неправильним."
+
+#. Tag: entry
+#, no-c-format
+msgid "invalid next_left_edge"
+msgstr "invalid next_left_edge"
+
+#. Tag: entry
+#, no-c-format
+msgid "Signed id of the edge which should be indicated as the next left edge."
+msgstr ""
+"Підписаний ідентифікатор ребра, яке слід вказати як наступне ліве ребро."
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"The edge indicated as the next edge encountered walking on the left side of "
+"an edge is wrong."
+msgstr ""
+"Ребро, вказане як наступне ребро, на яке натрапляєш, рухаючись лівою "
+"стороною ребра, є неправильним."
+
+#. Tag: entry
+#, no-c-format
+msgid "mixed face labeling in ring"
+msgstr "mixed face labeling in ring"
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"Edges in a ring indicate conflicting faces on the walking side. This is also "
+"known as a \"Side Location Conflict\"."
+msgstr ""
+"Ребра в кільці позначають конфліктуючі грані на стороні ходіння. Це також "
+"називається \"конфліктом розташування сторін\"."
+
+#. Tag: entry
+#, no-c-format
+msgid "non-closed ring"
+msgstr "non-closed ring"
+
+#. Tag: entry
+#, no-c-format
+msgid ""
+"A ring of edges formed by following next_left_edge/next_right_edge "
+"attributes starts and ends on different nodes."
+msgstr ""
+"Кільце ребер, утворене атрибутами next_left_edge/next_right_edge, "
+"починається і закінчується на різних вузлах."
+
+#. Tag: entry
+#, no-c-format
+msgid "face has multiple shells"
+msgstr "face has multiple shells"
+
+#. Tag: entry
+#, no-c-format
+msgid "Identifier of the contended face."
+msgstr "Ідентифікатор грані, що є предметом суперечки."
+
+#. Tag: entry
+#, no-c-format
+msgid "More than a one ring of edges indicate the same face on its interior."
+msgstr "Більше ніж одне кільце ребер вказує на ту саму грань всередині."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.0.0"
+msgstr "Доступність: 1.0.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 more efficient edge crossing detection and fixes for false "
+"positives that were existent in prior versions."
+msgstr ""
+"Покращено: 2.0.0 більш ефективне виявлення перетину ребер та виправлення "
+"помилок, що були присутні в попередніх версіях."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 values for id1 and id2 were swapped for 'edge crosses node' "
+"to be consistent with error description."
+msgstr ""
+"Змінено: 2.2.0 значення id1 та id2 були поміняні місцями для \"перетину ребер "
+"вузлом\" з метою узгодження з описом помилки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.2.0 added optional bbox parameter, perform face labeling and edge "
+"linking checks."
+msgstr ""
+"Змінено: 3.2.0 додано опційний параметр bbox, виконується перевірка "
+"маркування ребер та з'єднання ребер."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Topology_Load_Tiger\"/>"
+msgstr ", <xref linkend=\"Topology_Load_Tiger\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns info about invalid topology relation records"
+msgstr "Повертає інформацію про недійсні записи топологічних відносин"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set records giving information about invalidities in the relation "
+"table of the topology."
+msgstr ""
+"Повертає набір записів, що містять інформацію про недійсні елементи в "
+"таблиці відносин топології."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.2.0"
+msgstr "Доступність: 3.2.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns non-precise vertices in the topology."
+msgstr "Повертає неточні вершини в топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns all vertices that are not rounded to the topology or given "
+"<varname>gridSize</varname> as a puntal geometry, optionally limiting the "
+"check to the area specified by the <varname>bbox</varname> parameter."
+msgstr ""
+"Повертає всі вершини, які не округлені до топології або задані "
+"<varname>gridSize</varname> як точкова геометрія, опціонально обмежуючи "
+"перевірку областю, заданою параметром <varname>bbox</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.6.0"
+msgstr "Доступність: 3.6.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Snap topology vertices to precision grid."
+msgstr "Прив'язати вершини топології до сітки з високою точністю."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Snaps all vertices of a topology to the topology precision grid or to the "
+"grid whose size is specified with the <varname>gridSize</varname> parameter, "
+"optionally limiting the operation to the objects intersecting the area "
+"specified by the <varname>bbox</varname> parameter."
+msgstr ""
+"Прив'язує всі вершини топології до сітки точності топології або до сітки, "
+"розмір якої вказано параметром <varname>gridSize</varname>, за бажанням "
+"обмежуючи операцію об'єктами, що перетинають область, вказану параметром "
+"<varname>bbox</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Snapping could make the topology invalid, so it is recommended to check the "
+"outcome of operation with <xref linkend=\"ValidateTopology\"/>."
+msgstr ""
+"При використанні функції \"Прив'язати\" топологія може стати недійсною, тому "
+"рекомендується перевірити результат операції за допомогою <xref linkend="
+"\"ValidateTopology\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ValidateTopology\"/>"
+msgstr ", <xref linkend=\"ValidateTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a topology record by different means."
+msgstr "Повертає запис топології різними способами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes a topology identifier or the identifier of a topology-related object "
+"and returns a topology.topology record."
+msgstr ""
+"Приймає ідентифікатор топології або ідентифікатор об'єкта, пов'язаного з "
+"топологією, і повертає запис топології."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a topology.layer record by different means."
+msgstr "Повертає запис topology.layer різними способами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes a layer identifier or the identifier of a topology-related object and "
+"returns a topology.layer record."
+msgstr ""
+"Приймає ідентифікатор шару або ідентифікатор об'єкта, пов'язаного з "
+"топологією, і повертає запис topology.layer."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Total disk space used by the specified topology, including all indexes and "
+"TOAST data."
+msgstr ""
+"Загальний обсяг дискового простору, використовуваний зазначеною топологією, "
+"включаючи всі індекси та дані TOAST."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes a topology name and provides the total disk space used by all its "
+"tables, including indexes and TOAST data."
+msgstr ""
+"Приймає ім'я топології та надає загальний обсяг дискового простору, "
+"зайнятого всіма її таблицями, включаючи індекси та дані TOAST."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Upgrades the specified topology to support large ids (int8) for topology and "
+"primitive ids."
+msgstr ""
+"Оновлює вказану топологію для підтримки великих ідентифікаторів (int8) для "
+"топології та примітивних ідентифікаторів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes a topology name and upgrades it to support large ids (int8) for "
+"topology and primitive ids. The function upgrades the following: - face "
+"(face_id column from int4 to int8, face_id_seq from int4 to int8) - node "
+"(node_id column from int4 to int8, containing_face column from int4 to int8, "
+"node_id_seq from int4 to int8) - edge_data (edge_id column from int4 to "
+"int8, edge_data_edge_id_seq from int4 to int8, left_face and right_face "
+"columns from int4 to int8, start_node and end_node columns from int4 to "
+"int8, next_left_edge and next_right_edge columns from int4 to int8) - "
+"relation (topogeo_id column from int4 to int8, element_id from int4 to int8) "
+"- topology (useslargeids column set to true)"
+msgstr ""
+"Бере ім'я топології та оновлює його для підтримки великих ідентифікаторів "
+"(int8) для топології та примітивних ідентифікаторів. Функція оновлює "
+"наступне: - face (стовпець face_id з int4 до int8, face_id_seq з int4 до "
+"int8) - node (стовпець node_id з int4 до int8, столпець containing_face з "
+"int4 до int8, node_id_seq з int4 до int8) - edge_data (стовпець edge_id з "
+"int4 до int8, edge_data_edge_id_seq з int4 до int8, стовпці left_face та "
+"right_face з int4 до int8, стовпці start_node та end_node з int4 до int8, "
+"стовпці next_left_edge та next_right_edge з int4 до int8) - relation ("
+"стовпець topogeo_id з int4 до int8, element_id з int4 до int8) - topology ("
+"стовпець useslargeids встановлено на true)"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Statistics Management"
+msgstr "Управління статистикою топології"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section discusses management of database statistics during topology "
+"building."
+msgstr ""
+"У цьому розділі розглядається управління статистикою бази даних під час "
+"побудови топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adding elements to a topology triggers many database queries for finding "
+"existing edges that will be split, adding nodes and updating edges that will "
+"node with the new linework. For this reason it is useful that statistics "
+"about the data in the topology tables are up-to-date."
+msgstr ""
+"Додавання елементів до топології викликає багато запитів до бази даних для "
+"пошуку існуючих ребер, які будуть розділені, додавання вузлів та оновлення "
+"ребер, які будуть з'єднані з новою лінією. З цієї причини корисно, щоб "
+"статистичні дані про дані в таблицях топології були актуальними."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS Topology population and editing functions do not automatically "
+"update the statistics because a updating stats after each and every change "
+"in a topology would be overkill, so it is the caller's duty to take care of "
+"that."
+msgstr ""
+"Функції заповнення та редагування топології PostGIS не оновлюють статистику "
+"автоматично, оскільки оновлення статистики після кожної зміни в топології "
+"було б надмірним, тому це обов'язок того, хто викликає функцію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"That the statistics updated by autovacuum will NOT be visible to "
+"transactions which started before autovacuum process completed, so long-"
+"running transactions will need to run ANALYZE themselves, to use updated "
+"statistics."
+msgstr ""
+"Статистика, оновлена за допомогою autovacuum, НЕ буде видима для транзакцій, "
+"які були запущені до завершення процесу autovacuum, тому для використання "
+"оновленої статистики довготривалі транзакції повинні самостійно виконати "
+"ANALYZE."
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Constructors"
+msgstr "Конструктори топології"
+
+#. Tag: para
+#, no-c-format
+msgid "This section covers the topology functions for creating new topologies."
+msgstr ""
+"У цьому розділі описано функції топології для створення нових топологій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a new topology schema and registers it in the topology.topology "
+"table."
+msgstr ""
+"Створює нову схему топології та реєструє її в таблиці topology.topology."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new topology schema with name <varname>topology_name</varname> and "
+"registers it in the <varname>topology.topology</varname> table. Topologies "
+"must be uniquely named. The topology tables (<varname>edge_data</varname>, "
+"<varname>face</varname>, <varname>node</varname>,and <varname>relation</"
+"varname> are created in the schema. It returns the id of the topology."
+msgstr ""
+"Створює нову схему топології з іменем <varname>topology_name</varname> і "
+"реєструє її в таблиці <varname>topology.topology</varname>. Топології "
+"повинні мати унікальні імена. Таблиці топологій (<varname>edge_data</"
+"varname>, <varname>face</varname>, <varname>node</varname> та "
+"<varname>relation</varname> створюються в схемі. Повертає ідентифікатор "
+"топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>srid</varname> is the <link linkend=\"spatial_ref_sys\">spatial "
+"reference system</link> SRID for the topology. The SRID defaults to -1 "
+"(unknown) if not specified."
+msgstr ""
+"<varname>srid</varname> — це SRID <link linkend=\"spatial_ref_sys\""
+">просторової системи координат</link> для топології. Якщо SRID не вказано, "
+"за замовчуванням використовується значення -1 (невідомо)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The tolerance <varname>prec</varname> is measured in the units of the "
+"spatial reference system. The tolerance defaults to 0."
+msgstr ""
+"Допуск <varname>prec</varname> вимірюється в одиницях просторової системи "
+"відліку. За замовчуванням допуск дорівнює 0."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>hasz</varname> defaults to false if not specified."
+msgstr ""
+"<varname>hasz</varname> за замовчуванням має значення false, якщо не вказано "
+"інше."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>topoid</varname> optional explicit identifier (allows deterministic "
+"topology id assignment, needs to be unique)"
+msgstr ""
+"<varname>topoid</varname> необов'язковий явний ідентифікатор (дозволяє "
+"детерміновано присвоювати ідентифікатори топології, повинен бути унікальним)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>useslargeids</varname> optional, defaults to false. If true, the "
+"topology will be created to support large ids (int8) for topology and "
+"primitive ids."
+msgstr ""
+"<varname>useslargeids</varname> необов'язковий, за замовчуванням false. Якщо "
+"true, то топологія буде створена для підтримки великих ідентифікаторів (int8)"
+" для топології та примітивних ідентифікаторів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is similar to the SQL/MM <xref linkend=\"ST_InitTopoGeo\"/> but has "
+"more functionality."
+msgstr ""
+"Це схоже на SQL/MM <xref linkend=\"ST_InitTopoGeo\"/>, але має більше "
+"функціональних можливостей."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0 added the signature accepting hasZ"
+msgstr "Покращено: у версії 2.0 додано прийняття підпису hasZ"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a topology schema called <varname>ma_topo</varname> that stores edges "
+"and nodes in Massachusetts State Plane-meters (SRID = 26986). The tolerance "
+"represents 0.5 meters since the spatial reference system is meter-based."
+msgstr ""
+"Створіть схему топології під назвою <varname>ma_topo</varname>, яка зберігає "
+"ребра та вузли в системі координат Massachusetts State Plane-meters (SRID = "
+"26986). Допуск становить 0,5 метра, оскільки система просторових координат "
+"базується на метрах."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a topology for Rhode Island called <varname>ri_topo</varname> in "
+"spatial reference system State Plane-feet (SRID = 3438)"
+msgstr ""
+"Створіть топологію для Род-Айленду під назвою <varname>ri_topo</varname> у "
+"системі просторових координат State Plane-feet (SRID = 3438)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_InitTopoGeo\"/>, <xref linkend=\"Topology_Load_Tiger\"/>"
+msgstr ""
+", <xref linkend=\"ST_InitTopoGeo\"/>, <xref linkend=\"Topology_Load_Tiger\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Makes a copy of a topology (nodes, edges, faces, layers and TopoGeometries) "
+"into a new schema"
+msgstr ""
+"Створює копію топології (вузлів, ребер, граней, шарів і TopoGeometries) у "
+"новій схемі"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new topology with name <varname>new_name</varname>, with SRID and "
+"precision copied from <varname>existing_topology_name</varname> The nodes, "
+"edges and faces in <varname>existing_topology_name</varname> are copied into "
+"the new topology, as well as Layers and their associated TopoGeometries."
+msgstr ""
+"Створює нову топологію з назвою <varname>new_name</varname>, з SRID і "
+"точністю, скопійованими з <varname>existing_topology_name</varname>. Вузли, "
+"ребра та грані в <varname>existing_topology_name</varname> копіюються в нову "
+"топологію, а також шари та пов'язані з ними TopoGeometries."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The new rows in the <varname>topology.layer</varname> table contain "
+"synthetic values for schema_name, table_name and feature_column. This is "
+"because the TopoGeometry objects exist only as a definition and are not yet "
+"available in a user-defined table."
+msgstr ""
+"Нові рядки в таблиці <varname>topology.layer</varname> містять синтетичні "
+"значення для schema_name, table_name та feature_column. Це пов'язано з тим, "
+"що об'єкти TopoGeometry існують лише як визначення і ще не доступні в "
+"таблиці, визначеній користувачем."
+
+#. Tag: para
+#, no-c-format
+msgid "Make a backup of a topology called <varname>ma_topo</varname>."
+msgstr ""
+"Створіть резервну копію топології під назвою <varname>ma_topo</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CreateTopology\"/>, <xref linkend=\"RenameTopology\"/>"
+msgstr ""
+", <xref linkend=\"CreateTopology\"/>, <xref linkend=\"RenameTopology\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is the SQL-MM equivalent of <xref linkend=\"CreateTopology\"/>. It "
+"lacks options for spatial reference system and tolerance. it returns a text "
+"description of the topology creation, instead of the topology id."
+msgstr ""
+"Це еквівалент SQL-MM для <xref linkend=\"CreateTopology\"/>. У ньому "
+"відсутні параметри для просторової системи координат і допуску. Він повертає "
+"текстовий опис створення топології замість ідентифікатора топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM 3 Topo-Geo and Topo-Net 3: Routine Details: X.3.17"
+msgstr ""
+"&sqlmm_compliant; SQL-MM 3 Topo-Geo and Topo-Net 3: Routine Details: X.3.17"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Adds a collection of geometries to a given empty topology and "
+"returns a message detailing success.</refpurpose>"
+msgstr ""
+"<refpurpose>Додає колекцію геометрій до заданої порожньої топології та "
+"повертає повідомлення з детальною інформацією про успішність "
+"операції.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Adds a collection of geometries to a given empty topology and returns "
+"a message detailing success.</para>"
+msgstr ""
+"<para>Додає колекцію геометрій до заданої порожньої топології та повертає "
+"повідомлення з детальною інформацією про успішність виконання.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid "Useful for populating an empty topology."
+msgstr "Корисно для заповнення порожньої топології."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0"
+msgstr "Доступність: 2.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details -- X.3.18"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details -- X.3.18"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"AddTopoGeometryColumn\"/>, <xref "
+"linkend=\"CreateTopology\"/>, <xref linkend=\"DropTopology\"/>"
+msgstr ""
+", <xref linkend=\"AddTopoGeometryColumn\"/>, <xref linkend=\"CreateTopology\""
+"/>, <xref linkend=\"DropTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds a point to an existing topology using a tolerance and possibly "
+"splitting an existing edge."
+msgstr ""
+"Додає точку до існуючої топології, використовуючи допуск і, можливо, "
+"розділяючи існуюче ребро."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a point to an existing topology and returns its identifier. The given "
+"point will snap to existing nodes or edges within given tolerance. An "
+"existing edge may be split by the snapped point."
+msgstr ""
+"Додає точку до існуючої топології та повертає її ідентифікатор. Задана точка "
+"буде прив'язана до існуючих вузлів або ребер в межах заданого допуску. "
+"Існуюче ребро може бути розділене прив'язаною точкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"TopoGeo_AddPolygon\"/>, <xref "
+"linkend=\"TopoGeo_LoadGeometry\"/>, <xref linkend=\"AddNode\"/>, <xref "
+"linkend=\"CreateTopology\"/>"
+msgstr ""
+", <xref linkend=\"TopoGeo_AddPolygon\"/>, <xref linkend="
+"\"TopoGeo_LoadGeometry\"/>, <xref linkend=\"AddNode\"/>, <xref linkend="
+"\"CreateTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds a linestring to an existing topology using a tolerance and possibly "
+"splitting existing edges/faces."
+msgstr ""
+"Додає лінійний елемент до існуючої топології з використанням допуску та "
+"можливого розділення існуючих ребер/граней."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a linestring to an existing topology and returns a set of signed edge "
+"identifiers forming it up (negative identifies mean the edge goes in the "
+"opposite direction of the input linestring). The given line will snap to "
+"existing nodes or edges within given tolerance. Existing edges and faces may "
+"be split by the line. New nodes and faces may be added."
+msgstr ""
+"Додає лінійний рядок до існуючої топології та повертає набір підписаних "
+"ідентифікаторів ребер, що його утворюють (негативні ідентифікатори "
+"означають, що ребро йде в протилежному напрямку від вхідного лінійного рядка)"
+". Задана лінія буде прив'язана до існуючих вузлів або ребер в межах заданого "
+"допуску. Існуючі ребра та грані можуть бути розділені лінією. Можуть бути "
+"додані нові вузли та грані."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Updating statistics about topologies being loaded via this function is up to "
+"caller, see <xref linkend=\"Topology_StatsManagement\"/>."
+msgstr ""
+"Оновлення статистики про топології, що завантажуються за допомогою цієї "
+"функції, залежить від виклику, див. <xref linkend=\"Topology_StatsManagement"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.2.0 added support for returning signed identifier."
+msgstr ""
+"Покращено: у версії 3.2.0 додано підтримку повернення підписаного "
+"ідентифікатора."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"TopoGeo_AddPolygon\"/>, <xref "
+"linkend=\"TopoGeo_LoadGeometry\"/>, <xref linkend=\"AddEdge\"/>, <xref "
+"linkend=\"CreateTopology\"/>"
+msgstr ""
+", <xref linkend=\"TopoGeo_AddPolygon\"/>, <xref linkend="
+"\"TopoGeo_LoadGeometry\"/>, <xref linkend=\"AddEdge\"/>, <xref linkend="
+"\"CreateTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds a polygon to an existing topology using a tolerance and possibly "
+"splitting existing edges/faces. Returns face identifiers."
+msgstr ""
+"Додає полігон до існуючої топології, використовуючи допуск і, можливо, "
+"розділяючи існуючі ребра/грані. Повертає ідентифікатори граней."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a polygon to an existing topology and returns a set of face identifiers "
+"forming it up. The boundary of the given polygon will snap to existing nodes "
+"or edges within given tolerance. Existing edges and faces may be split by "
+"the boundary of the new polygon."
+msgstr ""
+"Додає полігон до існуючої топології та повертає набір ідентифікаторів "
+"граней, що його утворюють. Межа заданого полігону буде прив'язана до "
+"існуючих вузлів або ребер з урахуванням заданого допуску. Існуючі ребра та "
+"грані можуть бути розділені межею нового полігону."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"TopoGeo_AddLineString\"/>, <xref "
+"linkend=\"TopoGeo_LoadGeometry\"/>, <xref linkend=\"AddFace\"/>, <xref "
+"linkend=\"CreateTopology\"/>"
+msgstr ""
+", <xref linkend=\"TopoGeo_AddLineString\"/>, <xref linkend="
+"\"TopoGeo_LoadGeometry\"/>, <xref linkend=\"AddFace\"/>, <xref linkend="
+"\"CreateTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Load a geometry into an existing topology, snapping and splitting as needed."
+msgstr ""
+"Завантажте геометрію в існуючу топологію, при необхідності вирівнюючи та "
+"розділяючи."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Loads a geometry into an existing topology. The given geometry will snap to "
+"existing nodes or edges within given tolerance. Existing edges and faces may "
+"be split as a consequence of the load."
+msgstr ""
+"Завантажує геометрію в існуючу топологію. Задана геометрія буде прив'язана "
+"до існуючих вузлів або ребер в межах заданого допуску. Існуючі ребра та "
+"грані можуть бути розділені в результаті завантаження."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.5.0"
+msgstr "Доступність: 3.5.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"TopoGeo_AddLineString\"/>, <xref "
+"linkend=\"TopoGeo_AddPolygon\"/>, <xref linkend=\"CreateTopology\"/>"
+msgstr ""
+", <xref linkend=\"TopoGeo_AddLineString\"/>, <xref linkend="
+"\"TopoGeo_AddPolygon\"/>, <xref linkend=\"CreateTopology\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Editors"
+msgstr "Редактори топології"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section covers topology functions for adding, moving, deleting, and "
+"splitting edges, faces, and nodes. All of these functions are defined by ISO "
+"SQL/MM."
+msgstr ""
+"Цей розділ охоплює функції топології для додавання, переміщення, видалення "
+"та розділення ребер, граней та вузлів. Усі ці функції визначені стандартом "
+"ISO SQL/MM."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds an isolated node to a face in a topology and returns the nodeid of the "
+"new node. If face is null, the node is still created."
+msgstr ""
+"Додає ізольований вузол до грані в топології та повертає ідентифікатор "
+"нового вузла. Якщо грань має нульове значення, вузол все одно створюється."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds an isolated node with point location <varname>apoint</varname> to an "
+"existing face with faceid <varname>aface</varname> to a topology "
+"<varname>atopology</varname> and returns the nodeid of the new node."
+msgstr ""
+"Додає ізольований вузол із точкою розташування <varname>apoint</varname> до "
+"існуючої грані з ідентифікатором грані <varname>aface</varname> до топології "
+"<varname>atopology</varname> і повертає ідентифікатор нового вузла."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the spatial reference system (srid) of the point geometry is not the same "
+"as the topology, the <varname>apoint</varname> is not a point geometry, the "
+"point is null, or the point intersects an existing edge (even at the "
+"boundaries) then an exception is thrown. If the point already exists as a "
+"node, an exception is thrown."
+msgstr ""
+"Якщо система просторових координат (srid) геометрії точки не збігається з "
+"топологією, <varname>apoint</varname> не є геометрією точки, точка є "
+"нульовою або точка перетинає існуючу ребро (навіть на межі), то виникає "
+"виняток. Якщо точка вже існує як вузол, виникає виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>aface</varname> is not null and the <varname>apoint</varname> is "
+"not within the face, then an exception is thrown."
+msgstr ""
+"Якщо <varname>aface</varname> не дорівнює нулю, а <varname>apoint</varname> "
+"не знаходиться в межах грані, то генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM: Topo-Net Routines: X+1.3.1"
+msgstr "&sqlmm_compliant; SQL-MM: Топо-мережеві процедури: X+1.3.1"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CreateTopology\"/>, <xref linkend=\"DropTopology\"/>, "
+"<xref linkend=\"ST_Intersects\"/>"
+msgstr ""
+", <xref linkend=\"CreateTopology\"/>, <xref linkend=\"DropTopology\"/>, "
+"<xref linkend=\"ST_Intersects\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Adds an isolated edge defined by geometry <varname>alinestring</"
+"varname> to a topology connecting two existing isolated nodes "
+"<varname>anode</varname> and <varname>anothernode</varname> and returns the "
+"edge id of the new edge.</refpurpose>"
+msgstr ""
+"<refpurpose>Додає ізольоване ребро, визначене геометрією "
+"<varname>alinestring</varname>, до топології, що з'єднує два існуючі "
+"ізольовані вузли <varname>anode</varname> та <varname>anothernode</varname>, "
+"і повертає ідентифікатор нового ребра.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Adds an isolated edge defined by geometry <varname>alinestring</"
+"varname> to a topology connecting two existing isolated nodes "
+"<varname>anode</varname> and <varname>anothernode</varname> and returns the "
+"edge id of the new edge.</para>"
+msgstr ""
+"<para>Додає ізольоване ребро, визначене геометрією <varname>alinestring</"
+"varname>, до топології, що з'єднує два існуючі ізольовані вузли "
+"<varname>anode</varname> та <varname>anothernode</varname>, і повертає "
+"ідентифікатор нового ребра.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the spatial reference system (srid) of the <varname>alinestring</varname> "
+"geometry is not the same as the topology, any of the input arguments are "
+"null, or the nodes are contained in more than one face, or the nodes are "
+"start or end nodes of an existing edge, then an exception is thrown."
+msgstr ""
+"Якщо система просторових посилань (srid) геометрії <varname>alinestring</"
+"varname> не збігається з топологією, будь-який з вхідних аргументів має "
+"значення null, або вузли містяться в більш ніж одній грані, або вузли є "
+"початковими або кінцевими вузлами існуючої ребра, то генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>alinestring</varname> is not within the face of the face the "
+"<varname>anode</varname> and <varname>anothernode</varname> belong to, then "
+"an exception is thrown."
+msgstr ""
+"Якщо <varname>alinestring</varname> не знаходиться в межах грані, до якої "
+"належать <varname>anode</varname> та <varname>anothernode</varname>, то "
+"генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>anode</varname> and <varname>anothernode</varname> are not "
+"the start and end points of the <varname>alinestring</varname> then an "
+"exception is thrown."
+msgstr ""
+"Якщо <varname>anode</varname> та <varname>anothernode</varname> не є "
+"початковою та кінцевою точками <varname>alinestring</varname>, то "
+"генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.4"
+msgstr "&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X.3"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_IsSimple\"/>, <xref linkend=\"ST_Within\"/>"
+msgstr ", <xref linkend=\"ST_IsSimple\"/>, <xref linkend=\"ST_Within\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Add a new edge and, if in doing so it splits a face, delete the original "
+"face and replace it with two new faces."
+msgstr ""
+"Додайте нову ребро і, якщо при цьому розділяється грань, видаліть "
+"оригінальну грань і замініть її двома новими."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Add a new edge and, if in doing so it splits a face, delete the original "
+"face and replace it with two new faces. Returns the id of the newly added "
+"edge."
+msgstr ""
+"Додайте нове ребро і, якщо при цьому розділяється грань, видаліть "
+"оригінальну грань і замініть її двома новими гранями. Повертає ідентифікатор "
+"новододаного ребра."
+
+#. Tag: para
+#, no-c-format
+msgid "Updates all existing joined edges and relationships accordingly."
+msgstr "Відповідно оновлює всі існуючі з'єднані ребра та взаємозв'язки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any arguments are null, the given nodes are unknown (must already exist "
+"in the <varname>node</varname> table of the topology schema) , the "
+"<varname>acurve</varname> is not a <varname>LINESTRING</varname>, the "
+"<varname>anode</varname> and <varname>anothernode</varname> are not the "
+"start and endpoints of <varname>acurve</varname> then an error is thrown."
+msgstr ""
+"Якщо будь-які аргументи мають нульове значення, вказані вузли невідомі ("
+"повинні вже існувати в таблиці <varname>node</varname> схеми топології) , "
+"<varname>acurve</varname> не є <varname>LINESTRING</varname>, "
+"<varname>anode</varname> та <varname>anothernode</varname> не є початковою "
+"та кінцевою точками <varname>acurve</varname>, тоді генерується помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the spatial reference system (srid) of the <varname>acurve</varname> "
+"geometry is not the same as the topology an exception is thrown."
+msgstr ""
+"Якщо система просторових посилань (srid) геометрії <varname>acurve</varname> "
+"не збігається з топологією, виникає виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.12"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X.3.12"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Add a new edge and, if in doing so it splits a face, modify the original "
+"face and add a new face."
+msgstr ""
+"Додайте нову кромку і, якщо при цьому розділяється грань, змініть вихідну "
+"грань і додайте нову."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Add a new edge and, if doing so splits a face, modify the original face and "
+"add a new one."
+msgstr ""
+"Додайте нове ребро і, якщо це призведе до розділення грані, змініть "
+"оригінальну грань і додайте нову."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If possible, the new face will be created on left side of the new edge. This "
+"will not be possible if the face on the left side will need to be the "
+"Universe face (unbounded)."
+msgstr ""
+"Якщо можливо, нова грань буде створена зліва від нового ребра. Це буде "
+"неможливо, якщо грань зліва повинна бути необмеженою."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the id of the newly added edge."
+msgstr "Повертає ідентифікатор новододаного ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.13"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X.3.13"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Removes an edge and, if the removed edge separated two faces, "
+"delete the original faces and replace them with a new face.</refpurpose>"
+msgstr ""
+"<refpurpose>Видаляє ребро і, якщо видалене ребро розділяло дві грані, "
+"видаляє оригінальні грані та замінює їх новою гранею.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Removes an edge and, if the removed edge separated two faces, delete "
+"the original faces and replace them with a new face.</para>"
+msgstr ""
+"<para>Видаляє ребро і, якщо видалене ребро розділяло дві грані, видаляє "
+"оригінальні грані та замінює їх новою гранею.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the id of a newly created face or NULL, if no new face is created. "
+"No new face is created when the removed edge is dangling or isolated or "
+"confined with the universe face (possibly making the universe flood into the "
+"face on the other side)."
+msgstr ""
+"Повертає ідентифікатор новоствореної грані або NULL, якщо нова грань не "
+"створена. Нова грань не створюється, якщо видалена ребро є висячою, "
+"ізольованою або обмеженою гранею всесвіту (що може призвести до затоплення "
+"всесвіту гранею з іншого боку)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refuses to remove an edge participating in the definition of an existing "
+"TopoGeometry. Refuses to heal two faces if any TopoGeometry is defined by "
+"only one of them (and not the other)."
+msgstr ""
+"Відмовляється видаляти край, що бере участь у визначенні існуючої "
+"TopoGeometry. Відмовляється виправляти дві грані, якщо будь-яка TopoGeometry "
+"визначена тільки однією з них (а не іншою)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any arguments are null, the given edge is unknown (must already exist in "
+"the <varname>edge</varname> table of the topology schema), the topology name "
+"is invalid then an error is thrown."
+msgstr ""
+"Якщо будь-які аргументи мають нульове значення, задана ребро невідома ("
+"повинна вже існувати в таблиці <varname>edge</varname> схеми топології), "
+"ім'я топології недійсне, то генерується помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.14"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X.3.14"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Removes an edge, and if the edge separates two faces deletes one face and "
+"modifies the other face to cover the space of both."
+msgstr ""
+"Видаляє ребро, і якщо ребро розділяє дві грані, видаляє одну грань і "
+"модифікує іншу грань, щоб покрити простір обох."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Removes an edge, and if the removed edge separates two faces deletes one "
+"face and modifies the other face to cover the space of both. Preferentially "
+"keeps the face on the right, to be consistent with <xref "
+"linkend=\"ST_AddEdgeModFace\"/>. Returns the id of the face which is "
+"preserved."
+msgstr ""
+"Видаляє ребро, і якщо видалене ребро розділяє дві грані, видаляє одну грань "
+"і модифікує іншу грань, щоб покрити простір обох. Переважно зберігає грань "
+"праворуч, щоб забезпечити узгодженість з <xref linkend=\"ST_AddEdgeModFace\"/"
+">. Повертає ідентифікатор грані, яка зберігається."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.15"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X.3.15"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Changes the shape of an edge without affecting the topology "
+"structure.</refpurpose>"
+msgstr ""
+"<refpurpose>Змінює форму ребра, не впливаючи на топологічну "
+"структуру.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Changes the shape of an edge without affecting the topology structure."
+"</para>"
+msgstr "<para>Змінює форму ребра, не впливаючи на топологічну структуру.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any arguments are null, the given edge does not exist in the "
+"<varname>edge</varname> table of the topology schema, the <varname>acurve</"
+"varname> is not a <varname>LINESTRING</varname>, or the modification would "
+"change the underlying topology then an error is thrown."
+msgstr ""
+"Якщо будь-які аргументи мають значення null, задана ребро не існує в таблиці "
+"<varname>edge</varname> схеми топології, <varname>acurve</varname> не є "
+"<varname>LINESTRING</varname>, або модифікація змінить базову топологію, то "
+"буде видано помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the new <varname>acurve</varname> is not simple, then an error is thrown."
+msgstr "Якщо новий <varname>acurve</varname> не є простим, то виникає помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If moving the edge from old to new position would hit an obstacle then an "
+"error is thrown."
+msgstr ""
+"Якщо переміщення ребра зі старого положення в нове призведе до зіткнення з "
+"перешкодою, буде видано помилку."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.0"
+msgstr "Доступність: 1.1.0"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 adds topological consistency enforcement"
+msgstr "Покращено: у версії 2.0.0 додано забезпечення топологічної узгодженості"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details X.3.6"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі рутинних операцій X."
+"3.6"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Split an edge by creating a new node along an existing edge, modifying the "
+"original edge and adding a new edge."
+msgstr ""
+"Розділіть ребро, створивши новий вузол уздовж існуючого ребра, змінивши "
+"оригінальне ребро та додавши нове."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Split an edge by creating a new node along an existing edge, modifying the "
+"original edge and adding a new edge. Updates all existing joined edges and "
+"relationships accordingly. Returns the identifier of the newly added node."
+msgstr ""
+"Розділити ребро, створивши новий вузол уздовж існуючого ребра, змінивши "
+"оригінальне ребро та додавши нове ребро. Відповідно оновлює всі існуючі "
+"з'єднані ребра та відносини. Повертає ідентифікатор новододаного вузла."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0 - In prior versions, this was misnamed ST_ModEdgesSplit"
+msgstr ""
+"Змінено: 2.0 — у попередніх версіях це було неправильно названо "
+"ST_ModEdgesSplit"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X.3.9"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X.3.9"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ModEdgeHeal\"/>, <xref linkend=\"ST_NewEdgeHeal\"/>, "
+"<xref linkend=\"AddEdge\"/>"
+msgstr ""
+", <xref linkend=\"ST_ModEdgeHeal\"/>, <xref linkend=\"ST_NewEdgeHeal\"/>, "
+"<xref linkend=\"AddEdge\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Heals two edges by deleting the node connecting them, modifying the first "
+"edge and deleting the second edge. Returns the id of the deleted node."
+msgstr ""
+"Виправляє двa ребра, видаляючи вузол, що їх з'єднує, змінюючи перше ребро та "
+"видаляючи друге ребро. Повертає ідентифікатор видаленого вузла."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Heals two edges by deleting the node connecting them, modifying the first "
+"edge and deleting the second edge. Returns the id of the deleted node. "
+"Updates all existing joined edges and relationships accordingly."
+msgstr ""
+"Виправляє два ребра, видаляючи вузол, що їх з'єднує, змінюючи перше ребро та "
+"видаляючи друге ребро. Повертає ідентифікатор видаленого вузла. Відповідно "
+"оновлює всі існуючі з'єднані ребра та відносини."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Heals two edges by deleting the node connecting them, deleting both edges, "
+"and replacing them with an edge whose direction is the same as the first "
+"edge provided."
+msgstr ""
+"Відновлює два ребра, видаляючи вузол, що їх з'єднує, видаляючи обидва ребра "
+"та замінюючи їх ребром, напрямок якого збігається з напрямком першого "
+"наданого ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Heals two edges by deleting the node connecting them, deleting both edges, "
+"and replacing them with an edge whose direction is the same as the first "
+"edge provided. Returns the id of the new edge replacing the healed ones. "
+"Updates all existing joined edges and relationships accordingly."
+msgstr ""
+"Виправляє дві ребра, видаляючи вузол, що їх з'єднує, видаляючи обидві ребра "
+"та замінюючи їх ребром, напрямок якого збігається з напрямком першого "
+"наданого ребра. Повертає ідентифікатор нового ребра, що замінює виправлені "
+"ребра. Відповідно оновлює всі існуючі з'єднані ребра та відносини."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Moves an isolated node in a topology from one point to another. If new "
+"<varname>apoint</varname> geometry exists as a node an error is thrown. "
+"Returns description of move."
+msgstr ""
+"Переміщує ізольований вузол у топології з однієї точки в іншу. Якщо нова "
+"геометрія <varname>apoint</varname> існує як вузол, виникає помилка. "
+"Повертає опис переміщення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Moves an isolated node in a topology from one point to another. If new "
+"<varname>apoint</varname> geometry exists as a node an error is thrown."
+msgstr ""
+"Переміщує ізольований вузол у топології з однієї точки в іншу. Якщо нова "
+"геометрія <varname>apoint</varname> існує як вузол, виникає помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any arguments are null, the <varname>apoint</varname> is not a point, the "
+"existing node is not isolated (is a start or end point of an existing edge), "
+"new node location intersects an existing edge (even at the end points) or "
+"the new location is in a different face (since 3.2.0) then an exception is "
+"thrown."
+msgstr ""
+"Якщо будь-які аргументи мають нульове значення, <varname>apoint</varname> не "
+"є точкою, існуючий вузол не є ізольованим (є початковою або кінцевою точкою "
+"існуючої ребра), нове розташування вузла перетинає існуючу ребро (навіть у "
+"кінцевих точках) або нове розташування знаходиться в іншій грані (починаючи "
+"з версії 3.2.0), то генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the spatial reference system (srid) of the point geometry is not the same "
+"as the topology an exception is thrown."
+msgstr ""
+"Якщо система просторових координат (srid) геометрії точки не збігається з "
+"топологією, генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.2.0 ensures the nod cannot be moved in a different face"
+msgstr ""
+"Покращено: версія 3.2.0 гарантує, що вузол не можна перемістити на іншу грань"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM: Topo-Net Routines: X.3.2"
+msgstr "&sqlmm_compliant; SQL-MM: Процедури Topo-Net: X.3.2"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Split an edge by creating a new node along an existing edge, deleting the "
+"original edge and replacing it with two new edges. Returns the id of the new "
+"node created that joins the new edges."
+msgstr ""
+"Розділіть ребро, створивши новий вузол уздовж існуючого ребра, видаливши "
+"оригінальне ребро і замінивши його двома новими ребрами. Повертає "
+"ідентифікатор нового вузла, створеного для з'єднання нових ребер."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Split an edge with edge id <varname>anedge</varname> by creating a new node "
+"with point location <varname>apoint</varname> along current edge, deleting "
+"the original edge and replacing it with two new edges. Returns the id of the "
+"new node created that joins the new edges. Updates all existing joined edges "
+"and relationships accordingly."
+msgstr ""
+"Розділити ребро з ідентифікатором <varname>anedge</varname> шляхом створення "
+"нового вузла з точкою розташування <varname>apoint</varname> вздовж "
+"поточного ребра, видалення оригінального ребра та заміни його двома новими "
+"ребрами. Повертає ідентифікатор нового вузла, створеного для з'єднання нових "
+"ребер. Відповідно оновлює всі існуючі з'єднані ребра та відносини."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the spatial reference system (srid) of the point geometry is not the same "
+"as the topology, the <varname>apoint</varname> is not a point geometry, the "
+"point is null, the point already exists as a node, the edge does not "
+"correspond to an existing edge or the point is not within the edge then an "
+"exception is thrown."
+msgstr ""
+"Якщо система просторових посилань (srid) геометрії точки не збігається з "
+"топологією, <varname>apoint</varname> не є геометрією точки, точка є "
+"нульовою, точка вже існує як вузол, край не відповідає існуючому краю або "
+"точка не знаходиться в межах краю, то генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM: Topo-Net Routines: X.3.8"
+msgstr "&sqlmm_compliant; SQL-MM: Процедури Topo-Net: X.3.8"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Removes an isolated node and returns description of action. If "
+"the node is not isolated (is start or end of an edge), then an exception is "
+"thrown.</refpurpose>"
+msgstr ""
+"<refpurpose>Видаляє ізольований вузол і повертає опис дії. Якщо вузол не "
+"ізольований (є початком або кінцем ребра), то генерується "
+"виняток.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Removes an isolated node and returns description of action. If the "
+"node is not isolated (is start or end of an edge), then an exception is "
+"thrown.</para>"
+msgstr ""
+"<para>Видаляє ізольований вузол і повертає опис дії. Якщо вузол не "
+"ізольований (є початком або кінцем ребра), то генерується виняток.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details: X+1.3.3"
+msgstr ""
+"&sqlmm_compliant; SQL-MM: Topo-Geo та Topo-Net 3: Деталі процедури: X+1.3.3"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Removes an isolated edge and returns description of action. If "
+"the edge is not isolated, then an exception is thrown.</refpurpose>"
+msgstr ""
+"<refpurpose>Видаляє ізольовану грань і повертає опис дії. Якщо грань не "
+"ізольована, то генерується виняток.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Removes an isolated edge and returns description of action. If the "
+"edge is not isolated, then an exception is thrown.</para>"
+msgstr ""
+"<para>Видаляє ізольовану грань і повертає опис дії. Якщо грань не "
+"ізольована, то генерується виняток.</para>"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Accessors"
+msgstr "Топологічні методи доступу"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Finds the edge-id of an edge that intersects a given point."
+msgstr "Знаходить ідентифікатор ребра, яке перетинає задану точку."
+
+#. Tag: para
+#, no-c-format
+msgid "Retrieves the id of an edge that intersects a Point."
+msgstr "Отримує ідентифікатор ребра, яке перетинає точку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function returns an integer (id-edge) given a topology, a POINT and a "
+"tolerance. If tolerance = 0 then the point has to intersect the edge."
+msgstr ""
+"Функція повертає ціле число (id-edge) за заданою топологією, точкою POINT і "
+"допуском tolerance. Якщо tolerance = 0, то точка повинна перетинати край."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>apoint</varname> doesn't intersect an edge, returns 0 (zero)."
+msgstr "Якщо <varname>apoint</varname> не перетинає ребро, повертає 0 (нуль)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If use tolerance > 0 and there is more than one edge near the point then "
+"an exception is thrown."
+msgstr ""
+"Якщо використання tolerance > 0 і поблизу точки є більше ніж одна грань, "
+"то виникає виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If tolerance = 0, the function uses ST_Intersects otherwise uses ST_DWithin."
+msgstr ""
+"Якщо tolerance = 0, функція використовує ST_Intersects, в іншому випадку "
+"використовує ST_DWithin."
+
+#. Tag: para
+#, no-c-format
+msgid "Performed by the GEOS module."
+msgstr "Виконується модулем GEOS."
+
+#. Tag: para
+#, no-c-format
+msgid "These examples use edges we created in <xref linkend=\"AddEdge\"/>"
+msgstr ""
+"У цих прикладах використовуються ребра, які ми створили в <xref linkend="
+"\"AddEdge\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"GetNodeByPoint\"/>, <xref linkend=\"GetFaceByPoint\"/>"
+msgstr ""
+", <xref linkend=\"GetNodeByPoint\"/>, <xref linkend=\"GetFaceByPoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Finds face intersecting a given point."
+msgstr "Знаходить грань, що перетинає задану точку."
+
+#. Tag: para
+#, no-c-format
+msgid "Finds a face referenced by a Point, with given tolerance."
+msgstr "Знаходить грань, на яку вказує точка, з заданим допуском."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function will effectively look for a face intersecting a circle having "
+"the point as center and the tolerance as radius."
+msgstr ""
+"Функція ефективно шукатиме грань, що перетинає коло з центром у точці та "
+"радіусом, що відповідає допуску."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no face intersects the given query location, 0 is returned (universal "
+"face)."
+msgstr ""
+"Якщо жодна поверхня не перетинає задане місце пошуку, повертається 0 ("
+"універсальна поверхня)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If more than one face intersect the query location an exception is thrown."
+msgstr "Якщо більше ніж одна грань перетинає місце запиту, генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.2.0 more efficient implementation and clearer contract, stops "
+"working with invalid topologies."
+msgstr ""
+"Покращено: 3.2.0 більш ефективна реалізація та чіткіший контракт, припиняє "
+"роботу з недійсними топологіями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"AddFace\"/>, <xref linkend=\"GetNodeByPoint\"/>, <xref "
+"linkend=\"GetEdgeByPoint\"/>"
+msgstr ""
+", <xref linkend=\"AddFace\"/>, <xref linkend=\"GetNodeByPoint\"/>, <xref "
+"linkend=\"GetEdgeByPoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Finds the face containing a point."
+msgstr "Знаходить обличчя, що містить точку."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the id of the face containing a point."
+msgstr "Повертає ідентифікатор грані, що містить точку."
+
+#. Tag: para
+#, no-c-format
+msgid "An exception is thrown if the point falls on a face boundary."
+msgstr "Якщо точка потрапляє на межу грані, генерується виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function relies on a valid topology, using edge linking and face "
+"labeling."
+msgstr ""
+"Функція базується на дійсній топології, використовуючи зв'язки між ребрами "
+"та маркування граней."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Finds the node-id of a node at a point location."
+msgstr "Знаходить ідентифікатор вузла в точці."
+
+#. Tag: para
+#, no-c-format
+msgid "Retrieves the id of a node at a point location."
+msgstr "Отримує ідентифікатор вузла в точці розташування."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function returns an integer (id-node) given a topology, a POINT and a "
+"tolerance. If tolerance = 0 means exact intersection, otherwise retrieves "
+"the node from an interval."
+msgstr ""
+"Функція повертає ціле число (id-node) за заданою топологією, POINT і "
+"допуском. Якщо допуск = 0, це означає точне перетин, в іншому випадку "
+"витягує вузол з інтервалу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>apoint</varname> doesn't intersect a node, returns 0 (zero)."
+msgstr "Якщо <varname>apoint</varname> не перетинає вузол, повертає 0 (нуль)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If use tolerance > 0 and there is more than one node near the point then "
+"an exception is thrown."
+msgstr ""
+"Якщо використання tolerance > 0 і поблизу точки знаходиться більше одного "
+"вузла, то виникає виняток."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"GetEdgeByPoint\"/>, <xref linkend=\"GetFaceByPoint\"/>"
+msgstr ""
+", <xref linkend=\"GetEdgeByPoint\"/>, <xref linkend=\"GetFaceByPoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the id of a topology in the topology.topology table "
+"given the name of the topology.</refpurpose>"
+msgstr ""
+"<refpurpose>Повертає ідентифікатор топології в таблиці topology.topology за "
+"назвою топології.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the id of a topology in the topology.topology table given the "
+"name of the topology.</para>"
+msgstr ""
+"<para>Повертає ідентифікатор топології в таблиці topology.topology за назвою "
+"топології.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"DropTopology\"/>, <xref linkend=\"GetTopologyName\"/>, "
+"<xref linkend=\"GetTopologySRID\"/>"
+msgstr ""
+", <xref linkend=\"DropTopology\"/>, <xref linkend=\"GetTopologyName\"/>, "
+"<xref linkend=\"GetTopologySRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the SRID of a topology in the topology.topology table given the name "
+"of the topology."
+msgstr ""
+"Повертає SRID топології в таблиці topology.topology, задавши ім'я топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the spatial reference id of a topology in the topology.topology "
+"table given the name of the topology."
+msgstr ""
+"Повертає ідентифікатор просторового посилання топології в таблиці "
+"topology.topology за назвою топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"DropTopology\"/>, <xref linkend=\"GetTopologyName\"/>, "
+"<xref linkend=\"GetTopologyID\"/>"
+msgstr ""
+", <xref linkend=\"DropTopology\"/>, <xref linkend=\"GetTopologyName\"/>, "
+"<xref linkend=\"GetTopologyID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the name of a topology (schema) given the id of the topology."
+msgstr "Повертає назву топології (схеми) за ідентифікатором топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the topology name (schema) of a topology from the topology.topology "
+"table given the topology id of the topology."
+msgstr ""
+"Повертає ім'я топології (схему) з таблиці topology.topology, задавши "
+"ідентифікатор топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"DropTopology\"/>, <xref linkend=\"GetTopologyID\"/>, <xref "
+"linkend=\"GetTopologySRID\"/>"
+msgstr ""
+", <xref linkend=\"DropTopology\"/>, <xref linkend=\"GetTopologyID\"/>, <xref "
+"linkend=\"GetTopologySRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a set of ordered edges that bound <varname>aface</varname>."
+msgstr ""
+"Повертає набір впорядкованих ребер, що обмежують <varname>aface</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of ordered edges that bound <varname>aface</varname>. Each "
+"output consists of a sequence and edgeid. Sequence numbers start with value "
+"1."
+msgstr ""
+"Повертає набір впорядкованих ребер, що обмежують <varname>aface</varname>. "
+"Кожен вихідний елемент складається з послідовності та edgeid. Номери "
+"послідовності починаються з значення 1."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enumeration of each ring edges start from the edge with smallest identifier. "
+"Order of edges follows a left-hand-rule (bound face is on the left of each "
+"directed edge)."
+msgstr ""
+"Перелік кожного краю кільця починається з краю з найменшим ідентифікатором. "
+"Порядок країв відповідає правилу лівої руки (межа знаходиться ліворуч від "
+"кожного спрямованого краю)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM 3 Topo-Geo and Topo-Net 3: Routine Details: X.3.5"
+msgstr ""
+"&sqlmm_compliant; SQL-MM 3 Topo-Geo та Topo-Net 3: Деталі процедури: X.3.5"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"AddFace\"/>, <xref linkend=\"ST_GetFaceGeometry\"/>"
+msgstr ", <xref linkend=\"AddFace\"/>, <xref linkend=\"ST_GetFaceGeometry\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the polygon in the given topology with the specified face id."
+msgstr ""
+"Повертає багатокутник у заданій топології із зазначеним ідентифікатором "
+"грані."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the polygon in the given topology with the specified face id. Builds "
+"the polygon from the edges making up the face."
+msgstr ""
+"Повертає багатокутник у заданій топології із зазначеним ідентифікатором "
+"грані. Будує багатокутник із ребер, що утворюють грань."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM 3 Topo-Geo and Topo-Net 3: Routine Details: X.3.16"
+msgstr ""
+"&sqlmm_compliant; SQL-MM 3 Topo-Geo та Topo-Net 3: Деталі процедури: X.3.16"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the ordered set of signed edge identifiers met by walking on an a "
+"given edge side."
+msgstr ""
+"Повертає впорядкований набір ідентифікаторів підписаних ребер, зустрітих при "
+"проходженні по заданій стороні ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the ordered set of signed edge identifiers met by walking on an a "
+"given edge side. Each output consists of a sequence and a signed edge id. "
+"Sequence numbers start with value 1."
+msgstr ""
+"Повертає впорядкований набір ідентифікаторів підписаних ребер, зустрінутих "
+"під час проходження по заданій стороні ребра. Кожен вихідний елемент "
+"складається з послідовності та ідентифікатора підписаного ребра. Номери "
+"послідовності починаються з значення 1."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you pass a positive edge id, the walk starts on the left side of the "
+"corresponding edge and follows the edge direction. If you pass a negative "
+"edge id, the walk starts on the right side of it and goes backward."
+msgstr ""
+"Якщо ви передаєте позитивний ідентифікатор ребра, проходження починається з "
+"лівого боку відповідного ребра і слідує за напрямком ребра. Якщо ви "
+"передаєте негативний ідентифікатор ребра, проходження починається з правого "
+"боку ребра і йде назад."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>max_edges</varname> is not null no more than those records are "
+"returned by that function. This is meant to be a safety parameter when "
+"dealing with possibly invalid topologies."
+msgstr ""
+"Якщо <varname>max_edges</varname> не дорівнює нулю, функція повертає не "
+"більше цих записів. Це є параметром безпеки при роботі з потенційно "
+"недійсними топологіями."
+
+#. Tag: para
+#, no-c-format
+msgid "This function uses edge ring linking metadata."
+msgstr "Ця функція використовує метадані зв'язку крайових кілець."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"GetNodeEdges\"/>"
+msgstr ", <xref linkend=\"GetNodeEdges\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns an ordered set of edges incident to the given node."
+msgstr "Повертає впорядкований набір ребер, що прилягають до заданого вузла."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an ordered set of edges incident to the given node. Each output "
+"consists of a sequence and a signed edge id. Sequence numbers start with "
+"value 1. A positive edge starts at the given node. A negative edge ends into "
+"the given node. Closed edges will appear twice (with both signs). Order is "
+"clockwise starting from northbound."
+msgstr ""
+"Повертає впорядкований набір ребер, що прилягають до заданого вузла. Кожен "
+"вихідний елемент складається з послідовності та ідентифікатора ребра зі "
+"знаком. Номери послідовності починаються з 1. Позитивне ребро починається в "
+"заданому вузлі. Негативне ребро закінчується в заданому вузлі. Замкнуті "
+"ребра з'являються двічі (з обома знаками). Порядок визначається за "
+"годинниковою стрілкою, починаючи з півночі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function computes ordering rather than deriving from metadata and is "
+"thus usable to build edge ring linking."
+msgstr ""
+"Ця функція обчислює порядок, а не виводить його з метаданих, і тому може "
+"використовуватися для побудови зв'язків між кільцями ребер."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"GetRingEdges\"/>, <xref linkend=\"ST_Azimuth\"/>"
+msgstr ", <xref linkend=\"GetRingEdges\"/>, <xref linkend=\"ST_Azimuth\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Processing"
+msgstr "Обробка топології"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section covers the functions for processing topologies in non-standard "
+"ways."
+msgstr ""
+"Цей розділ описує функції для обробки топологій нестандартними способами."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Finds and registers all faces defined by topology edges."
+msgstr "Знаходить і реєструє всі грані, визначені краями топології."
+
+#. Tag: para
+#, no-c-format
+msgid "Registers all faces that can be built out a topology edge primitives."
+msgstr "Реєструє всі грані, які можна побудувати з примітивів ребер."
+
+#. Tag: para
+#, no-c-format
+msgid "The target topology is assumed to contain no self-intersecting edges."
+msgstr "Припускається, що цільова топологія не містить самоперетинаючих ребер."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Already known faces are recognized, so it is safe to call Polygonize "
+"multiple times on the same topology."
+msgstr ""
+"Вже відомі грані розпізнаються, тому можна безпечно викликати Polygonize "
+"кілька разів для однієї топології."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not use nor set the next_left_edge and next_right_edge "
+"fields of the edge table."
+msgstr ""
+"Ця функція не використовує і не встановлює поля next_left_edge та "
+"next_right_edge таблиці ребер."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Polygonize\"/>"
+msgstr ", <xref linkend=\"ST_Polygonize\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds a point node to the node table in the specified topology schema and "
+"returns the nodeid of new node. If point already exists as node, the "
+"existing nodeid is returned."
+msgstr ""
+"Додає точковий вузол до таблиці вузлів у вказаній схемі топології та "
+"повертає ідентифікатор нового вузла. Якщо точка вже існує як вузол, "
+"повертається існуючий ідентифікатор вузла."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a point node to the node table in the specified topology schema. The "
+"<xref linkend=\"AddEdge\"/> function automatically adds start and end points "
+"of an edge when called so not necessary to explicitly add nodes of an edge."
+msgstr ""
+"Додає точковий вузол до таблиці вузлів у вказаній схемі топології. Функція "
+"<xref linkend=\"AddEdge\"/> автоматично додає початкову та кінцеву точки "
+"ребра при виклику, тому немає необхідності явно додавати вузли ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any edge crossing the node is found either an exception is raised or the "
+"edge is split, depending on the <varname>allowEdgeSplitting</varname> "
+"parameter value."
+msgstr ""
+"Якщо виявлено будь-яке ребро, що перетинає вузол, то, залежно від значення "
+"параметра <varname>allowEdgeSplitting</varname>, або генерується виняток, "
+"або ребро розділяється."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>computeContainingFace</varname> is true a newly added node would "
+"get the correct containing face computed."
+msgstr ""
+"Якщо <varname>computeContainingFace</varname> має значення true, для "
+"новододаного вузла буде обчислено правильну грань, що його містить."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>apoint</varname> geometry already exists as a node, the node "
+"is not added but the existing nodeid is returned."
+msgstr ""
+"Якщо геометрія <varname>apoint</varname> вже існує як вузол, вузол не "
+"додається, а повертається існуючий nodeid."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CreateTopology\"/>"
+msgstr ", <xref linkend=\"CreateTopology\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds a linestring edge to the edge table and associated start and end points "
+"to the point nodes table of the specified topology schema using the "
+"specified linestring geometry and returns the edgeid of the new (or "
+"existing) edge."
+msgstr ""
+"Додає лінійний край до таблиці країв ребер та пов'язані початкові та кінцеві "
+"точки до таблиці вузлів точок заданої топологічної схеми, використовуючи "
+"задану геометрію лінійного ребра, та повертає ідентифікатор нового (або "
+"існуючого) ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds an edge to the edge table and associated nodes to the nodes table of "
+"the specified <varname>toponame</varname> schema using the specified "
+"linestring geometry and returns the edgeid of the new or existing record. "
+"The newly added edge has \"universe\" face on both sides and links to itself."
+msgstr ""
+"Додає ребро до таблиці ребер і пов'язані вузли до таблиці вузлів заданої "
+"схеми <varname>toponame</varname> з використанням заданої геометрії "
+"лінійного рядка та повертає edgeid нового або існуючого запису. Новододане "
+"ребро має обох боків \"універсум\" і пов'язане саме з собою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>aline</varname> geometry crosses, overlaps, contains or is "
+"contained by an existing linestring edge, then an error is thrown and the "
+"edge is not added."
+msgstr ""
+"Якщо геометрія <varname>aline</varname> перетинає, перекриває, містить або "
+"міститься в існуючій лінії, то виникає помилка і ребро не додається."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geometry of <varname>aline</varname> must have the same <varname>srid</"
+"varname> as defined for the topology otherwise an invalid spatial reference "
+"sys error will be thrown."
+msgstr ""
+"Геометрія <varname>aline</varname> повинна мати той самий <varname>srid</"
+"varname>, що визначений для топології, інакше буде видано помилку недійсного "
+"просторового посилання sys."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"TopoGeo_AddLineString\"/> "
+"instead."
+msgstr ""
+"застаріло з версії 3.5.0. Замість цього використовуйте <xref linkend="
+"\"TopoGeo_AddLineString\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CreateTopology\"/>, <xref linkend=\"spatial_ref_sys\"/>"
+msgstr ""
+", <xref linkend=\"CreateTopology\"/>, <xref linkend=\"spatial_ref_sys\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Registers a face primitive to a topology and gets its identifier."
+"</refpurpose>"
+msgstr ""
+"<refpurpose>Реєструє примітив грані в топології та отримує його "
+"ідентифікатор.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Registers a face primitive to a topology and gets its identifier.</"
+"para>"
+msgstr ""
+"<para>Реєструє примітив грані в топології та отримує його "
+"ідентифікатор.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For a newly added face, the edges forming its boundaries and the ones "
+"contained in the face will be updated to have correct values in the "
+"left_face and right_face fields. Isolated nodes contained in the face will "
+"also be updated to have a correct containing_face field value."
+msgstr ""
+"Для новододаної грані краї, що утворюють її межі, та краї, що містяться в "
+"грані, будуть оновлені, щоб мати правильні значення в полях left_face та "
+"right_face. Ізольовані вузли, що містяться в грані, також будуть оновлені, "
+"щоб мати правильне значення поля containing_face."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The target topology is assumed to be valid (containing no self-intersecting "
+"edges). An exception is raised if: The polygon boundary is not fully defined "
+"by existing edges or the polygon overlaps an existing face."
+msgstr ""
+"Припускається, що топологія цілі є правильною (не містить самоперетинаючих "
+"ребер). Виникає виняток, якщо: Межа багатокутника не повністю визначена "
+"існуючими ребрами або багатокутник перетинає існуючу грань."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>apolygon</varname> geometry already exists as a face, then: "
+"if <varname>force_new</varname> is false (the default) the face id of the "
+"existing face is returned; if <varname>force_new</varname> is true a new id "
+"will be assigned to the newly registered face."
+msgstr ""
+"Якщо геометрія <varname>apolygon</varname> вже існує як грань, то: якщо "
+"<varname>force_new</varname> має значення false (за замовчуванням), "
+"повертається ідентифікатор існуючої грані; якщо <varname>force_new</varname> "
+"має значення true, новому зареєстрованому грані присвоюється новий "
+"ідентифікатор."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When a new registration of an existing face is performed (force_new=true), "
+"no action will be taken to resolve dangling references to the existing face "
+"in the edge, node an relation tables, nor will the MBR field of the existing "
+"face record be updated. It is up to the caller to deal with that."
+msgstr ""
+"Коли виконується нова реєстрація існуючої грані (force_new=true), не буде "
+"виконано жодних дій для вирішення висячих посилань на існуючу грань у "
+"таблицях ребер, вузлів та відносин, а також не буде оновлено поле MBR "
+"існуючого запису грані. Це має зробити викликаючий."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>apolygon</varname> geometry must have the same <varname>srid</"
+"varname> as defined for the topology otherwise an invalid spatial reference "
+"sys error will be thrown."
+msgstr ""
+"Геометрія <varname>apolygon</varname> повинна мати той самий <varname>srid</"
+"varname>, що визначено для топології, інакше буде видано помилку недійсного "
+"просторового посилання sys."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a \"simplified\" geometry version of the given TopoGeometry using "
+"the Douglas-Peucker algorithm."
+msgstr ""
+"Повертає \"спрощену\" версію геометрії заданої TopoGeometry за допомогою "
+"алгоритму Дугласа-Пеукера."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a \"simplified\" geometry version of the given TopoGeometry using "
+"the Douglas-Peucker algorithm on each component edge."
+msgstr ""
+"Повертає \"спрощену\" геометрію заданої TopoGeometry, використовуючи алгоритм "
+"Дугласа-Пеукера для кожного компонента ребра."
+
+#. Tag: para
+#, no-c-format
+msgid "The returned geometry may be non-simple or non-valid."
+msgstr "Повернена геометрія може бути неспрощеною або недійсна."
+
+#. Tag: para
+#, no-c-format
+msgid "Splitting component edges may help retaining simplicity/validity."
+msgstr ""
+"Розділення граней компонентів може допомогти зберегти простоту/дійсність."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry <xref linkend=\"ST_Simplify\"/>, <xref linkend=\"ST_IsSimple\"/>, "
+"<xref linkend=\"ST_IsValid\"/>, <xref linkend=\"ST_ModEdgeSplit\"/>"
+msgstr ""
+"Геометрія <xref linkend=\"ST_Simplify\"/>, <xref linkend=\"ST_IsSimple\"/>, "
+"<xref linkend=\"ST_IsValid\"/>, <xref linkend=\"ST_ModEdgeSplit\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Removes topology primitives which not needed to define existing TopoGeometry "
+"objects."
+msgstr ""
+"Видаляє примітивні елементи топології, які не потрібні для визначення "
+"існуючих об'єктів TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Finds all primitives (nodes, edges, faces) that are not strictly needed to "
+"represent existing TopoGeometry objects and removes them, maintaining "
+"topology validity (edge linking, face labeling) and TopoGeometry space "
+"occupation."
+msgstr ""
+"Знаходить всі примітиви (вузли, ребра, грані), які не є строго необхідними "
+"для представлення існуючих об'єктів TopoGeometry, і видаляє їх, зберігаючи "
+"топологічну валідність (зв'язки ребер, маркування граней) і зайнятість "
+"простору TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"No new primitive identifiers are created, but rather existing primitives are "
+"expanded to include merged faces (upon removing edges) or healed edges (upon "
+"removing nodes)."
+msgstr ""
+"Нові примітивні ідентифікатори не створюються, а існуючі примітиви "
+"розширюються, щоб включити об'єднані грані (після видалення ребер) або "
+"відновлені ребра (після видалення вузлів)."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.3.0"
+msgstr "Доступність: 3.3.0"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_RemEdgeModFace\"/>"
+msgstr ", <xref linkend=\"ST_RemEdgeModFace\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "TopoGeometry Constructors"
+msgstr "Конструктори топогеометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section covers the topology functions for creating new topogeometries."
+msgstr ""
+"Цей розділ присвячений функціям топології для створення нових топогеометрій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a new topo geometry object from topo element array - tg_type: 1:"
+"[multi]point, 2:[multi]line, 3:[multi]poly, 4:collection"
+msgstr ""
+"Створює новий об'єкт топографічної геометрії з масиву топографічних "
+"елементів - tg_type: 1:[multi]point, 2:[multi]line, 3:[multi]poly, "
+"4:collection"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a topogeometry object for layer denoted by <varname>layer_id</"
+"varname> and registers it in the relations table in the <varname>toponame</"
+"varname> schema."
+msgstr ""
+"Створює об'єкт топогеометрії для шару, позначеного <varname>layer_id</"
+"varname>, і реєструє його в таблиці відносин у схемі "
+"<varname>toponame</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>tg_type</varname> is an integer: 1:[multi]point (punctal), 2:"
+"[multi]line (lineal), 3:[multi]poly (areal), 4:collection. "
+"<varname>layer_id</varname> is the layer id in the topology.layer table."
+msgstr ""
+"<varname>tg_type</varname> є цілим числом: 1:[multi]point (точкова), "
+"2:[multi]line (лінійна), 3:[multi]poly (площа), 4:колекція. "
+"<varname>layer_id</varname> є ідентифікатором шару в таблиці topology.layer."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"punctal layers are formed from set of nodes, lineal layers are formed from a "
+"set of edges, areal layers are formed from a set of faces, and collections "
+"can be formed from a mixture of nodes, edges, and faces."
+msgstr ""
+"пунктуальні шари утворюються з набору вузлів, лінійні шари утворюються з "
+"набору ребер, площинні шари утворюються з набору граней, а колекції можуть "
+"утворюватися з суміші вузлів, ребер і граней."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Omitting the array of components generates an empty TopoGeometry object."
+msgstr ""
+"Пропуск масиву компонентів призводить до створення порожнього об'єкта "
+"TopoGeometry."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Form from existing edges"
+msgstr "Приклади: Форма з існуючих ребер"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a topogeom in ri_topo schema for layer 2 (our ri_roads), of type (2) "
+"LINE, for the first edge (we loaded in <varname>ST_CreateTopoGeo</varname>)."
+msgstr ""
+"Створіть топогеометрію в схемі ri_topo для шару 2 (наш ri_roads) типу (2) "
+"LINE для першого ребра (ми завантажили в "
+"<varname>ST_CreateTopoGeo</varname>)."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Convert an areal geometry to best guess topogeometry"
+msgstr ""
+"Приклади: Перетворення плоскої геометрії в найкраще наближену топогеометрію"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Lets say we have geometries that should be formed from a collection of "
+"faces. We have for example blockgroups table and want to know the topo "
+"geometry of each block group. If our data was perfectly aligned, we could do "
+"this:"
+msgstr ""
+"Припустимо, ми маємо геометрії, які повинні бути сформовані з набору граней. "
+"Наприклад, ми маємо таблицю груп блоків і хочемо знати топологічну геометрію "
+"кожної групи блоків. Якщо наші дані були б ідеально вирівняні, ми могли б "
+"зробити так:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"toTopoGeom\"/> <xref linkend=\"ST_CreateTopoGeo\"/>, <xref "
+"linkend=\"ST_GetFaceGeometry\"/>, <xref linkend=\"topoelementarray\"/>, "
+"<xref linkend=\"TopoElementArray_Agg\"/>"
+msgstr ""
+", <xref linkend=\"toTopoGeom\"/> <xref linkend=\"ST_CreateTopoGeo\"/>, <xref "
+"linkend=\"ST_GetFaceGeometry\"/>, <xref linkend=\"topoelementarray\"/>, "
+"<xref linkend=\"TopoElementArray_Agg\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Converts a simple Geometry into a topo geometry."
+msgstr "Перетворює просту геометрію в топологічну геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid "Converts a simple Geometry into a <xref linkend=\"topogeometry\"/>."
+msgstr "Перетворює просту геометрію в <xref linkend=\"topogeometry\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Topological primitives required to represent the input geometry will be "
+"added to the underlying topology, possibly splitting existing ones, and they "
+"will be associated with the output TopoGeometry in the <varname>relation</"
+"varname> table."
+msgstr ""
+"Топологічні примітиви, необхідні для представлення вхідної геометрії, будуть "
+"додані до базової топології, можливо з розділенням існуючих, і будуть "
+"пов'язані з вихідною TopoGeometry в таблиці <varname>relation</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Existing TopoGeometry objects (with the possible exception of "
+"<varname>topogeom</varname>, if given) will retain their shapes."
+msgstr ""
+"Існуючі об'єкти TopoGeometry (за можливим винятком <varname>topogeom</"
+"varname>, якщо вказано) збережуть свої форми."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When <varname>tolerance</varname> is given it will be used to snap the input "
+"geometry to existing primitives."
+msgstr ""
+"Коли вказано <varname>tolerance</varname>, воно буде використовуватися для "
+"прив'язки вхідної геометрії до існуючих примітивів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the first form a new TopoGeometry will be created for the given layer "
+"(<varname>layer_id</varname>) of the given topology (<varname>toponame</"
+"varname>)."
+msgstr ""
+"У першій формі буде створено нову топогеометрію для заданого шару "
+"(<varname>layer_id</varname>) заданої топології "
+"(<varname>toponame</varname>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the second form the primitives resulting from the conversion will be "
+"added to the pre-existing TopoGeometry (<varname>topogeom</varname>), "
+"possibly adding space to its final shape. To have the new shape completely "
+"replace the old one see <xref linkend=\"clearTopoGeom\"/>."
+msgstr ""
+"У другій формі примітиви, отримані в результаті перетворення, будуть додані "
+"до існуючої TopoGeometry (<varname>topogeom</varname>), можливо, додаючи "
+"простір до її остаточної форми. Щоб нова форма повністю замінила стару, див. "
+"<xref linkend=\"clearTopoGeom\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 adds the version taking an existing TopoGeometry."
+msgstr ""
+"Покращено: у версії 2.1.0 додано версію, що використовує існуючу "
+"TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid "This is a full self-contained workflow"
+msgstr "Це повністю автономний робочий процес"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"AddTopoGeometryColumn\"/>, <xref "
+"linkend=\"CreateTopoGeom\"/>, <xref linkend=\"TopologySummary\"/>, <xref "
+"linkend=\"clearTopoGeom\"/>"
+msgstr ""
+", <xref linkend=\"AddTopoGeometryColumn\"/>, <xref linkend=\"CreateTopoGeom\""
+"/>, <xref linkend=\"TopologySummary\"/>, <xref linkend=\"clearTopoGeom\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a <varname>topoelementarray</varname> for a set of element_id, type "
+"arrays (topoelements)."
+msgstr ""
+"Повертає <varname>topoelementarray</varname> для набору масивів element_id, "
+"type (topoelements)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Used to create a <xref linkend=\"topoelementarray\"/> from a set of <xref "
+"linkend=\"topoelement\"/>."
+msgstr ""
+"Використовується для створення <xref linkend=\"topoelementarray\"/> з набору "
+"<xref linkend=\"topoelement\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"topoelementarray\"/>"
+msgstr ", <xref linkend=\"topoelementarray\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Converts a topogeometry to a topoelement."
+msgstr "Перетворює топогеометрію в топоелемент."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converts a <xref linkend=\"topogeometry\"/> to a <xref "
+"linkend=\"topoelement\"/>."
+msgstr ""
+"Перетворює <xref linkend=\"topogeometry\"/> на <xref linkend=\"topoelement\""
+"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"topogeometry\"/>, <xref linkend=\"topoelement\"/>"
+msgstr ", <xref linkend=\"topogeometry\"/>, <xref linkend=\"topoelement\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "TopoGeometry Editors"
+msgstr "Редактори топогеометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section covers the topology functions for editing existing "
+"topogeometries."
+msgstr ""
+"Цей розділ охоплює функції топології для редагування існуючих топогеометрій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Clears the content of a topo geometry."
+msgstr "Очищає вміст геометрії топографії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Clears the content a <xref linkend=\"topogeometry\"/> turning it into an "
+"empty one. Mostly useful in conjunction with <xref linkend=\"toTopoGeom\"/> "
+"to replace the shape of existing objects and any dependent object in higher "
+"hierarchical levels."
+msgstr ""
+"Очищає вміст <xref linkend=\"topogeometry\"/>, перетворюючи його на "
+"порожній. Найчастіше використовується разом з <xref linkend=\"toTopoGeom\"/> "
+"для заміни форми існуючих об'єктів та будь-яких залежних об'єктів на вищих "
+"ієрархічних рівнях."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.1"
+msgstr "Доступність: 2.1"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Adds an element to the definition of a TopoGeometry."
+msgstr "Додає елемент до визначення TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a <xref linkend=\"topoelement\"/> to the definition of a TopoGeometry "
+"object. Does not error out if the element is already part of the definition."
+msgstr ""
+"Додає <xref linkend=\"topoelement\"/> до визначення об'єкта TopoGeometry. Не "
+"видає помилку, якщо елемент вже є частиною визначення."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.3"
+msgstr "Доступність: 2.3"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CreateTopoGeom\"/>"
+msgstr ", <xref linkend=\"CreateTopoGeom\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Removes an element from the definition of a TopoGeometry."
+msgstr "Видаляє елемент з визначення TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Removes a <xref linkend=\"topoelement\"/> from the definition of a "
+"TopoGeometry object."
+msgstr ""
+"Видаляє <xref linkend=\"topoelement\"/> з визначення об'єкта TopoGeometry."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds element of a TopoGeometry to the definition of another TopoGeometry."
+msgstr "Додає елемент TopoGeometry до визначення іншого TopoGeometry."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds the elements of a <xref linkend=\"topogeometry\"/> to the definition of "
+"another TopoGeometry, possibly changing its cached type (type attribute) to "
+"a collection, if needed to hold all elements in the source object."
+msgstr ""
+"Додає елементи <xref linkend=\"topogeometry\"/> до визначення іншого "
+"TopoGeometry, можливо змінюючи його кешований тип (атрибут type) на "
+"колекцію, якщо це необхідно для збереження всіх елементів в об'єкті-джерелі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The two TopoGeometry objects need be defined against the *same* topology "
+"and, if hierarchically defined, need be composed by elements of the same "
+"child layer."
+msgstr ""
+"Два об'єкти TopoGeometry повинні бути визначені відповідно до *однієї і тієї "
+"ж* топології, а якщо вони визначені ієрархічно, то повинні складатися з "
+"елементів одного і того ж дочірнього шару."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.2"
+msgstr "Доступність: 3.2"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"clearTopoGeom\"/>, <xref linkend=\"CreateTopoGeom\"/>"
+msgstr ", <xref linkend=\"clearTopoGeom\"/>, <xref linkend=\"CreateTopoGeom\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Adds a geometry shape to an existing topo geometry."
+msgstr "Додає геометричну фігуру до існуючої топографічної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Refer to <xref linkend=\"toTopoGeom\"/>."
+msgstr "Див. <xref linkend=\"toTopoGeom\"/>."
+
+#. Tag: title
+#, no-c-format
+msgid "TopoGeometry Accessors"
+msgstr "Доступ до топогеометрії"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a <varname>topoelementarray</varname> (an array of topoelements) "
+"containing the topological elements and type of the given TopoGeometry "
+"(primitive elements)."
+msgstr ""
+"Повертає <varname>topoelementarray</varname> (масив топоелементів), що "
+"містить топологічні елементи та тип заданої TopoGeometry (примітивні "
+"елементи)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <xref linkend=\"topoelementarray\"/> containing the topological "
+"elements and type of the given TopoGeometry (primitive elements). This is "
+"similar to GetTopoGeomElements except it returns the elements as an array "
+"rather than as a dataset."
+msgstr ""
+"Повертає <xref linkend=\"topoelementarray\"/>, що містить топологічні "
+"елементи та тип заданої TopoGeometry (примітивні елементи). Це схоже на "
+"GetTopoGeomElements, за винятком того, що повертає елементи у вигляді "
+"масиву, а не набору даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"tg_id is the topogeometry id of the topogeometry object in the topology in "
+"the layer denoted by <varname>layer_id</varname> in the topology.layer table."
+msgstr ""
+"tg_id — ідентифікатор топогеометрії об'єкта топогеометрії в топології в "
+"шарі, позначеному <varname>layer_id</varname> в таблиці topology.layer."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of <varname>topoelement</varname> objects containing the "
+"topological element_id,element_type of the given TopoGeometry (primitive "
+"elements)."
+msgstr ""
+"Повертає набір об'єктів <varname>topoelement</varname>, що містять "
+"топологічні element_id,element_type заданої TopoGeometry (примітивні "
+"елементи)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of element_id,element_type (topoelements) corresponding to "
+"primitive topology elements <xref linkend=\"topoelement\"/> (1: nodes, 2: "
+"edges, 3: faces) that a given topogeometry object in <varname>toponame</"
+"varname> schema is composed of."
+msgstr ""
+"Повертає набір element_id,element_type (topoelements), що відповідає "
+"елементам примітивної топології <xref linkend=\"topoelement\"/> (1: вузли, 2:"
+" ребра, 3: грані), з яких складається заданий об'єкт топогеометрії в схемі "
+"<varname>toponame</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"topoelement\"/>, <xref linkend=\"TopoGeom_addElement\"/>, "
+"<xref linkend=\"TopoGeom_remElement\"/>"
+msgstr ""
+", <xref linkend=\"topoelement\"/>, <xref linkend=\"TopoGeom_addElement\"/>, "
+"<xref linkend=\"TopoGeom_remElement\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the spatial reference identifier for a topogeometry."
+msgstr "Повертає ідентифікатор просторової прив'язки для топогеометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the spatial reference identifier for the ST_Geometry as defined in "
+"spatial_ref_sys table. <xref linkend=\"spatial_ref_sys\"/>"
+msgstr ""
+"Повертає ідентифікатор просторової прив'язки для ST_Geometry, як визначено в "
+"таблиці spatial_ref_sys. <xref linkend=\"spatial_ref_sys\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"spatial_ref_sys table is a table that catalogs all spatial reference systems "
+"known to PostGIS and is used for transformations from one spatial reference "
+"system to another. So verifying you have the right spatial reference system "
+"identifier is important if you plan to ever transform your geometries."
+msgstr ""
+"Таблиця spatial_ref_sys — це таблиця, яка каталогізує всі системи "
+"просторових посилань, відомі PostGIS, і використовується для перетворення з "
+"однієї системи просторових посилань в іншу. Тому, якщо ви плануєте "
+"перетворювати геометрії, важливо перевірити, чи маєте ви правильний "
+"ідентифікатор системи просторових посилань."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 14.1.5"
+msgstr "&sqlmm_compliant; SQL-MM 3: 14.1.5"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_Transform\"/>, <xref "
+"linkend=\"ST_SRID\"/>"
+msgstr ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_Transform\"/>, <xref "
+"linkend=\"ST_SRID\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "TopoGeometry Outputs"
+msgstr "Вихідні дані TopoGeometry"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the GML representation of a topogeometry."
+msgstr "Повертає GML-представлення топогеометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the GML representation of a topogeometry in version GML3 format. If "
+"no <varname>nsprefix_in</varname> is specified then <varname>gml</varname> "
+"is used. Pass in an empty string for nsprefix to get a non-qualified name "
+"space. The precision (default: 15) and options (default 1) parameters, if "
+"given, are passed untouched to the underlying call to ST_AsGML."
+msgstr ""
+"Повертає GML-представлення топогеометрії у форматі GML3. Якщо не вказано "
+"<varname>nsprefix_in</varname>, використовується <varname>gml</varname>. "
+"Передайте порожній рядок для nsprefix, щоб отримати некваліфікований простір "
+"імен. Параметри точності (за замовчуванням: 15) та опції (за замовчуванням 1)"
+", якщо вони вказані, передаються без змін до базового виклику ST_AsGML."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>visitedTable</varname> parameter, if given, is used for keeping "
+"track of the visited Node and Edge elements so to use cross-references "
+"(xlink:xref) rather than duplicating definitions. The table is expected to "
+"have (at least) two integer fields: 'element_type' and 'element_id'. The "
+"calling user must have both read and write privileges on the given table. "
+"For best performance, an index should be defined on <varname>element_type</"
+"varname> and <varname>element_id</varname>, in that order. Such index would "
+"be created automatically by adding a unique constraint to the fields. "
+"Example:"
+msgstr ""
+"Параметр <varname>visitedTable</varname>, якщо він вказаний, "
+"використовується для відстеження відвіданих елементів Node та Edge, щоб "
+"використовувати перехресні посилання (xlink:xref) замість дублювання "
+"визначень. Таблиця повинна мати (принаймні) два цілочисельні поля: "
+"“element_type” та “element_id”. Користувач, який викликає функцію, повинен "
+"мати права на читання та запис у вказаній таблиці. Для найкращої "
+"продуктивності слід визначити індекс для <varname>element_type</varname> та "
+"<varname>element_id</varname> у такому порядку. Такий індекс буде створено "
+"автоматично шляхом додавання унікального обмеження до полів. Приклад:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>idprefix</varname> parameter, if given, will be prepended to "
+"Edge and Node tag identifiers."
+msgstr ""
+"Параметр <varname>idprefix</varname>, якщо вказано, буде додано перед "
+"ідентифікаторами тегів Edge та Node."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>gmlver</varname> parameter, if given, will be passed to the "
+"underlying ST_AsGML. Defaults to 3."
+msgstr ""
+"Параметр <varname>gmlver</varname>, якщо вказано, буде передано до базового "
+"ST_AsGML. За замовчуванням встановлено значення 3."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This uses the topo geometry we created in <xref linkend=\"CreateTopoGeom\"/>"
+msgstr ""
+"Тут використовується геометрія топографії, яку ми створили в <xref linkend="
+"\"CreateTopoGeom\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid "Same exercise as previous without namespace"
+msgstr "Те саме завдання, що й попереднє, але без простору імен"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_CreateTopoGeo\"/>"
+msgstr ", <xref linkend=\"ST_CreateTopoGeo\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the TopoJSON representation of a topogeometry."
+msgstr "Повертає представлення топогеометрії у форматі TopoJSON."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the TopoJSON representation of a topogeometry. If "
+"<varname>edgeMapTable</varname> is not null, it will be used as a lookup/"
+"storage mapping of edge identifiers to arc indices. This is to be able to "
+"allow for a compact \"arcs\" array in the final document."
+msgstr ""
+"Повертає представлення топогеометрії у форматі TopoJSON. Якщо "
+"<varname>edgeMapTable</varname> не є нульовим, воно буде використовуватися "
+"як відображення ідентифікаторів ребер на індекси дуг для пошуку/зберігання. "
+"Це необхідно для того, щоб у кінцевому документі можна було отримати "
+"компактний масив \"дуг\"."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The table, if given, is expected to have an \"arc_id\" field of type "
+"\"serial\" and an \"edge_id\" of type integer; the code will query the table "
+"for \"edge_id\" so it is recommended to add an index on that field."
+msgstr ""
+"У таблиці, якщо вона надана, має бути поле \"arc_id\" типу \"serial\" та "
+"\"edge_id\" типу integer; код буде запитувати таблицю щодо \"edge_id\", тому "
+"рекомендується додати індекс до цього поля."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Arc indices in the TopoJSON output are 0-based but they are 1-based in the "
+"\"edgeMapTable\" table."
+msgstr ""
+"Індекси дуг у вихідних даних TopoJSON починаються з 0, але в таблиці "
+"\"edgeMapTable\" вони починаються з 1."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A full TopoJSON document will be need to contain, in addition to the "
+"snippets returned by this function, the actual arcs plus some headers. See "
+"the <link xlink:href=\"http://github.com/mbostock/topojson-specification/"
+"blob/master/README.md\">TopoJSON specification</link>."
+msgstr ""
+"Повний документ TopoJSON повинен містити, крім фрагментів, повернутих цією "
+"функцією, фактичні дуги та деякі заголовки. Див. <link "
+"xlink:href=\"http://github.com/mbostock/topojson-specification/blob/master/"
+"README.md\">специфікацію TopoJSON</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.2.1 added support for puntal inputs"
+msgstr "Покращено: у версії 2.2.1 додано підтримку вхідних сигналів puntal"
+
+#. Tag: title
+#, no-c-format
+msgid "Topology Spatial Relationships"
+msgstr "Топологія Просторові відносини"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the Topology functions used to check relationships "
+"between topogeometries and topology primitives"
+msgstr ""
+"У цьому розділі перелічено функції топології, що використовуються для "
+"перевірки взаємозв'язків між топогеометріями та топологічними примітивами"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns true if two topogeometries are composed of the same topology "
+"primitives."
+msgstr ""
+"Повертає true, якщо дві топогеометрії складаються з однакових топологічних "
+"примітивів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if two topogeometries are composed of the same topology "
+"primitives: faces, edges, nodes."
+msgstr ""
+"Повертає true, якщо дві топогеометрії складаються з однакових топологічних "
+"примітивів: граней, ребер, вузлів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function not supported for topogeometries that are geometry "
+"collections. It also can not compare topogeometries from different "
+"topologies."
+msgstr ""
+"Ця функція не підтримується для топогеометрій, які є колекціями геометрій. "
+"Вона також не може порівнювати топогеометрії з різних топологій."
+
+#. Tag: para
+#, no-c-format
+msgid "&Z_support;"
+msgstr "&Z_support;"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Equals\"/>"
+msgstr ", <xref linkend=\"ST_Equals\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns true if any pair of primitives from the two "
+"topogeometries intersect.</refpurpose>"
+msgstr ""
+"<refpurpose>Повертає true, якщо будь-яка пара примітивів з двох "
+"топогеометрій перетинаються.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns true if any pair of primitives from the two topogeometries "
+"intersect.</para>"
+msgstr ""
+"<para>Повертає true, якщо будь-яка пара примітивів з двох топогеометрій "
+"перетинаються.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function not supported for topogeometries that are geometry "
+"collections. It also can not compare topogeometries from different "
+"topologies. Also not currently supported for hierarchical topogeometries "
+"(topogeometries composed of other topogeometries)."
+msgstr ""
+"Ця функція не підтримується для топогеометрій, які є колекціями геометрій. "
+"Вона також не може порівнювати топогеометрії з різних топологій. Також "
+"наразі не підтримується для ієрархічних топогеометрій (топогеометрій, що "
+"складаються з інших топогеометрій)."
+
+#. Tag: title
+#, no-c-format
+msgid "Importing and exporting Topologies"
+msgstr "Імпорт та експорт топологій"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you have created topologies, and maybe associated topological layers, "
+"you might want to export them into a file-based format for backup or "
+"transfer into another database."
+msgstr ""
+"Після створення топологій і, можливо, пов'язаних топологічних шарів, ви "
+"можете експортувати їх у файловий формат для резервного копіювання або "
+"перенесення в іншу базу даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using the standard dump/restore tools of PostgreSQL is problematic because "
+"topologies are composed by a set of tables (4 for primitives, an arbitrary "
+"number for layers) and records in metadata tables (topology.topology and "
+"topology.layer). Additionally, topology identifiers are not univoque across "
+"databases so that parameter of your topology will need to be changes upon "
+"restoring it."
+msgstr ""
+"Використання стандартних інструментів PostgreSQL для вивантаження/"
+"відновлення є проблематичним, оскільки топології складаються з набору "
+"таблиць (4 для примітивних типів, довільна кількість для шарів) та записів у "
+"таблицях метаданих (topology.topology та topology.layer). Крім того, "
+"ідентифікатори топології не є однозначними в різних базах даних, тому "
+"параметри топології потрібно буде змінити після її відновлення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In order to simplify export/restore of topologies a pair of executables are "
+"provided: <filename>pgtopo_export</filename> and <filename>pgtopo_import</"
+"filename>. Example usage:"
+msgstr ""
+"Для спрощення експорту/відновлення топологій надається пара виконуваних "
+"файлів: <filename>pgtopo_export</filename> та <filename>pgtopo_import</"
+"filename>. Приклад використання:"
+
+#. Tag: title
+#, no-c-format
+msgid "Using the Topology exporter"
+msgstr "Використання експорту топології"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <filename>pgtopo_export</filename> script takes the name of a database "
+"and a topology and outputs a dump file which can be used to import the "
+"topology (and associated layers) into a new database."
+msgstr ""
+"Скрипт <filename>pgtopo_export</filename> бере ім'я бази даних і топологію "
+"та виводить файл дампа, який можна використовувати для імпорту топології (та "
+"пов'язаних шарів) до нової бази даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default <filename>pgtopo_export</filename> writes the dump file to the "
+"standard output so that it can be piped to <filename>pgtopo_import</"
+"filename> or redirected to a file (refusing to write to terminal). You can "
+"optionally specify an output filename with the <code>-f</code> commandline "
+"switch."
+msgstr ""
+"За замовчуванням <filename>pgtopo_export</filename> записує файл дампа у "
+"стандартний вивід, щоб його можна було передати до <filename>pgtopo_import</"
+"filename> або перенаправити до файлу (відмовляючись записувати в термінал). "
+"За бажанням можна вказати ім'я файлу виводу за допомогою параметра "
+"командного рядка <code>-f</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default <filename>pgtopo_export</filename> includes a dump of all layers "
+"defined against the given topology. This may be more data than you need, or "
+"may be non-working (in case your layer tables have complex dependencies) in "
+"which case you can request skipping the layers with the <code>--skip-layers</"
+"code> switch and deal with those separately."
+msgstr ""
+"За замовчуванням <filename>pgtopo_export</filename> включає вивантаження "
+"всіх шарів, визначених для заданої топології. Це може бути більше даних, ніж "
+"вам потрібно, або вони можуть не працювати (у випадку, якщо таблиці шарів "
+"мають складні залежності). У такому випадку ви можете попросити пропустити "
+"шари за допомогою перемикача <code>--skip-layers</code> і обробити їх окремо."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Invoking <filename>pgtopo_export</filename> with the <code>--help</code> (or "
+"<code>-h</code> for short) switch will always print short usage string."
+msgstr ""
+"Виклик <filename>pgtopo_export</filename> з параметром <code>--help</code> ("
+"або <code>-h</code> для скорочення) завжди виведе короткий текст про "
+"використання."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The dump file format is a compressed tar archive of a "
+"<filename>pgtopo_export</filename> directory containing at least a "
+"<filename>pgtopo_dump_version</filename> file with format version info. As "
+"of version <code>1</code> the directory contains tab-delimited CSV files "
+"with data of the topology primitive tables (node, edge_data, face, "
+"relation), the topology and layer records associated with it and (unless "
+"<code>--skip-layers</code> is given) a custom-format PostgreSQL dump of "
+"tables reported as being layers of the given topology."
+msgstr ""
+"Формат файлу дампа — це стиснений архів tar каталогу "
+"<filename>pgtopo_export</filename>, що містить принаймні файл "
+"<filename>pgtopo_dump_version</filename> з інформацією про версію формату. "
+"Починаючи з версії <code>1</code>, каталог містить CSV-файли, розділені "
+"табуляцією, з даними таблиць примітивних елементів топології (node, "
+"edge_data, face, relation), пов'язаними з ними записами топології та шарів, "
+"а також (якщо не вказано <code>--skip-layers</code>) дамп таблиць у форматі "
+"PostgreSQL, що повідомляються як шари заданої топології."
+
+#. Tag: title
+#, no-c-format
+msgid "Using the Topology importer"
+msgstr "Використання імпортера топології"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <filename>pgtopo_import</filename> script takes a <code>pgtopo_export</"
+"code> format topology dump and a name to give to the topology to be created "
+"and outputs an SQL script reconstructing the topology and associated layers."
+msgstr ""
+"Скрипт <filename>pgtopo_import</filename> приймає дамп топології у форматі "
+"<code>pgtopo_export</code> та ім'я, яке буде надано створюваній топології, і "
+"виводить SQL-скрипт, що відтворює топологію та пов'язані з нею шари."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The generated SQL file will contain statements that create a topology with "
+"the given name, load primitive data in it, restores and registers all "
+"topology layers by properly linking all TopoGeometry values to their correct "
+"topology."
+msgstr ""
+"Створений файл SQL міститиме оператори, які створюють топологію з заданою "
+"назвою, завантажують в неї примітивні дані, відновлюють і реєструють усі "
+"шари топології, правильно пов'язуючи всі значення TopoGeometry з відповідною "
+"топологією."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default <filename>pgtopo_import</filename> reads the dump from the "
+"standard input so that it can be used in conjunction with "
+"<filename>pgtopo_export</filename> in a pipeline. You can optionally specify "
+"an input filename with the <code>-f</code> commandline switch."
+msgstr ""
+"За замовчуванням <filename>pgtopo_import</filename> зчитує дамп із "
+"стандартного вводу, щоб його можна було використовувати разом із "
+"<filename>pgtopo_export</filename> у конвеєрі. За бажанням можна вказати "
+"ім'я вхідного файлу за допомогою параметра командного рядка <code>-f</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default <filename>pgtopo_import</filename> includes in the output SQL "
+"file the code to restore all layers found in the dump."
+msgstr ""
+"За замовчуванням <filename>pgtopo_import</filename> включає у вихідний файл "
+"SQL код для відновлення всіх шарів, знайдених у дампі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This may be unwanted or non-working in case your target database already "
+"have tables with the same name as the ones in the dump. In that case you can "
+"request skipping the layers with the <code>--skip-layers</code> switch and "
+"deal with those separately (or later)."
+msgstr ""
+"Це може бути небажаним або непрацюючим у випадку, якщо ваша цільова база "
+"даних вже містить таблиці з такими самими іменами, як і в дампі. У такому "
+"випадку ви можете попросити пропустити рівні за допомогою перемикача <code"
+">--skip-layers</code> і обробити їх окремо (або пізніше)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SQL to only load and link layers to a named topology can be generated using "
+"the <code>--only-layers</code> switch. This can be useful to load layers "
+"AFTER resolving the naming conflicts or to link layers to a different "
+"topology (say a spatially-simplified version of the starting topology)."
+msgstr ""
+"SQL для завантаження та зв'язування шарів тільки з топологією з іменем можна "
+"створити за допомогою перемикача <code>--only-layers</code>. Це може бути "
+"корисно для завантаження шарів ПІСЛЯ вирішення конфліктів імен або для "
+"зв'язування шарів з іншою топологією (наприклад, простою версією вихідної "
+"топології)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the target topology already exists and you want it dropped upfront you "
+"can pass the <code>--drop-topology</code> switch (since PostGIS-3.6.0)."
+msgstr ""
+"Якщо цільова топологія вже існує і ви хочете її видалити заздалегідь, ви "
+"можете передати параметр <code>--drop-topology</code> (починаючи з PostGIS-3."
+"6.0)."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Installation"
+msgstr "Встановлення PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid "This chapter details the steps required to install PostGIS."
+msgstr ""
+"У цьому розділі детально описано кроки, необхідні для встановлення PostGIS."
+
+#. Tag: title
+#, no-c-format
+msgid "Short Version"
+msgstr "Коротка версія"
+
+#. Tag: para
+#, no-c-format
+msgid "To compile assuming you have all the dependencies in your search path:"
+msgstr ""
+"Щоб скомпілювати, припускаючи, що у вашому шляху пошуку є всі залежності:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once PostGIS is installed, it needs to be enabled (<xref "
+"linkend=\"create_spatial_db\"/>) or upgraded (<xref linkend=\"upgrading\"/>) "
+"in each individual database you want to use it in."
+msgstr ""
+"Після встановлення PostGIS його потрібно ввімкнути (<xref linkend="
+"\"create_spatial_db\"/>) або оновити (<xref linkend=\"upgrading\"/>) в "
+"кожній окремій базі даних, в якій ви хочете його використовувати."
+
+#. Tag: title
+#, no-c-format
+msgid "Compiling and Install from Source"
+msgstr "Компіляція та встановлення з вихідного коду"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Many OS systems now include pre-built packages for PostgreSQL/PostGIS. In "
+"many cases compilation is only necessary if you want the most bleeding edge "
+"versions or you are a package maintainer."
+msgstr ""
+"Багато операційних систем зараз містять готові пакети для PostgreSQL/"
+"PostGIS. У більшості випадків компіляція необхідна лише якщо ви хочете "
+"отримати найновіші версії або ви є розробником пакету."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section includes general compilation instructions, if you are compiling "
+"for Windows etc or another OS, you may find additional more detailed help at "
+"<link xlink:href=\"https://trac.osgeo.org/postgis/wiki/"
+"UsersWikiInstall\">PostGIS User contributed compile guides</link> and <link "
+"xlink:href=\"http://trac.osgeo.org/postgis/wiki/DevWikiMain\">PostGIS Dev "
+"Wiki</link>."
+msgstr ""
+"Цей розділ містить загальні інструкції з компіляції. Якщо ви компілюєте для "
+"Windows тощо або іншої ОС, додаткову детальну допомогу можна знайти за "
+"посиланням <link xlink:href=\"https://trac.osgeo.org/postgis/wiki/"
+"UsersWikiInstall\">Посібники з компіляції, надані користувачами PostGIS</"
+"link> та <link xlink:href=\"http://trac.osgeo.org/postgis/wiki/DevWikiMain\""
+">PostGIS Dev Wiki</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Pre-Built Packages for various OS are listed in <link xlink:href=\"https://"
+"trac.osgeo.org/postgis/wiki/UsersWikiPackages\">PostGIS Pre-built Packages</"
+"link>"
+msgstr ""
+"Готові пакети для різних операційних систем перелічені в <link "
+"xlink:href=\"https://trac.osgeo.org/postgis/wiki/UsersWikiPackages\">Готові "
+"пакети PostGIS</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are a windows user, you can get stable builds via Stackbuilder or "
+"<link xlink:href=\"https://postgis.net/windows_downloads\">PostGIS Windows "
+"download site</link> We also have <link xlink:href=\"https://postgis.net/"
+"windows_downloads\">very bleeding-edge windows experimental builds</link> "
+"that are built usually once or twice a week or whenever anything exciting "
+"happens. You can use these to experiment with the in progress releases of "
+"PostGIS"
+msgstr ""
+"Якщо ви користуєтеся Windows, ви можете отримати стабільні збірки через "
+"Stackbuilder або <link xlink:href=\"https://postgis.net/windows_downloads\"
+">сайт завантаження PostGIS для Windows</link>. Ми також маємо <link "
+"xlink:href=\"https://postgis.net/windows_downloads\">дуже новітні "
+"експериментальні збірки для Windows</link>, які зазвичай створюються один-"
+"два рази на тиждень або коли трапляється щось цікаве. Ви можете "
+"використовувати їх для експериментів з поточними версіями PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS module is an extension to the PostgreSQL backend server. As "
+"such, PostGIS &last_release_version; <emphasis>requires</emphasis> full "
+"PostgreSQL server headers access in order to compile. It can be built "
+"against PostgreSQL versions &min_postgres_version; - &max_postgres_version;. "
+"Earlier versions of PostgreSQL are <emphasis>not</emphasis> supported."
+msgstr ""
+"Модуль PostGIS є розширенням серверного бекенду PostgreSQL. Як такий, "
+"PostGIS &last_release_version; <emphasis>вимагає</emphasis> повного доступу "
+"до заголовків сервера PostgreSQL для компіляції. Його можна скомпілювати для "
+"версій PostgreSQL &min_postgres_version; - &max_postgres_version;. Раніші "
+"версії PostgreSQL <emphasis>не</emphasis> підтримуються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to the PostgreSQL installation guides if you haven't already installed "
+"PostgreSQL. <link xlink:href=\"https://www.postgresql.org\"> https://www."
+"postgresql.org </link> ."
+msgstr ""
+"Якщо ви ще не встановили PostgreSQL, зверніться до інструкцій з інсталяції "
+"PostgreSQL. <link xlink:href=\"https://www.postgresql.org\"> https://"
+"www.postgresql.org </link> ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For GEOS functionality, when you install PostgreSQL you may need to "
+"explicitly link PostgreSQL against the standard C++ library:"
+msgstr ""
+"Для роботи GEOS, під час встановлення PostgreSQL може знадобитися явно "
+"пов'язати PostgreSQL зі стандартною бібліотекою C++:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a workaround for bogus C++ exceptions interaction with older "
+"development tools. If you experience weird problems (backend unexpectedly "
+"closed or similar things) try this trick. This will require recompiling your "
+"PostgreSQL from scratch, of course."
+msgstr ""
+"Це обхідний шлях для вирішення проблеми взаємодії помилкових винятків C++ зі "
+"старими інструментами розробки. Якщо ви зіткнулися з дивними проблемами ("
+"несподіване закриття бекенду або подібні речі), спробуйте цей трюк. "
+"Звичайно, для цього потрібно буде перекомпілювати PostgreSQL з нуля."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The following steps outline the configuration and compilation of the PostGIS "
+"source. They are written for Linux users and will not work on Windows or Mac."
+msgstr ""
+"Наступні кроки описують конфігурацію та компіляцію вихідного коду PostGIS. "
+"Вони написані для користувачів Linux і не працюватимуть на Windows або Mac."
+
+#. Tag: title
+#, no-c-format
+msgid "Getting the Source"
+msgstr "Отримання вихідного коду"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Retrieve the PostGIS source archive from the downloads website <link xlink:"
+"href=\"&postgis_download_url;\"> &postgis_download_url; </link>"
+msgstr ""
+"Завантажте архів PostGIS з веб-сайту завантажень <link "
+"xlink:href=\"&postgis_download_url;\"> &postgis_download_url; </link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This will create a directory called <varname>postgis-&last_release_version;</"
+"varname> in the current working directory."
+msgstr ""
+"Це створить каталог з назвою <varname>postgis-&last_release_version;</"
+"varname> у поточному робочому каталозі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alternatively, checkout the source from the <link xlink:href=\"https://git-"
+"scm.com/\"> git </link> repository <link xlink:href=\"https://git.osgeo.org/"
+"gitea/postgis/postgis/\"> https://git.osgeo.org/gitea/postgis/postgis/ </"
+"link> ."
+msgstr ""
+"Або перегляньте джерело з репозиторію <link xlink:href=\"https://git-scm.com/\""
+"> git </link> <link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/\""
+"> https://git.osgeo.org/gitea/postgis/postgis/ </link> ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Change into the newly created <varname>postgis</varname> directory to "
+"continue the installation."
+msgstr ""
+"Перейдіть до новоствореного каталогу <varname>postgis</varname>, щоб "
+"продовжити встановлення."
+
+#. Tag: title
+#, no-c-format
+msgid "Install Requirements"
+msgstr "Вимоги до встановлення"
+
+#. Tag: para
+#, no-c-format
+msgid "PostGIS has the following requirements for building and usage:"
+msgstr "PostGIS має наступні вимоги до побудови та використання:"
+
+#. Tag: emphasis
+#, no-c-format
+msgid "Required"
+msgstr "Необхідно"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostgreSQL &min_postgres_version; - &max_postgres_version;. A complete "
+"installation of PostgreSQL (including server headers) is required. "
+"PostgreSQL is available from <link xlink:href=\"https://www.postgresql."
+"org\"> https://www.postgresql.org </link>18 ."
+msgstr ""
+"PostgreSQL &min_postgres_version; - &max_postgres_version;. Потрібна повна "
+"інсталяція PostgreSQL (включно з заголовками сервера). PostgreSQL доступний "
+"за адресою <link xlink:href=\"https://www.postgresql.org\"> https://"
+"www.postgresql.org </link>18 ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For a full PostgreSQL / PostGIS support matrix and PostGIS/GEOS support "
+"matrix refer to <link xlink:href=\"https://trac.osgeo.org/postgis/wiki/"
+"UsersWikiPostgreSQLPostGIS\">https://trac.osgeo.org/postgis/wiki/"
+"UsersWikiPostgreSQLPostGIS</link>"
+msgstr ""
+"Повна матриця підтримки PostgreSQL / PostGIS та матриця підтримки PostGIS/"
+"GEOS наведена за посиланням <link xlink:href=\"https://trac.osgeo.org/postgis/"
+"wiki/UsersWikiPostgreSQLPostGIS\">https://trac.osgeo.org/postgis/wiki/"
+"UsersWikiPostgreSQLPostGIS</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GNU C compiler (<filename>gcc</filename>). Some other ANSI C compilers can "
+"be used to compile PostGIS, but we find far fewer problems when compiling "
+"with <filename>gcc</filename>."
+msgstr ""
+"Компілятор GNU C (<filename>gcc</filename>). Для компіляції PostGIS можна "
+"використовувати й інші компілятори ANSI C, але при компіляції за допомогою "
+"<filename>gcc</filename> ми зустрічаємо набагато менше проблем."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GNU Make (<filename>gmake</filename> or <filename>make</filename>). For many "
+"systems, GNU <filename>make</filename> is the default version of make. Check "
+"the version by invoking <filename>make -v</filename>. Other versions of "
+"<filename>make</filename> may not process the PostGIS <filename>Makefile</"
+"filename> properly."
+msgstr ""
+"GNU Make (<filename>gmake</filename> або <filename>make</filename>). Для "
+"багатьох систем GNU <filename>make</filename> є стандартною версією make. "
+"Перевірте версію, викликавши <filename>make -v</filename>. Інші версії "
+"<filename>make</filename> можуть не обробляти PostGIS <filename>Makefile</"
+"filename> належним чином."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Proj reprojection library. Proj 6.1 or above is required. The Proj library "
+"is used to provide coordinate reprojection support within PostGIS. Proj is "
+"available for download from <link xlink:href=\"https://proj.org/\"> https://"
+"proj.org/ </link> ."
+msgstr ""
+"Бібліотека перепроекції Proj. Потрібна версія Proj 6.1 або вище. Бібліотека "
+"Proj використовується для забезпечення підтримки перепроекції координат у "
+"PostGIS. Proj можна завантажити за адресою <link xlink:href=\"https://proj."
+"org/\"> https://proj.org/ </link> ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GEOS geometry library, version &min_geos_version; or greater, but GEOS 3.14+ "
+"is required to take full advantage of all the new functions and features. "
+"GEOS is available for download from <link xlink:href=\"https://libgeos.org/"
+"\"> https://libgeos.org </link>."
+msgstr ""
+"Бібліотека геометрії GEOS, версія &min_geos_version; або вище, але для "
+"повного використання всіх нових функцій і можливостей необхідна версія GEOS 3"
+".14+. GEOS можна завантажити за адресою <link xlink:href=\"https://libgeos."
+"org/\"> https://libgeos.org </link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"LibXML2, version 2.5.x or higher. LibXML2 is currently used in some imports "
+"functions (ST_GeomFromGML and ST_GeomFromKML). LibXML2 is available for "
+"download from <link xlink:href=\"https://gitlab.gnome.org/GNOME/libxml2/-/"
+"releases\">https://gitlab.gnome.org/GNOME/libxml2/-/releases</link>."
+msgstr ""
+"LibXML2, версія 2.5.x або вище. LibXML2 наразі використовується в деяких "
+"функціях імпорту (ST_GeomFromGML та ST_GeomFromKML). LibXML2 можна "
+"завантажити за адресою <link xlink:href=\"https://gitlab.gnome.org/GNOME/"
+"libxml2/-/releases\">https://gitlab.gnome.org/GNOME/libxml2/-/releases</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"JSON-C, version 0.9 or higher. JSON-C is currently used to import GeoJSON "
+"via the function ST_GeomFromGeoJson. JSON-C is available for download from "
+"<link xlink:href=\"https://github.com/json-c/json-c/releases\">https://"
+"github.com/json-c/json-c/releases/</link>."
+msgstr ""
+"JSON-C, версія 0.9 або вище. JSON-C наразі використовується для імпорту "
+"GeoJSON за допомогою функції ST_GeomFromGeoJson. JSON-C можна завантажити за "
+"посиланням <link xlink:href=\"https://github.com/json-c/json-c/"
+"releases\">https://github.com/json-c/json-c/releases/</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GDAL, version 3+ is preferred. This is required for raster support. <link "
+"xlink:href=\"https://gdal.org/download.html\">https://gdal.org/download."
+"html</link>."
+msgstr ""
+"GDAL, версія 3+ є кращою. Це необхідно для підтримки растрових даних. <link "
+"xlink:href=\"https://gdal.org/download.html\">https://gdal.org/download."
+"html</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If compiling with PostgreSQL+JIT, LLVM version >=6 is required <link "
+"xlink:href=\"https://trac.osgeo.org/postgis/ticket/4125\">https://trac.osgeo."
+"org/postgis/ticket/4125</link>."
+msgstr ""
+"При компіляції з PostgreSQL+JIT необхідна версія LLVM >=6 <link "
+"xlink:href=\"https://trac.osgeo.org/postgis/ticket/4125\">https://trac.osgeo."
+"org/postgis/ticket/4125</link>."
+
+#. Tag: emphasis
+#, no-c-format
+msgid "Optional"
+msgstr "Додатково"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GDAL (pseudo optional) only if you don't want raster you can leave it out. "
+"Also make sure to enable the drivers you want to use as described in <xref "
+"linkend=\"raster_configuration\"/>."
+msgstr ""
+"GDAL (псевдоопціональний) тільки якщо ви не хочете растрові дані, ви можете "
+"залишити його поза увагою. Також переконайтеся, що ви ввімкнули драйвери, "
+"які ви хочете використовувати, як описано в <xref linkend="
+"\"raster_configuration\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GTK (requires GTK+2.0, 2.8+) to compile the shp2pgsql-gui shape file loader. "
+"<link xlink:href=\"http://www.gtk.org/\"> http://www.gtk.org/ </link> ."
+msgstr ""
+"GTK (потрібно GTK+2.0, 2.8+) для компіляції завантажувача файлів shp2pgsql-"
+"gui. <link xlink:href=\"http://www.gtk.org/\"> http://www.gtk.org/ </link> ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SFCGAL, 1.4.1 or higher is required and 2.1+ is needed to be able to use all "
+"functionality. SFCGAL can be used to provide additional 2D and 3D advanced "
+"analysis functions to PostGIS cf <xref linkend=\"reference_sfcgal\"/>. And "
+"also allow to use SFCGAL rather than GEOS for some 2D functions provided by "
+"both backends (like ST_Intersection or ST_Area, for instance). A PostgreSQL "
+"configuration variable <code>postgis.backend</code> allow end user to "
+"control which backend he want to use if SFCGAL is installed (GEOS by "
+"default). Nota: SFCGAL 1.2 require at least CGAL 4.3 and Boost 1.54 (cf: "
+"<link xlink:href=\"https://sfcgal.org\">https://sfcgal.org</link>) <link "
+"xlink:href=\"https://gitlab.com/sfcgal/SFCGAL/\">https://gitlab.com/sfcgal/"
+"SFCGAL/</link>."
+msgstr ""
+"SFCGAL, 1.4.1 або вище, а для використання всіх функцій необхідна версія 2.1+"
+". SFCGAL можна використовувати для надання додаткових функцій розширеного 2D-"
+" та 3D-аналізу для PostGIS cf <xref linkend=\"reference_sfcgal\"/>. А також "
+"дозволяє використовувати SFCGAL замість GEOS для деяких 2D-функцій, що "
+"надаються обома бекендами (наприклад, ST_Intersection або ST_Area). "
+"Конфігураційна змінна PostgreSQL <code>postgis.backend</code> дозволяє "
+"кінцевому користувачеві контролювати, який бекенд він хоче використовувати, "
+"якщо встановлено SFCGAL (за замовчуванням GEOS). Примітка: SFCGAL 1.2 "
+"вимагає принаймні CGAL 4.3 та Boost 1.54 (див.: <link "
+"xlink:href=\"https://sfcgal.org\">https://sfcgal.org</link>) <link "
+"xlink:href=\"https://gitlab.com/sfcgal/SFCGAL/\">https://gitlab.com/sfcgal/"
+"SFCGAL/</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In order to build the <xref linkend=\"Address_Standardizer\"/> you will also "
+"need PCRE 1 or 2 <link xlink:href=\"http://www.pcre.org\">http://www.pcre."
+"org</link> (which generally is already installed on nix systems). <xref "
+"linkend=\"Address_Standardizer\"/> will automatically be built if it detects "
+"a PCRE library, or you pass in a valid <varname>--with-pcre-dir=/path/to/"
+"pcre</varname> during configure."
+msgstr ""
+"Для побудови <xref linkend=\"Address_Standardizer\"/> вам також знадобиться "
+"PCRE 1 або 2 <link xlink:href=\"http://www.pcre.org\">http://www.pcre.org</"
+"link> (яка, як правило, вже встановлена в системах nix). <xref linkend="
+"\"Address_Standardizer\"/> буде створено автоматично, якщо буде виявлено "
+"бібліотеку PCRE, або якщо ви передасте дійсний <varname>--with-pcre-dir=/"
+"path/to/pcre</varname> під час конфігурації."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To enable ST_AsMVT protobuf-c library 1.1.0 or higher (for usage) and the "
+"protoc-c compiler (for building) are required. Also, pkg-config is required "
+"to verify the correct minimum version of protobuf-c. See <link xlink:"
+"href=\"https://github.com/protobuf-c/protobuf-c\">protobuf-c</link>. By "
+"default, Postgis will use Wagyu to validate MVT polygons faster which "
+"requires a c++11 compiler. It will use CXXFLAGS and the same compiler as the "
+"PostgreSQL installation. To disable this and use GEOS instead use the "
+"<varname>--without-wagyu</varname> during the configure step."
+msgstr ""
+"Щоб увімкнути ST_AsMVT, потрібна бібліотека protobuf-c 1.1.0 або вище (для "
+"використання) та компілятор protoc-c (для побудови). Також для перевірки "
+"мінімальної версії protobuf-c необхідний pkg-config. Див. <link "
+"xlink:href=\"https://github.com/protobuf-c/protobuf-c\">protobuf-c</link>. За "
+"замовчуванням Postgis використовує Wagyu для швидшої перевірки полігонів "
+"MVT, що вимагає компілятора c++11. Він використовуватиме CXXFLAGS і той "
+"самий компілятор, що й інсталяція PostgreSQL. Щоб вимкнути це і замість "
+"цього використовувати GEOS, під час конфігурації вкажіть <varname>--without-"
+"wagyu</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"CUnit (<filename>CUnit</filename>). This is needed for regression testing. "
+"<link xlink:href=\"http://cunit.sourceforge.net/\">http://cunit.sourceforge."
+"net/</link>"
+msgstr ""
+"CUnit (<filename>CUnit</filename>). Це потрібно для регресійного "
+"тестування. <link xlink:href=\"http://cunit.sourceforge.net/\">http://cunit."
+"sourceforge.net/</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"DocBook (<filename>xsltproc</filename>) is required for building the "
+"documentation. Docbook is available from <link xlink:href=\"http://www."
+"docbook.org/\"> http://www.docbook.org/ </link> ."
+msgstr ""
+"Для створення документації необхідний DocBook (<filename>xsltproc</filename>)"
+". Docbook доступний за адресою <link xlink:href=\"http://www.docbook.org/\"> "
+"http://www.docbook.org/ </link> ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"DBLatex (<filename>dblatex</filename>) is required for building the "
+"documentation in PDF format. DBLatex is available from <link xlink:"
+"href=\"http://dblatex.sourceforge.net/\"> http://dblatex.sourceforge.net/ </"
+"link> ."
+msgstr ""
+"DBLatex (<filename>dblatex</filename>) необхідний для створення документації "
+"у форматі PDF. DBLatex доступний за адресою <link xlink:href=\"http://dblatex."
+"sourceforge.net/\"> http://dblatex.sourceforge.net/ </link> ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ImageMagick (<filename>convert</filename>) is required to generate the "
+"images used in the documentation. ImageMagick is available from <link xlink:"
+"href=\"http://www.imagemagick.org/\"> http://www.imagemagick.org/ </link> ."
+msgstr ""
+"Для створення зображень, що використовуються в документації, необхідна "
+"програма ImageMagick (<filename>convert</filename>). ImageMagick доступна за "
+"адресою <link xlink:href=\"http://www.imagemagick.org/\"> http://www."
+"imagemagick.org/ </link> ."
+
+#. Tag: title
+#, no-c-format
+msgid "Build configuration"
+msgstr "Конфігурація збірки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As with most linux installations, the first step is to generate the Makefile "
+"that will be used to build the source code. This is done by running the "
+"shell script"
+msgstr ""
+"Як і в більшості випадків встановлення Linux, першим кроком є створення "
+"файлу Makefile, який буде використовуватися для компіляції вихідного коду. "
+"Це робиться за допомогою виконання скрипта оболонки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"With no additional parameters, this command will attempt to automatically "
+"locate the required components and libraries needed to build the PostGIS "
+"source code on your system. Although this is the most common usage of "
+"<command>./configure</command>, the script accepts several parameters for "
+"those who have the required libraries and programs in non-standard locations."
+msgstr ""
+"Без додаткових параметрів ця команда спробує автоматично знайти необхідні "
+"компоненти та бібліотеки, потрібні для компіляції вихідного коду PostGIS у "
+"вашій системі. Хоча це найпоширеніший спосіб використання "
+"<command>./configure</command>, скрипт приймає кілька параметрів для тих, "
+"хто має необхідні бібліотеки та програми в нестандартних місцях."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The following list shows only the most commonly used parameters. For a "
+"complete list, use the <command>--help</command> or <command>--help=short</"
+"command> parameters."
+msgstr ""
+"У наведеному нижче списку вказані лише найчастіше використовувані параметри. "
+"Повний список можна отримати за допомогою параметрів <command>--help</"
+"command> або <command>--help=short</command>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Starting with PostGIS 3.0, the library files generated by default will no "
+"longer have the minor version as part of the file name. This means all "
+"PostGIS 3 libs will end in <code>postgis-3</code>. This was done to make "
+"pg_upgrade easier, with downside that you can only install one version "
+"PostGIS 3 series in your server. To get the old behavior of file including "
+"the minor version: e.g. <code>postgis-3.0</code> add this switch to your "
+"configure statement."
+msgstr ""
+"Починаючи з PostGIS 3.0, файли бібліотеки, що генеруються за замовчуванням, "
+"більше не матимуть незначну версію як частину імені файлу. Це означає, що "
+"всі бібліотеки PostGIS 3 будуть закінчуватися на <code>postgis-3</code>. Це "
+"було зроблено для спрощення pg_upgrade, але має той недолік, що ви можете "
+"встановити на сервер лише одну версію PostGIS 3. Щоб повернути стару "
+"поведінку файлів із включенням другорядної версії, наприклад <code>postgis-3."
+"0</code>, додайте цей перемикач до вашої конфігураційної команди."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is the location the PostGIS loader executables and shared libs will be "
+"installed. By default, this location is the same as the detected PostgreSQL "
+"installation."
+msgstr ""
+"Це місце, куди будуть встановлені виконувані файли завантажувача PostGIS та "
+"спільні бібліотеки. За замовчуванням це місце збігається з місцем "
+"встановлення PostgreSQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This parameter is currently broken, as the package will only install into "
+"the PostgreSQL installation directory. Visit <link xlink:href=\"http://trac."
+"osgeo.org/postgis/ticket/635\"> http://trac.osgeo.org/postgis/ticket/635 </"
+"link> to track this bug."
+msgstr ""
+"Цей параметр наразі не працює, оскільки пакет встановлюється лише в каталог "
+"інсталяції PostgreSQL. Відвідайте <link xlink:href=\"http://trac.osgeo.org/"
+"postgis/ticket/635\"> http://trac.osgeo.org/postgis/ticket/635 </link>, щоб "
+"відстежити цю помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostgreSQL provides a utility called <command>pg_config</command> to enable "
+"extensions like PostGIS to locate the PostgreSQL installation directory. Use "
+"this parameter (<command>--with-pgconfig=/path/to/pg_config</command>) to "
+"manually specify a particular PostgreSQL installation that PostGIS will "
+"build against."
+msgstr ""
+"PostgreSQL надає утиліту під назвою <command>pg_config</command> для "
+"увімкнення розширень, таких як PostGIS, для пошуку каталогу інсталяції "
+"PostgreSQL. Використовуйте цей параметр (<command>--with-pgconfig=/path/to/"
+"pg_config</command>), щоб вручну вказати конкретну інсталяцію PostgreSQL, на "
+"основі якої буде побудовано PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GDAL, a required library, provides functionality needed for raster support "
+"<command>gdal-config</command> to enable software installations to locate "
+"the GDAL installation directory. Use this parameter (<command>--with-"
+"gdalconfig=/path/to/gdal-config</command>) to manually specify a particular "
+"GDAL installation that PostGIS will build against."
+msgstr ""
+"GDAL, необхідна бібліотека, надає функціональність, необхідну для підтримки "
+"растрових даних <command>gdal-config</command>, щоб програмне забезпечення "
+"могло знайти каталог інсталяції GDAL. Використовуйте цей параметр (<command"
+">--with-gdalconfig=/path/to/gdal-config</command>), щоб вручну вказати "
+"конкретну інсталяцію GDAL, на основі якої буде побудовано PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GEOS, a required geometry library, provides a utility called <command>geos-"
+"config</command> to enable software installations to locate the GEOS "
+"installation directory. Use this parameter (<command>--with-geosconfig=/path/"
+"to/geos-config</command>) to manually specify a particular GEOS installation "
+"that PostGIS will build against."
+msgstr ""
+"GEOS, необхідна бібліотека геометрії, надає утиліту під назвою <command>geos-"
+"config</command> для того, щоб програмне забезпечення могло знайти каталог "
+"інсталяції GEOS. Використовуйте цей параметр (<command>--with-geosconfig=/"
+"path/to/geos-config</command>), щоб вручну вказати конкретну інсталяцію "
+"GEOS, на основі якої буде побудовано PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"LibXML is the library required for doing GeomFromKML/GML processes. It "
+"normally is found if you have libxml installed, but if not or you want a "
+"specific version used, you'll need to point PostGIS at a specific "
+"<filename>xml2-config</filename> confi file to enable software installations "
+"to locate the LibXML installation directory. Use this parameter "
+"(<command>>--with-xml2config=/path/to/xml2-config</command>) to manually "
+"specify a particular LibXML installation that PostGIS will build against."
+msgstr ""
+"LibXML — це бібліотека, необхідна для виконання процесів GeomFromKML/GML. "
+"Зазвичай вона знаходиться, якщо у вас встановлено libxml, але якщо її немає "
+"або ви хочете використовувати конкретну версію, вам потрібно вказати PostGIS "
+"на конкретний файл конфігурації <filename>xml2-config</filename>, щоб "
+"програмне забезпечення могло знайти каталог установки LibXML. Використовуйте "
+"цей параметр (<command>>--with-xml2config=/path/to/xml2-config</command>)"
+", щоб вручну вказати конкретну інсталяцію LibXML, на основі якої буде "
+"побудовано PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Proj is a reprojection library required by PostGIS. Use this parameter "
+"(<command>--with-projdir=/path/to/projdir</command>) to manually specify a "
+"particular Proj installation directory that PostGIS will build against."
+msgstr ""
+"Proj — це бібліотека перепроекції, необхідна для PostGIS. Використовуйте цей "
+"параметр (<command>--with-projdir=/path/to/projdir</command>), щоб вручну "
+"вказати конкретний каталог інсталяції Proj, на основі якого буде побудовано "
+"PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid "Directory where iconv is installed."
+msgstr "Каталог, в якому встановлено iconv."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://oss.metaparadigm.com/json-c/\">JSON-C</link> is an "
+"MIT-licensed JSON library required by PostGIS ST_GeomFromJSON support. Use "
+"this parameter (<command>--with-jsondir=/path/to/jsondir</command>) to "
+"manually specify a particular JSON-C installation directory that PostGIS "
+"will build against."
+msgstr ""
+"<link xlink:href=\"http://oss.metaparadigm.com/json-c/\">JSON-C</link> — це "
+"бібліотека JSON з ліцензією MIT, необхідна для підтримки PostGIS "
+"ST_GeomFromJSON. Використовуйте цей параметр (<command>--with-jsondir=/path/"
+"to/jsondir</command>), щоб вручну вказати конкретний каталог інсталяції JSON-"
+"C, на основі якого буде побудовано PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.pcre.org/\">PCRE</link> is an BSD-licensed "
+"Perl Compatible Regular Expression library required by address_standardizer "
+"extension. Use this parameter (<command>--with-pcredir=/path/to/pcredir</"
+"command>) to manually specify a particular PCRE installation directory that "
+"PostGIS will build against."
+msgstr ""
+"<link xlink:href=\"http://www.pcre.org/\">PCRE</link> — це бібліотека "
+"регулярних виразів, сумісна з Perl, що має ліцензію BSD і потрібна для "
+"розширення address_standardizer. Використовуйте цей параметр (<command"
+">--with-pcredir=/path/to/pcredir</command>), щоб вручну вказати конкретний "
+"каталог інсталяції PCRE, на основі якого буде побудовано PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Compile the data import GUI (requires GTK+2.0). This will create shp2pgsql-"
+"gui graphical interface to shp2pgsql."
+msgstr ""
+"Скомпілюйте графічний інтерфейс імпорту даних (потрібен GTK+2.0). Це "
+"створить графічний інтерфейс shp2pgsql-gui для shp2pgsql."
+
+#. Tag: para
+#, no-c-format
+msgid "Compile without raster support."
+msgstr "Скомпілюйте без підтримки растрових зображень."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Disable topology support. There is no corresponding library as all logic "
+"needed for topology is in postgis-&last_release_version; library."
+msgstr ""
+"Вимкнути підтримку топології. Відповідної бібліотеки немає, оскільки вся "
+"логіка, необхідна для топології, міститься в бібліотеці "
+"postgis-&last_release_version;."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default PostGIS will try to detect gettext support and compile with it, "
+"however if you run into incompatibility issues that cause breakage of "
+"loader, you can disable it entirely with this command. Refer to ticket <link "
+"xlink:href=\"http://trac.osgeo.org/postgis/ticket/748\">http://trac.osgeo."
+"org/postgis/ticket/748</link> for an example issue solved by configuring "
+"with this. NOTE: that you aren't missing much by turning this off. This is "
+"used for international help/label support for the GUI loader which is not "
+"yet documented and still experimental."
+msgstr ""
+"За замовчуванням PostGIS спробує виявити підтримку gettext і скомпілювати з "
+"нею, однак якщо ви зіткнетеся з проблемами несумісності, які спричиняють "
+"порушення роботи завантажувача, ви можете повністю вимкнути її за допомогою "
+"цієї команди. Дивіться квиток <link xlink:href=\"http://trac.osgeo.org/"
+"postgis/ticket/748\">http://trac.osgeo.org/postgis/ticket/748</link> для "
+"прикладу проблеми, вирішеної за допомогою цієї конфігурації. ПРИМІТКА: ви "
+"нічого не втратите, вимкнувши цю опцію. Вона використовується для підтримки "
+"міжнародної довідки/міток для завантажувача GUI, яка ще не задокументована і "
+"все ще є експериментальною."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default PostGIS will not install with sfcgal support without this switch. "
+"<varname>PATH</varname> is an optional argument that allows to specify an "
+"alternate PATH to sfcgal-config."
+msgstr ""
+"За замовчуванням PostGIS не встановлюється з підтримкою sfcgal без цього "
+"параметра. <varname>PATH</varname> — це необов'язковий аргумент, який "
+"дозволяє вказати альтернативний шлях до sfcgal-config."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Disable updating postgis_revision.h to match current HEAD of the git "
+"repository."
+msgstr ""
+"Вимкнути оновлення postgis_revision.h, щоб відповідати поточній версії HEAD "
+"репозиторію git."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you obtained PostGIS from the <link xlink:href=\"https://trac.osgeo.org/"
+"postgis/wiki/CodeRepository\"> code repository </link> , the first step is "
+"really to run the script"
+msgstr ""
+"Якщо ви отримали PostGIS з <link xlink:href=\"https://trac.osgeo.org/postgis/"
+"wiki/CodeRepository\"> репозиторію коду </link> , першим кроком є запуск "
+"скрипта"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This script will generate the <command>configure</command> script that in "
+"turn is used to customize the installation of PostGIS."
+msgstr ""
+"Цей скрипт створить скрипт <command>configure</command>, який, у свою чергу, "
+"використовується для налаштування встановлення PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you instead obtained PostGIS as a tarball, running <command>./autogen.sh</"
+"command> is not necessary as <command>configure</command> has already been "
+"generated."
+msgstr ""
+"Якщо ви отримали PostGIS у вигляді архіву tar, запускати <command>./autogen."
+"sh</command> не потрібно, оскільки <command>configure</command> вже було "
+"згенеровано."
+
+#. Tag: title
+#, no-c-format
+msgid "Building"
+msgstr "Збірка"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once the Makefile has been generated, building PostGIS is as simple as "
+"running"
+msgstr "Після створення Makefile, збірка PostGIS зводиться до виконання команди"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The last line of the output should be \"<code>PostGIS was built "
+"successfully. Ready to install.</code>\""
+msgstr ""
+"Останній рядок виводу повинен бути таким: \"<code>PostGIS було успішно "
+"скомпільовано. Готово до встановлення.</code>\""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As of PostGIS v1.4.0, all the functions have comments generated from the "
+"documentation. If you wish to install these comments into your spatial "
+"databases later, run the command which requires docbook. The "
+"postgis_comments.sql and other package comments files raster_comments.sql, "
+"topology_comments.sql are also packaged in the tar.gz distribution in the "
+"doc folder so no need to make comments if installing from the tar ball. "
+"Comments are also included as part of the CREATE EXTENSION install."
+msgstr ""
+"Починаючи з PostGIS v1.4.0, всі функції мають коментарі, згенеровані з "
+"документації. Якщо ви бажаєте встановити ці коментарі у ваші просторові бази "
+"даних пізніше, запустіть команду, яка вимагає docbook. Файли "
+"postgis_comments.sql та інші файли коментарів пакету raster_comments.sql, "
+"topology_comments.sql також упаковані у tar.gz дистрибутив у папці doc, тому "
+"немає потреби створювати коментарі, якщо ви встановлюєте з tar-архіву. "
+"Коментарі також включені як частина інсталяції CREATE EXTENSION."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Introduced in PostGIS 2.0. This generates html cheat sheets suitable for "
+"quick reference or for student handouts. This requires xsltproc to build and "
+"will generate 4 files in doc folder <filename>topology_cheatsheet.html</"
+"filename>, <filename>tiger_geocoder_cheatsheet.html</filename>, "
+"<filename>raster_cheatsheet.html</filename>, <filename>postgis_cheatsheet."
+"html</filename>"
+msgstr ""
+"Введено в PostGIS 2.0. Ця функція створює HTML-шпаргалки, які можна "
+"використовувати для швидкого довідкового пошуку або як роздатковий матеріал "
+"для студентів. Для створення потрібно xsltproc, після чого в папці doc буде "
+"створено 4 файли: <filename>topology_cheatsheet.html</filename>, "
+"<filename>tiger_geocoder_cheatsheet.html</filename>, "
+"<filename>raster_cheatsheet.html</filename>, <filename>postgis_cheatsheet."
+"html</filename>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can download some pre-built ones available in html and pdf from <link "
+"xlink:href=\"http://www.postgis.us/study_guides\">PostGIS / PostgreSQL Study "
+"Guides</link>"
+msgstr ""
+"Ви можете завантажити готові приклади у форматі html та pdf з <link "
+"xlink:href=\"http://www.postgis.us/study_guides\">Посібників з PostGIS / "
+"PostgreSQL</link>"
+
+#. Tag: title
+#, no-c-format
+msgid "Building PostGIS Extensions and Deploying them"
+msgstr "Збірка розширень PostGIS та їх розгортання"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS extensions are built and installed automatically if you are "
+"using PostgreSQL 9.1+."
+msgstr ""
+"Розширення PostGIS створюються та встановлюються автоматично, якщо ви "
+"використовуєте PostgreSQL 9.1+."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are building from source repository, you need to build the function "
+"descriptions first. These get built if you have docbook installed. You can "
+"also manually build with the statement:"
+msgstr ""
+"Якщо ви компілюєте з репозиторію вихідного коду, спочатку потрібно "
+"скомпілювати описи функцій. Вони компілюються, якщо у вас встановлено "
+"docbook. Ви також можете скомпілювати їх вручну за допомогою команди:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Building the comments is not necessary if you are building from a release "
+"tar ball since these are packaged pre-built with the tar ball already."
+msgstr ""
+"Створювати коментарі не потрібно, якщо ви створюєте з архіву tar, оскільки "
+"вони вже попередньо вбудовані в архів tar."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The extensions should automatically build as part of the make install "
+"process. You can if needed build from the extensions folders or copy files "
+"if you need them on a different server."
+msgstr ""
+"Розширення повинні автоматично створюватися в рамках процесу make install. "
+"При необхідності ви можете створити їх з папок розширень або скопіювати "
+"файли, якщо вони потрібні вам на іншому сервері."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>make check</code> uses psql to run tests and as such can use psql "
+"environment variables. Common ones useful to override are <varname>PGUSER</"
+"varname>,<varname>PGPORT</varname>, and <varname>PGHOST</varname>. Refer to "
+"<link xlink:href=\"https://www.postgresql.org/docs/current/libpq-envars."
+"html\">psql environment variables</link>"
+msgstr ""
+"<code>make check</code> використовує psql для виконання тестів і, отже, може "
+"використовувати змінні середовища psql. Найпоширеніші змінні, які корисно "
+"замінити, — це <varname>PGUSER</varname>,<varname>PGPORT</varname> та "
+"<varname>PGHOST</varname>. Див. <link xlink:href=\"https://www.postgresql.org/"
+"docs/current/libpq-envars.html\">Змінні середовища psql</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The extension files will always be the same for the same version of PostGIS "
+"and PostgreSQL regardless of OS, so it is fine to copy over the extension "
+"files from one OS to another as long as you have the PostGIS binaries "
+"already installed on your servers."
+msgstr ""
+"Файли розширення завжди будуть однаковими для однієї версії PostGIS і "
+"PostgreSQL незалежно від ОС, тому можна копіювати файли розширення з однієї "
+"ОС на іншу, якщо на ваших серверах вже встановлено бінарні файли PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you want to install the extensions manually on a separate server "
+"different from your development, You need to copy the following files from "
+"the extensions folder into the <filename>PostgreSQL / share / extension</"
+"filename> folder of your PostgreSQL install as well as the needed binaries "
+"for regular PostGIS if you don't have them already on the server."
+msgstr ""
+"Якщо ви хочете встановити розширення вручну на окремому сервері, відмінному "
+"від вашого сервера розробки, вам потрібно скопіювати наступні файли з папки "
+"розширень у папку <filename>PostgreSQL / share / extension</filename> вашої "
+"інсталяції PostgreSQL, а також необхідні бінарні файли для звичайного "
+"PostGIS, якщо вони ще не встановлені на сервері."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These are the control files that denote information such as the version of "
+"the extension to install if not specified. <filename>postgis.control, "
+"postgis_topology.control</filename>."
+msgstr ""
+"Це контрольні файли, які містять таку інформацію, як версія розширення, яке "
+"потрібно встановити, якщо вона не вказана. <filename>postgis.control, "
+"postgis_topology.control</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All the files in the /sql folder of each extension. Note that these need to "
+"be copied to the root of the PostgreSQL share/extension folder "
+"<filename>extensions/postgis/sql/*.sql</filename>, <filename>extensions/"
+"postgis_topology/sql/*.sql</filename>"
+msgstr ""
+"Усі файли в папці /sql кожного розширення. Зверніть увагу, що їх потрібно "
+"скопіювати в корінь папки PostgreSQL share/extension <filename>extensions/"
+"postgis/sql/*.sql</filename>, <filename>extensions/postgis_topology/sql/*."
+"sql</filename>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you do that, you should see <varname>postgis</varname>, "
+"<varname>postgis_topology</varname> as available extensions in PgAdmin -> "
+"extensions."
+msgstr ""
+"Після цього ви повинні побачити <varname>postgis</varname>, "
+"<varname>postgis_topology</varname> як доступні розширення в PgAdmin -> "
+"розширення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are using psql, you can verify that the extensions are installed by "
+"running this query:"
+msgstr ""
+"Якщо ви використовуєте psql, ви можете перевірити, чи встановлені "
+"розширення, виконавши такий запит:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you have the extension installed in the database you are querying, you'll "
+"see mention in the <varname>installed_version</varname> column. If you get "
+"no records back, it means you don't have postgis extensions installed on the "
+"server at all. PgAdmin III 1.14+ will also provide this information in the "
+"<varname>extensions</varname> section of the database browser tree and will "
+"even allow upgrade or uninstall by right-clicking."
+msgstr ""
+"Якщо розширення встановлено в базі даних, яку ви запитуєте, ви побачите "
+"згадку в стовпці <varname>installed_version</varname>. Якщо ви не отримали "
+"жодних записів, це означає, що на сервері взагалі не встановлено розширень "
+"postgis. PgAdmin III 1.14+ також надасть цю інформацію в розділі "
+"<varname>extensions</varname> дерева браузера бази даних і навіть дозволить "
+"оновити або видалити розширення, клацнувши правою кнопкою миші."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you have the extensions available, you can install postgis extension in "
+"your database of choice by either using pgAdmin extension interface or "
+"running these sql commands:"
+msgstr ""
+"Якщо у вас доступні розширення, ви можете встановити розширення postgis у "
+"вибраній базі даних за допомогою інтерфейсу розширення pgAdmin або виконавши "
+"такі команди sql:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In psql you can use to see what versions you have installed and also what "
+"schema they are installed."
+msgstr ""
+"У psql ви можете переглянути, які версії ви встановили, а також, в якій "
+"схемі вони встановлені."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Extension tables <varname>spatial_ref_sys</varname>, <varname>layer</"
+"varname>, <varname>topology</varname> can not be explicitly backed up. They "
+"can only be backed up when the respective <varname>postgis</varname> or "
+"<varname>postgis_topology</varname> extension is backed up, which only seems "
+"to happen when you backup the whole database. As of PostGIS 2.0.1, only srid "
+"records not packaged with PostGIS are backed up when the database is backed "
+"up so don't go around changing srids we package and expect your changes to "
+"be there. Put in a ticket if you find an issue. The structures of extension "
+"tables are never backed up since they are created with <code>CREATE "
+"EXTENSION</code> and assumed to be the same for a given version of an "
+"extension. These behaviors are built into the current PostgreSQL extension "
+"model, so nothing we can do about it."
+msgstr ""
+"Таблиці розширення <varname>spatial_ref_sys</varname>, <varname>layer</"
+"varname>, <varname>topology</varname> не можуть бути явно збережені. Їх "
+"можна створити резервну копію лише під час створення резервної копії "
+"відповідного розширення <varname>postgis</varname> або "
+"<varname>postgis_topology</varname>, що, як видається, відбувається лише під "
+"час створення резервної копії всієї бази даних. Починаючи з PostGIS 2.0.1, "
+"під час резервного копіювання бази даних створюються резервні копії лише "
+"записів srid, які не входять до складу PostGIS, тому не змінюйте srid, які "
+"ми пакуємо, і не очікуйте, що ваші зміни будуть збережені. Якщо ви виявили "
+"проблему, створіть квиток. Структури таблиць розширень ніколи не "
+"резервуються, оскільки вони створюються за допомогою <code>CREATE EXTENSION</"
+"code> і вважаються однаковими для певної версії розширення. Ця поведінка "
+"вбудована в поточну модель розширень PostgreSQL, тому ми нічого не можемо з "
+"цим зробити."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you installed &last_release_version;, without using our wonderful "
+"extension system, you can change it to be extension based by running the "
+"below commands to package the functions in their respective extension. "
+"Installing using `unpackaged` was removed in PostgreSQL 13, so you are "
+"advised to switch to an extension build before upgrading to PostgreSQL 13."
+msgstr ""
+"Якщо ви встановили &last_release_version; без використання нашої чудової "
+"системи розширень, ви можете змінити його на розширення, виконавши наведені "
+"нижче команди, щоб упакувати функції у відповідні розширення. Встановлення "
+"за допомогою `unpackaged` було видалено в PostgreSQL 13, тому перед "
+"оновленням до PostgreSQL 13 рекомендується перейти на збірку розширення."
+
+#. Tag: title
+#, no-c-format
+msgid "Testing"
+msgstr "Тестування"
+
+#. Tag: para
+#, no-c-format
+msgid "If you wish to test the PostGIS build, run"
+msgstr "Якщо ви бажаєте протестувати збірку PostGIS, запустіть"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above command will run through various checks and regression tests using "
+"the generated library against an actual PostgreSQL database."
+msgstr ""
+"Вищезазначена команда виконає різні перевірки та регресійні тести, "
+"використовуючи створену бібліотеку та реальну базу даних PostgreSQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you configured PostGIS using non-standard PostgreSQL, GEOS, or Proj "
+"locations, you may need to add their library locations to the "
+"<varname>LD_LIBRARY_PATH</varname> environment variable."
+msgstr ""
+"Якщо ви налаштували PostGIS, використовуючи нестандартні розташування "
+"PostgreSQL, GEOS або Proj, можливо, вам доведеться додати розташування їхніх "
+"бібліотек до змінної середовища <varname>LD_LIBRARY_PATH</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Currently, the <command>make check</command> relies on the <code>PATH</code> "
+"and <code>PGPORT</code> environment variables when performing the checks - "
+"it does <emphasis>not</emphasis> use the PostgreSQL version that may have "
+"been specified using the configuration parameter <command>--with-pgconfig</"
+"command>. So make sure to modify your PATH to match the detected PostgreSQL "
+"installation during configuration or be prepared to deal with the impending "
+"headaches."
+msgstr ""
+"Наразі команда <command>make check</command> під час виконання перевірок "
+"використовує змінні середовища <code>PATH</code> та <code>PGPORT</code> — "
+"вона <emphasis>не</emphasis> використовує версію PostgreSQL, яка може бути "
+"вказана за допомогою параметра конфігурації <command>--with-pgconfig</"
+"command>. Тому під час конфігурації обов'язково змініть PATH відповідно до "
+"виявленої інсталяції PostgreSQL або будьте готові до можливих проблем."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If successful, make check will produce the output of almost 500 tests. The "
+"results will look similar to the following (numerous lines omitted below):"
+msgstr ""
+"Якщо все пройде успішно, команда make check видасть результат майже 500 "
+"тестів. Результати будуть схожими на наведені нижче (багато рядків опущено):"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>postgis_tiger_geocoder</varname> and "
+"<varname>address_standardizer</varname> extensions, currently only support "
+"the standard PostgreSQL installcheck. To test these use the below. Note: the "
+"make install is not necessary if you already did make install at root of "
+"PostGIS code folder."
+msgstr ""
+"Розширення <varname>postgis_tiger_geocoder</varname> та "
+"<varname>address_standardizer</varname> наразі підтримують лише стандартну "
+"перевірку інсталяції PostgreSQL. Щоб перевірити їх, скористайтеся наведеним "
+"нижче кодом. Примітка: команда make install не потрібна, якщо ви вже "
+"виконали make install у кореневому каталозі коду PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid "For address_standardizer:"
+msgstr "Для address_standardizer:"
+
+#. Tag: para
+#, no-c-format
+msgid "Output should look like:"
+msgstr "Результат повинен виглядати так:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For tiger geocoder, make sure you have postgis and fuzzystrmatch extensions "
+"available in your PostgreSQL instance. The address_standardizer tests will "
+"also kick in if you built postgis with address_standardizer support:"
+msgstr ""
+"Для геокодера tiger переконайтеся, що у вашому екземплярі PostgreSQL "
+"доступні розширення postgis та fuzzystrmatch. Тести address_standardizer "
+"також запустяться, якщо ви створили postgis із підтримкою "
+"address_standardizer:"
+
+#. Tag: para
+#, no-c-format
+msgid "output should look like:"
+msgstr "результат повинен виглядати так:"
+
+#. Tag: title
+#, no-c-format
+msgid "Installation"
+msgstr "Встановлення"
+
+#. Tag: para
+#, no-c-format
+msgid "To install PostGIS, type"
+msgstr "Щоб встановити PostGIS, введіть"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This will copy the PostGIS installation files into their appropriate "
+"subdirectory specified by the <command>--prefix</command> configuration "
+"parameter. In particular:"
+msgstr ""
+"Це скопіює файли інсталяції PostGIS у відповідний підкаталог, вказаний "
+"параметром конфігурації <command>--prefix</command>. Зокрема:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The loader and dumper binaries are installed in <filename>[prefix]/bin</"
+"filename>."
+msgstr ""
+"Бінарні файли завантажувача та вивантажувача встановлюються в "
+"<filename>[prefix]/bin</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The SQL files, such as <filename>postgis.sql</filename>, are installed in "
+"<filename>[prefix]/share/contrib</filename>."
+msgstr ""
+"Файли SQL, такі як <filename>postgis.sql</filename>, встановлюються в "
+"<filename>[prefix]/share/contrib</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS libraries are installed in <filename>[prefix]/lib</filename>."
+msgstr "Бібліотеки PostGIS встановлюються в <filename>[prefix]/lib</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you previously ran the <command>make comments</command> command to "
+"generate the <filename>postgis_comments.sql</filename>, "
+"<filename>raster_comments.sql</filename> file, install the sql file by "
+"running"
+msgstr ""
+"Якщо ви раніше запустили команду <command>make comments</command> для "
+"створення файлів <filename>postgis_comments.sql</filename> та "
+"<filename>raster_comments.sql</filename>, встановіть файл sql, виконавши "
+"команду"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<filename>postgis_comments.sql</filename>, <filename>raster_comments.sql</"
+"filename>, <filename>topology_comments.sql</filename> was separated from the "
+"typical build and installation targets since with it comes the extra "
+"dependency of <command>xsltproc</command>."
+msgstr ""
+"<filename>postgis_comments.sql</filename>, <filename>raster_comments.sql</"
+"filename>, <filename>topology_comments.sql</filename> було виокремлено з "
+"типових цілей побудови та інсталяції, оскільки з ними виникає додаткова "
+"залежність від <command>xsltproc</command>."
+
+#. Tag: title
+#, no-c-format
+msgid "Installing and Using the address standardizer"
+msgstr "Встановлення та використання стандартизатора адрес"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <code>address_standardizer</code> extension used to be a separate "
+"package that required separate download. From PostGIS 2.2 on, it is now "
+"bundled in. For more information about the address_standardize, what it "
+"does, and how to configure it for your needs, refer to <xref "
+"linkend=\"Address_Standardizer\"/>."
+msgstr ""
+"Розширення <code>address_standardizer</code> раніше було окремим пакетом, "
+"який потрібно було завантажувати окремо. Починаючи з PostGIS 2.2, воно "
+"входить до складу пакета. Більше інформації про address_standardize, його "
+"функції та налаштування відповідно до ваших потреб дивіться у <xref linkend="
+"\"Address_Standardizer\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This standardizer can be used in conjunction with the PostGIS packaged tiger "
+"geocoder extension as a replacement for the <xref "
+"linkend=\"Normalize_Address\"/> discussed. To use as replacement refer to "
+"<xref linkend=\"tiger_pagc_address_standardizing\"/>. You can also use it as "
+"a building block for your own geocoder or use it to standardize your "
+"addresses for easier compare of addresses."
+msgstr ""
+"Цей стандартизатор можна використовувати разом із розширенням PostGIS "
+"packaged tiger geocoder як заміну для <xref linkend=\"Normalize_Address\"/>, "
+"про яке йшлося вище. Щоб використовувати його як заміну, зверніться до <xref "
+"linkend=\"tiger_pagc_address_standardizing\"/>. Ви також можете "
+"використовувати його як будівельний блок для власного геокодера або для "
+"стандартизації адрес, щоб полегшити їх порівняння."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The address standardizer relies on PCRE which is usually already installed "
+"on many Nix systems, but you can download the latest at: <link xlink:"
+"href=\"http://www.pcre.org\">http://www.pcre.org</link>. If during <xref "
+"linkend=\"installation_configuration\"/>, PCRE is found, then the address "
+"standardizer extension will automatically be built. If you have a custom "
+"pcre install you want to use instead, pass to configure <code>--with-"
+"pcredir=/path/to/pcre</code> where <filename>/path/to/pcre</filename> is the "
+"root folder for your pcre include and lib directories."
+msgstr ""
+"Стандартизатор адрес використовує PCRE, який зазвичай вже встановлений на "
+"багатьох системах Nix, але ви можете завантажити останню версію за адресою: "
+"<link xlink:href=\"http://www.pcre.org\">http://www.pcre.org</link>. Якщо під "
+"час <xref linkend=\"installation_configuration\"/> буде знайдено PCRE, "
+"розширення стандартизатора адрес буде автоматично скомпільовано. Якщо ви "
+"хочете використовувати власну версію pcre, передайте в конфігурацію <code"
+">--with-pcredir=/path/to/pcre</code>, де <filename>/path/to/pcre</filename> —"
+" коренева папка для ваших каталогів pcre include та lib."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Windows users, the PostGIS 2.1+ bundle is packaged with the "
+"address_standardizer already so no need to compile and can move straight to "
+"<code>CREATE EXTENSION</code> step."
+msgstr ""
+"Для користувачів Windows пакет PostGIS 2.1+ вже містить "
+"address_standardizer, тому компілювати не потрібно і можна переходити "
+"безпосередньо до кроку <code>CREATE EXTENSION</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you have installed, you can connect to your database and run the SQL:"
+msgstr ""
+"Після встановлення ви можете підключитися до бази даних і запустити SQL:"
+
+#. Tag: para
+#, no-c-format
+msgid "The following test requires no rules, gaz, or lex tables"
+msgstr "Наступний тест не вимагає правил, газів або лексичних таблиць"
+
+#. Tag: para
+#, no-c-format
+msgid "Output should be"
+msgstr "Результат повинен бути таким"
+
+#. Tag: title
+#, no-c-format
+msgid "Installing, Upgrading Tiger Geocoder, and loading data"
+msgstr "Встановлення, оновлення Tiger Geocoder та завантаження даних"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Extras like Tiger geocoder may not be packaged in your PostGIS distribution. "
+"If you are missing the tiger geocoder extension or want a newer version than "
+"what your install comes with, then use the <filename>share/extension/"
+"postgis_tiger_geocoder.*</filename> files from the packages in <link xlink:"
+"href=\"http://postgis.net/windows_downloads/\">Windows Unreleased Versions</"
+"link> section for your version of PostgreSQL. Although these packages are "
+"for windows, the postgis_tiger_geocoder extension files will work on any OS "
+"since the extension is an SQL/plpgsql only extension."
+msgstr ""
+"Додаткові компоненти, такі як геокодер Tiger, можуть не входити до складу "
+"вашого дистрибутива PostGIS. Якщо вам бракує розширення tiger geocoder або "
+"ви хочете мати новішу версію, ніж та, що входить до вашої інсталяції, "
+"скористайтеся файлами <filename>share/extension/postgis_tiger_geocoder.*</"
+"filename> з пакетів у розділі <link xlink:href=\"http://postgis.net/"
+"windows_downloads/\">Windows Unreleased Versions</link> для вашої версії "
+"PostgreSQL. Хоча ці пакети призначені для Windows, файли розширення "
+"postgis_tiger_geocoder працюватимуть на будь-якій ОС, оскільки розширення є "
+"розширенням тільки для SQL/plpgsql."
+
+#. Tag: title
+#, no-c-format
+msgid "Tiger Geocoder Enabling your PostGIS database"
+msgstr "Tiger Geocoder Увімкнення бази даних PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These directions assume your PostgreSQL installation already has the "
+"postgis_tiger_geocoder extension installed."
+msgstr ""
+"Ці вказівки передбачають, що у вашій установці PostgreSQL вже встановлено "
+"розширення postgis_tiger_geocoder."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Connect to your database via psql or pgAdmin or some other tool and run the "
+"following SQL commands. Note that if you are installing in a database that "
+"already has postgis, you don't need to do the first step. If you have "
+"<varname>fuzzystrmatch</varname> extension already installed, you don't need "
+"to do the second step either."
+msgstr ""
+"Підключіться до бази даних за допомогою psql, pgAdmin або іншого інструменту "
+"та виконайте наступні команди SQL. Зверніть увагу, що якщо ви встановлюєте "
+"програму в базу даних, яка вже має postgis, перший крок виконувати не "
+"потрібно. Якщо ви вже встановили розширення <varname>fuzzystrmatch</"
+"varname>, другий крок також виконувати не потрібно."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you already have postgis_tiger_geocoder extension installed, and just "
+"want to update to the latest run:"
+msgstr ""
+"Якщо ви вже встановили розширення postgis_tiger_geocoder і просто хочете "
+"оновити його до останньої версії, виконайте наступні дії:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you made custom entries or changes to <varname>tiger.loader_platform</"
+"varname> and <varname>tiger.loader_variables</varname> you may need to "
+"update these."
+msgstr ""
+"Якщо ви зробили власні записи або змінили <varname>tiger.loader_platform</"
+"varname> та <varname>tiger.loader_variables</varname>, можливо, вам "
+"доведеться їх оновити."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To confirm your install is working correctly, run this sql in your database:"
+msgstr ""
+"Щоб переконатися, що інсталяція працює правильно, виконайте цей sql-запит у "
+"вашій базі даних:"
+
+#. Tag: para
+#, no-c-format
+msgid "Which should output"
+msgstr "Що повинно вивести"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new record in <varname>tiger.loader_platform</varname> table with "
+"the paths of your executables and server."
+msgstr ""
+"Створіть новий запис у таблиці <varname>tiger.loader_platform</varname> із "
+"шляхами до ваших виконуваних файлів та сервера."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"So for example to create a profile called debbie that follows <code>sh</"
+"code> convention. You would do:"
+msgstr ""
+"Наприклад, щоб створити профіль під назвою debbie, який дотримується "
+"конвенції <code>sh</code>, потрібно зробити наступне:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"And then edit the paths in the <emphasis>declare_sect</emphasis> column to "
+"those that fit Debbie's pg, unzip,shp2pgsql, psql, etc path locations."
+msgstr ""
+"А потім відредагуйте шляхи в стовпці <emphasis>declare_sect</emphasis> "
+"відповідно до шляхів, що відповідають розташуванню pg, unzip, shp2pgsql, "
+"psql тощо у Debbie."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you don't edit this <varname>loader_platform</varname> table, it will "
+"just contain common case locations of items and you'll have to edit the "
+"generated script after the script is generated."
+msgstr ""
+"Якщо ви не відредагуєте цю таблицю <varname>loader_platform</varname>, вона "
+"буде містити лише загальні розташування елементів, і вам доведеться "
+"редагувати скрипт після його створення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As of PostGIS 2.4.1 the Zip code-5 digit tabulation area <varname>zcta5</"
+"varname> load step was revised to load current zcta5 data and is part of the "
+"<xref linkend=\"Loader_Generate_Nation_Script\"/> when enabled. It is turned "
+"off by default because it takes quite a bit of time to load (20 to 60 "
+"minutes), takes up quite a bit of disk space, and is not used that often."
+msgstr ""
+"Починаючи з PostGIS 2.4.1, крок завантаження 5-значного поштового індексу "
+"<varname>zcta5</varname> було переглянуто, щоб завантажувати поточні дані "
+"zcta5, і він є частиною <xref linkend=\"Loader_Generate_Nation_Script\"/>, "
+"коли ввімкнено. За замовчуванням він вимкнений, оскільки завантаження займає "
+"досить багато часу (від 20 до 60 хвилин), займає чимало місця на диску і "
+"використовується не так часто."
+
+#. Tag: para
+#, no-c-format
+msgid "To enable it, do the following:"
+msgstr "Щоб увімкнути цю функцію, виконайте такі дії:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If present the <xref linkend=\"Geocode\"/> function can use it if a boundary "
+"filter is added to limit to just zips in that boundary. The <xref "
+"linkend=\"Reverse_Geocode\"/> function uses it if the returned address is "
+"missing a zip, which often happens with highway reverse geocoding."
+msgstr ""
+"Якщо присутня функція <xref linkend=\"Geocode\"/>, вона може використовувати "
+"її, якщо додано фільтр меж, щоб обмежити пошук лише поштовими індексами в "
+"цих межах. Функція <xref linkend=\"Reverse_Geocode\"/> використовує її, якщо "
+"у повернутій адресі відсутній поштовий індекс, що часто трапляється при "
+"зворотному геокодуванні автомагістралей."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a folder called <filename>gisdata</filename> on root of server or "
+"your local pc if you have a fast network connection to the server. This "
+"folder is where the tiger files will be downloaded to and processed. If you "
+"are not happy with having the folder on the root of the server, or simply "
+"want to change to a different folder for staging, then edit the field "
+"<varname>staging_fold</varname> in the <varname>tiger.loader_variables</"
+"varname> table."
+msgstr ""
+"Створіть папку з назвою <filename>gisdata</filename> в кореневому каталозі "
+"сервера або на вашому локальному комп'ютері, якщо у вас швидке підключення "
+"до сервера. У цю папку будуть завантажуватися та оброблятися файли tiger. "
+"Якщо ви не хочете, щоб папка знаходилася в кореневому каталозі сервера, або "
+"просто хочете змінити папку для тимчасового зберігання, відредагуйте поле "
+"<varname>staging_fold</varname> в таблиці <varname>tiger."
+"loader_variables</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a folder called temp in the <filename>gisdata</filename> folder or "
+"wherever you designated the <varname>staging_fold</varname> to be. This will "
+"be the folder where the loader extracts the downloaded tiger data."
+msgstr ""
+"Створіть папку з назвою temp у папці <filename>gisdata</filename> або в будь-"
+"якому іншому місці, яке ви призначили для <varname>staging_fold</varname>. "
+"Це буде папка, куди завантажувач витягне завантажені дані tiger."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Then run the <xref linkend=\"Loader_Generate_Nation_Script\"/> SQL function "
+"make sure to use the name of your custom profile and copy the script to a ."
+"sh or .bat file. So for example to build the nation load:"
+msgstr ""
+"Потім запустіть функцію SQL <xref linkend=\"Loader_Generate_Nation_Script\"/"
+">, обов'язково вкажіть ім'я вашого власного профілю та скопіюйте скрипт у "
+"файл .sh або .bat. Наприклад, щоб створити націю, завантажте:"
+
+#. Tag: para
+#, no-c-format
+msgid "Run the generated nation load commandline scripts."
+msgstr ""
+"Запустіть скрипти командного рядка для завантаження нації, що були створені."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After you are done running the nation script, you should have three tables "
+"in your <code>tiger_data</code> schema and they should be filled with data. "
+"Confirm you do by doing the following queries from psql or pgAdmin"
+msgstr ""
+"Після завершення виконання скрипта nation у схемі <code>tiger_data</code> "
+"має бути три таблиці, які повинні бути заповнені даними. Перевірте це, "
+"виконавши наступні запити з psql або pgAdmin"
+
+#. Tag: para
+#, no-c-format
+msgid "This will only have data if you marked zcta5 to be loaded"
+msgstr ""
+"Це буде містити дані тільки в тому випадку, якщо ви позначили zcta5 для "
+"завантаження"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default the tables corresponding to <varname>bg</varname>, "
+"<varname>tract</varname>, <varname>tabblock20</varname> are not loaded. "
+"These tables are not used by the geocoder but are used by folks for "
+"population statistics. If you wish to load them as part of your state loads, "
+"run the following statement to enable them."
+msgstr ""
+"За замовчуванням таблиці, що відповідають <varname>bg</varname>, "
+"<varname>tract</varname>, <varname>tabblock20</varname>, не завантажуються. "
+"Ці таблиці не використовуються геокодером, але використовуються для "
+"статистики населення. Якщо ви хочете завантажити їх як частину завантаження "
+"даних про стан, виконайте наступну команду, щоб увімкнути їх."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alternatively you can load just these tables after loading state data using "
+"the <xref linkend=\"Loader_Generate_Census_Script\"/>"
+msgstr ""
+"Або ви можете завантажити тільки ці таблиці після завантаження даних про "
+"стан за допомогою <xref linkend=\"Loader_Generate_Census_Script\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"DO NOT Generate the state script until you have already loaded the nation "
+"data, because the state script utilizes county list loaded by nation script."
+msgstr ""
+"НЕ створюйте скрипт штату, поки не завантажили дані про країну, оскільки "
+"скрипт штату використовує список округів, завантажений скриптом країни."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For each state you want to load data for, generate a state script <xref "
+"linkend=\"Loader_Generate_Script\"/>."
+msgstr ""
+"Для кожного стану, для якого ви хочете завантажити дані, створіть скрипт "
+"стану <xref linkend=\"Loader_Generate_Script\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Run the generated commandline scripts."
+msgstr "Запустіть скрипти командного рядка, що були створені."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After you are done loading all data or at a stopping point, it's a good idea "
+"to analyze all the tiger tables to update the stats (include inherited stats)"
+msgstr ""
+"Після завантаження всіх даних або на етапі зупинки рекомендується "
+"проаналізувати всі таблиці tiger, щоб оновити статистику (включно зі "
+"статистикою, що успадковується)"
+
+#. Tag: title
+#, no-c-format
+msgid "Using Address Standardizer Extension with Tiger geocoder"
+msgstr "Використання розширення Address Standardizer з геокодером Tiger"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"One of the many complaints of folks is the address normalizer function <xref "
+"linkend=\"Normalize_Address\"/> function that normalizes an address for "
+"prepping before geocoding. The normalizer is far from perfect and trying to "
+"patch its imperfectness takes a vast amount of resources. As such we have "
+"integrated with another project that has a much better address standardizer "
+"engine. To use this new address_standardizer, you compile the extension as "
+"described in <xref linkend=\"installing_pagc_address_standardizer\"/> and "
+"install as an extension in your database."
+msgstr ""
+"Однією з багатьох скарг користувачів є функція нормалізації адреси <xref "
+"linkend=\"Normalize_Address\"/>, яка нормалізує адресу для підготовки до "
+"геокодування. Нормалізатор далеко не ідеальний, і спроби виправити його "
+"недоліки вимагають значних ресурсів. Тому ми інтегрували інший проект, який "
+"має набагато кращий механізм стандартизації адрес. Щоб використовувати цей "
+"новий address_standardizer, скомпілюйте розширення, як описано в <xref "
+"linkend=\"installing_pagc_address_standardizer\"/>, і встановіть його як "
+"розширення у вашій базі даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you install this extension in the same database as you have installed "
+"<code>postgis_tiger_geocoder</code>, then the <xref "
+"linkend=\"Pagc_Normalize_Address\"/> can be used instead of <xref "
+"linkend=\"Normalize_Address\"/>. This extension is tiger agnostic, so can be "
+"used with other data sources such as international addresses. The tiger "
+"geocoder extension does come packaged with its own custom versions of <xref "
+"linkend=\"rulestab\"/> ( <code>tiger.pagc_rules</code>) , <xref "
+"linkend=\"gaztab\"/> (<code>tiger.pagc_gaz</code>), and <xref "
+"linkend=\"lextab\"/> (<code>tiger.pagc_lex</code>). These you can add and "
+"update to improve your standardizing experience for your own needs."
+msgstr ""
+"Після встановлення цього розширення в тій самій базі даних, де встановлено "
+"<code>postgis_tiger_geocoder</code>, замість <xref linkend="
+"\"Normalize_Address\"/> можна використовувати <xref linkend="
+"\"Pagc_Normalize_Address\"/>. Це розширення не залежить від tiger, тому його "
+"можна використовувати з іншими джерелами даних, такими як міжнародні адреси. "
+"Розширення tiger geocoder постачається у комплекті з власними версіями <xref "
+"linkend=\"rulestab\"/> ( <code>tiger.pagc_rules</code>) , <xref linkend="
+"\"gaztab\"/> (<code>tiger.pagc_gaz</code>) та <xref linkend=\"lextab\"/> "
+"(<code>tiger.pagc_lex</code>). Ви можете додавати та оновлювати їх, щоб "
+"покращити стандартизацію відповідно до власних потреб."
+
+#. Tag: title
+#, no-c-format
+msgid "Required tools for tiger data loading"
+msgstr "Необхідні інструменти для завантаження tiger даних"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The load process downloads data from the census website for the respective "
+"nation files, states requested, extracts the files, and then loads each "
+"state into its own separate set of state tables. Each state table inherits "
+"from the tables defined in <varname>tiger</varname> schema so that its "
+"sufficient to just query those tables to access all the data and drop a set "
+"of state tables at any time using the <xref "
+"linkend=\"Drop_State_Tables_Generate_Script\"/> if you need to reload a "
+"state or just don't need a state anymore."
+msgstr ""
+"Процес завантаження завантажує дані з веб-сайту перепису населення для "
+"відповідних файлів країн, запитуваних штатів, витягує файли, а потім "
+"завантажує кожен штат у свій окремий набір таблиць штатів. Кожна таблиця "
+"штату успадковує таблиці, визначені в схемі <varname>tiger</varname>, так що "
+"достатньо просто зробити запит до цих таблиць, щоб отримати доступ до всіх "
+"даних, і видалити набір таблиць штатів у будь-який час за допомогою <xref "
+"linkend=\"Drop_State_Tables_Generate_Script\"/>, якщо вам потрібно "
+"перезавантажити штат або він вам більше не потрібен."
+
+#. Tag: para
+#, no-c-format
+msgid "In order to be able to load data you'll need the following tools:"
+msgstr "Для завантаження даних вам знадобляться такі інструменти:"
+
+#. Tag: para
+#, no-c-format
+msgid "A tool to unzip the zip files from census website."
+msgstr "Інструмент для розпакування zip-файлів з веб-сайту перепису населення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Unix like systems: <varname>unzip</varname> executable which is usually "
+"already installed on most Unix like platforms."
+msgstr ""
+"Для систем типу Unix: <varname>unzip</varname> виконуваний файл, який "
+"зазвичай вже встановлений на більшості платформ типу Unix."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Windows, 7-zip which is a free compress/uncompress tool you can download "
+"from <link xlink:href=\"http://www.7-zip.org/\">http://www.7-zip.org/</link>"
+msgstr ""
+"Для Windows можна завантажити безкоштовну програму для стиснення/"
+"розпакування файлів 7-zip за посиланням <link xlink:href=\"http://www.7-zip."
+"org/\">http://www.7-zip.org/</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<filename>shp2pgsql</filename> commandline which is installed by default "
+"when you install PostGIS."
+msgstr ""
+"Командний рядок <filename>shp2pgsql</filename>, який встановлюється за "
+"замовчуванням під час інсталяції PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<filename>wget</filename> which is a web grabber tool usually installed on "
+"most Unix/Linux systems."
+msgstr ""
+"<filename>wget</filename> — це інструмент для завантаження веб-сторінок, "
+"який зазвичай встановлюється на більшості систем Unix/Linux."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are on windows, you can get pre-compiled binaries from <link xlink:"
+"href=\"http://gnuwin32.sourceforge.net/packages/wget.htm\">http://gnuwin32."
+"sourceforge.net/packages/wget.htm</link>"
+msgstr ""
+"Якщо ви використовуєте Windows, ви можете завантажити попередньо "
+"скомпільовані бінарні файли з <link xlink:href=\"http://gnuwin32.sourceforge."
+"net/packages/wget.htm\">http://gnuwin32.sourceforge.net/packages/wget."
+"htm</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are upgrading from tiger_2010, you'll need to first generate and run "
+"<xref linkend=\"Drop_Nation_Tables_Generate_Script\"/>. Before you load any "
+"state data, you need to load the nation wide data which you do with <xref "
+"linkend=\"Loader_Generate_Nation_Script\"/>. Which will generate a loader "
+"script for you. <xref linkend=\"Loader_Generate_Nation_Script\"/> is a one-"
+"time step that should be done for upgrading (from a prior year tiger census "
+"data) and for new installs."
+msgstr ""
+"Якщо ви оновлюєте систему з tiger_2010, спочатку потрібно створити та "
+"запустити <xref linkend=\"Drop_Nation_Tables_Generate_Script\"/>. Перед "
+"завантаженням будь-яких даних про стан, потрібно завантажити "
+"загальнонаціональні дані за допомогою <xref linkend="
+"\"Loader_Generate_Nation_Script\"/>. Це створить для вас скрипт "
+"завантажувача. <xref linkend=\"Loader_Generate_Nation_Script\"/> — це "
+"одноразовий крок, який потрібно виконати для оновлення (з даних перепису "
+"тигрів за попередній рік) та для нових інсталяцій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To load state data refer to <xref linkend=\"Loader_Generate_Script\"/> to "
+"generate a data load script for your platform for the states you desire. "
+"Note that you can install these piecemeal. You don't have to load all the "
+"states you want all at once. You can load them as you need them."
+msgstr ""
+"Щоб завантажити дані про стан, зверніться до <xref linkend="
+"\"Loader_Generate_Script\"/>, щоб створити скрипт завантаження даних для "
+"вашої платформи для потрібних вам станів. Зверніть увагу, що ви можете "
+"встановлювати їх по частинах. Не обов'язково завантажувати всі потрібні "
+"стани одночасно. Ви можете завантажувати їх у міру необхідності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After the states you desire have been loaded, make sure to run the: "
+"<programlisting>SELECT install_missing_indexes();</programlisting> as "
+"described in <xref linkend=\"Install_Missing_Indexes\"/>."
+msgstr ""
+"Після завантаження потрібних штатів обов'язково виконайте команду: "
+"<programlisting>SELECT install_missing_indexes();</programlisting> "
+"відповідно до опису в <xref linkend=\"Install_Missing_Indexes\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test that things are working as they should, try to run a geocode on an "
+"address in your state using <xref linkend=\"Geocode\"/>"
+msgstr ""
+"Щоб перевірити, чи все працює як слід, спробуйте виконати геокодування "
+"адреси у вашому штаті, використовуючи <xref linkend=\"Geocode\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Upgrading your Tiger Geocoder Install and Data"
+msgstr "Оновлення інсталяції та даних Tiger Geocoder"
+
+#. Tag: para
+#, no-c-format
+msgid "First upgrade your postgis_tiger_geocoder extension as follows:"
+msgstr "Спочатку оновіть розширення postgis_tiger_geocoder наступним чином:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Next drop all nation tables and load up the new ones. Generate a drop script "
+"with this SQL statement as detailed in <xref "
+"linkend=\"Drop_Nation_Tables_Generate_Script\"/>"
+msgstr ""
+"Далі видаліть усі таблиці країн і завантажте нові. Створіть скрипт видалення "
+"за допомогою цього SQL-запиту, як описано в <xref linkend="
+"\"Drop_Nation_Tables_Generate_Script\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid "Run the generated drop SQL statements."
+msgstr "Виконайте згенеровані оператори SQL для створення таблиць."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generate a nation load script with this SELECT statement as detailed in "
+"<xref linkend=\"Loader_Generate_Nation_Script\"/>"
+msgstr ""
+"Створіть скрипт завантаження нації за допомогою цієї команди SELECT, як "
+"описано в <xref linkend=\"Loader_Generate_Nation_Script\"/>"
+
+#. Tag: emphasis
+#, no-c-format
+msgid "For windows"
+msgstr "Для windows"
+
+#. Tag: emphasis
+#, no-c-format
+msgid "For unix/linux"
+msgstr "Для Unix/Linux"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to <xref linkend=\"install_tiger_geocoder_extension\"/> for "
+"instructions on how to run the generate script. This only needs to be done "
+"once."
+msgstr ""
+"Інструкції щодо запуску скрипту генерації див. у <xref linkend="
+"\"install_tiger_geocoder_extension\"/>. Це потрібно зробити лише один раз."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can have a mix of different year state tables and can upgrade each state "
+"separately. Before you upgrade a state you first need to drop the prior year "
+"state tables for that state using <xref "
+"linkend=\"Drop_State_Tables_Generate_Script\"/>."
+msgstr ""
+"Ви можете мати комбінацію таблиць стану за різні роки та оновлювати кожен "
+"стан окремо. Перед оновленням стану спочатку потрібно видалити таблиці стану "
+"за попередній рік для цього стану за допомогою <xref linkend="
+"\"Drop_State_Tables_Generate_Script\"/>."
+
+#. Tag: title
+#, no-c-format
+msgid "Common Problems during installation"
+msgstr "Поширені проблеми під час встановлення"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are several things to check when your installation or upgrade doesn't "
+"go as you expected."
+msgstr ""
+"Якщо установка або оновлення не відбуваються так, як ви очікували, слід "
+"перевірити кілька речей."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Check that you have installed PostgreSQL &min_postgres_version; or newer, "
+"and that you are compiling against the same version of the PostgreSQL source "
+"as the version of PostgreSQL that is running. Mix-ups can occur when your "
+"(Linux) distribution has already installed PostgreSQL, or you have otherwise "
+"installed PostgreSQL before and forgotten about it. PostGIS will only work "
+"with PostgreSQL &min_postgres_version; or newer, and strange, unexpected "
+"error messages will result if you use an older version. To check the version "
+"of PostgreSQL which is running, connect to the database using psql and run "
+"this query:"
+msgstr ""
+"Переконайтеся, що ви встановили PostgreSQL &min_postgres_version; або новішу "
+"версію, і що ви компілюєте з тією ж версією вихідного коду PostgreSQL, що і "
+"версія PostgreSQL, яка працює. Плутанина може виникнути, якщо у вашому "
+"дистрибутиві (Linux) вже встановлено PostgreSQL або ви раніше встановлювали "
+"PostgreSQL і забули про це. PostGIS працюватиме лише з PostgreSQL "
+"&min_postgres_version; або новішою версією, а використання старішої версії "
+"призведе до появи дивних, несподіваних повідомлень про помилки. Щоб "
+"перевірити версію PostgreSQL, що працює, під’єднайтеся до бази даних за "
+"допомогою psql і виконайте цей запит:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are running an RPM based distribution, you can check for the "
+"existence of pre-installed packages using the <command>rpm</command> command "
+"as follows: <command>rpm -qa | grep postgresql</command>"
+msgstr ""
+"Якщо ви використовуєте дистрибутив на основі RPM, ви можете перевірити "
+"наявність попередньо встановлених пакетів за допомогою команди <command>rpm</"
+"command> наступним чином: <command>rpm -qa | grep postgresql</command>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If your upgrade fails, make sure you are restoring into a database that "
+"already has PostGIS installed."
+msgstr ""
+"Якщо оновлення не вдалося, переконайтеся, що ви відновлюєте дані в базу, в "
+"якій вже встановлено PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Also check that configure has correctly detected the location and version of "
+"PostgreSQL, the Proj library and the GEOS library."
+msgstr ""
+"Також перевірте, чи конфігуратор правильно визначив розташування та версію "
+"PostgreSQL, бібліотеки Proj та бібліотеки GEOS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The output from configure is used to generate the <filename>postgis_config."
+"h</filename> file. Check that the <varname>POSTGIS_PGSQL_VERSION</varname>, "
+"<varname>POSTGIS_PROJ_VERSION</varname> and <varname>POSTGIS_GEOS_VERSION</"
+"varname> variables have been set correctly."
+msgstr ""
+"Вихідні дані команди configure використовуються для створення файлу "
+"<filename>postgis_config.h</filename>. Перевірте, чи правильно встановлено "
+"змінні <varname>POSTGIS_PGSQL_VERSION</varname>, "
+"<varname>POSTGIS_PROJ_VERSION</varname> та "
+"<varname>POSTGIS_GEOS_VERSION</varname>."
+
+#. Tag: title
+#, no-c-format
+msgid "Introduction"
+msgstr "Вступ"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS is a spatial extension for the PostgreSQL relational database that "
+"was created by Refractions Research Inc, as a spatial database technology "
+"research project. Refractions is a GIS and database consulting company in "
+"Victoria, British Columbia, Canada, specializing in data integration and "
+"custom software development."
+msgstr ""
+"PostGIS — це просторове розширення для реляційної бази даних PostgreSQL, "
+"створене компанією Refractions Research Inc. як проект з дослідження "
+"технологій просторових баз даних. Refractions — це компанія з консалтингу в "
+"галузі ГІС та баз даних, розташована у місті Вікторія, Британська Колумбія, "
+"Канада, що спеціалізується на інтеграції даних та розробці програмного "
+"забезпечення на замовлення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS is now a project of the OSGeo Foundation and is developed and funded "
+"by many FOSS4G developers and organizations all over the world that gain "
+"great benefit from its functionality and versatility."
+msgstr ""
+"PostGIS зараз є проєктом Фонду OSGeo, розробляється і фінансується багатьма "
+"розробниками FOSS4G і організаціями по всьому світу, які отримують величезну "
+"користь від його функціональності та універсальності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS project development group plans on supporting and enhancing "
+"PostGIS to better support a range of important GIS functionality in the "
+"areas of OGC and SQL/MM spatial standards, advanced topological constructs "
+"(coverages, surfaces, networks), data source for desktop user interface "
+"tools for viewing and editing GIS data, and web-based access tools."
+msgstr ""
+"Група розробників проєкту PostGIS планує підтримувати та вдосконалювати "
+"PostGIS для кращої підтримки ряду важливих функціональних можливостей ГІС в "
+"області просторових стандартів OGC і SQL/MM, розширених топологічних "
+"конструкцій (покриття, поверхні, сітки), джерел даних для інструментів для "
+"перегляду і редагування даних ГІС, а також інструментів вебдоступу до них."
+
+#. Tag: title
+#, no-c-format
+msgid "Project Steering Committee"
+msgstr "Керівний комітет проекту"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS Project Steering Committee (PSC) coordinates the general "
+"direction, release cycles, documentation, and outreach efforts for the "
+"PostGIS project. In addition the PSC provides general user support, accepts "
+"and approves patches from the general PostGIS community and votes on "
+"miscellaneous issues involving PostGIS such as developer commit access, new "
+"PSC members or significant API changes."
+msgstr ""
+"Координаційний комітет проекту PostGIS (PSC) координує загальний напрямок, "
+"цикли випуску, документацію та інформаційно-просвітницьку діяльність проекту "
+"PostGIS. Крім того, PSC надає загальну підтримку користувачам, приймає та "
+"затверджує виправлення від загальної спільноти PostGIS і голосує з різних "
+"питань, що стосуються PostGIS, таких як доступ розробників до комітів, нові "
+"члени PSC або значні зміни API."
+
+#. Tag: term
+#, no-c-format
+msgid "Raúl Marín Rodríguez"
+msgstr "Рауль Марін Родрігес"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"MVT support, Bug fixing, Performance and stability improvements, GitHub "
+"curation, alignment of PostGIS with PostgreSQL releases"
+msgstr ""
+"Підтримка MVT, виправлення помилок, поліпшення продуктивності та "
+"стабільності, курація GitHub, узгодження PostGIS з релізами PostgreSQL"
+
+#. Tag: term
+#, no-c-format
+msgid "Regina Obe"
+msgstr "Регіна Обе"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"CI and website maintenance, Windows production and experimental builds, "
+"documentation, alignment of PostGIS with PostgreSQL releases, X3D support, "
+"TIGER geocoder support, management functions."
+msgstr ""
+"CI та обслуговування веб-сайту, виробництво та експериментальні збірки "
+"Windows, документація, узгодження PostGIS з випусками PostgreSQL, підтримка "
+"X3D, підтримка геокодера TIGER, функції управління."
+
+#. Tag: term
+#, no-c-format
+msgid "Darafei Praliaskouski"
+msgstr "Дарафей Пралясковський"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index improvements, bug fixing and geometry/geography function improvements, "
+"SFCGAL, raster, GitHub curation, and ci maintenance."
+msgstr ""
+"Покращення індексу, виправлення помилок та покращення функцій геометрії/"
+"географії, SFCGAL, растр, курація GitHub та обслуговування ci."
+
+#. Tag: term
+#, no-c-format
+msgid "Paul Ramsey (Chair)"
+msgstr "Пол Рамзі (голова)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Co-founder of PostGIS project. General bug fixing, geography support, "
+"geography and geometry index support (2D, 3D, nD index and anything spatial "
+"index), underlying geometry internal structures, GEOS functionality "
+"integration and alignment with GEOS releases, alignment of PostGIS with "
+"PostgreSQL releases, loader/dumper, and Shapefile GUI loader."
+msgstr ""
+"Співзасновник проекту PostGIS. Загальне виправлення помилок, підтримка "
+"географії, підтримка географічних та геометричних індексів (2D, 3D, nD "
+"індекси та будь-які просторові індекси), внутрішні структури геометрії, "
+"інтеграція функціональності GEOS та узгодження з релізами GEOS, узгодження "
+"PostGIS з релізами PostgreSQL, завантажувач/вивантажувач та завантажувач "
+"Shapefile GUI."
+
+#. Tag: term
+#, no-c-format
+msgid "Sandro Santilli"
+msgstr "Сандро Сантіллі"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Bug fixes and maintenance, ci maintenance, git mirror management, management "
+"functions, integration of new GEOS functionality and alignment with GEOS "
+"releases, topology support, and raster framework and low level API functions."
+msgstr ""
+"Виправлення помилок та технічне обслуговування, обслуговування CI, "
+"управління дзеркалами Git, функції управління, інтеграція нових функцій GEOS "
+"та узгодження з випусками GEOS, підтримка топології, а також функції "
+"растрової структури та API низького рівня."
+
+#. Tag: title
+#, no-c-format
+msgid "Core Contributors Present"
+msgstr "Основні учасники"
+
+#. Tag: term
+#, no-c-format
+msgid "Nicklas Avén"
+msgstr "Ніклас Авен"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Distance function enhancements (including 3D distance and relationship "
+"functions) and additions, Tiny WKB (TWKB) output format and general user "
+"support"
+msgstr ""
+"Покращення функції відстані (включно з функціями 3D-відстані та "
+"взаємозв'язку) та доповнення, формат виводу Tiny WKB (TWKB) та загальна "
+"підтримка користувачів"
+
+#. Tag: term
+#, no-c-format
+msgid "Loïc Bartoletti"
+msgstr "Лоїк Бартолетті"
+
+#. Tag: para
+#, no-c-format
+msgid "SFCGAL enhancements and maintenance and ci support"
+msgstr "Покращення та обслуговування SFCGAL і підтримка ci"
+
+#. Tag: term
+#, no-c-format
+msgid "Dan Baston"
+msgstr "Ден Бастон"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry clustering function additions, other geometry algorithm "
+"enhancements, GEOS enhancements and general user support"
+msgstr ""
+"Додавання функцій кластеризації геометрії, інші вдосконалення алгоритмів "
+"геометрії, вдосконалення GEOS та загальна підтримка користувачів"
+
+#. Tag: term
+#, no-c-format
+msgid "Martin Davis"
+msgstr "Мартін Девіс"
+
+#. Tag: para
+#, no-c-format
+msgid "GEOS enhancements and documentation"
+msgstr "Удосконалення та документація GEOS"
+
+#. Tag: term
+#, no-c-format
+msgid "Björn Harrtell"
+msgstr "Бйорн Харрелл"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"MapBox Vector Tile, GeoBuf, and Flatgeobuf functions. Gitea testing and "
+"GitLab experimentation."
+msgstr ""
+"Функції MapBox Vector Tile, GeoBuf та Flatgeobuf. Тестування Gitea та "
+"експерименти GitLab."
+
+#. Tag: term
+#, no-c-format
+msgid "Aliaksandr Kalenik"
+msgstr "Олександр Каленік"
+
+#. Tag: para
+#, no-c-format
+msgid "Geometry Processing, PostgreSQL gist, general bug fixing"
+msgstr "Обробка геометрії, PostgreSQL gist, загальне виправлення помилок"
+
+#. Tag: title
+#, no-c-format
+msgid "Core Contributors Past"
+msgstr "Основні учасники минулого"
+
+#. Tag: term
+#, no-c-format
+msgid "Bborie Park"
+msgstr "Бборі Парк"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior PSC Member. Raster development, integration with GDAL, raster loader, "
+"user support, general bug fixing, testing on various OS (Slackware, Mac, "
+"Windows, and more)"
+msgstr ""
+"Колишній член PSC. Розробка растрових даних, інтеграція з GDAL, завантажувач "
+"растрових даних, підтримка користувачів, загальне виправлення помилок, "
+"тестування на різних ОС (Slackware, Mac, Windows та інші)"
+
+#. Tag: term
+#, no-c-format
+msgid "Mark Cave-Ayland"
+msgstr "Марк Кейв-Айланд"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior PSC Member. Coordinated bug fixing and maintenance effort, spatial "
+"index selectivity and binding, loader/dumper, and Shapefile GUI Loader, "
+"integration of new and new function enhancements."
+msgstr ""
+"Колишній член PSC. Координація виправлення помилок та технічного "
+"обслуговування, вибірковості та прив'язки просторового індексу, "
+"завантажувача/вивантажувача, а також Shapefile GUI Loader, інтеграція нових "
+"та вдосконалених функцій."
+
+#. Tag: term
+#, no-c-format
+msgid "Jorge Arévalo"
+msgstr "Хорхе Аревало"
+
+#. Tag: para
+#, no-c-format
+msgid "Raster development, GDAL driver support, loader"
+msgstr "Розробка растрових даних, підтримка драйвера GDAL, завантажувач"
+
+#. Tag: term
+#, no-c-format
+msgid "Olivier Courtin"
+msgstr "Олів'є Куртен"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(Emeritus) Input/output XML (KML,GML)/GeoJSON functions, 3D support and bug "
+"fixes."
+msgstr ""
+"(Почесний) Функції введення/виведення XML (KML, GML)/GeoJSON, підтримка 3D "
+"та виправлення помилок."
+
+#. Tag: term
+#, no-c-format
+msgid "Chris Hodgson"
+msgstr "Кріс Ходжсон"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior PSC Member. General development, site and buildbot maintenance, OSGeo "
+"incubation management"
+msgstr ""
+"Колишній член PSC. Загальний розвиток, обслуговування сайту та buildbot, "
+"управління інкубацією OSGeo"
+
+#. Tag: term
+#, no-c-format
+msgid "Mateusz Loskot"
+msgstr "Матеуш Лоскот"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"CMake support for PostGIS, built original raster loader in python and low "
+"level raster API functions"
+msgstr ""
+"Підтримка CMake для PostGIS, вбудований оригінальний завантажувач растрових "
+"даних на Python та функції низького рівня для роботи з растровими даними"
+
+#. Tag: term
+#, no-c-format
+msgid "Kevin Neufeld"
+msgstr "Кевін Нойфельд"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior PSC Member. Documentation and documentation support tools, buildbot "
+"maintenance, advanced user support on PostGIS newsgroup, and PostGIS "
+"maintenance function enhancements."
+msgstr ""
+"Колишній член PSC. Документація та інструменти підтримки документації, "
+"обслуговування buildbot, підтримка досвідчених користувачів у новинній групі "
+"PostGIS та вдосконалення функцій обслуговування PostGIS."
+
+#. Tag: term
+#, no-c-format
+msgid "Dave Blasby"
+msgstr "Дейв Бласбі"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The original developer/Co-founder of PostGIS. Dave wrote the server side "
+"objects, index bindings, and many of the server side analytical functions."
+msgstr ""
+"Оригінальний розробник/співзасновник PostGIS. Дейв написав об'єкти серверної "
+"частини, індексні прив'язки та багато аналітичних функцій серверної частини."
+
+#. Tag: term
+#, no-c-format
+msgid "Jeff Lounsbury"
+msgstr "Джефф Лаунсбері"
+
+#. Tag: para
+#, no-c-format
+msgid "Original development of the Shapefile loader/dumper."
+msgstr "Оригінальна розробка завантажувача/вивантажувача Shapefile."
+
+#. Tag: term
+#, no-c-format
+msgid "Mark Leslie"
+msgstr "Марк Леслі"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Ongoing maintenance and development of core functions. Enhanced curve "
+"support. Shapefile GUI loader."
+msgstr ""
+"Постійне обслуговування та розвиток основних функцій. Покращена підтримка "
+"кривих. Завантажувач Shapefile GUI."
+
+#. Tag: term
+#, no-c-format
+msgid "Pierre Racine"
+msgstr "П'єр Расін"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Architect of PostGIS raster implementation. Raster overall architecture, "
+"prototyping, programming support"
+msgstr ""
+"Архітектор реалізації растрових даних PostGIS. Загальна архітектура "
+"растрових даних, прототипування, підтримка програмування"
+
+#. Tag: term
+#, no-c-format
+msgid "David Zwarg"
+msgstr "Девід Цварг"
+
+#. Tag: para
+#, no-c-format
+msgid "Raster development (mostly map algebra analytic functions)"
+msgstr "Розробка растрових даних (переважно аналітичні функції алгебри карт)"
+
+#. Tag: title
+#, no-c-format
+msgid "Other Contributors"
+msgstr "Інші автори"
+
+#. Tag: term
+#, no-c-format
+msgid "Individual Contributors"
+msgstr "Індивідуальні учасники"
+
+#. Tag: member
+#, no-c-format
+msgid "Alex Bodnaru"
+msgstr "Алекс Боднару"
+
+#. Tag: member
+#, no-c-format
+msgid "Alex Mayrhofer"
+msgstr "Алекс Майрхофер"
+
+#. Tag: member
+#, no-c-format
+msgid "Andrea Peri"
+msgstr "Андреа Пері"
+
+#. Tag: member
+#, no-c-format
+msgid "Andreas Forø Tollefsen"
+msgstr "Андреас Форо Толлефсен"
+
+#. Tag: member
+#, no-c-format
+msgid "Andreas Neumann"
+msgstr "Андреас Нойман"
+
+#. Tag: member
+#, no-c-format
+msgid "Andrew Gierth"
+msgstr "Ендрю Герт"
+
+#. Tag: member
+#, no-c-format
+msgid "Anne Ghisla"
+msgstr "Енн Гісла"
+
+#. Tag: member
+#, no-c-format
+msgid "Antoine Bajolet"
+msgstr "Антуан Бажоле"
+
+#. Tag: member
+#, no-c-format
+msgid "Arthur Lesuisse"
+msgstr "Артур Лесуа"
+
+#. Tag: member
+#, no-c-format
+msgid "Artur Zakirov"
+msgstr "Артур Закіров"
+
+#. Tag: member
+#, no-c-format
+msgid "Ayo Adesugba"
+msgstr "Айо Адесугба"
+
+#. Tag: member
+#, no-c-format
+msgid "Barbara Phillipot"
+msgstr "Барбара Філліпот"
+
+#. Tag: member
+#, no-c-format
+msgid "Ben Jubb"
+msgstr "Бен Джубб"
+
+#. Tag: member
+#, no-c-format
+msgid "Bernhard Reiter"
+msgstr "Бернхард Райтер"
+
+#. Tag: member
+#, no-c-format
+msgid "Björn Esser"
+msgstr "Бйорн Ессер"
+
+#. Tag: member
+#, no-c-format
+msgid "Brian Hamlin"
+msgstr "Брайан Хемлін"
+
+#. Tag: member
+#, no-c-format
+msgid "Bruce Rindahl"
+msgstr "Брюс Ріндал"
+
+#. Tag: member
+#, no-c-format
+msgid "Bruno Wolff III"
+msgstr "Бруно Вольф III"
+
+#. Tag: member
+#, no-c-format
+msgid "Bryce L. Nordgren"
+msgstr "Брайс Л. Нордгрен"
+
+#. Tag: member
+#, no-c-format
+msgid "Carl Anderson"
+msgstr "Карл Андерсон"
+
+#. Tag: member
+#, no-c-format
+msgid "Charlie Savage"
+msgstr "Чарлі Сейвідж"
+
+#. Tag: member
+#, no-c-format
+msgid "Chris Mayo"
+msgstr "Кріс Майо"
+
+#. Tag: member
+#, no-c-format
+msgid "Christian Schroeder"
+msgstr "Крістіан Шредер"
+
+#. Tag: member
+#, no-c-format
+msgid "Christoph Berg"
+msgstr "Крістоф Берг"
+
+#. Tag: member
+#, no-c-format
+msgid "Christoph Moench-Tegeder"
+msgstr "Крістоф Менх-Тегедер"
+
+#. Tag: member
+#, no-c-format
+msgid "Dane Springmeyer"
+msgstr "Дейн Спрінгмейер"
+
+#. Tag: member
+#, no-c-format
+msgid "Daniel Nylander"
+msgstr "Даніель Нюландер"
+
+#. Tag: member
+#, no-c-format
+msgid "Dapeng Wang"
+msgstr "Дапен Ван"
+
+#. Tag: member
+#, no-c-format
+msgid "Daryl Herzmann"
+msgstr "Деріл Герцманн"
+
+#. Tag: member
+#, no-c-format
+msgid "Dave Fuhry"
+msgstr "Дейв Фурі"
+
+#. Tag: member
+#, no-c-format
+msgid "David Garnier"
+msgstr "Девід Гарньє"
+
+#. Tag: member
+#, no-c-format
+msgid "David Skea"
+msgstr "Девід Скі"
+
+#. Tag: member
+#, no-c-format
+msgid "David Techer"
+msgstr "Девід Течер"
+
+#. Tag: member
+#, no-c-format
+msgid "Dian M Fay"
+msgstr "Діан М. Фей"
+
+#. Tag: member
+#, no-c-format
+msgid "Dmitry Vasilyev"
+msgstr "Дмитро Василєв"
+
+#. Tag: member
+#, no-c-format
+msgid "Eduin Carrillo"
+msgstr "Едуїн Каррільо"
+
+#. Tag: member
+#, no-c-format
+msgid "Esteban Zimanyi"
+msgstr "Естебан Зімані"
+
+#. Tag: member
+#, no-c-format
+msgid "Eugene Antimirov"
+msgstr "Євген Антиміров"
+
+#. Tag: member
+#, no-c-format
+msgid "Even Rouault"
+msgstr "Навіть Руо"
+
+#. Tag: member
+#, no-c-format
+msgid "Florian Weimer"
+msgstr "Флоріан Ваймер"
+
+#. Tag: member
+#, no-c-format
+msgid "Frank Warmerdam"
+msgstr "Френк Вармердам"
+
+#. Tag: member
+#, no-c-format
+msgid "George Silva"
+msgstr "Джордж Сільва"
+
+#. Tag: member
+#, no-c-format
+msgid "Gerald Fenoy"
+msgstr "Джеральд Феной"
+
+#. Tag: member
+#, no-c-format
+msgid "Gino Lucrezi"
+msgstr "Джино Лукрезі"
+
+#. Tag: member
+#, no-c-format
+msgid "Greg Troxel"
+msgstr "Грег Троксел"
+
+#. Tag: member
+#, no-c-format
+msgid "Guillaume Lelarge"
+msgstr "Гійом Леларж"
+
+#. Tag: member
+#, no-c-format
+msgid "Giuseppe Broccolo"
+msgstr "Джузеппе Брокколо"
+
+#. Tag: member
+#, no-c-format
+msgid "Han Wang"
+msgstr "Хан Ван"
+
+#. Tag: member
+#, no-c-format
+msgid "Hans Lemuet"
+msgstr "Ганс Лемует"
+
+#. Tag: member
+#, no-c-format
+msgid "Haribabu Kommi"
+msgstr "Харібабу Коммі"
+
+#. Tag: member
+#, no-c-format
+msgid "Havard Tveite"
+msgstr "Хавард Твейте"
+
+#. Tag: member
+#, no-c-format
+msgid "IIDA Tetsushi"
+msgstr "ІІДА Тетсуші"
+
+#. Tag: member
+#, no-c-format
+msgid "Ingvild Nystuen"
+msgstr "Інгвільд Нюстен"
+
+#. Tag: member
+#, no-c-format
+msgid "Jackie Leng"
+msgstr "Джекі Ленг"
+
+#. Tag: member
+#, no-c-format
+msgid "James Addison"
+msgstr "Джеймс Аддісон"
+
+#. Tag: member
+#, no-c-format
+msgid "James Marca"
+msgstr "Джеймс Марка"
+
+#. Tag: member
+#, no-c-format
+msgid "Jan Katins"
+msgstr "Ян Катінс"
+
+#. Tag: member
+#, no-c-format
+msgid "Jan Tojnar"
+msgstr "Ян Тожнар"
+
+#. Tag: member
+#, no-c-format
+msgid "Jason Smith"
+msgstr "Джейсон Сміт"
+
+#. Tag: member
+#, no-c-format
+msgid "Jeff Adams"
+msgstr "Джефф Адамс"
+
+#. Tag: member
+#, no-c-format
+msgid "Jelte Fennema"
+msgstr "Джелте Феннема"
+
+#. Tag: member
+#, no-c-format
+msgid "Jim Jones"
+msgstr "Джим Джонс"
+
+#. Tag: member
+#, no-c-format
+msgid "Joe Conway"
+msgstr "Джо Конвей"
+
+#. Tag: member
+#, no-c-format
+msgid "Jonne Savolainen"
+msgstr "Йонне Саволайнен"
+
+#. Tag: member
+#, no-c-format
+msgid "Jose Carlos Martinez Llari"
+msgstr "Хосе Карлос Мартінес Лларі"
+
+#. Tag: member
+#, no-c-format
+msgid "Jörg Habenicht"
+msgstr "Йорг Хабеніхт"
+
+#. Tag: member
+#, no-c-format
+msgid "Julien Rouhaud"
+msgstr "Жюльєн Руо"
+
+#. Tag: member
+#, no-c-format
+msgid "Kashif Rasul"
+msgstr "Кашиф Расул"
+
+#. Tag: member
+#, no-c-format
+msgid "Klaus Foerster"
+msgstr "Клаус Ферстер"
+
+#. Tag: member
+#, no-c-format
+msgid "Kris Jurka"
+msgstr "Кріс Юрка"
+
+#. Tag: member
+#, no-c-format
+msgid "Laurențiu Nicola"
+msgstr "Лаурентіу Нікола"
+
+#. Tag: member
+#, no-c-format
+msgid "Laurenz Albe"
+msgstr "Лауренц Альбе"
+
+#. Tag: member
+#, no-c-format
+msgid "Lars Roessiger"
+msgstr "Ларс Роессігер"
+
+#. Tag: member
+#, no-c-format
+msgid "Leo Hsu"
+msgstr "Лео Хсу"
+
+#. Tag: member
+#, no-c-format
+msgid "Loic Dachary"
+msgstr "Лоїк Дачарі"
+
+#. Tag: member
+#, no-c-format
+msgid "Luca S. Percich"
+msgstr "Лука С. Перчіч"
+
+#. Tag: member
+#, no-c-format
+msgid "Lucas C. Villa Real"
+msgstr "Лукас С. Вілла Реаль"
+
+#. Tag: member
+#, no-c-format
+msgid "Maksim Korotkov"
+msgstr "Максим Коротков"
+
+#. Tag: member
+#, no-c-format
+msgid "Maria Arias de Reyna"
+msgstr "Марія Аріас де Рейна"
+
+#. Tag: member
+#, no-c-format
+msgid "Marc Ducobu"
+msgstr "Марк Дюкубу"
+
+#. Tag: member
+#, no-c-format
+msgid "Mark Sondheim"
+msgstr "Марк Сондхайм"
+
+#. Tag: member
+#, no-c-format
+msgid "Markus Schaber"
+msgstr "Маркус Шабер"
+
+#. Tag: member
+#, no-c-format
+msgid "Markus Wanner"
+msgstr "Маркус Ваннер"
+
+#. Tag: member
+#, no-c-format
+msgid "Matt Amos"
+msgstr "Метт Амос"
+
+#. Tag: member
+#, no-c-format
+msgid "Matt Bretl"
+msgstr "Метт Бретл"
+
+#. Tag: member
+#, no-c-format
+msgid "Matthias Bay"
+msgstr "Матіас Бей"
+
+#. Tag: member
+#, no-c-format
+msgid "Maxime Guillaud"
+msgstr "Максим Гійо"
+
+#. Tag: member
+#, no-c-format
+msgid "Maxime van Noppen"
+msgstr "Максима ван Ноппен"
+
+#. Tag: member
+#, no-c-format
+msgid "Maxime Schoemans"
+msgstr "Максим Шеманс"
+
+#. Tag: member
+#, no-c-format
+msgid "Megan Ma"
+msgstr "Меган Ма"
+
+#. Tag: member
+#, no-c-format
+msgid "Michael Fuhr"
+msgstr "Майкл Фур"
+
+#. Tag: member
+#, no-c-format
+msgid "Mike Toews"
+msgstr "Майк Тоус"
+
+#. Tag: member
+#, no-c-format
+msgid "Nathan Wagner"
+msgstr "Натан Вагнер"
+
+#. Tag: member
+#, no-c-format
+msgid "Nathaniel Clay"
+msgstr "Натаніель Клей"
+
+#. Tag: member
+#, no-c-format
+msgid "Nikita Shulga"
+msgstr "Микита Шульга"
+
+#. Tag: member
+#, no-c-format
+msgid "Norman Vine"
+msgstr "Норман Вайн"
+
+#. Tag: member
+#, no-c-format
+msgid "Patricia Tozer"
+msgstr "Патрісія Тозер"
+
+#. Tag: member
+#, no-c-format
+msgid "Rafal Magda"
+msgstr "Рафал Магда"
+
+#. Tag: member
+#, no-c-format
+msgid "Ralph Mason"
+msgstr "Ральф Мейсон"
+
+#. Tag: member
+#, no-c-format
+msgid "Rémi Cura"
+msgstr "Ремі Кура"
+
+#. Tag: member
+#, no-c-format
+msgid "Richard Greenwood"
+msgstr "Річард Грінвуд"
+
+#. Tag: member
+#, no-c-format
+msgid "Robert Coup"
+msgstr "Роберт Куп"
+
+#. Tag: member
+#, no-c-format
+msgid "Roger Crew"
+msgstr "Роджер Крю"
+
+#. Tag: member
+#, no-c-format
+msgid "Ron Mayer"
+msgstr "Рон Майер"
+
+#. Tag: member
+#, no-c-format
+msgid "Sam Peters"
+msgstr "Сем Пітерс"
+
+#. Tag: member
+#, no-c-format
+msgid "Sebastiaan Couwenberg"
+msgstr "Себастьян Коувенберг"
+
+#. Tag: member
+#, no-c-format
+msgid "Sergei Shoulbakov"
+msgstr "Сергій Шульбаков"
+
+#. Tag: member
+#, no-c-format
+msgid "Sergey Fedoseev"
+msgstr "Сергій Федосєєв"
+
+#. Tag: member
+#, no-c-format
+msgid "Shinichi Sugiyama"
+msgstr "Шінічі Сугіяма"
+
+#. Tag: member
+#, no-c-format
+msgid "Shoaib Burq"
+msgstr "Шоаїб Бурк"
+
+#. Tag: member
+#, no-c-format
+msgid "Silvio Grosso"
+msgstr "Сільвіо Гроссо"
+
+#. Tag: member
+#, no-c-format
+msgid "Stefan Corneliu Petrea"
+msgstr "Стефан Корнеліу Петреа"
+
+#. Tag: member
+#, no-c-format
+msgid "Steffen Macke"
+msgstr "Стеффен Макке"
+
+#. Tag: member
+#, no-c-format
+msgid "Stepan Kuzmin"
+msgstr "Степан Кузьмін"
+
+#. Tag: member
+#, no-c-format
+msgid "Stephen Frost"
+msgstr "Стівен Фрост"
+
+#. Tag: member
+#, no-c-format
+msgid "Steven Ottens"
+msgstr "Стівен Оттенс"
+
+#. Tag: member
+#, no-c-format
+msgid "Talha Rizwan"
+msgstr "Талха Різван"
+
+#. Tag: member
+#, no-c-format
+msgid "Teramoto Ikuhiro"
+msgstr "Терамото Ікухіро"
+
+#. Tag: member
+#, no-c-format
+msgid "Tom Glancy"
+msgstr "Том Гленсі"
+
+#. Tag: member
+#, no-c-format
+msgid "Tom van Tilburg"
+msgstr "Том ван Тільбург"
+
+#. Tag: member
+#, no-c-format
+msgid "Victor Collod"
+msgstr "Віктор Колод"
+
+#. Tag: member
+#, no-c-format
+msgid "Vincent Bre"
+msgstr "Вінсент Бре"
+
+#. Tag: member
+#, no-c-format
+msgid "Vincent Mora"
+msgstr "Вінсент Мора"
+
+#. Tag: member
+#, no-c-format
+msgid "Vincent Picavet"
+msgstr "Вінсент Пікаве"
+
+#. Tag: member
+#, no-c-format
+msgid "Volf Tomáš"
+msgstr "Вольф Томаш"
+
+#. Tag: member
+#, no-c-format
+msgid "Zuo Chenwei"
+msgstr "Зуо Ченвей"
+
+#. Tag: term
+#, no-c-format
+msgid "Corporate Sponsors"
+msgstr "Корпоративні спонсори"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These are corporate entities that have contributed developer time, hosting, "
+"or direct monetary funding to the PostGIS project. In alphabetical order:"
+msgstr ""
+"Це корпоративні організації, які надали розробникам час, хостинг або пряме "
+"фінансове фінансування для проекту PostGIS. У алфавітному порядку:"
+
+#. Tag: link
+#, no-c-format
+msgid "Aiven"
+msgstr "Aiven"
+
+#. Tag: link
+#, no-c-format
+msgid "Arrival 3D"
+msgstr "Arrival 3D"
+
+#. Tag: link
+#, no-c-format
+msgid "Associazione Italiana per l'Informazione Geografica Libera (GFOSS.it)"
+msgstr "Associazione Italiana per l'Informazione Geografica Libera (GFOSS.it)"
+
+#. Tag: link
+#, no-c-format
+msgid "AusVet"
+msgstr "AusVet"
+
+#. Tag: simpara
+#, no-c-format
+msgid "Avencia"
+msgstr "Avencia"
+
+#. Tag: link
+#, no-c-format
+msgid "Azavea"
+msgstr "Azavea"
+
+#. Tag: link
+#, no-c-format
+msgid "Boundless"
+msgstr "Boundless"
+
+#. Tag: link
+#, no-c-format
+msgid "Cadcorp"
+msgstr "Cadcorp"
+
+#. Tag: link
+#, no-c-format
+msgid "Camptocamp"
+msgstr "Camptocamp"
+
+#. Tag: link
+#, no-c-format
+msgid "Carto"
+msgstr "Carto"
+
+#. Tag: link
+#, no-c-format
+msgid "Crunchy Data"
+msgstr "Crunchy Data"
+
+#. Tag: link
+#, no-c-format
+msgid "City of Boston (DND)"
+msgstr "City of Boston (DND)"
+
+#. Tag: link
+#, no-c-format
+msgid "City of Helsinki"
+msgstr "City of Helsinki"
+
+#. Tag: link
+#, no-c-format
+msgid "Clever Elephant Solutions"
+msgstr "Clever Elephant Solutions"
+
+#. Tag: link
+#, no-c-format
+msgid "Cooperativa Alveo"
+msgstr "Cooperativa Alveo"
+
+#. Tag: link
+#, no-c-format
+msgid "Deimos Space"
+msgstr "Deimos Space"
+
+#. Tag: link
+#, no-c-format
+msgid "Faunalia"
+msgstr "Faunalia"
+
+#. Tag: link
+#, no-c-format
+msgid "Geographic Data BC"
+msgstr "Geographic Data BC"
+
+#. Tag: link
+#, no-c-format
+msgid "HighGo"
+msgstr "HighGo"
+
+#. Tag: simpara
+#, no-c-format
+msgid "Hunter Systems Group"
+msgstr "Hunter Systems Group"
+
+#. Tag: link
+#, no-c-format
+msgid "INIA-CSIC"
+msgstr "INIA-CSIC"
+
+#. Tag: link
+#, no-c-format
+msgid "ISciences, LLC"
+msgstr "ISciences, LLC"
+
+#. Tag: link
+#, no-c-format
+msgid "Kontur"
+msgstr "Kontur"
+
+#. Tag: link
+#, no-c-format
+msgid "Lidwala Consulting Engineers"
+msgstr "Lidwala Consulting Engineers"
+
+#. Tag: link
+#, no-c-format
+msgid "LISAsoft"
+msgstr "LISAsoft"
+
+#. Tag: simpara
+#, no-c-format
+msgid "Logical Tracking & Tracing International AG"
+msgstr "Logical Tracking & Tracing International AG"
+
+#. Tag: simpara
+#, no-c-format
+msgid "Maponics"
+msgstr "Maponics"
+
+#. Tag: link
+#, no-c-format
+msgid "Michigan Tech Research Institute"
+msgstr "Michigan Tech Research Institute"
+
+#. Tag: link
+#, no-c-format
+msgid "Natural Resources Canada"
+msgstr "Natural Resources Canada"
+
+#. Tag: simpara
+#, no-c-format
+msgid "Norwegian Forest and Landscape Institute"
+msgstr "Norwegian Forest and Landscape Institute"
+
+#. Tag: link
+#, no-c-format
+msgid "Norwegian Institute of Bioeconomy Research (NIBIO)"
+msgstr "Norwegian Institute of Bioeconomy Research (NIBIO)"
+
+#. Tag: link
+#, no-c-format
+msgid "OSGeo"
+msgstr "OSGeo"
+
+#. Tag: link
+#, no-c-format
+msgid "Oslandia"
+msgstr "Oslandia"
+
+#. Tag: link
+#, no-c-format
+msgid "Palantir Technologies"
+msgstr "Palantir Technologies"
+
+#. Tag: link
+#, no-c-format
+msgid "Paragon Corporation"
+msgstr "Paragon Corporation"
+
+#. Tag: link
+#, no-c-format
+msgid "Postgres Pro"
+msgstr "Postgres Pro"
+
+#. Tag: link
+#, no-c-format
+msgid "R3 GIS"
+msgstr "R3 GIS"
+
+#. Tag: link
+#, no-c-format
+msgid "Refractions Research"
+msgstr "Refractions Research"
+
+#. Tag: link
+#, no-c-format
+msgid "Regione Toscana - SITA"
+msgstr "Regione Toscana - SITA"
+
+#. Tag: link
+#, no-c-format
+msgid "Safe Software"
+msgstr "Safe Software"
+
+#. Tag: simpara
+#, no-c-format
+msgid "Sirius Corporation plc"
+msgstr "Sirius Corporation plc"
+
+#. Tag: link
+#, no-c-format
+msgid "Stadt Uster"
+msgstr "Stadt Uster"
+
+#. Tag: link
+#, no-c-format
+msgid "UC Davis Center for Vectorborne Diseases"
+msgstr "UC Davis Center for Vectorborne Diseases"
+
+#. Tag: link
+#, no-c-format
+msgid "Université Laval"
+msgstr "Université Laval"
+
+#. Tag: link
+#, no-c-format
+msgid "U.S. Census Bureau"
+msgstr "U.S. Census Bureau"
+
+#. Tag: link
+#, no-c-format
+msgid "U.S. Department of State (HIU)"
+msgstr "U.S. Department of State (HIU)"
+
+#. Tag: link
+#, no-c-format
+msgid "Zonar Systems"
+msgstr "Zonar Systems"
+
+#. Tag: term
+#, no-c-format
+msgid "Crowd Funding Campaigns"
+msgstr "Crowd Funding Campaigns"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Crowd funding campaigns are campaigns we run to get badly wanted features "
+"funded that can service a large number of people. Each campaign is "
+"specifically focused on a particular feature or set of features. Each "
+"sponsor chips in a small fraction of the needed funding and with enough "
+"people/organizations contributing, we have the funds to pay for the work "
+"that will help many. If you have an idea for a feature you think many others "
+"would be willing to co-fund, please post to the <link xlink:href=\"https://"
+"lists.osgeo.org/mailman/listinfo/postgis-users\">PostGIS newsgroup</link> "
+"your thoughts and together we can make it happen."
+msgstr ""
+"Кампанії з краудфандингу — це кампанії, які ми проводимо, щоб зібрати кошти "
+"на реалізацію дуже потрібних функцій, які можуть бути корисними для великої "
+"кількості людей. Кожна кампанія зосереджена на конкретній функції або наборі "
+"функцій. Кожен спонсор вносить невелику частину необхідних коштів, і за "
+"умови, що достатня кількість людей/організацій долучиться до кампанії, ми "
+"отримаємо кошти для оплати роботи, яка допоможе багатьом. Якщо у вас є ідея "
+"щодо функції, яку, на вашу думку, багато інших людей були б готові спільно "
+"фінансувати, будь ласка, опублікуйте її в <link xlink:href=\"https://lists."
+"osgeo.org/mailman/listinfo/postgis-users\">групі новин PostGIS</link>, і "
+"разом ми зможемо її реалізувати."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS 2.0.0 was the first release we tried this strategy. We used <link "
+"xlink:href=\"http://www.pledgebank.com\">PledgeBank</link> and we got two "
+"successful campaigns out of it."
+msgstr ""
+"PostGIS 2.0.0 був першим випуском, в якому ми випробували цю стратегію. Ми "
+"використовували <link xlink:href=\"http://www.pledgebank.com\">PledgeBank</"
+"link> і провели дві успішні кампанії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.pledgebank.com/postgistopology\"><emphasis "
+"role=\"bold\">postgistopology</emphasis></link> - 10 plus sponsors each "
+"contributed $250 USD to build toTopoGeometry function and beef up topology "
+"support in 2.0.0. It happened."
+msgstr ""
+"<link xlink:href=\"http://www.pledgebank.com/postgistopology\"><emphasis role="
+"\"bold\">postgistopology</emphasis></link> - 10 спонсорів внесли по 250 "
+"доларів США на створення функції toTopoGeometry та покращення підтримки "
+"топології в версії 2.0.0. Це сталося."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.pledgebank.com/postgis64windows\"><emphasis "
+"role=\"bold\">postgis64windows</emphasis></link> - 20 someodd sponsors each "
+"contributed $100 USD to pay for the work needed to work out PostGIS 64-bit "
+"issues on windows. It happened."
+msgstr ""
+"<link xlink:href=\"http://www.pledgebank.com/postgis64windows\"><emphasis role="
+"\"bold\">postgis64windows</emphasis></link> - 20 спонсорів внесли по 100 "
+"доларів США для оплати робіт, необхідних для вирішення проблем PostGIS 64-"
+"bit на Windows. Це сталося."
+
+#. Tag: term
+#, no-c-format
+msgid "Important Support Libraries"
+msgstr "Важливі допоміжні бібліотеки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <link xlink:href=\"https://libgeos.org\">GEOS</link> geometry operations "
+"library"
+msgstr ""
+"Бібліотека геометричних операцій <link xlink:href=\"https://libgeos."
+"org\">GEOS</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <link xlink:href=\"https://gdal.org\">GDAL</link> Geospatial Data "
+"Abstraction Library used to power much of the raster functionality "
+"introduced in PostGIS 2. In kind, improvements needed in GDAL to support "
+"PostGIS are contributed back to the GDAL project."
+msgstr ""
+"Бібліотека абстракції геопросторових даних <link xlink:href=\"https://gdal."
+"org\">GDAL</link> використовується для забезпечення більшості функцій роботи "
+"з растровими даними, представлених у PostGIS 2. Відповідно, поліпшення, "
+"необхідні в GDAL для підтримки PostGIS, вносяться назад у проект GDAL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <link xlink:href=\"https://www.proj4.org\">PROJ</link> cartographic "
+"projection library"
+msgstr ""
+"Бібліотека картографічних проекцій <link xlink:href=\"https://www.proj4."
+"org\">PROJ</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Last but not least, <link xlink:href=\"http://www.postgresql."
+"org\">PostgreSQL</link>, the giant that PostGIS stands on. Much of the speed "
+"and flexibility of PostGIS would not be possible without the extensibility, "
+"great query planner, GIST index, and plethora of SQL features provided by "
+"PostgreSQL."
+msgstr ""
+"І останнє, але не менш важливе, <link xlink:href=\"http://www.postgresql."
+"org\">PostgreSQL</link>, гігант, на якому стоїть PostGIS. Більша частина "
+"швидкості та гнучкості PostGIS була б неможливою без розширюваності, "
+"чудового планувальника запитів, індексу GIST та безлічі функцій SQL, що "
+"надаються PostgreSQL."
+
+#. Tag: title
+#, no-c-format
+msgid "Performance Tips"
+msgstr "Поради щодо продуктивності"
+
+#. Tag: title
+#, no-c-format
+msgid "Small tables of large geometries"
+msgstr "Невеликі таблиці великих геометрій"
+
+#. Tag: title
+#, no-c-format
+msgid "Problem description"
+msgstr "Опис проблеми"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Current PostgreSQL versions (including 9.6) suffer from a query optimizer "
+"weakness regarding TOAST tables. TOAST tables are a kind of \"extension "
+"room\" used to store large (in the sense of data size) values that do not "
+"fit into normal data pages (like long texts, images or complex geometries "
+"with lots of vertices), see <link xlink:href=\"http://www.postgresql.org/"
+"docs/current/static/storage-toast.html\">the PostgreSQL Documentation for "
+"TOAST</link> for more information)."
+msgstr ""
+"Поточні версії PostgreSQL (включно з 9.6) мають недолік оптимізатора запитів "
+"щодо таблиць TOAST. Таблиці TOAST — це свого роду \"розширення\", що "
+"використовуються для зберігання великих (у сенсі розміру даних) значень, які "
+"не вміщуються на звичайних сторінках даних (наприклад, довгі тексти, "
+"зображення або складні геометричні фігури з великою кількістю вершин). "
+"Докладнішу інформацію див. <link xlink:href=\"http://www.postgresql.org/docs/"
+"current/static/storage-toast.html\">документації PostgreSQL щодо TOAST</"
+"link> для отримання додаткової інформації)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The problem appears if you happen to have a table with rather large "
+"geometries, but not too many rows of them (like a table containing the "
+"boundaries of all European countries in high resolution). Then the table "
+"itself is small, but it uses lots of TOAST space. In our example case, the "
+"table itself had about 80 rows and used only 3 data pages, but the TOAST "
+"table used 8225 pages."
+msgstr ""
+"Проблема виникає, якщо у вас є таблиця з досить великими геометріями, але не "
+"надто великою кількістю рядків (наприклад, таблиця, що містить межі всіх "
+"європейських країн у високій роздільній здатності). Тоді сама таблиця є "
+"невеликою, але використовує багато простору TOAST. У нашому прикладі таблиця "
+"мала близько 80 рядків і використовувала лише 3 сторінки даних, але таблиця "
+"TOAST використовувала 8225 сторінок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Now issue a query where you use the geometry operator && to search "
+"for a bounding box that matches only very few of those rows. Now the query "
+"optimizer sees that the table has only 3 pages and 80 rows. It estimates "
+"that a sequential scan on such a small table is much faster than using an "
+"index. And so it decides to ignore the GIST index. Usually, this estimation "
+"is correct. But in our case, the && operator has to fetch every "
+"geometry from disk to compare the bounding boxes, thus reading all TOAST "
+"pages, too."
+msgstr ""
+"Тепер виконайте запит, в якому використовується оператор геометрії &&"
+" для пошуку обмежувального прямокутника, який відповідає лише деяким із цих "
+"рядків. Тепер оптимізатор запитів бачить, що таблиця має лише 3 сторінки та "
+"80 рядків. Він оцінює, що послідовне сканування такої невеликої таблиці буде "
+"набагато швидшим, ніж використання індексу. Тому він вирішує проігнорувати "
+"індекс GIST. Зазвичай така оцінка є правильною. Але в нашому випадку "
+"оператор && повинен витягнути кожну геометрію з диска, щоб порівняти "
+"обмежувальні прямокутники, тим самим прочитавши також усі сторінки TOAST."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To see whether your suffer from this issue, use the \"EXPLAIN ANALYZE\" "
+"postgresql command. For more information and the technical details, you can "
+"read the thread on the PostgreSQL performance mailing list: <link xlink:"
+"href=\"http://archives.postgresql.org/pgsql-performance/2005-02/msg00030."
+"php\">http://archives.postgresql.org/pgsql-performance/2005-02/msg00030.php</"
+"link>"
+msgstr ""
+"Щоб перевірити, чи є у вас ця проблема, скористайтеся командою postgresql \""
+"EXPLAIN ANALYZE\". Більш детальну інформацію та технічні подробиці можна "
+"знайти у темі на форумі PostgreSQL performance mailing list: <link "
+"xlink:href=\"http://archives.postgresql.org/pgsql-performance/2005-02/msg00030"
+".php\">http://archives.postgresql.org/pgsql-performance/2005-02/msg00030."
+"php</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"and newer thread on PostGIS <link xlink:href=\"https://lists.osgeo.org/"
+"pipermail/postgis-devel/2017-June/026209.html\">https://lists.osgeo.org/"
+"pipermail/postgis-devel/2017-June/026209.html</link>"
+msgstr ""
+"та новіша тема на PostGIS <link xlink:href=\"https://lists.osgeo.org/"
+"pipermail/postgis-devel/2017-June/026209.html\">https://lists.osgeo.org/"
+"pipermail/postgis-devel/2017-June/026209.html</link>"
+
+#. Tag: title
+#, no-c-format
+msgid "Workarounds"
+msgstr "Обхідні шляхи"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostgreSQL people are trying to solve this issue by making the query "
+"estimation TOAST-aware. For now, here are two workarounds:"
+msgstr ""
+"Розробники PostgreSQL намагаються вирішити цю проблему, зробивши оцінку "
+"запиту TOAST-сумісною. Наразі існують два обхідні шляхи:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The first workaround is to force the query planner to use the index. Send "
+"\"SET enable_seqscan TO off;\" to the server before issuing the query. This "
+"basically forces the query planner to avoid sequential scans whenever "
+"possible. So it uses the GIST index as usual. But this flag has to be set on "
+"every connection, and it causes the query planner to make misestimations in "
+"other cases, so you should \"SET enable_seqscan TO on;\" after the query."
+msgstr ""
+"Перший спосіб вирішення проблеми полягає в тому, щоб змусити планувальник "
+"запитів використовувати індекс. Перед відправкою запиту надішліть на сервер "
+"команду \"SET enable_seqscan TO off;\". Це змусить планувальник запитів "
+"уникати послідовного сканування, коли це можливо. Таким чином, він буде "
+"використовувати індекс GIST, як зазвичай. Але цей прапор потрібно "
+"встановлювати для кожного з'єднання, і це призводить до неправильних оцінок "
+"планувальника запитів в інших випадках, тому після запиту слід виконати "
+"команду \"SET enable_seqscan TO on;\"."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The second workaround is to make the sequential scan as fast as the query "
+"planner thinks. This can be achieved by creating an additional column that "
+"\"caches\" the bbox, and matching against this. In our example, the commands "
+"are like:"
+msgstr ""
+"Другий спосіб вирішення проблеми полягає в тому, щоб зробити послідовне "
+"сканування таким же швидким, як вважає планувальник запитів. Це можна "
+"досягти, створивши додатковий стовпець, який \"кешує\" bbox, і зіставляючи "
+"його з цим стовпцем. У нашому прикладі команди виглядають так:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Now change your query to use the && operator against bbox instead of "
+"geom_column, like:"
+msgstr ""
+"Тепер змініть запит, щоб використовувати оператор && для bbox "
+"замість geom_column, наприклад:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Of course, if you change or add rows to mytable, you have to keep the bbox "
+"\"in sync\". The most transparent way to do this would be triggers, but you "
+"also can modify your application to keep the bbox column current or run the "
+"UPDATE query above after every modification."
+msgstr ""
+"Звичайно, якщо ви змінюєте або додаєте рядки до таблиці mytable, ви повинні "
+"синхронізувати bbox. Найпростіший спосіб зробити це — використовувати "
+"тригери, але ви також можете змінити свою програму, щоб стовпець bbox завжди "
+"був актуальним, або виконувати запит UPDATE після кожної зміни."
+
+#. Tag: title
+#, no-c-format
+msgid "CLUSTERing on geometry indices"
+msgstr "Кластеризація за геометричними індексами"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For tables that are mostly read-only, and where a single index is used for "
+"the majority of queries, PostgreSQL offers the CLUSTER command. This command "
+"physically reorders all the data rows in the same order as the index "
+"criteria, yielding two performance advantages: First, for index range scans, "
+"the number of seeks on the data table is drastically reduced. Second, if "
+"your working set concentrates to some small intervals on the indices, you "
+"have a more efficient caching because the data rows are spread along fewer "
+"data pages. (Feel invited to read the CLUSTER command documentation from the "
+"PostgreSQL manual at this point.)"
+msgstr ""
+"Для таблиць, які в основному є тільки для читання і де для більшості запитів "
+"використовується один індекс, PostgreSQL пропонує команду CLUSTER. Ця "
+"команда фізично перевпорядковує всі рядки даних у тому ж порядку, що й "
+"критерії індексу, що дає дві переваги в продуктивності: По-перше, для "
+"сканування діапазону індексу кількість пошуків у таблиці даних значно "
+"зменшується. По-друге, якщо робочий набір зосереджений на невеликих "
+"інтервалах індексів, ви отримуєте більш ефективне кешування, оскільки рядки "
+"даних розподіляються між меншою кількістю сторінок даних. (Запрошуємо вас "
+"ознайомитися з документацією команди CLUSTER у посібнику PostgreSQL.)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"However, currently PostgreSQL does not allow clustering on PostGIS GIST "
+"indices because GIST indices simply ignores NULL values, you get an error "
+"message like:"
+msgstr ""
+"Однак на даний момент PostgreSQL не дозволяє кластеризацію на індексах "
+"PostGIS GIST, оскільки індекси GIST просто ігнорують значення NULL, і ви "
+"отримуєте таке повідомлення про помилку:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As the HINT message tells you, one can work around this deficiency by adding "
+"a \"not null\" constraint to the table:"
+msgstr ""
+"Як вказує повідомлення HINT, цю недоліку можна обійти, додавши до таблиці "
+"обмеження \"not null\":"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Of course, this will not work if you in fact need NULL values in your "
+"geometry column. Additionally, you must use the above method to add the "
+"constraint, using a CHECK constraint like \"ALTER TABLE blubb ADD CHECK "
+"(geometry is not null);\" will not work."
+msgstr ""
+"Звичайно, це не спрацює, якщо вам насправді потрібні значення NULL у стовпці "
+"геометрії. Крім того, ви повинні використовувати вищезазначений метод для "
+"додавання обмеження, використання обмеження CHECK, такого як \"ALTER TABLE "
+"blubb ADD CHECK (geometry is not null);\" не спрацює."
+
+#. Tag: title
+#, no-c-format
+msgid "Avoiding dimension conversion"
+msgstr "Уникнення перетворення вимірів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sometimes, you happen to have 3D or 4D data in your table, but always access "
+"it using OpenGIS compliant ST_AsText() or ST_AsBinary() functions that only "
+"output 2D geometries. They do this by internally calling the ST_Force2D() "
+"function, which introduces a significant overhead for large geometries. To "
+"avoid this overhead, it may be feasible to pre-drop those additional "
+"dimensions once and forever:"
+msgstr ""
+"Іноді в таблиці трапляються дані 3D або 4D, але доступ до них завжди "
+"здійснюється за допомогою функцій ST_AsText() або ST_AsBinary(), сумісних з "
+"OpenGIS, які виводять тільки 2D-геометрії. Вони роблять це шляхом "
+"внутрішнього виклику функції ST_Force2D(), що створює значне навантаження "
+"для великих геометрій. Щоб уникнути цього навантаження, можна попередньо "
+"видалити ці додаткові виміри один раз і назавжди:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that if you added your geometry column using AddGeometryColumn() "
+"there'll be a constraint on geometry dimension. To bypass it you will need "
+"to drop the constraint. Remember to update the entry in the geometry_columns "
+"table and recreate the constraint afterwards."
+msgstr ""
+"Зверніть увагу, що якщо ви додали стовпець геометрії за допомогою "
+"AddGeometryColumn(), буде обмеження на розмір геометрії. Щоб обійти це "
+"обмеження, вам потрібно буде видалити обмеження. Не забудьте оновити запис у "
+"таблиці geometry_columns і потім знову створити обмеження."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In case of large tables, it may be wise to divide this UPDATE into smaller "
+"portions by constraining the UPDATE to a part of the table via a WHERE "
+"clause and your primary key or another feasible criteria, and running a "
+"simple \"VACUUM;\" between your UPDATEs. This drastically reduces the need "
+"for temporary disk space. Additionally, if you have mixed dimension "
+"geometries, restricting the UPDATE by \"WHERE dimension(geom)>2\" skips "
+"re-writing of geometries that already are in 2D."
+msgstr ""
+"У разі великих таблиць може бути доцільним розділити це оновлення на менші "
+"частини, обмеживши оновлення частиною таблиці за допомогою оператора WHERE "
+"та вашого первинного ключа або іншого можливого критерію, а також виконавши "
+"просту команду \"VACUUM;\" між оновленнями. Це значно зменшує потребу в "
+"тимчасовому дисковому просторі. Крім того, якщо ви маєте змішані геометрії "
+"розмірів, обмеження UPDATE за допомогою \"WHERE dimension(geom)>2\" "
+"пропускає перезапис геометрій, які вже є у 2D."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS &last_release_version; Manual"
+msgstr "PostGIS &last_release_version; Посібник користувача"
+
+#. Tag: orgname
+#, no-c-format
+msgid "The PostGIS Development Group"
+msgstr "Група розробників PostGIS"
+
+#. Tag: affiliation
+#, no-c-format
+msgid ""
+"<orgname><link xlink:href=\"http://www.cleverelephant.ca\">clever elephant</"
+"link></orgname> <address><city>Victoria</city> <state>British Columbia</"
+"state> <country>Canada</country> <email>pramsey@cleverelephant.ca</email></"
+"address>"
+msgstr ""
+"<orgname><link xlink:href=\"http://www.cleverelephant.ca\">clever "
+"elephant</link></orgname> <address><city>Вікторія</city> <state>Британська "
+"Колумбія</state> <country>Канада</country> <email>pramsey@cleverelephant."
+"ca</email></address>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS is an extension to the <link xlink:href=\"https://www.postgresql.org/"
+"\">PostgreSQL</link> object-relational database system which allows GIS "
+"(Geographic Information Systems) objects to be stored in the database. "
+"PostGIS includes support for GiST-based R-Tree spatial indexes, and "
+"functions for analysis and processing of GIS objects."
+msgstr ""
+"PostGIS — це розширення для об'єктно-реляційної системи баз даних <link "
+"xlink:href=\"https://www.postgresql.org/\">PostgreSQL</link>, яке дозволяє "
+"зберігати об'єкти ГІС (географічних інформаційних систем) у базі даних. "
+"PostGIS підтримує просторові індекси R-Tree на основі GiST, а також функції "
+"для аналізу та обробки об'єктів ГІС."
+
+#. Tag: para
+#, no-c-format
+msgid "This is the manual for version &last_release_version;"
+msgstr "Це інструкція для версії &last_release_version;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This work is licensed under a <link xlink:href=\"http://creativecommons.org/"
+"licenses/by-sa/3.0/\">Creative Commons Attribution-Share Alike 3.0 License</"
+"link>. Feel free to use this material any way you like, but we ask that you "
+"attribute credit to the PostGIS Project and wherever possible, a link back "
+"to <link xlink:href=\"https://postgis.net\">https://postgis.net</link>."
+msgstr ""
+"Ця робота ліцензована за ліцензією <link xlink:href=\"http://creativecommons."
+"org/licenses/by-sa/3.0/\">Creative Commons Attribution-Share Alike 3.0 "
+"License</link>. Ви можете використовувати цей матеріал будь-яким чином, але "
+"просимо вас вказати посилання на проект PostGIS та, по можливості, на <link "
+"xlink:href=\"https://postgis.net\">https://postgis.net</link>."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Special Functions Index"
+msgstr "Спеціальні функції PostGIS Вказівник"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Aggregate Functions"
+msgstr "Агрегатні функції PostGIS"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_aggregates;"
+msgstr "&list_aggregates;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions below are spatial aggregate functions that are used in the "
+"same way as SQL aggregate function such as <code>sum</code> and "
+"<code>average</code>."
+msgstr ""
+"Нижче наведено просторові агрегатні функції, які використовуються так само, "
+"як і агрегатні функції SQL, такі як <code>sum</code> та <code>average</code>."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Window Functions"
+msgstr "Віконні функції PostGIS"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_window_functions;"
+msgstr "&list_window_functions;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions below are spatial window functions that are used in the same "
+"way as SQL window functions such as <code>row_number()</code>, <code>lead()</"
+"code>, and <code>lag()</code>. They must be followed by an <code>OVER()</"
+"code> clause."
+msgstr ""
+"Наведені нижче функції є віконними просторовими функціями, які "
+"використовуються так само, як і віконні функції SQL, такі як "
+"<code>row_number()</code>, <code>lead()</code> та <code>lag()</code>. За "
+"ними має слідувати оператор <code>OVER()</code>."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS SQL-MM Compliant Functions"
+msgstr "Функції, сумісні з PostGIS SQL-MM"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_sqlmm_functions;"
+msgstr "&list_sqlmm_functions;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that conform to the SQL/MM 3 "
+"standard"
+msgstr ""
+"Наведені нижче функції є функціями PostGIS, які відповідають стандарту SQL/"
+"MM 3"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Geography Support Functions"
+msgstr "Функції підтримки географії PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions and operators given below are PostGIS functions/operators that "
+"take as input or return as output a <link "
+"linkend=\"PostGIS_Geography\">geography</link> data type object."
+msgstr ""
+"Наведені нижче функції та оператори є функціями/операторами PostGIS, які "
+"приймають як вхідні дані або повертають як вихідні дані об'єкт типу даних "
+"<link linkend=\"PostGIS_Geography\">geography</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Functions with a (T) are not native geodetic functions, and use a "
+"ST_Transform call to and from geometry to do the operation. As a result, "
+"they may not behave as expected when going over dateline, poles, and for "
+"large geometries or geometry pairs that cover more than one UTM zone. Basic "
+"transform - (favoring UTM, Lambert Azimuthal (North/South), and falling back "
+"on mercator in worst case scenario)"
+msgstr ""
+"Функції з (T) не є вбудованими геодезичними функціями і використовують "
+"виклик ST_Transform до та з геометрії для виконання операції. Як результат, "
+"вони можуть поводитися не так, як очікується, при перетині лінії зміни дати, "
+"полюсів, а також для великих геометрій або пар геометрій, що охоплюють "
+"більше однієї зони UTM. Базове перетворення - (віддаючи перевагу UTM, "
+"азимутальному проектуванню Ламберта (північ/південь) і, в гіршому випадку, "
+"проектуванню Меркатора)"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_geography_functions;"
+msgstr "&list_geography_functions;"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Raster Support Functions"
+msgstr "Функції підтримки растрових даних PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions and operators given below are PostGIS functions/operators that "
+"take as input or return as output a <xref linkend=\"raster\"/> data type "
+"object. Listed in alphabetical order."
+msgstr ""
+"Наведені нижче функції та оператори є функціями/операторами PostGIS, які "
+"приймають як вхідні дані або повертають як вихідні дані об'єкт типу даних "
+"<xref linkend=\"raster\"/>. Перелічені в алфавітному порядку."
+
+#. Tag: section
+#, no-c-format
+msgid "&list_raster_functions;"
+msgstr "&list_raster_functions;"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Geometry / Geography / Raster Dump Functions"
+msgstr "Функції PostGIS для геометрії / географії / растрового дампа"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_dump_functions;"
+msgstr "&list_dump_functions;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that take as input or return "
+"as output a set of or single <link linkend=\"geometry_dump\">geometry_dump</"
+"link> or <link linkend=\"geomval\">geomval</link> data type object."
+msgstr ""
+"Наведені нижче функції є функціями PostGIS, які приймають як вхідні дані або "
+"повертають як вихідні дані набір або окремий об'єкт типу даних <link linkend="
+"\"geometry_dump\">geometry_dump</link> або <link linkend=\"geomval\""
+">geomval</link>."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Box Functions"
+msgstr "Функції PostGIS Box"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that take as input or return "
+"as output the box* family of PostGIS spatial types. The box family of types "
+"consists of <link linkend=\"box2d_type\">box2d</link>, and <link "
+"linkend=\"box3d_type\">box3d</link>"
+msgstr ""
+"Наведені нижче функції є функціями PostGIS, які приймають як вхідні дані або "
+"повертають як вихідні дані сімейство просторових типів PostGIS box*. "
+"Сімейство типів box складається з <link linkend=\"box2d_type\">box2d</link> "
+"та <link linkend=\"box3d_type\">box3d</link>"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_box_functions;"
+msgstr "&list_box_functions;"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Functions that support 3D"
+msgstr "Функції PostGIS, що підтримують 3D"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_3d_functions;"
+msgstr "&list_3d_functions;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that do not throw away the Z-"
+"Index."
+msgstr "Наведені нижче функції є функціями PostGIS, які не відкидають Z-індекс."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Curved Geometry Support Functions"
+msgstr "Функції підтримки вигнутої геометрії PostGIS"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_curved_geometry_functions;"
+msgstr "&list_curved_geometry_functions;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that can use CIRCULARSTRING, "
+"CURVEPOLYGON, and other curved geometry types"
+msgstr ""
+"Наведені нижче функції є функціями PostGIS, які можуть використовувати "
+"CIRCULARSTRING, CURVEPOLYGON та інші типи кривої геометрії"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Polyhedral Surface Support Functions"
+msgstr "Функції підтримки багатогранних поверхонь PostGIS"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_polyhedral_geometry_functions;"
+msgstr "&list_polyhedral_geometry_functions;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that can use "
+"POLYHEDRALSURFACE, POLYHEDRALSURFACEM geometries"
+msgstr ""
+"Наведені нижче функції є функціями PostGIS, які можуть використовувати "
+"геометрії POLYHEDRALSURFACE, POLYHEDRALSURFACEM"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Function Support Matrix"
+msgstr "Матриця підтримки функцій PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Below is an alphabetical listing of spatial specific functions in PostGIS "
+"and the kinds of spatial types they work with or OGC/SQL compliance they try "
+"to conform to."
+msgstr ""
+"Нижче наведено алфавітний перелік просторових функцій у PostGIS та типи "
+"просторових даних, з якими вони працюють, або відповідність стандартам OGC/"
+"SQL, яких вони намагаються дотримуватися."
+
+#. Tag: simpara
+#, no-c-format
+msgid ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images/"
+"matrix_checkmark.png\"/></imageobject></inlinemediaobject> means the "
+"function works with the type or subtype natively."
+msgstr ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images"
+"/matrix_checkmark.png\"/></imageobject></inlinemediaobject> означає, що "
+"функція працює з типом або підтипом вбудовано."
+
+#. Tag: simpara
+#, no-c-format
+msgid ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images/"
+"matrix_transform.png\"/></imageobject></inlinemediaobject> means it works "
+"but with a transform cast built-in using cast to geometry, transform to a "
+"\"best srid\" spatial ref and then cast back. Results may not be as expected "
+"for large areas or areas at poles and may accumulate floating point junk."
+msgstr ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images"
+"/matrix_transform.png\"/></imageobject></inlinemediaobject> означає, що це "
+"працює, але з вбудованим перетворенням за допомогою cast to geometry, "
+"перетворенням у просторове посилання \"best srid\", а потім зворотним "
+"перетворенням. Результати можуть не відповідати очікуваним для великих "
+"областей або областей на полюсах і можуть накопичувати сміття з плаваючою "
+"комою."
+
+#. Tag: simpara
+#, no-c-format
+msgid ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images/"
+"matrix_autocast.png\"/></imageobject></inlinemediaobject> means the function "
+"works with the type because of a auto-cast to another such as to box3d "
+"rather than direct type support."
+msgstr ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images/matrix_autocast"
+".png\"/></imageobject></inlinemediaobject> означає, що функція працює з "
+"типом завдяки автоматичному перетворенню в інший тип, наприклад box3d, а не "
+"завдяки прямій підтримці типу."
+
+#. Tag: simpara
+#, no-c-format
+msgid ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images/"
+"matrix_sfcgal_required.png\"/></imageobject></inlinemediaobject> means the "
+"function only available if PostGIS compiled with SFCGAL support."
+msgstr ""
+"A <inlinemediaobject><imageobject><imagedata fileref=\"images"
+"/matrix_sfcgal_required.png\"/></imageobject></inlinemediaobject> означає, "
+"що функція доступна тільки якщо PostGIS скомпільовано з підтримкою SFCGAL."
+
+#. Tag: simpara
+#, no-c-format
+msgid "geom - Basic 2D geometry support (x,y)."
+msgstr "geom - Базова підтримка 2D-геометрії (x, y)."
+
+#. Tag: simpara
+#, no-c-format
+msgid "geog - Basic 2D geography support (x,y)."
+msgstr "geog - Базова підтримка 2D географії (x, y)."
+
+#. Tag: simpara
+#, no-c-format
+msgid "2.5D - basic 2D geometries in 3 D/4D space (has Z or M coord)."
+msgstr "2.5D — базові 2D-геометрії в 3D/4D-просторі (має координати Z або M)."
+
+#. Tag: simpara
+#, no-c-format
+msgid "PS - Polyhedral surfaces"
+msgstr "PS - Поліедральні поверхні"
+
+#. Tag: simpara
+#, no-c-format
+msgid "T - Triangles and Triangulated Irregular Network surfaces (TIN)"
+msgstr "T - Трикутники та трикутні нерегулярні мережеві поверхні (TIN)"
+
+#. Tag: entry
+#, no-c-format
+msgid "Function"
+msgstr "Функція"
+
+#. Tag: entry
+#, no-c-format
+msgid "geom"
+msgstr "geom"
+
+#. Tag: entry
+#, no-c-format
+msgid "geog"
+msgstr "geog"
+
+#. Tag: entry
+#, no-c-format
+msgid "2.5D"
+msgstr "2.5D"
+
+#. Tag: entry
+#, no-c-format
+msgid "Curves"
+msgstr "Криві"
+
+#. Tag: entry
+#, no-c-format
+msgid "SQL MM"
+msgstr "SQL MM"
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>PS</entry>"
+msgstr "<entry>PS</entry>"
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>T</entry>"
+msgstr "<entry>T</entry>"
+
+#. Tag: tgroup
+#, no-c-format
+msgid "&table_body_function_support_matrix;"
+msgstr "&table_body_function_support_matrix;"
+
+#. Tag: section
+#, no-c-format
+msgid "&list_new_functions;"
+msgstr "&list_new_functions;"
+
+#. Tag: title
+#, no-c-format
+msgid "New, Enhanced or changed PostGIS Functions"
+msgstr "Нові, вдосконалені або змінені функції PostGIS"
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Reference"
+msgstr "Довідка PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are the ones which a user of PostGIS is likely to "
+"need. There are other functions which are required support functions to the "
+"PostGIS objects which are not of use to a general user."
+msgstr ""
+"Нижче наведено функції, які можуть знадобитися користувачеві PostGIS. "
+"Існують також інші функції, які є необхідними допоміжними функціями для "
+"об'єктів PostGIS, але не використовуються звичайними користувачами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS has begun a transition from the existing naming convention to an SQL-"
+"MM-centric convention. As a result, most of the functions that you know and "
+"love have been renamed using the standard spatial type (ST) prefix. Previous "
+"functions are still available, though are not listed in this document where "
+"updated functions are equivalent. The non ST_ functions not listed in this "
+"documentation are deprecated and will be removed in a future release so STOP "
+"USING THEM."
+msgstr ""
+"PostGIS розпочав перехід від існуючої конвенції іменування до конвенції, "
+"орієнтованої на SQL-MM. В результаті, більшість функцій, які ви знаєте і "
+"любите, були перейменовані з використанням стандартного префікса "
+"просторового типу (ST). Попередні функції все ще доступні, хоча вони не "
+"вказані в цьому документі, де наведено оновлені функції, які є "
+"еквівалентними. Функції, що не вказані в цій документації, є застарілими і "
+"будуть видалені в майбутніх версіях, тому ПРИПИНІТЬ ЇХ ВИКОРИСТОВУВАТИ."
+
+#. Tag: chapter
+#, no-c-format
+msgid ""
+"&reference_type; &reference_management; &reference_constructor; "
+"&reference_accessor; &reference_editor; &reference_validation; "
+"&reference_srs; &reference_input; &reference_output; &reference_operator; "
+"&reference_relationship; &reference_measure; &reference_overlay; "
+"&reference_processing; &reference_coverage; &reference_transformation; "
+"&reference_cluster; &reference_bbox; &reference_lrs; &reference_trajectory; "
+"&reference_version; &reference_guc; &reference_troubleshooting;"
+msgstr ""
+"&reference_type; &reference_management; &reference_constructor; "
+"&reference_accessor; &reference_editor; &reference_validation; "
+"&reference_srs; &reference_input; &reference_output; &reference_operator; "
+"&reference_relationship; &reference_measure; &reference_overlay; "
+"&reference_processing; &reference_coverage; &reference_transformation; "
+"&reference_cluster; &reference_bbox; &reference_lrs; &reference_trajectory; "
+"&reference_version; &reference_guc; &reference_troubleshooting;"
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Accessors"
+msgstr "Доступ до геометрії"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the type of a geometry as text."
+msgstr "Повертає тип геометрії у вигляді тексту."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the type of the geometry as a string. Eg: 'LINESTRING', 'POLYGON', "
+"'MULTIPOINT', etc."
+msgstr ""
+"Повертає тип геометрії у вигляді рядка. Наприклад: “LINESTRING”, “POLYGON”, "
+"“MULTIPOINT” тощо."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"OGC SPEC s2.1.1.1 - Returns the name of the instantiable subtype of Geometry "
+"of which this Geometry instance is a member. The name of the instantiable "
+"subtype of Geometry is returned as a string."
+msgstr ""
+"OGC SPEC s2.1.1.1 - Повертає ім'я підтипу Geometry, який можна "
+"інстанціювати, до якого належить цей екземпляр Geometry. Ім'я підтипу "
+"Geometry, який можна інстанціювати, повертається у вигляді рядка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function also indicates if the geometry is measured, by returning a "
+"string of the form 'POINTM'."
+msgstr ""
+"Ця функція також вказує, чи вимірюється геометрія, повертаючи рядок у "
+"вигляді “POINTM”."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 support for Polyhedral surfaces, Triangles and TIN was "
+"introduced."
+msgstr ""
+"Покращено: 2.0.0 додано підтримку багатогранних поверхонь, трикутників і TIN."
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant;"
+msgstr "&sfs_compliant;"
+
+#. Tag: para
+#, no-c-format
+msgid "&curve_support;"
+msgstr "&curve_support;"
+
+#. Tag: para
+#, no-c-format
+msgid "&P_support;"
+msgstr "&P_support;"
+
+#. Tag: para
+#, no-c-format
+msgid "&T_support;"
+msgstr "&T_support;"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the boundary of a geometry."
+msgstr "Повертає межі геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the closure of the combinatorial boundary of this Geometry. The "
+"combinatorial boundary is defined as described in section 3.12.3.2 of the "
+"OGC SPEC. Because the result of this function is a closure, and hence "
+"topologically closed, the resulting boundary can be represented using "
+"representational geometry primitives as discussed in the OGC SPEC, section "
+"3.12.2."
+msgstr ""
+"Повертає закриття комбінаторної межі цієї геометрії. Комбінаторна межа "
+"визначається, як описано в розділі 3.12.3.2 специфікації OGC. Оскільки "
+"результат цієї функції є закриттям, а отже, топологічно замкнутим, отриману "
+"межу можна представити за допомогою примітивних елементів геометрії, як "
+"описано в розділі 3.12.2 специфікації OGC."
+
+#. Tag: para
+#, no-c-format
+msgid "Performed by the GEOS module"
+msgstr "Виконано модулем GEOS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior to 2.0.0, this function throws an exception if used with "
+"<varname>GEOMETRYCOLLECTION</varname>. From 2.0.0 up it will return NULL "
+"instead (unsupported input)."
+msgstr ""
+"До версії 2.0.0 ця функція викликає виняток, якщо використовується з "
+"<varname>GEOMETRYCOLLECTION</varname>. Починаючи з версії 2.0.0, вона "
+"повертає NULL (непідтримуваний вхідний параметр)."
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; OGC SPEC s2.1.1.1"
+msgstr "&sfs_compliant; OGC SPEC s2.1.1.1"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.17"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.17"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 support for Triangle was introduced"
+msgstr "Покращено: 2.1.0 додано підтримку Triangle"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.2.0 support for TIN, does not use geos, does not linearize curves"
+msgstr "Змінено: 3.2.0 підтримка TIN, не використовує geos, не лінеаризує криві"
+
+#. Tag: para
+#, no-c-format
+msgid "Linestring with boundary points overlaid"
+msgstr "Лінія з накладеними граничними точками"
+
+#. Tag: para
+#, no-c-format
+msgid "polygon holes with boundary multilinestring"
+msgstr "отвори полігону з межею, що складається з декількох ліній"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ExteriorRing\"/>, <xref linkend=\"ST_MakePolygon\"/>"
+msgstr ""
+", <xref linkend=\"ST_ExteriorRing\"/>, <xref linkend=\"ST_MakePolygon\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the diagonal of a geometry's bounding box."
+msgstr "Повертає діагональ обмежувального прямокутника геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the diagonal of the supplied geometry's bounding box as a "
+"LineString. The diagonal is a 2-point LineString with the minimum values of "
+"each dimension in its start point and the maximum values in its end point. "
+"If the input geometry is empty, the diagonal line is a LINESTRING EMPTY."
+msgstr ""
+"Повертає діагональ обмежувальної рамки наданої геометрії у вигляді "
+"LineString. Діагональ — це 2-точковий LineString із мінімальними значеннями "
+"кожного виміру в початковій точці та максимальними значеннями в кінцевій "
+"точці. Якщо вхідна геометрія порожня, діагональна лінія є LINESTRING EMPTY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The optional <varname>fits</varname> parameter specifies if the best fit is "
+"needed. If false, the diagonal of a somewhat larger bounding box can be "
+"accepted (which is faster to compute for geometries with many vertices). In "
+"either case, the bounding box of the returned diagonal line always covers "
+"the input geometry."
+msgstr ""
+"Додатковий параметр <varname>fits</varname> визначає, чи потрібно знайти "
+"найкраще співпадіння. Якщо значення false, можна прийняти діагональ дещо "
+"більшої обмежувальної рамки (що швидше обчислюється для геометрій з великою "
+"кількістю вершин). У будь-якому випадку обмежувальна рамка поверненої "
+"діагональної лінії завжди охоплює вхідну геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The returned geometry retains the SRID and dimensionality (Z and M presence) "
+"of the input geometry."
+msgstr ""
+"Повернена геометрія зберігає SRID та розмірність (наявність Z та M) вхідної "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In degenerate cases (i.e. a single vertex in input) the returned linestring "
+"will be formally invalid (no interior). The result is still topologically "
+"valid."
+msgstr ""
+"У виняткових випадках (тобто, якщо у вхідних даних є лише одна вершина) "
+"повернутий ланцюжок ліній буде формально недійсним (не має внутрішньої "
+"частини). Результат все одно залишається топологічно правильним."
+
+#. Tag: para
+#, no-c-format
+msgid "&M_support;"
+msgstr "&M_support;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_EndPoint\"/>, <xref linkend=\"ST_X\"/>, <xref "
+"linkend=\"ST_Y\"/>, <xref linkend=\"ST_Z\"/>, <xref linkend=\"ST_M\"/>, "
+"<xref linkend=\"ST_Envelope\"/>"
+msgstr ""
+", <xref linkend=\"ST_EndPoint\"/>, <xref linkend=\"ST_X\"/>, <xref linkend="
+"\"ST_Y\"/>, <xref linkend=\"ST_Z\"/>, <xref linkend=\"ST_M\"/>, <xref "
+"linkend=\"ST_Envelope\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the coordinate dimension of a geometry."
+msgstr "Повертає розмірність координат геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Return the coordinate dimension of the ST_Geometry value."
+msgstr "Повертає розмірність координат значення ST_Geometry."
+
+#. Tag: para
+#, no-c-format
+msgid "This is the MM compliant alias name for <xref linkend=\"ST_NDims\"/>"
+msgstr "Це ім'я псевдоніма, що відповідає MM, для <xref linkend=\"ST_NDims\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.3"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.3"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the topological dimension of a geometry."
+msgstr "Повертає топологічну розмірність геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the topological dimension of this Geometry object, which must be less "
+"than or equal to the coordinate dimension. OGC SPEC s2.1.1.1 - returns 0 for "
+"<varname>POINT</varname>, 1 for <varname>LINESTRING</varname>, 2 for "
+"<varname>POLYGON</varname>, and the largest dimension of the components of a "
+"<varname>GEOMETRYCOLLECTION</varname>. If the dimension is unknown (e.g. for "
+"an empty <varname>GEOMETRYCOLLECTION</varname>) 0 is returned."
+msgstr ""
+"Повертає топологічну розмірність цього об'єкта Geometry, яка повинна бути "
+"меншою або дорівнювати розмірності координат. OGC SPEC s2.1.1.1 - повертає 0 "
+"для <varname>POINT</varname>, 1 для <varname>LINESTRING</varname>, 2 для "
+"<varname>POLYGON</varname> і найбільший вимір компонентів "
+"<varname>GEOMETRYCOLLECTION</varname>. Якщо розмір невідомий (наприклад, для "
+"порожнього <varname>GEOMETRYCOLLECTION</varname>), повертається 0."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.2"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.2"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 support for Polyhedral surfaces and TINs was introduced. No "
+"longer throws an exception if given empty geometry."
+msgstr ""
+"Покращено: 2.0.0 додано підтримку багатогранних поверхонь і TIN. Більше не "
+"виникає виняток, якщо задано порожню геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior to 2.0.0, this function throws an exception if used with empty "
+"geometry."
+msgstr ""
+"До версії 2.0.0 ця функція викликає виняток, якщо використовується з "
+"порожньою геометрією."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of <varname>geometry_dump</varname> rows for the components of "
+"a geometry."
+msgstr ""
+"Повертає набір рядків <varname>geometry_dump</varname> для компонентів "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A set-returning function (SRF) that extracts the components of a geometry. "
+"It returns a set of <xref linkend=\"geometry_dump\"/> rows, each containing "
+"a geometry (<parameter>geom</parameter> field) and an array of integers "
+"(<parameter>path</parameter> field)."
+msgstr ""
+"Функція повернення набору (SRF), яка витягує компоненти геометрії. Вона "
+"повертає набір <xref linkend=\"geometry_dump\"/>рядків, кожен з яких містить "
+"геометрію (поле <parameter>geom</parameter>) та масив цілих чисел (поле "
+"<parameter>path</parameter>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For an atomic geometry type (POINT,LINESTRING,POLYGON) a single record is "
+"returned with an empty <parameter>path</parameter> array and the input "
+"geometry as <parameter>geom</parameter>. For a collection or multi-geometry "
+"a record is returned for each of the collection components, and the "
+"<parameter>path</parameter> denotes the position of the component inside the "
+"collection."
+msgstr ""
+"Для типу атомарної геометрії (POINT, LINESTRING, POLYGON) повертається один "
+"запис з порожнім масивом <parameter>path</parameter> і вхідною геометрією як "
+"<parameter>geom</parameter>. Для колекції або мультигеометрії повертається "
+"запис для кожного компонента колекції, а <parameter>path</parameter> "
+"позначає положення компонента всередині колекції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Dump is useful for expanding geometries. It is the inverse of a <xref "
+"linkend=\"ST_Collect\"/> / GROUP BY, in that it creates new rows. For "
+"example it can be use to expand MULTIPOLYGONS into POLYGONS."
+msgstr ""
+"ST_Dump корисний для розширення геометрій. Він є оберненим до <xref linkend="
+"\"ST_Collect\"/>/ GROUP BY, оскільки створює нові рядки. Наприклад, його "
+"можна використовувати для розширення MULTIPOLYGONS в POLYGONS."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: PostGIS 1.0.0RC1. Requires PostgreSQL 7.3 or higher."
+msgstr "Доступність: PostGIS 1.0.0RC1. Потрібна PostgreSQL 7.3 або вище."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior to 1.3.4, this function crashes if used with geometries that contain "
+"CURVES. This is fixed in 1.3.4+"
+msgstr ""
+"До версії 1.3.4 ця функція виходила з ладу при використанні з геометріями, "
+"що містять КРИВІ. Ця проблема вирішена у версії 1.3.4+"
+
+#. Tag: title
+#, no-c-format
+msgid "Standard Examples"
+msgstr "Стандартні приклади"
+
+#. Tag: title
+#, no-c-format
+msgid "Polyhedral Surfaces, TIN and Triangle Examples"
+msgstr "Багатогранні поверхні, TIN і приклади трикутників"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref "
+"linkend=\"ST_Collect\"/>, <xref linkend=\"ST_GeometryN\"/>"
+msgstr ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref linkend="
+"\"ST_Collect\"/>, <xref linkend=\"ST_GeometryN\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of <varname>geometry_dump</varname> rows for the coordinates "
+"in a geometry."
+msgstr ""
+"Повертає набір рядків <varname>geometry_dump</varname> для координат у "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A set-returning function (SRF) that extracts the coordinates (vertices) of a "
+"geometry. It returns a set of <xref linkend=\"geometry_dump\"/> rows, each "
+"containing a geometry (<parameter>geom</parameter> field) and an array of "
+"integers (<parameter>path</parameter> field)."
+msgstr ""
+"Функція повернення набору (SRF), яка витягує координати (вершини) геометрії. "
+"Вона повертає набір <xref linkend=\"geometry_dump\"/>рядків, кожен з яких "
+"містить геометрію (поле <parameter>geom</parameter>) та масив цілих чисел ("
+"поле <parameter>path</parameter>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the <parameter>geom</parameter> field <varname>POINT</varname>s represent "
+"the coordinates of the supplied geometry."
+msgstr ""
+"поле <parameter>geom</parameter> <varname>POINT</varname>s представляє "
+"координати наданої геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the <parameter>path</parameter> field (an <varname>integer[]</varname>) is "
+"an index enumerating the coordinate positions in the elements of the "
+"supplied geometry. The indices are 1-based. For example, for a "
+"<varname>LINESTRING</varname> the paths are <varname>{i}</varname> where "
+"<varname>i</varname> is the <varname>nth</varname> coordinate in the "
+"<varname>LINESTRING</varname>. For a <varname>POLYGON</varname> the paths "
+"are <varname>{i,j}</varname> where <varname>i</varname> is the ring number "
+"(1 is outer; inner rings follow) and <varname>j</varname> is the coordinate "
+"position in the ring."
+msgstr ""
+"the <parameter>path</parameter> field (an <varname>integer[]</varname>) is "
+"an index enumerating the coordinate positions in the elements of the "
+"supplied geometry. The indices are 1-based. For example, for a "
+"<varname>LINESTRING</varname> the paths are <varname>{i}</varname> where "
+"<varname>i</varname> is the <varname>nth</varname> coordinate in the "
+"<varname>LINESTRING</varname>. For a <varname>POLYGON</varname> the paths "
+"are <varname>{i,j}</varname> where <varname>i</varname> is the ring number ("
+"1 is outer; inner rings follow) and <varname>j</varname> is the coordinate "
+"position in the ring."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To obtain a single geometry containing the coordinates use <xref "
+"linkend=\"ST_Points\"/>."
+msgstr ""
+"Щоб отримати єдину геометрію, що містить координати, використовуйте <xref "
+"linkend=\"ST_Points\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 Faster speed. Reimplemented as native-C."
+msgstr "Покращено: 2.1.0 Вища швидкість. Перероблено як native-C."
+
+#. Tag: title
+#, no-c-format
+msgid "Classic Explode a Table of LineStrings into nodes"
+msgstr "Класичний розрив таблиці рядків у вузли"
+
+#. Tag: title
+#, no-c-format
+msgid "Standard Geometry Examples"
+msgstr "Приклади стандартної геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_DumpRings\"/>, <xref "
+"linkend=\"ST_Points\"/>"
+msgstr ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref linkend=\"ST_Dump"
+"\"/>, <xref linkend=\"ST_DumpRings\"/>, <xref linkend=\"ST_Points\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of <varname>geometry_dump</varname> rows for the segments in a "
+"geometry."
+msgstr ""
+"Повертає набір рядків <varname>geometry_dump</varname> для сегментів у "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A set-returning function (SRF) that extracts the segments of a geometry. It "
+"returns a set of <xref linkend=\"geometry_dump\"/> rows, each containing a "
+"geometry (<parameter>geom</parameter> field) and an array of integers "
+"(<parameter>path</parameter> field)."
+msgstr ""
+"Функція повернення набору (SRF), яка витягує сегменти геометрії. Вона "
+"повертає набір <xref linkend=\"geometry_dump\"/>рядків, кожен з яких містить "
+"геометрію (поле <parameter>geom</parameter>) та масив цілих чисел (поле "
+"<parameter>path</parameter>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the <parameter>geom</parameter> field <varname>LINESTRING</varname>s "
+"represent the linear segments of the supplied geometry, while the "
+"<varname>CIRCULARSTRING</varname>s represent the arc segments."
+msgstr ""
+"поле <parameter>geom</parameter> <varname>LINESTRING</varname>s представляє "
+"лінійні сегменти наданої геометрії, а <varname>CIRCULARSTRING</varname>s "
+"представляє сегменти дуги."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the <parameter>path</parameter> field (an <varname>integer[]</varname>) is "
+"an index enumerating the segment start point positions in the elements of "
+"the supplied geometry. The indices are 1-based. For example, for a "
+"<varname>LINESTRING</varname> the paths are <varname>{i}</varname> where "
+"<varname>i</varname> is the <varname>nth</varname> segment start point in "
+"the <varname>LINESTRING</varname>. For a <varname>POLYGON</varname> the "
+"paths are <varname>{i,j}</varname> where <varname>i</varname> is the ring "
+"number (1 is outer; inner rings follow) and <varname>j</varname> is the "
+"segment start point position in the ring."
+msgstr ""
+"поле <parameter>path</parameter> (тип <varname>integer[]</varname>) є "
+"індексом, що перелічує позиції початкових точок сегментів в елементах "
+"наданої геометрії. Індекси починаються з 1. Наприклад, для "
+"<varname>LINESTRING</varname> шляхи є <varname>{i}</varname>, де <varname>i</"
+"varname> є <varname>n-тою</varname> початковою точкою сегмента в "
+"<varname>LINESTRING</varname>. Для <varname>POLYGON</varname> шляхи мають "
+"вигляд <varname>{i,j}</varname>, де <varname>i</varname> — номер кільця (1 — "
+"зовнішнє, внутрішні кільця йдуть за ним), а <varname>j</varname> — позиція "
+"початку сегмента в кільці."
+
+#. Tag: title
+#, no-c-format
+msgid "TIN and Triangle Examples"
+msgstr "Приклади TIN і трикутників"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_DumpRings\"/>"
+msgstr ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref linkend=\"ST_Dump"
+"\"/>, <xref linkend=\"ST_DumpRings\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of <varname>geometry_dump</varname> rows for the exterior and "
+"interior rings of a Polygon."
+msgstr ""
+"Повертає набір рядків <varname>geometry_dump</varname> для зовнішнього та "
+"внутрішнього кілець полігону."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A set-returning function (SRF) that extracts the rings of a polygon. It "
+"returns a set of <xref linkend=\"geometry_dump\"/> rows, each containing a "
+"geometry (<parameter>geom</parameter> field) and an array of integers "
+"(<parameter>path</parameter> field)."
+msgstr ""
+"Функція повернення набору (SRF), яка витягує кільця полігону. Вона повертає "
+"набір <xref linkend=\"geometry_dump\"/>рядків, кожен з яких містить "
+"геометрію (поле <parameter>geom</parameter>) та масив цілих чисел (поле "
+"<parameter>path</parameter>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <parameter>geom</parameter> field contains each ring as a POLYGON. The "
+"<parameter>path</parameter> field is an integer array of length 1 containing "
+"the polygon ring index. The exterior ring (shell) has index 0. The interior "
+"rings (holes) have indices of 1 and higher."
+msgstr ""
+"Поле <parameter>geom</parameter> містить кожне кільце як POLYGON. Поле "
+"<parameter>path</parameter> є цілочисельним масивом довжиною 1, що містить "
+"індекс кільця полігону. Зовнішнє кільце (оболонка) має індекс 0. Внутрішні "
+"кільця (отвори) мають індекси 1 і вище."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This only works for POLYGON geometries. It does not work for MULTIPOLYGONS"
+msgstr "Це працює тільки для геометрії POLYGON. Не працює для MULTIPOLYGONS"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: PostGIS 1.1.3. Requires PostgreSQL 7.3 or higher."
+msgstr "Доступність: PostGIS 1.1.3. Вимагає PostgreSQL 7.3 або вище."
+
+#. Tag: para
+#, no-c-format
+msgid "General form of query."
+msgstr "Загальна форма запиту."
+
+#. Tag: para
+#, no-c-format
+msgid "A polygon with a single hole."
+msgstr "Полігон з одним отвором."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_ExteriorRing\"/>, <xref "
+"linkend=\"ST_InteriorRingN\"/>"
+msgstr ""
+", <xref linkend=\"PostGIS_Geometry_DumpFunctions\"/>, <xref linkend=\"ST_Dump"
+"\"/>, <xref linkend=\"ST_ExteriorRing\"/>, <xref linkend=\"ST_InteriorRingN\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the last point of a LineString or CircularLineString."
+msgstr "Повертає останню точку LineString або CircularLineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the last point of a <varname>LINESTRING</varname> or "
+"<varname>CIRCULARLINESTRING</varname> geometry as a <varname>POINT</"
+"varname>. Returns <varname>NULL</varname> if the input is not a "
+"<varname>LINESTRING</varname> or <varname>CIRCULARLINESTRING</varname>."
+msgstr ""
+"Повертає останню точку геометрії <varname>LINESTRING</varname> або "
+"<varname>CIRCULARLINESTRING</varname> як <varname>POINT</varname>. Повертає "
+"<varname>NULL</varname>, якщо вхідні дані не є <varname>LINESTRING</varname> "
+"або <varname>CIRCULARLINESTRING</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.1.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.1.4"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 no longer works with single geometry MultiLineStrings. In "
+"older versions of PostGIS a single-line MultiLineString would work with this "
+"function and return the end point. In 2.0.0 it returns NULL like any other "
+"MultiLineString. The old behavior was an undocumented feature, but people "
+"who assumed they had their data stored as LINESTRING may experience these "
+"returning NULL in 2.0.0."
+msgstr ""
+"Змінено: 2.0.0 більше не працює з одномірними MultiLineStrings. У старих "
+"версіях PostGIS одномірний MultiLineString працював з цією функцією і "
+"повертав кінцеву точку. У 2.0.0 він повертає NULL, як і будь-який інший "
+"MultiLineString. Стара поведінка була недокументованою функцією, але "
+"користувачі, які вважали, що їхні дані зберігаються як LINESTRING, можуть "
+"зіткнутися з поверненням NULL у 2.0.0."
+
+#. Tag: para
+#, no-c-format
+msgid "End point of a LineString"
+msgstr "End point of a LineString"
+
+#. Tag: para
+#, no-c-format
+msgid "End point of a non-LineString is NULL"
+msgstr "Кінцева точка нелінійного об'єкта LineString має значення NULL"
+
+#. Tag: para
+#, no-c-format
+msgid "End point of a 3D LineString"
+msgstr "Кінцева точка 3D-лінії"
+
+#. Tag: para
+#, no-c-format
+msgid "End point of a CircularString"
+msgstr "Кінцева точка CircularString"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_StartPoint\"/>"
+msgstr ", <xref linkend=\"ST_StartPoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a geometry representing the bounding box of a geometry."
+msgstr "Повертає геометрію, що представляє обмежувальну рамку геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the double-precision (float8) minimum bounding box for the supplied "
+"geometry, as a geometry. The polygon is defined by the corner points of the "
+"bounding box ((<varname>MINX</varname>, <varname>MINY</varname>), "
+"(<varname>MINX</varname>, <varname>MAXY</varname>), (<varname>MAXX</"
+"varname>, <varname>MAXY</varname>), (<varname>MAXX</varname>, <varname>MINY</"
+"varname>), (<varname>MINX</varname>, <varname>MINY</varname>)). (PostGIS "
+"will add a <varname>ZMIN</varname>/<varname>ZMAX</varname> coordinate as "
+"well)."
+msgstr ""
+"Повертає мінімальну обмежувальну коробку подвійної точності (float8) для "
+"заданої геометрії у вигляді геометрії. Полігон визначається кутовими точками "
+"обмежувальної рамки ((<varname>MINX</varname>, <varname>MINY</varname>), "
+"(<varname>MINX</varname>, <varname>MAXY</varname>), (<varname>MAXX</"
+"varname>, <varname>MAXY</varname>), (<varname>MAXX</varname>, "
+"<varname>MINY</varname>), (<varname>MINX</varname>, <varname>MINY</varname>))"
+". (PostGIS також додасть координати "
+"<varname>ZMIN</varname>/<varname>ZMAX</varname>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Degenerate cases (vertical lines, points) will return a geometry of lower "
+"dimension than <varname>POLYGON</varname>, ie. <varname>POINT</varname> or "
+"<varname>LINESTRING</varname>."
+msgstr ""
+"У виняткових випадках (вертикальні лінії, точки) буде повернено геометрію з "
+"розмірністю, меншою за <varname>POLYGON</varname>, тобто <varname>POINT</"
+"varname> або <varname>LINESTRING</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.5.0 behavior changed to output double precision instead of "
+"float4"
+msgstr ""
+"Доступність: 1.5.0 поведінка змінена на виведення подвійної точності замість "
+"float4"
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.1.1"
+msgstr "&sfs_compliant; s2.1.1.1"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.19"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.19"
+
+#. Tag: para
+#, no-c-format
+msgid "Envelope of a point and linestring."
+msgstr "Огинаюча точки та лінійного відрізка."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"Box3D\"/>, <xref linkend=\"ST_OrientedEnvelope\"/>"
+msgstr ", <xref linkend=\"Box3D\"/>, <xref linkend=\"ST_OrientedEnvelope\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a LineString representing the exterior ring of a Polygon."
+msgstr "Повертає LineString, що представляє зовнішнє кільце полігону"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a LINESTRING representing the exterior ring (shell) of a POLYGON. "
+"Returns NULL if the geometry is not a polygon."
+msgstr "Повертає LineString, що представляє зовнішнє кільце полігону."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not support MULTIPOLYGONs. For MULTIPOLYGONs use in "
+"conjunction with <xref linkend=\"ST_GeometryN\"/> or <xref "
+"linkend=\"ST_Dump\"/>"
+msgstr ""
+"Ця функція не підтримує MULTIPOLYGON. Для MULTIPOLYGON використовуйте разом "
+"з <xref linkend=\"ST_GeometryN\"/>або <xref linkend=\"ST_Dump\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; 2.1.5.1"
+msgstr "&sfs_compliant; 2.1.5.1"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.2.3, 8.3.3"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.2.3, 8.3.3"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Boundary\"/>, <xref linkend=\"ST_NumInteriorRings\"/>"
+msgstr ""
+", <xref linkend=\"ST_Boundary\"/>, <xref linkend=\"ST_NumInteriorRings\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return an element of a geometry collection."
+msgstr "Повернути елемент колекції геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the 1-based Nth element geometry of an input geometry which is a "
+"GEOMETRYCOLLECTION, MULTIPOINT, MULTILINESTRING, MULTICURVE, MULTI)POLYGON, "
+"or POLYHEDRALSURFACE. Otherwise, returns NULL."
+msgstr ""
+"Повертає N-й елемент геометрії, починаючи з 1, вхідної геометрії, яка є "
+"GEOMETRYCOLLECTION, MULTIPOINT, MULTILINESTRING, MULTICURVE, MULTI)POLYGON "
+"або POLYHEDRALSURFACE. В іншому випадку повертає NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index is 1-based as for OGC specs since version 0.8.0. Previous versions "
+"implemented this as 0-based instead."
+msgstr ""
+"Індекс базується на 1, як і в специфікаціях OGC, починаючи з версії 0.8.0. У "
+"попередніх версіях це реалізовано на основі 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To extract all elements of a geometry, <xref linkend=\"ST_Dump\"/> is more "
+"efficient and works for atomic geometries."
+msgstr ""
+"Щоб витягти всі елементи геометрії, <xref linkend=\"ST_Dump\"/>є більш "
+"ефективним і працює для атомних геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 Prior versions would return NULL for singular geometries. "
+"This was changed to return the geometry for ST_GeometryN(..,1) case."
+msgstr ""
+"Змінено: 2.0.0 Попередні версії повертали NULL для геометрій в однині. Це "
+"було змінено, щоб повертати геометрію для випадку ST_GeometryN(..,1)."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 9.1.5"
+msgstr "&sqlmm_compliant; SQL-MM 3: 9.1.5"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_NumGeometries\"/>"
+msgstr ", <xref linkend=\"ST_NumGeometries\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the SQL-MM type of a geometry as text."
+msgstr "Повертає тип SQL-MM геометрії у вигляді тексту."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the type of the geometry as a string. EG: 'ST_LineString', "
+"'ST_Polygon','ST_MultiPolygon' etc. This function differs from "
+"GeometryType(geometry) in the case of the string and ST in front that is "
+"returned, as well as the fact that it will not indicate whether the geometry "
+"is measured."
+msgstr ""
+"Повертає тип геометрії у вигляді рядка. Наприклад: “ST_LineString”, "
+"“ST_Polygon”,'ST_MultiPolygon' тощо. Ця функція відрізняється від "
+"GeometryType(geometry) тим, що повертає строку і ST на початку, а також тим, "
+"що не вказує, чи виміряно геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 support for Polyhedral surfaces was introduced."
+msgstr "Покращено: 2.0.0 додано підтримку багатогранних поверхонь."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.4"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if a geometry contains a circular arc"
+msgstr "Тестує, чи містить геометрія кругову дугу"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if a geometry or geometry collection contains a circular string"
+msgstr ""
+"Повертає true, якщо геометрія або колекція геометрій містить циклічну строку"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.2.3?"
+msgstr "Доступність: 1.2.3?"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LineToCurve\"/>"
+msgstr ", <xref linkend=\"ST_LineToCurve\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Nth interior ring (hole) of a Polygon."
+msgstr "Повертає N-те внутрішнє кільце (отвір) полігону."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the Nth interior ring (hole) of a POLYGON geometry as a LINESTRING. "
+"The index starts at 1. Returns NULL if the geometry is not a polygon or the "
+"index is out of range."
+msgstr ""
+"Повертає N-те внутрішнє кільце (отвір) геометрії POLYGON як LINESTRING. "
+"Індекс починається з 1. Повертає NULL, якщо геометрія не є полігоном або "
+"індекс виходить за межі діапазону."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.2.6, 8.3.5"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.2.6, 8.3.5"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_BuildArea\"/>, <xref linkend=\"ST_Collect\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_NumInteriorRing\"/>, <xref "
+"linkend=\"ST_NumInteriorRings\"/>"
+msgstr ""
+", <xref linkend=\"ST_BuildArea\"/>, <xref linkend=\"ST_Collect\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_NumInteriorRing\"/>, <xref linkend="
+"\"ST_NumInteriorRings\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the number of component curves in a CompoundCurve."
+msgstr "Повернути кількість кривих компонентів у CompoundCurve."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the number of component curves in a CompoundCurve, zero for an empty "
+"CompoundCurve, or NULL for a non-CompoundCurve input."
+msgstr ""
+"Повертає кількість компонентних кривих у CompoundCurve, нуль для порожнього "
+"CompoundCurve або NULL для вхідних даних, що не є CompoundCurve."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Dump\"/>, <xref linkend=\"ST_ExteriorRing\"/>, <xref "
+"linkend=\"ST_NumInteriorRings\"/>, <xref linkend=\"ST_NumGeometries\"/>"
+msgstr ""
+", <xref linkend=\"ST_Dump\"/>, <xref linkend=\"ST_ExteriorRing\"/>, <xref "
+"linkend=\"ST_NumInteriorRings\"/>, <xref linkend=\"ST_NumGeometries\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Nth component curve geometry of a CompoundCurve."
+msgstr "Повертає геометрію N-го компонента кривої CompoundCurve."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the Nth component curve geometry of a CompoundCurve. The index "
+"starts at 1. Returns NULL if the geometry is not a CompoundCurve or the "
+"index is out of range."
+msgstr ""
+"Повертає геометрію N-го компонента кривої CompoundCurve. Індекс починається "
+"з 1. Повертає NULL, якщо геометрія не є CompoundCurve або індекс знаходиться "
+"поза діапазоном."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if a LineStrings's start and end points are coincident. For a "
+"PolyhedralSurface tests if it is closed (volumetric)."
+msgstr ""
+"Перевіряє, чи збігаються початкова та кінцева точки LineStrings. Для "
+"PolyhedralSurface перевіряє, чи є вона закритою (об'ємною)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if the <varname>LINESTRING</varname>'s start "
+"and end points are coincident. For Polyhedral Surfaces, reports if the "
+"surface is areal (open) or volumetric (closed)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо початкова та кінцева точки "
+"<varname>LINESTRING</varname> збігаються. Для поліедральних поверхонь "
+"повідомляє, чи поверхня є плоскою (відкритою) чи об'ємною (закритою)."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.1.5, 9.3.3"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.1.5, 9.3.3"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SQL-MM defines the result of <code>ST_IsClosed(NULL)</code> to be 0, while "
+"PostGIS returns <varname>NULL</varname>."
+msgstr ""
+"SQL-MM визначає результат <code>ST_IsClosed(NULL)</code> як 0, тоді як "
+"PostGIS повертає <varname>NULL</varname>."
+
+#. Tag: title
+#, no-c-format
+msgid "Line String and Point Examples"
+msgstr "Приклади LineString і Point"
+
+#. Tag: title
+#, no-c-format
+msgid "Polyhedral Surface Examples"
+msgstr "Приклади багатогранних поверхонь"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if a geometry is a geometry collection type."
+msgstr "Перевіряє, чи є геометрія типом колекції геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if the geometry type of the argument a "
+"geometry collection type. Collection types are the following:"
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо тип геометрії аргументу є типом "
+"колекції геометрії. Типи колекцій є такими:"
+
+#. Tag: para
+#, no-c-format
+msgid "GEOMETRYCOLLECTION"
+msgstr "GEOMETRYCOLLECTION"
+
+#. Tag: para
+#, no-c-format
+msgid "MULTI{POINT,POLYGON,LINESTRING,CURVE,SURFACE}"
+msgstr "MULTI{POINT,POLYGON,LINESTRING,CURVE,SURFACE}"
+
+#. Tag: para
+#, no-c-format
+msgid "COMPOUNDCURVE"
+msgstr "COMPOUNDCURVE"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function analyzes the type of the geometry. This means that it will "
+"return <varname>TRUE</varname> on collections that are empty or that contain "
+"a single element."
+msgstr ""
+"Ця функція аналізує тип геометрії. Це означає, що вона поверне "
+"<varname>TRUE</varname> для колекцій, які порожні або містять один елемент."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if a geometry is empty."
+msgstr "Перевіряє, чи геометрія порожня."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if this Geometry is an empty geometry. If true, then this "
+"Geometry represents an empty geometry collection, polygon, point etc."
+msgstr ""
+"Повертає true, якщо ця геометрія є порожньою. Якщо true, то ця геометрія "
+"представляє порожню колекцію геометрії, полігон, точку тощо."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SQL-MM defines the result of ST_IsEmpty(NULL) to be 0, while PostGIS returns "
+"NULL."
+msgstr ""
+"SQL-MM визначає результат ST_IsEmpty(NULL) як 0, тоді як PostGIS повертає "
+"NULL."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.7"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.7"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 In prior versions of PostGIS "
+"ST_GeomFromText('GEOMETRYCOLLECTION(EMPTY)') was allowed. This is now "
+"illegal in PostGIS 2.0.0 to better conform with SQL/MM standards"
+msgstr ""
+"Змінено: 2.0.0 У попередніх версіях PostGIS "
+"ST_GeomFromText(“GEOMETRYCOLLECTION(EMPTY)”) було дозволено. Тепер це є "
+"незаконним у PostGIS 2.0.0 для кращої відповідності стандартам SQL/MM"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if Polygons have exterior rings oriented counter-clockwise and "
+"interior rings oriented clockwise."
+msgstr ""
+"Перевіряє, чи мають полігони зовнішні кільця, орієнтовані проти годинникової "
+"стрілки, і внутрішні кільця, орієнтовані за годинниковою стрілкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if all polygonal components of the input geometry use a counter-"
+"clockwise orientation for their exterior ring, and a clockwise direction for "
+"all interior rings."
+msgstr ""
+"Повертає true, якщо всі полігональні компоненти вхідної геометрії "
+"використовують орієнтацію проти годинникової стрілки для зовнішнього кільця "
+"і за годинниковою стрілкою для всіх внутрішніх кілець."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns true if the geometry has no polygonal components."
+msgstr "Повертає true, якщо геометрія не має полігональних компонентів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Closed linestrings are not considered polygonal components, so you would "
+"still get a true return by passing a single closed linestring no matter its "
+"orientation."
+msgstr ""
+"Закриті лінії не вважаються полігональними компонентами, тому ви все одно "
+"отримаєте правильний результат, передавши одну закриту лінію незалежно від "
+"її орієнтації."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If a polygonal geometry does not use reversed orientation for interior rings "
+"(i.e., if one or more interior rings are oriented in the same direction as "
+"an exterior ring) then both ST_IsPolygonCW and ST_IsPolygonCCW will return "
+"false."
+msgstr ""
+"Якщо полігональна геометрія не використовує зворотну орієнтацію для "
+"внутрішніх кілець (тобто, якщо одне або більше внутрішніх кілець орієнтовані "
+"в тому ж напрямку, що і зовнішнє кільце), то обидва ST_IsPolygonCW і "
+"ST_IsPolygonCCW повернуть false."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.4.0"
+msgstr "Доступність: 2.4.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ForcePolygonCCW\"/>, <xref linkend=\"ST_IsPolygonCW\"/>"
+msgstr ""
+", <xref linkend=\"ST_ForcePolygonCCW\"/>, <xref linkend=\"ST_IsPolygonCW\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if Polygons have exterior rings oriented clockwise and interior rings "
+"oriented counter-clockwise."
+msgstr ""
+"Перевіряє, чи полігони мають зовнішні кільця, орієнтовані за годинниковою "
+"стрілкою, а внутрішні кільця — проти годинникової стрілки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if all polygonal components of the input geometry use a "
+"clockwise orientation for their exterior ring, and a counter-clockwise "
+"direction for all interior rings."
+msgstr ""
+"Повертає true, якщо всі полігональні компоненти вхідної геометрії "
+"використовують орієнтацію за годинниковою стрілкою для зовнішнього кільця і "
+"проти годинникової стрілки для всіх внутрішніх кілець."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if a LineString is closed and simple."
+msgstr "Перевіряє, чи лінія LineString є замкнутою та простою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if this <varname>LINESTRING</varname> is "
+"both <xref linkend=\"ST_IsClosed\"/> (<code>ST_StartPoint(g) ~= "
+"ST_Endpoint(g)</code>) and <xref linkend=\"ST_IsSimple\"/> (does not self "
+"intersect)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо цей <varname>LINESTRING</varname> є "
+"одночасно <xref linkend=\"ST_IsClosed\"/>(<code>ST_StartPoint(g) ~= "
+"ST_Endpoint(g)</code>) і <xref linkend=\"ST_IsSimple\"/>(не перетинається "
+"сам із собою)."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.1.6"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.1.6"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SQL-MM defines the result of <code>ST_IsRing(NULL)</code> to be 0, while "
+"PostGIS returns <varname>NULL</varname>."
+msgstr ""
+"SQL-MM визначає результат <code>ST_IsRing(NULL)</code> як 0, тоді як PostGIS "
+"повертає <varname>NULL</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_IsSimple\"/>, <xref linkend=\"ST_StartPoint\"/>, <xref "
+"linkend=\"ST_EndPoint\"/>"
+msgstr ""
+", <xref linkend=\"ST_IsSimple\"/>, <xref linkend=\"ST_StartPoint\"/>, <xref "
+"linkend=\"ST_EndPoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if a geometry has no points of self-intersection or self-tangency."
+msgstr "Перевіряє, чи геометрія не має точок самоперетину або самодотику."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if this Geometry has no anomalous geometric points, such as "
+"self-intersection or self-tangency. For more information on the OGC's "
+"definition of geometry simplicity and validity, refer to <link "
+"linkend=\"OGC_Validity\">\"Ensuring OpenGIS compliance of geometries\"</link>"
+msgstr ""
+"Повертає значення true, якщо ця геометрія не має аномальних геометричних "
+"точок, таких як самоперетин або самодотичність. Для отримання додаткової "
+"інформації про визначення простоти та валідності геометрії OGC див. <link "
+"linkend=\"OGC_Validity\">\"Забезпечення відповідності геометрій стандарту "
+"OpenGIS\"</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SQL-MM defines the result of ST_IsSimple(NULL) to be 0, while PostGIS "
+"returns NULL."
+msgstr ""
+"SQL-MM визначає результат ST_IsSimple(NULL) як 0, тоді як PostGIS повертає "
+"NULL."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.8"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.8"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the M coordinate of a Point."
+msgstr "Повертає координату M точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the M coordinate of a Point, or NULL if not available. Input must be "
+"a Point."
+msgstr ""
+"Повертає координату M точки або NULL, якщо вона недоступна. Вхідні дані "
+"повинні бути точкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is not (yet) part of the OGC spec, but is listed here to complete the "
+"point coordinate extractor function list."
+msgstr ""
+"Це (поки що) не є частиною специфікації OGC, але наведено тут для повноти "
+"переліку функцій вилучення координат точок."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant;"
+msgstr "&sqlmm_compliant;"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_X\"/>, <xref linkend=\"ST_Y\"/>, <xref linkend=\"ST_Z\"/"
+">"
+msgstr ""
+", <xref linkend=\"ST_X\"/>, <xref linkend=\"ST_Y\"/>, <xref linkend=\"ST_Z\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the amount of memory space a geometry takes."
+msgstr "Повертає обсяг пам'яті, який займає геометрія."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the amount of memory space (in bytes) the geometry takes."
+msgstr "Повертає обсяг пам'яті (у байтах), який займає геометрія."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This complements the PostgreSQL built-in <link xlink:href=\"https://www."
+"postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-"
+"DBOBJECT\">database object functions</link> pg_column_size, pg_size_pretty, "
+"pg_relation_size, pg_total_relation_size."
+msgstr ""
+"Це доповнює вбудовані в PostgreSQL <link xlink:href=\"https://www.postgresql."
+"org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT\">функції "
+"об'єктів бази даних</link> pg_column_size, pg_size_pretty, pg_relation_size, "
+"pg_total_relation_size."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"pg_relation_size which gives the byte size of a table may return byte size "
+"lower than ST_MemSize. This is because pg_relation_size does not add toasted "
+"table contribution and large geometries are stored in TOAST tables."
+msgstr ""
+"pg_relation_size, що повертає розмір таблиці в байтах, може повернути "
+"розмір, менший за ST_MemSize. Це відбувається тому, що pg_relation_size не "
+"додає розмір тостованих таблиць, а великі геометрії зберігаються в таблицях "
+"TOAST."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"pg_total_relation_size - includes, the table, the toasted tables, and the "
+"indexes."
+msgstr "pg_total_relation_size - включає таблицю, тостовані таблиці та індекси."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"pg_column_size returns how much space a geometry would take in a column "
+"considering compression, so may be lower than ST_MemSize"
+msgstr ""
+"pg_column_size повертає, скільки місця займає геометрія в стовпці з "
+"урахуванням стиснення, тому може бути менше, ніж ST_MemSize."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.2.0 name changed to ST_MemSize to follow naming convention."
+msgstr ""
+"Змінено: 2.2.0 назва змінено на ST_MemSize відповідно до правил іменування."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the coordinate dimension of a geometry."
+msgstr "Повертає розмір координат геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the coordinate dimension of the geometry. PostGIS supports 2 - (x,"
+"y) , 3 - (x,y,z) or 2D with measure - x,y,m, and 4 - 3D with measure space x,"
+"y,z,m"
+msgstr ""
+"Повертає розмірність координат геометрії. PostGIS підтримує 2 - (x,y) , 3 - "
+"(x,y,z) або 2D з мірою - x,y,m, і 4 - 3D з мірою простору x,y,z,m"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Dimension\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>"
+msgstr ", <xref linkend=\"ST_Dimension\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the number of points (vertices) in a geometry."
+msgstr "Повертає кількість точок (вершин) у геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Return the number of points in a geometry. Works for all geometries."
+msgstr "Повертає кількість точок у геометрії. Працює для всіх геометрій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the number of rings in a polygonal geometry."
+msgstr "Повертає кількість кілець у полігональній геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the geometry is a polygon or multi-polygon returns the number of rings. "
+"Unlike NumInteriorRings, it counts the outer rings as well."
+msgstr ""
+"Якщо геометрія є полігоном або мультиполігоном, повертає кількість кілець. "
+"На відміну від NumInteriorRings, враховує також зовнішні кільця."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the number of elements in a geometry collection."
+msgstr "Повертає кількість елементів у колекції геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the number of elements in a geometry collection (GEOMETRYCOLLECTION "
+"or MULTI*). For non-empty atomic geometries returns 1. For empty geometries "
+"returns 0."
+msgstr ""
+"Повертає кількість елементів у колекції геометрій (GEOMETRYCOLLECTION або "
+"MULTI*). Для не порожніх атомарних геометрій повертає 1. Для порожніх "
+"геометрій повертає 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 In prior versions this would return NULL if the geometry was "
+"not a collection/MULTI type. 2.0.0+ now returns 1 for single geometries e.g "
+"POLYGON, LINESTRING, POINT."
+msgstr ""
+"Змінено: 2.0.0 У попередніх версіях це повертало NULL, якщо геометрія не "
+"була типом колекції/MULTI. 2.0.0+ тепер повертає 1 для одиночних геометрій, "
+"наприклад POLYGON, LINESTRING, POINT."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 9.1.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 9.1.4"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Multi\"/>"
+msgstr ", <xref linkend=\"ST_Multi\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the number of interior rings (holes) of a Polygon."
+msgstr "Повертає кількість внутрішніх кілець (отворів) полігону."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the number of interior rings of a polygon geometry. Return NULL if "
+"the geometry is not a polygon."
+msgstr ""
+"Повертає кількість внутрішніх кілець геометрії полігону. Повертає NULL, якщо "
+"геометрія не є полігоном."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.2.5"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.2.5"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 - in prior versions it would allow passing a MULTIPOLYGON, "
+"returning the number of interior rings of first POLYGON."
+msgstr ""
+"Змінено: 2.0.0 - у попередніх версіях дозволялося передавати MULTIPOLYGON, "
+"повертаючи кількість внутрішніх кілець першого POLYGON."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_InteriorRingN\"/>"
+msgstr ", <xref linkend=\"ST_InteriorRingN\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the number of interior rings (holes) of a Polygon. Aias for "
+"ST_NumInteriorRings"
+msgstr ""
+"Повертає кількість внутрішніх кілець (отворів) полігону. Aias для "
+"ST_NumInteriorRings"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the number of faces on a Polyhedral Surface. Will return null for non-"
+"polyhedral geometries."
+msgstr ""
+"Повертає кількість граней на багатогранній поверхні. Для небагатогранних "
+"геометрій повертає нуль."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the number of faces on a Polyhedral Surface. Will return null for non-"
+"polyhedral geometries. This is an alias for ST_NumGeometries to support MM "
+"naming. Faster to use ST_NumGeometries if you don't care about MM convention."
+msgstr ""
+"Повертає кількість граней на багатогранній поверхні. Для геометрій, що не є "
+"багатогранними, повертає нуль. Це псевдонім для ST_NumGeometries для "
+"підтримки іменування MM. Якщо вам не важлива конвенція MM, швидше "
+"використовувати ST_NumGeometries."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM ISO/IEC 13249-3: 8.5"
+msgstr "&sqlmm_compliant; SQL-MM ISO/IEC 13249-3: 8.5"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the number of points in a LineString or CircularString."
+msgstr "Повертає кількість точок у LineString або CircularString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the number of points in an ST_LineString or ST_CircularString value. "
+"Prior to 1.4 only works with linestrings as the specs state. From 1.4 "
+"forward this is an alias for ST_NPoints which returns number of vertices for "
+"not just linestrings. Consider using ST_NPoints instead which is multi-"
+"purpose and works with many geometry types."
+msgstr ""
+"Повертає кількість точок у значенні ST_LineString або ST_CircularString. До "
+"версії 1.4 працює тільки з лініями, як зазначено в специфікації. Починаючи з "
+"версії 1.4, це псевдонім для ST_NPoints, який повертає кількість вершин не "
+"тільки для лінійних рядків. Розгляньте можливість використання ST_NPoints, "
+"який є багатоцільовим і працює з багатьма типами геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.2.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.2.4"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Nth geometry (face) of a PolyhedralSurface."
+msgstr "Повертає N-ту геометрію (грань) багатогранної поверхні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 1-based Nth geometry (face) if the geometry is a "
+"POLYHEDRALSURFACE or POLYHEDRALSURFACEM. Otherwise, returns NULL. This "
+"returns the same answer as ST_GeometryN for PolyhedralSurfaces. Using "
+"ST_GeometryN is faster."
+msgstr ""
+"Повертає N-ту геометрію (грань), починаючи з 1, якщо геометрія є "
+"POLYHEDRALSURFACE або POLYHEDRALSURFACEM. В іншому випадку повертає NULL. "
+"Повертає той самий результат, що й ST_GeometryN для PolyhedralSurfaces. "
+"Використання ST_GeometryN є швидшим."
+
+#. Tag: para
+#, no-c-format
+msgid "Index is 1-based."
+msgstr "Індекс починається з 1."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you want to extract all elements of a geometry <xref linkend=\"ST_Dump\"/"
+"> is more efficient."
+msgstr ""
+"Якщо ви хочете витягти всі елементи геометрії, <xref linkend=\"ST_Dump\"/>є "
+"більш ефективним."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_Dump\"/>, <xref "
+"linkend=\"ST_GeometryN\"/>, <xref linkend=\"ST_NumGeometries\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_Dump\"/>, <xref "
+"linkend=\"ST_GeometryN\"/>, <xref linkend=\"ST_NumGeometries\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the Nth point in the first LineString or circular LineString in a "
+"geometry."
+msgstr ""
+"Повертає N-ту точку в першому LineString або круговому LineString в "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the Nth point in a single linestring or circular linestring in the "
+"geometry. Negative values are counted backwards from the end of the "
+"LineString, so that -1 is the last point. Returns NULL if there is no "
+"linestring in the geometry."
+msgstr ""
+"Повертає N-ту точку в одній лінійній або круговій лінійній геометрії. "
+"Негативні значення відраховуються назад від кінця LineString, так що -1 є "
+"останньою точкою. Повертає NULL, якщо в геометрії немає лінійної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index is 1-based as for OGC specs since version 0.8.0. Backward indexing "
+"(negative index) is not in OGC Previous versions implemented this as 0-based "
+"instead."
+msgstr ""
+"Індекс починається з 1, як і в специфікаціях OGC, починаючи з версії 0.8.0. "
+"Зворотне індексування (негативний індекс) не передбачено в OGC. У попередніх "
+"версіях це реалізовано як індекс, що починається з 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you want to get the Nth point of each LineString in a MultiLineString, "
+"use in conjunction with ST_Dump"
+msgstr ""
+"Якщо ви хочете отримати N-ту точку кожного LineString у MultiLineString, "
+"використовуйте разом із ST_Dump"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.2.5, 7.3.5"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.2.5, 7.3.5"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 no longer works with single geometry multilinestrings. In "
+"older versions of PostGIS -- a single line multilinestring would work "
+"happily with this function and return the start point. In 2.0.0 it just "
+"returns NULL like any other multilinestring."
+msgstr ""
+"Змінено: 2.0.0 більше не працює з одногеометричними мультилініями. У "
+"старіших версіях PostGIS — одинарну мультилінію працював би з цією функцією "
+"без проблем і повертав би початкову точку. У 2.0.0 він просто повертає NULL, "
+"як і будь-який інший мультилінії."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.3.0 : negative indexing available (-1 is last point)"
+msgstr "Змінено: 2.3.0: доступне негативне індексування (-1 — останній пункт)"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a MultiPoint containing the coordinates of a geometry."
+msgstr "Повертає об'єкт MultiPoint, що містить координати геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a MultiPoint containing all the coordinates of a geometry. Duplicate "
+"points are preserved, including the start and end points of ring geometries. "
+"(If desired, duplicate points can be removed by calling <xref "
+"linkend=\"ST_RemoveRepeatedPoints\"/> on the result)."
+msgstr ""
+"Повертає MultiPoint, що містить усі координати геометрії. Дублікати точок "
+"зберігаються, включаючи початкову та кінцеву точки кільцевих геометрій. (За "
+"бажанням дублікати точок можна видалити, викликавши <xref linkend="
+"\"ST_RemoveRepeatedPoints\"/> на результаті)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To obtain information about the position of each coordinate in the parent "
+"geometry use <xref linkend=\"ST_DumpPoints\"/>."
+msgstr ""
+"Щоб отримати інформацію про положення кожної координати в батьківській "
+"геометрії, використовуйте <xref linkend=\"ST_DumpPoints\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "M and Z coordinates are preserved if present."
+msgstr "Координати M і Z зберігаються, якщо вони є."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_DumpPoints\"/>"
+msgstr ", <xref linkend=\"ST_DumpPoints\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the first point of a LineString."
+msgstr "Повертає першу точку LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the first point of a <varname>LINESTRING</varname> or "
+"<varname>CIRCULARLINESTRING</varname> geometry as a <varname>POINT</"
+"varname>. Returns <varname>NULL</varname> if the input is not a "
+"<varname>LINESTRING</varname> or <varname>CIRCULARLINESTRING</varname>."
+msgstr ""
+"Повертає першу точку геометрії <varname>LINESTRING</varname> або "
+"<varname>CIRCULARLINESTRING</varname> як <varname>POINT</varname>. Повертає "
+"<varname>NULL</varname>, якщо вхідні дані не є <varname>LINESTRING</varname> "
+"або <varname>CIRCULARLINESTRING</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.1.3"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.1.3"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.2.0 returns a point for all geometries. Prior behavior returns "
+"NULLs if input was not a LineString."
+msgstr ""
+"Покращено: 3.2.0 повертає точку для всіх геометрій. Попередня поведінка "
+"повертала NULL, якщо вхідні дані не були LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 no longer works with single geometry MultiLineStrings. In "
+"older versions of PostGIS a single-line MultiLineString would work happily "
+"with this function and return the start point. In 2.0.0 it just returns NULL "
+"like any other MultiLineString. The old behavior was an undocumented "
+"feature, but people who assumed they had their data stored as LINESTRING may "
+"experience these returning NULL in 2.0.0."
+msgstr ""
+"Змінено: 2.0.0 більше не працює з одномірними геометричними об'єктами "
+"MultiLineStrings. У старих версіях PostGIS одномірний MultiLineString "
+"працював з цією функцією без проблем і повертав початкову точку. У 2.0.0 він "
+"просто повертає NULL, як і будь-який інший MultiLineString. Стара поведінка "
+"була недокументованою функцією, але користувачі, які вважали, що їхні дані "
+"зберігаються як LINESTRING, можуть зіткнутися з поверненням NULL у 2.0.0."
+
+#. Tag: para
+#, no-c-format
+msgid "Start point of a LineString"
+msgstr "Початкова точка лінії"
+
+#. Tag: para
+#, no-c-format
+msgid "Start point of a non-LineString is NULL"
+msgstr "Початкова точка нелінійного об'єкта LineString має значення NULL"
+
+#. Tag: para
+#, no-c-format
+msgid "Start point of a 3D LineString"
+msgstr "Початкова точка 3D-лінії"
+
+#. Tag: para
+#, no-c-format
+msgid "Start point of a CircularString"
+msgstr "Початкова точка CircularString"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_PointN\"/>"
+msgstr ", <xref linkend=\"ST_PointN\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a text summary of the contents of a geometry."
+msgstr "Повертає текстовий підсумок вмісту геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns a text summary of the contents of the geometry."
+msgstr "Повертає текстовий підсумок вмісту геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Flags shown square brackets after the geometry type have the following "
+"meaning:"
+msgstr ""
+"Прапорці, що відображаються в квадратних дужках після типу геометрії, мають "
+"таке значення:"
+
+#. Tag: para
+#, no-c-format
+msgid "M: has M coordinate"
+msgstr "M: має координату M"
+
+#. Tag: para
+#, no-c-format
+msgid "Z: has Z coordinate"
+msgstr "Z: має координату Z"
+
+#. Tag: para
+#, no-c-format
+msgid "B: has a cached bounding box"
+msgstr "B: має кешовану обмежувальну рамку"
+
+#. Tag: para
+#, no-c-format
+msgid "G: is geodetic (geography)"
+msgstr "G: геодезичний (географія)"
+
+#. Tag: para
+#, no-c-format
+msgid "S: has spatial reference system"
+msgstr "S: має просторову систему координат"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.2.2"
+msgstr "Доступність: 1.2.2"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 added support for geography"
+msgstr "Покращено: у версії 2.0.0 додано підтримку географії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 S flag to denote if has a known spatial reference system"
+msgstr ""
+"Покращено: 2.1.0 Прапор S для позначення наявності відомої системи "
+"просторових координат"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.2.0 Added support for TIN and Curves"
+msgstr "Покращено: 2.2.0 Додано підтримку TIN і кривих"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_AddBBox\"/>, <xref linkend=\"ST_Force_3DM\"/>, "
+"<xref linkend=\"ST_Force_3DZ\"/>, <xref linkend=\"ST_Force2D\"/>, <xref "
+"linkend=\"geography\"/>"
+msgstr ""
+", <xref linkend=\"PostGIS_AddBBox\"/>, <xref linkend=\"ST_Force_3DM\"/>, "
+"<xref linkend=\"ST_Force_3DZ\"/>, <xref linkend=\"ST_Force2D\"/>, <xref "
+"linkend=\"geography\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_IsValid\"/>, <xref linkend=\"ST_IsValidReason\"/>, "
+"<xref linkend=\"ST_IsValidDetail\"/>"
+msgstr ""
+", <xref linkend=\"ST_IsValid\"/>, <xref linkend=\"ST_IsValidReason\"/>, "
+"<xref linkend=\"ST_IsValidDetail\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the X coordinate of a Point."
+msgstr "Повертає координату X точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the X coordinate of the point, or NULL if not available. Input must "
+"be a point."
+msgstr ""
+"Повертає координату X точки або NULL, якщо вона недоступна. Вхідні дані "
+"повинні бути точкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To get the minimum and maximum X value of geometry coordinates use the "
+"functions <xref linkend=\"ST_XMin\"/> and <xref linkend=\"ST_XMax\"/>."
+msgstr ""
+"Щоб отримати мінімальне та максимальне значення X координат геометрії, "
+"використовуйте функції <xref linkend=\"ST_XMin\"/> та <xref linkend=\"ST_XMax"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 6.1.3"
+msgstr "&sqlmm_compliant; SQL-MM 3: 6.1.3"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_M\"/>, <xref "
+"linkend=\"ST_XMax\"/>, <xref linkend=\"ST_XMin\"/>, <xref linkend=\"ST_Y\"/"
+">, <xref linkend=\"ST_Z\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_M\"/>, <xref "
+"linkend=\"ST_XMax\"/>, <xref linkend=\"ST_XMin\"/>, <xref linkend=\"ST_Y\"/"
+">, <xref linkend=\"ST_Z\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Y coordinate of a Point."
+msgstr "Повертає координату Y точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the Y coordinate of the point, or NULL if not available. Input must "
+"be a point."
+msgstr ""
+"Повертає координату Y точки або NULL, якщо вона недоступна. Вхідні дані "
+"повинні бути точкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To get the minimum and maximum Y value of geometry coordinates use the "
+"functions <xref linkend=\"ST_YMin\"/> and <xref linkend=\"ST_YMax\"/>."
+msgstr ""
+"Щоб отримати мінімальне та максимальне значення Y координат геометрії, "
+"використовуйте функції <xref linkend=\"ST_YMin\"/> та <xref linkend=\"ST_YMax"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 6.1.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 6.1.4"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_M\"/>, <xref "
+"linkend=\"ST_X\"/>, <xref linkend=\"ST_YMax\"/>, <xref linkend=\"ST_YMin\"/"
+">, <xref linkend=\"ST_Z\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_M\"/>, <xref "
+"linkend=\"ST_X\"/>, <xref linkend=\"ST_YMax\"/>, <xref linkend=\"ST_YMin\"/"
+">, <xref linkend=\"ST_Z\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Z coordinate of a Point."
+msgstr "Повертає координату Z точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the Z coordinate of the point, or NULL if not available. Input must "
+"be a point."
+msgstr ""
+"Повертає координату Z точки або NULL, якщо вона недоступна. Вхідні дані "
+"повинні бути точкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To get the minimum and maximum Z value of geometry coordinates use the "
+"functions <xref linkend=\"ST_ZMin\"/> and <xref linkend=\"ST_ZMax\"/>."
+msgstr ""
+"Щоб отримати мінімальне та максимальне значення Z координат геометрії, "
+"використовуйте функції <xref linkend=\"ST_ZMin\"/> та <xref linkend=\"ST_ZMax"
+"\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_M\"/>, <xref linkend=\"ST_X\"/>, <xref linkend=\"ST_Y\"/"
+">, <xref linkend=\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+msgstr ""
+", <xref linkend=\"ST_M\"/>, <xref linkend=\"ST_X\"/>, <xref linkend=\"ST_Y\"/"
+">, <xref linkend=\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns a code indicating the ZM coordinate dimension of a "
+"geometry.</refpurpose>"
+msgstr ""
+"<refpurpose>Повертає код, що вказує на розмірність координат ZM "
+"геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns a code indicating the ZM coordinate dimension of a geometry.</"
+"para>"
+msgstr ""
+"<para>Повертає код, що вказує на розмірність координат ZM геометрії.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid "Values are: 0 = 2D, 1 = 3D-M, 2 = 3D-Z, 3 = 4D."
+msgstr "Значення: 0 = 2D, 1 = 3D-M, 2 = 3D-Z, 3 = 4D."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_NDims\"/>, <xref linkend=\"ST_Dimension\"/>"
+msgstr ", <xref linkend=\"ST_NDims\"/>, <xref linkend=\"ST_Dimension\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Checks if a geometry has a Z dimension."
+msgstr "Перевіряє, чи має геометрія розмір Z."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Checks if the input geometry has a Z dimension and returns a boolean value. "
+"If the geometry has a Z dimension, it returns true; otherwise, it returns "
+"false."
+msgstr ""
+"Перевіряє, чи має вхідна геометрія розмір Z, і повертає логічне значення. "
+"Якщо геометрія має розмір Z, повертає true; інакше повертає false."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry objects with a Z dimension typically represent three-dimensional "
+"(3D) geometries, while those without it are two-dimensional (2D) geometries."
+msgstr ""
+"Геометричні об'єкти з розміром Z зазвичай представляють тривимірні (3D) "
+"геометрії, тоді як об'єкти без цього розміру є двовимірними (2D) геометріями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is useful for determining if a geometry has elevation or "
+"height information."
+msgstr ""
+"Ця функція корисна для визначення, чи має геометрія інформацію про висоту."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Checks if a geometry has an M (measure) dimension."
+msgstr "Перевіряє, чи має геометрія розмір M (вимір)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Checks if the input geometry has an M (measure) dimension and returns a "
+"boolean value. If the geometry has an M dimension, it returns true; "
+"otherwise, it returns false."
+msgstr ""
+"Перевіряє, чи має вхідна геометрія розмір M (вимір), і повертає булеве "
+"значення. Якщо геометрія має розмір M, повертає true; інакше повертає false."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry objects with an M dimension typically represent measurements or "
+"additional data associated with spatial features."
+msgstr ""
+"Геометричні об'єкти з розмірністю M зазвичай представляють вимірювання або "
+"додаткові дані, пов'язані з просторовими характеристиками."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is useful for determining if a geometry includes measure "
+"information."
+msgstr ""
+"Ця функція корисна для визначення, чи містить геометрія інформацію про "
+"виміри."
+
+#. Tag: title
+#, no-c-format
+msgid "Bounding Box Functions"
+msgstr "Функції обмежувальної рамки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions produce or operate on bounding boxes. They can also provide "
+"and accept geometry values, by using automatic or explicit casts."
+msgstr ""
+"Ці функції створюють або оперують обмежувальними рамками. Вони також можуть "
+"надавати та приймати значення геометрії, використовуючи автоматичні або явні "
+"приведення типів."
+
+#. Tag: para
+#, no-c-format
+msgid "See also <xref linkend=\"PostGIS_BoxFunctions\"/>."
+msgstr "Див. також <xref linkend=\"PostGIS_BoxFunctions\"/>."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a BOX2D representing the 2D extent of a geometry."
+msgstr "Повертає BOX2D, що представляє 2D розмір геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <xref linkend=\"box2d_type\"/> representing the 2D extent of the "
+"geometry."
+msgstr ""
+"Повертає <xref linkend=\"box2d_type\"/>, що представляє 2D розмір геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeomFromText\"/>"
+msgstr ", <xref linkend=\"ST_GeomFromText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a BOX3D representing the 3D extent of a geometry."
+msgstr "Повертає BOX3D, що представляє 3D-розмір геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <xref linkend=\"box3d_type\"/> representing the 3D extent of the "
+"geometry."
+msgstr ""
+"Повертає <xref linkend=\"box3d_type\"/>, що представляє 3D-розмір геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeomFromEWKT\"/>"
+msgstr ", <xref linkend=\"ST_GeomFromEWKT\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the estimated extent of a spatial table."
+msgstr "Повертає приблизний діапазон просторової таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the estimated extent of a spatial table as a <xref "
+"linkend=\"box2d_type\"/>. The current schema is used if not specified. The "
+"estimated extent is taken from the geometry column's statistics. This is "
+"usually much faster than computing the exact extent of the table using <xref "
+"linkend=\"ST_Extent\"/> or <xref linkend=\"ST_3DExtent\"/>."
+msgstr ""
+"Повертає приблизний діапазон просторової таблиці у вигляді <xref linkend="
+"\"box2d_type\"/>. Якщо не вказано, використовується поточна схема. "
+"Приблизний діапазон береться зі статистики стовпця геометрії. Зазвичай це "
+"набагато швидше, ніж обчислення точного діапазону таблиці за допомогою <xref "
+"linkend=\"ST_Extent\"/> або <xref linkend=\"ST_3DExtent\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The default behavior is to also use statistics collected from child tables "
+"(tables with INHERITS) if available. If <varname>parent_only</varname> is "
+"set to TRUE, only statistics for the given table are used and child tables "
+"are ignored."
+msgstr ""
+"За замовчуванням також використовуються статистичні дані, зібрані з дочірніх "
+"таблиць (таблиць з INHERITS), якщо вони доступні. Якщо <varname>parent_only</"
+"varname> встановлено на TRUE, використовуються тільки статистичні дані для "
+"заданої таблиці, а дочірні таблиці ігноруються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For PostgreSQL >= 8.0.0 statistics are gathered by VACUUM ANALYZE and the "
+"result extent will be about 95% of the actual one. For PostgreSQL < 8.0.0 "
+"statistics are gathered by running <code>update_geometry_stats()</code> and "
+"the result extent is exact."
+msgstr ""
+"Для PostgreSQL >= 8.0.0 статистика збирається за допомогою VACUUM "
+"ANALYZE, а результат буде приблизно 95% від фактичного. Для PostgreSQL <"
+"8.0.0 статистика збирається за допомогою <code>update_geometry_stats()</"
+"code>, а результат є точним."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the absence of statistics (empty table or no ANALYZE called) this "
+"function returns NULL. Prior to version 1.5.4 an exception was thrown "
+"instead."
+msgstr ""
+"За відсутності статистики (порожня таблиця або не викликано ANALYZE) ця "
+"функція повертає NULL. До версії 1.5.4 замість цього виникало виключення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Escaping names for tables and/or namespaces that include special characters "
+"and quotes may require special handling. A user notes: \"For schemas and "
+"tables, use identifier escaping rules to produce a double-quoted string, and "
+"afterwards remove the first and last double-quote character. For geometry "
+"column pass as is.\""
+msgstr ""
+"Для імен таблиць та/або просторів імен, що містять спеціальні символи та "
+"лапки, може знадобитися спеціальна обробка. Користувач зазначає: \"Для схем і "
+"таблиць використовуйте правила екранування ідентифікаторів, щоб створити "
+"рядок у подвійних лапках, а потім видаліть перший і останній символи "
+"подвійних лапок. Для стовпця геометрії передайте як є\""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Estimated_Extent."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Estimated_Extent."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DExtent\"/>"
+msgstr ", <xref linkend=\"ST_3DExtent\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a bounding box expanded from another bounding box or a geometry."
+msgstr ""
+"Повертає обмежувальну рамку, розширену з іншої обмежувальної рамки або "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a bounding box expanded from the bounding box of the input, either "
+"by specifying a single distance with which the box should be expanded on "
+"both axes, or by specifying an expansion distance for each axis. Uses double-"
+"precision. Can be used for distance queries, or to add a bounding box filter "
+"to a query to take advantage of a spatial index."
+msgstr ""
+"Повертає обмежувальну рамку, розширену від обмежувальної рамки вхідних "
+"даних, або шляхом вказання єдиної відстані, на яку слід розширити рамку по "
+"обох осях, або шляхом вказання відстані розширення для кожної осі. "
+"Використовує подвійну точність. Може використовуватися для запитів відстані "
+"або для додавання фільтра обмежувальної рамки до запиту, щоб скористатися "
+"перевагами просторового індексу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In addition to the version of ST_Expand accepting and returning a geometry, "
+"variants are provided that accept and return <xref linkend=\"box2d_type\"/> "
+"and <xref linkend=\"box3d_type\"/> data types."
+msgstr ""
+"На додаток до версії ST_Expand, яка приймає та повертає геометрію, надаються "
+"варіанти, які приймають та повертають типи даних <xref linkend=\"box2d_type\""
+"/> та <xref linkend=\"box3d_type\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Distances are in the units of the spatial reference system of the input."
+msgstr ""
+"Відстані вказані в одиницях просторової системи координат вхідних даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Expand is similar to <xref linkend=\"ST_Buffer\"/>, except while "
+"buffering expands a geometry in all directions, ST_Expand expands the "
+"bounding box along each axis."
+msgstr ""
+"ST_Expand схожий на <xref linkend=\"ST_Buffer\"/>, за винятком того, що під "
+"час буферизації геометрія розширюється в усіх напрямках, а ST_Expand "
+"розширює обмежувальну рамку вздовж кожної осі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Pre version 1.3, ST_Expand was used in conjunction with <xref "
+"linkend=\"ST_Distance\"/> to do indexable distance queries. For example, "
+"<code>geom && ST_Expand('POINT(10 20)', 10) AND ST_Distance(geom, "
+"'POINT(10 20)') < 10</code>. This has been replaced by the simpler and "
+"more efficient <xref linkend=\"ST_DWithin\"/> function."
+msgstr ""
+"До версії 1.3 ST_Expand використовувався разом з <xref linkend=\"ST_Distance"
+"\"/> для виконання індексованих запитів на відстань. Наприклад, <code>geom "
+"&&ST_Expand(“POINT(10 20)”, 10) AND ST_Distance(geom, “POINT(10 20)”)"
+" <10</code>. Це було замінено простішою та ефективнішою функцією <xref "
+"linkend=\"ST_DWithin\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.5.0 behavior changed to output double precision instead of "
+"float4 coordinates."
+msgstr ""
+"Доступність: 1.5.0 поведінка змінена на виведення координат подвійної "
+"точності замість float4."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.3.0 support was added to expand a box by different amounts in "
+"different dimensions."
+msgstr ""
+"Покращено: додано підтримку версії 2.3.0 для розширення поля на різну "
+"величину в різних вимірах."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Examples below use US National Atlas Equal Area (SRID=2163) which is a meter "
+"projection"
+msgstr ""
+"У наведених нижче прикладах використовується карта США National Atlas Equal "
+"Area (SRID=2163), яка є метровою проекцією"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_SRID\"/>"
+msgstr ", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_SRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Aggregate function that returns the bounding box of geometries."
+msgstr "Агрегатна функція, яка повертає обмежувальну рамку геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function that returns a <xref linkend=\"box2d_type\"/> bounding "
+"box that bounds a set of geometries."
+msgstr ""
+"Агрегатна функція, яка повертає обмежувальну рамку <xref linkend=\"box2d_type"
+"\"/>, що обмежує набір геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The bounding box coordinates are in the spatial reference system of the "
+"input geometries."
+msgstr ""
+"Координати обмежувальної рамки знаходяться в просторовій системі координат "
+"вхідних геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Extent is similar in concept to Oracle Spatial/Locator's SDO_AGGR_MBR."
+msgstr ""
+"ST_Extent за своєю концепцією схожий на SDO_AGGR_MBR Oracle Spatial/Locator."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Extent returns boxes with only X and Y ordinates even with 3D geometries. "
+"To return XYZ ordinates use <xref linkend=\"ST_3DExtent\"/>."
+msgstr ""
+"ST_Extent повертає прямокутники тільки з координатами X і Y, навіть для 3D-"
+"геометрій. Щоб повернути координати XYZ, використовуйте <xref linkend="
+"\"ST_3DExtent\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The returned <code>box3d</code> value does not include a SRID. Use <xref "
+"linkend=\"ST_SetSRID\"/> to convert it into a geometry with SRID metadata. "
+"The SRID is the same as the input geometries."
+msgstr ""
+"Повернене значення <code>box3d</code> не містить SRID. Використовуйте <xref "
+"linkend=\"ST_SetSRID\"/>, щоб перетворити його на геометрію з метаданими "
+"SRID. SRID є таким самим, як і вхідні геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Examples below use Massachusetts State Plane ft (SRID=2249)"
+msgstr ""
+"У наведених нижче прикладах використовується система координат штату "
+"Массачусетс (SRID=2249)"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DExtent\"/>, <xref linkend=\"ST_SetSRID\"/>"
+msgstr ", <xref linkend=\"ST_3DExtent\"/>, <xref linkend=\"ST_SetSRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Aggregate function that returns the 3D bounding box of geometries."
+msgstr "Агрегатна функція, яка повертає 3D обмежувальну рамку геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function that returns a <xref linkend=\"box3d_type\"/> "
+"(includes Z ordinate) bounding box that bounds a set of geometries."
+msgstr ""
+"Агрегатна функція, яка повертає обмежувальну рамку <xref linkend=\"box3d_type"
+"\"/>(включає координату Z), що обмежує набір геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 In prior versions this used to be called ST_Extent3D"
+msgstr "Змінено: 2.0.0 У попередніх версіях це називалося ST_Extent3D"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Force_3DZ\"/>, <xref linkend=\"ST_SetSRID\"/>"
+msgstr ", <xref linkend=\"ST_Force_3DZ\"/>, <xref linkend=\"ST_SetSRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a BOX2D defined by two 2D point geometries."
+msgstr "Створює BOX2D, визначений двома 2D точковими геометріями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a <xref linkend=\"box2d_type\"/> defined by two Point geometries. "
+"This is useful for doing range queries."
+msgstr ""
+"Створює <xref linkend=\"box2d_type\"/>, визначений двома геометріями Point. "
+"Це корисно для виконання запитів діапазону."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_SRID\"/>"
+msgstr ", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_SRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a BOX3D defined by two 3D point geometries."
+msgstr "Створює BOX3D, визначений двома геометріями 3D-точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a <xref linkend=\"box3d_type\"/> defined by two 3D Point geometries."
+msgstr ""
+"Створює <xref linkend=\"box3d_type\"/>, визначений двома геометріями 3D "
+"Point."
+
+#. Tag: para
+#, no-c-format
+msgid "This function supports 3D and will not drop the z-index."
+msgstr "Ця функція підтримує 3D і не знижує z-індекс."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 In prior versions this used to be called ST_MakeBox3D"
+msgstr "Змінено: 2.0.0 У попередніх версіях це називалося ST_MakeBox3D"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the X maxima of a 2D or 3D bounding box or a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає X максимум 2D або 3D обмежувальної рамки або "
+"геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the X maxima of a 2D or 3D bounding box or a geometry.</para>"
+msgstr ""
+"<para>Повертає X максимум 2D або 3D обмежувальної рамки або геометрії.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Although this function is only defined for box3d, it also works for box2d "
+"and geometry values due to automatic casting. However, it will not accept a "
+"geometry or box2d text representation, since those do not auto-cast."
+msgstr ""
+"Хоча ця функція визначена тільки для box3d, вона також працює для значень "
+"box2d і geometry завдяки автоматичному перетворенню. Однак вона не приймає "
+"текстове представлення geometry або box2d, оскільки вони не перетворюються "
+"автоматично."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_YMax\"/>, <xref linkend=\"ST_YMin\"/>, <xref "
+"linkend=\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+msgstr ""
+", <xref linkend=\"ST_YMax\"/>, <xref linkend=\"ST_YMin\"/>, <xref linkend="
+"\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the X minima of a 2D or 3D bounding box or a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає мінімальне значення X для 2D або 3D обмежувальної рамки "
+"або геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the X minima of a 2D or 3D bounding box or a geometry.</para>"
+msgstr ""
+"<para>Повертає мінімальне значення X для 2D або 3D обмежувальної рамки або "
+"геометрії.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Although this function is only defined for box3d, it also works for box2d "
+"and geometry values due to automatic casting. However it will not accept a "
+"geometry or box2d text representation, since those do not auto-cast."
+msgstr ""
+"Хоча ця функція визначена тільки для box3d, вона також працює для значень "
+"box2d і geometry завдяки автоматичному перетворенню. Однак вона не приймає "
+"текстове представлення geometry або box2d, оскільки вони не перетворюються "
+"автоматично."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the Y maxima of a 2D or 3D bounding box or a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає максимальне значення Y 2D або 3D обмежувальної рамки "
+"або геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the Y maxima of a 2D or 3D bounding box or a geometry.</para>"
+msgstr ""
+"<para>Повертає максимальне значення Y 2D або 3D обмежувальної рамки або "
+"геометрії.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_XMax\"/>, <xref linkend=\"ST_YMin\"/>, <xref "
+"linkend=\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+msgstr ""
+", <xref linkend=\"ST_XMax\"/>, <xref linkend=\"ST_YMin\"/>, <xref linkend="
+"\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the Y minima of a 2D or 3D bounding box or a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає мінімальне значення Y для 2D або 3D обмежувальної рамки "
+"або геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the Y minima of a 2D or 3D bounding box or a geometry.</para>"
+msgstr ""
+"<para>Повертає мінімальне значення Y 2D або 3D обмежувальної рамки або "
+"геометрії.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_XMin\"/>, <xref linkend=\"ST_XMax\"/>, <xref "
+"linkend=\"ST_YMax\"/>, <xref linkend=\"ST_ZMax\"/>, <xref "
+"linkend=\"ST_ZMin\"/>"
+msgstr ""
+", <xref linkend=\"ST_XMin\"/>, <xref linkend=\"ST_XMax\"/>, <xref linkend="
+"\"ST_YMax\"/>, <xref linkend=\"ST_ZMax\"/>, <xref linkend=\"ST_ZMin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the Z maxima of a 2D or 3D bounding box or a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає максимальне значення Z для 2D або 3D обмежувальної "
+"рамки або геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the Z maxima of a 2D or 3D bounding box or a geometry.</para>"
+msgstr ""
+"<para>Повертає максимальне значення Z для 2D або 3D обмежувальної рамки або "
+"геометрії..</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_XMin\"/>, <xref linkend=\"ST_XMax\"/>, <xref "
+"linkend=\"ST_YMax\"/>, <xref linkend=\"ST_YMin\"/>, <xref "
+"linkend=\"ST_ZMax\"/>"
+msgstr ""
+", <xref linkend=\"ST_XMin\"/>, <xref linkend=\"ST_XMax\"/>, <xref linkend="
+"\"ST_YMax\"/>, <xref linkend=\"ST_YMin\"/>, <xref linkend=\"ST_ZMax\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the Z minima of a 2D or 3D bounding box or a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає мінімальне значення Z для 2D або 3D обмежувальної рамки "
+"або геометрії.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the Z minima of a 2D or 3D bounding box or a geometry.</para>"
+msgstr ""
+"<para>Повертає мінімальне значення Z 2D- або 3D-обмежувальної рамки або "
+"геометрії.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_XMin\"/>, <xref "
+"linkend=\"ST_XMax\"/>, <xref linkend=\"ST_YMax\"/>, <xref "
+"linkend=\"ST_YMin\"/>, <xref linkend=\"ST_ZMax\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_XMin\"/>, <xref "
+"linkend=\"ST_XMax\"/>, <xref linkend=\"ST_YMax\"/>, <xref linkend=\"ST_YMin\""
+"/>, <xref linkend=\"ST_ZMax\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Clustering Functions"
+msgstr "Функції кластеризації"
+
+#. Tag: para
+#, no-c-format
+msgid "These functions implement clustering algorithms for sets of geometries."
+msgstr "Ці функції реалізують алгоритми кластеризації для наборів геометрій."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Window function that returns a cluster id for each input geometry using the "
+"DBSCAN algorithm."
+msgstr ""
+"Функція вікна, яка повертає ідентифікатор кластера для кожної вхідної "
+"геометрії за допомогою алгоритму DBSCAN."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A window function that returns a cluster number for each input geometry, "
+"using the 2D <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"DBSCAN\">Density-based spatial clustering of applications with noise "
+"(DBSCAN)</link> algorithm. Unlike <xref linkend=\"ST_ClusterKMeans\"/>, it "
+"does not require the number of clusters to be specified, but instead uses "
+"the desired <link linkend=\"ST_Distance\">distance</link> (<varname>eps</"
+"varname>) and density (<varname>minpoints</varname>) parameters to determine "
+"each cluster."
+msgstr ""
+"Віконна функція, яка повертає номер кластера для кожної вхідної геометрії, "
+"використовуючи 2D <link xlink:href=\"https://en.wikipedia.org/wiki/DBSCAN\""
+">алгоритм просторового кластеризації додатків на основі щільності з шумом "
+"(DBSCAN)</link>. На відміну від <xref linkend=\"ST_ClusterKMeans\"/>, вона "
+"не вимагає вказання кількості кластерів, а замість цього використовує бажані "
+"параметри <link linkend=\"ST_Distance\">відстань</link> "
+"(<varname>eps</varname>) та щільність (<varname>minpoints</varname>) для "
+"визначення кожного кластера."
+
+#. Tag: para
+#, no-c-format
+msgid "An input geometry is added to a cluster if it is either:"
+msgstr "Геометрія входу додається до кластера, якщо вона:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A \"core\" geometry, that is within <varname>eps</varname> <link "
+"linkend=\"ST_Distance\">distance</link> of at least <varname>minpoints</"
+"varname> input geometries (including itself); or"
+msgstr ""
+"\"Основна\" геометрія, яка знаходиться в межах <varname>eps</varname> <link "
+"linkend=\"ST_Distance\">відстань</link> щонайменше <varname>minpoints</"
+"varname> вхідних геометрій (включно з самою собою); або"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A \"border\" geometry, that is within <varname>eps</varname> <link "
+"linkend=\"ST_Distance\">distance</link> of a core geometry."
+msgstr ""
+"Геометрія \"border\", що знаходиться в межах <varname>eps</varname> <link "
+"linkend=\"ST_Distance\">відстань</link> від геометрії ядра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that border geometries may be within <varname>eps</varname> distance of "
+"core geometries in more than one cluster. Either assignment would be "
+"correct, so the border geometry will be arbitrarily assigned to one of the "
+"available clusters. In this situation it is possible for a correct cluster "
+"to be generated with fewer than <varname>minpoints</varname> geometries. To "
+"ensure deterministic assignment of border geometries (so that repeated calls "
+"to ST_ClusterDBSCAN will produce identical results) use an <code>ORDER BY</"
+"code> clause in the window definition. Ambiguous cluster assignments may "
+"differ from other DBSCAN implementations."
+msgstr ""
+"Зверніть увагу, що геометрії меж можуть знаходитися на відстані "
+"<varname>eps</varname> від геометрій ядра в більш ніж одному кластері. Будь-"
+"яке призначення буде правильним, тому геометрія межі буде довільно "
+"призначена одному з доступних кластерів. У цій ситуації можливе створення "
+"правильного кластера з меншою кількістю геометрій, ніж <varname>minpoints</"
+"varname>. Щоб забезпечити детермінований прив'язку геометрій меж (так, щоб "
+"повторні виклики ST_ClusterDBSCAN давали однакові результати), "
+"використовуйте оператор <code>ORDER BY</code> у визначенні вікна. "
+"Неоднозначні прив'язки кластерів можуть відрізнятися від інших реалізацій "
+"DBSCAN."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometries that do not meet the criteria to join any cluster are assigned a "
+"cluster number of NULL."
+msgstr ""
+"Геометріям, які не відповідають критеріям для приєднання до будь-якого "
+"кластера, присвоюється номер кластера NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Clustering polygon within 50 meters of each other, and requiring at least 2 "
+"polygons per cluster."
+msgstr ""
+"Групування полігонів на відстані 50 метрів один від одного, при цьому в "
+"кожній групі має бути не менше 2 полігонів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Clusters within 50 meters with at least 2 items per cluster. Singletons have "
+"NULL for cid"
+msgstr ""
+"Кластери в межах 50 метрів з щонайменше 2 елементами в кожному кластері. "
+"Одиночні елементи мають NULL для cid"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A example showing combining parcels with the same cluster number into "
+"geometry collections."
+msgstr ""
+"Приклад об'єднання ділянок з однаковим номером кластера в геометричні "
+"колекції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClusterKMeans\"/>, <xref "
+"linkend=\"ST_ClusterIntersecting\"/>, <xref "
+"linkend=\"ST_ClusterIntersectingWin\"/>, <xref linkend=\"ST_ClusterWithin\"/"
+">, <xref linkend=\"ST_ClusterWithinWin\"/>"
+msgstr ""
+", <xref linkend=\"ST_ClusterKMeans\"/>, <xref linkend="
+"\"ST_ClusterIntersecting\"/>, <xref linkend=\"ST_ClusterIntersectingWin\"/>, "
+"<xref linkend=\"ST_ClusterWithin\"/>, <xref linkend=\"ST_ClusterWithinWin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Aggregate function that clusters input geometries into connected sets."
+msgstr "Агрегуюча функція, яка групує вхідні геометрії у зв'язані набори."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function that returns an array of GeometryCollections "
+"partitioning the input geometries into connected clusters that are disjoint. "
+"Each geometry in a cluster intersects at least one other geometry in the "
+"cluster, and does not intersect any geometry in other clusters."
+msgstr ""
+"Агрегатна функція, яка повертає масив GeometryCollections, розділяючи вхідні "
+"геометрії на з'єднані кластери, які не перетинаються. Кожна геометрія в "
+"кластері перетинається принаймні з однією іншою геометрією в кластері і не "
+"перетинається з жодною геометрією в інших кластерах."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClusterWithin\"/>, <xref "
+"linkend=\"ST_ClusterWithinWin\"/>"
+msgstr ""
+", <xref linkend=\"ST_ClusterWithin\"/>, <xref linkend=\"ST_ClusterWithinWin\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Window function that returns a cluster id for each input geometry, "
+"clustering input geometries into connected sets."
+msgstr ""
+"Віконна функція, яка повертає ідентифікатор кластера для кожної вхідної "
+"геометрії, групуючи вхідні геометрії у пов'язані набори."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A window function that builds connected clusters of geometries that "
+"intersect. It is possible to traverse all geometries in a cluster without "
+"leaving the cluster. The return value is the cluster number that the "
+"geometry argument participates in, or null for null inputs."
+msgstr ""
+"Віконна функція, яка будує з'єднані кластери геометрій, що перетинаються. "
+"Можна пройти всі геометрії в кластері, не виходячи з нього. Повертається "
+"номер кластера, до якого належить аргумент геометрії, або null для нульових "
+"вхідних даних."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Window function that returns a cluster id for each input geometry using the "
+"K-means algorithm."
+msgstr ""
+"Віконна функція, яка повертає ідентифікатор кластера для кожної вхідної "
+"геометрії за допомогою алгоритму K-means."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <link xlink:href=\"https://en.wikipedia.org/wiki/K-"
+"means_clustering\">K-means</link> cluster number for each input geometry. "
+"The distance used for clustering is the distance between the centroids for "
+"2D geometries, and distance between bounding box centers for 3D geometries. "
+"For POINT inputs, M coordinate will be treated as weight of input and has to "
+"be larger than 0."
+msgstr ""
+"Повертає <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"K-means_clustering\">K-means</link> номер кластера для кожної вхідної "
+"геометрії. Відстань, що використовується для кластеризації, - це відстань "
+"між центроїдами для 2D-геометрій і відстань між центрами обмежувальних рамок "
+"для 3D-геометрій. Для вхідних даних POINT координата M буде розглядатися як "
+"вага вхідних даних і повинна бути більшою за 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>max_radius</varname>, if set, will cause ST_ClusterKMeans to "
+"generate more clusters than <varname>k</varname> ensuring that no cluster in "
+"output has radius larger than <varname>max_radius</varname>. This is useful "
+"in reachability analysis."
+msgstr ""
+"<varname>max_radius</varname>, якщо встановлено, змусить ST_ClusterKMeans "
+"генерувати більше кластерів, ніж <varname>k</varname>, гарантуючи, що жоден "
+"кластер у вихідних даних не матиме радіус, більший за <varname>max_radius</"
+"varname>. Це корисно для аналізу доступності."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.2.0 Support for <varname>max_radius</varname>"
+msgstr "Покращено: 3.2.0 Підтримка <varname>max_radius</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.1.0 Support for 3D geometries and weights"
+msgstr "Покращено: 3.1.0 Підтримка 3D-геометрії та ваги"
+
+#. Tag: para
+#, no-c-format
+msgid "Generate dummy set of parcels for examples:"
+msgstr "Створити фіктивний набір посилок для прикладів:"
+
+#. Tag: para
+#, no-c-format
+msgid "Parcels color-coded by cluster number (cid)"
+msgstr "Пакунки, позначені кольором за номером кластера (cid)"
+
+#. Tag: para
+#, no-c-format
+msgid "Partitioning parcel clusters by type:"
+msgstr "Розподіл кластерів ділянок за типом:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example: Clustering a preaggregated planetary-scale data population dataset "
+"using 3D clusering and weighting. Identify at least 20 regions based on "
+"<link xlink:href=\"https://data.humdata.org/dataset/kontur-population-"
+"dataset\">Kontur Population Data</link> that do not span more than 3000 km "
+"from their center:"
+msgstr ""
+"Приклад: Кластеризація попередньо агрегованого набору даних про населення "
+"планетарного масштабу за допомогою 3D-кластеризації та зважування. Визначте "
+"щонайменше 20 регіонів на основі <link xlink:href=\"https://data.humdata.org/"
+"dataset/kontur-population-dataset\">даних про населення Kontur</link>, які не "
+"простягаються більше ніж на 3000 км від їхнього центру:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"World population clustered to above specs produces 46 clusters. Clusters are "
+"centered at well-populated regions (New York, Moscow). Greenland is one "
+"cluster. There are island clusters that span across the antimeridian. "
+"Cluster edges follow Earth's curvature."
+msgstr ""
+"Населення світу, скупчене вище зазначених показників, утворює 46 кластерів. "
+"Кластери зосереджені в густонаселених регіонах (Нью-Йорк, Москва). "
+"Гренландія є одним кластером. Існують острівні кластери, що простягаються "
+"через антимеридіан. Краї кластерів повторюють кривизну Землі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClusterIntersectingWin\"/>, <xref "
+"linkend=\"ST_ClusterWithinWin\"/>, <xref linkend=\"ST_ClusterIntersecting\"/"
+">, <xref linkend=\"ST_ClusterWithin\"/>, <xref linkend=\"ST_Subdivide\"/>, "
+"<xref linkend=\"ST_Force_3D\"/>, <xref linkend=\"ST_Force_4D\"/>,"
+msgstr ""
+", <xref linkend=\"ST_ClusterIntersectingWin\"/>, <xref linkend="
+"\"ST_ClusterWithinWin\"/>, <xref linkend=\"ST_ClusterIntersecting\"/>, <xref "
+"linkend=\"ST_ClusterWithin\"/>, <xref linkend=\"ST_Subdivide\"/>, <xref "
+"linkend=\"ST_Force_3D\"/>, <xref linkend=\"ST_Force_4D\"/>,"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Aggregate function that clusters geometries by separation distance."
+msgstr "Агрегатна функція, яка групує геометрії за відстанню розділення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function that returns an array of GeometryCollections, where "
+"each collection is a cluster containing some input geometries. Clustering "
+"partitions the input geometries into sets in which each geometry is within "
+"the specified <parameter>distance</parameter> of at least one other geometry "
+"in the same cluster. Distances are Cartesian distances in the units of the "
+"SRID."
+msgstr ""
+"Агрегатна функція, яка повертає масив GeometryCollections, де кожна колекція "
+"є кластером, що містить деякі вхідні геометрії. Кластеризація розділяє "
+"вхідні геометрії на набори, в яких кожна геометрія знаходиться в межах "
+"заданої <parameter>відстані</parameter> від принаймні однієї іншої геометрії "
+"в тому самому кластері. Відстані є декартовими відстанями в одиницях SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_ClusterWithin is equivalent to running <xref linkend=\"ST_ClusterDBSCAN\"/"
+"> with <code>minpoints => 0</code>."
+msgstr ""
+"ST_ClusterWithin еквівалентний виконанню <xref linkend=\"ST_ClusterDBSCAN\"/"
+"> з <code>minpoints => 0</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClusterDBSCAN\"/>, <xref "
+"linkend=\"ST_ClusterIntersecting\"/>, <xref "
+"linkend=\"ST_ClusterIntersectingWin\"/>"
+msgstr ""
+", <xref linkend=\"ST_ClusterDBSCAN\"/>, <xref linkend="
+"\"ST_ClusterIntersecting\"/>, <xref linkend=\"ST_ClusterIntersectingWin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Window function that returns a cluster id for each input geometry, "
+"clustering using separation distance."
+msgstr ""
+"Віконна функція, яка повертає ідентифікатор кластера для кожної вхідної "
+"геометрії, кластеризуючи за відстанню розділення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A window function that returns a cluster number for each input geometry. "
+"Clustering partitions the geometries into sets in which each geometry is "
+"within the specified <varname>distance</varname> of at least one other "
+"geometry in the same cluster. Distances are Cartesian distances in the units "
+"of the SRID."
+msgstr ""
+"Віконна функція, яка повертає номер кластера для кожної вхідної геометрії. "
+"Кластеризація розділяє геометрії на набори, в яких кожна геометрія "
+"знаходиться в межах заданої відстані <varname>distance</varname> від "
+"принаймні однієї іншої геометрії в тому самому кластері. Відстані є "
+"декартовими відстанями в одиницях SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_ClusterWithinWin is equivalent to running <xref "
+"linkend=\"ST_ClusterDBSCAN\"/> with <code>minpoints => 0</code>."
+msgstr ""
+"ST_ClusterWithinWin еквівалентно виконанню <xref linkend=\"ST_ClusterDBSCAN\""
+"/> з <code>minpoints => 0</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClusterDBSCAN\"/>, <xref "
+"linkend=\"ST_ClusterIntersecting\"/>, <xref "
+"linkend=\"ST_ClusterIntersectingWin\"/>,"
+msgstr ""
+", <xref linkend=\"ST_ClusterDBSCAN\"/>, <xref linkend="
+"\"ST_ClusterIntersecting\"/>, <xref linkend=\"ST_ClusterIntersectingWin\"/>,"
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Constructors"
+msgstr "Конструктори геометрії"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a GeometryCollection or Multi* geometry from a set of geometries."
+msgstr "Створює GeometryCollection або Multi* геометрію з набору геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Collects geometries into a geometry collection. The result is either a "
+"Multi* or a GeometryCollection, depending on whether the input geometries "
+"have the same or different types (homogeneous or heterogeneous). The input "
+"geometries are left unchanged within the collection."
+msgstr ""
+"Збирає геометрії в колекцію геометрій. Результатом є або Multi*, або "
+"GeometryCollection, залежно від того, чи мають вхідні геометрії однаковий "
+"або різний тип (однорідні або неоднорідні). Вхідні геометрії залишаються "
+"незмінними в колекції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 1:</emphasis> accepts two input geometries"
+msgstr ""
+"<emphasis role=\"bold\">Варіант 1:</emphasis> приймає дві вхідні геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 2:</emphasis> accepts an array of geometries"
+msgstr "<emphasis role=\"bold\">Варіант 2:</emphasis> приймає масив геометрій"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 3:</emphasis> aggregate function accepting a "
+"rowset of geometries."
+msgstr ""
+"<emphasis role=\"bold\">Варіант 3:</emphasis> агрегатна функція, що приймає "
+"набір рядків геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any of the input geometries are collections (Multi* or "
+"GeometryCollection) ST_Collect returns a GeometryCollection (since that is "
+"the only type which can contain nested collections). To prevent this, use "
+"<xref linkend=\"ST_Dump\"/> in a subquery to expand the input collections to "
+"their atomic elements (see example below)."
+msgstr ""
+"Якщо будь-яка з вхідних геометрій є колекцією (Multi* або GeometryCollection)"
+", ST_Collect повертає GeometryCollection (оскільки це єдиний тип, який може "
+"містити вкладені колекції). Щоб цього уникнути, використовуйте <xref linkend="
+"\"ST_Dump\"/>у підзапиті, щоб розгорнути вхідні колекції до їхніх атомних "
+"елементів (див. приклад нижче)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Collect and <xref linkend=\"ST_Union\"/> appear similar, but in fact "
+"operate quite differently. ST_Collect aggregates geometries into a "
+"collection without changing them in any way. ST_Union geometrically merges "
+"geometries where they overlap, and splits linestrings at intersections. It "
+"may return single geometries when it dissolves boundaries."
+msgstr ""
+"ST_Collect і <xref linkend=\"ST_Union\"/> виглядають схожими, але насправді "
+"працюють зовсім по-різному. ST_Collect об'єднує геометрії в колекцію, не "
+"змінюючи їх жодним чином. ST_Union геометрично об'єднує геометрії в місцях "
+"їх перетину і розділяє лінії в точках перетину. При розчиненні меж може "
+"повертати окремі геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.4.0 - ST_Collect(geomarray) was introduced. ST_Collect was "
+"enhanced to handle more geometries faster."
+msgstr ""
+"Доступність: 1.4.0 — додано ST_Collect(geomarray). ST_Collect було "
+"вдосконалено для швидшої обробки більшої кількості геометрій."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples - Two-input variant"
+msgstr "Приклади - Варіант з двома входами"
+
+#. Tag: para
+#, no-c-format
+msgid "Collect 2D points."
+msgstr "Збір 2D точок."
+
+#. Tag: para
+#, no-c-format
+msgid "Collect 3D points."
+msgstr "Збір 3D-точок."
+
+#. Tag: para
+#, no-c-format
+msgid "Collect curves."
+msgstr "Збір кривих."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples - Array variant"
+msgstr "Приклади - Варіант масиву"
+
+#. Tag: para
+#, no-c-format
+msgid "Using an array constructor for a subquery."
+msgstr "Використання конструктора масиву для підзапиту."
+
+#. Tag: para
+#, no-c-format
+msgid "Using an array constructor for values."
+msgstr "Використання конструктора масиву для значень."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples - Aggregate variant"
+msgstr "Приклади - Агрегований варіант"
+
+#. Tag: para
+#, no-c-format
+msgid "Creating multiple collections by grouping geometries in a table."
+msgstr "Створення декількох колекцій шляхом групування геометрій у таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Union\"/>"
+msgstr ", <xref linkend=\"ST_Union\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Creates a LineString from a MultiPoint geometry.</refpurpose>"
+msgstr "<refpurpose>Створює LineString з геометрії MultiPoint.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Creates a LineString from a MultiPoint geometry.</para>"
+msgstr "<para>Створює LineString з геометрії MultiPoint.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use <xref linkend=\"ST_MakeLine\"/> to create lines from Point or LineString "
+"inputs."
+msgstr ""
+"Використовуйте <xref linkend=\"ST_MakeLine\"/> для створення ліній з вхідних "
+"даних Point або LineString."
+
+#. Tag: para
+#, no-c-format
+msgid "Create a 3D line string from a 3D MultiPoint"
+msgstr "Створити 3D лінію з 3D MultiPoint"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_MakeLine\"/>"
+msgstr ", <xref linkend=\"ST_MakeLine\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a rectangular Polygon from minimum and maximum coordinates."
+msgstr "Створює прямокутний полігон з мінімальних і максимальних координат."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a rectangular Polygon from the minimum and maximum values for X and "
+"Y. Input values must be in the spatial reference system specified by the "
+"SRID. If no SRID is specified the unknown spatial reference system (SRID 0) "
+"is used."
+msgstr ""
+"Створює прямокутний полігон з мінімальних і максимальних значень для X і Y. "
+"Вхідні значення повинні бути в просторовій системі координат, визначеній "
+"SRID. Якщо SRID не вказано, використовується невідома просторова система "
+"координат (SRID 0)."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5"
+msgstr "Доступність: 1.5"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0: Ability to specify an envelope without specifying an SRID was "
+"introduced."
+msgstr "Покращено: 2.0: Додано можливість вказати конверт без вказання SRID."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Building a bounding box polygon"
+msgstr "Приклад: Побудова полігону обмежувальної рамки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MakeLine\"/>, <xref linkend=\"ST_MakePolygon\"/>, <xref "
+"linkend=\"ST_TileEnvelope\"/>"
+msgstr ""
+", <xref linkend=\"ST_MakeLine\"/>, <xref linkend=\"ST_MakePolygon\"/>, <xref "
+"linkend=\"ST_TileEnvelope\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a LineString from Point, MultiPoint, or LineString geometries."
+msgstr "Створює LineString з геометрій Point, MultiPoint або LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a LineString containing the points of Point, MultiPoint, or "
+"LineString geometries. Other geometry types cause an error."
+msgstr ""
+"Створює об'єкт LineString, що містить точки геометрій Point, MultiPoint або "
+"LineString. Інші типи геометрії спричиняють помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 3:</emphasis> aggregate function accepting a "
+"rowset of geometries. To ensure the order of the input geometries use "
+"<varname>ORDER BY</varname> in the function call, or a subquery with an "
+"<varname>ORDER BY</varname> clause."
+msgstr ""
+"<emphasis role=\"bold\">Варіант 3:</emphasis> агрегатна функція, що приймає "
+"набір рядків геометрій. Щоб забезпечити порядок вхідних геометрій, "
+"використовуйте <varname>ORDER BY</varname> у виклику функції або підзапит із "
+"розділом <varname>ORDER BY</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Repeated nodes at the beginning of input LineStrings are collapsed to a "
+"single point. Repeated points in Point and MultiPoint inputs are not "
+"collapsed. <xref linkend=\"ST_RemoveRepeatedPoints\"/> can be used to "
+"collapse repeated points from the output LineString."
+msgstr ""
+"Повторювані вузли на початку вхідних рядків LineStrings об'єднуються в одну "
+"точку. Повторювані точки у вхідних даних Point і MultiPoint не об'єднуються. "
+"<xref linkend=\"ST_RemoveRepeatedPoints\"/>можна використовувати для "
+"об'єднання повторюваних точок з вихідної лінії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 2.3.0 - Support for MultiPoint input elements was introduced"
+msgstr "Доступність: 2.3.0 — додано підтримку елементів введення MultiPoint"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 2.0.0 - Support for LineString input elements was introduced"
+msgstr "Доступність: 2.0.0 - Додано підтримку елементів введення LineString"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.4.0 - ST_MakeLine(geomarray) was introduced. ST_MakeLine "
+"aggregate functions was enhanced to handle more points faster."
+msgstr ""
+"Доступність: 1.4.0 — додано ST_MakeLine(geomarray). Агрегатні функції "
+"ST_MakeLine було вдосконалено для швидшої обробки більшої кількості точок."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Two-input variant"
+msgstr "Приклади: Варіант з двома входами"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a line composed of two points."
+msgstr "Створити лінію, що складається з двох точок."
+
+#. Tag: para
+#, no-c-format
+msgid "Create a 3D line from two 3D points."
+msgstr "Створити 3D лінію з двох 3D точок."
+
+#. Tag: para
+#, no-c-format
+msgid "Create a line from two disjoint LineStrings."
+msgstr "Створити лінію з двох роз'єднаних LineStrings."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Array variant"
+msgstr "Приклади: Варіант масиву"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a line from an array formed by a subquery with ordering."
+msgstr "Створити лінію з масиву, сформованого підзапитом із сортуванням."
+
+#. Tag: para
+#, no-c-format
+msgid "Create a 3D line from an array of 3D points"
+msgstr "Створити 3D лінію з масиву 3D точок"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Aggregate variant"
+msgstr "Приклади: Агрегований варіант"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This example queries time-based sequences of GPS points from a set of tracks "
+"and creates one record for each track. The result geometries are LineStrings "
+"composed of the GPS track points in the order of travel."
+msgstr ""
+"У цьому прикладі запитуються послідовності точок GPS за часом із набору "
+"треків і створюється один запис для кожного треку. Результатом є геометрії "
+"LineStrings, що складаються з точок треку GPS у порядку руху."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using aggregate <varname>ORDER BY</varname> provides a correctly-ordered "
+"LineString."
+msgstr ""
+"Використання агрегату <varname>ORDER BY</varname> забезпечує правильний "
+"порядок LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior to PostgreSQL 9, ordering in a subquery can be used. However, "
+"sometimes the query plan may not respect the order of the subquery."
+msgstr ""
+"До PostgreSQL 9 можна було використовувати сортування в підзапиті. Однак "
+"іноді план запиту може не дотримуватися порядку підзапиту."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsEWKT\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_MakePoint\"/>, <xref "
+"linkend=\"ST_Point\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsEWKT\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_MakePoint\"/>, <xref "
+"linkend=\"ST_Point\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a 2D, 3DZ or 4D Point."
+msgstr "Створює 2D, 3DZ або 4D точку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a 2D XY, 3D XYZ or 4D XYZM Point geometry. Use <xref "
+"linkend=\"ST_MakePointM\"/> to make points with XYM coordinates."
+msgstr ""
+"Створює геометрію точки 2D XY, 3D XYZ або 4D XYZM. Використовуйте <xref "
+"linkend=\"ST_MakePointM\"/>, щоб створити точки з координатами XYM."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use <xref linkend=\"ST_SetSRID\"/> to specify a SRID for the created point."
+msgstr ""
+"Використовуйте <xref linkend=\"ST_SetSRID\"/>, щоб вказати SRID для "
+"створеної точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"While not OGC-compliant, <varname>ST_MakePoint</varname> is faster than "
+"<xref linkend=\"ST_GeomFromText\"/> and <xref linkend=\"ST_PointFromText\"/"
+">. It is also easier to use for numeric coordinate values."
+msgstr ""
+"Хоча <varname>ST_MakePoint</varname> не відповідає стандарту OGC, він працює "
+"швидше, ніж <xref linkend=\"ST_GeomFromText\"/> та <xref linkend="
+"\"ST_PointFromText\"/>. Він також простіший у використанні для числових "
+"значень координат."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geodetic coordinates, <varname>X</varname> is longitude and <varname>Y</"
+"varname> is latitude"
+msgstr ""
+"Для геодезичних координат <varname>X</varname> є довготою, а <varname>Y</"
+"varname> — широтою"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointZ\"/>, "
+"<xref linkend=\"ST_PointM\"/>, and <xref linkend=\"ST_PointZM\"/> can be "
+"used to create points with a given SRID."
+msgstr ""
+"Функції <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointZ\"/>, <xref "
+"linkend=\"ST_PointM\"/> та <xref linkend=\"ST_PointZM\"/> можна "
+"використовувати для створення точок із заданим SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_PointFromText\"/>, <xref linkend=\"ST_SetSRID\"/>, "
+"<xref linkend=\"ST_MakePointM\"/>, <xref linkend=\"ST_Point\"/>, <xref "
+"linkend=\"ST_PointZ\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZM\"/>"
+msgstr ""
+", <xref linkend=\"ST_PointFromText\"/>, <xref linkend=\"ST_SetSRID\"/>, "
+"<xref linkend=\"ST_MakePointM\"/>, <xref linkend=\"ST_Point\"/>, <xref "
+"linkend=\"ST_PointZ\"/>, <xref linkend=\"ST_PointM\"/>, <xref linkend="
+"\"ST_PointZM\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Point from X, Y and M values."
+msgstr "Створює точку з значень X, Y та M."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a point with X, Y and M (measure) ordinates. Use <xref "
+"linkend=\"ST_MakePoint\"/> to make points with XY, XYZ, or XYZM coordinates."
+msgstr ""
+"Створює точку з координатами X, Y та M (вимірювання). Використовуйте <xref "
+"linkend=\"ST_MakePoint\"/>, щоб створити точки з координатами XY, XYZ або "
+"XYZM."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions <xref linkend=\"ST_PointM\"/>, and <xref "
+"linkend=\"ST_PointZM\"/> can be used to create points with an M value and a "
+"given SRID."
+msgstr ""
+"Функції <xref linkend=\"ST_PointM\"/> та <xref linkend=\"ST_PointZM\"/> "
+"можна використовувати для створення точок із значенням M та заданим SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is used for text output because <xref linkend=\"ST_AsText\"/> does not "
+"support M values."
+msgstr ""
+"використовується для виведення тексту, оскільки <xref linkend=\"ST_AsText\"/"
+">не підтримує значення M."
+
+#. Tag: para
+#, no-c-format
+msgid "Create point with unknown SRID."
+msgstr "Створити точку з невідомим SRID."
+
+#. Tag: para
+#, no-c-format
+msgid "Create point with a measure in the WGS 84 geodetic coordinate system."
+msgstr "Створити точку з виміром у геодезичній системі координат WGS 84."
+
+#. Tag: para
+#, no-c-format
+msgid "Get measure of created point."
+msgstr "Отримати розмір створеної точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZM\"/>"
+msgstr ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZM\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Polygon from a shell and optional list of holes."
+msgstr "Створює полігон з оболонки та опціонального списку отворів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a Polygon formed by the given shell and optional array of holes. "
+"Input geometries must be closed LineStrings (rings)."
+msgstr ""
+"Створює полігон, утворений заданою оболонкою та опціональним масивом "
+"отворів. Вхідні геометрії повинні бути закритими лініями (кільцями)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 1:</emphasis> Accepts one shell LineString."
+msgstr ""
+"<emphasis role=\"bold\">Варіант 1:</emphasis> Приймає оболонку LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 2:</emphasis> Accepts a shell LineString and "
+"an array of inner (hole) LineStrings. A geometry array can be constructed "
+"using the PostgreSQL array_agg(), ARRAY[] or ARRAY() constructs."
+msgstr ""
+"<emphasis role=\"bold\">Варіант 2:</emphasis> Приймає оболонку LineString та "
+"масив внутрішніх (діркових) LineStrings. Масив геометрії можна побудувати за "
+"допомогою конструкцій PostgreSQL array_agg(), ARRAY[] або ARRAY()."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not accept MultiLineStrings. Use <xref "
+"linkend=\"ST_LineMerge\"/> to generate a LineString, or <xref "
+"linkend=\"ST_Dump\"/> to extract LineStrings."
+msgstr ""
+"Ця функція не приймає MultiLineStrings. Використовуйте <xref linkend="
+"\"ST_LineMerge\"/>для створення LineString або <xref linkend=\"ST_Dump\"/"
+">для вилучення LineStrings."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Single input variant"
+msgstr "Приклади: Варіант з одним входом"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a Polygon from a 2D LineString."
+msgstr "Створити полігон з 2D LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a Polygon from an open LineString, using <xref "
+"linkend=\"ST_StartPoint\"/> and <xref linkend=\"ST_AddPoint\"/> to close it."
+msgstr ""
+"Створіть полігон з відкритої лінії, використовуючи <xref linkend="
+"\"ST_StartPoint\"/>та <xref linkend=\"ST_AddPoint\"/>для його закриття."
+
+#. Tag: para
+#, no-c-format
+msgid "Create a Polygon from a 3D LineString"
+msgstr "Створіть полігон із 3D-лінії"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a Polygon from a LineString with measures"
+msgstr "Створює полігон з лінії з вимірами"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Outer shell with inner holes variant"
+msgstr "Приклади: Зовнішня оболонка з внутрішніми отворами"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a donut Polygon with an extra hole"
+msgstr "Створити полігон у формі пончика з додатковим отвором"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a set of province boundaries with holes representing lakes. The input "
+"is a table of province Polygons/MultiPolygons and a table of water "
+"linestrings. Lines forming lakes are determined by using <xref "
+"linkend=\"ST_IsClosed\"/>. The province linework is extracted by using <xref "
+"linkend=\"ST_Boundary\"/>. As required by <code>ST_MakePolygon</code>, the "
+"boundary is forced to be a single LineString by using <xref "
+"linkend=\"ST_LineMerge\"/>. (However, note that if a province has more than "
+"one region or has islands this will produce an invalid polygon.) Using a "
+"LEFT JOIN ensures all provinces are included even if they have no lakes."
+msgstr ""
+"Створити набір меж провінцій з отворами, що позначають озера. Вхідними "
+"даними є таблиця полігонів/мультиполігонів провінцій та таблиця лінійних "
+"об'єктів, що позначають водойми. Лінії, що утворюють озера, визначаються за "
+"допомогою <xref linkend=\"ST_IsClosed\"/>. Лінії провінцій витягуються за "
+"допомогою <xref linkend=\"ST_Boundary\"/>. Відповідно до вимог "
+"<code>ST_MakePolygon</code>, межа примусово перетворюється на єдину лінію за "
+"допомогою <xref linkend=\"ST_LineMerge\"/>. (Однак, зверніть увагу, що якщо "
+"провінція має більше одного регіону або має острови, це призведе до "
+"створення недійсного полігону.) Використання LEFT JOIN гарантує, що всі "
+"провінції будуть включені, навіть якщо вони не мають озер."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The CASE construct is used because passing a null array into ST_MakePolygon "
+"results in a NULL return value."
+msgstr ""
+"Конструкція CASE використовується, оскільки передача нульового масиву в "
+"ST_MakePolygon призводить до повернення значення NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Another technique is to utilize a correlated subquery and the ARRAY() "
+"constructor that converts a row set to an array."
+msgstr ""
+"Інший метод полягає у використанні корельованого підзапиту та конструктора "
+"ARRAY(), який перетворює набір рядків у масив."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Point with X, Y and SRID values."
+msgstr "Створює точку із значеннями X, Y та SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a Point with the given X and Y coordinate values. This is the SQL-MM "
+"equivalent for <xref linkend=\"ST_MakePoint\"/> that takes just X and Y."
+msgstr ""
+"Повертає точку з заданими значеннями координат X та Y. Це еквівалент SQL-MM "
+"для <xref linkend=\"ST_MakePoint\"/>, який приймає тільки X та Y."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.2.0 srid as an extra optional argument was added. Older installs "
+"require combining with ST_SetSRID to mark the srid on the geometry."
+msgstr ""
+"Покращено: 3.2.0 Додано srid як додатковий опціональний аргумент. Старіші "
+"версії вимагають поєднання з ST_SetSRID для позначення srid на геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 6.1.2"
+msgstr "&sqlmm_compliant; SQL-MM 3: 6.1.2"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Geometry"
+msgstr "Приклади: Геометрія"
+
+#. Tag: para
+#, no-c-format
+msgid "Creating a point with SRID specified:"
+msgstr "Створення точки із зазначеним SRID:"
+
+#. Tag: para
+#, no-c-format
+msgid "Alternative way of specifying SRID:"
+msgstr "Альтернативний спосіб вказати SRID:"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Geography"
+msgstr "Приклади: Географія"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create <link linkend=\"PostGIS_Geography\">geography</link> points using the "
+"<varname>::</varname> cast syntax:"
+msgstr ""
+"Створіть точки <link linkend=\"PostGIS_Geography\">географії</link> за "
+"допомогою синтаксису перетворення <varname>::</varname>:"
+
+#. Tag: para
+#, no-c-format
+msgid "Pre-PostGIS 3.2 code, using <varname>CAST</varname>:"
+msgstr "Код до PostGIS 3.2, що використовує <varname>CAST</varname>:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the point coordinates are not in a geodetic coordinate system (such as "
+"WGS84), then they must be reprojected before casting to a geography. In this "
+"example a point in Pennsylvania State Plane feet (SRID 2273) is projected to "
+"WGS84 (SRID 4326)."
+msgstr ""
+"Якщо координати точки не знаходяться в геодезичній системі координат (такій "
+"як WGS84), то перед перенесенням в географічну систему їх необхідно "
+"перепроектувати. У цьому прикладі точка в системі координат Pennsylvania "
+"State Plane feet (SRID 2273) перепроектована в систему WGS84 (SRID 4326)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_PointZ\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZM\"/>, <xref linkend=\"ST_SetSRID\"/>, <xref "
+"linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_PointZ\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZM\"/>, <xref linkend=\"ST_SetSRID\"/>, <xref linkend="
+"\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Point with X, Y, Z and SRID values."
+msgstr "Створює точку з координатами X, Y, Z та значенням SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an Point with the given X, Y and Z coordinate values, and optionally "
+"an SRID number."
+msgstr ""
+"Повертає точку з заданими значеннями координат X, Y і Z, а також, за "
+"бажанням, номер SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZM\"/>"
+msgstr ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointM\"/>, <xref linkend="
+"\"ST_PointZM\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Point with X, Y, M and SRID values."
+msgstr "Створює точку з значеннями X, Y, M та SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an Point with the given X, Y and M coordinate values, and optionally "
+"an SRID number."
+msgstr ""
+"Повертає точку з заданими значеннями координат X, Y і M, а також, за "
+"бажанням, номер SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointZ\"/>, <xref "
+"linkend=\"ST_PointZM\"/>"
+msgstr ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointZ\"/>, <xref linkend="
+"\"ST_PointZM\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Point with X, Y, Z, M and SRID values."
+msgstr "Створює точку з значеннями X, Y, Z, M та SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an Point with the given X, Y, Z and M coordinate values, and "
+"optionally an SRID number."
+msgstr ""
+"Повертає точку з заданими значеннями координат X, Y, Z і M, а також, за "
+"бажанням, номер SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointM\"/>, <xref "
+"linkend=\"ST_PointZ\"/>, <xref linkend=\"ST_SetSRID\"/>"
+msgstr ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_PointM\"/>, <xref linkend="
+"\"ST_PointZ\"/>, <xref linkend=\"ST_SetSRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a Polygon from a LineString with a specified SRID."
+msgstr "Створює полігон з LineString із заданим SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a polygon built from the given LineString and sets the spatial "
+"reference system from the <varname>srid</varname>."
+msgstr ""
+"Повертає полігон, побудований з заданого LineString, і встановлює систему "
+"просторових координат з <varname>srid</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Polygon is similar to <xref linkend=\"ST_MakePolygon\"/> Variant 1 with "
+"the addition of setting the SRID."
+msgstr ""
+"ST_Polygon схожий на <xref linkend=\"ST_MakePolygon\"/>Варіант 1 з "
+"додаванням налаштування SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To create polygons with holes use <xref linkend=\"ST_MakePolygon\"/> Variant "
+"2 and then <xref linkend=\"ST_SetSRID\"/>."
+msgstr ""
+"Для створення полігонів з отворами використовуйте <xref linkend="
+"\"ST_MakePolygon\"/>Варіант 2, а потім <xref linkend=\"ST_SetSRID\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.3.2"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.3.2"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a 2D polygon."
+msgstr "Створити 2D полігон."
+
+#. Tag: para
+#, no-c-format
+msgid "Create a 3D polygon."
+msgstr "Створити 3D полігон."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsText\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_LineMerge\"/>, <xref "
+"linkend=\"ST_MakePolygon\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsText\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_LineMerge\"/>, <xref "
+"linkend=\"ST_MakePolygon\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a rectangular Polygon in <link xlink:href=\"https://en.wikipedia.org/"
+"wiki/Web_Mercator_projection\">Web Mercator</link> (SRID:3857) using the "
+"<link xlink:href=\"https://en.wikipedia.org/wiki/Tiled_web_map\">XYZ tile "
+"system</link>."
+msgstr ""
+"Створює прямокутний полігон у <link xlink:href=\"https://en.wikipedia.org/"
+"wiki/Web_Mercator_projection\">Web Mercator</link> (SRID:3857) за допомогою "
+"<link xlink:href=\"https://en.wikipedia.org/wiki/Tiled_web_map\">системи "
+"тайлів XYZ</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a rectangular Polygon giving the extent of a tile in the <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/Tiled_web_map\">XYZ tile system</link>. "
+"The tile is specified by the zoom level Z and the XY index of the tile in "
+"the grid at that level. Can be used to define the tile bounds required by "
+"<xref linkend=\"ST_AsMVTGeom\"/> to convert geometry into the MVT tile "
+"coordinate space."
+msgstr ""
+"Створює прямокутний полігон, що визначає розмір плитки в <link "
+"xlink:href=\"https://en.wikipedia.org/wiki/Tiled_web_map\">системі плиток XYZ</"
+"link>. Плитка визначається рівнем масштабування Z та індексом XY плитки в "
+"сітці на цьому рівні. Може використовуватися для визначення меж плитки, "
+"необхідних для <xref linkend=\"ST_AsMVTGeom\"/> для перетворення геометрії в "
+"координатну систему плиток MVT."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default, the tile envelope is in the <link xlink:href=\"https://en."
+"wikipedia.org/wiki/Web_Mercator_projection\">Web Mercator</link> coordinate "
+"system (SRID:3857) using the standard range of the Web Mercator system "
+"(-20037508.342789, 20037508.342789). This is the most common coordinate "
+"system used for MVT tiles. The optional <varname>bounds</varname> parameter "
+"can be used to generate tiles in any coordinate system. It is a geometry "
+"that has the SRID and extent of the \"Zoom Level zero\" square within which "
+"the XYZ tile system is inscribed."
+msgstr ""
+"За замовчуванням контур плитки знаходиться в системі координат <link "
+"xlink:href=\"https://en.wikipedia.org/wiki/Web_Mercator_projection\">Web "
+"Mercator</link> (SRID:3857) з використанням стандартного діапазону системи "
+"Web Mercator (-20037508.342789, 20037508.342789). Це найпоширеніша система "
+"координат, що використовується для плиток MVT. Додатковий параметр "
+"<varname>bounds</varname> можна використовувати для створення плиток у будь-"
+"якій системі координат. Це геометрія, що має SRID і розмір квадрата \"Рівень "
+"масштабування нуль\", в якому вписана система плиток XYZ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The optional <varname>margin</varname> parameter can be used to expand a "
+"tile by the given percentage. E.g. <varname>margin=0.125</varname> expands "
+"the tile by 12.5%, which is equivalent to buffer=512 when the tile extent "
+"size is 4096, as used in <xref linkend=\"ST_AsMVTGeom\"/>. This is useful to "
+"create a tile buffer to include data lying outside of the tile's visible "
+"area, but whose existence affects the tile rendering. For example, a city "
+"name (a point) could be near an edge of a tile, so its label should be "
+"rendered on two tiles, even though the point is located in the visible area "
+"of just one tile. Using expanded tiles in a query will include the city "
+"point in both tiles. Use a negative value to shrink the tile instead. Values "
+"less than -0.5 are prohibited because that would eliminate the tile "
+"completely. Do not specify a margin when using with <varname>ST_AsMVTGeom</"
+"varname>. See the example for <xref linkend=\"ST_AsMVT\"/>."
+msgstr ""
+"Додатковий параметр <varname>margin</varname> можна використовувати для "
+"розширення плитки на заданий відсоток. Наприклад, <varname>margin=0.125</"
+"varname> розширює плитку на 12,5%, що еквівалентно buffer=512, коли розмір "
+"плитки становить 4096, як використовується в <xref linkend=\"ST_AsMVTGeom\"/"
+">. Це корисно для створення буфера плиток, щоб включити дані, які лежать за "
+"межами видимої області плитки, але наявність яких впливає на візуалізацію "
+"плитки. Наприклад, назва міста (точка) може бути поблизу краю плитки, тому "
+"її мітка повинна бути візуалізована на двох плитках, навіть якщо точка "
+"розташована у видимій області лише однієї плитки. Використання розширених "
+"плиток у запиті дозволить включити точку міста в обидві плитки. Для "
+"зменшення плитки використовуйте від'ємне значення. Значення менше -0.5 "
+"заборонені, оскільки це призведе до повного видалення плитки. Не вказуйте "
+"поле при використанні з <varname>ST_AsMVTGeom</varname>. Дивіться приклад "
+"для <xref linkend=\"ST_AsMVT\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.1.0 Added margin parameter."
+msgstr "Покращено: 3.1.0 Додано параметр поля."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.0.0"
+msgstr "Доступність: 3.0.0"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Building a tile envelope"
+msgstr "Приклад: Побудова конверта плитки"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of hexagons and cell indices that completely cover the bounds "
+"of the geometry argument."
+msgstr ""
+"Повертає набір шестикутників та індексів комірок, які повністю покривають "
+"межі аргументу геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Starts with the concept of a hexagon tiling of the plane. (Not a hexagon "
+"tiling of the globe, this is not the <link xlink:href=\"https://github.com/"
+"uber/h3\">H3</link> tiling scheme.) For a given planar SRS, and a given edge "
+"size, starting at the origin of the SRS, there is one unique hexagonal "
+"tiling of the plane, Tiling(SRS, Size). This function answers the question: "
+"what hexagons in a given Tiling(SRS, Size) overlap with a given bounds."
+msgstr ""
+"Починається з концепції шестикутної мозаїки площини. (Це не шестикутна "
+"мозаїка земної кулі, це не схема мозаїки <link xlink:href=\"https://github."
+"com/uber/h3\">H3</link>). Для заданої плоскої SRS і заданого розміру ребра, "
+"починаючи від початку координат SRS, існує одне унікальне шестикутне "
+"покриття площини, Tiling(SRS, Size). Ця функція відповідає на питання: які "
+"шестикутники в заданому Tiling(SRS, Size) перекриваються з заданими межами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The SRS for the output hexagons is the SRS provided by the bounds geometry."
+msgstr "SRS для вихідних шестикутників — це SRS, що надається геометрією меж."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Doubling or tripling the edge size of the hexagon generates a new parent "
+"tiling that fits with the origin tiling. Unfortunately, it is not possible "
+"to generate parent hexagon tilings that the child tiles perfectly fit inside."
+msgstr ""
+"Подвоєння або потроєння розміру ребра шестикутника створює нову батьківську "
+"мозаїку, яка відповідає вихідній мозаїці. На жаль, неможливо створити "
+"батьківську мозаїку з шестикутників, в яку ідеально вписуються дочірні "
+"плитки."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.1.0"
+msgstr "Доступність: 3.1.0"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Counting points in hexagons"
+msgstr "Приклад: Підрахунок точок у шестикутниках"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To do a point summary against a hexagonal tiling, generate a hexagon grid "
+"using the extent of the points as the bounds, then spatially join to that "
+"grid."
+msgstr ""
+"Щоб зробити підсумок точок на шестикутній мозаїці, створіть шестикутну "
+"сітку, використовуючи межі точок як обмеження, а потім просторово з'єднайте "
+"її з цією сіткою."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Generating hex coverage of polygons"
+msgstr "Приклад: Створення шестнадцяткового покриття полігонів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If we generate a set of hexagons for each polygon boundary and filter out "
+"those that do not intersect their hexagons, we end up with a tiling for each "
+"polygon."
+msgstr ""
+"Якщо ми створимо набір шестикутників для кожної межі полігону і "
+"відфільтруємо ті, що не перетинаються з їх шестикутниками, ми отримаємо "
+"мозаїку для кожного полігону."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tiling states results in a hexagon coverage of each state, and multiple "
+"hexagons overlapping at the borders between states."
+msgstr ""
+"У результаті мозаїчного покриття кожен стан покривається шестикутником, а на "
+"межі між станами утворюються перекриваються шестикутники."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The LATERAL keyword is implied for set-returning functions when referring to "
+"a prior table in the FROM list. So CROSS JOIN LATERAL, CROSS JOIN, or just "
+"plain , are equivalent constructs for this example."
+msgstr ""
+"Ключове слово LATERAL є імпліцитним для функцій, що повертають набір, коли "
+"вони посилаються на попередню таблицю в списку FROM. Тому CROSS JOIN "
+"LATERAL, CROSS JOIN або просто є еквівалентними конструкціями для цього "
+"прикладу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_SquareGrid\"/>, <xref "
+"linkend=\"ST_TileEnvelope\"/>"
+msgstr ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_SquareGrid\"/>, <xref "
+"linkend=\"ST_TileEnvelope\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a single hexagon, using the provided edge size and cell coordinate "
+"within the hexagon grid space."
+msgstr ""
+"Повертає один шестикутник, використовуючи заданий розмір ребра та координати "
+"комірки в просторі шестикутної сітки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Uses the same hexagon tiling concept as <xref linkend=\"ST_HexagonGrid\"/>, "
+"but generates just one hexagon at the desired cell coordinate. Optionally, "
+"can adjust origin coordinate of the tiling, the default origin is at 0,0."
+msgstr ""
+"Використовує ту саму концепцію шестикутної мозаїки, що й <xref linkend="
+"\"ST_HexagonGrid\"/>, але створює лише один шестикутник у бажаних "
+"координатах комірки. За бажанням можна налаштувати координати початку "
+"мозаїки, за замовчуванням початок знаходиться в точці 0,0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Hexagons are generated with no SRID set, so use <xref linkend=\"ST_SetSRID\"/"
+"> to set the SRID to the one you expect."
+msgstr ""
+"Шестикутники генеруються без заданого SRID, тому використовуйте <xref "
+"linkend=\"ST_SetSRID\"/>, щоб задати SRID відповідно до ваших очікувань."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Creating a hexagon at the origin"
+msgstr "Приклад: Створення шестикутника в початку координат"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_HexagonGrid\"/>, <xref linkend=\"ST_Square\"/>"
+msgstr ", <xref linkend=\"ST_HexagonGrid\"/>, <xref linkend=\"ST_Square\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of grid squares and cell indices that completely cover the "
+"bounds of the geometry argument."
+msgstr ""
+"Повертає набір квадратів сітки та індексів комірок, які повністю покривають "
+"межі аргументу геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Starts with the concept of a square tiling of the plane. For a given planar "
+"SRS, and a given edge size, starting at the origin of the SRS, there is one "
+"unique square tiling of the plane, Tiling(SRS, Size). This function answers "
+"the question: what grids in a given Tiling(SRS, Size) overlap with a given "
+"bounds."
+msgstr ""
+"Починається з концепції квадратного покриття площини. Для заданої плоскої "
+"SRS і заданого розміру ребра, починаючи від початку SRS, існує одне "
+"унікальне квадратне покриття площини, Tiling(SRS, Size). Ця функція "
+"відповідає на питання: які сітки в заданому Tiling(SRS, Size) перекриваються "
+"з заданими межами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The SRS for the output squares is the SRS provided by the bounds geometry."
+msgstr "SRS для вихідних квадратів — це SRS, що надається геометрією меж."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Doubling or edge size of the square generates a new parent tiling that "
+"perfectly fits with the original tiling. Standard web map tilings in "
+"mercator are just powers-of-two square grids in the mercator plane."
+msgstr ""
+"Подвоєння або розмір краю квадрата створює нову батьківську мозаїку, яка "
+"ідеально підходить до оригінальної мозаїки. Стандартні веб-карти в проекції "
+"Меркатора — це просто квадратні сітки, що є степенями числа два в площині "
+"Меркатора."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Generating a 1 degree grid for a country"
+msgstr "Приклад: Створення сітки з кроком 1 градус для країни"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The grid will fill the whole bounds of the country, so if you want just "
+"squares that touch the country you will have to filter afterwards with "
+"ST_Intersects."
+msgstr ""
+"Сітка заповнить всю територію країни, тому якщо вам потрібні лише квадрати, "
+"що торкаються країни, вам доведеться потім відфільтрувати їх за допомогою "
+"ST_Intersects."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Counting points in squares (using single chopped grid)"
+msgstr "Приклад: Підрахунок очок у квадратах (з використанням одинарної сітки)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To do a point summary against a square tiling, generate a square grid using "
+"the extent of the points as the bounds, then spatially join to that grid. "
+"Note the estimated extent might be off from actual extent, so be cautious "
+"and at very least make sure you've analyzed your table."
+msgstr ""
+"Щоб зробити підсумок точок на квадратній мозаїці, створіть квадратну сітку, "
+"використовуючи межі точок як обмеження, а потім просторово з'єднайте її з "
+"цією сіткою. Зверніть увагу, що приблизна площа може відрізнятися від "
+"фактичної, тому будьте обережні і, як мінімум, переконайтеся, що ви "
+"проаналізували свою таблицю."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Counting points in squares using set of grid per point"
+msgstr ""
+"Приклад: Підрахунок точок у квадратах за допомогою набору сіток для кожної "
+"точки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This yields the same result as the first example but will be slower for a "
+"large number of points"
+msgstr ""
+"Це дає той самий результат, що й у першому прикладі, але буде повільніше для "
+"великої кількості точок"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_HexagonGrid\"/> , <xref linkend=\"ST_EstimatedExtent\"/"
+"> , <xref linkend=\"ST_SetSRID\"/>"
+msgstr ""
+", <xref linkend=\"ST_HexagonGrid\"/> , <xref linkend=\"ST_EstimatedExtent\"/"
+"> , <xref linkend=\"ST_SetSRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a single square, using the provided edge size and cell coordinate "
+"within the square grid space."
+msgstr ""
+"Повертає один квадрат, використовуючи заданий розмір сторони та координати "
+"комірки в просторі квадратної сітки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Uses the same square tiling concept as <xref linkend=\"ST_SquareGrid\"/>, "
+"but generates just one square at the desired cell coordinate. Optionally, "
+"can adjust origin coordinate of the tiling, the default origin is at 0,0."
+msgstr ""
+"Використовує ту саму концепцію квадратної мозаїки, що й <xref linkend="
+"\"ST_SquareGrid\"/>, але створює лише один квадрат у бажаних координатах "
+"комірки. За бажанням можна налаштувати координати початку мозаїки, за "
+"замовчуванням початок знаходиться в точці 0,0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Squares are generated with the SRID of the given origin. Use <xref "
+"linkend=\"ST_SetSRID\"/> to set the SRID if the given origin has an unknown "
+"SRID (as is the case by default)."
+msgstr ""
+"Квадрати генеруються з SRID заданого початку координат. Використовуйте <xref "
+"linkend=\"ST_SetSRID\"/>, щоб встановити SRID, якщо заданий початок "
+"координат має невідомий SRID (як це відбувається за замовчуванням)."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Creating a square at the origin"
+msgstr "Приклад: Створення квадрата в початку координат"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_SquareGrid\"/>, <xref linkend=\"ST_Hexagon\"/>"
+msgstr ", <xref linkend=\"ST_SquareGrid\"/>, <xref linkend=\"ST_Hexagon\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the input letters rendered as geometry with a default start position "
+"at the origin and default text height of 100."
+msgstr ""
+"Повертає введені літери, відтворені як геометрія, з початковою позицією за "
+"замовчуванням в початку координат і висотою тексту за замовчуванням 100."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Uses a built-in font to render out a string as a multipolygon geometry. The "
+"default text height is 100.0, the distance from the bottom of a descender to "
+"the top of a capital. The default start position places the start of the "
+"baseline at the origin. Over-riding the font involves passing in a json map, "
+"with a character as the key, and base64 encoded TWKB for the font shape, "
+"with the fonts having a height of 1000 units from the bottom of the "
+"descenders to the tops of the capitals."
+msgstr ""
+"Використовує вбудований шрифт для відображення рядка як мультиполігональної "
+"геометрії. За замовчуванням висота тексту становить 100,0, відстань від "
+"нижньої частини нижнього виступу до верхньої частини великої літери. За "
+"замовчуванням початкова позиція розміщує початок базової лінії в точці "
+"початку координат. Для заміни шрифту потрібно передати карту json, де ключем "
+"є символ, а TWKB, закодований у base64, — форма шрифту, висота шрифтів "
+"становить 1000 одиниць від нижньої частини нижнього виступу до верхньої "
+"частини великої літери."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The text is generated at the origin by default, so to reposition and resize "
+"the text, first apply the <code>ST_Scale</code> function and then apply the "
+"<code>ST_Translate</code> function."
+msgstr ""
+"Текст за замовчуванням генерується в точці початку координат, тому щоб "
+"змінити його положення та розмір, спочатку застосуйте функцію "
+"<code>ST_Scale</code>, а потім функцію <code>ST_Translate</code>."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Generating the word 'Yo'"
+msgstr "Приклад: Створення слова \"Yo\""
+
+#. Tag: para
+#, no-c-format
+msgid "Letters generated by ST_Letters"
+msgstr "Листи, створені ST_Letters"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Scaling and moving words"
+msgstr "Приклад: Масштабування та переміщення слів"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Scale\"/>, <xref linkend=\"ST_Translate\"/>"
+msgstr ", <xref linkend=\"ST_Scale\"/>, <xref linkend=\"ST_Translate\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Coverages"
+msgstr "Покриття"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions operate on sets of polygonal geometry that form \"implicit "
+"coverages\". To form a valid coverage polygons must not overlap, and the "
+"vertices of adjacent edges must match exactly. Coverages are fast to "
+"process, and can be operated on with window functions, which retain the "
+"coverage topology inside the window partition while altering the edges."
+msgstr ""
+"Ці функції працюють з наборами полігональної геометрії, що утворюють \"неявні "
+"покриття\". Щоб утворити дійсне покриття, полігони не повинні перекриватися, "
+"а вершини суміжних ребер повинні збігатися. Покриття швидко обробляються і "
+"можуть оброблятися за допомогою віконних функцій, які зберігають топологію "
+"покриття всередині розділу вікна при зміні ребер."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Window function that finds locations where polygons fail to form a valid "
+"coverage."
+msgstr ""
+"Віконна функція, яка знаходить місця, де полігони не утворюють дійсного "
+"покриття."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A window function which checks if the polygons in the window partition form "
+"a valid polygonal coverage. It returns linear indicators showing the "
+"location of invalid edges (if any) in each polygon."
+msgstr ""
+"Віконна функція, яка перевіряє, чи полігони у вікні утворюють дійсне "
+"полігональне покриття. Вона повертає лінійні індикатори, що показують "
+"розташування недійсних країв (якщо такі є) у кожному полігоні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A set of valid polygons is a valid coverage if the following conditions hold:"
+msgstr ""
+"Набір дійсних полігонів є дійсним покриттям, якщо виконуються такі умови:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Non-overlapping</emphasis> - polygons do not overlap "
+"(their interiors do not intersect)"
+msgstr ""
+"<emphasis role=\"bold\">Неперекриваються</emphasis> - полігони не "
+"перекриваються (їх внутрішні частини не перетинаються)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Edge-Matched</emphasis> - vertices along shared "
+"edges are identical"
+msgstr ""
+"<emphasis role=\"bold\">Edge-Matched</emphasis> - вершини вздовж спільних "
+"ребер є ідентичними"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As a window function a value is returned for every input polygon. For "
+"polygons which violate one or more of the validity conditions the return "
+"value is a MULTILINESTRING containing the problematic edges. Coverage-valid "
+"polygons return the value NULL. Non-polygonal or empty geometries also "
+"produce NULL values."
+msgstr ""
+"Як віконна функція, для кожного вхідного полігону повертається значення. Для "
+"полігонів, які порушують одну або кілька умов дійсності, значенням, що "
+"повертається, є MULTILINESTRING, що містить проблемні краї. Полігони з "
+"дійсним покриттям повертають значення NULL. Неполігональні або порожні "
+"геометрії також дають значення NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The conditions allow a valid coverage to contain holes (gaps between "
+"polygons), as long as the surrounding polygons are edge-matched. However, "
+"very narrow gaps are often undesirable. If the <parameter>tolerance</"
+"parameter> parameter is specified with a non-zero distance, edges forming "
+"narrower gaps will also be returned as invalid."
+msgstr ""
+"Умови дозволяють дійсному покриттю містити отвори (проміжки між полігонами), "
+"якщо сусідні полігони збігаються по краях. Однак дуже вузькі проміжки часто "
+"є небажаними. Якщо параметр <parameter>tolerance</parameter> задано з "
+"відстанню, відмінною від нуля, краї, що утворюють вужчі проміжки, також "
+"будуть повернуті як недійсні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The polygons being checked for coverage validity must also be valid "
+"geometries. This can be checked with <xref linkend=\"ST_IsValid\"/>."
+msgstr ""
+"Полігони, що перевіряються на валідність покриття, також повинні бути "
+"валідними геометріями. Це можна перевірити за допомогою <xref linkend="
+"\"ST_IsValid\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.12.0"
+msgstr "Потрібна версія GEOS >= 3.12.0"
+
+#. Tag: para
+#, no-c-format
+msgid "Invalid edges caused by overlap and non-matching vertices"
+msgstr "Недійсні ребра, спричинені перекриттям і невідповідністю вершин"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_CoverageUnion\"/>, <xref linkend=\"ST_CoverageClean\"/"
+">, <xref linkend=\"ST_CoverageSimplify\"/>"
+msgstr ""
+", <xref linkend=\"ST_CoverageUnion\"/>, <xref linkend=\"ST_CoverageClean\"/"
+">, <xref linkend=\"ST_CoverageSimplify\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Window function that simplifies the edges of a polygonal coverage."
+msgstr "Віконна функція, яка спрощує краї полігонального покриття."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A window function which simplifies the edges of polygons in a polygonal "
+"coverage. The simplification preserves the coverage topology. This means the "
+"simplified output polygons are consistent along shared edges, and still form "
+"a valid coverage."
+msgstr ""
+"Віконна функція, яка спрощує краї полігонів у полігональному покритті. "
+"Спрощення зберігає топологію покриття. Це означає, що спрощені вихідні "
+"полігони є сумісними вздовж спільних країв і все ще утворюють дійсне "
+"покриття."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The simplification uses a variant of the <link xlink:href=\"https://en."
+"wikipedia.org/wiki/Visvalingam%E2%80%93Whyatt_algorithm\">Visvalingam–Whyatt "
+"algorithm</link>. The <parameter>tolerance</parameter> parameter has units "
+"of distance, and is roughly equal to the square root of triangular areas to "
+"be simplified."
+msgstr ""
+"Спрощення використовує варіант алгоритму <link xlink:href=\"https://en."
+"wikipedia.org/wiki/Visvalingam%E2%80%93Whyatt_algorithm\">Visvalingam–Whyatt</"
+"link>. Параметр <parameter>tolerance</parameter> має одиниці виміру відстані "
+"і приблизно дорівнює квадратному кореню з площі трикутників, що спрощуються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To simplify only the \"internal\" edges of the coverage (those that are "
+"shared by two polygons) set the <parameter>simplifyBoundary</parameter> "
+"parameter to false."
+msgstr ""
+"Щоб спростити тільки \"внутрішні\" краї покриття (ті, що є спільними для двох "
+"полігонів), встановіть параметр <parameter>simplifyBoundary</parameter> на "
+"значення false."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the input is not a valid coverage there may be unexpected artifacts in "
+"the output (such as boundary intersections, or separated boundaries which "
+"appeared to be shared). Use <xref linkend=\"ST_CoverageInvalidEdges\"/> to "
+"determine if a coverage is valid."
+msgstr ""
+"Якщо вхідні дані не є дійсним покриттям, у вихідних даних можуть з'явитися "
+"несподівані артефакти (наприклад, перетини меж або розділені межі, які "
+"здавалися спільними). Використовуйте <xref linkend=\"ST_CoverageInvalidEdges"
+"\"/>, щоб визначити, чи є покриття дійсним."
+
+#. Tag: para
+#, no-c-format
+msgid "Input coverage"
+msgstr "Покриття вхідних даних"
+
+#. Tag: para
+#, no-c-format
+msgid "Simplified coverage"
+msgstr "Спрощене покриття"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_CoverageUnion\"/>, <xref linkend=\"ST_CoverageClean\"/>"
+msgstr ""
+", <xref linkend=\"ST_CoverageUnion\"/>, <xref linkend=\"ST_CoverageClean\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes the union of a set of polygons forming a coverage by removing "
+"shared edges."
+msgstr ""
+"Обчислює об'єднання набору полігонів, що утворюють покриття, видаляючи "
+"спільні ребра."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function which unions a set of polygons forming a polygonal "
+"coverage. The result is a polygonal geometry covering the same area as the "
+"coverage. This function produces the same result as <xref "
+"linkend=\"ST_Union\"/>, but uses the coverage structure to compute the union "
+"much faster."
+msgstr ""
+"Агрегуюча функція, яка об'єднує набір полігонів, що утворюють полігональне "
+"покриття. Результатом є полігональна геометрія, що покриває ту саму площу, "
+"що й покриття. Ця функція дає той самий результат, що й <xref linkend="
+"\"ST_Union\"/>, але використовує структуру покриття для значно швидшого "
+"обчислення об'єднання."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the input is not a valid coverage there may be unexpected artifacts in "
+"the output (such as unmerged or overlapping polygons). Use <xref "
+"linkend=\"ST_CoverageInvalidEdges\"/> to determine if a coverage is valid."
+msgstr ""
+"Якщо вхідні дані не є дійсним покриттям, у вихідних даних можуть з'явитися "
+"несподівані артефакти (наприклад, не об'єднані або перекриваються полігони). "
+"Використовуйте <xref linkend=\"ST_CoverageInvalidEdges\"/>, щоб визначити, "
+"чи є покриття дійсним."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.4.0 - requires GEOS >= 3.8.0"
+msgstr "Доступність: 3.4.0 - вимагає GEOS >= 3.8.0"
+
+#. Tag: para
+#, no-c-format
+msgid "Union result"
+msgstr "Результат об'єднання"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_CoverageSimplify\"/>, <xref "
+"linkend=\"ST_CoverageClean\"/>, <xref linkend=\"ST_Union\"/>"
+msgstr ""
+", <xref linkend=\"ST_CoverageSimplify\"/>, <xref linkend=\"ST_CoverageClean\""
+"/>, <xref linkend=\"ST_Union\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a clean (edge matched, non-overlapping, gap-cleared) polygonal "
+"coverage, given a non-clean input."
+msgstr ""
+"Обчислює чисте (збіжні краї, без перекриттів, без прогалин) полігональне "
+"покриття, задане нечистим вхідним даними."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A window function which alters the edges of a polygonal coverage to ensure "
+"that none of the polygons overlap, that small gaps are snapped away, and "
+"that all shared edges are exactly identical. The result is a clean coverage "
+"that will pass validation tests like <xref "
+"linkend=\"ST_CoverageInvalidEdges\"/>"
+msgstr ""
+"Віконна функція, яка змінює краї полігонального покриття, щоб жоден з "
+"полігонів не перекривався, невеликі проміжки були видалені, а всі спільні "
+"краї були абсолютно ідентичними. Результатом є чисте покриття, яке пройде "
+"тести валідації, такі як <xref linkend=\"ST_CoverageInvalidEdges\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <parameter>gapMaximumWidth</parameter> controls the cleaning of gaps "
+"between polygons. Gaps smaller than this tolerance will be closed."
+msgstr ""
+"Параметр <parameter>gapMaximumWidth</parameter> контролює очищення проміжків "
+"між полігонами. Проміжки, менші за цей допуск, будуть закриті."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <parameter>snappingDistance</parameter> controls the node snapping step, "
+"when nearby vertices are snapped together. The default setting (-1) applies "
+"an automatic snapping distance based on an analysis of the input. Set to 0.0 "
+"to turn off all snapping."
+msgstr ""
+"Параметр <parameter>snappingDistance</parameter> контролює крок прив'язки "
+"вузлів, коли сусідні вершини прив'язуються одна до одної. За замовчуванням "
+"(-1) застосовується автоматична відстань прив'язки на основі аналізу вхідних "
+"даних. Встановіть значення 0,0, щоб вимкнути всі прив'язки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <parameter>overlapMergeStrategy</parameter> controls the algorithm used "
+"to determine which neighboring polygons to merge overlapping areas into."
+msgstr ""
+"Параметр <parameter>overlapMergeStrategy</parameter> контролює алгоритм, що "
+"використовується для визначення сусідніх полігонів, в які слід об'єднати "
+"перекриваються області."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>MERGE_LONGEST_BORDER</code> chooses polygon with longest common border"
+msgstr ""
+"<code>MERGE_LONGEST_BORDER</code> вибирає полігон з найдовшою спільною межею"
+
+#. Tag: para
+#, no-c-format
+msgid "<code>MERGE_MAX_AREA</code> chooses polygon with maximum area"
+msgstr "<code>MERGE_MAX_AREA</code> вибирає полігон з максимальною площею"
+
+#. Tag: para
+#, no-c-format
+msgid "<code>MERGE_MIN_AREA</code> chooses polygon with minimum area"
+msgstr "<code>MERGE_MIN_AREA</code> вибирає полігон з мінімальною площею"
+
+#. Tag: para
+#, no-c-format
+msgid "<code>MERGE_MIN_INDEX</code> chooses polygon with smallest input index"
+msgstr ""
+"<code>MERGE_MIN_INDEX</code> вибирає полігон з найменшим індексом вхідних "
+"даних"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.6.0 - requires GEOS >= 3.14.0"
+msgstr "Доступність: 3.6.0 - вимагає GEOS >= 3.14.0"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Union\"/> <xref linkend=\"ST_CoverageSimplify\"/>"
+msgstr ", <xref linkend=\"ST_Union\"/> <xref linkend=\"ST_CoverageSimplify\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Editors"
+msgstr "Редактори геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions create modified geometries by changing type, structure or "
+"vertices."
+msgstr ""
+"Ці функції створюють модифіковані геометрії шляхом зміни типу, структури або "
+"вершин."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Add a point to a LineString."
+msgstr "Додати точку до LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a point to a LineString before the index <parameter>position</"
+"parameter> (using a 0-based index). If the <parameter>position</parameter> "
+"parameter is omitted or is -1 the point is appended to the end of the "
+"LineString."
+msgstr ""
+"Додає точку до LineString перед індексом <parameter>position</parameter> ("
+"використовуючи індекс, що починається з 0). Якщо параметр "
+"<parameter>position</parameter> пропущено або дорівнює -1, точка додається в "
+"кінець LineString."
+
+#. Tag: para
+#, no-c-format
+msgid "Add a point to the end of a 3D line"
+msgstr "Додати точку в кінець 3D лінії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Guarantee all lines in a table are closed by adding the start point of each "
+"line to the end of the line only for those that are not closed."
+msgstr ""
+"Гарантуйте, що всі лінії в таблиці закриті, додавши початкову точку кожної "
+"лінії до кінця лінії тільки для тих, які не закриті."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_SetPoint\"/>"
+msgstr ", <xref linkend=\"ST_SetPoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Given a geometry collection, returns a multi-geometry containing only "
+"elements of a specified type."
+msgstr ""
+"За заданою колекцією геометрій повертає мультигеометрію, що містить тільки "
+"елементи заданого типу."
+
+#. Tag: para
+#, no-c-format
+msgid "Given a geometry collection, returns a homogeneous multi-geometry."
+msgstr "За заданою колекцією геометрій повертає однорідну мультигеометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <parameter>type</parameter> is not specified, returns a multi-"
+"geometry containing only geometries of the highest dimension. So polygons "
+"are preferred over lines, which are preferred over points."
+msgstr ""
+"Якщо <parameter>type</parameter> не вказано, повертає мультигеометрію, що "
+"містить тільки геометрії найвищого виміру. Тому полігони мають пріоритет над "
+"лініями, які мають пріоритет над точками."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <parameter>type</parameter> is specified, returns a multi-geometry "
+"containing only that type. If there are no sub-geometries of the right type, "
+"an EMPTY geometry is returned. Only points, lines and polygons are "
+"supported. The type numbers are:"
+msgstr ""
+"Якщо вказано <parameter>type</parameter>, повертає мультигеометрію, що "
+"містить тільки цей тип. Якщо немає підгеометрій потрібного типу, "
+"повертається геометрія EMPTY. Підтримуються тільки точки, лінії та полігони. "
+"Номери типів:"
+
+#. Tag: para
+#, no-c-format
+msgid "1 == POINT"
+msgstr "1 == POINT"
+
+#. Tag: para
+#, no-c-format
+msgid "2 == LINESTRING"
+msgstr "2 == LINESTRING"
+
+#. Tag: para
+#, no-c-format
+msgid "3 == POLYGON"
+msgstr "3 == POLYGON"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For atomic geometry inputs, the geometry is returned unchanged if the input "
+"type matches the requested type. Otherwise, the result is an EMPTY geometry "
+"of the specified type. If required, these can be converted to multi-"
+"geometries using <xref linkend=\"ST_Multi\"/>."
+msgstr ""
+"Для вхідних даних атомарної геометрії геометрія повертається без змін, якщо "
+"тип вхідних даних відповідає запитуваному типу. В іншому випадку результатом "
+"є геометрія EMPTY заданого типу. За необхідності їх можна перетворити на "
+"мультигеометрії за допомогою <xref linkend=\"ST_Multi\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"MultiPolygon results are not checked for validity. If the polygon components "
+"are adjacent or overlapping the result will be invalid. (For example, this "
+"can occur when applying this function to an <xref linkend=\"ST_Split\"/> "
+"result.) This situation can be checked with <xref linkend=\"ST_IsValid\"/> "
+"and repaired with <xref linkend=\"ST_MakeValid\"/>."
+msgstr ""
+"Результати MultiPolygon не перевіряються на валідність. Якщо компоненти "
+"полігону є суміжними або перекриваються, результат буде недійсним. ("
+"Наприклад, це може статися при застосуванні цієї функції до результату <xref "
+"linkend=\"ST_Split\"/>.) Цю ситуацію можна перевірити за допомогою <xref "
+"linkend=\"ST_IsValid\"/> і виправити за допомогою <xref linkend="
+"\"ST_MakeValid\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior to 1.5.3 this function returned atomic inputs unchanged, no matter "
+"type. In 1.5.3 non-matching single geometries returned a NULL result. In "
+"2.0.0 non-matching single geometries return an EMPTY result of the requested "
+"type."
+msgstr ""
+"До версії 1.5.3 ця функція повертала атомарні вхідні дані без змін, "
+"незалежно від типу. У версії 1.5.3 невідповідні одиничні геометрії повертали "
+"результат NULL. У версії 2.0.0 невідповідні одиничні геометрії повертають "
+"результат EMPTY запитуваного типу."
+
+#. Tag: para
+#, no-c-format
+msgid "Extract highest-dimension type:"
+msgstr "Витяг типу найвищого виміру:"
+
+#. Tag: para
+#, no-c-format
+msgid "Extract points (type 1 == POINT):"
+msgstr "Витягнути точки (тип 1 == POINT):"
+
+#. Tag: para
+#, no-c-format
+msgid "Extract lines (type 2 == LINESTRING):"
+msgstr "Витягнути лінії (тип 2 == LINESTRING):"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Multi\"/>, <xref linkend=\"ST_IsValid\"/>, <xref "
+"linkend=\"ST_MakeValid\"/>"
+msgstr ""
+", <xref linkend=\"ST_Multi\"/>, <xref linkend=\"ST_IsValid\"/>, <xref "
+"linkend=\"ST_MakeValid\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the simplest representation of a geometry collection."
+msgstr "Повертає найпростіше представлення колекції геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given a geometry collection, returns the \"simplest\" representation of the "
+"contents."
+msgstr ""
+"За заданою колекцією геометрії повертає \"найпростіше\" представлення вмісту."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Homogeneous (uniform) collections are returned as the appropriate multi-"
+"geometry."
+msgstr ""
+"Однорідні (однотипні) колекції повертаються як відповідна мультигеометрія."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Heterogeneous (mixed) collections are flattened into a single "
+"GeometryCollection."
+msgstr ""
+"Гетерогенні (змішані) колекції об'єднуються в одну колекцію "
+"GeometryCollection."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Collections containing a single atomic element are returned as that element."
+msgstr ""
+"Колекції, що містять один атомарний елемент, повертаються як цей елемент."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Atomic geometries are returned unchanged. If required, these can be "
+"converted to a multi-geometry using <xref linkend=\"ST_Multi\"/>."
+msgstr ""
+"Атомарні геометрії повертаються без змін. При необхідності їх можна "
+"перетворити на мультигеометрії за допомогою <xref linkend=\"ST_Multi\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not ensure that the result is valid. In particular, a "
+"collection containing adjacent or overlapping Polygons will create an "
+"invalid MultiPolygon. This situation can be checked with <xref "
+"linkend=\"ST_IsValid\"/> and repaired with <xref linkend=\"ST_MakeValid\"/>."
+msgstr ""
+"Ця функція не гарантує, що результат є дійсним. Зокрема, колекція, що "
+"містить сусідні або перекриваються полігони, створить недійсний "
+"MultiPolygon. Цю ситуацію можна перевірити за допомогою <xref linkend="
+"\"ST_IsValid\"/> і виправити за допомогою <xref linkend=\"ST_MakeValid\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Single-element collection converted to an atomic geometry"
+msgstr "Одноелементна колекція, перетворена в атомарну геометрію"
+
+#. Tag: para
+#, no-c-format
+msgid "Nested single-element collection converted to an atomic geometry:"
+msgstr "Вкладена колекція з одним елементом, перетворена в атомарну геометрію:"
+
+#. Tag: para
+#, no-c-format
+msgid "Collection converted to a multi-geometry:"
+msgstr "Колекція перетворена на багатогеометрію:"
+
+#. Tag: para
+#, no-c-format
+msgid "Nested heterogeneous collection flattened to a GeometryCollection:"
+msgstr "Вкладені неоднорідні колекції, сплощені до GeometryCollection:"
+
+#. Tag: para
+#, no-c-format
+msgid "Collection of Polygons converted to an (invalid) MultiPolygon:"
+msgstr "Колекція полігонів, перетворених у (недійсний) MultiPolygon:"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Converts a geometry containing curves to a linear geometry."
+msgstr "Перетворює геометрію, що містить криві, на лінійну геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converts a CIRCULAR STRING to regular LINESTRING or CURVEPOLYGON to POLYGON "
+"or MULTISURFACE to MULTIPOLYGON. Useful for outputting to devices that can't "
+"support CIRCULARSTRING geometry types"
+msgstr ""
+"Перетворює CIRCULAR STRING у звичайний LINESTRING або CURVEPOLYGON у POLYGON "
+"або MULTISURFACE у MULTIPOLYGON. Корисно для виведення на пристрої, які не "
+"підтримують типи геометрії CIRCULARSTRING"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converts a given geometry to a linear geometry. Each curved geometry or "
+"segment is converted into a linear approximation using the given `tolerance` "
+"and options (32 segments per quadrant and no options by default)."
+msgstr ""
+"Перетворює задану геометрію в лінійну геометрію. Кожна крива геометрія або "
+"сегмент перетворюється в лінійне наближення з використанням заданого "
+"`допуску` та опцій (32 сегменти на квадрант і жодних опцій за замовчуванням)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The 'tolerance_type' argument determines interpretation of the `tolerance` "
+"argument. It can take the following values:"
+msgstr ""
+"Аргумент \"tolerance_type\" визначає інтерпретацію аргументу \"tolerance\". Він "
+"може приймати наступні значення:"
+
+#. Tag: para
+#, no-c-format
+msgid "0 (default): Tolerance is max segments per quadrant."
+msgstr ""
+"0 (за замовчуванням): Допустиме відхилення — максимальна кількість сегментів "
+"на квадрант."
+
+#. Tag: para
+#, no-c-format
+msgid "1: Tolerance is max-deviation of line from curve, in source units."
+msgstr ""
+"1: Допуск — це максимальне відхилення лінії від кривої в одиницях джерела."
+
+#. Tag: para
+#, no-c-format
+msgid "2: Tolerance is max-angle, in radians, between generating radii."
+msgstr ""
+"2: Допуск — це максимальний кут, виражений в радіанах, між радіусами, що "
+"утворюють."
+
+#. Tag: para
+#, no-c-format
+msgid "The 'flags' argument is a bitfield. 0 by default. Supported bits are:"
+msgstr ""
+"Аргумент \"flags\" є бітовим полем. За замовчуванням має значення 0. "
+"Підтримуються такі біти:"
+
+#. Tag: para
+#, no-c-format
+msgid "1: Symmetric (orientation independent) output."
+msgstr "1: Симетричний (незалежний від орієнтації) вихід."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"2: Retain angle, avoids reducing angles (segment lengths) when producing "
+"symmetric output. Has no effect when Symmetric flag is off."
+msgstr ""
+"2: Зберігає кут, запобігає зменшенню кутів (довжини сегментів) під час "
+"створення симетричного виводу. Не діє, якщо прапор Symmetric вимкнено."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.3.0"
+msgstr "Доступність: 1.3.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.4.0 added support for max-deviation and max-angle tolerance, and "
+"for symmetric output."
+msgstr ""
+"Покращено: у версії 2.4.0 додано підтримку максимального відхилення та "
+"максимального кута допуску, а також симетричного виводу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.0.0 implemented a minimum number of segments per linearized arc "
+"to prevent topological collapse."
+msgstr ""
+"Покращено: у версії 3.0.0 впроваджено мінімальну кількість сегментів на "
+"лінійну дугу, щоб запобігти топологічному колапсу."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.1.7"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.1.7"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Change start point of a closed LineString."
+msgstr "Змінити початкову точку замкнутої лінії LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changes the start/end point of a closed LineString to the given vertex "
+"<parameter>point</parameter>."
+msgstr ""
+"Змінює початкову/кінцеву точку замкнутої лінії LineString на задану вершину "
+"<parameter>point</parameter>."
+
+#. Tag: para
+#, no-c-format
+msgid "Make e closed line start at its 3rd vertex"
+msgstr "Зробіть закриту лінію, починаючи з її третьої вершини"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a version of a geometry with X and Y axis flipped."
+msgstr "Повертає версію геометрії з перевернутими осями X та Y."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a version of the given geometry with X and Y axis flipped. Useful "
+"for fixing geometries which contain coordinates expressed as latitude/"
+"longitude (Y,X)."
+msgstr ""
+"Повертає версію заданої геометрії з перевернутими осями X та Y. Корисно для "
+"виправлення геометрій, які містять координати, виражені у вигляді широти/"
+"довготи (Y, X)."
+
+#. Tag: title
+#, no-c-format
+msgid "Example"
+msgstr "Приклад"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force the geometries into a \"2-dimensional mode\"."
+msgstr "Примусово переведіть геометрії в \"2-вимірний режим\"."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces the geometries into a \"2-dimensional mode\" so that all output "
+"representations will only have the X and Y coordinates. This is useful for "
+"force OGC-compliant output (since OGC only specifies 2-D geometries)."
+msgstr ""
+"Примусово переводить геометрії в \"двовимірний режим\", щоб усі вихідні "
+"представлення мали тільки координати X і Y. Це корисно для виведення даних, "
+"сумісних із OGC (оскільки OGC визначає тільки двовимірні геометрії)."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Force_2D."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Force_2D."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force the geometries into XYZ mode. This is an alias for ST_Force3DZ."
+msgstr ""
+"Примусово перевести геометрії в режим XYZ. Це псевдонім для ST_Force3DZ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces the geometries into XYZ mode. This is an alias for ST_Force3DZ. If a "
+"geometry has no Z component, then a <parameter>Zvalue</parameter> Z "
+"coordinate is tacked on."
+msgstr ""
+"Примусово переводить геометрії в режим XYZ. Це псевдонім для ST_Force3DZ. "
+"Якщо геометрія не має компонента Z, то додається координата Z "
+"<parameter>Zvalue</parameter>."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3D."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Force_3D."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.1.0. Added support for supplying a non-zero Z value."
+msgstr ""
+"Змінено: 3.1.0. Додано підтримку для надання значення Z, відмінного від нуля."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Force2D\"/>, <xref linkend=\"ST_Force_3DM\"/>, <xref "
+"linkend=\"ST_Force_3DZ\"/>"
+msgstr ""
+", <xref linkend=\"ST_Force2D\"/>, <xref linkend=\"ST_Force_3DM\"/>, <xref "
+"linkend=\"ST_Force_3DZ\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force the geometries into XYZ mode."
+msgstr "Примусово перевести геометрії в режим XYZ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces the geometries into XYZ mode. If a geometry has no Z component, then "
+"a <parameter>Zvalue</parameter> Z coordinate is tacked on."
+msgstr ""
+"Примусово переводить геометрії в режим XYZ. Якщо геометрія не має компонента "
+"Z, то додається координата Z <parameter>Zvalue</parameter>."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3DZ."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Force_3DZ."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Force2D\"/>, <xref linkend=\"ST_Force_3DM\"/>, <xref "
+"linkend=\"ST_Force_3D\"/>"
+msgstr ""
+", <xref linkend=\"ST_Force2D\"/>, <xref linkend=\"ST_Force_3DM\"/>, <xref "
+"linkend=\"ST_Force_3D\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force the geometries into XYM mode."
+msgstr "Примусово перевести геометрії в режим XYM."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces the geometries into XYM mode. If a geometry has no M component, then "
+"a <parameter>Mvalue</parameter> M coordinate is tacked on. If it has a Z "
+"component, then Z is removed"
+msgstr ""
+"Примусово переводить геометрії в режим XYM. Якщо геометрія не має компонента "
+"M, то додається координата <parameter>Mvalue</parameter> M. Якщо вона має "
+"компонент Z, то Z видаляється"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Force_3DM."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Force_3DM."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.1.0. Added support for supplying a non-zero M value."
+msgstr ""
+"Змінено: 3.1.0. Додано підтримку для надання значення M, відмінного від нуля."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Force2D\"/>, <xref linkend=\"ST_Force_3DM\"/>, <xref "
+"linkend=\"ST_Force_3D\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>"
+msgstr ""
+", <xref linkend=\"ST_Force2D\"/>, <xref linkend=\"ST_Force_3DM\"/>, <xref "
+"linkend=\"ST_Force_3D\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force the geometries into XYZM mode."
+msgstr "Примусово перевести геометрії в режим XYZM."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces the geometries into XYZM mode. <parameter>Zvalue</parameter> and "
+"<parameter>Mvalue</parameter> is tacked on for missing Z and M dimensions, "
+"respectively."
+msgstr ""
+"Примусово переводить геометрії в режим XYZM. <parameter>Zvalue</parameter> "
+"та <parameter>Mvalue</parameter> додаються для відсутніх розмірів Z та M "
+"відповідно."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Force_4D."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Force_4D."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.1.0. Added support for supplying non-zero Z and M values."
+msgstr "Змінено: 3.1.0. Додано підтримку для надання ненульових значень Z та M."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Convert the geometry into a GEOMETRYCOLLECTION."
+msgstr "Перетворити геометрію в GEOMETRYCOLLECTION."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converts the geometry into a GEOMETRYCOLLECTION. This is useful for "
+"simplifying the WKB representation."
+msgstr ""
+"Перетворює геометрію в GEOMETRYCOLLECTION. Це корисно для спрощення "
+"представлення WKB."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.2.2, prior to 1.3.4 this function will crash with Curves. "
+"This is fixed in 1.3.4+"
+msgstr ""
+"Доступність: 1.2.2, до версії 1.3.4 ця функція буде виходити з ладу з "
+"кривими. Ця проблема вирішена в версії 1.3.4+"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Force_Collection."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Force_Collection."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Upcast a geometry into its curved type, if applicable."
+msgstr "Перетворити геометрію в її вигнутий тип, якщо це можливо."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Turns a geometry into its curved representation, if applicable: lines become "
+"compoundcurves, multilines become multicurves polygons become curvepolygons "
+"multipolygons become multisurfaces. If the geometry input is already a "
+"curved representation returns back same as input."
+msgstr ""
+"Перетворює геометрію в її криве представлення, якщо це можливо: лінії стають "
+"складеними кривими, мультилінії стають мультикривими, полігони стають "
+"криволінійними полігонами, мультиполігоанми стають багатоповерхневими. Якщо "
+"вхідна геометрія вже є кривим представленням, повертається те саме, що і "
+"вхідні дані."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Orients all exterior rings counter-clockwise and all interior rings "
+"clockwise."
+msgstr ""
+"Всі зовнішні кільця орієнтуйте проти годинникової стрілки, а всі внутрішні "
+"кільця — за годинниковою стрілкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces (Multi)Polygons to use a counter-clockwise orientation for their "
+"exterior ring, and a clockwise orientation for their interior rings. Non-"
+"polygonal geometries are returned unchanged."
+msgstr ""
+"Змушує (Мульти)Полігони) використовувати орієнтацію проти годинникової "
+"стрілки для зовнішнього кільця та орієнтацію за годинниковою стрілкою для "
+"внутрішніх кілець. Неполігональні геометрії повертаються без змін."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_IsPolygonCCW\"/>, <xref linkend=\"ST_IsPolygonCW\"/>"
+msgstr ""
+", <xref linkend=\"ST_IsPolygonCCW\"/>, <xref linkend=\"ST_IsPolygonCW\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Orients all exterior rings clockwise and all interior rings counter-"
+"clockwise."
+msgstr ""
+"Всі зовнішні кільця орієнтуйте за годинниковою стрілкою, а всі внутрішні "
+"кільця — проти годинникової стрілки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces (Multi)Polygons to use a clockwise orientation for their exterior "
+"ring, and a counter-clockwise orientation for their interior rings. Non-"
+"polygonal geometries are returned unchanged."
+msgstr ""
+"Змушує (Мульти)Полігони) використовувати орієнтацію за годинниковою стрілкою "
+"для зовнішнього кільця та проти годинникової стрілки для внутрішніх кілець. "
+"Неполігональні геометрії повертаються без змін."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force the geometries to use SFS 1.1 geometry types only."
+msgstr "Змусити геометрії використовувати тільки типи геометрії SFS 1.1."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Force the orientation of the vertices in a polygon to follow the Right-Hand-"
+"Rule."
+msgstr ""
+"Примусово встановити орієнтацію вершин полігону відповідно до правила правої "
+"руки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Forces the orientation of the vertices in a polygon to follow a Right-Hand-"
+"Rule, in which the area that is bounded by the polygon is to the right of "
+"the boundary. In particular, the exterior ring is orientated in a clockwise "
+"direction and the interior rings in a counter-clockwise direction. This "
+"function is a synonym for <xref linkend=\"ST_ForcePolygonCW\"/>"
+msgstr ""
+"Примушує орієнтацію вершин полігону слідувати правилу правої руки, за яким "
+"область, обмежена полігоном, знаходиться праворуч від межі. Зокрема, "
+"зовнішнє кільце орієнтовано за годинниковою стрілкою, а внутрішні кільця - "
+"проти годинникової стрілки. Ця функція є синонімом <xref linkend="
+"\"ST_ForcePolygonCW\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above definition of the Right-Hand-Rule conflicts with definitions used "
+"in other contexts. To avoid confusion, it is recommended to use "
+"ST_ForcePolygonCW."
+msgstr ""
+"Вищезазначене визначення правила правої руки суперечить визначенням, що "
+"використовуються в інших контекстах. Щоб уникнути плутанини, рекомендується "
+"використовувати ST_ForcePolygonCW."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ForcePolygonCW\"/>, <xref linkend=\"ST_IsPolygonCCW\"/"
+">, <xref linkend=\"ST_IsPolygonCW\"/>, <xref linkend=\"ST_BuildArea\"/>, "
+"<xref linkend=\"ST_Polygonize\"/>, <xref linkend=\"ST_Reverse\"/>"
+msgstr ""
+", <xref linkend=\"ST_ForcePolygonCW\"/>, <xref linkend=\"ST_IsPolygonCCW\"/"
+">, <xref linkend=\"ST_IsPolygonCW\"/>, <xref linkend=\"ST_BuildArea\"/>, "
+"<xref linkend=\"ST_Polygonize\"/>, <xref linkend=\"ST_Reverse\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a line extended forwards and backwards by specified distances."
+msgstr "Повертає лінію, розширений вперед і назад на вказані відстані."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a line extended forwards and backwards by adding new start (and end) "
+"points at the given distance(s). A distance of zero does not add a point. "
+"Only non-negative distances are allowed. The direction(s) of the added "
+"point(s) is determined by the first (and last) two distinct points of the "
+"line. Duplicate points are ignored."
+msgstr ""
+"Повертає лінію, продовжену вперед і назад шляхом додавання нових початкових ("
+"і кінцевих) точок на заданій відстані (відстанях). Відстань, рівна нулю, не "
+"додає точку. Допускаються тільки невід'ємні відстані. Напрямок доданих точок "
+"визначається першими (і останніми) двома відмінними точками лінії. "
+"Повторювані точки ігноруються."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Extends a line 5 units forward and 6 units backward"
+msgstr "Приклад: Продовжує лінію на 5 одиниць вперед і 6 одиниць назад"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LocateAlong\"/>, <xref linkend=\"ST_Project\"/>"
+msgstr ", <xref linkend=\"ST_LocateAlong\"/>, <xref linkend=\"ST_Project\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Converts a linear geometry to a curved geometry."
+msgstr "Перетворює лінійну геометрію на криву геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converts plain LINESTRING/POLYGON to CIRCULAR STRINGs and Curved Polygons. "
+"Note much fewer points are needed to describe the curved equivalent."
+msgstr ""
+"Перетворює прості LINESTRING/POLYGON в CIRCULAR STRINGs і вигнуті полігони. "
+"Зверніть увагу, що для опису вигнутого еквівалента потрібно набагато менше "
+"точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the input LINESTRING/POLYGON is not curved enough to clearly represent a "
+"curve, the function will return the same input geometry."
+msgstr ""
+"Якщо вхідні дані LINESTRING/POLYGON недостатньо вигнуті, щоб чітко "
+"відобразити криву, функція поверне ту саму вхідну геометрію."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the geometry as a MULTI* geometry."
+msgstr "Повернути геометрію як геометрію MULTI*."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the geometry as a MULTI* geometry collection. If the geometry is "
+"already a collection, it is returned unchanged."
+msgstr ""
+"Повертає геометрію як колекцію геометрії MULTI*. Якщо геометрія вже є "
+"колекцією, вона повертається без змін."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the geometry in its canonical form."
+msgstr "Повернути геометрію в канонічній формі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the geometry in its normalized/canonical form. May reorder vertices "
+"in polygon rings, rings in a polygon, elements in a multi-geometry complex."
+msgstr ""
+"Повертає геометрію в нормалізованому/канонічному вигляді. Може змінювати "
+"порядок вершин у кільцях полігонів, кільцях у полігоні, елементах у "
+"багатогеометричному комплексі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Mostly only useful for testing purposes (comparing expected and obtained "
+"results)."
+msgstr ""
+"В основному корисний тільки для тестування (порівняння очікуваних і "
+"отриманих результатів)."
+
+#. Tag: para
+#, no-c-format
+msgid "<para>,</para>"
+msgstr "<para>,</para>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a point projected from a start point by a distance and bearing "
+"(azimuth)."
+msgstr "Повертає точку, спроектовану від початкової точки на відстань і азимут."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a point projected from a point along a geodesic using a given "
+"distance and azimuth (bearing). This is known as the direct geodesic problem."
+msgstr ""
+"Повертає точку, спроектовану з точки вздовж геодезичної лінії з "
+"використанням заданої відстані та азимута (пеленга). Це відоме як пряма "
+"геодезична задача."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The two-point version uses the path from the first to the second point to "
+"implicitly define the azimuth and uses the distance as before."
+msgstr ""
+"Двоточкова версія використовує шлях від першої до другої точки для неявного "
+"визначення азимута і використовує відстань, як і раніше."
+
+#. Tag: para
+#, no-c-format
+msgid "The distance is given in meters. Negative values are supported."
+msgstr "Відстань вказана в метрах. Підтримуються від'ємні значення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The azimuth (also known as heading or bearing) is given in radians. It is "
+"measured clockwise from true north."
+msgstr ""
+"Азимут (також відомий як курс або пеленг) вимірюється в радіанах. Він "
+"вимірюється за годинниковою стрілкою від справжнього півночі."
+
+#. Tag: para
+#, no-c-format
+msgid "North is azimuth zero (0 degrees)"
+msgstr "Північ — це азимут нуль (0 градусів)"
+
+#. Tag: para
+#, no-c-format
+msgid "East is azimuth π/2 (90 degrees)"
+msgstr "Схід — азимут π/2 (90 градусів)"
+
+#. Tag: para
+#, no-c-format
+msgid "South is azimuth π (180 degrees)"
+msgstr "Південь — азимут π (180 градусів)"
+
+#. Tag: para
+#, no-c-format
+msgid "West is azimuth 3π/2 (270 degrees)"
+msgstr "Захід знаходиться на азимуті 3π/2 (270 градусів)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Negative azimuth values and values greater than 2π (360 degrees) are "
+"supported."
+msgstr ""
+"Підтримуються від'ємні значення азимута та значення, більші за 2π ("
+"360 градусів)."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.4.0 Allow negative distance and non-normalized azimuth."
+msgstr ""
+"Покращено: 2.4.0 Дозволено негативну відстань і ненормалізований азимут."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.4.0 Allow geometry arguments and two-point form omitting azimuth."
+msgstr ""
+"Покращено: 3.4.0 Дозволено аргументи геометрії та двоточкову форму з "
+"пропуском азимута."
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Projected point at 100,000 meters and bearing 45 degrees"
+msgstr ""
+"Приклад: Проекційна точка на відстані 100 000 метрів і пеленг 45 градусів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Distance\"/>, <link xlink:href=\"http://www.postgresql."
+"org/docs/current/interactive/functions-math.html\">PostgreSQL function "
+"radians()</link>"
+msgstr ""
+", <xref linkend=\"ST_Distance\"/>, <link xlink:href=\"http://www.postgresql."
+"org/docs/current/interactive/functions-math.html\">Функція PostgreSQL "
+"radians()</link>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Sets least significant bits of coordinates to zero"
+msgstr "Встановлює найменш значущі біти координат у нуль"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>ST_QuantizeCoordinates</code> determines the number of bits (<code>N</"
+"code>) required to represent a coordinate value with a specified number of "
+"digits after the decimal point, and then sets all but the <code>N</code> "
+"most significant bits to zero. The resulting coordinate value will still "
+"round to the original value, but will have improved compressiblity. This can "
+"result in a significant disk usage reduction provided that the geometry "
+"column is using a <link xlink:href=\"https://www.postgresql.org/docs/current/"
+"static/storage-toast.html#STORAGE-TOAST-ONDISK\"> compressible storage type</"
+"link>. The function allows specification of a different number of digits "
+"after the decimal point in each dimension; unspecified dimensions are "
+"assumed to have the precision of the <code>x</code> dimension. Negative "
+"digits are interpreted to refer digits to the left of the decimal point, (i."
+"e., <code>prec_x=-2</code> will preserve coordinate values to the nearest "
+"100."
+msgstr ""
+"<code>ST_QuantizeCoordinates</code> визначає кількість бітів (<code>N</code>)"
+", необхідних для представлення значення координати з заданою кількістю цифр "
+"після десяткової крапки, а потім встановлює всі біти, крім <code>N</code> "
+"найстарших, в нуль. Отримане значення координати все одно буде округлено до "
+"початкового значення, але його стисливість буде покращено. Це може призвести "
+"до значного зменшення використання дискового простору за умови, що стовпець "
+"геометрії використовує <link xlink:href=\"https://www.postgresql.org/docs/"
+"current/static/storage-toast.html#STORAGE-TOAST-ONDISK\"> стисливий тип "
+"зберігання</link>. Функція дозволяє вказати різну кількість цифр після "
+"десяткової крапки в кожному вимірі; невизначені виміри вважаються такими, що "
+"мають точність виміру <code>x</code>. Негативні цифри інтерпретуються як "
+"цифри ліворуч від десяткової крапки (тобто <code>prec_x=-2</code> збереже "
+"значення координат з точністю до 100."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The coordinates produced by <code>ST_QuantizeCoordinates</code> are "
+"independent of the geometry that contains those coordinates and the relative "
+"position of those coordinates within the geometry. As a result, existing "
+"topological relationships between geometries are unaffected by use of this "
+"function. The function may produce invalid geometry when it is called with a "
+"number of digits lower than the intrinsic precision of the geometry."
+msgstr ""
+"Координати, отримані за допомогою <code>ST_QuantizeCoordinates</code>, не "
+"залежать від геометрії, що містить ці координати, та відносного положення "
+"цих координат у геометрії. Як результат, використання цієї функції не "
+"впливає на існуючі топологічні відносини між геометріями. Функція може "
+"створити недійсну геометрію, якщо її викликати з кількістю цифр, меншою за "
+"внутрішню точність геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.5.0"
+msgstr "Доступність: 2.5.0"
+
+#. Tag: title
+#, no-c-format
+msgid "Technical Background"
+msgstr "Технічна інформація"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS stores all coordinate values as double-precision floating point "
+"integers, which can reliably represent 15 significant digits. However, "
+"PostGIS may be used to manage data that intrinsically has fewer than 15 "
+"significant digits. An example is TIGER data, which is provided as "
+"geographic coordinates with six digits of precision after the decimal point "
+"(thus requiring only nine significant digits of longitude and eight "
+"significant digits of latitude.)"
+msgstr ""
+"PostGIS зберігає всі значення координат у вигляді цілих чисел з подвійною "
+"точністю, які можуть надійно представляти 15 значущих цифр. Однак PostGIS "
+"може використовуватися для управління даними, які за своєю суттю мають менше "
+"15 значущих цифр. Прикладом є дані TIGER, які надаються у вигляді "
+"географічних координат з точністю до шести цифр після десяткової крапки ("
+"отже, потрібно лише дев'ять значущих цифр довготи та вісім значущих цифр "
+"широти)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When 15 significant digits are available, there are many possible "
+"representations of a number with 9 significant digits. A double precision "
+"floating point number uses 52 explicit bits to represent the significand "
+"(mantissa) of the coordinate. Only 30 bits are needed to represent a "
+"mantissa with 9 significant digits, leaving 22 insignificant bits; we can "
+"set their value to anything we like and still end up with a number that "
+"rounds to our input value. For example, the value 100.123456 can be "
+"represented by the floating point numbers closest to 100.123456000000, "
+"100.123456000001, and 100.123456432199. All are equally valid, in that "
+"<code>ST_AsText(geom, 6)</code> will return the same result with any of "
+"these inputs. As we can set these bits to any value, "
+"<code>ST_QuantizeCoordinates</code> sets the 22 insignificant bits to zero. "
+"For a long coordinate sequence this creates a pattern of blocks of "
+"consecutive zeros that is compressed by PostgreSQL more efficiently."
+msgstr ""
+"Коли доступно 15 значущих цифр, існує багато можливих представлень числа з 9 "
+"значущими цифрами. Число з подвійною точністю з плаваючою комою використовує "
+"52 явних біти для представлення значущої частини (мантиси) координати. Для "
+"представлення мантиси з 9 значущими цифрами потрібно лише 30 бітів, що "
+"залишає 22 не значущих біти; ми можемо встановити їх значення на будь-яке, "
+"яке нам подобається, і все одно отримаємо число, яке округлюється до "
+"вхідного значення. Наприклад, значення 100,123456 можна представити числами "
+"з плаваючою комою, найближчими до 100,123456000000, 100,123456000001 та "
+"100,123456432199. Усі вони є однаково дійсними, оскільки <code>ST_AsText("
+"geom, 6)</code> поверне однаковий результат для будь-якого з цих вхідних "
+"значень. Оскільки ми можемо встановити ці біти на будь-яке значення, "
+"<code>ST_QuantizeCoordinates</code> встановлює 22 незначущі біти на нуль. "
+"Для довгої послідовності координат це створює шаблон блоків послідовних "
+"нулів, який PostgreSQL стискає більш ефективно."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Only the on-disk size of the geometry is potentially affected by "
+"<code>ST_QuantizeCoordinates</code>. <xref linkend=\"ST_MemSize\"/>, which "
+"reports the in-memory usage of the geometry, will return the the same value "
+"regardless of the disk space used by a geometry."
+msgstr ""
+"На розмір геометрії на диску потенційно впливає лише "
+"<code>ST_QuantizeCoordinates</code>. <xref linkend=\"ST_MemSize\"/>, який "
+"повідомляє про використання геометрії в пам'яті, поверне те саме значення "
+"незалежно від дискового простору, який використовує геометрія."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Remove a point from a linestring."
+msgstr "Видалити точку з лінії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Removes a point from a LineString, given its index (0-based). Useful for "
+"turning a closed line (ring) into an open linestring."
+msgstr ""
+"Видаляє точку з LineString, задавши її індекс (починаючи з 0). Корисно для "
+"перетворення замкнутої лінії (кільця) у відкриту лінію."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.2.0"
+msgstr "Покращено: 3.2.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Guarantees no lines are closed by removing the end point of closed lines "
+"(rings). Assumes geom is of type LINESTRING"
+msgstr ""
+"Гарантує, що лінії не будуть закриті, видаляючи кінцеву точку закритих ліній "
+"(кільця). Припускає, що геометрична фігура має тип LINESTRING"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_NPoints\"/>, <xref linkend=\"ST_NumPoints\"/>"
+msgstr ", <xref linkend=\"ST_NPoints\"/>, <xref linkend=\"ST_NumPoints\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a version of a geometry with duplicate points removed."
+msgstr "Повертає версію геометрії з видаленими дублікатами точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a version of the given geometry with duplicate consecutive points "
+"removed. The function processes only (Multi)LineStrings, (Multi)Polygons and "
+"MultiPoints but it can be called with any kind of geometry. Elements of "
+"GeometryCollections are processed individually. The endpoints of LineStrings "
+"are preserved."
+msgstr ""
+"Повертає версію заданої геометрії з видаленими дублюючими послідовними "
+"точками. Функція обробляє тільки (Multi)LineStrings, (Multi)Polygons і "
+"MultiPoints, але її можна викликати з будь-яким типом геометрії. Елементи "
+"GeometryCollections обробляються індивідуально. Кінцеві точки LineStrings "
+"зберігаються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If a non-zero <parameter>tolerance</parameter> parameter is provided, "
+"vertices within the tolerance distance of one another are considered to be "
+"duplicates. The distance is computed in 2D (XY plane)."
+msgstr ""
+"Якщо вказано ненульовий параметр <parameter>tolerance</parameter>, вершини, "
+"що знаходяться на відстані, яка не перевищує допуск, вважаються дублікатами. "
+"Відстань обчислюється у 2D (площина XY)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Collection elements are "
+"processed individually."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Елементи колекції обробляються "
+"окремо."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Repeated point removal with a "
+"distance tolerance."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Повторне видалення точок з "
+"допуском відстані."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Removes points that are irrelevant for rendering a specific rectangular view "
+"of a geometry."
+msgstr ""
+"Видаляє точки, які не мають значення для візуалізації певного прямокутного "
+"виду геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <xref linkend=\"geometry\"/> without points being irrelevant for "
+"rendering the geometry within a given rectangular view."
+msgstr ""
+"Повертає <xref linkend=\"geometry\"/>без точок, що не мають значення для "
+"візуалізації геометрії в заданому прямокутному вікні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function can be used to quickly preprocess geometries that should be "
+"rendered only within certain bounds."
+msgstr ""
+"Ця функція може бути використана для швидкої попередньої обробки геометрій, "
+"які повинні бути відтворені тільки в певних межах."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Only geometries of type (MULTI)POLYGON and (MULTI)LINESTRING are evaluated. "
+"Other geometries keep unchanged."
+msgstr ""
+"Оцінюються тільки геометрії типу (MULTI)POLYGON і (MULTI)LINESTRING. Інші "
+"геометрії залишаються без змін."
+
+#. Tag: para
+#, no-c-format
+msgid "In contrast to <code>ST_ClipByBox2D()</code> this function"
+msgstr "На відміну від <code>ST_ClipByBox2D()</code>, ця функція"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"sorts out points without computing new intersection points which avoids "
+"rounding errors and usually increases performance,"
+msgstr ""
+"сортує точки без обчислення нових точок перетину, що дозволяє уникнути "
+"помилок округлення і, як правило, підвищує продуктивність,"
+
+#. Tag: para
+#, no-c-format
+msgid "returns a geometry with equal or similar point number,"
+msgstr "повертає геометрію з однаковою або схожою кількістю точок,"
+
+#. Tag: para
+#, no-c-format
+msgid "leads to the same rendering result within the specified view, and"
+msgstr ""
+"призводить до однакового результату візуалізації в межах заданого виду, і"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"may introduce self-intersections which would make the resulting geometry "
+"invalid (see example below)."
+msgstr ""
+"може призвести до самоперетину, що зробить отриману геометрію недійсною ("
+"див. приклад нижче)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <code>cartesian_hint</code> is set to <code>true</code>, the algorithm "
+"applies additional optimizations involving cartesian math to further reduce "
+"the resulting point number. Please note that using this option might "
+"introduce rendering artifacts if the resulting coordinates are projected "
+"into another (non-cartesian) coordinate system before rendering."
+msgstr ""
+"Якщо <code>cartesian_hint</code> встановлено на <code>true</code>, алгоритм "
+"застосовує додаткові оптимізації, що включають декартову математику, для "
+"подальшого зменшення кількості отриманих точок. Зверніть увагу, що "
+"використання цієї опції може призвести до появи артефактів рендерингу, якщо "
+"отримані координати перед рендерингом проектуються в іншу (не декартову) "
+"систему координат."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For polygons, this function does currently not ensure that the result is "
+"valid. This situation can be checked with <xref linkend=\"ST_IsValid\"/> and "
+"repaired with <xref linkend=\"ST_MakeValid\"/>."
+msgstr ""
+"Для полігонів ця функція наразі не гарантує, що результат є дійсним. Цю "
+"ситуацію можна перевірити за допомогою <xref linkend=\"ST_IsValid\"/> та "
+"виправити за допомогою <xref linkend=\"ST_MakeValid\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example: ST_RemoveIrrelevantPointsForView() applied to a polygon. Blue "
+"points remain, the rendering result (light-blue area) within the grey view "
+"box remains as well."
+msgstr ""
+"Приклад: ST_RemoveIrrelevantPointsForView() застосовано до полігону. Сині "
+"точки залишаються, результат візуалізації (світло-синя область) у сірій "
+"області перегляду також залишається."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example: Due to the fact that points are just sorted out and no new points "
+"are computed, the result of ST_RemoveIrrelevantPointsForView() may contain "
+"self-intersections."
+msgstr ""
+"Приклад: Оскільки точки лише сортуються і нові точки не обчислюються, "
+"результат функції ST_RemoveIrrelevantPointsForView() може містити "
+"самоперетини."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Intersection\"/>"
+msgstr ", <xref linkend=\"ST_Intersection\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Removes small parts (polygon rings or linestrings) of a geometry."
+msgstr "Видаляє невеликі частини (кільця полігону або лінії) геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <xref linkend=\"geometry\"/> without small parts (exterior or "
+"interior polygon rings, or linestrings)."
+msgstr ""
+"Повертає <xref linkend=\"geometry\"/> без дрібних частин (зовнішніх або "
+"внутрішніх кілець полігону або лінійних елементів)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function can be used as preprocessing step for creating simplified "
+"maps, e. g. to remove small islands or holes."
+msgstr ""
+"Ця функція може бути використана як попередній етап обробки для створення "
+"спрощених карт, наприклад, для видалення невеликих островів або отворів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It evaluates only geometries of type (MULTI)POLYGON and (MULTI)LINESTRING. "
+"Other geometries remain unchanged."
+msgstr ""
+"Він оцінює тільки геометрії типу (MULTI)POLYGON і (MULTI)LINESTRING. Інші "
+"геометрії залишаються без змін."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <parameter>minSizeX</parameter> is greater than 0, parts are sorted out "
+"if their width is smaller than <parameter>minSizeX</parameter>."
+msgstr ""
+"Якщо <parameter>minSizeX</parameter> більше 0, частини сортуються, якщо їх "
+"ширина менше <parameter>minSizeX</parameter>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <parameter>minSizeY</parameter> is greater than 0, parts are sorted out "
+"if their height is smaller than <parameter>minSizeY</parameter>."
+msgstr ""
+"Якщо <parameter>minSizeY</parameter> більше 0, деталі сортуються, якщо їх "
+"висота менше <parameter>minSizeY</parameter>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Both <parameter>minSizeX</parameter> and <parameter>minSizeY</parameter> are "
+"measured in coordinate system units of the geometry."
+msgstr ""
+"Обидва параметри <parameter>minSizeX</parameter> та <parameter>minSizeY</"
+"parameter> вимірюються в одиницях системи координат геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For polygon types, evaluation is done separately for each ring which can "
+"lead to one of the following results:"
+msgstr ""
+"Для типів полігонів оцінка проводиться окремо для кожного кільця, що може "
+"призвести до одного з наступних результатів:"
+
+#. Tag: para
+#, no-c-format
+msgid "the original geometry,"
+msgstr "оригінальна геометрія,"
+
+#. Tag: para
+#, no-c-format
+msgid "a POLYGON with all rings with less vertices,"
+msgstr "POLYGON з усіма кільцями з меншою кількістю вершин,"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"a POLYGON with a reduced number of interior rings (having possibly less "
+"vertices),"
+msgstr ""
+"POLYGON зі зменшеною кількістю внутрішніх кілець (можливо, з меншою "
+"кількістю вершин),"
+
+#. Tag: para
+#, no-c-format
+msgid "a POLYGON EMPTY, or"
+msgstr "POLYGON EMPTY, або"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"a MULTIPOLYGON with a reduced number of polygons (having possibly less "
+"interior rings or vertices), or"
+msgstr ""
+"MULTIPOLYGON зі зменшеною кількістю полігонів (можливо, з меншою кількістю "
+"внутрішніх кілець або вершин), або"
+
+#. Tag: para
+#, no-c-format
+msgid "a MULTIPOLYGON EMPTY."
+msgstr "MULTIPOLYGON EMPTY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For linestring types, evaluation is done for each linestring which can lead "
+"to one of the following results:"
+msgstr ""
+"Для типів лінійних рядків оцінка виконується для кожної лінії, що може "
+"призвести до одного з таких результатів:"
+
+#. Tag: para
+#, no-c-format
+msgid "a LINESTRING with a reduced number of vertices,"
+msgstr "LINESTRING зі зменшеною кількістю вершин,"
+
+#. Tag: para
+#, no-c-format
+msgid "a LINESTRING EMPTY,"
+msgstr "LINESTRING EMPTY,"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"a MULTILINESTRING with a reduced number of linestrings (having possibly less "
+"vertices), or"
+msgstr ""
+"MULTILINESTRING зі зменшеною кількістю лінійних ланцюгів (які можуть мати "
+"менше вершин), або"
+
+#. Tag: para
+#, no-c-format
+msgid "a MULTILINESTRING EMPTY."
+msgstr "MULTILINESTRING EMPTY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example: ST_RemoveSmallParts() applied to a multi-polygon. Blue parts remain."
+msgstr ""
+"Приклад: ST_RemoveSmallParts() застосовано до мультиполігону. Сині частини "
+"залишаються."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the geometry with vertex order reversed."
+msgstr "Повернути геометрію з оберненим порядком вершин."
+
+#. Tag: para
+#, no-c-format
+msgid "Can be used on any geometry and reverses the order of the vertices."
+msgstr ""
+"Може використовуватися для будь-якої геометрії та змінює порядок вершин."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.4.0 support for curves was introduced."
+msgstr "Покращено: 2.4.0 додано підтримку кривих."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a modified geometry/geography having no segment longer than a given "
+"distance."
+msgstr ""
+"Повертає змінену геометрію/географію, в якій немає сегментів, довжина яких "
+"перевищує задану відстань."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a modified geometry/geography having no segment longer than "
+"<varname>max_segment_length</varname>. Length is computed in 2D. Segments "
+"are always split into equal-length subsegments."
+msgstr ""
+"Повертає змінену геометрію/географію, в якій немає сегментів довжиною більше "
+"<varname>max_segment_length</varname>. Довжина обчислюється у 2D. Сегменти "
+"завжди розділяються на підсегменти однакової довжини."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geometry, the maximum length is in the units of the spatial reference "
+"system."
+msgstr ""
+"Для геометрії максимальна довжина вимірюється в одиницях просторової системи "
+"відліку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography, the maximum length is in meters. Distances are computed on "
+"the sphere. Added vertices are created along the spherical great-circle arcs "
+"defined by segment endpoints."
+msgstr ""
+"Для географії максимальна довжина вимірюється в метрах. Відстані "
+"обчислюються на сфері. Додані вершини створюються вздовж дуг сферичного "
+"великого кола, визначених кінцевими точками відрізків."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This only shortens long segments. It does not lengthen segments shorter than "
+"the maximum length."
+msgstr ""
+"Це тільки скорочує довгі сегменти. Сегменти, довжина яких не перевищує "
+"максимальну, не подовжуються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For inputs containing long segments, specifying a relatively short "
+"<varname>max_segment_length</varname> can cause a very large number of "
+"vertices to be added. This can happen unintentionally if the argument is "
+"specified accidentally as a number of segments, rather than a maximum length."
+msgstr ""
+"Для вхідних даних, що містять довгі сегменти, вказання відносно короткого "
+"<varname>max_segment_length</varname> може призвести до додавання дуже "
+"великої кількості вершин. Це може статися ненавмисно, якщо аргумент "
+"випадково вказано як кількість сегментів, а не максимальну довжину."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.0.0 Segmentize geometry now produces equal-length subsegments"
+msgstr ""
+"Покращено: 3.0.0 Сегментація геометрії тепер створює підсегменти однакової "
+"довжини"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.3.0 Segmentize geography now produces equal-length subsegments"
+msgstr ""
+"Покращено: 2.3.0 Сегментація географії тепер створює підсегменти однакової "
+"довжини"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 support for geography was introduced."
+msgstr "Покращено: 2.1.0 додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.1.0 As a result of the introduction of geography support, the "
+"usage <code>ST_Segmentize('LINESTRING(1 2, 3 4)', 0.5)</code> causes an "
+"ambiguous function error. The input needs to be properly typed as a geometry "
+"or geography. Use ST_GeomFromText, ST_GeogFromText or a cast to the required "
+"type (e.g. <code>ST_Segmentize('LINESTRING(1 2, 3 4)'::geometry, 0.5) )</"
+"code>"
+msgstr ""
+"Змінено: 2.1.0 В результаті впровадження підтримки географії використання "
+"<code>ST_Segmentize(“LINESTRING(1 2, 3 4)”, 0.5)</code> спричиняє помилку "
+"неоднозначної функції. Вхідні дані потрібно правильно вказати як геометрію "
+"або географію. Використовуйте ST_GeomFromText, ST_GeogFromText або "
+"перетворення до необхідного типу (наприклад, <code>ST_Segmentize(“LINESTRING("
+"1 2, 3 4)”::geometry, 0.5) )</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Segmentizing a line. Long segments are split evenly, and short segments are "
+"not split."
+msgstr ""
+"Сегментація лінії. Довгі сегменти розділяються рівномірно, а короткі "
+"сегменти не розділяються."
+
+#. Tag: para
+#, no-c-format
+msgid "Segmentizing a polygon:"
+msgstr "Сегментація полігону:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Segmentizing a geographic line, using a maximum segment length of 2000 "
+"kilometers. Vertices are added along the great-circle arc connecting the "
+"endpoints."
+msgstr ""
+"Сегментація географічної лінії з використанням максимальної довжини сегмента "
+"2000 кілометрів. Вершини додаються вздовж дуги великого кола, що з'єднує "
+"кінцеві точки."
+
+#. Tag: para
+#, no-c-format
+msgid "A geographic line segmentized along a great circle arc"
+msgstr "Географічна лінія, сегментована вздовж дуги великого кола"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Replace point of a linestring with a given point."
+msgstr "Замінити точку лінійного об'єкта на задану точку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Replace point N of linestring with given point. Index is 0-based.Negative "
+"index are counted backwards, so that -1 is last point. This is especially "
+"useful in triggers when trying to maintain relationship of joints when one "
+"vertex moves."
+msgstr ""
+"Замінити точку N лінійного елемента на задану точку. Індекс починається з 0. "
+"Негативні індекси рахуються назад, так що -1 є останньою точкою. Це особливо "
+"корисно в тригерах, коли потрібно зберегти зв'язки між суглобами при "
+"переміщенні однієї вершини."
+
+#. Tag: para
+#, no-c-format
+msgid "Updated 2.3.0 : negative indexing"
+msgstr "Оновлено 2.3.0: негативна індексація"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_NPoints\"/>, <xref linkend=\"ST_NumPoints\"/>, <xref "
+"linkend=\"ST_PointN\"/>, <xref linkend=\"ST_RemovePoint\"/>"
+msgstr ""
+", <xref linkend=\"ST_NPoints\"/>, <xref linkend=\"ST_NumPoints\"/>, <xref "
+"linkend=\"ST_PointN\"/>, <xref linkend=\"ST_RemovePoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Shifts the longitude coordinates of a geometry between -180..180 and 0..360."
+msgstr ""
+"Змінює координати довготи геометрії в діапазоні від -180 до 180 і від 0 до "
+"360."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reads every point/vertex in a geometry, and shifts its longitude coordinate "
+"from -180..0 to 180..360 and vice versa if between these ranges. This "
+"function is symmetrical so the result is a 0..360 representation of a "
+"-180..180 data and a -180..180 representation of a 0..360 data."
+msgstr ""
+"Зчитує кожну точку/вершину в геометрії та зміщує її координату довготи з -"
+"180..0 на 180..360 і навпаки, якщо вона знаходиться в цих діапазонах. Ця "
+"функція є симетричною, тому результатом є представлення даних -180..180 у "
+"вигляді 0..360 та представлення даних 0..360 у вигляді -180..180."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is only useful for data with coordinates in longitude/latitude; e.g. "
+"SRID 4326 (WGS 84 geographic)"
+msgstr ""
+"Це корисно тільки для даних з координатами в довготі/широті; наприклад, SRID "
+"4326 (географічна система WGS 84)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Pre-1.3.4 bug prevented this from working for MULTIPOINT. 1.3.4+ works with "
+"MULTIPOINT as well."
+msgstr ""
+"Помилка версії до 1.3.4 заважала цій функції працювати з MULTIPOINT. Версія 1"
+".3.4+ також працює з MULTIPOINT."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 support for Polyhedral surfaces and TIN was introduced."
+msgstr "Покращено: 2.0.0 додано підтримку багатогранних поверхонь та TIN."
+
+#. Tag: para
+#, no-c-format
+msgid "NOTE: this function was renamed from \"ST_Shift_Longitude\" in 2.2.0"
+msgstr ""
+"ПРИМІТКА: ця функція була перейменована з \"ST_Shift_Longitude\" у версії 2.2.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Wrap a geometry around an X value."
+msgstr "Оберніть геометрію навколо значення X."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function splits the input geometries and then moves every resulting "
+"component falling on the right (for negative 'move') or on the left (for "
+"positive 'move') of given 'wrap' line in the direction specified by the "
+"'move' parameter, finally re-unioning the pieces together."
+msgstr ""
+"Ця функція розділяє вхідні геометрії, а потім переміщує кожен отриманий "
+"компонент, що потрапляє праворуч (для від'ємного значення “move”) або "
+"ліворуч (для додатного значення “move”) від заданої лінії “wrap” у напрямку, "
+"визначеному параметром “move”, і нарешті знову об'єднує частини разом."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is useful to \"recenter\" long-lat input to have features of interest "
+"not spawned from one side to the other."
+msgstr ""
+"Це корисно для \"перецентрування\" вхідних даних довготи та широти, щоб "
+"об'єкти, що представляють інтерес, не з'являлися з одного боку на інший."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.3.0 requires GEOS"
+msgstr "Доступність: 2.3.0 вимагає GEOS"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Snap all points of the input geometry to a regular grid."
+msgstr "Прив'яжіть всі точки вхідної геометрії до регулярної сітки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 1,2,3: Snap all points of the input geometry to the grid defined by "
+"its origin and cell size. Remove consecutive points falling on the same "
+"cell, eventually returning NULL if output points are not enough to define a "
+"geometry of the given type. Collapsed geometries in a collection are "
+"stripped from it. Useful for reducing precision."
+msgstr ""
+"Варіант 1,2,3: Прив'язати всі точки вхідної геометрії до сітки, визначеної "
+"її початком і розміром комірки. Видалити послідовні точки, що потрапляють на "
+"одну комірку, і в кінцевому підсумку повернути NULL, якщо вихідних точок "
+"недостатньо для визначення геометрії заданого типу. Зібрані геометрії в "
+"колекції видаляються з неї. Корисно для зменшення точності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 4: Introduced 1.1.0 - Snap all points of the input geometry to the "
+"grid defined by its origin (the second argument, must be a point) and cell "
+"sizes. Specify 0 as size for any dimension you don't want to snap to a grid."
+msgstr ""
+"Варіант 4: Введено в версії 1.1.0 — прив'язує всі точки вхідної геометрії до "
+"сітки, визначеної її початком (другий аргумент, повинен бути точкою) і "
+"розмірами комірок. Вкажіть 0 як розмір для будь-якого виміру, який не "
+"потрібно прив'язувати до сітки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The returned geometry might lose its simplicity (see <xref "
+"linkend=\"ST_IsSimple\"/>)."
+msgstr ""
+"Повернена геометрія може втратити свою простоту (див. <xref linkend="
+"\"ST_IsSimple\"/>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Before release 1.1.0 this function always returned a 2d geometry. Starting "
+"at 1.1.0 the returned geometry will have same dimensionality as the input "
+"one with higher dimension values untouched. Use the version taking a second "
+"geometry argument to define all grid dimensions."
+msgstr ""
+"До версії 1.1.0 ця функція завжди повертала 2D-геометрію. Починаючи з версії "
+"1.1.0, повернена геометрія матиме ту саму розмірність, що й вхідна, а "
+"значення вищих розмірностей залишатимуться незмінними. Використовуйте "
+"версію, що приймає другий аргумент геометрії, щоб визначити всі розмірності "
+"сітки."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.0.0RC1"
+msgstr "Доступність: 1.0.0RC1"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.0 - Z and M support"
+msgstr "Доступність: 1.1.0 - підтримка Z і M"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsEWKT\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>, <xref "
+"linkend=\"ST_Simplify\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsEWKT\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_GeomFromEWKT\"/>, <xref "
+"linkend=\"ST_Simplify\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Snap segments and vertices of input geometry to vertices of a reference "
+"geometry."
+msgstr ""
+"Прив'язати сегменти та вершини вхідної геометрії до вершин еталонної "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Snaps the vertices and segments of a geometry to another Geometry's "
+"vertices. A snap distance tolerance is used to control where snapping is "
+"performed. The result geometry is the input geometry with the vertices "
+"snapped. If no snapping occurs then the input geometry is returned unchanged."
+msgstr ""
+"Прив'язує вершини та сегменти геометрії до вершин іншої геометрії. Для "
+"контролю місця прив'язки використовується допуск відстані прив'язки. "
+"Результатом є геометрія з прив'язаними вершинами. Якщо прив'язка не "
+"відбувається, геометрія залишається без змін."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Snapping one geometry to another can improve robustness for overlay "
+"operations by eliminating nearly-coincident edges (which cause problems "
+"during noding and intersection calculation)."
+msgstr ""
+"З'єднання однієї геометрії з іншою може підвищити надійність операцій "
+"накладання, усуваючи майже збіжні краї (які спричиняють проблеми під час "
+"обчислення вузлів і перетинів)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Too much snapping can result in invalid topology being created, so the "
+"number and location of snapped vertices is decided using heuristics to "
+"determine when it is safe to snap. This can result in some potential snaps "
+"being omitted, however."
+msgstr ""
+"Занадто часте прив'язування може призвести до створення некоректної "
+"топології, тому кількість і розташування прив'язаних вершин визначається за "
+"допомогою евристичних методів, які визначають, коли прив'язування є "
+"безпечним. Однак це може призвести до пропуску деяких потенційних прив'язок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The returned geometry might lose its simplicity (see <xref "
+"linkend=\"ST_IsSimple\"/>) and validity (see <xref linkend=\"ST_IsValid\"/>)."
+msgstr ""
+"Повернена геометрія може втратити свою простоту (див. <xref linkend="
+"\"ST_IsSimple\"/>) та валідність (див. <xref linkend=\"ST_IsValid\"/>)."
+
+#. Tag: para
+#, no-c-format
+msgid "A multipolygon shown with a linestring (before any snapping)"
+msgstr "Мультиполігон, показаний лінією (до будь-якого прив'язування)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A multipolygon snapped to linestring to tolerance: 1.01 of distance. The new "
+"multipolygon is shown with reference linestring"
+msgstr ""
+"Мультиполігон, прив'язаний до лінії з точністю до 1,01 відстані. Новий "
+"мультиполігону відображається з посиланням на лінію"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A multipolygon snapped to linestring to tolerance: 1.25 of distance. The new "
+"multipolygon is shown with reference linestring"
+msgstr ""
+"Мультиполігон, прив'язаний до лінії з допуском: 1,25 відстані. Новий "
+"мультиполігон відображається з посиланням на лінію"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The linestring snapped to the original multipolygon at tolerance 1.01 of "
+"distance. The new linestring is shown with reference multipolygon"
+msgstr ""
+"Лінія прив'язалася до вихідного мультиполігону з допуском 1,01 відстані. "
+"Нова лінія відображається з посиланням на мультиполігон"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The linestring snapped to the original multipolygon at tolerance 1.25 of "
+"distance. The new linestring is shown with reference multipolygon"
+msgstr ""
+"Лінія прив'язалася до вихідного мультиполігону з допуском 1,25 відстані. "
+"Нова лінія відображається з посиланням на мультиполігон"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a version of the given geometry with given ordinate values swapped."
+msgstr "Повертає версію заданої геометрії із заміненими значеннями ординат."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns a version of the given geometry with given ordinates swapped."
+msgstr "Повертає версію заданої геометрії із заміненими заданими координатами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ords</varname> parameter is a 2-characters string naming the "
+"ordinates to swap. Valid names are: x,y,z and m."
+msgstr ""
+"Параметр <varname>ords</varname> — це 2-символьний рядок, що позначає "
+"координати, які потрібно поміняти місцями. Допустимі імена: x, y, z та m."
+
+#. Tag: title
+#, no-c-format
+msgid "Exceptional Functions"
+msgstr "Особливі функції"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions are rarely used functions that should only be used if your "
+"data is corrupted in someway. They are used for troubleshooting corruption "
+"and also fixing things that should under normal circumstances, never happen."
+msgstr ""
+"Ці функції використовуються рідко і застосовуються лише у випадку "
+"пошкодження даних. Вони призначені для усунення несправностей та виправлення "
+"помилок, які за звичайних обставин не повинні виникати."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Add bounding box to the geometry."
+msgstr "Додати обмежувальну рамку до геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Add bounding box to the geometry. This would make bounding box based queries "
+"faster, but will increase the size of the geometry."
+msgstr ""
+"Додати обмежувальну рамку до геометрії. Це пришвидшить запити на основі "
+"обмежувальної рамки, але збільшить розмір геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Bounding boxes are automatically added to geometries so in general this is "
+"not needed unless the generated bounding box somehow becomes corrupted or "
+"you have an old install that is lacking bounding boxes. Then you need to "
+"drop the old and re-add."
+msgstr ""
+"Обмежувальні рамки автоматично додаються до геометрій, тому, як правило, це "
+"не потрібно, якщо тільки створена обмежувальна рамка якимось чином не "
+"пошкодилася або у вас стара версія, в якій відсутні обмежувальні рамки. Тоді "
+"вам потрібно видалити стару і додати нову."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"PostGIS_HasBBox\"/>"
+msgstr ", <xref linkend=\"PostGIS_HasBBox\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Drop the bounding box cache from the geometry."
+msgstr "Видалити кеш обмежувальної рамки з геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Drop the bounding box cache from the geometry. This reduces geometry size, "
+"but makes bounding-box based queries slower. It is also used to drop a "
+"corrupt bounding box. A tale-tell sign of a corrupt cached bounding box is "
+"when your ST_Intersects and other relation queries leave out geometries that "
+"rightfully should return true."
+msgstr ""
+"Видалити кеш обмежувальної рамки з геометрії. Це зменшує розмір геометрії, "
+"але уповільнює запити на основі обмежувальної рамки. Також використовується "
+"для видалення пошкодженої обмежувальної рамки. Ознакою пошкодження кешованої "
+"обмежувальної рамки є те, що ST_Intersects та інші запити на відношення "
+"пропускають геометрії, які повинні повертати значення true."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Bounding boxes are automatically added to geometries and improve speed of "
+"queries so in general this is not needed unless the generated bounding box "
+"somehow becomes corrupted or you have an old install that is lacking "
+"bounding boxes. Then you need to drop the old and re-add. This kind of "
+"corruption has been observed in 8.3-8.3.6 series whereby cached bboxes were "
+"not always recalculated when a geometry changed and upgrading to a newer "
+"version without a dump reload will not correct already corrupted boxes. So "
+"one can manually correct using below and re-add the bbox or do a dump reload."
+msgstr ""
+"Обмежувальні рамки автоматично додаються до геометрій і покращують швидкість "
+"запитів, тому, як правило, це не потрібно, якщо тільки створена обмежувальна "
+"рамка якимось чином не пошкодилася або у вас стара версія, в якій відсутні "
+"обмежувальні рамки. У такому випадку потрібно видалити старі та додати "
+"заново. Таке пошкодження спостерігалося в серіях 8.3-8.3.6, де кешовані "
+"bboxes не завжди перераховувалися при зміні геометрії, і оновлення до нової "
+"версії без перезавантаження дампа не виправляє вже пошкоджені рамки. Тому "
+"можна вручну виправити за допомогою наведеного нижче коду та додати bbox "
+"заново або виконати перезавантаження дампа."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"PostGIS_HasBBox\"/>, <xref linkend=\"Box2D\"/>"
+msgstr ", <xref linkend=\"PostGIS_HasBBox\"/>, <xref linkend=\"Box2D\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns TRUE if the bbox of this geometry is cached, FALSE otherwise."
+msgstr ""
+"Повертає TRUE, якщо bbox цієї геометрії кешована, і FALSE в іншому випадку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns TRUE if the bbox of this geometry is cached, FALSE otherwise. Use "
+"<xref linkend=\"PostGIS_AddBBox\"/> and <xref linkend=\"PostGIS_DropBBox\"/> "
+"to control caching."
+msgstr ""
+"Повертає TRUE, якщо bbox цієї геометрії кешована, і FALSE в іншому випадку. "
+"Використовуйте <xref linkend=\"PostGIS_AddBBox\"/>та <xref linkend="
+"\"PostGIS_DropBBox\"/>для керування кешуванням."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"PostGIS_DropBBox\"/>"
+msgstr ", <xref linkend=\"PostGIS_DropBBox\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Grand Unified Custom Variables (GUCs)"
+msgstr "Великі уніфіковані змінні (GUC)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists custom PostGIS Grand Unified Custom Variables (GUC). "
+"These can be set globally, by database, by session or by transaction. Best "
+"set at global or database level."
+msgstr ""
+"У цьому розділі перелічено власні великі уніфіковані змінні PostGIS (GUC). "
+"Їх можна налаштувати глобально, для бази даних, для сеансу або для "
+"транзакції. Найкраще налаштовувати на глобальному рівні або на рівні бази "
+"даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more examples of usage refer to <link xlink:href=\"https://www."
+"postgresql.org/docs/current/sql-set.html\">SQL SET</link> and <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/sql-altersystem.html\">SQL "
+"ALTER SYSTEM</link>"
+msgstr ""
+"Більше прикладів використання див. <link xlink:href=\"https://www.postgresql."
+"org/docs/current/sql-set.html\">SQL SET</link> та <link "
+"xlink:href=\"https://www.postgresql.org/docs/current/sql-altersystem.html\""
+">SQL ALTER SYSTEM</link>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A configuration option to assign the value of GDAL's GDAL_DATA option. If "
+"not set, the environmentally set GDAL_DATA variable is used."
+msgstr ""
+"Параметр конфігурації для призначення значення параметра GDAL_DATA GDAL. "
+"Якщо не встановлено, використовується змінна GDAL_DATA, встановлена в "
+"середовищі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A PostgreSQL GUC variable for setting the value of GDAL's GDAL_DATA option. "
+"The <varname>postgis.gdal_datapath</varname> value should be the complete "
+"physical path to GDAL's data files."
+msgstr ""
+"Змінна PostgreSQL GUC для встановлення значення опції GDAL_DATA GDAL. "
+"Значення <varname>postgis.gdal_datapath</varname> повинно бути повним "
+"фізичним шляхом до файлів даних GDAL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This configuration option is of most use for Windows platforms where GDAL's "
+"data files path is not hard-coded. This option should also be set when "
+"GDAL's data files are not located in GDAL's expected path."
+msgstr ""
+"Ця опція конфігурації найбільш корисна для платформ Windows, де шлях до "
+"файлів даних GDAL не є жорстко заданим. Цю опцію також слід встановити, якщо "
+"файли даних GDAL не знаходяться в очікуваному GDAL шляху."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This option can be set in PostgreSQL's configuration file postgresql.conf. "
+"It can also be set by connection or transaction."
+msgstr ""
+"Цей параметр можна встановити у файлі конфігурації PostgreSQL "
+"postgresql.conf. Його також можна встановити для окремого з'єднання або "
+"транзакції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Additional information about GDAL_DATA is available at GDAL's <link xlink:"
+"href=\"https://gdal.org/user/configoptions.html\">Configuration Options</"
+"link>."
+msgstr ""
+"Додаткова інформація про GDAL_DATA доступна в розділі \"Параметри "
+"конфігурації\" на сайті GDAL <link xlink:href=\"https://gdal.org/user/"
+"configoptions.html\">Опція конфігурації</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "Set and reset <varname>postgis.gdal_datapath</varname>"
+msgstr "Встановити та скинути <varname>postgis.gdal_datapath</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "Setting on windows for a particular database"
+msgstr "Налаштування Windows для певної бази даних"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Transform\"/>"
+msgstr ", <xref linkend=\"RT_ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A configuration option to set the enabled GDAL drivers in the PostGIS "
+"environment. Affects the GDAL configuration variable GDAL_SKIP."
+msgstr ""
+"Параметр конфігурації для встановлення увімкнених драйверів GDAL у "
+"середовищі PostGIS. Впливає на змінну конфігурації GDAL GDAL_SKIP."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A configuration option to set the enabled GDAL drivers in the PostGIS "
+"environment. Affects the GDAL configuration variable GDAL_SKIP. This option "
+"can be set in PostgreSQL's configuration file: postgresql.conf. It can also "
+"be set by connection or transaction."
+msgstr ""
+"Параметр конфігурації для встановлення увімкнених драйверів GDAL у "
+"середовищі PostGIS. Впливає на змінну конфігурації GDAL GDAL_SKIP. Цей "
+"параметр можна встановити у файлі конфігурації PostgreSQL: postgresql.conf. "
+"Його також можна встановити для з'єднання або транзакції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The initial value of <varname>postgis.gdal_enabled_drivers</varname> may "
+"also be set by passing the environment variable "
+"<varname>POSTGIS_GDAL_ENABLED_DRIVERS</varname> with the list of enabled "
+"drivers to the process starting PostgreSQL."
+msgstr ""
+"Початкове значення <varname>postgis.gdal_enabled_drivers</varname> також "
+"можна встановити, передавши змінну середовища "
+"<varname>POSTGIS_GDAL_ENABLED_DRIVERS</varname> зі списком увімкнених "
+"драйверів процесу, що запускає PostgreSQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enabled GDAL specified drivers can be specified by the driver's short-name "
+"or code. Driver short-names or codes can be found at <link xlink:"
+"href=\"http://www.gdal.org/formats_list.html\">GDAL Raster Formats</link>. "
+"Multiple drivers can be specified by putting a space between each driver."
+msgstr ""
+"Увімкнені драйвери GDAL можна вказати за короткою назвою або кодом драйвера. "
+"Короткі назви або коди драйверів можна знайти за посиланням <link "
+"xlink:href=\"http://www.gdal.org/formats_list.html\">GDAL Raster Formats</"
+"link>. Можна вказати кілька драйверів, розділивши їх пробілом."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are three special codes available for <varname>postgis."
+"gdal_enabled_drivers</varname>. The codes are case-sensitive."
+msgstr ""
+"Для <varname>postgis.gdal_enabled_drivers</varname> доступні три спеціальні "
+"коди. Коди чутливі до регістру."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>DISABLE_ALL</varname> disables all GDAL drivers. If present, "
+"<varname>DISABLE_ALL</varname> overrides all other values in "
+"<varname>postgis.gdal_enabled_drivers</varname>."
+msgstr ""
+"<varname>DISABLE_ALL</varname> вимикає всі драйвери GDAL. Якщо присутній, "
+"<varname>DISABLE_ALL</varname> замінює всі інші значення в <varname>postgis."
+"gdal_enabled_drivers</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>ENABLE_ALL</varname> enables all GDAL drivers."
+msgstr "<varname>ENABLE_ALL</varname> вмикає всі драйвери GDAL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>VSICURL</varname> enables GDAL's <varname>/vsicurl/</varname> "
+"virtual file system."
+msgstr ""
+"<varname>VSICURL</varname> вмикає віртуальну файлову систему GDAL <varname>/"
+"vsicurl/</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When <varname>postgis.gdal_enabled_drivers</varname> is set to DISABLE_ALL, "
+"attempts to use out-db rasters, ST_FromGDALRaster(), ST_AsGDALRaster(), "
+"ST_AsTIFF(), ST_AsJPEG() and ST_AsPNG() will result in error messages."
+msgstr ""
+"Коли <varname>postgis.gdal_enabled_drivers</varname> встановлено на "
+"DISABLE_ALL, спроби використання растрів out-db, ST_FromGDALRaster(), "
+"ST_AsGDALRaster(), ST_AsTIFF(), ST_AsJPEG() та ST_AsPNG() призведуть до "
+"появи повідомлень про помилки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the standard PostGIS installation, <varname>postgis.gdal_enabled_drivers</"
+"varname> is set to DISABLE_ALL."
+msgstr ""
+"У стандартній установці PostGIS <varname>postgis.gdal_enabled_drivers</"
+"varname> встановлено на DISABLE_ALL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Additional information about GDAL_SKIP is available at GDAL's <link xlink:"
+"href=\"https://gdal.org/user/configoptions.html\">Configuration Options</"
+"link>."
+msgstr ""
+"Додаткова інформація про GDAL_SKIP доступна в розділі \"Параметри "
+"конфігурації\" на сайті GDAL <link xlink:href=\"https://gdal.org/user/"
+"configoptions.html\">Опція конфігурації</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To set and reset <varname>postgis.gdal_enabled_drivers</varname> for current "
+"session"
+msgstr ""
+"Встановити та скинути <varname>postgis.gdal_enabled_drivers</varname> для "
+"поточного сеансу"
+
+#. Tag: para
+#, no-c-format
+msgid "Set for all new connections to a specific database to specific drivers"
+msgstr ""
+"Встановити для всіх нових підключень до певної бази даних конкретні драйвери"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Setting for whole database cluster to enable all drivers. Requires super "
+"user access. Also note that database, session, and user settings override "
+"this."
+msgstr ""
+"Налаштування для всього кластера бази даних, щоб увімкнути всі драйвери. "
+"Потрібен доступ суперкористувача. Також зверніть увагу, що налаштування бази "
+"даних, сеансу та користувача мають пріоритет над цими налаштуваннями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_AsTIFF\"/>, "
+"<xref linkend=\"RT_ST_AsPNG\"/>, <xref linkend=\"RT_ST_AsJPEG\"/>, <xref "
+"linkend=\"postgis_enable_outdb_rasters\"/>"
+msgstr ""
+", <xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_AsTIFF\"/>, "
+"<xref linkend=\"RT_ST_AsPNG\"/>, <xref linkend=\"RT_ST_AsJPEG\"/>, <xref "
+"linkend=\"postgis_enable_outdb_rasters\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "A boolean configuration option to enable access to out-db raster bands."
+msgstr ""
+"Булева опція конфігурації для увімкнення доступу до растрових смуг out-db."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A boolean configuration option to enable access to out-db raster bands. This "
+"option can be set in PostgreSQL's configuration file: postgresql.conf. It "
+"can also be set by connection or transaction."
+msgstr ""
+"Булева опція конфігурації для увімкнення доступу до растрових смуг out-db. "
+"Цю опцію можна встановити у файлі конфігурації PostgreSQL: postgresql.conf. "
+"Її також можна встановити для з'єднання або транзакції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The initial value of <varname>postgis.enable_outdb_rasters</varname> may "
+"also be set by passing the environment variable "
+"<varname>POSTGIS_ENABLE_OUTDB_RASTERS</varname> with a non-zero value to the "
+"process starting PostgreSQL."
+msgstr ""
+"Початкове значення <varname>postgis.enable_outdb_rasters</varname> також "
+"можна встановити, передавши змінну середовища "
+"<varname>POSTGIS_ENABLE_OUTDB_RASTERS</varname> з значенням, відмінним від "
+"нуля, процесу, що запускає PostgreSQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Even if <varname>postgis.enable_outdb_rasters</varname> is True, the GUC "
+"<varname>postgis.gdal_enabled_drivers</varname> determines the accessible "
+"raster formats."
+msgstr ""
+"Навіть якщо <varname>postgis.enable_outdb_rasters</varname> має значення "
+"True, доступні растрові формати визначаються GUC <varname>postgis."
+"gdal_enabled_drivers</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the standard PostGIS installation, <varname>postgis.enable_outdb_rasters</"
+"varname> is set to False."
+msgstr ""
+"У стандартній установці PostGIS <varname>postgis.enable_outdb_rasters</"
+"varname> встановлено на False."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Set and reset <varname>postgis.enable_outdb_rasters</varname> for current "
+"session"
+msgstr ""
+"Встановити та скинути <varname>postgis.enable_outdb_rasters</varname> для "
+"поточної сесії"
+
+#. Tag: para
+#, no-c-format
+msgid "Set for all new connections to a specific database"
+msgstr "Встановити для всіх нових підключень до певної бази даних"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Setting for whole database cluster. Requires super user access. Also note "
+"that database, session, and user settings override this."
+msgstr ""
+"Налаштування для всього кластера бази даних. Потрібен доступ "
+"суперкористувача. Також зверніть увагу, що налаштування бази даних, сеансу "
+"та користувача мають пріоритет над цими налаштуваннями."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A string configuration to set options used when working with an out-db "
+"raster."
+msgstr ""
+"Конфігурація рядка для встановлення параметрів, що використовуються під час "
+"роботи з растровим файлом out-db."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A string configuration to set options used when working with an out-db "
+"raster. <link xlink:href=\"https://gdal.org/user/configoptions."
+"html\">Configuration options</link> control things like how much space GDAL "
+"allocates to local data cache, whether to read overviews, and what access "
+"keys to use for remote out-db data sources."
+msgstr ""
+"Конфігурація рядка для встановлення опцій, що використовуються під час "
+"роботи з растровим файлом out-db. <link xlink:href=\"https://gdal.org/user/"
+"configoptions.html\">Опції конфігурації</link> контролюють такі параметри, як "
+"обсяг простору, що GDAL виділяє для локального кешу даних, чи читати огляди "
+"та які ключі доступу використовувати для віддалених джерел даних out-db."
+
+#. Tag: para
+#, no-c-format
+msgid "Set <varname>postgis.gdal_vsi_options</varname> for current session:"
+msgstr ""
+"Встановити <varname>postgis.gdal_vsi_options</varname> для поточної сесії:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Set <varname>postgis.gdal_vsi_options</varname> just for the "
+"<emphasis>current transaction</emphasis> using the <varname>LOCAL</varname> "
+"keyword:"
+msgstr ""
+"Встановіть <varname>postgis.gdal_vsi_options</varname> тільки для "
+"<emphasis>поточної транзакції</emphasis> за допомогою ключового слова "
+"<varname>LOCAL</varname>:"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A boolean configuration to turn logging of GDAL debug messages on and off."
+msgstr ""
+"Булева конфігурація для ввімкнення та вимкнення реєстрації повідомлень про "
+"налагодження GDAL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default, GDAL logging is printed to stderr, and lower level debug "
+"messages are not printed at all. Turning this GUC to true will cause GDAL "
+"logging to be sent into the PostgreSQL logging stream, so you can see more "
+"or less of it by altering the <code>client_min_message</code> PostgreSQL GUC."
+msgstr ""
+"За замовчуванням, журнали GDAL друкуються на stderr, а повідомлення нижчого "
+"рівня не друкуються взагалі. Встановлення цього GUC на true призведе до "
+"надсилання журналів GDAL до потоку журналів PostgreSQL, тож ви зможете "
+"бачити більше або менше з них, змінюючи <code>client_min_message</code> "
+"PostgreSQL GUC."
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Input"
+msgstr "Введення геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions create geometry objects from various textual or binary "
+"formats."
+msgstr ""
+"Ці функції створюють геометричні об'єкти з різних текстових або бінарних "
+"форматів."
+
+#. Tag: title
+#, no-c-format
+msgid "Well-Known Text (WKT)"
+msgstr "Well-Known Text (WKT)"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Construct a Polygon given an arbitrary collection of closed "
+"linestrings as a MultiLineString Well-Known text representation.</refpurpose>"
+msgstr ""
+"<refpurpose>Побудувати полігон, заданий довільною сукупністю замкнутих "
+"лінійних відрізків у вигляді добре відомого текстового представлення "
+"MultiLineString.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Construct a Polygon given an arbitrary collection of closed "
+"linestrings as a MultiLineString Well-Known text representation.</para>"
+msgstr ""
+"<para>Побудувати полігон, заданий довільною сукупністю замкнутих лінійних "
+"відрізків у вигляді добре відомого текстового представлення "
+"MultiLineString.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Throws an error if WKT is not a MULTILINESTRING. Throws an error if output "
+"is a MULTIPOLYGON; use ST_BdMPolyFromText in that case, or see "
+"ST_BuildArea() for a postgis-specific approach."
+msgstr ""
+"Видає помилку, якщо WKT не є MULTILINESTRING. Видає помилку, якщо вихідні "
+"дані є MULTIPOLYGON; у цьому випадку використовуйте ST_BdMPolyFromText або "
+"дивіться ST_BuildArea() для підходу, специфічного для postgis."
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s3.2.6.2"
+msgstr "&sfs_compliant; s3.2.6.2"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_BdMPolyFromText\"/>"
+msgstr ", <xref linkend=\"ST_BdMPolyFromText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Construct a MultiPolygon given an arbitrary collection of closed linestrings "
+"as a MultiLineString text representation Well-Known text representation."
+msgstr ""
+"Побудувати мультиполігон на основі довільної сукупності замкнутих лінійних "
+"відрізків у вигляді текстового представлення MultiLineString. Загальновідоме "
+"текстове представлення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Construct a Polygon given an arbitrary collection of closed linestrings, "
+"polygons, MultiLineStrings as Well-Known text representation."
+msgstr ""
+"Побудувати полігон, заданий довільною сукупністю замкнутих ліній, полігонів, "
+"багатолінійних ліній у вигляді добре відомого текстового представлення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Throws an error if WKT is not a MULTILINESTRING. Forces MULTIPOLYGON output "
+"even when result is really only composed by a single POLYGON; use <link "
+"linkend=\"ST_BdPolyFromText\">ST_BdPolyFromText</link> if you're sure a "
+"single POLYGON will result from operation, or see <link "
+"linkend=\"ST_BuildArea\">ST_BuildArea()</link> for a postgis-specific "
+"approach."
+msgstr ""
+"Видає помилку, якщо WKT не є MULTILINESTRING. Примусово виводить "
+"MULTIPOLYGON, навіть якщо результат насправді складається лише з одного "
+"POLYGON; використовуйте <link linkend=\"ST_BdPolyFromText\""
+">ST_BdPolyFromText</link>, якщо ви впевнені, що в результаті операції буде "
+"отримано один POLYGON, або дивіться <link linkend=\"ST_BuildArea\""
+">ST_BuildArea()</link> для підходу, специфічного для postgis."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_BdPolyFromText\"/>"
+msgstr ", <xref linkend=\"ST_BdPolyFromText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified geography value from Well-Known Text representation or "
+"extended (WKT)."
+msgstr ""
+"Повернути вказане географічне значення з представлення Well-Known Text або "
+"розширеного (WKT)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geography object from the well-known text or extended well-known "
+"representation. SRID 4326 is assumed if unspecified. This is an alias for "
+"ST_GeographyFromText. Points are always expressed in long lat form."
+msgstr ""
+"Повертає географічний об'єкт із відомого тексту або розширеного відомого "
+"представлення. Якщо не вказано, використовується SRID 4326. Це псевдонім для "
+"ST_GeographyFromText. Точки завжди виражаються у форматі довготи та широти."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeographyFromText\"/>"
+msgstr ", <xref linkend=\"ST_GeographyFromText\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geography object from the well-known text representation. SRID "
+"4326 is assumed if unspecified."
+msgstr ""
+"Повертає географічний об'єкт із загальновідомого текстового представлення. "
+"Якщо не вказано, використовується SRID 4326."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsText\"/>"
+msgstr ", <xref linkend=\"ST_AsText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Makes a collection Geometry from collection WKT with the given SRID. If SRID "
+"is not given, it defaults to 0."
+msgstr ""
+"Створює колекцію Geometry з колекції WKT із заданим SRID. Якщо SRID не "
+"задано, за замовчуванням використовується 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Makes a collection Geometry from the Well-Known-Text (WKT) representation "
+"with the given SRID. If SRID is not given, it defaults to 0."
+msgstr ""
+"Створює колекцію Geometry з представлення Well-Known-Text (WKT) із заданим "
+"SRID. Якщо SRID не вказано, за замовчуванням використовується 0."
+
+#. Tag: para
+#, no-c-format
+msgid "OGC SPEC 3.2.6.2 - option SRID is from the conformance suite"
+msgstr "OGC SPEC 3.2.6.2 — опція SRID взята з набору вимог відповідності"
+
+#. Tag: para
+#, no-c-format
+msgid "Returns null if the WKT is not a GEOMETRYCOLLECTION"
+msgstr "Повертає null, якщо WKT не є GEOMETRYCOLLECTION"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are absolutely sure all your WKT geometries are collections, don't "
+"use this function. It is slower than ST_GeomFromText since it adds an "
+"additional validation step."
+msgstr ""
+"Якщо ви абсолютно впевнені, що всі ваші геометрії WKT є колекціями, не "
+"використовуйте цю функцію. Вона працює повільніше, ніж ST_GeomFromText, "
+"оскільки додає додатковий крок перевірки."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_SRID\"/>"
+msgstr ", <xref linkend=\"ST_SRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified ST_Geometry value from Extended Well-Known Text "
+"representation (EWKT)."
+msgstr ""
+"Повернути вказане значення ST_Geometry з розширеного представлення добре "
+"відомого тексту (EWKT)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Constructs a PostGIS ST_Geometry object from the OGC Extended Well-Known "
+"text (EWKT) representation."
+msgstr ""
+"Створює об'єкт PostGIS ST_Geometry з представлення OGC Extended Well-Known "
+"text (EWKT)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The EWKT format is not an OGC standard, but an PostGIS specific format that "
+"includes the spatial reference system (SRID) identifier"
+msgstr ""
+"Формат EWKT не є стандартом OGC, а специфічним форматом PostGIS, що включає "
+"ідентифікатор просторової системи координат (SRID)."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes MARC21/XML geographic data as input and returns a PostGIS geometry "
+"object."
+msgstr ""
+"Приймає географічні дані MARC21/XML як вхідні дані та повертає геометричний "
+"об'єкт PostGIS."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function creates a PostGIS geometry from a MARC21/XML record, which can "
+"contain a <varname>POINT</varname> or a <varname>POLYGON</varname>. In case "
+"of multiple geographic data entries in the same MARC21/XML record, a "
+"<varname>MULTIPOINT</varname> or <varname>MULTIPOLYGON</varname> will be "
+"returned. If the record contains mixed geometry types, a "
+"<varname>GEOMETRYCOLLECTION</varname> will be returned. It returns NULL if "
+"the MARC21/XML record does not contain any geographic data (datafield:034)."
+msgstr ""
+"Ця функція створює геометрію PostGIS з запису MARC21/XML, який може містити "
+"<varname>POINT</varname> або <varname>POLYGON</varname>. У разі наявності "
+"декількох географічних даних в одному записі MARC21/XML, буде повернуто "
+"<varname>MULTIPOINT</varname> або <varname>MULTIPOLYGON</varname>. Якщо "
+"запис містить змішані типи геометрії, буде повернуто "
+"<varname>GEOMETRYCOLLECTION</varname>. Повертає NULL, якщо запис MARC21/XML "
+"не містить географічних даних (поле даних: 034)."
+
+#. Tag: para
+#, no-c-format
+msgid "LOC MARC21/XML versions supported:"
+msgstr "Підтримувані версії LOC MARC21/XML:"
+
+#. Tag: link
+#, no-c-format
+msgid "MARC21/XML 1.1"
+msgstr "MARC21/XML 1.1"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.3.0, requires libxml2 2.6+"
+msgstr "Доступність: 3.3.0, вимагає libxml2 2.6+"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The MARC21/XML Coded Cartographic Mathematical Data currently does not "
+"provide any means to describe the Spatial Reference System of the encoded "
+"coordinates, so this function will always return a geometry with "
+"<varname>SRID 0</varname>."
+msgstr ""
+"Кодовані картографічні математичні дані MARC21/XML наразі не надають жодних "
+"засобів для опису просторової системи координат закодованих координат, тому "
+"ця функція завжди повертатиме геометрію з <varname>SRID 0</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returned <varname>POLYGON</varname> geometries will always be clockwise "
+"oriented."
+msgstr ""
+"Повернуті геометрії <varname>POLYGON</varname> завжди будуть орієнтовані за "
+"годинниковою стрілкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converting MARC21/XML geographic data containing a single <varname>POINT</"
+"varname> encoded as <varname>hddd.dddddd</varname>"
+msgstr ""
+"Перетворення географічних даних MARC21/XML, що містять один <varname>POINT</"
+"varname>, закодований як <varname>hddd.dddddd</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converting MARC21/XML geographic data containing a single <varname>POLYGON</"
+"varname> encoded as <varname>hdddmmss</varname>"
+msgstr ""
+"Перетворення географічних даних MARC21/XML, що містять один "
+"<varname>POLYGON</varname>, закодований як <varname>hdddmmss</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converting MARC21/XML geographic data containing a <varname>POLYGON</"
+"varname> and a <varname>POINT</varname>:"
+msgstr ""
+"Перетворення географічних даних MARC21/XML, що містять <varname>POLYGON</"
+"varname> та <varname>POINT</varname>:"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified ST_Geometry value from Well-Known Text representation "
+"(WKT). This is an alias name for ST_GeomFromText"
+msgstr ""
+"Повертає вказане значення ST_Geometry з представлення Well-Known Text (WKT). "
+"Це псевдонім для ST_GeomFromText."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.40"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.4"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified ST_Geometry value from Well-Known Text representation "
+"(WKT)."
+msgstr ""
+"Повертає вказане значення ST_Geometry з представлення Well-Known Text (WKT)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Constructs a PostGIS ST_Geometry object from the OGC Well-Known text "
+"representation."
+msgstr ""
+"Створює об'єкт PostGIS ST_Geometry на основі текстового представлення OGC "
+"Well-Known."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are two variants of ST_GeomFromText function. The first takes no SRID "
+"and returns a geometry with no defined spatial reference system (SRID=0). "
+"The second takes a SRID as the second argument and returns a geometry that "
+"includes this SRID as part of its metadata."
+msgstr ""
+"Існує два варіанти функції ST_GeomFromText. Перший не приймає SRID і "
+"повертає геометрію без визначеної системи просторових координат (SRID=0). "
+"Другий приймає SRID як другий аргумент і повертає геометрію, яка включає цей "
+"SRID як частину своїх метаданих."
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s3.2.6.2 - option SRID is from the conformance suite."
+msgstr ""
+"&sfs_compliant; s3.2.6.2 - опція SRID належить до набору вимог відповідності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"While not OGC-compliant, <xref linkend=\"ST_MakePoint\"/> is faster than "
+"ST_GeomFromText and ST_PointFromText. It is also easier to use for numeric "
+"coordinate values. <xref linkend=\"ST_Point\"/> is another option similar in "
+"speed to <xref linkend=\"ST_MakePoint\"/> and is OGC-compliant, but doesn't "
+"support anything but 2D points."
+msgstr ""
+"Хоча <xref linkend=\"ST_MakePoint\"/> не відповідає стандарту OGC, він "
+"працює швидше, ніж ST_GeomFromText і ST_PointFromText. Він також простіший у "
+"використанні для числових значень координат. <xref linkend=\"ST_Point\"/> — "
+"це інший варіант, схожий за швидкістю на <xref linkend=\"ST_MakePoint\"/> і "
+"сумісний з OGC, але підтримує тільки 2D-точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 In prior versions of PostGIS "
+"ST_GeomFromText('GEOMETRYCOLLECTION(EMPTY)') was allowed. This is now "
+"illegal in PostGIS 2.0.0 to better conform with SQL/MM standards. This "
+"should now be written as ST_GeomFromText('GEOMETRYCOLLECTION EMPTY')"
+msgstr ""
+"Змінено: 2.0.0 У попередніх версіях PostGIS "
+"ST_GeomFromText(“GEOMETRYCOLLECTION(EMPTY)”) було дозволено. Тепер це є "
+"некоректним у PostGIS 2.0.0 для кращої відповідності стандартам SQL/MM. "
+"Тепер це слід писати як ST_GeomFromText(“GEOMETRYCOLLECTION EMPTY”)"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeomFromWKB\"/>, <xref linkend=\"ST_SRID\"/>"
+msgstr ", <xref linkend=\"ST_GeomFromWKB\"/>, <xref linkend=\"ST_SRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Makes a Geometry from WKT representation with the given SRID. If SRID is not "
+"given, it defaults to 0."
+msgstr ""
+"Створює геометрію з представлення WKT із заданим SRID. Якщо SRID не задано, "
+"за замовчуванням використовується 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Makes a Geometry from WKT with the given SRID. If SRID is not given, it "
+"defaults to 0. If WKT passed in is not a LINESTRING, then null is returned."
+msgstr ""
+"Створює геометрію з WKT із заданим SRID. Якщо SRID не вказано, за "
+"замовчуванням використовується 0. Якщо переданий WKT не є LINESTRING, "
+"повертається null."
+
+#. Tag: para
+#, no-c-format
+msgid "OGC SPEC 3.2.6.2 - option SRID is from the conformance suite."
+msgstr "OGC SPEC 3.2.6.2 — опція SRID належить до набору вимог відповідності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you know all your geometries are LINESTRINGS, its more efficient to just "
+"use ST_GeomFromText. This just calls ST_GeomFromText and adds additional "
+"validation that it returns a linestring."
+msgstr ""
+"Якщо ви знаєте, що всі ваші геометрії є LINESTRINGS, ефективніше просто "
+"використовувати ST_GeomFromText. Це просто викликає ST_GeomFromText і додає "
+"додаткову перевірку, що він повертає лінію."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.2.8"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.2.8"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a specified ST_MultiLineString value from WKT representation."
+msgstr "Повернути вказане значення ST_MultiLineString з представлення WKT."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Makes a Geometry from Well-Known-Text (WKT) with the given SRID. If SRID is "
+"not given, it defaults to 0."
+msgstr ""
+"Створює геометрію з добре відомого тексту (WKT) із заданим SRID. Якщо SRID "
+"не задано, за замовчуванням використовується 0."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns null if the WKT is not a MULTILINESTRING"
+msgstr "Повертає null, якщо WKT не є MULTILINESTRING"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are absolutely sure all your WKT geometries are points, don't use "
+"this function. It is slower than ST_GeomFromText since it adds an additional "
+"validation step."
+msgstr ""
+"Якщо ви абсолютно впевнені, що всі ваші геометрії WKT є точками, не "
+"використовуйте цю функцію. Вона працює повільніше, ніж ST_GeomFromText, "
+"оскільки додає додатковий крок перевірки."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant;SQL-MM 3: 9.4.4"
+msgstr "&sqlmm_compliant;SQL-MM 3: 9.4.4"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Makes a Geometry from WKT with the given SRID. If SRID is not "
+"given, it defaults to 0.</refpurpose>"
+msgstr ""
+"<refpurpose>Створює геометрію з WKT із заданим SRID. Якщо SRID не вказано, "
+"за замовчуванням використовується 0.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Makes a Geometry from WKT with the given SRID. If SRID is not given, "
+"it defaults to 0.</para>"
+msgstr ""
+"<para>Створює геометрію з WKT із заданим SRID. Якщо SRID не вказано, за "
+"замовчуванням використовується значення 0.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid "Returns null if the WKT is not a MULTIPOINT"
+msgstr "Повертає null, якщо WKT не є MULTIPOINT"
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; 3.2.6.2"
+msgstr "&sfs_compliant; 3.2.6.2"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 9.2.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 9.2.4"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Makes a MultiPolygon Geometry from WKT with the given SRID. If SRID is not "
+"given, it defaults to 0."
+msgstr ""
+"Створює геометрію MultiPolygon з WKT із заданим SRID. Якщо SRID не задано, "
+"за замовчуванням використовується 0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Makes a MultiPolygon from WKT with the given SRID. If SRID is not given, it "
+"defaults to 0."
+msgstr ""
+"Створює багатокутник з WKT із заданим SRID. Якщо SRID не задано, за "
+"замовчуванням використовується 0."
+
+#. Tag: para
+#, no-c-format
+msgid "Throws an error if the WKT is not a MULTIPOLYGON"
+msgstr "Видає помилку, якщо WKT не є MULTIPOLYGON"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are absolutely sure all your WKT geometries are multipolygons, don't "
+"use this function. It is slower than ST_GeomFromText since it adds an "
+"additional validation step."
+msgstr ""
+"Якщо ви абсолютно впевнені, що всі ваші геометрії WKT є багатокутниками, не "
+"використовуйте цю функцію. Вона працює повільніше, ніж ST_GeomFromText, "
+"оскільки додає додатковий крок перевірки."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 9.6.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 9.6.4"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Makes a point Geometry from WKT with the given SRID. If SRID is not given, "
+"it defaults to unknown."
+msgstr ""
+"Створює точку Геометрія з WKT із заданим SRID. Якщо SRID не вказано, за "
+"замовчуванням використовується невідомий."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Constructs a PostGIS ST_Geometry point object from the OGC Well-Known text "
+"representation. If SRID is not given, it defaults to unknown (currently 0). "
+"If geometry is not a WKT point representation, returns null. If completely "
+"invalid WKT, then throws an error."
+msgstr ""
+"Створює об'єкт точки PostGIS ST_Geometry з текстового представлення OGC Well-"
+"Known. Якщо SRID не вказано, за замовчуванням використовується невідоме "
+"значення (наразі 0). Якщо геометрія не є представленням точки WKT, повертає "
+"null. Якщо WKT повністю недійсне, видає помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are 2 variants of ST_PointFromText function, the first takes no SRID "
+"and returns a geometry with no defined spatial reference system. The second "
+"takes a spatial reference id as the second argument and returns an "
+"ST_Geometry that includes this srid as part of its meta-data. The srid must "
+"be defined in the spatial_ref_sys table."
+msgstr ""
+"Існує 2 варіанти функції ST_PointFromText, перший не приймає SRID і повертає "
+"геометрію без визначеної системи просторових координат. Другий приймає "
+"ідентифікатор просторової координатної системи як другий аргумент і повертає "
+"ST_Geometry, що включає цей srid як частину своїх метаданих. SRID повинен "
+"бути визначений у таблиці spatial_ref_sys."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are absolutely sure all your WKT geometries are points, don't use "
+"this function. It is slower than ST_GeomFromText since it adds an additional "
+"validation step. If you are building points from long lat coordinates and "
+"care more about performance and accuracy than OGC compliance, use <xref "
+"linkend=\"ST_MakePoint\"/> or OGC compliant alias <xref linkend=\"ST_Point\"/"
+">."
+msgstr ""
+"Якщо ви абсолютно впевнені, що всі ваші геометрії WKT є точками, не "
+"використовуйте цю функцію. Вона працює повільніше, ніж ST_GeomFromText, "
+"оскільки додає додатковий крок перевірки. Якщо ви створюєте точки з "
+"координат довготи та широти і для вас важливіша продуктивність та точність, "
+"ніж відповідність OGC, використовуйте <xref linkend=\"ST_MakePoint\"/>або "
+"псевдонім, що відповідає OGC <xref linkend=\"ST_Point\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 6.1.8"
+msgstr "&sqlmm_compliant; SQL-MM 3: 6.1.8"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MakePoint\"/>, <xref linkend=\"ST_Point\"/>, <xref "
+"linkend=\"ST_SRID\"/>"
+msgstr ""
+", <xref linkend=\"ST_MakePoint\"/>, <xref linkend=\"ST_Point\"/>, <xref "
+"linkend=\"ST_SRID\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Makes a Geometry from WKT with the given SRID. If SRID is not given, it "
+"defaults to 0. Returns null if WKT is not a polygon."
+msgstr ""
+"Створює геометрію з WKT із заданим SRID. Якщо SRID не задано, за "
+"замовчуванням використовується 0. Повертає null, якщо WKT не є полігоном."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you are absolutely sure all your WKT geometries are polygons, don't use "
+"this function. It is slower than ST_GeomFromText since it adds an additional "
+"validation step."
+msgstr ""
+"Якщо ви абсолютно впевнені, що всі ваші геометрії WKT є полігонами, не "
+"використовуйте цю функцію. Вона працює повільніше, ніж ST_GeomFromText, "
+"оскільки додає додатковий крок перевірки."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.3.6"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.3.6"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.34"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.34"
+
+#. Tag: title
+#, no-c-format
+msgid "Well-Known Binary (WKB)"
+msgstr "Добре відомий бінарний файл (WKB)"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a geography instance from a Well-Known Binary geometry "
+"representation (WKB) or extended Well Known Binary (EWKB)."
+msgstr ""
+"Створює географічний екземпляр на основі добре відомого двійкового "
+"геометричного представлення (WKB) або розширеного добре відомого двійкового "
+"представлення (EWKB)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ST_GeogFromWKB</varname> function, takes a well-known binary "
+"representation (WKB) of a geometry or PostGIS Extended WKB and creates an "
+"instance of the appropriate geography type. This function plays the role of "
+"the Geometry Factory in SQL."
+msgstr ""
+"Функція <varname>ST_GeogFromWKB</varname> бере добре відоме двійкове "
+"представлення (WKB) геометрії або PostGIS Extended WKB і створює екземпляр "
+"відповідного типу географії. Ця функція виконує роль Geometry Factory в SQL."
+
+#. Tag: para
+#, no-c-format
+msgid "If SRID is not specified, it defaults to 4326 (WGS 84 long lat)."
+msgstr ""
+"Якщо SRID не вказано, за замовчуванням використовується значення 4326 (WGS "
+"84 long lat)."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsBinary\"/>"
+msgstr ", <xref linkend=\"ST_AsBinary\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified ST_Geometry value from Extended Well-Known Binary "
+"representation (EWKB)."
+msgstr ""
+"Повернути вказане значення ST_Geometry з розширеного добре відомого "
+"двійкового представлення (EWKB)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Constructs a PostGIS ST_Geometry object from the OGC Extended Well-Known "
+"binary (EWKT) representation."
+msgstr ""
+"Створює об'єкт PostGIS ST_Geometry з представлення OGC Extended Well-Known "
+"binary (EWKT)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The EWKB format is not an OGC standard, but a PostGIS specific format that "
+"includes the spatial reference system (SRID) identifier"
+msgstr ""
+"Формат EWKB не є стандартом OGC, а специфічним форматом PostGIS, що включає "
+"ідентифікатор просторової системи координат (SRID)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"line string binary rep 0f LINESTRING(-71.160281 42.258729,-71.160837 "
+"42.259113,-71.161144 42.25932) in NAD 83 long lat (4269)."
+msgstr ""
+"лінія бінарне представлення LINESTRING(-71.160281 42.258729,-71.160837 42."
+"259113,-71.161144 42.25932) in NAD 83 long lat (4269)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: Even though byte arrays are delimited with \\ and may have ', we need "
+"to escape both out with \\ and '' if standard_conforming_strings is off. So "
+"it does not look exactly like its AsEWKB representation."
+msgstr ""
+"ПРИМІТКА: Незважаючи на те, що масиви байтів розділяються символом \\ і "
+"можуть містити символ “, нам потрібно екранувати обидва символи за допомогою "
+"\\ і ”', якщо стандарт standard_conforming_strings вимкнено. Тому це не "
+"виглядає точно так, як його представлення в AsEWKB."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In PostgreSQL 9.1+ - standard_conforming_strings is set to on by default, "
+"where as in past versions it was set to off. You can change defaults as "
+"needed for a single query or at the database or server level. Below is how "
+"you would do it with standard_conforming_strings = on. In this case we "
+"escape the ' with standard ansi ', but slashes are not escaped"
+msgstr ""
+"У PostgreSQL 9.1+ - standard_conforming_strings за замовчуванням встановлено "
+"на on, тоді як у попередніх версіях було встановлено на off. Ви можете "
+"змінити значення за замовчуванням за потреби для окремого запиту або на "
+"рівні бази даних чи сервера. Нижче наведено, як це зробити, якщо "
+"standard_conforming_strings = on. У цьому випадку ми екрануємо “ за "
+"допомогою стандартного ansi ”, але коси риски не екрануються"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_GeomFromWKB\"/>"
+msgstr ", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_GeomFromWKB\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a geometry instance from a Well-Known Binary geometry representation "
+"(WKB) and optional SRID."
+msgstr ""
+"Створює екземпляр геометрії з добре відомого двійкового представлення "
+"геометрії (WKB) та опціонального SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ST_GeomFromWKB</varname> function, takes a well-known binary "
+"representation of a geometry and a Spatial Reference System ID "
+"(<varname>SRID</varname>) and creates an instance of the appropriate "
+"geometry type. This function plays the role of the Geometry Factory in SQL. "
+"This is an alternate name for ST_WKBToSQL."
+msgstr ""
+"Функція <varname>ST_GeomFromWKB</varname> приймає добре відоме двійкове "
+"представлення геометрії та ідентифікатор просторової системи відліку "
+"(<varname>SRID</varname>) і створює екземпляр відповідного типу геометрії. "
+"Ця функція виконує роль Geometry Factory в SQL. Це альтернативна назва для "
+"ST_WKBToSQL."
+
+#. Tag: para
+#, no-c-format
+msgid "If SRID is not specified, it defaults to 0 (Unknown)."
+msgstr ""
+"Якщо SRID не вказано, за замовчуванням використовується значення 0 "
+"(Невідомо)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sfs_compliant; s3.2.7.2 - the optional SRID is from the conformance suite"
+msgstr ""
+"&sfs_compliant; s3.2.7.2 - необов'язковий SRID з набору вимог відповідності"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.41"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.41"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsBinary\"/>, <xref linkend=\"ST_GeomFromEWKB\"/>"
+msgstr ", <xref linkend=\"ST_AsBinary\"/>, <xref linkend=\"ST_GeomFromEWKB\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Makes a <varname>LINESTRING</varname> from WKB with the given SRID"
+msgstr "Створює <varname>LINESTRING</varname> з WKB із заданим SRID"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ST_LineFromWKB</varname> function, takes a well-known binary "
+"representation of geometry and a Spatial Reference System ID (<varname>SRID</"
+"varname>) and creates an instance of the appropriate geometry type - in this "
+"case, a <varname>LINESTRING</varname> geometry. This function plays the role "
+"of the Geometry Factory in SQL."
+msgstr ""
+"Функція <varname>ST_LineFromWKB</varname> приймає добре відоме двійкове "
+"представлення геометрії та ідентифікатор просторової системи відліку "
+"(<varname>SRID</varname>) і створює екземпляр відповідного типу геометрії — "
+"у цьому випадку геометрії <varname>LINESTRING</varname>. Ця функція виконує "
+"роль Geometry Factory в SQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If an SRID is not specified, it defaults to 0. <varname>NULL</varname> is "
+"returned if the input <varname>bytea</varname> does not represent a "
+"<varname>LINESTRING</varname>."
+msgstr ""
+"Якщо SRID не вказано, за замовчуванням використовується значення 0. Якщо "
+"вхідний параметр <varname>bytea</varname> не представляє "
+"<varname>LINESTRING</varname>, повертається <varname>NULL</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you know all your geometries are <varname>LINESTRING</varname>s, its more "
+"efficient to just use <xref linkend=\"ST_GeomFromWKB\"/>. This function just "
+"calls <xref linkend=\"ST_GeomFromWKB\"/> and adds additional validation that "
+"it returns a linestring."
+msgstr ""
+"Якщо ви знаєте, що всі ваші геометрії є <varname>LINESTRING</varname>s, "
+"ефективніше просто використовувати <xref linkend=\"ST_GeomFromWKB\"/>. Ця "
+"функція просто викликає <xref linkend=\"ST_GeomFromWKB\"/> і додає додаткову "
+"перевірку, що вона повертає лінію."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.2.9"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.2.9"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LinestringFromWKB\"/>"
+msgstr ", <xref linkend=\"ST_LinestringFromWKB\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Makes a geometry from WKB with the given SRID."
+msgstr "Створює геометрію з WKB із заданим SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ST_LinestringFromWKB</varname> function, takes a well-known "
+"binary representation of geometry and a Spatial Reference System ID "
+"(<varname>SRID</varname>) and creates an instance of the appropriate "
+"geometry type - in this case, a <varname>LINESTRING</varname> geometry. This "
+"function plays the role of the Geometry Factory in SQL."
+msgstr ""
+"Функція <varname>ST_LinestringFromWKB</varname> приймає добре відоме "
+"двійкове представлення геометрії та ідентифікатор просторової системи "
+"координат (<varname>SRID</varname>) і створює екземпляр відповідного типу "
+"геометрії — у цьому випадку геометрії <varname>LINESTRING</varname>. Ця "
+"функція виконує роль фабрики геометрії в SQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If an SRID is not specified, it defaults to 0. <varname>NULL</varname> is "
+"returned if the input <varname>bytea</varname> does not represent a "
+"<varname>LINESTRING</varname> geometry. This an alias for <xref "
+"linkend=\"ST_LineFromWKB\"/>."
+msgstr ""
+"Якщо SRID не вказано, за замовчуванням використовується 0. <varname>NULL</"
+"varname> повертається, якщо вхідний <varname>bytea</varname> не представляє "
+"геометрію <varname>LINESTRING</varname>. Це псевдонім для <xref linkend="
+"\"ST_LineFromWKB\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "OGC SPEC 3.2.6.2 - optional SRID is from the conformance suite."
+msgstr ""
+"OGC SPEC 3.2.6.2 — необов'язковий SRID взято з набору вимог відповідності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you know all your geometries are <varname>LINESTRING</varname>s, it's "
+"more efficient to just use <xref linkend=\"ST_GeomFromWKB\"/>. This function "
+"just calls <xref linkend=\"ST_GeomFromWKB\"/> and adds additional validation "
+"that it returns a <varname>LINESTRING</varname>."
+msgstr ""
+"Якщо ви знаєте, що всі ваші геометрії є <varname>LINESTRING</varname>s, "
+"ефективніше просто використовувати <xref linkend=\"ST_GeomFromWKB\"/>. Ця "
+"функція просто викликає <xref linkend=\"ST_GeomFromWKB\"/> і додає додаткову "
+"перевірку, що вона повертає <varname>LINESTRING</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LineFromWKB\"/>"
+msgstr ", <xref linkend=\"ST_LineFromWKB\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Makes a geometry from WKB with the given SRID"
+msgstr "Створює геометрію з WKB із заданим SRID"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ST_PointFromWKB</varname> function, takes a well-known binary "
+"representation of geometry and a Spatial Reference System ID (<varname>SRID</"
+"varname>) and creates an instance of the appropriate geometry type - in this "
+"case, a <varname>POINT</varname> geometry. This function plays the role of "
+"the Geometry Factory in SQL."
+msgstr ""
+"Функція <varname>ST_PointFromWKB</varname> приймає добре відоме двійкове "
+"представлення геометрії та ідентифікатор просторової системи відліку "
+"(<varname>SRID</varname>) і створює екземпляр відповідного типу геометрії — "
+"у цьому випадку геометрії <varname>POINT</varname>. Ця функція виконує роль "
+"Geometry Factory в SQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If an SRID is not specified, it defaults to 0. <varname>NULL</varname> is "
+"returned if the input <varname>bytea</varname> does not represent a "
+"<varname>POINT</varname> geometry."
+msgstr ""
+"Якщо SRID не вказано, за замовчуванням використовується 0. Якщо вхідний "
+"параметр <varname>bytea</varname> не представляє геометрію <varname>POINT</"
+"varname>, повертається <varname>NULL</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s3.2.7.2"
+msgstr "&sfs_compliant; s3.2.7.2"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 6.1.9"
+msgstr "&sqlmm_compliant; SQL-MM 3: 6.1.9"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified ST_Geometry value from Well-Known Binary representation "
+"(WKB). This is an alias name for ST_GeomFromWKB that takes no srid"
+msgstr ""
+"Повертає вказане значення ST_Geometry з добре відомого двійкового "
+"представлення (WKB). Це псевдонім для ST_GeomFromWKB, який не приймає srid."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.36"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.36"
+
+#. Tag: title
+#, no-c-format
+msgid "Other Formats"
+msgstr "Інші формати"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "<refpurpose>Return a BOX2D from a GeoHash string.</refpurpose>"
+msgstr "<refpurpose>Повернути BOX2D із рядка GeoHash.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Return a BOX2D from a GeoHash string.</para>"
+msgstr "<para>Повернути BOX2D із рядка GeoHash.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no <varname>precision</varname> is specified ST_Box2dFromGeoHash returns "
+"a BOX2D based on full precision of the input GeoHash string."
+msgstr ""
+"Якщо не вказано <varname>precision</varname>, ST_Box2dFromGeoHash повертає "
+"BOX2D на основі повної точності вхідного рядка GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>precision</varname> is specified ST_Box2dFromGeoHash will use "
+"that many characters from the GeoHash to create the BOX2D. Lower precision "
+"values results in larger BOX2Ds and larger values increase the precision."
+msgstr ""
+"Якщо вказано <varname>precision</varname>, ST_Box2dFromGeoHash використає "
+"стільки символів з GeoHash, щоб створити BOX2D. Менші значення точності "
+"дають більші BOX2D, а більші значення збільшують точність."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromGeoHash\"/>, <xref "
+"linkend=\"ST_PointFromGeoHash\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromGeoHash\"/>, <xref linkend=\"ST_PointFromGeoHash"
+"\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a geometry from a GeoHash string."
+msgstr "Повернути геометрію з рядка GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a geometry from a GeoHash string. The geometry will be a polygon "
+"representing the GeoHash bounds."
+msgstr ""
+"Повернути геометрію з рядка GeoHash. Геометрія буде полігоном, що "
+"представляє межі GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no <varname>precision</varname> is specified ST_GeomFromGeoHash returns a "
+"polygon based on full precision of the input GeoHash string."
+msgstr ""
+"Якщо не вказано <varname>precision</varname>, ST_GeomFromGeoHash повертає "
+"полігон на основі повної точності вхідного рядка GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>precision</varname> is specified ST_GeomFromGeoHash will use "
+"that many characters from the GeoHash to create the polygon."
+msgstr ""
+"Якщо вказано <varname>precision</varname>, ST_GeomFromGeoHash використає "
+"стільки символів з GeoHash, щоб створити полігон."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+",<xref linkend=\"ST_Box2dFromGeoHash\"/>, <xref "
+"linkend=\"ST_PointFromGeoHash\"/>"
+msgstr ""
+",<xref linkend=\"ST_Box2dFromGeoHash\"/>, <xref linkend=\"ST_PointFromGeoHash"
+"\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes as input GML representation of geometry and outputs a PostGIS geometry "
+"object"
+msgstr ""
+"Приймає в якості вхідних даних GML-представлення геометрії та видає об'єкт "
+"геометрії PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Constructs a PostGIS ST_Geometry object from the OGC GML representation."
+msgstr "Створює об'єкт PostGIS ST_Geometry з представлення OGC GML."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_GeomFromGML works only for GML Geometry fragments. It throws an error if "
+"you try to use it on a whole GML document."
+msgstr ""
+"ST_GeomFromGML працює тільки для фрагментів геометрії GML. При спробі "
+"використання на всьому документі GML видає помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"OGC GML versions supported: <itemizedlist> <listitem> <para>GML 3.2.1 "
+"Namespace</para> </listitem> <listitem> <para>GML 3.1.1 Simple Features "
+"profile SF-2 (with GML 3.1.0 and 3.0.0 backward compatibility)</para> </"
+"listitem> <listitem> <para>GML 2.1.2</para> </listitem> </itemizedlist> OGC "
+"GML standards, cf: <link xlink:href=\"http://www.opengeospatial.org/"
+"standards/gml\">http://www.opengeospatial.org/standards/gml</link>:"
+msgstr ""
+"Підтримувані версії OGC GML: <itemizedlist> <listitem> <para>GML 3.2.1 "
+"Namespace</para> </listitem> <listitem> <para>GML 3.1.1 Simple Features "
+"profile SF-2 (з сумісністю з GML 3.1.0 та 3.0.0)</para> </listitem> "
+"<listitem> <para>GML 2.1.2</para> </listitem> </itemizedlist> Стандарти OGC "
+"GML, див.: <link xlink:href=\"http://www.opengeospatial.org/standards/"
+"gml\">http://www.opengeospatial.org/standards/gml</link>:"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5, requires libxml2 1.6+"
+msgstr "Доступність: 1.5, вимагає libxml2 1.6+"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 default srid optional parameter added."
+msgstr "Покращено: 2.0.0 додано опціональний параметр srid за замовчуванням."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GML allow mixed dimensions (2D and 3D inside the same MultiGeometry for "
+"instance). As PostGIS geometries don't, ST_GeomFromGML convert the whole "
+"geometry to 2D if a missing Z dimension is found once."
+msgstr ""
+"GML дозволяє змішані розміри (наприклад, 2D і 3D в одній MultiGeometry). "
+"Оскільки геометрії PostGIS цього не дозволяють, ST_GeomFromGML перетворює "
+"всю геометрію в 2D, якщо знаходить відсутній розмір Z."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GML support mixed SRS inside the same MultiGeometry. As PostGIS geometries "
+"don't, ST_GeomFromGML, in this case, reproject all subgeometries to the SRS "
+"root node. If no srsName attribute available for the GML root node, the "
+"function throw an error."
+msgstr ""
+"GML підтримує змішані SRS всередині одного MultiGeometry. Оскільки геометрії "
+"PostGIS цього не роблять, ST_GeomFromGML у цьому випадку перепроектує всі "
+"підгеометрії до кореневого вузла SRS. Якщо для кореневого вузла GML "
+"недоступний атрибут srsName, функція видає помилку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_GeomFromGML function is not pedantic about an explicit GML namespace. You "
+"could avoid to mention it explicitly for common usages. But you need it if "
+"you want to use XLink feature inside GML."
+msgstr ""
+"Функція ST_GeomFromGML не є педантичною щодо явного простору імен GML. Ви "
+"можете не згадувати його явно для загального використання. Але він "
+"необхідний, якщо ви хочете використовувати функцію XLink всередині GML."
+
+#. Tag: para
+#, no-c-format
+msgid "ST_GeomFromGML function not support SQL/MM curves geometries."
+msgstr "Функція ST_GeomFromGML не підтримує геометрії кривих SQL/MM."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples - A single geometry with srsName"
+msgstr "Приклади - Одинарна геометрія з srsName"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples - XLink usage"
+msgstr "Приклади - Використання XLink"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples - Polyhedral Surface"
+msgstr "Приклади - Поліедральна поверхня"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsGML\"/>, <xref linkend=\"ST_GMLToSQL\"/>"
+msgstr ", <xref linkend=\"ST_AsGML\"/>, <xref linkend=\"ST_GMLToSQL\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes as input a geojson representation of a geometry and outputs a PostGIS "
+"geometry object"
+msgstr ""
+"Приймає в якості вхідних даних геометричне представлення у форматі geojson і "
+"видає геометричний об'єкт PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid "Constructs a PostGIS geometry object from the GeoJSON representation."
+msgstr "Створює об'єкт геометрії PostGIS з представлення GeoJSON."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_GeomFromGeoJSON works only for JSON Geometry fragments. It throws an "
+"error if you try to use it on a whole JSON document."
+msgstr ""
+"ST_GeomFromGeoJSON працює тільки для фрагментів JSON Geometry. При спробі "
+"використання на всьому документі JSON видається помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.0.0 parsed geometry defaults to SRID=4326 if not specified "
+"otherwise."
+msgstr ""
+"Покращено: 3.0.0, якщо не вказано інше, геометрія за замовчуванням "
+"аналізується як SRID=4326."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.5.0 can now accept json and jsonb as inputs."
+msgstr "Покращено: версія 2.5.0 тепер підтримує json та jsonb як вхідні дані."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0 requires - JSON-C >= 0.9"
+msgstr "Доступність: 2.0.0 вимагає - JSON-C >= 0.9"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you do not have JSON-C enabled, support you will get an error notice "
+"instead of seeing an output. To enable JSON-C, run configure --with-jsondir=/"
+"path/to/json-c. See <xref linkend=\"installation_configuration\"/> for "
+"details."
+msgstr ""
+"Якщо JSON-C не ввімкнено, замість виводу ви отримаєте повідомлення про "
+"помилку. Щоб увімкнути JSON-C, запустіть configure --with-jsondir=/path/to/"
+"json-c. Детальніше див. <xref linkend=\"installation_configuration\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsGeoJSON\"/>, <xref "
+"linkend=\"installation_configuration\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsGeoJSON\"/>, <xref linkend="
+"\"installation_configuration\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Takes as input KML representation of geometry and outputs a PostGIS geometry "
+"object"
+msgstr ""
+"Приймає в якості вхідних даних KML-представлення геометрії та видає об'єкт "
+"геометрії PostGIS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Constructs a PostGIS ST_Geometry object from the OGC KML representation."
+msgstr "Створює об'єкт PostGIS ST_Geometry з представлення OGC KML."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_GeomFromKML works only for KML Geometry fragments. It throws an error if "
+"you try to use it on a whole KML document."
+msgstr ""
+"ST_GeomFromKML працює тільки для фрагментів геометрії KML. При спробі "
+"використання на всьому документі KML видається помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"OGC KML versions supported: <itemizedlist> <listitem> <para>KML 2.2.0 "
+"Namespace</para> </listitem> </itemizedlist> OGC KML standards, cf: <link "
+"xlink:href=\"http://www.opengeospatial.org/standards/kml\">http://www."
+"opengeospatial.org/standards/kml</link>:"
+msgstr ""
+"Підтримувані версії OGC KML: <itemizedlist> <listitem> <para>Простір імен "
+"KML 2.2.0</para> </listitem> </itemizedlist> Стандарти OGC KML, див.: <link "
+"xlink:href=\"http://www.opengeospatial.org/standards/kml\">http://www."
+"opengeospatial.org/standards/kml</link>:"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5, requires libxml2 2.6+"
+msgstr "Доступність: 1.5, вимагає libxml2 2.6+"
+
+#. Tag: para
+#, no-c-format
+msgid "ST_GeomFromKML function not support SQL/MM curves geometries."
+msgstr "Функція ST_GeomFromKML не підтримує геометрії кривих SQL/MM."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsKML\"/>"
+msgstr ", <xref linkend=\"ST_AsKML\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a geometry instance from a TWKB (\"<link xlink:href=\"https://github."
+"com/TWKB/Specification/blob/master/twkb.md\">Tiny Well-Known Binary</"
+"link>\") geometry representation."
+msgstr ""
+"Створює екземпляр геометрії з представлення геометрії TWKB (\"<link "
+"xlink:href=\"https://github.com/TWKB/Specification/blob/master/twkb.md\">Tiny "
+"Well-Known Binary</link>\")."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ST_GeomFromTWKB</varname> function, takes a a TWKB (\"<link "
+"xlink:href=\"https://github.com/TWKB/Specification/blob/master/twkb."
+"md\">Tiny Well-Known Binary</link>\") geometry representation (WKB) and "
+"creates an instance of the appropriate geometry type."
+msgstr ""
+"Функція <varname>ST_GeomFromTWKB</varname> приймає геометричне представлення "
+"TWKB (\"<link xlink:href=\"https://github.com/TWKB/Specification/blob/master/"
+"twkb.md\">Tiny Well-Known Binary</link>\") (WKB) і створює екземпляр "
+"відповідного типу геометрії."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a specified ST_Geometry value from GML representation. This is an "
+"alias name for ST_GeomFromGML"
+msgstr ""
+"Повертає вказане значення ST_Geometry з представлення GML. Це псевдонім для "
+"ST_GeomFromGML."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.50 (except for curves support)."
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.50 (крім підтримки кривих)."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeomFromGML\"/>, <xref linkend=\"ST_AsGML\"/>"
+msgstr ", <xref linkend=\"ST_GeomFromGML\"/>, <xref linkend=\"ST_AsGML\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a LineString from an Encoded Polyline."
+msgstr "Створює LineString з закодованої полілінії."
+
+#. Tag: para
+#, no-c-format
+msgid "Creates a LineString from an Encoded Polyline string."
+msgstr "Створює об'єкт LineString із кодованої полілінії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Optional <varname>precision</varname> specifies how many decimal places will "
+"be preserved in Encoded Polyline. Value should be the same on encoding and "
+"decoding, or coordinates will be incorrect."
+msgstr ""
+"Опціональний параметр <varname>precision</varname> визначає, скільки "
+"десяткових знаків буде збережено в кодованій полілінії. Значення повинно "
+"бути однаковим при кодуванні та декодуванні, інакше координати будуть "
+"неправильними."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"See http://developers.google.com/maps/documentation/utilities/"
+"polylinealgorithm"
+msgstr ""
+"Див. http://developers.google.com/maps/documentation/utilities/"
+"polylinealgorithm"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a point from a GeoHash string."
+msgstr "Повернути точку з рядка GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a point from a GeoHash string. The point represents the center point "
+"of the GeoHash."
+msgstr ""
+"Повернути точку з рядка GeoHash. Точка представляє центральну точку GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no <varname>precision</varname> is specified ST_PointFromGeoHash returns "
+"a point based on full precision of the input GeoHash string."
+msgstr ""
+"Якщо не вказано <varname>precision</varname>, ST_PointFromGeoHash повертає "
+"точку на основі повної точності вхідного рядка GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>precision</varname> is specified ST_PointFromGeoHash will use "
+"that many characters from the GeoHash to create the point."
+msgstr ""
+"Якщо вказано <varname>precision</varname>, ST_PointFromGeoHash використає "
+"стільки символів з GeoHash, скільки потрібно для створення точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Box2dFromGeoHash\"/>, <xref "
+"linkend=\"ST_GeomFromGeoHash\"/>"
+msgstr ""
+", <xref linkend=\"ST_Box2dFromGeoHash\"/>, <xref linkend=\"ST_GeomFromGeoHash"
+"\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a table based on the structure of FlatGeobuf data."
+msgstr "Створює таблицю на основі структури даних FlatGeobuf."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a table based on the structure of FlatGeobuf data. (<link xlink:"
+"href=\"http://flatgeobuf.org\">http://flatgeobuf.org</link>)."
+msgstr ""
+"Створює таблицю на основі структури даних FlatGeobuf. (<link "
+"xlink:href=\"http://flatgeobuf.org\">http://flatgeobuf.org</link>)."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>schema</varname> Schema name."
+msgstr "<varname>schema</varname> Ім'я схеми."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>table</varname> Table name."
+msgstr "<varname>table</varname> Ім'я таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>data</varname> Input FlatGeobuf data."
+msgstr "<varname>data</varname> Введіть дані FlatGeobuf."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Reads FlatGeobuf data."
+msgstr "Зчитує дані FlatGeobuf."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reads FlatGeobuf data (<link xlink:href=\"http://flatgeobuf.org\">http://"
+"flatgeobuf.org</link>). NOTE: PostgreSQL bytea cannot exceed 1GB."
+msgstr ""
+"Читає дані FlatGeobuf (<link xlink:href=\"http://flatgeobuf."
+"org\">http://flatgeobuf.org</link>). ПРИМІТКА: PostgreSQL bytea не може "
+"перевищувати 1 ГБ."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>tabletype</varname> reference to a table type."
+msgstr "<varname>tabletype</varname> посилання на тип таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>data</varname> input FlatGeobuf data."
+msgstr "<varname>data</varname> вхідні дані FlatGeobuf."
+
+#. Tag: title
+#, no-c-format
+msgid "Linear Referencing"
+msgstr "Лінійне посилання"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a point interpolated along a line at a fractional location."
+msgstr "Повертає точку, інтерпольовану вздовж лінії в дробовому місці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a point interpolated along a line at a fractional location. First "
+"argument must be a LINESTRING. Second argument is a float between 0 and 1 "
+"representing the fraction of line length where the point is to be located. "
+"The Z and M values are interpolated if present."
+msgstr ""
+"Повертає точку, інтерпольовану вздовж лінії в дробовому місці. Перший "
+"аргумент повинен бути LINESTRING. Другий аргумент — це число з плаваючою "
+"комою від 0 до 1, що позначає дрібну частину довжини лінії, де має бути "
+"розташована точка. Значення Z і M інтерполюються, якщо вони є."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"See <xref linkend=\"ST_LineLocatePoint\"/> for computing the line location "
+"nearest to a Point."
+msgstr ""
+"Див. <xref linkend=\"ST_LineLocatePoint\"/>для обчислення найближчого до "
+"точки місця розташування лінії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function computes points in 2D and then interpolates values for Z and "
+"M, while <xref linkend=\"ST_3DLineInterpolatePoint\"/> computes points in 3D "
+"and only interpolates the M value."
+msgstr ""
+"<xref linkend=\"ST_3DLineInterpolatePoint\"/> обчислює точки в 3D і "
+"інтерполює тільки значення M."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Since release 1.1.1 this function also interpolates M and Z values (when "
+"present), while prior releases set them to 0.0."
+msgstr ""
+"Починаючи з версії 1.1.1, ця функція також інтерполює значення M і Z (якщо "
+"вони присутні), тоді як у попередніх версіях вони встановлювалися на 0,0."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 0.8.2, Z and M supported added in 1.1.1"
+msgstr "Доступність: 0.8.2, підтримка Z і M додана в 1.1.1"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Line_Interpolate_Point."
+msgstr ""
+"Змінено: 2.1.0. До версії 2.0.x ця функція називалася "
+"ST_Line_Interpolate_Point."
+
+#. Tag: para
+#, no-c-format
+msgid "A LineString with the interpolated point at 20% position (0.20)"
+msgstr "LineString з інтерпольованою точкою в положенні 20% (0,20)"
+
+#. Tag: para
+#, no-c-format
+msgid "The mid-point of a 3D line:"
+msgstr "Середина 3D лінії:"
+
+#. Tag: para
+#, no-c-format
+msgid "The closest point on a line to a point:"
+msgstr "Найближча точка на прямій до точки:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_3DLineInterpolatePoint\"/>, <xref "
+"linkend=\"ST_LineLocatePoint\"/>"
+msgstr ""
+", <xref linkend=\"ST_3DLineInterpolatePoint\"/>, <xref linkend="
+"\"ST_LineLocatePoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a point interpolated along a 3D line at a fractional location."
+msgstr "Повертає точку, інтерпольовану вздовж 3D-лінії в дробовому місці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a point interpolated along a 3D line at a fractional location. First "
+"argument must be a LINESTRING. Second argument is a float between 0 and 1 "
+"representing the point location as a fraction of line length. The M value is "
+"interpolated if present."
+msgstr ""
+"Повертає точку, інтерпольовану вздовж 3D-лінії в дробовому місці. Перший "
+"аргумент повинен бути LINESTRING. Другий аргумент — це число з плаваючою "
+"комою від 0 до 1, що позначає місце розташування точки як дробу довжини "
+"лінії. Якщо значення M присутнє, воно інтерполюється."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"computes points in 2D and then interpolates the values for Z and M, while "
+"this function computes points in 3D and only interpolates the M value."
+msgstr ""
+"обчислює точки в 2D, а потім інтерполює значення для Z і M, тоді як ця "
+"функція обчислює точки в 3D і інтерполює тільки значення M."
+
+#. Tag: para
+#, no-c-format
+msgid "Return point 20% along 3D line"
+msgstr "Точка повернення 20% вздовж 3D лінії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_LineInterpolatePoints\"/>, <xref "
+"linkend=\"ST_LineLocatePoint\"/>"
+msgstr ""
+", <xref linkend=\"ST_LineInterpolatePoints\"/>, <xref linkend="
+"\"ST_LineLocatePoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns points interpolated along a line at a fractional interval."
+msgstr "Повертає точки, інтерпольовані вздовж лінії з дробовим інтервалом."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns one or more points interpolated along a line at a fractional "
+"interval. The first argument must be a LINESTRING. The second argument is a "
+"float8 between 0 and 1 representing the spacing between the points as a "
+"fraction of line length. If the third argument is false, at most one point "
+"will be constructed (which is equivalent to <xref "
+"linkend=\"ST_LineInterpolatePoint\"/>.)"
+msgstr ""
+"Повертає одну або кілька точок, інтерпольованих вздовж лінії з дробовим "
+"інтервалом. Перший аргумент повинен бути LINESTRING. Другий аргумент — це "
+"float8 від 0 до 1, що представляє відстань між точками як дріб довжини "
+"лінії. Якщо третій аргумент має значення false, буде побудовано не більше "
+"однієї точки (що еквівалентно <xref linkend=\"ST_LineInterpolatePoint\"/>)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the result has zero or one points, it is returned as a POINT. If it has "
+"two or more points, it is returned as a MULTIPOINT."
+msgstr ""
+"Якщо результат має нуль або один пункт, він повертається як POINT. Якщо він "
+"має два або більше пунктів, він повертається як MULTIPOINT."
+
+#. Tag: para
+#, no-c-format
+msgid "A LineString with points interpolated every 20%"
+msgstr "Лінія String з точками, інтерпольованими кожні 20%"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LineLocatePoint\"/>"
+msgstr ", <xref linkend=\"ST_LineLocatePoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the fractional location of the closest point on a line to a point."
+msgstr ""
+"Повертає дробове значення відстані найближчої точки на лінії до заданої "
+"точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a float between 0 and 1 representing the location of the closest "
+"point on a LineString to the given Point, as a fraction of <link "
+"linkend=\"ST_Length2D\">2d line</link> length."
+msgstr ""
+"Повертає число з плаваючою комою в діапазоні від 0 до 1, що представляє "
+"розташування найближчої точки на LineString до заданої точки Point, як "
+"частку довжини <link linkend=\"ST_Length2D\">2d line</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can use the returned location to extract a Point (<xref "
+"linkend=\"ST_LineInterpolatePoint\"/>) or a substring (<xref "
+"linkend=\"ST_LineSubstring\"/>)."
+msgstr ""
+"Ви можете використовувати повернуте місце розташування для вилучення точки ("
+"<xref linkend=\"ST_LineInterpolatePoint\"/>) або підрядка (<xref linkend="
+"\"ST_LineSubstring\"/>)."
+
+#. Tag: para
+#, no-c-format
+msgid "This is useful for approximating numbers of addresses"
+msgstr "Це корисно для наближення кількості адрес"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Line_Locate_Point."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Line_Locate_Point."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Length2D\"/>, <xref linkend=\"ST_LineInterpolatePoint\"/"
+">, <xref linkend=\"ST_LineSubstring\"/>"
+msgstr ""
+", <xref linkend=\"ST_Length2D\"/>, <xref linkend=\"ST_LineInterpolatePoint\"/"
+">, <xref linkend=\"ST_LineSubstring\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the part of a line between two fractional locations."
+msgstr "Повертає частину лінії між двома дробовими позиціями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the line which is the section of the input line starting and ending "
+"at the given fractional locations. The first argument must be a LINESTRING. "
+"The second and third arguments are values in the range [0, 1] representing "
+"the start and end locations as fractions of line length. The Z and M values "
+"are interpolated for added endpoints if present."
+msgstr ""
+"Обчислює лінію, яка є ділянкою вхідної лінії, що починається і закінчується "
+"в заданих дробових точках. Перший аргумент повинен бути LINESTRING. Другий і "
+"третій аргументи є значеннями в діапазоні [0, 1], що представляють початкову "
+"і кінцеву точки як дроби довжини лінії. Значення Z і M інтерполюються для "
+"доданих кінцевих точок, якщо вони є."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>startfraction</varname> and <varname>endfraction</varname> have "
+"the same value this is equivalent to <xref "
+"linkend=\"ST_LineInterpolatePoint\"/>."
+msgstr ""
+"Якщо <varname>startfraction</varname> та <varname>endfraction</varname> "
+"мають однакове значення, це еквівалентно <xref linkend="
+"\"ST_LineInterpolatePoint\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This only works with LINESTRINGs. To use on contiguous MULTILINESTRINGs "
+"first join them with <xref linkend=\"ST_LineMerge\"/>."
+msgstr ""
+"Це працює тільки з LINESTRING. Щоб використовувати на суміжних "
+"MULTILINESTRING, спочатку об'єднайте їх за допомогою <xref linkend="
+"\"ST_LineMerge\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Since release 1.1.1 this function interpolates M and Z values. Prior "
+"releases set Z and M to unspecified values."
+msgstr ""
+"Починаючи з версії 1.1.1, ця функція інтерполює значення M і Z. У попередніх "
+"версіях Z і M встановлювалися на невизначені значення."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.4.0 - Support for geography was introduced."
+msgstr "Покращено: 3.4.0 - Додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0. Up to 2.0.x this was called ST_Line_Substring."
+msgstr "Змінено: 2.1.0. До версії 2.0.x це називалося ST_Line_Substring."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.0, Z and M supported added in 1.1.1"
+msgstr "Доступність: 1.1.0, підтримка Z і M додана в 1.1.1"
+
+#. Tag: para
+#, no-c-format
+msgid "A LineString seen with 1/3 midrange overlaid (0.333, 0.666)"
+msgstr ""
+"Лінія LineString, на яку накладено 1/3 середнього діапазону (0,333, 0,666)"
+
+#. Tag: para
+#, no-c-format
+msgid "If start and end locations are the same, the result is a POINT."
+msgstr "Якщо початкова та кінцева точки однакові, результатом є ТОЧКА."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A query to cut a LineString into sections of length 100 or shorter. It uses "
+"<varname>generate_series()</varname> with a CROSS JOIN LATERAL to produce "
+"the equivalent of a FOR loop."
+msgstr ""
+"Запит для розрізання LineString на секції довжиною 100 або менше. Він "
+"використовує <varname>generate_series()</varname> з CROSS JOIN LATERAL для "
+"створення еквівалента циклу FOR."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geography implementation measures along a spheroid, geometry along a line"
+msgstr "Заходи з реалізації географії вздовж сфероїда, геометрія вздовж лінії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_LineExtend\"/>, <xref "
+"linkend=\"ST_LineInterpolatePoint\"/>, <xref linkend=\"ST_LineMerge\"/>"
+msgstr ""
+", <xref linkend=\"ST_LineExtend\"/>, <xref linkend=\"ST_LineInterpolatePoint"
+"\"/>, <xref linkend=\"ST_LineMerge\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the point(s) on a geometry that match a measure value."
+msgstr "Повертає точку (точки) на геометрії, яка відповідає значенню міри."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the location(s) along a measured geometry that have the given "
+"measure values. The result is a Point or MultiPoint. Polygonal inputs are "
+"not supported."
+msgstr ""
+"Повертає місцезнаходження вздовж виміряної геометрії, яке має задані "
+"значення вимірювання. Результатом є точка або багатоточка. Полігональні "
+"вхідні дані не підтримуються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>offset</varname> is provided, the result is offset to the left "
+"or right of the input line by the specified distance. A positive offset will "
+"be to the left, and a negative one to the right."
+msgstr ""
+"Якщо вказано <varname>offset</varname>, результат буде зміщений вліво або "
+"вправо від лінії введення на вказану відстань. Позитивне зміщення буде "
+"вліво, а негативне — вправо."
+
+#. Tag: para
+#, no-c-format
+msgid "Use this function only for linear geometries with an M component"
+msgstr "Використовуйте цю функцію тільки для лінійних геометрій з компонентом M"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The semantic is specified by the <emphasis>ISO/IEC 13249-3 SQL/MM Spatial</"
+"emphasis> standard."
+msgstr ""
+"Семантика визначається стандартом <emphasis>ISO/IEC 13249-3 SQL/MM "
+"Spatial</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.0 by old name ST_Locate_Along_Measure."
+msgstr "Доступність: 1.1.0 під старою назвою ST_Locate_Along_Measure."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 in prior versions this used to be called "
+"ST_Locate_Along_Measure."
+msgstr ""
+"Змінено: 2.0.0 у попередніх версіях це називалося ST_Locate_Along_Measure."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.13"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.13"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_LocateBetweenElevations\"/>, <xref "
+"linkend=\"ST_InterpolatePoint\"/>"
+msgstr ""
+", <xref linkend=\"ST_LocateBetweenElevations\"/>, <xref linkend="
+"\"ST_InterpolatePoint\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the portions of a geometry that match a measure range."
+msgstr "Повертає частини геометрії, які відповідають діапазону вимірювання."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a geometry (collection) with the portions of the input measured "
+"geometry that match the specified measure range (inclusively)."
+msgstr ""
+"Повернути геометрію (колекцію) з частинами виміряної геометрії вхідних "
+"даних, які відповідають заданому діапазону вимірювання (включно)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>offset</varname> is provided, the result is offset to the "
+"left or right of the input line by the specified distance. A positive offset "
+"will be to the left, and a negative one to the right."
+msgstr ""
+"Якщо вказано <varname>offset</varname>, результат буде зміщений вліво або "
+"вправо від вхідної лінії на вказану відстань. Позитивне зміщення буде вліво, "
+"а негативне — вправо."
+
+#. Tag: para
+#, no-c-format
+msgid "Clipping a non-convex POLYGON may produce invalid geometry."
+msgstr "Обрізка не опуклого полігону може призвести до некоректної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.0 by old name ST_Locate_Between_Measures."
+msgstr "Доступність: 1.1.0 під старою назвою ST_Locate_Between_Measures."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 - in prior versions this used to be called "
+"ST_Locate_Between_Measures."
+msgstr ""
+"Змінено: 2.0.0 — у попередніх версіях ця функція називалася "
+"ST_Locate_Between_Measures.Змінено: 2.0.0 — у попередніх версіях ця функція "
+"називалася ST_Locate_Between_Measures."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.0.0 - added support for POLYGON, TIN, TRIANGLE."
+msgstr "Покращено: 3.0.0 - додано підтримку POLYGON, TIN, TRIANGLE."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A LineString with the section between measures 2 and 8, offset to the left"
+msgstr "LineString із відрізком між мірками 2 та 8, зміщений ліворуч"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LocateBetweenElevations\"/>"
+msgstr ", <xref linkend=\"ST_LocateBetweenElevations\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the portions of a geometry that lie in an elevation (Z) range."
+msgstr "Повертає частини геометрії, що лежать у діапазоні висоти (Z)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry (collection) with the portions of a geometry that lie in "
+"an elevation (Z) range."
+msgstr ""
+"Повертає геометрію (колекцію) з частинами геометрії, що лежать у діапазоні "
+"висоти (Z)."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.4.0"
+msgstr "Доступність: 1.4.0"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LocateBetween\"/>"
+msgstr ", <xref linkend=\"ST_LocateBetween\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the interpolated measure of a geometry closest to a point."
+msgstr "Повертає інтерпольоване значення геометрії, найближчої до точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an interpolated measure value of a linear measured geometry at the "
+"location closest to the given point."
+msgstr ""
+"Повертає інтерпольоване значення вимірювання лінійної геометрії в місці, "
+"найближчому до заданої точки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_LocateAlong\"/>, <xref linkend=\"ST_LocateBetween\"/>"
+msgstr ""
+", <xref linkend=\"ST_LocateAlong\"/>, <xref linkend=\"ST_LocateBetween\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Interpolates measures along a linear geometry."
+msgstr "Інтерполює виміри вздовж лінійної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a derived geometry with measure values linearly interpolated between "
+"the start and end points. If the geometry has no measure dimension, one is "
+"added. If the geometry has a measure dimension, it is over-written with new "
+"values. Only LINESTRINGS and MULTILINESTRINGS are supported."
+msgstr ""
+"Повертає похідну геометрію з лінійно інтерпольованими значеннями вимірювання "
+"між початковою та кінцевою точками. Якщо геометрія не має вимірювального "
+"виміру, він додається. Якщо геометрія має вимірювальний вимір, він "
+"перезаписується новими значеннями. Підтримуються лише LINESTRINGS та "
+"MULTILINESTRINGS."
+
+#. Tag: title
+#, no-c-format
+msgid "Table Management Functions"
+msgstr "Функції управління таблицями"
+
+#. Tag: para
+#, no-c-format
+msgid "These functions assist in defining tables containing geometry columns."
+msgstr "Ці функції допомагають визначати таблиці, що містять стовпці геометрії."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Adds a geometry column to an existing table."
+msgstr "Додає стовпець геометрії до існуючої таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds a geometry column to an existing table of attributes. The "
+"<varname>schema_name</varname> is the name of the table schema. The "
+"<varname>srid</varname> must be an integer value reference to an entry in "
+"the SPATIAL_REF_SYS table. The <varname>type</varname> must be a string "
+"corresponding to the geometry type, eg, 'POLYGON' or 'MULTILINESTRING' . An "
+"error is thrown if the schemaname doesn't exist (or not visible in the "
+"current search_path) or the specified SRID, geometry type, or dimension is "
+"invalid."
+msgstr ""
+"Додає стовпець геометрії до існуючої таблиці атрибутів. "
+"<varname>schema_name</varname> — це ім'я схеми таблиці. <varname>srid</"
+"varname> має бути цілочисельним значенням, що посилається на запис у таблиці "
+"SPATIAL_REF_SYS. <varname>type</varname> повинен бути рядком, що відповідає "
+"типу геометрії, наприклад, “POLYGON” або “MULTILINESTRING” . Якщо "
+"schema_name не існує (або не видно в поточному search_path) або вказаний "
+"SRID, тип геометрії або розмір є недійсними, виникає помилка."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 This function no longer updates geometry_columns since "
+"geometry_columns is a view that reads from system catalogs. It by default "
+"also does not create constraints, but instead uses the built in type "
+"modifier behavior of PostgreSQL. So for example building a wgs84 POINT "
+"column with this function is now equivalent to: <code>ALTER TABLE some_table "
+"ADD COLUMN geom geometry(Point,4326);</code>"
+msgstr ""
+"Змінено: 2.0.0 Ця функція більше не оновлює geometry_columns, оскільки "
+"geometry_columns є поданням, яке зчитує дані з системних каталогів. За "
+"замовчуванням вона також не створює обмежень, а замість цього використовує "
+"вбудовану поведінку модифікатора типу PostgreSQL. Наприклад, створення "
+"стовпця wgs84 POINT за допомогою цієї функції тепер еквівалентно: "
+"<code>ALTER TABLE some_table ADD COLUMN geom geometry(Point,4326);</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 If you require the old behavior of constraints use the "
+"default <varname>use_typmod</varname>, but set it to false."
+msgstr ""
+"Змінено: 2.0.0 Якщо вам потрібна стара поведінка обмежень, використовуйте "
+"стандартне значення <varname>use_typmod</varname>, але встановіть його на "
+"false."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 Views can no longer be manually registered in "
+"geometry_columns, however views built against geometry typmod tables "
+"geometries and used without wrapper functions will register themselves "
+"correctly because they inherit the typmod behavior of their parent table "
+"column. Views that use geometry functions that output other geometries will "
+"need to be cast to typmod geometries for these view geometry columns to be "
+"registered correctly in geometry_columns. Refer to <xref "
+"linkend=\"Manual_Register_Spatial_Column\"/>."
+msgstr ""
+"Змінено: 2.0.0 Види більше не можна реєструвати вручну в geometry_columns, "
+"однак види, побудовані на основі геометрій таблиць типу typmod і "
+"використовувані без функцій-обгортки, реєструватимуться правильно, оскільки "
+"вони успадковують поведінку типу typmod стовпця батьківської таблиці. Види, "
+"які використовують функції геометрії, що виводять інші геометрії, потрібно "
+"буде перетворити на геометрії типу typmod, щоб ці стовпці геометрії виду "
+"були зареєстровані правильно в geometry_columns. Див. <xref linkend="
+"\"Manual_Register_Spatial_Column\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 use_typmod argument introduced. Defaults to creating typmod "
+"geometry column instead of constraint-based."
+msgstr ""
+"Покращено: 2.0.0 Додано аргумент use_typmod. За замовчуванням створюється "
+"стовпець геометрії typmod замість стовпця на основі обмежень."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"DropGeometryTable\"/>, <xref linkend=\"geometry_columns\"/"
+">, <xref linkend=\"Manual_Register_Spatial_Column\"/>"
+msgstr ""
+", <xref linkend=\"DropGeometryTable\"/>, <xref linkend=\"geometry_columns\"/"
+">, <xref linkend=\"Manual_Register_Spatial_Column\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Removes a geometry column from a spatial table."
+msgstr "Видаляє стовпець геометрії з просторової таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Removes a geometry column from a spatial table. Note that schema_name will "
+"need to match the f_table_schema field of the table's row in the "
+"geometry_columns table."
+msgstr ""
+"Видаляє стовпець геометрії з просторової таблиці. Зверніть увагу, що "
+"schema_name повинен відповідати полю f_table_schema рядка таблиці в таблиці "
+"geometry_columns."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 This function is provided for backward compatibility. Now "
+"that since geometry_columns is now a view against the system catalogs, you "
+"can drop a geometry column like any other table column using <code>ALTER "
+"TABLE</code>"
+msgstr ""
+"Змінено: 2.0.0 Ця функція надається для забезпечення зворотної сумісності. "
+"Тепер, коли geometry_columns є видом системних каталогів, ви можете видалити "
+"стовпець geometry так само, як і будь-який інший стовпець таблиці, за "
+"допомогою <code>ALTER TABLE</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"DropGeometryTable\"/>, <xref linkend=\"geometry_columns\"/>"
+msgstr ""
+", <xref linkend=\"DropGeometryTable\"/>, <xref linkend=\"geometry_columns\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Drops a table and all its references in geometry_columns."
+msgstr "Видаляє таблицю та всі її посилання в geometry_columns."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Drops a table and all its references in geometry_columns. Note: uses "
+"current_schema() on schema-aware pgsql installations if schema is not "
+"provided."
+msgstr ""
+"Видаляє таблицю та всі її посилання в geometry_columns. Примітка: "
+"використовує current_schema() в установках pgsql, що підтримують схеми, якщо "
+"схема не вказана."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 This function is provided for backward compatibility. Now "
+"that since geometry_columns is now a view against the system catalogs, you "
+"can drop a table with geometry columns like any other table using <code>DROP "
+"TABLE</code>"
+msgstr ""
+"Змінено: 2.0.0 Ця функція надається для забезпечення зворотної сумісності. "
+"Тепер, коли geometry_columns є переглядом системних каталогів, ви можете "
+"видалити таблицю з геометричними стовпцями, як і будь-яку іншу таблицю, за "
+"допомогою <code>DROP TABLE</code>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"DropGeometryColumn\"/>, <xref linkend=\"geometry_columns\"/"
+">"
+msgstr ""
+", <xref linkend=\"DropGeometryColumn\"/>, <xref linkend=\"geometry_columns\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the SRID defined for a geometry column."
+msgstr "Повертає SRID, визначений для стовпця геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the integer SRID of the specified geometry column by searching "
+"through the GEOMETRY_COLUMNS table. If the geometry column has not been "
+"properly added (e.g. with the <xref linkend=\"AddGeometryColumn\"/> "
+"function), this function will not work."
+msgstr ""
+"Повертає ціле значення SRID вказаного стовпця геометрії, шукаючи його в "
+"таблиці GEOMETRY_COLUMNS. Якщо стовпець геометрії не був доданий належним "
+"чином (наприклад, за допомогою функції <xref linkend=\"AddGeometryColumn\"/>)"
+", ця функція не працюватиме."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Ensures geometry columns are defined with type modifiers or have appropriate "
+"spatial constraints."
+msgstr ""
+"Забезпечує, щоб стовпці геометрії були визначені з модифікаторами типу або "
+"мали відповідні просторові обмеження."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Ensures geometry columns have appropriate type modifiers or spatial "
+"constraints to ensure they are registered correctly in the "
+"<varname>geometry_columns</varname> view. By default will convert all "
+"geometry columns with no type modifier to ones with type modifiers."
+msgstr ""
+"Забезпечує, щоб стовпці геометрії мали відповідні модифікатори типу або "
+"просторові обмеження, щоб гарантувати їх правильну реєстрацію в перегляді "
+"<varname>geometry_columns</varname>. За замовчуванням перетворює всі стовпці "
+"геометрії без модифікатора типу на стовпці з модифікаторами типу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For backwards compatibility and for spatial needs such as table inheritance "
+"where each child table may have different geometry type, the old check "
+"constraint behavior is still supported. If you need the old behavior, you "
+"need to pass in the new optional argument as false "
+"<varname>use_typmod=false</varname>. When this is done geometry columns will "
+"be created with no type modifiers but will have 3 constraints defined. In "
+"particular, this means that every geometry column belonging to a table has "
+"at least three constraints:"
+msgstr ""
+"Для забезпечення зворотної сумісності та для просторових потреб, таких як "
+"успадкування таблиць, де кожна дочірня таблиця може мати різний тип "
+"геометрії, все ще підтримується старе поведінка перевірки обмежень. Якщо вам "
+"потрібна стара поведінка, потрібно передати новий необов'язковий аргумент як "
+"false <varname>use_typmod=false</varname>. Після цього стовпці геометрії "
+"будуть створені без модифікаторів типу, але з 3 визначеними обмеженнями. "
+"Зокрема, це означає, що кожен стовпець геометрії, що належить до таблиці, "
+"має принаймні три обмеження:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>enforce_dims_geom</varname> - ensures every geometry has the same "
+"dimension (see <xref linkend=\"ST_NDims\"/>)"
+msgstr ""
+"<varname>enforce_dims_geom</varname> - гарантує, що всі геометричні об'єкти "
+"мають однакові розміри (див. <xref linkend=\"ST_NDims\"/>)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>enforce_geotype_geom</varname> - ensures every geometry is of the "
+"same type (see <xref linkend=\"GeometryType\"/>)"
+msgstr ""
+"<varname>enforce_geotype_geom</varname> - гарантує, що всі геометричні "
+"об'єкти мають однаковий тип (див. <xref linkend=\"GeometryType\"/>)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>enforce_srid_geom</varname> - ensures every geometry is in the same "
+"projection (see <xref linkend=\"ST_SRID\"/>)"
+msgstr ""
+"<varname>enforce_srid_geom</varname> - гарантує, що всі геометричні об'єкти "
+"мають однакову проекцію (див. <xref linkend=\"ST_SRID\"/>)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If a table <varname>oid</varname> is provided, this function tries to "
+"determine the srid, dimension, and geometry type of all geometry columns in "
+"the table, adding constraints as necessary. If successful, an appropriate "
+"row is inserted into the geometry_columns table, otherwise, the exception is "
+"caught and an error notice is raised describing the problem."
+msgstr ""
+"Якщо вказано таблицю <varname>oid</varname>, ця функція намагається "
+"визначити srid, розмірність та тип геометрії всіх стовпців геометрії в "
+"таблиці, додаючи обмеження за необхідності. У разі успіху відповідний рядок "
+"вставляється в таблицю geometry_columns, інакше виникає виняток і "
+"з'являється повідомлення про помилку з описом проблеми."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the <varname>oid</varname> of a view is provided, as with a table oid, "
+"this function tries to determine the srid, dimension, and type of all the "
+"geometries in the view, inserting appropriate entries into the "
+"<varname>geometry_columns</varname> table, but nothing is done to enforce "
+"constraints."
+msgstr ""
+"Якщо вказано <varname>oid</varname> перегляду, як і в разі табличного oid, "
+"ця функція намагається визначити srid, розмірність і тип усіх геометрій у "
+"перегляді, вставляючи відповідні записи в таблицю <varname>geometry_columns</"
+"varname>, але не виконує жодних дій для забезпечення обмежень."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The parameterless variant is a simple wrapper for the parameterized variant "
+"that first truncates and repopulates the geometry_columns table for every "
+"spatial table and view in the database, adding spatial constraints to tables "
+"where appropriate. It returns a summary of the number of geometry columns "
+"detected in the database and the number that were inserted into the "
+"<varname>geometry_columns</varname> table. The parameterized version simply "
+"returns the number of rows inserted into the <varname>geometry_columns</"
+"varname> table."
+msgstr ""
+"Варіант без параметрів є простим обгорткою для параметризованого варіанту, "
+"який спочатку обрізає і заповнює таблицю geometry_columns для кожної "
+"просторової таблиці і перегляду в базі даних, додаючи просторові обмеження "
+"до таблиць, де це доречно. Він повертає підсумок кількості стовпців "
+"геометрії, виявлених в базі даних, і кількості, які були вставлені в таблицю "
+"<varname>geometry_columns</varname>. Параметризована версія просто повертає "
+"кількість рядків, вставлених у таблицю <varname>geometry_columns</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 By default, now uses type modifiers instead of check "
+"constraints to constrain geometry types. You can still use check constraint "
+"behavior instead by using the new <varname>use_typmod</varname> and setting "
+"it to false."
+msgstr ""
+"Змінено: 2.0.0 За замовчуванням тепер для обмеження типів геометрії "
+"використовуються модифікатори типів замість обмежень перевірки. Ви все ще "
+"можете використовувати поведінку обмежень перевірки, використовуючи новий "
+"параметр <varname>use_typmod</varname> і встановивши його значення false."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 <varname>use_typmod</varname> optional argument was "
+"introduced that allows controlling if columns are created with typmodifiers "
+"or with check constraints."
+msgstr ""
+"Покращено: 2.0.0 <varname>use_typmod</varname> додано опціональний аргумент, "
+"який дозволяє контролювати, чи створюються стовпці з типовими модифікаторами "
+"або з перевірками обмежень."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Updates the SRID of all features in a geometry column, and the table "
+"metadata."
+msgstr "Оновлює SRID всіх об'єктів у стовпці геометрії та метадані таблиці."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Updates the SRID of all features in a geometry column, updating constraints "
+"and reference in geometry_columns. If the column was enforced by a type "
+"definition, the type definition will be changed. Note: uses current_schema() "
+"on schema-aware pgsql installations if schema is not provided."
+msgstr ""
+"Оновлює SRID всіх об'єктів у стовпці геометрії, оновлюючи обмеження та "
+"посилання в geometry_columns. Якщо стовпець був застосований за допомогою "
+"визначення типу, визначення типу буде змінено. Примітка: використовує "
+"current_schema() в установках pgsql, що підтримують схеми, якщо схема не "
+"вказана."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Insert geometries into roads table with a SRID set already using <link "
+"linkend=\"ST_GeomFromEWKT\">EWKT format</link>:"
+msgstr ""
+"Вставте геометрії в таблицю доріг із вже встановленим SRID, використовуючи "
+"формат <link linkend=\"ST_GeomFromEWKT\">EWKT</link>:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This will change the srid of the roads table to 4326 from whatever it was "
+"before:"
+msgstr ""
+"Це змінить srid таблиці доріг на 4326 з будь-якого попереднього значення:"
+
+#. Tag: para
+#, no-c-format
+msgid "The prior example is equivalent to this DDL statement:"
+msgstr "Попередній приклад еквівалентний цій DDL-інструкція:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you got the projection wrong (or brought it in as unknown) in load and "
+"you wanted to transform to web mercator all in one shot you can do this with "
+"DDL but there is no equivalent PostGIS management function to do so in one "
+"go."
+msgstr ""
+"Якщо ви неправильно вказали проекцію (або вказали її як невідому) під час "
+"завантаження і хочете перетворити все в веб-меркатор за один раз, ви можете "
+"зробити це за допомогою DDL, але в PostGIS немає еквівалентної функції для "
+"виконання цієї операції за один раз."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_Transform\"/>, <xref "
+"linkend=\"ST_GeomFromEWKT\"/>"
+msgstr ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_Transform\"/>, <xref "
+"linkend=\"ST_GeomFromEWKT\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Measurement Functions"
+msgstr "Функції вимірювання"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions compute measurements of distance, area and angles. There are "
+"also functions to compute geometry values determined by measurements."
+msgstr ""
+"Ці функції обчислюють відстані, площі та кути. Існують також функції для "
+"обчислення геометричних величин, визначених за вимірами."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the area of a polygonal geometry."
+msgstr "Повертає площу полігональної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the area of a polygonal geometry. For geometry types a 2D Cartesian "
+"(planar) area is computed, with units specified by the SRID. For geography "
+"types by default area is determined on a spheroid with units in square "
+"meters. To compute the area using the faster but less accurate spherical "
+"model use <varname>ST_Area(geog,false)</varname>."
+msgstr ""
+"Повертає площу полігональної геометрії. Для типів геометрії обчислюється "
+"площина 2D (плоска) з одиницями, визначеними SRID. Для типів географії за "
+"замовчуванням площа визначається на сфероїді з одиницями в квадратних "
+"метрах. Для обчислення площі за допомогою швидшої, але менш точної сферичної "
+"моделі використовуйте <varname>ST_Area(geog,false)</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 - support for 2D polyhedral surfaces was introduced."
+msgstr "Покращено: 2.0.0 - додано підтримку 2D багатогранних поверхонь."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.2.0 - measurement on spheroid performed with GeographicLib for "
+"improved accuracy and robustness. Requires PROJ >= 4.9.0 to take "
+"advantage of the new feature."
+msgstr ""
+"Покращено: 2.2.0 — вимірювання на сфероїді виконується за допомогою "
+"GeographicLib для підвищення точності та надійності. Для використання нової "
+"функції потрібно PROJ >= 4.9.0."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 - does not depend on SFCGAL anymore."
+msgstr "Змінено: 3.0.0 - більше не залежить від SFCGAL."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.1.2, 9.5.3"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.1.2, 9.5.3"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For polyhedral surfaces, only supports 2D polyhedral surfaces (not 2.5D). "
+"For 2.5D, may give a non-zero answer, but only for the faces that sit "
+"completely in XY plane."
+msgstr ""
+"Для багатогранних поверхонь підтримуються тільки 2D багатогранні поверхні ("
+"не 2.5D). Для 2.5D може бути надано відповідь, відмінну від нуля, але тільки "
+"для граней, які повністю лежать у площині XY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return area in square feet for a plot of Massachusetts land and multiply by "
+"conversion to get square meters. Note this is in square feet because "
+"EPSG:2249 is Massachusetts State Plane Feet"
+msgstr ""
+"Площа ділянки в квадратних футах для ділянки землі в штаті Массачусетс і "
+"помножте на коефіцієнт перетворення, щоб отримати квадратні метри. Зверніть "
+"увагу, що це квадратні фути, оскільки EPSG:2249 — це система координат штату "
+"Массачусетс"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return area square feet and transform to Massachusetts state plane meters "
+"(EPSG:26986) to get square meters. Note this is in square feet because 2249 "
+"is Massachusetts State Plane Feet and transformed area is in square meters "
+"since EPSG:26986 is state plane Massachusetts meters"
+msgstr ""
+"Введіть площу в квадратних футах і переведіть її в метри площини штату "
+"Массачусетс (EPSG:26986), щоб отримати площу в квадратних метрах. Зверніть "
+"увагу, що значення вказано в квадратних футах, оскільки 2249 — це фути "
+"площини штату Массачусетс, а перетворена площа вказана в квадратних метрах, "
+"оскільки EPSG:26986 — це метри площини штату Массачусетс."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return area square feet and square meters using geography data type. Note "
+"that we transform to our geometry to geography (before you can do that make "
+"sure your geometry is in WGS 84 long lat 4326). Geography always measures in "
+"meters. This is just for demonstration to compare. Normally your table will "
+"be stored in geography data type already."
+msgstr ""
+"Поверніть площу в квадратних футах і квадратних метрах, використовуючи тип "
+"даних \"географія\". Зверніть увагу, що ми перетворюємо геометрію в географію ("
+"перед тим, як це зробити, переконайтеся, що ваша геометрія відповідає "
+"стандарту WGS 84 long lat 4326). Географія завжди вимірюється в метрах. Це "
+"лише для демонстрації та порівняння. Зазвичай ваша таблиця вже зберігається "
+"в типі даних \"географія\"."
+
+#. Tag: para
+#, no-c-format
+msgid "If your data is in geography already:"
+msgstr "Якщо ваші дані вже знаходяться в географії:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromText\"/>, <xref "
+"linkend=\"ST_GeographyFromText\"/>, <xref linkend=\"ST_SetSRID\"/>, <xref "
+"linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_GeographyFromText\""
+"/>, <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the north-based azimuth of a line between two points."
+msgstr "Повертає азимут на північ від лінії між двома точками."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the azimuth in radians of the target point from the origin point, or "
+"NULL if the two points are coincident. The azimuth angle is a positive "
+"clockwise angle referenced from the positive Y axis (geometry) or the North "
+"meridian (geography): North = 0; Northeast = π/4; East = π/2; "
+"Southeast = 3π/4; South = π; Southwest 5π/4; West = "
+"3π/2; Northwest = 7π/4."
+msgstr ""
+"Повертає азимут в радіанах від точки відліку до точки призначення або NULL, "
+"якщо ці дві точки збігаються. Кут азимута є додатним кутом за годинниковою "
+"стрілкою, відлічуваним від додатної осі Y (геометрія) або північного "
+"меридіана (географія): Північ = 0; Північний схід = π/4; Схід = "
+"π/2; Південний схід = 3π/4; Південь = π; Південний "
+"захід 5π/4; Захід = 3π/2; Північний захід = 7π/4."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the geography type, the azimuth solution is known as the <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid\">inverse "
+"geodesic problem</link>."
+msgstr ""
+"Для типу географії рішення азимута відоме як <link xlink:href=\"https://en."
+"wikipedia.org/wiki/Geodesics_on_an_ellipsoid\">обернена геодезична "
+"задача</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The azimuth is a mathematical concept defined as the angle between a "
+"reference vector and a point, with angular units in radians. The result "
+"value in radians can be converted to degrees using the PostgreSQL function "
+"<varname>degrees()</varname>."
+msgstr ""
+"Азимут — це математичне поняття, яке визначається як кут між опорним "
+"вектором і точкою, вимірюється в радіанах. Результат у радіанах можна "
+"перетворити в градуси за допомогою функції PostgreSQL "
+"<varname>degrees()</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Azimuth can be used in conjunction with <xref linkend=\"ST_Translate\"/> to "
+"shift an object along its perpendicular axis. See the "
+"<varname>upgis_lineshift()</varname> function in the <link xlink:"
+"href=\"http://trac.osgeo.org/postgis/wiki/"
+"UsersWikiplpgsqlfunctions\">PostGIS wiki</link> for an implementation of "
+"this."
+msgstr ""
+"Азимут можна використовувати разом з <xref linkend=\"ST_Translate\"/> для "
+"зміщення об'єкта вздовж його перпендикулярної осі. Дивіться функцію "
+"<varname>upgis_lineshift()</varname> у <link xlink:href=\"http://trac.osgeo."
+"org/postgis/wiki/UsersWikiplpgsqlfunctions\">PostGIS wiki</link> для "
+"реалізації цього."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 support for geography was introduced."
+msgstr "Покращено: 2.0.0 додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.2.0 measurement on spheroid performed with GeographicLib for "
+"improved accuracy and robustness. Requires PROJ >= 4.9.0 to take "
+"advantage of the new feature."
+msgstr ""
+"Покращено: вимірювання 2.2.0 на сфероїді, виконане за допомогою "
+"GeographicLib для підвищення точності та надійності. Для використання нової "
+"функції потрібно PROJ >= 4.9.0."
+
+#. Tag: para
+#, no-c-format
+msgid "Geometry Azimuth in degrees"
+msgstr "Геометрія Азимут у градусах"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Blue: origin Point(25,45); Green: target Point(75, 100); Yellow: Y axis or "
+"North; Red: azimuth angle."
+msgstr ""
+"Синій: точка відліку (25,45); Зелений: точка призначення (75, 100); Жовтий: "
+"вісь Y або північ; Червоний: кут азимута."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Blue: origin Point(75, 100); Green: target Point(25, 45); Yellow: Y axis or "
+"North; Red: azimuth angle."
+msgstr ""
+"Синій: точка відліку (75, 100); Зелений: точка призначення (25, 45); Жовтий: "
+"вісь Y або північ; Червоний: кут азимута."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_Translate\"/>, <xref "
+"linkend=\"ST_Project\"/>, <link xlink:href=\"http://www.postgresql.org/docs/"
+"current/interactive/functions-math.html\">PostgreSQL Math Functions</link>"
+msgstr ""
+", <xref linkend=\"ST_Point\"/>, <xref linkend=\"ST_Translate\"/>, <xref "
+"linkend=\"ST_Project\"/>, <link xlink:href=\"http://www.postgresql.org/docs/"
+"current/interactive/functions-math.html\">Математичні функції "
+"PostgreSQL</link>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the angle between two vectors defined by 3 or 4 points, or 2 lines."
+msgstr ""
+"Повертає кут між двома векторами, визначеними 3 або 4 точками, або 2 лініями."
+
+#. Tag: para
+#, no-c-format
+msgid "Computes the clockwise angle between two vectors."
+msgstr "Обчислює кут за годинниковою стрілкою між двома векторами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 1:</emphasis> computes the angle enclosed by "
+"the points P1-P2-P3. If a 4th point provided computes the angle points P1-P2 "
+"and P3-P4"
+msgstr ""
+"<emphasis role=\"bold\">Варіант 1:</emphasis> обчислює кут, утворений "
+"точками P1-P2-P3. Якщо вказано четверту точку, обчислюється кут між точками "
+"P1-P2 і P3-P4"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 2:</emphasis> computes the angle between two "
+"vectors S1-E1 and S2-E2, defined by the start and end points of the input "
+"lines"
+msgstr ""
+"<emphasis role=\"bold\">Варіант 2:</emphasis> обчислює кут між двома "
+"векторами S1-E1 і S2-E2, визначеними початковою і кінцевою точками вхідних "
+"ліній"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The result is a positive angle between 0 and 2π radians. The radian "
+"result can be converted to degrees using the PostgreSQL function "
+"<varname>degrees()</varname>."
+msgstr ""
+"Результатом є позитивний кут між 0 і 2π радіанами. Результат у "
+"радіанах можна перетворити на градуси за допомогою функції PostgreSQL "
+"<varname>degrees()</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that <varname>ST_Angle(P1,P2,P3) = ST_Angle(P2,P1,P2,P3)</varname>."
+msgstr ""
+"Зверніть увагу, що <varname>ST_Angle(P1,P2,P3) = "
+"ST_Angle(P2,P1,P2,P3)</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Angle between three points"
+msgstr "Кут між трьома точками"
+
+#. Tag: para
+#, no-c-format
+msgid "Angle between vectors defined by four points"
+msgstr "Кут між векторами, визначеними чотирма точками"
+
+#. Tag: para
+#, no-c-format
+msgid "Angle between vectors defined by the start and end points of lines"
+msgstr "Кут між векторами, визначеними початковою та кінцевою точками ліній"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 2D point on g1 that is closest to g2. This is the first point of "
+"the shortest line from one geometry to the other."
+msgstr ""
+"Повертає 2D точку на g1, яка найближча до g2. Це перша точка найкоротшої "
+"лінії від однієї геометрії до іншої."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 2-dimensional point on <varname>geom1</varname> that is closest "
+"to <varname>geom2</varname>. This is the first point of the shortest line "
+"between the geometries (as computed by <xref linkend=\"ST_ShortestLine\"/>)."
+msgstr ""
+"Повертає двовимірну точку на <varname>geom1</varname>, яка найближча до "
+"<varname>geom2</varname>. Це перша точка найкоротшої лінії між геометріями ("
+"розрахована за допомогою <xref linkend=\"ST_ShortestLine\"/>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you have a 3D Geometry, you may prefer to use <xref "
+"linkend=\"ST_3DClosestPoint\"/>."
+msgstr ""
+"Якщо у вас є 3D-геометрія, ви можете скористатися <xref linkend="
+"\"ST_3DClosestPoint\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.4.0 - Support for geography."
+msgstr "Покращено: 3.4.0 - Підтримка географії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The closest point for a Point and a LineString is the point itself. The "
+"closest point for a LineString and a Point is a point on the line."
+msgstr ""
+"Найближчою точкою для точки та лінійного елемента є сама точка. Найближчою "
+"точкою для лінійного елемента та точки є точка на лінії."
+
+#. Tag: para
+#, no-c-format
+msgid "The closest point on polygon A to polygon B"
+msgstr "Найближча точка полігону A до полігону B"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"ST_LongestLine\"/>, <xref "
+"linkend=\"ST_ShortestLine\"/>, <xref linkend=\"ST_MaxDistance\"/>"
+msgstr ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"ST_LongestLine\"/>, <xref "
+"linkend=\"ST_ShortestLine\"/>, <xref linkend=\"ST_MaxDistance\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 3D point on g1 that is closest to g2. This is the first point of "
+"the 3D shortest line."
+msgstr ""
+"Повертає 3D точку на g1, яка найближча до g2. Це перша точка найкоротшої 3D "
+"лінії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional point on g1 that is closest to g2. This is the "
+"first point of the 3D shortest line. The 3D length of the 3D shortest line "
+"is the 3D distance."
+msgstr ""
+"Повертає тривимірну точку на g1, яка найближча до g2. Це перша точка "
+"найкоротшої лінії в 3D. Довжина найкоротшої лінії в 3D є відстанню в 3D."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 - if 2 2D geometries are input, a 2D point is returned "
+"(instead of old behavior assuming 0 for missing Z). In case of 2D and 3D, Z "
+"is no longer assumed to be 0 for missing Z."
+msgstr ""
+"Змінено: 2.2.0 - якщо введено 2 2D геометрії, повертається 2D точка (замість "
+"старого поведінки, що припускає 0 для відсутнього Z). У випадку 2D і 3D, Z "
+"більше не вважається 0 для відсутнього Z."
+
+#. Tag: para
+#, no-c-format
+msgid "linestring and point -- both 3d and 2d closest point"
+msgstr "лінія та точка — як 3D, так і 2D найближча точка"
+
+#. Tag: para
+#, no-c-format
+msgid "linestring and multipoint -- both 3d and 2d closest point"
+msgstr "лінія та багатоточка — як 3D, так і 2D найближча точка"
+
+#. Tag: para
+#, no-c-format
+msgid "Multilinestring and polygon both 3d and 2d closest point"
+msgstr "Багатолінійні та полігони, як 3D, так і 2D, найближчі точки"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClosestPoint\"/>, <xref linkend=\"ST_3DDistance\"/>, "
+"<xref linkend=\"ST_3DShortestLine\"/>"
+msgstr ""
+", <xref linkend=\"ST_ClosestPoint\"/>, <xref linkend=\"ST_3DDistance\"/>, "
+"<xref linkend=\"ST_3DShortestLine\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the distance between two geometry or geography values."
+msgstr "Повертає відстань між двома геометричними або географічними значеннями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For <xref linkend=\"geometry\"/> types returns the minimum 2D Cartesian "
+"(planar) distance between two geometries, in projected units (spatial ref "
+"units)."
+msgstr ""
+"Для типів <xref linkend=\"geometry\"/> повертає мінімальну 2D декартову "
+"(плоску) відстань між двома геометріями в проекційних одиницях (одиницях "
+"просторової прив'язки)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For <xref linkend=\"geography\"/> types defaults to return the minimum "
+"geodesic distance between two geographies in meters, compute on the spheroid "
+"determined by the SRID. If <varname>use_spheroid</varname> is false, a "
+"faster spherical calculation is used."
+msgstr ""
+"Для типів <xref linkend=\"geography\"/> за замовчуванням повертається "
+"мінімальна геодезична відстань між двома географічними об'єктами в метрах, "
+"обчислена на сфероїді, визначеному SRID. Якщо <varname>use_spheroid</"
+"varname> має значення false, використовується швидший сферичний розрахунок."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.23"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.23"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.5.0 geography support was introduced in 1.5. Speed "
+"improvements for planar to better handle large or many vertex geometries"
+msgstr ""
+"Доступність: 1.5.0 Підтримка географії була впроваджена в версії 1.5. "
+"Покращення швидкості для плоских об'єктів для кращої обробки великих або "
+"численних вершин геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 improved speed for geography. See <link xlink:href=\"https://"
+"web.archive.org/web/20160827203903/http://boundlessgeo.com/2012/07/making-"
+"geography-faster/\">Making Geography faster</link> for details."
+msgstr ""
+"Покращено: 2.1.0 покращено швидкість роботи з географією. Детальніше див. "
+"<link xlink:href=\"https://web.archive.org/web/20160827203903/"
+"http://boundlessgeo.com/2012/07/making-geography-faster/\">Пришвидшення "
+"роботи з географією</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 - support for curved geometries was introduced."
+msgstr "Покращено: 2.1.0 — додано підтримку кривих геометрій."
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Examples"
+msgstr "Приклади геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry example - units in planar degrees 4326 is WGS 84 long lat, units "
+"are degrees."
+msgstr ""
+"Приклад геометрії - одиниці виміру в плоских градусах 4326 - це довжина в "
+"градусах за системою WGS 84, одиниці виміру - градуси."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry example - units in meters (SRID: 3857, proportional to pixels on "
+"popular web maps). Although the value is off, nearby ones can be compared "
+"correctly, which makes it a good choice for algorithms like KNN or KMeans."
+msgstr ""
+"Приклад геометрії — одиниці виміру в метрах (SRID: 3857, пропорційно до "
+"пікселів на популярних веб-мапах). Хоча значення не відповідає дійсності, "
+"сусідні значення можна порівняти правильно, що робить цей вибір хорошим для "
+"таких алгоритмів, як KNN або KMeans."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry example - units in meters (SRID: 3857 as above, but corrected by "
+"cos(lat) to account for distortion)"
+msgstr ""
+"Приклад геометрії — одиниці виміру в метрах (SRID: 3857, як вище, але "
+"скориговано за допомогою cos(lat) для врахування спотворення)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry example - units in meters (SRID: 26986 Massachusetts state plane "
+"meters) (most accurate for Massachusetts)"
+msgstr ""
+"Приклад геометрії — одиниці виміру в метрах (SRID: 26986 метри площини штату "
+"Массачусетс) (найточніше для штату Массачусетс)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry example - units in meters (SRID: 2163 US National Atlas Equal area) "
+"(least accurate)"
+msgstr ""
+"Приклад геометрії — одиниці виміру в метрах (SRID: 2163 US National Atlas "
+"Equal area) (найменша точність)"
+
+#. Tag: title
+#, no-c-format
+msgid "Geography Examples"
+msgstr "Приклади з географії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Same as geometry example but note units in meters - use sphere for slightly "
+"faster and less accurate computation."
+msgstr ""
+"Те саме, що й у прикладі з геометрією, але зверніть увагу на одиниці виміру "
+"в метрах — для трохи швидшого та менш точного обчислення використовуйте "
+"сферу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_DistanceSphere\"/>, "
+"<xref linkend=\"ST_Distance_Spheroid\"/>, <xref linkend=\"ST_MaxDistance\"/"
+">, <xref linkend=\"ST_HausdorffDistance\"/>, <xref "
+"linkend=\"ST_FrechetDistance\"/>, <xref linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_DistanceSphere\"/>, "
+"<xref linkend=\"ST_Distance_Spheroid\"/>, <xref linkend=\"ST_MaxDistance\"/"
+">, <xref linkend=\"ST_HausdorffDistance\"/>, <xref linkend="
+"\"ST_FrechetDistance\"/>, <xref linkend=\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 3D cartesian minimum distance (based on spatial ref) between two "
+"geometries in projected units."
+msgstr ""
+"Повертає мінімальну 3D декартову відстань (на основі просторової референції) "
+"між двома геометріями в проекційних одиницях."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional minimum cartesian distance between two geometries "
+"in projected units (spatial ref units)."
+msgstr ""
+"Повертає 3-вимірну мінімальну декартову відстань між двома геометріями в "
+"проекційних одиницях (одиницях просторової прив'язки)."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM ISO/IEC 13249-3"
+msgstr "&sqlmm_compliant; SQL-MM ISO/IEC 13249-3"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 - In case of 2D and 3D, Z is no longer assumed to be 0 for "
+"missing Z."
+msgstr ""
+"Змінено: 2.2.0 - У випадку 2D та 3D, Z більше не вважається рівним 0 для "
+"відсутнього Z."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 - SFCGAL version removed"
+msgstr "Змінено: 3.0.0 - Вилучено версію SFCGAL"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_3DClosestPoint\"/>, <xref linkend=\"ST_3DDWithin\"/>, "
+"<xref linkend=\"ST_3DMaxDistance\"/>, <xref linkend=\"ST_3DShortestLine\"/>, "
+"<xref linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_3DClosestPoint\"/>, <xref linkend=\"ST_3DDWithin\"/>, "
+"<xref linkend=\"ST_3DMaxDistance\"/>, <xref linkend=\"ST_3DShortestLine\"/>, "
+"<xref linkend=\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns minimum distance in meters between two lon/lat geometries using a "
+"spherical earth model."
+msgstr ""
+"Повертає мінімальну відстань у метрах між двома геометріями довготи/широти, "
+"використовуючи модель сферичної Землі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns minimum distance in meters between two lon/lat points. Uses a "
+"spherical earth and radius derived from the spheroid defined by the SRID. "
+"Faster than <xref linkend=\"ST_Distance_Spheroid\"/>, but less accurate. "
+"PostGIS Versions prior to 1.5 only implemented for points."
+msgstr ""
+"Повертає мінімальну відстань у метрах між двома точками lon/lat. "
+"Використовує сферичну Землю та радіус, отриманий із сфероїда, визначеного "
+"SRID. Швидше, ніж <xref linkend=\"ST_Distance_Spheroid\"/>, але менш точне. "
+"У версіях PostGIS до 1.5 реалізовано тільки для точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.5 - support for other geometry types besides points was "
+"introduced. Prior versions only work with points."
+msgstr ""
+"Доступність: 1.5 — додано підтримку інших типів геометрії, крім точок. "
+"Попередні версії працюють тільки з точками."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 In prior versions this used to be called ST_Distance_Sphere"
+msgstr "Змінено: 2.2.0 У попередніх версіях це називалося ST_Distance_Sphere"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Distance_Spheroid\"/>"
+msgstr ", <xref linkend=\"ST_Distance_Spheroid\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the minimum distance between two lon/lat geometries using a "
+"spheroidal earth model."
+msgstr ""
+"Повертає мінімальну відстань між двома геометріями lon/lat, використовуючи "
+"сфероїдальну модель Землі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns minimum distance in meters between two lon/lat geometries given a "
+"particular spheroid. See the explanation of spheroids given for <xref "
+"linkend=\"ST_Length_Spheroid\"/>."
+msgstr ""
+"Повертає мінімальну відстань у метрах між двома геометріями lon/lat, "
+"заданими для певного сфероїда. Див. пояснення сфероїдів, наведене для <xref "
+"linkend=\"ST_Length_Spheroid\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not look at the SRID of the geometry. It assumes the "
+"geometry coordinates are based on the provided spheroid."
+msgstr ""
+"Ця функція не враховує SRID геометрії. Вона припускає, що координати "
+"геометрії базуються на наданому сфероїді."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.2.0 In prior versions this was called ST_Distance_Spheroid"
+msgstr "Змінено: 2.2.0 У попередніх версіях це називалося ST_Distance_Spheroid"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_DistanceSphere\"/>"
+msgstr ", <xref linkend=\"ST_DistanceSphere\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Fréchet distance between two geometries."
+msgstr "Повертає відстань Фреше між двома геометріями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Implements algorithm for computing the Fréchet distance restricted to "
+"discrete points for both geometries, based on <link xlink:href=\"http://www."
+"kr.tuwien.ac.at/staff/eiter/et-archive/cdtr9464.pdf\">Computing Discrete "
+"Fréchet Distance</link>. The Fréchet distance is a measure of similarity "
+"between curves that takes into account the location and ordering of the "
+"points along the curves. Therefore it is often better than the Hausdorff "
+"distance."
+msgstr ""
+"Реалізує алгоритм обчислення відстані Фреше, обмеженої дискретними точками "
+"для обох геометрій, на основі <link xlink:href=\"http://www.kr.tuwien.ac.at/"
+"staff/eiter/et-archive/cdtr9464.pdf\">Computing Discrete Fréchet Distance</"
+"link>. Відстань Фреше — це міра подібності кривих, що враховує розташування "
+"та порядок точок уздовж кривих. Тому вона часто є кращою за відстань "
+"Гаусдорфа."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When the optional densifyFrac is specified, this function performs a segment "
+"densification before computing the discrete Fréchet distance. The "
+"densifyFrac parameter sets the fraction by which to densify each segment. "
+"Each segment will be split into a number of equal-length subsegments, whose "
+"fraction of the total length is closest to the given fraction."
+msgstr ""
+"Коли вказано опціональний параметр densifyFrac, ця функція виконує "
+"ущільнення сегментів перед обчисленням дискретної відстані Фреше. Параметр "
+"densifyFrac встановлює частку, на яку ущільнюється кожен сегмент. Кожен "
+"сегмент буде розділений на декілька підсегментів однакової довжини, частка "
+"яких у загальній довжині найближча до заданої частки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Units are in the units of the spatial reference system of the geometries."
+msgstr ""
+"Одиниці вимірювання відповідають одиницям просторової системи координат "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The current implementation supports only vertices as the discrete locations. "
+"This could be extended to allow an arbitrary density of points to be used."
+msgstr ""
+"Поточна реалізація підтримує тільки вершини як дискретні місця розташування. "
+"Це можна розширити, щоб дозволити використання довільної щільності точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The smaller densifyFrac we specify, the more accurate Fréchet distance we "
+"get. But, the computation time and the memory usage increase with the square "
+"of the number of subsegments."
+msgstr ""
+"Чим менше значення densifyFrac ми вказуємо, тим точніше буде відстань Фреше. "
+"Однак час обчислення та використання пам'яті зростають пропорційно до "
+"квадрату кількості підсегментів."
+
+#. Tag: para
+#, fuzzy, no-c-format
+msgid "Availability: 2.4.0 - requires GEOS >= 3.7.0"
+msgstr "Availability: 2.4.0 - requires GEOS >= 3.7.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Hausdorff distance between two geometries."
+msgstr "Повертає відстань Гаусдорфа між двома геометріями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"Hausdorff_distance\">Hausdorff distance</link> between two geometries. The "
+"Hausdorff distance is a measure of how similar or dissimilar 2 geometries "
+"are."
+msgstr ""
+"Повертає <link xlink:href=\"http://en.wikipedia.org/wiki/Hausdorff_distance\""
+">відстань Гаусдорфа</link> між двома геометріями. Відстань Гаусдорфа — це "
+"міра схожості або відмінності двох геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function actually computes the \"Discrete Hausdorff Distance\". This is "
+"the Hausdorff distance computed at discrete points on the geometries. The "
+"<parameter>densifyFrac</parameter> parameter can be specified, to provide a "
+"more accurate answer by densifying segments before computing the discrete "
+"Hausdorff distance. Each segment is split into a number of equal-length "
+"subsegments whose fraction of the segment length is closest to the given "
+"fraction."
+msgstr ""
+"Функція фактично обчислює \"дискретну відстань Гаусдорфа\". Це відстань "
+"Гаусдорфа, обчислена в дискретних точках геометрії. Параметр "
+"<parameter>densifyFrac</parameter> можна вказати, щоб отримати більш точний "
+"результат шляхом ущільнення сегментів перед обчисленням дискретної відстані "
+"Гаусдорфа. Кожен сегмент розділяється на кілька підсегментів однакової "
+"довжини, частка яких у довжині сегмента найближча до заданої частки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This algorithm is NOT equivalent to the standard Hausdorff distance. "
+"However, it computes an approximation that is correct for a large subset of "
+"useful cases. One important case is Linestrings that are roughly parallel to "
+"each other, and roughly equal in length. This is a useful metric for line "
+"matching."
+msgstr ""
+"Цей алгоритм НЕ є еквівалентним стандартній відстані Гаусдорфа. Однак він "
+"обчислює наближення, яке є правильним для великої підмножини корисних "
+"випадків. Одним з важливих випадків є лінійні рядки, які приблизно "
+"паралельні один одному і мають приблизно однакову довжину. Це корисний "
+"показник для зіставлення ліній."
+
+#. Tag: para
+#, no-c-format
+msgid "Hausdorff distance (red) and distance (yellow) between two lines"
+msgstr "Відстань Гаусдорфа (червоний) і відстань (жовтий) між двома лініями"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Hausdorff distance with "
+"densification."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Відстань Гаусдорфа з ущільненням."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> For each building, find the "
+"parcel that best represents it. First we require that the parcel intersect "
+"with the building geometry. <code>DISTINCT ON</code> guarantees we get each "
+"building listed only once. <code>ORDER BY .. ST_HausdorffDistance</code> "
+"selects the parcel that is most similar to the building."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Для кожної будівлі знайдіть "
+"ділянку, яка найкраще її представляє. Спочатку ми вимагаємо, щоб ділянка "
+"перетиналася з геометрією будівлі. <code>DISTINCT ON</code> гарантує, що "
+"кожна будівля буде вказана тільки один раз. <code>ORDER BY .. "
+"ST_HausdorffDistance</code> вибирає ділянку, яка найбільш схожа на будівлю."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 2D length of a linear geometry."
+msgstr "Повертає 2D довжину лінійної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geometry types: returns the 2D Cartesian length of the geometry if it is "
+"a LineString, MultiLineString, ST_Curve, ST_MultiCurve. For areal geometries "
+"0 is returned; use <xref linkend=\"ST_Perimeter\"/> instead. The units of "
+"length is determined by the spatial reference system of the geometry."
+msgstr ""
+"Для типів геометрії: повертає двовимірну декартову довжину геометрії, якщо "
+"це LineString, MultiLineString, ST_Curve, ST_MultiCurve. Для плоских "
+"геометрій повертається 0; замість цього використовуйте <xref linkend="
+"\"ST_Perimeter\"/>. Одиниці довжини визначаються просторовою системою "
+"відліку геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography types: computation is performed using the inverse geodesic "
+"calculation. Units of length are in meters. If PostGIS is compiled with PROJ "
+"version 4.8.0 or later, the spheroid is specified by the SRID, otherwise it "
+"is exclusive to WGS84. If <varname>use_spheroid = false</varname>, then the "
+"calculation is based on a sphere instead of a spheroid."
+msgstr ""
+"Для географічних типів: обчислення виконується за допомогою оберненого "
+"геодезичного розрахунку. Одиниці довжини вказані в метрах. Якщо PostGIS "
+"скомпільовано з PROJ версії 4.8.0 або пізнішої, сфероїд визначається за "
+"SRID, інакше він є ексклюзивним для WGS84. Якщо <varname>use_spheroid = "
+"false</varname>, обчислення базується на сфері, а не на сфероїді."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Currently for geometry this is an alias for ST_Length2D, but this may change "
+"to support higher dimensions."
+msgstr ""
+"Наразі для геометрії це псевдонім для ST_Length2D, але це може змінитися для "
+"підтримки вищих вимірів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 Breaking change -- in prior versions applying this to a MULTI/"
+"POLYGON of type geography would give you the perimeter of the POLYGON/"
+"MULTIPOLYGON. In 2.0.0 this was changed to return 0 to be in line with "
+"geometry behavior. Please use ST_Perimeter if you want the perimeter of a "
+"polygon"
+msgstr ""
+"Змінено: 2.0.0 Істотна зміна — у попередніх версіях застосування цього до "
+"MULTI/POLYGON типу geography давало периметр POLYGON/MULTIPOLYGON. У 2.0.0 "
+"це було змінено, щоб повертати 0 відповідно до поведінки геометрії. Будь "
+"ласка, використовуйте ST_Perimeter, якщо ви хочете отримати периметр полігону"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography the calculation defaults to using a spheroidal model. To use "
+"the faster but less accurate spherical calculation use ST_Length(gg,false);"
+msgstr ""
+"Для географії за замовчуванням використовується сфероїдальна модель. Щоб "
+"скористатися швидшим, але менш точним сферичним розрахунком, використовуйте "
+"ST_Length(gg,false);"
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.5.1"
+msgstr "&sfs_compliant; s2.1.5.1"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 7.1.2, 9.3.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 7.1.2, 9.3.4"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5.0 geography support was introduced in 1.5."
+msgstr "Доступність: підтримка географії 1.5.0 була введена в версії 1.5."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return length in feet for line string. Note this is in feet because "
+"EPSG:2249 is Massachusetts State Plane Feet"
+msgstr ""
+"Довжина повернення в футах для рядка рядка. Зверніть увагу, що це в футах, "
+"оскільки EPSG:2249 - це фути штату Массачусетс"
+
+#. Tag: para
+#, no-c-format
+msgid "Return length of WGS 84 geography line"
+msgstr "Повернути довжину географічної лінії WGS 84"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_Length_Spheroid\"/"
+">, <xref linkend=\"ST_Perimeter\"/>, <xref linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_GeomFromEWKT\"/>, <xref linkend=\"ST_Length_Spheroid\"/"
+">, <xref linkend=\"ST_Perimeter\"/>, <xref linkend=\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 2D length of a linear geometry. Alias for <varname>ST_Length</"
+"varname>"
+msgstr ""
+"Повертає 2D довжину лінійної геометрії. Псевдонім для "
+"<varname>ST_Length</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 2D length of the geometry if it is a linestring or multi-"
+"linestring. This is an alias for <varname>ST_Length</varname>"
+msgstr ""
+"Повертає 2D довжину геометрії, якщо це лінія або багатолінійна лінія. Це "
+"псевдонім для <varname>ST_Length</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DLength\"/>"
+msgstr ", <xref linkend=\"ST_3DLength\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 3D length of a linear geometry."
+msgstr "Повертає 3D довжину лінійної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional or 2-dimensional length of the geometry if it is a "
+"LineString or MultiLineString. For 2-d lines it will just return the 2-d "
+"length (same as ST_Length and ST_Length2D)"
+msgstr ""
+"Повертає тривимірну або двовимірну довжину геометрії, якщо це LineString або "
+"MultiLineString. Для двовимірних ліній повертається лише двовимірна довжина ("
+"так само, як ST_Length і ST_Length2D)"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 7.1, 10.3"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 7.1, 10.3"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 In prior versions this used to be called ST_Length3D"
+msgstr "Змінено: 2.0.0 У попередніх версіях це називалося ST_Length3D"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return length in feet for a 3D cable. Note this is in feet because EPSG:2249 "
+"is Massachusetts State Plane Feet"
+msgstr ""
+"Довжина повернення в футах для 3D-кабелю. Зверніть увагу, що це в футах, "
+"оскільки EPSG:2249 — це фути штату Массачусетс"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Length2D\"/>"
+msgstr ", <xref linkend=\"ST_Length2D\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 2D or 3D length/perimeter of a lon/lat geometry on a spheroid."
+msgstr "Повертає 2D або 3D довжину/периметр геометрії lon/lat на сфероїді."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculates the length or perimeter of a geometry on an ellipsoid. This is "
+"useful if the coordinates of the geometry are in longitude/latitude and a "
+"length is desired without reprojection. The spheroid is specified by a text "
+"value as follows:"
+msgstr ""
+"Обчислює довжину або периметр геометрії на еліпсоїді. Це корисно, якщо "
+"координати геометрії задані в градусах довготи/широти, а довжина потрібна "
+"без перепроекції. Сфероїд задається текстовим значенням у такому форматі:"
+
+#. Tag: para
+#, fuzzy, no-c-format
+msgid "For example:"
+msgstr "Наприклад:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 In prior versions this was called ST_Length_Spheroid and had "
+"the alias ST_3DLength_Spheroid"
+msgstr ""
+"Змінено: 2.2.0 У попередніх версіях ця функція називалася ST_Length_Spheroid "
+"і мала псевдонім ST_3DLength_Spheroid"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Length\"/>"
+msgstr ", <xref linkend=\"ST_Length\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 2D longest line between two geometries."
+msgstr "Повертає найдовшу 2D лінію між двома геометріями."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 2-dimensional longest line between the points of two geometries. "
+"The line returned starts on <varname>g1</varname> and ends on <varname>g2</"
+"varname>."
+msgstr ""
+"Повертає найдовшу двовимірну лінію між точками двох геометрій. Повернена "
+"лінія починається в точці <varname>g1</varname> і закінчується в точці "
+"<varname>g2</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The longest line always occurs between two vertices. The function returns "
+"the first longest line if more than one is found. The length of the line is "
+"equal to the distance returned by <xref linkend=\"ST_MaxDistance\"/>."
+msgstr ""
+"Найдовша лінія завжди проходить між двома вершинами. Якщо знайдено більше "
+"однієї лінії, функція повертає першу найдовшу лінію. Довжина лінії дорівнює "
+"відстані, поверненій функцією <xref linkend=\"ST_MaxDistance\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If g1 and g2 are the same geometry, returns the line between the two "
+"vertices farthest apart in the geometry. The endpoints of the line lie on "
+"the circle computed by <xref linkend=\"ST_MinimumBoundingCircle\"/>."
+msgstr ""
+"Якщо g1 і g2 мають однакову геометрію, повертає лінію між двома "
+"найвіддаленішими вершинами в геометрії. Кінцеві точки лінії лежать на колі, "
+"обчисленому за допомогою <xref linkend=\"ST_MinimumBoundingCircle\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Longest line between a point and a line"
+msgstr "Найдовша лінія між точкою і прямою"
+
+#. Tag: para
+#, no-c-format
+msgid "Longest line between two polygons"
+msgstr "Найдовша лінія між двома полігонами"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Longest line across a single geometry. The length of the line is equal to "
+"the Maximum Distance. The endpoints of the line lie on the Minimum Bounding "
+"Circle."
+msgstr ""
+"Найдовша лінія, що проходить через одну геометрію. Довжина лінії дорівнює "
+"максимальній відстані. Кінцеві точки лінії лежать на мінімальному "
+"обмежувальному колі."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ShortestLine\"/>, <xref linkend=\"ST_3DLongestLine\"/>, "
+"<xref linkend=\"ST_MinimumBoundingCircle\"/>"
+msgstr ""
+", <xref linkend=\"ST_ShortestLine\"/>, <xref linkend=\"ST_3DLongestLine\"/>, "
+"<xref linkend=\"ST_MinimumBoundingCircle\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 3D longest line between two geometries"
+msgstr "Повертає найдовшу 3D лінію між двома геометріями"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional longest line between two geometries. The function "
+"returns the first longest line if more than one. The line returned starts in "
+"g1 and ends in g2. The 3D length of the line is equal to the distance "
+"returned by <xref linkend=\"ST_3DMaxDistance\"/>."
+msgstr ""
+"Повертає найдовшу тривимірну лінію між двома геометріями. Якщо таких ліній "
+"більше однієї, функція повертає першу найдовшу лінію. Повернена лінія "
+"починається в g1 і закінчується в g2. Тривимірна довжина лінії дорівнює "
+"відстані, поверненій функцією <xref linkend=\"ST_3DMaxDistance\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "linestring and point -- both 3d and 2d longest line"
+msgstr "лінія та точка — найдовша лінія у 3D та 2D"
+
+#. Tag: para
+#, no-c-format
+msgid "linestring and multipoint -- both 3d and 2d longest line"
+msgstr "лінія та мультиточка — найдовша лінія в 3D та 2D"
+
+#. Tag: para
+#, no-c-format
+msgid "MultiLineString and Polygon both 3d and 2d longest line"
+msgstr "MultiLineString і Polygon, як 3D, так і 2D найдовша лінія"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_3DDistance\"/>, <xref linkend=\"ST_LongestLine\"/>, "
+"<xref linkend=\"ST_3DShortestLine\"/>, <xref linkend=\"ST_3DMaxDistance\"/>"
+msgstr ""
+", <xref linkend=\"ST_3DDistance\"/>, <xref linkend=\"ST_LongestLine\"/>, "
+"<xref linkend=\"ST_3DShortestLine\"/>, <xref linkend=\"ST_3DMaxDistance\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 2D largest distance between two geometries in projected units."
+msgstr ""
+"Повертає найбільшу відстань між двома геометріями в проекційних одиницях."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 2-dimensional maximum distance between two geometries, in "
+"projected units. The maximum distance always occurs between two vertices. "
+"This is the length of the line returned by <xref linkend=\"ST_LongestLine\"/"
+">."
+msgstr ""
+"Повертає максимальну відстань між двома геометріями у двовимірному просторі, "
+"в проекційних одиницях. Максимальна відстань завжди виникає між двома "
+"вершинами. Це довжина лінії, повернена функцією <xref linkend="
+"\"ST_LongestLine\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If g1 and g2 are the same geometry, returns the distance between the two "
+"vertices farthest apart in that geometry."
+msgstr ""
+"Якщо g1 і g2 мають однакову геометрію, повертає відстань між двома "
+"найвіддаленішими вершинами в цій геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Maximum distance between a point and lines."
+msgstr "Максимальна відстань між точкою та лініями."
+
+#. Tag: para
+#, no-c-format
+msgid "Maximum distance between vertices of a single geometry."
+msgstr "Максимальна відстань між вершинами однієї геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_LongestLine\"/>, <xref linkend=\"ST_DFullyWithin\"/>"
+msgstr ""
+", <xref linkend=\"ST_LongestLine\"/>, <xref linkend=\"ST_DFullyWithin\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 3D cartesian maximum distance (based on spatial ref) between two "
+"geometries in projected units."
+msgstr ""
+"Повертає максимальну 3D-відстань (на основі просторової референції) між "
+"двома геометріями в проекційних одиницях."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional maximum cartesian distance between two geometries "
+"in projected units (spatial ref units)."
+msgstr ""
+"Повертає тривимірну максимальну декартову відстань між двома геометріями в "
+"проекційних одиницях (одиницях просторової прив'язки)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_3DDWithin\"/>, <xref linkend=\"ST_3DMaxDistance\"/>, "
+"<xref linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_3DDWithin\"/>, <xref linkend=\"ST_3DMaxDistance\"/>, "
+"<xref linkend=\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the minimum clearance of a geometry, a measure of a geometry's "
+"robustness."
+msgstr "Повертає мінімальний зазор геометрії, міру міцності геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It is possible for a geometry to meet the criteria for validity according to "
+"<xref linkend=\"ST_IsValid\"/> (polygons) or <xref linkend=\"ST_IsSimple\"/> "
+"(lines), but to become invalid if one of its vertices is moved by a small "
+"distance. This can happen due to loss of precision during conversion to text "
+"formats (such as WKT, KML, GML, GeoJSON), or binary formats that do not use "
+"double-precision floating point coordinates (e.g. MapInfo TAB)."
+msgstr ""
+"Геометрія може відповідати критеріям валідності згідно з <xref linkend="
+"\"ST_IsValid\"/>(полігони) або <xref linkend=\"ST_IsSimple\"/>(лінії), але "
+"стати невалідною, якщо одна з її вершин буде переміщена на невелику "
+"відстань. Це може статися через втрату точності під час перетворення в "
+"текстові формати (такі як WKT, KML, GML, GeoJSON) або бінарні формати, які "
+"не використовують координати з подвійною точністю з плаваючою комою ("
+"наприклад, MapInfo TAB)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The minimum clearance is a quantitative measure of a geometry's robustness "
+"to change in coordinate precision. It is the largest distance by which "
+"vertices of the geometry can be moved without creating an invalid geometry. "
+"Larger values of minimum clearance indicate greater robustness."
+msgstr ""
+"Мінімальний зазор — це кількісна міра стійкості геометрії до зміни точності "
+"координат. Це найбільша відстань, на яку можна перемістити вершини "
+"геометрії, не порушуючи її цілісності. Більші значення мінімального зазору "
+"вказують на більшу стійкість."
+
+#. Tag: para
+#, no-c-format
+msgid "If a geometry has a minimum clearance of <varname>e</varname>, then:"
+msgstr "Якщо геометрія має мінімальний зазор <varname>e</varname>, то:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"No two distinct vertices in the geometry are closer than the distance "
+"<varname>e</varname>."
+msgstr ""
+"У геометрії немає двох різних вершин, відстань між якими менша за "
+"<varname>e</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"No vertex is closer than <varname>e</varname> to a line segment of which it "
+"is not an endpoint."
+msgstr ""
+"Жодна вершина не знаходиться ближче, ніж <varname>e</varname> до відрізка "
+"лінії, кінцевою точкою якого вона не є."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no minimum clearance exists for a geometry (e.g. a single point, or a "
+"MultiPoint whose points are identical), the return value is "
+"<varname>Infinity</varname>."
+msgstr ""
+"Якщо для геометрії не існує мінімального зазору (наприклад, для окремої "
+"точки або для MultiPoint, точки якого є ідентичними), повертається значення "
+"<varname>Infinity</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To avoid validity issues caused by precision loss, <xref "
+"linkend=\"ST_ReducePrecision\"/> can reduce coordinate precision while "
+"ensuring that polygonal geometry remains valid."
+msgstr ""
+"Щоб уникнути проблем з валідністю, спричинених втратою точності, <xref "
+"linkend=\"ST_ReducePrecision\"/>може зменшити точність координат, гарантуючи "
+"при цьому валідність полігональної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_IsSimple\"/>, <xref linkend=\"ST_IsValid\"/>, <xref "
+"linkend=\"ST_ReducePrecision\"/>"
+msgstr ""
+", <xref linkend=\"ST_IsSimple\"/>, <xref linkend=\"ST_IsValid\"/>, <xref "
+"linkend=\"ST_ReducePrecision\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the two-point LineString spanning a geometry's minimum clearance."
+msgstr ""
+"Повертає двоточкову лінію LineString, що охоплює мінімальний простір "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the two-point LineString spanning a geometry's minimum clearance. If "
+"the geometry does not have a minimum clearance, <varname>LINESTRING EMPTY</"
+"varname> is returned."
+msgstr ""
+"Повертає двоточкову лінію LineString, що охоплює мінімальний зазор "
+"геометрії. Якщо геометрія не має мінімального зазору, повертається "
+"<varname>LINESTRING EMPTY</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.3.0 - requires GEOS >= 3.6.0"
+msgstr "Доступність: 2.3.0 - вимагає GEOS >= 3.6.0"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the length of the boundary of a polygonal geometry or geography."
+msgstr "Повертає довжину межі полігональної геометрії або географії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 2D perimeter of the geometry/geography if it is a ST_Surface, "
+"ST_MultiSurface (Polygon, MultiPolygon). 0 is returned for non-areal "
+"geometries. For linear geometries use <xref linkend=\"ST_Length\"/>. For "
+"geometry types, units for perimeter measures are specified by the spatial "
+"reference system of the geometry."
+msgstr ""
+"Повертає 2D периметр геометрії/географії, якщо це ST_Surface, "
+"ST_MultiSurface (Polygon, MultiPolygon). Для геометрій, що не мають площі, "
+"повертається 0. Для лінійних геометрій використовуйте <xref linkend="
+"\"ST_Length\"/>. Для типів геометрії одиниці виміру периметра визначаються "
+"просторовою системою відліку геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography types, the calculations are performed using the inverse "
+"geodesic problem, where perimeter units are in meters. If PostGIS is "
+"compiled with PROJ version 4.8.0 or later, the spheroid is specified by the "
+"SRID, otherwise it is exclusive to WGS84. If <varname>use_spheroid = false</"
+"varname>, then calculations will approximate a sphere instead of a spheroid."
+msgstr ""
+"Для географічних типів обчислення виконуються за допомогою оберненої "
+"геодезичної задачі, де одиниці периметра вимірюються в метрах. Якщо PostGIS "
+"скомпільовано з PROJ версії 4.8.0 або пізнішої, сфероїд визначається SRID, "
+"інакше він є ексклюзивним для WGS84. Якщо <varname>use_spheroid = false</"
+"varname>, обчислення будуть наближатися до сфери, а не до сфероїда."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Currently this is an alias for ST_Perimeter2D, but this may change to "
+"support higher dimensions."
+msgstr ""
+"Наразі це псевдонім для ST_Perimeter2D, але це може змінитися для підтримки "
+"вищих вимірів."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.1.3, 9.5.4"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.1.3, 9.5.4"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability 2.0.0: Support for geography was introduced"
+msgstr "Доступність 2.0.0: додано підтримку географії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return perimeter in feet for Polygon and MultiPolygon. Note this is in feet "
+"because EPSG:2249 is Massachusetts State Plane Feet"
+msgstr ""
+"Повернути периметр у футах для полігону та мультиполігону. Зверніть увагу, "
+"що це фути, оскільки EPSG:2249 — це фути штату Массачусетс."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return perimeter in meters and feet for Polygon and MultiPolygon. Note this "
+"is geography (WGS 84 long lat)"
+msgstr ""
+"Повернути периметр у метрах і футах для полігону та мультиполігону. Зверніть "
+"увагу, що це географічні координати (WGS 84 long lat)"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_Length\"/>"
+msgstr ", <xref linkend=\"ST_GeomFromText\"/>, <xref linkend=\"ST_Length\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the 2D perimeter of a polygonal geometry. Alias for "
+"<varname>ST_Perimeter</varname>."
+msgstr ""
+"Повертає 2D периметр полігональної геометрії. Псевдонім для "
+"<varname>ST_Perimeter</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the 2-dimensional perimeter of a polygonal geometry."
+msgstr "Повертає двовимірний периметр багатокутної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is currently an alias for ST_Perimeter. In future versions ST_Perimeter "
+"may return the highest dimension perimeter for a geometry. This is still "
+"under consideration"
+msgstr ""
+"Наразі це псевдонім для ST_Perimeter. У майбутніх версіях ST_Perimeter може "
+"повертати найбільший периметр для геометрії. Це питання ще розглядається"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 3D perimeter of a polygonal geometry."
+msgstr "Повертає 3D периметр полігональної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional perimeter of the geometry, if it is a polygon or "
+"multi-polygon. If the geometry is 2-dimensional, then the 2-dimensional "
+"perimeter is returned."
+msgstr ""
+"Повертає тривимірний периметр геометрії, якщо це полігон або мультиполігон. "
+"Якщо геометрія двовимірна, то повертається двовимірний периметр."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM ISO/IEC 13249-3: 8.1, 10.5"
+msgstr "&sqlmm_compliant; SQL-MM ISO/IEC 13249-3: 8.1, 10.5"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 In prior versions this used to be called ST_Perimeter3D"
+msgstr "Змінено: 2.0.0 У попередніх версіях це називалося ST_Perimeter3D"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Perimeter of a slightly elevated polygon in the air in Massachusetts state "
+"plane feet"
+msgstr ""
+"Периметр злегка піднятого полігону в повітрі в штаті Массачусетс, фути "
+"площини штату"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Perimeter\"/>, <xref linkend=\"ST_Perimeter2D\"/>"
+msgstr ", <xref linkend=\"ST_Perimeter\"/>, <xref linkend=\"ST_Perimeter2D\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 2D shortest line between two geometries"
+msgstr "Повертає найкоротшу 2D лінію між двома геометріями"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 2-dimensional shortest line between two geometries. The line "
+"returned starts in <varname>geom1</varname> and ends in <varname>geom2</"
+"varname>. If <varname>geom1</varname> and <varname>geom2</varname> intersect "
+"the result is a line with start and end at an intersection point. The length "
+"of the line is the same as <xref linkend=\"ST_Distance\"/> returns for g1 "
+"and g2."
+msgstr ""
+"Повертає найкоротшу двовимірну лінію між двома геометріями. Повернена лінія "
+"починається в <varname>geom1</varname> і закінчується в <varname>geom2</"
+"varname>. Якщо <varname>geom1</varname> і <varname>geom2</varname> "
+"перетинаються, результатом є лінія, що починається і закінчується в точці "
+"перетину. Довжина лінії дорівнює значенню, яке повертає <xref linkend="
+"\"ST_Distance\"/> для g1 і g2."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.4.0 - support for geography."
+msgstr "Покращено: 3.4.0 - підтримка географії."
+
+#. Tag: para
+#, no-c-format
+msgid "Shortest line between Point and LineString"
+msgstr "Найкоротша лінія між точкою та лінією"
+
+#. Tag: para
+#, no-c-format
+msgid "Shortest line between Polygons"
+msgstr "Найкоротша лінія між полігонами"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"ST_LongestLine\"/>, <xref "
+"linkend=\"ST_MaxDistance\"/>"
+msgstr ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"ST_LongestLine\"/>, <xref "
+"linkend=\"ST_MaxDistance\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 3D shortest line between two geometries"
+msgstr "Повертає найкоротшу 3D лінію між двома геометріями"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the 3-dimensional shortest line between two geometries. The function "
+"will only return the first shortest line if more than one, that the function "
+"finds. If g1 and g2 intersects in just one point the function will return a "
+"line with both start and end in that intersection-point. If g1 and g2 are "
+"intersecting with more than one point the function will return a line with "
+"start and end in the same point but it can be any of the intersecting "
+"points. The line returned will always start in g1 and end in g2. The 3D "
+"length of the line this function returns will always be the same as <xref "
+"linkend=\"ST_3DDistance\"/> returns for g1 and g2."
+msgstr ""
+"Повертає найкоротшу тривимірну лінію між двома геометріями. Якщо функція "
+"знаходить більше однієї найкоротшої лінії, вона повертає тільки першу. Якщо "
+"g1 і g2 перетинаються тільки в одній точці, функція повертає лінію, початок "
+"і кінець якої знаходяться в цій точці перетину. Якщо g1 і g2 перетинаються в "
+"більш ніж одній точці, функція поверне лінію, початок і кінець якої "
+"знаходяться в одній точці, але це може бути будь-яка з точок перетину. "
+"Повернена лінія завжди починатиметься в g1 і закінчуватиметься в g2. "
+"Тривимірна довжина лінії, яку повертає ця функція, завжди буде такою ж, як "
+"<xref linkend=\"ST_3DDistance\"/>повертає для g1 і g2."
+
+#. Tag: para
+#, no-c-format
+msgid "linestring and point -- both 3d and 2d shortest line"
+msgstr "лінія та точка — найкоротша лінія в 3D та 2D"
+
+#. Tag: para
+#, no-c-format
+msgid "linestring and multipoint -- both 3d and 2d shortest line"
+msgstr "лінія та мультиточка — найкоротша лінія в 3D та 2D"
+
+#. Tag: para
+#, no-c-format
+msgid "MultiLineString and polygon both 3d and 2d shortest line"
+msgstr "MultiLineString і полігон, як 3D, так і 2D найкоротша лінія"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_3DDistance\"/>, <xref linkend=\"ST_LongestLine\"/>, "
+"<xref linkend=\"ST_ShortestLine\"/>, <xref linkend=\"ST_3DMaxDistance\"/>"
+msgstr ""
+", <xref linkend=\"ST_3DDistance\"/>, <xref linkend=\"ST_LongestLine\"/>, "
+"<xref linkend=\"ST_ShortestLine\"/>, <xref linkend=\"ST_3DMaxDistance\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Operators"
+msgstr "Оператори"
+
+#. Tag: title
+#, no-c-format
+msgid "Bounding Box Operators"
+msgstr "Оператори обмежувальної рамки"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's 2D bounding box intersects B's 2D "
+"bounding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо 2D обмежувальна рамка A перетинається "
+"з 2D обмежувальною рамкою B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&</varname> operator returns <varname>TRUE</varname> "
+"if the 2D bounding box of geometry A intersects the 2D bounding box of "
+"geometry B."
+msgstr ""
+"Оператор <varname>&&</varname> повертає <varname>TRUE</varname>, "
+"якщо 2D обмежувальна рамка геометрії A перетинає 2D обмежувальну рамку "
+"геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will make use of any indexes that may be available on the "
+"geometries."
+msgstr ""
+"Цей операнд буде використовувати будь-які індекси, які можуть бути доступні "
+"для геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5.0 support for geography was introduced."
+msgstr "Доступність: 1.5.0 додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Extent\"/>, <xref linkend=\"ST_Geometry_Overabove\"/>, "
+"<xref linkend=\"ST_Geometry_Overright\"/>, <xref "
+"linkend=\"ST_Geometry_Overbelow\"/>, <xref linkend=\"ST_Geometry_Overleft\"/"
+">, <xref linkend=\"ST_Geometry_Contain\"/>, <xref "
+"linkend=\"ST_Geometry_Contained\"/>"
+msgstr ""
+", <xref linkend=\"ST_Extent\"/>, <xref linkend=\"ST_Geometry_Overabove\"/>, "
+"<xref linkend=\"ST_Geometry_Overright\"/>, <xref linkend="
+"\"ST_Geometry_Overbelow\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>, <xref "
+"linkend=\"ST_Geometry_Contain\"/>, <xref linkend=\"ST_Geometry_Contained\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a geometry's (cached) 2D bounding box "
+"intersects a 2D float precision bounding box (BOX2DF)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо (кешована) 2D обмежувальна рамка "
+"геометрії перетинає 2D обмежувальну рамку з плаваючою точністю (BOX2DF)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&</varname> operator returns <varname>TRUE</varname> "
+"if the cached 2D bounding box of geometry A intersects the 2D bounding box "
+"B, using float precision. This means that if B is a (double precision) "
+"box2d, it will be internally converted to a float precision 2D bounding box "
+"(BOX2DF)"
+msgstr ""
+"Оператор <varname>&&</varname> повертає <varname>TRUE</varname>, "
+"якщо кешована 2D обмежувальна рамка геометрії A перетинає 2D обмежувальну "
+"рамку B, використовуючи точність float. Це означає, що якщо B є (подвійної "
+"точності) box2d, вона буде внутрішньо перетворена в 2D обмежувальну рамку з "
+"точністю float (BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand is intended to be used internally by BRIN indexes, more than by "
+"users."
+msgstr ""
+"Цей операнд призначений для внутрішнього використання індексами BRIN, а не "
+"користувачами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 2.3.0 support for Block Range INdexes (BRIN) was introduced. "
+"Requires PostgreSQL 9.5+."
+msgstr ""
+"Доступність: 2.3.0 додано підтримку індексів діапазону блоків (BRIN). "
+"Потрібна PostgreSQL 9.5+."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_box2df\"/>, <xref linkend="
+"\"contains_geometry_box2df\"/>, <xref linkend=\"contains_box2df_geometry\"/"
+">, <xref linkend=\"contains_box2df_box2df\"/>, <xref linkend="
+"\"is_contained_geometry_box2df\"/>, <xref linkend="
+"\"is_contained_box2df_geometry\"/>, <xref linkend="
+"\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a 2D float precision bounding box "
+"(BOX2DF) intersects a geometry's (cached) 2D bounding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо 2D обмежувальна рамка з плаваючою "
+"точністю (BOX2DF) перетинає (кешовану) 2D обмежувальну рамку геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&</varname> operator returns <varname>TRUE</varname> "
+"if the 2D bounding box A intersects the cached 2D bounding box of geometry "
+"B, using float precision. This means that if A is a (double precision) "
+"box2d, it will be internally converted to a float precision 2D bounding box "
+"(BOX2DF)"
+msgstr ""
+"Оператор <varname>&&</varname> повертає <varname>TRUE</varname>, "
+"якщо 2D обмежувальна рамка A перетинає кешовану 2D обмежувальну рамку "
+"геометрії B, використовуючи точність float. Це означає, що якщо A є ("
+"подвійної точності) box2d, вона буде внутрішньо перетворена в 2D "
+"обмежувальну рамку з точністю float (BOX2DF)"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if two 2D float precision bounding boxes "
+"(BOX2DF) intersect each other."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо дві обмежувальні рамки 2D з плаваючою "
+"точністю (BOX2DF) перетинаються між собою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&</varname> operator returns <varname>TRUE</varname> "
+"if two 2D bounding boxes A and B intersect each other, using float "
+"precision. This means that if A (or B) is a (double precision) box2d, it "
+"will be internally converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>&&</varname> повертає <varname>TRUE</varname>, "
+"якщо дві 2D обмежувальні рамки A і B перетинаються, використовуючи точність "
+"float. Це означає, що якщо A (або B) є (подвійної точності) box2d, вона буде "
+"внутрішньо перетворена в 2D обмежувальну рамку (BOX2DF) з точністю float"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operator is intended to be used internally by BRIN indexes, more than "
+"by users."
+msgstr ""
+"Цей оператор призначений для внутрішнього використання індексами BRIN, а не "
+"користувачами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"contains_geometry_box2df\"/>, <xref linkend=\"contains_box2df_geometry\"/"
+">, <xref linkend=\"contains_box2df_box2df\"/>, <xref linkend="
+"\"is_contained_geometry_box2df\"/>, <xref linkend="
+"\"is_contained_box2df_geometry\"/>, <xref linkend="
+"\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's n-D bounding box intersects B's n-D "
+"bounding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо n-D обмежувальна рамка A "
+"перетинається з n-D обмежувальною рамкою B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&&</varname> operator returns <varname>TRUE</"
+"varname> if the n-D bounding box of geometry A intersects the n-D bounding "
+"box of geometry B."
+msgstr ""
+"Оператор <varname>&&&</varname> повертає <varname>TRUE</"
+"varname>, якщо n-вимірна обмежувальна рамка геометрії A перетинає n-вимірну "
+"обмежувальну рамку геометрії B."
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: 3D LineStrings"
+msgstr "Приклади: 3D лінійні об'єкти"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: 3M LineStrings"
+msgstr "Приклади: 3M LineStrings"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a geometry's (cached) n-D bounding box "
+"intersects a n-D float precision bounding box (GIDX)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо (кешована) n-вимірна обмежувальна "
+"рамка геометрії перетинає n-вимірну обмежувальну рамку з плаваючою точністю "
+"(GIDX)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&&</varname> operator returns <varname>TRUE</"
+"varname> if the cached n-D bounding box of geometry A intersects the n-D "
+"bounding box B, using float precision. This means that if B is a (double "
+"precision) box3d, it will be internally converted to a float precision 3D "
+"bounding box (GIDX)"
+msgstr ""
+"Оператор <varname>&&&</varname> повертає <varname>TRUE</"
+"varname>, якщо кешована n-вимірна обмежувальна рамка геометрії A перетинає n-"
+"вимірну обмежувальну рамку B, використовуючи точність float. Це означає, що "
+"якщо B є (подвійної точності) box3d, вона буде внутрішньо перетворена в "
+"обмежувальну рамку 3D з точністю float (GIDX)"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"overlaps_nd_gidx_gidx\"/>"
+msgstr ", <xref linkend=\"overlaps_nd_gidx_gidx\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a n-D float precision bounding box (GIDX) "
+"intersects a geometry's (cached) n-D bounding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка з n-вимірною "
+"точністю (GIDX) перетинає (кешовану) n-вимірну обмежувальну рамку геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&&</varname> operator returns <varname>TRUE</"
+"varname> if the n-D bounding box A intersects the cached n-D bounding box of "
+"geometry B, using float precision. This means that if A is a (double "
+"precision) box3d, it will be internally converted to a float precision 3D "
+"bounding box (GIDX)"
+msgstr ""
+"Оператор <varname>&&&</varname> повертає <varname>TRUE</"
+"varname>, якщо n-вимірна обмежувальна рамка A перетинає кешовану n-вимірну "
+"обмежувальну рамку геометрії B, використовуючи точність float. Це означає, "
+"що якщо A є (подвійної точності) box3d, вона буде внутрішньо перетворена в "
+"3D обмежувальну рамку (GIDX) з точністю float"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if two n-D float precision bounding boxes "
+"(GIDX) intersect each other."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо дві n-вимірні обмежувальні рамки "
+"(GIDX) з плаваючою точністю перетинаються між собою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&&</varname> operator returns <varname>TRUE</"
+"varname> if two n-D bounding boxes A and B intersect each other, using float "
+"precision. This means that if A (or B) is a (double precision) box3d, it "
+"will be internally converted to a float precision 3D bounding box (GIDX)"
+msgstr ""
+"Оператор <varname>&&&</varname> повертає <varname>TRUE</"
+"varname>, якщо дві n-вимірні обмежувальні рамки A і B перетинаються, "
+"використовуючи точність float. Це означає, що якщо A (або B) є (подвійної "
+"точності) box3d, вона буде внутрішньо перетворена в обмежувальну рамку 3D з "
+"точністю float (GIDX)"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"overlaps_nd_gidx_geometry\"/>"
+msgstr ", <xref linkend=\"overlaps_nd_gidx_geometry\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box overlaps or is to the "
+"left of B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A перекриває або "
+"знаходиться ліворуч від обмежувальної рамки B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&<</varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of geometry A overlaps or is to the left of the bounding "
+"box of geometry B, or more accurately, overlaps or is NOT to the right of "
+"the bounding box of geometry B."
+msgstr ""
+"Оператор <varname>&<</varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A перекриває або знаходиться ліворуч від "
+"обмежувальної рамки геометрії B, або, точніше, перекриває або НЕ знаходиться "
+"праворуч від обмежувальної рамки геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Overabove\"/>, <xref "
+"linkend=\"ST_Geometry_Overright\"/>, <xref linkend=\"ST_Geometry_Overbelow\"/"
+">"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Overabove\"/>, <xref linkend="
+"\"ST_Geometry_Overright\"/>, <xref linkend=\"ST_Geometry_Overbelow\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box overlaps or is below B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A перекриває або "
+"знаходиться нижче обмежувальної рамки B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&<|</varname> operator returns <varname>TRUE</varname> "
+"if the bounding box of geometry A overlaps or is below of the bounding box "
+"of geometry B, or more accurately, overlaps or is NOT above the bounding box "
+"of geometry B."
+msgstr ""
+"Оператор <varname>&<|</varname> повертає <varname>TRUE</varname>, "
+"якщо обмежувальна рамка геометрії A перекриває або знаходиться нижче "
+"обмежувальної рамки геометрії B, або, точніше, перекриває або НЕ знаходиться "
+"вище обмежувальної рамки геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Overabove\"/>, <xref "
+"linkend=\"ST_Geometry_Overright\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Overabove\"/>, <xref linkend="
+"\"ST_Geometry_Overright\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A' bounding box overlaps or is to the "
+"right of B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A перекриває або "
+"знаходиться праворуч від обмежувальної рамки B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&></varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of geometry A overlaps or is to the right of the bounding "
+"box of geometry B, or more accurately, overlaps or is NOT to the left of the "
+"bounding box of geometry B."
+msgstr ""
+"Оператор <varname>&></varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A перекриває або знаходиться праворуч від "
+"обмежувальної рамки геометрії B, або, точніше, перекриває або НЕ знаходиться "
+"ліворуч від обмежувальної рамки геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Overabove\"/>, <xref "
+"linkend=\"ST_Geometry_Overbelow\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Overabove\"/>, <xref linkend="
+"\"ST_Geometry_Overbelow\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is strictly to the left "
+"of B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A знаходиться "
+"строго ліворуч від B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname><<</varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of geometry A is strictly to the left of the bounding box "
+"of geometry B."
+msgstr ""
+"Оператор <varname><<</varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A знаходиться строго ліворуч від обмежувальної "
+"рамки геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Above\"/>, <xref linkend=\"ST_Geometry_Below\"/"
+">"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Above\"/>, <xref linkend=\"ST_Geometry_Below\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is strictly below B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A знаходиться "
+"строго нижче B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname><<|</varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of geometry A is strictly below the bounding box of "
+"geometry B."
+msgstr ""
+"Оператор <varname><<|</varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A знаходиться строго нижче обмежувальної рамки "
+"геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Right\"/>, <xref linkend=\"ST_Geometry_Above\"/"
+">"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Right\"/>, <xref linkend=\"ST_Geometry_Above\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if the coordinates and coordinate order "
+"geometry/geography A are the same as the coordinates and coordinate order of "
+"geometry/geography B."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо координати та порядок координат "
+"геометрії/географії A збігаються з координатами та порядком координат "
+"геометрії/географії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>=</varname> operator returns <varname>TRUE</varname> if the "
+"coordinates and coordinate order geometry/geography A are the same as the "
+"coordinates and coordinate order of geometry/geography B. PostgreSQL uses "
+"the =, <, and > operators defined for geometries to perform internal "
+"orderings and comparison of geometries (ie. in a GROUP BY or ORDER BY "
+"clause)."
+msgstr ""
+"Оператор <varname>=</varname> повертає <varname>TRUE</varname>, якщо "
+"координати та порядок координат геометрії/географії A збігаються з "
+"координатами та порядком координат геометрії/географії B. PostgreSQL "
+"використовує оператори =, < та >, визначені для геометрій, для "
+"виконання внутрішнього впорядкування та порівняння геометрій (тобто в "
+"операторах GROUP BY або ORDER BY)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Only geometry/geography that are exactly equal in all respects, with the "
+"same coordinates, in the same order, are considered equal by this operator. "
+"For \"spatial equality\", that ignores things like coordinate order, and can "
+"detect features that cover the same spatial area with different "
+"representations, use <xref linkend=\"ST_OrderingEquals\"/> or <xref "
+"linkend=\"ST_Equals\"/>"
+msgstr ""
+"Цей оператор вважає рівними лише геометрію/географію, які є абсолютно "
+"однаковими в усіх відношеннях, мають однакові координати в однаковому "
+"порядку. Для \"просторової рівності\", яка ігнорує такі речі, як порядок "
+"координат, і може виявляти об'єкти, що займають однакову просторову площу, "
+"але мають різне представлення, використовуйте <xref linkend="
+"\"ST_OrderingEquals\"/>або <xref linkend=\"ST_Equals\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will NOT make use of any indexes that may be available on the "
+"geometries. For an index assisted exact equality test, combine = with "
+"&&."
+msgstr ""
+"Цей операнд НЕ використовуватиме жодних індексів, які можуть бути доступні "
+"для геометрій. Для перевірки точної рівності за допомогою індексу поєднайте "
+"= з &&."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.4.0, in prior versions this was bounding box equality not a "
+"geometric equality. If you need bounding box equality, use <xref "
+"linkend=\"ST_Geometry_Same\"/> instead."
+msgstr ""
+"Змінено: 2.4.0, у попередніх версіях це була рівність обмежувальної рамки, а "
+"не геометрична рівність. Якщо вам потрібна рівність обмежувальної рамки, "
+"використовуйте замість цього <xref linkend=\"ST_Geometry_Same\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_OrderingEquals\"/>, <xref linkend=\"ST_Geometry_Same\"/>"
+msgstr ""
+", <xref linkend=\"ST_OrderingEquals\"/>, <xref linkend=\"ST_Geometry_Same\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is strictly to the right "
+"of B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A знаходиться "
+"строго праворуч від B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>>></varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of geometry A is strictly to the right of the bounding box "
+"of geometry B."
+msgstr ""
+"Оператор <varname>>></varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A знаходиться строго праворуч від обмежувальної "
+"рамки геометрії B."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is contained by B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A міститься в "
+"обмежувальній рамці B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>@</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of geometry A is completely contained by the bounding box of "
+"geometry B."
+msgstr ""
+"Оператор <varname>@</varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A повністю міститься в обмежувальній рамці "
+"геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"geometry_overlaps\"/>"
+msgstr ", <xref linkend=\"geometry_overlaps\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a geometry's 2D bounding box is contained "
+"into a 2D float precision bounding box (BOX2DF)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо 2D обмежувальна рамка геометрії "
+"міститься в 2D обмежувальній рамці з плаваючою точністю (BOX2DF)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>@</varname> operator returns <varname>TRUE</varname> if the A "
+"geometry's 2D bounding box is contained the 2D bounding box B, using float "
+"precision. This means that if B is a (double precision) box2d, it will be "
+"internally converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>@</varname> повертає <varname>TRUE</varname>, якщо 2D "
+"обмежувальна рамка геометрії A міститься в 2D обмежувальній рамці B, "
+"використовуючи точність float. Це означає, що якщо B є (подвійної точності) "
+"box2d, вона буде внутрішньо перетворена в 2D обмежувальну рамку з точністю "
+"float (BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"overlaps_box2df_box2df\"/>, <xref linkend=\"contains_geometry_box2df\"/>, "
+"<xref linkend=\"contains_box2df_geometry\"/>, <xref linkend="
+"\"contains_box2df_box2df\"/>, <xref linkend=\"is_contained_box2df_geometry\"/"
+">, <xref linkend=\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a 2D float precision bounding box "
+"(BOX2DF) is contained into a geometry's 2D bounding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо 2D обмежувальна рамка з плаваючою "
+"точністю (BOX2DF) міститься в 2D обмежувальній рамці геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>@</varname> operator returns <varname>TRUE</varname> if the 2D "
+"bounding box A is contained into the B geometry's 2D bounding box, using "
+"float precision. This means that if B is a (double precision) box2d, it will "
+"be internally converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>@</varname> повертає <varname>TRUE</varname>, якщо 2D "
+"обмежувальна рамка A міститься в 2D обмежувальній рамці геометрії B, "
+"використовуючи точність float. Це означає, що якщо B є (подвійної точності) "
+"box2d, вона буде внутрішньо перетворена в 2D обмежувальну рамку з точністю "
+"float (BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"overlaps_box2df_box2df\"/>, <xref linkend=\"contains_geometry_box2df\"/>, "
+"<xref linkend=\"contains_box2df_geometry\"/>, <xref linkend="
+"\"contains_box2df_box2df\"/>, <xref linkend=\"is_contained_geometry_box2df\"/"
+">, <xref linkend=\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a 2D float precision bounding box "
+"(BOX2DF) is contained into another 2D float precision bounding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо 2D обмежувальна рамка з плаваючою "
+"точністю (BOX2DF) міститься в іншій 2D обмежувальній рамці з плаваючою "
+"точністю."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>@</varname> operator returns <varname>TRUE</varname> if the 2D "
+"bounding box A is contained into the 2D bounding box B, using float "
+"precision. This means that if A (or B) is a (double precision) box2d, it "
+"will be internally converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>@</varname> повертає <varname>TRUE</varname>, якщо 2D "
+"обмежувальна рамка A міститься в 2D обмежувальній рамці B, використовуючи "
+"точність float. Це означає, що якщо A (або B) є (подвійної точності) box2d, "
+"вона буде внутрішньо перетворена в 2D обмежувальну рамку з точністю float "
+"(BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"overlaps_box2df_box2df\"/>, <xref linkend=\"contains_geometry_box2df\"/>, "
+"<xref linkend=\"contains_box2df_geometry\"/>, <xref linkend="
+"\"contains_box2df_box2df\"/>, <xref linkend=\"is_contained_geometry_box2df\"/"
+">, <xref linkend=\"is_contained_box2df_geometry\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box overlaps or is above B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A перекриває або "
+"знаходиться над обмежувальною рамкою B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>|&></varname> operator returns <varname>TRUE</varname> "
+"if the bounding box of geometry A overlaps or is above the bounding box of "
+"geometry B, or more accurately, overlaps or is NOT below the bounding box of "
+"geometry B."
+msgstr ""
+"Оператор <varname>|&></varname> повертає <varname>TRUE</varname>, "
+"якщо обмежувальна рамка геометрії A перекриває або знаходиться над "
+"обмежувальною рамкою геометрії B, або, точніше, перекриває або НЕ "
+"знаходиться нижче обмежувальної рамки геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Overright\"/>, <xref "
+"linkend=\"ST_Geometry_Overbelow\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Overright\"/>, <xref linkend="
+"\"ST_Geometry_Overbelow\"/>, <xref linkend=\"ST_Geometry_Overleft\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is strictly above B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A знаходиться "
+"строго над обмежувальною рамкою B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>|>></varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of geometry A is strictly above the bounding box of "
+"geometry B."
+msgstr ""
+"Оператор <varname>|>></varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A знаходиться строго над обмежувальною рамкою "
+"геометрії B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Geometry_Right\"/>, <xref linkend=\"ST_Geometry_Below\"/"
+">"
+msgstr ""
+", <xref linkend=\"ST_Geometry_Right\"/>, <xref linkend=\"ST_Geometry_Below\""
+"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns <varname>TRUE</varname> if A's bounding box contains B's."
+msgstr "Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A містить B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of geometry A completely contains the bounding box of geometry "
+"B."
+msgstr ""
+"Оператор <varname>~</varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії A повністю містить обмежувальну рамку геометрії "
+"B."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a geometry's 2D bonding box contains a 2D "
+"float precision bounding box (GIDX)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо 2D обмежувальна рамка геометрії "
+"містить 2D обмежувальну рамку з плаваючою точністю (GIDX)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~</varname> operator returns <varname>TRUE</varname> if the 2D "
+"bounding box of a geometry A contains the 2D bounding box B, using float "
+"precision. This means that if B is a (double precision) box2d, it will be "
+"internally converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>~</varname> повертає <varname>TRUE</varname>, якщо 2D "
+"обмежувальна рамка геометрії A містить 2D обмежувальну рамку B, "
+"використовуючи точність float. Це означає, що якщо B є (подвійної точності) "
+"box2d, вона буде внутрішньо перетворена в 2D обмежувальну рамку з точністю "
+"float (BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"overlaps_box2df_box2df\"/>, <xref linkend=\"contains_box2df_geometry\"/>, "
+"<xref linkend=\"contains_box2df_box2df\"/>, <xref linkend="
+"\"is_contained_geometry_box2df\"/>, <xref linkend="
+"\"is_contained_box2df_geometry\"/>, <xref linkend="
+"\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a 2D float precision bounding box "
+"(BOX2DF) contains a geometry's 2D bonding box."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка з плаваючою "
+"точністю 2D (BOX2DF) містить обмежувальну рамку 2D геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~</varname> operator returns <varname>TRUE</varname> if the 2D "
+"bounding box A contains the B geometry's bounding box, using float "
+"precision. This means that if A is a (double precision) box2d, it will be "
+"internally converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>~</varname> повертає <varname>TRUE</varname>, якщо 2D "
+"обмежувальна рамка A містить обмежувальну рамку геометрії B, використовуючи "
+"точність float. Це означає, що якщо A є (подвійної точності) box2d, вона "
+"буде внутрішньо перетворена в 2D обмежувальну рамку з точністю float (BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_box2df\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"overlaps_box2df_box2df\"/>, <xref linkend=\"contains_geometry_box2df\"/>, "
+"<xref linkend=\"contains_box2df_box2df\"/>, <xref linkend="
+"\"is_contained_geometry_box2df\"/>, <xref linkend="
+"\"is_contained_box2df_geometry\"/>, <xref linkend="
+"\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if a 2D float precision bounding box "
+"(BOX2DF) contains another 2D float precision bounding box (BOX2DF)."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка з точністю до 2D "
+"float (BOX2DF) містить іншу обмежувальну рамку з точністю до 2D float "
+"(BOX2DF)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~</varname> operator returns <varname>TRUE</varname> if the 2D "
+"bounding box A contains the 2D bounding box B, using float precision. This "
+"means that if A is a (double precision) box2d, it will be internally "
+"converted to a float precision 2D bounding box (BOX2DF)"
+msgstr ""
+"Оператор <varname>~</varname> повертає <varname>TRUE</varname>, якщо 2D "
+"обмежувальна рамка A містить 2D обмежувальну рамку B, використовуючи "
+"точність float. Це означає, що якщо A є (подвійної точності) box2d, вона "
+"буде внутрішньо перетворена в 2D обмежувальну рамку з точністю float (BOX2DF)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref "
+"linkend=\"overlaps_box2df_box2df\"/>, <xref "
+"linkend=\"contains_geometry_box2df\"/>, <xref "
+"linkend=\"contains_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_geometry_box2df\"/>, <xref "
+"linkend=\"is_contained_box2df_geometry\"/>, <xref "
+"linkend=\"is_contained_box2df_box2df\"/>"
+msgstr ""
+", <xref linkend=\"overlaps_box2df_geometry\"/>, <xref linkend="
+"\"overlaps_box2df_box2df\"/>, <xref linkend=\"contains_geometry_box2df\"/>, "
+"<xref linkend=\"contains_box2df_geometry\"/>, <xref linkend="
+"\"is_contained_geometry_box2df\"/>, <xref linkend="
+"\"is_contained_box2df_geometry\"/>, <xref linkend="
+"\"is_contained_box2df_box2df\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns <varname>TRUE</varname> if A's bounding box is the same as B's."
+msgstr ""
+"Повертає <varname>TRUE</varname>, якщо обмежувальна рамка A збігається з "
+"обмежувальною рамкою B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~=</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of geometry/geography A is the same as the bounding box of "
+"geometry/geography B."
+msgstr ""
+"Оператор <varname>~=</varname> повертає <varname>TRUE</varname>, якщо "
+"обмежувальна рамка геометрії/географії A збігається з обмежувальною рамкою "
+"геометрії/географії B."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5.0 changed behavior"
+msgstr "Доступність: 1.5.0 змінено поведінку"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operator has changed behavior in PostGIS 1.5 from testing for actual "
+"geometric equality to only checking for bounding box equality. To complicate "
+"things it also depends on if you have done a hard or soft upgrade which "
+"behavior your database has. To find out which behavior your database has you "
+"can run the query below. To check for true equality use <xref "
+"linkend=\"ST_OrderingEquals\"/> or <xref linkend=\"ST_Equals\"/>."
+msgstr ""
+"У PostGIS 1.5 поведінка цього оператора змінилася: замість перевірки "
+"фактичної геометричної рівності тепер перевіряється лише рівність "
+"обмежувальної рамки. Щоб ускладнити справу, поведінка оператора також "
+"залежить від того, чи було оновлення жорстким чи м'яким. Щоб дізнатися, яку "
+"поведінку має ваша база даних, виконайте запит, наведений нижче. Щоб "
+"перевірити справжню рівність, використовуйте <xref linkend="
+"\"ST_OrderingEquals\"/>або <xref linkend=\"ST_Equals\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_OrderingEquals\"/>, <xref linkend=\"ST_Geometry_EQ\"/>"
+msgstr ""
+", <xref linkend=\"ST_OrderingEquals\"/>, <xref linkend=\"ST_Geometry_EQ\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Distance Operators"
+msgstr "Оператори відстані"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 2D distance between A and B."
+msgstr "Повертає 2D відстань між A і B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname><-></varname> operator returns the 2D distance between "
+"two geometries. Used in the \"ORDER BY\" clause provides index-assisted "
+"nearest-neighbor result sets. For PostgreSQL below 9.5 only gives centroid "
+"distance of bounding boxes and for PostgreSQL 9.5+, does true KNN distance "
+"search giving true distance between geometries, and distance sphere for "
+"geographies."
+msgstr ""
+"Оператор <varname><-></varname> повертає двовимірну відстань між двома "
+"геометріями. Використовується в розділі \"ORDER BY\" для отримання наборів "
+"результатів найближчих сусідів за допомогою індексу. Для PostgreSQL нижче "
+"9.5 повертає тільки відстань до центроїда обмежувальних рамок, а для "
+"PostgreSQL 9.5+ виконує пошук справжньої відстані KNN, що дає справжню "
+"відстань між геометріями та відстань до сфери для географічних об'єктів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will make use of 2D GiST indexes that may be available on the "
+"geometries. It is different from other operators that use spatial indexes in "
+"that the spatial index is only used when the operator is in the ORDER BY "
+"clause."
+msgstr ""
+"Цей операнд використовує 2D-індекси GiST, які можуть бути доступні для "
+"геометрій. Він відрізняється від інших операторів, що використовують "
+"просторові індекси, тим, що просторовий індекс використовується тільки тоді, "
+"коли оператор знаходиться в розділі ORDER BY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index only kicks in if one of the geometries is a constant (not in a "
+"subquery/cte). e.g. 'SRID=3005;POINT(1011102 450541)'::geometry instead of a."
+"geom"
+msgstr ""
+"Індекс спрацьовує тільки в тому випадку, якщо одна з геометрій є константою ("
+"не знаходиться в підзапиті/cte). Наприклад, “SRID=3005;POINT(1011102 "
+"450541)”::geometry замість a.geom"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to <link xlink:href=\"https://postgis.net/workshops/postgis-intro/knn."
+"html\">PostGIS workshop: Nearest-Neighbor Searching</link> for a detailed "
+"example."
+msgstr ""
+"Детальний приклад див. у <link xlink:href=\"https://postgis.net/workshops/"
+"postgis-intro/knn.html\">семінарі PostGIS: Пошук найближчих сусідів</link>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.2.0 -- True KNN (\"K nearest neighbor\") behavior for geometry "
+"and geography for PostgreSQL 9.5+. Note for geography KNN is based on sphere "
+"rather than spheroid. For PostgreSQL 9.4 and below, geography support is new "
+"but only supports centroid box."
+msgstr ""
+"Покращено: 2.2.0 — Поведінка True KNN (\"K найближчих сусідів\") для геометрії "
+"та географії для PostgreSQL 9.5+. Примітка щодо географії: KNN базується на "
+"сфері, а не на сфероїді. Для PostgreSQL 9.4 та нижчих версій підтримка "
+"географії є новою, але підтримує лише центроїдні прямокутники."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 -- For PostgreSQL 9.5 users, old Hybrid syntax may be slower, "
+"so you'll want to get rid of that hack if you are running your code only on "
+"PostGIS 2.2+ 9.5+. See examples below."
+msgstr ""
+"Змінено: 2.2.0 — Для користувачів PostgreSQL 9.5 старий гібридний синтаксис "
+"може працювати повільніше, тому вам слід позбутися цього хаку, якщо ви "
+"виконуєте свій код тільки на PostGIS 2.2+ 9.5+. Дивіться приклади нижче."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 2.0.0 -- Weak KNN provides nearest neighbors based on geometry "
+"centroid distances instead of true distances. Exact results for points, "
+"inexact for all other types. Available for PostgreSQL 9.1+"
+msgstr ""
+"Доступність: 2.0.0 — Weak KNN надає найближчих сусідів на основі "
+"геометричних відстаней до центроїдів замість реальних відстаней. Точні "
+"результати для точок, неточні для всіх інших типів. Доступно для PostgreSQL 9"
+".1+"
+
+#. Tag: para
+#, no-c-format
+msgid "Then the KNN raw answer:"
+msgstr "Потім необроблена відповідь KNN:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you run \"EXPLAIN ANALYZE\" on the two queries you would see a "
+"performance improvement for the second."
+msgstr ""
+"Якщо ви виконаєте \"EXPLAIN ANALYZE\" для двох запитів, ви побачите підвищення "
+"продуктивності для другого."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For users running with PostgreSQL < 9.5, use a hybrid query to find the "
+"true nearest neighbors. First a CTE query using the index-assisted KNN, then "
+"an exact query to get correct ordering:"
+msgstr ""
+"Для користувачів, які працюють з PostgreSQL < 9.5, використовуйте "
+"гібридний запит, щоб знайти найближчих сусідів. Спочатку виконайте запит CTE "
+"з використанням KNN з індексом, а потім точний запит, щоб отримати "
+"правильний порядок:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"geometry_distance_box\"/>"
+msgstr ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"geometry_distance_box\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the distance between A and B trajectories at their closest point of "
+"approach."
+msgstr ""
+"Повертає відстань між траєкторіями A і B у найближчій точці їх зближення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>|=|</varname> operator returns the 3D distance between two "
+"trajectories (See <xref linkend=\"ST_IsValidTrajectory\"/>). This is the "
+"same as <xref linkend=\"ST_DistanceCPA\"/> but as an operator it can be used "
+"for doing nearest neighbor searches using an N-dimensional index (requires "
+"PostgreSQL 9.5.0 or higher)."
+msgstr ""
+"Оператор <varname>|=|</varname> повертає 3D відстань між двома траєкторіями ("
+"див. <xref linkend=\"ST_IsValidTrajectory\"/>). Це те саме, що <xref linkend="
+"\"ST_DistanceCPA\"/>, але як оператор його можна використовувати для пошуку "
+"найближчих сусідів за допомогою N-вимірного індексу (потрібна PostgreSQL "
+"9.5.0 або вище)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will make use of ND GiST indexes that may be available on the "
+"geometries. It is different from other operators that use spatial indexes in "
+"that the spatial index is only used when the operator is in the ORDER BY "
+"clause."
+msgstr ""
+"Цей операнд використовує індекси ND GiST, які можуть бути доступні для "
+"геометрій. Він відрізняється від інших операторів, що використовують "
+"просторові індекси, тим, що просторовий індекс використовується тільки тоді, "
+"коли оператор знаходиться в розділі ORDER BY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index only kicks in if one of the geometries is a constant (not in a "
+"subquery/cte). e.g. 'SRID=3005;LINESTRINGM(0 0 0,0 0 1)'::geometry instead "
+"of a.geom"
+msgstr ""
+"Індекс спрацьовує тільки в тому випадку, якщо одна з геометрій є константою ("
+"не в підзапиті/cte). Наприклад, “SRID=3005;LINESTRINGM(0 0 0,0 0 1)”::"
+"geometry замість a.geom."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.2.0. Index-supported only available for PostgreSQL 9.5+"
+msgstr ""
+"Доступність: 2.2.0. Підтримка індексу доступна тільки для PostgreSQL 9.5+"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClosestPointOfApproach\"/>, <xref "
+"linkend=\"ST_IsValidTrajectory\"/>"
+msgstr ""
+", <xref linkend=\"ST_ClosestPointOfApproach\"/>, <xref linkend="
+"\"ST_IsValidTrajectory\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the 2D distance between A and B bounding boxes."
+msgstr "Повертає 2D відстань між обмежувальними рамками A і B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname><#></varname> operator returns distance between two "
+"floating point bounding boxes, possibly reading them from a spatial index "
+"(PostgreSQL 9.1+ required). Useful for doing nearest neighbor <emphasis "
+"role=\"strong\">approximate</emphasis> distance ordering."
+msgstr ""
+"Оператор <varname><#></varname> повертає відстань між двома "
+"обмежувальними рамками з плаваючою точкою, можливо зчитуючи їх з "
+"просторового індексу (потрібна PostgreSQL 9.1+). Корисно для <emphasis role="
+"\"strong\">наближеного</emphasis> упорядкування найближчих сусідів за "
+"відстанню."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will make use of any indexes that may be available on the "
+"geometries. It is different from other operators that use spatial indexes in "
+"that the spatial index is only used when the operator is in the ORDER BY "
+"clause."
+msgstr ""
+"Цей операнд використовує всі індекси, які можуть бути доступні для "
+"геометрій. Він відрізняється від інших операторів, які використовують "
+"просторові індекси, тим, що просторовий індекс використовується тільки тоді, "
+"коли оператор знаходиться в розділі ORDER BY."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index only kicks in if one of the geometries is a constant e.g. ORDER BY "
+"(ST_GeomFromText('POINT(1 2)') <#> geom) instead of g1.geom <#>."
+msgstr ""
+"Індекс спрацьовує тільки в тому випадку, якщо одна з геометрій є константою, "
+"наприклад ORDER BY (ST_GeomFromText(“POINT(1 2)”) <#> geom) замість "
+"g1.geom <#>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0 -- KNN only available for PostgreSQL 9.1+"
+msgstr "Доступність: 2.0.0 — KNN доступний тільки для PostgreSQL 9.1+"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"geometry_distance_knn\"/>"
+msgstr ""
+", <xref linkend=\"ST_Distance\"/>, <xref linkend=\"geometry_distance_knn\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the n-D distance between the A and B geometries or bounding boxes"
+msgstr ""
+"Повертає n-вимірну відстань між геометріями A і B або обмежувальними рамками"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname><<->></varname> operator returns the n-D "
+"(euclidean) distance between the centroids of the bounding boxes of two "
+"geometries. Useful for doing nearest neighbor <emphasis "
+"role=\"strong\">approximate</emphasis> distance ordering."
+msgstr ""
+"Оператор <varname><<->></varname> повертає n-вимірну (евклідову) "
+"відстань між центроїдами обмежувальних рамок двох геометрій. Корисний для "
+"<emphasis role=\"strong\">наближеного</emphasis> упорядкування найближчих "
+"сусідів за відстанню."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will make use of n-D GiST indexes that may be available on the "
+"geometries. It is different from other operators that use spatial indexes in "
+"that the spatial index is only used when the operator is in the ORDER BY "
+"clause."
+msgstr ""
+"Цей операнд використовує індекси n-D GiST, які можуть бути доступні для "
+"геометрій. Він відрізняється від інших операторів, що використовують "
+"просторові індекси, тим, що просторовий індекс використовується тільки тоді, "
+"коли оператор знаходиться в розділі ORDER BY."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.2.0 -- KNN only available for PostgreSQL 9.1+"
+msgstr "Доступність: 2.2.0 — KNN доступний тільки для PostgreSQL 9.1+"
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Output"
+msgstr "Вивід геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions convert geometry objects into various textual or binary "
+"formats."
+msgstr ""
+"Ці функції перетворюють геометричні об'єкти в різні текстові або двійкові "
+"формати."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the Well-Known Text (WKT) representation of the geometry with SRID "
+"meta data."
+msgstr ""
+"Повернути представлення геометрії у вигляді добре відомого тексту (WKT) з "
+"метаданими SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the Well-Known Text representation of the geometry prefixed with the "
+"SRID. The optional <parameter>maxdecimaldigits</parameter> argument may be "
+"used to reduce the maximum number of decimal digits after floating point "
+"used in output (defaults to 15)."
+msgstr ""
+"Повертає добре відоме текстове представлення геометрії з префіксом SRID. "
+"Опціональний аргумент <parameter>maxdecimaldigits</parameter> може "
+"використовуватися для зменшення максимальної кількості десяткових цифр після "
+"плаваючої коми, що використовуються у вихідних даних (за замовчуванням — 15)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To perform the inverse conversion of EWKT representation to PostGIS geometry "
+"use <xref linkend=\"ST_GeomFromEWKT\"/>."
+msgstr ""
+"Для виконання зворотного перетворення представлення EWKT у геометрію PostGIS "
+"використовуйте <xref linkend=\"ST_GeomFromEWKT\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using the <parameter>maxdecimaldigits</parameter> parameter can cause output "
+"geometry to become invalid. To avoid this use <xref "
+"linkend=\"ST_ReducePrecision\"/> with a suitable gridsize first."
+msgstr ""
+"Використання параметра <parameter>maxdecimaldigits</parameter> може "
+"призвести до некоректності геометрії вихідних даних. Щоб уникнути цього, "
+"спочатку використовуйте <xref linkend=\"ST_ReducePrecision\"/> з відповідним "
+"розміром сітки."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The WKT spec does not include the SRID. To get the OGC WKT format use <xref "
+"linkend=\"ST_AsText\"/>."
+msgstr ""
+"Специфікація WKT не включає SRID. Щоб отримати формат OGC WKT, "
+"використовуйте <xref linkend=\"ST_AsText\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"WKT format does not maintain precision so to prevent floating truncation, "
+"use <xref linkend=\"ST_AsBinary\"/> or <xref linkend=\"ST_AsEWKB\"/> format "
+"for transport."
+msgstr ""
+"Формат WKT не зберігає точність, тому щоб запобігти обрізанню плаваючої "
+"точки, для передачі використовуйте формат <xref linkend=\"ST_AsBinary\"/>або "
+"<xref linkend=\"ST_AsEWKB\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.1.0 support for optional precision parameter."
+msgstr "Покращено: 3.1.0 підтримка опціонального параметра точності."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 support for Geography, Polyhedral surfaces, Triangles and "
+"TIN was introduced."
+msgstr ""
+"Покращено: 2.0.0 додано підтримку географії, багатогранних поверхонь, "
+"трикутників і TIN."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_GeomFromEWKT\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_AsText\"/>, <xref "
+"linkend=\"ST_GeomFromEWKT\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the Well-Known Text (WKT) representation of the geometry/geography "
+"without SRID metadata."
+msgstr ""
+"Повернути представлення геометрії/географії у вигляді добре відомого тексту "
+"(WKT) без метаданих SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the OGC <link linkend=\"OpenGISWKBWKT\">Well-Known Text</link> (WKT) "
+"representation of the geometry/geography. The optional "
+"<parameter>maxdecimaldigits</parameter> argument may be used to limit the "
+"number of digits after the decimal point in output ordinates (defaults to "
+"15)."
+msgstr ""
+"Повертає представлення геометрії/географії у форматі OGC <link linkend="
+"\"OpenGISWKBWKT\">Well-Known Text</link> (WKT). Опціональний аргумент "
+"<parameter>maxdecimaldigits</parameter> може використовуватися для обмеження "
+"кількості цифр після десяткової крапки у вихідних координатах (за "
+"замовчуванням — 15)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To perform the inverse conversion of WKT representation to PostGIS geometry "
+"use <xref linkend=\"ST_GeomFromText\"/>."
+msgstr ""
+"Для виконання зворотного перетворення представлення WKT в геометрію PostGIS "
+"використовуйте <xref linkend=\"ST_GeomFromText\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The standard OGC WKT representation does not include the SRID. To include "
+"the SRID as part of the output representation, use the non-standard PostGIS "
+"function <xref linkend=\"ST_AsEWKT\"/>"
+msgstr ""
+"Стандартне представлення OGC WKT не включає SRID. Щоб включити SRID як "
+"частину вихідного представлення, використовуйте нестандартну функцію PostGIS "
+"<xref linkend=\"ST_AsEWKT\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The textual representation of numbers in WKT may not maintain full floating-"
+"point precision. To ensure full accuracy for data storage or transport it is "
+"best to use <link linkend=\"OpenGISWKBWKT\">Well-Known Binary</link> (WKB) "
+"format (see <xref linkend=\"ST_AsBinary\"/> and <parameter>maxdecimaldigits</"
+"parameter>)."
+msgstr ""
+"Текстове представлення чисел у WKT може не зберігати повну точність з "
+"плаваючою комою. Щоб забезпечити повну точність зберігання або передачі "
+"даних, найкраще використовувати формат <link linkend=\"OpenGISWKBWKT\">Well-"
+"Known Binary</link> (WKB) (див. <xref linkend=\"ST_AsBinary\"/>та "
+"<parameter>maxdecimaldigits</parameter>)."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5 - support for geography was introduced."
+msgstr "Доступність: 1.5 — додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.5 - optional parameter precision introduced."
+msgstr "Покращено: 2.5 — додано опційний параметр точності."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.25"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.25"
+
+#. Tag: para
+#, no-c-format
+msgid "Full precision output is the default."
+msgstr "Повна точність виводу є стандартною настройкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <parameter>maxdecimaldigits</parameter> argument can be used to limit "
+"output precision."
+msgstr ""
+"Аргумент <parameter>maxdecimaldigits</parameter> можна використовувати для "
+"обмеження точності виводу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_AsEWKT\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_AsEWKT\"/>, <xref "
+"linkend=\"ST_GeomFromText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the OGC/ISO Well-Known Binary (WKB) representation of the geometry/"
+"geography without SRID meta data."
+msgstr ""
+"Повернути представлення геометрії/географії у форматі OGC/ISO Well-Known "
+"Binary (WKB) без метаданих SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the OGC/ISO <link linkend=\"OpenGISWKBWKT\">Well-Known Binary</link> "
+"(WKB) representation of the geometry. The first function variant defaults to "
+"encoding using server machine endian. The second function variant takes a "
+"text argument specifying the endian encoding: either 'NDR' for little-"
+"endian; or 'XDR' for big-endian. Supplying unknown arguments will result in "
+"little-endian output."
+msgstr ""
+"Повертає представлення геометрії у форматі OGC/ISO <link linkend="
+"\"OpenGISWKBWKT\">Well-Known Binary</link> (WKB). Перший варіант функції за "
+"замовчуванням використовує кодування, що відповідає ендіану сервера. Другий "
+"варіант функції приймає текстовий аргумент, що визначає кодування ендіана: "
+"“NDR” для little-endian або “XDR” для big-endian. Введення невідомих "
+"аргументів призведе до виведення little-endian."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"WKB format is useful to read geometry data from the database and maintaining "
+"full numeric precision. This avoids the precision rounding that can happen "
+"with text formats such as WKT."
+msgstr ""
+"Формат WKB корисний для читання геометричних даних з бази даних та "
+"збереження повної числової точності. Це дозволяє уникнути округлення "
+"точності, яке може відбуватися у текстових форматах, таких як WKT."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To perform the inverse conversion of WKB to PostGIS geometry use <xref "
+"linkend=\"ST_GeomFromWKB\"/>."
+msgstr ""
+"Для виконання зворотного перетворення WKB в геометрію PostGIS використовуйте "
+"<xref linkend=\"ST_GeomFromWKB\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The OGC/ISO WKB format does not include the SRID. To get the EWKB format "
+"which does include the SRID use <xref linkend=\"ST_AsEWKB\"/>"
+msgstr ""
+"Формат OGC/ISO WKB не включає SRID. Щоб отримати формат EWKB, який включає "
+"SRID, використовуйте <xref linkend=\"ST_AsEWKB\"/>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The default behavior in PostgreSQL 9.0 has been changed to output bytea in "
+"hex encoding. If your GUI tools require the old behavior, then SET "
+"bytea_output='escape' in your database."
+msgstr ""
+"Стандартна поведінка в PostgreSQL 9.0 була змінена на виведення bytea в "
+"шістнадцятковому кодуванні. Якщо ваші графічні інструменти вимагають старої "
+"поведінки, то встановіть SET bytea_output=“escape” у вашій базі даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 support for higher coordinate dimensions was introduced."
+msgstr "Покращено: 2.0.0 додано підтримку вищих розмірностей координат."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 support for specifying endian with geography was introduced."
+msgstr ""
+"Покращено: 2.0.0 додано підтримку вказання ендіанності для географічних "
+"даних."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5.0 geography support was introduced."
+msgstr "Доступність: 1.5.0 додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 Inputs to this function can not be unknown -- must be "
+"geometry. Constructs such as <code>ST_AsBinary('POINT(1 2)')</code> are no "
+"longer valid and you will get an <code>n st_asbinary(unknown) is not unique "
+"error</code>. Code like that needs to be changed to "
+"<code>ST_AsBinary('POINT(1 2)'::geometry);</code>. If that is not possible, "
+"then install <filename>legacy.sql</filename>."
+msgstr ""
+"Змінено: 2.0.0 Вхідні дані для цієї функції не можуть бути невідомими — вони "
+"повинні бути геометрією. Такі конструкції, як <code>ST_AsBinary(“POINT(1 "
+"2)”)</code>, більше не є дійсними, і ви отримаєте помилку <code>n "
+"st_asbinary(unknown) is not unique</code>. Такий код потрібно змінити на "
+"<code>ST_AsBinary(“POINT(1 2)”::geometry);</code>. Якщо це неможливо, "
+"встановіть <filename>legacy.sql</filename>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.37"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.37"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_AsTWKB\"/>, <xref "
+"linkend=\"ST_AsText\"/>,"
+msgstr ""
+", <xref linkend=\"ST_AsEWKB\"/>, <xref linkend=\"ST_AsTWKB\"/>, <xref "
+"linkend=\"ST_AsText\"/>,"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the Extended Well-Known Binary (EWKB) representation of the geometry "
+"with SRID meta data."
+msgstr ""
+"Повернути розширене добре відоме двійкове (EWKB) представлення геометрії з "
+"метаданими SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the <link linkend=\"EWKB_EWKT\">Extended Well-Known Binary</link> "
+"(EWKB) representation of the geometry with SRID metadata. The first function "
+"variant defaults to encoding using server machine endian. The second "
+"function variant takes a text argument specifying the endian encoding: "
+"either 'NDR' for little-endian; or 'XDR' for big-endian. Supplying unknown "
+"arguments will result in little-endian output."
+msgstr ""
+"Повертає представлення геометрії у форматі <link linkend=\"EWKB_EWKT\""
+">Extended Well-Known Binary</link> (EWKB) з метаданими SRID. Перший варіант "
+"функції за замовчуванням використовує кодування, що відповідає порядку "
+"байтів на сервері. Другий варіант функції приймає текстовий аргумент, що "
+"визначає кодування ендіана: “NDR” для little-endian або “XDR” для big-"
+"endian. Введення невідомих аргументів призведе до виведення little-endian."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To perform the inverse conversion of EWKB to PostGIS geometry use <xref "
+"linkend=\"ST_GeomFromEWKB\"/>."
+msgstr ""
+"Для виконання зворотного перетворення EWKB в геометрію PostGIS "
+"використовуйте <xref linkend=\"ST_GeomFromEWKB\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To get the OGC/ISO WKB format use <xref linkend=\"ST_AsBinary\"/>. Note that "
+"OGC/ISO WKB format does not include the SRID."
+msgstr ""
+"Щоб отримати формат OGC/ISO WKB, використовуйте <xref linkend=\"ST_AsBinary\""
+"/>. Зверніть увагу, що формат OGC/ISO WKB не включає SRID."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeomFromEWKB\"/>, <xref linkend=\"ST_SRID\"/>"
+msgstr ", <xref linkend=\"ST_GeomFromEWKB\"/>, <xref linkend=\"ST_SRID\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a Geometry in HEXEWKB format (as text) using either little-endian "
+"(NDR) or big-endian (XDR) encoding."
+msgstr ""
+"Повертає геометрію у форматі HEXEWKB (у вигляді тексту) з використанням "
+"кодування little-endian (NDR) або big-endian (XDR)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a Geometry in HEXEWKB format (as text) using either little-endian "
+"(NDR) or big-endian (XDR) encoding. If no encoding is specified, then NDR is "
+"used."
+msgstr ""
+"Повертає геометрію у форматі HEXEWKB (у вигляді тексту) з використанням "
+"кодування little-endian (NDR) або big-endian (XDR). Якщо кодування не "
+"вказано, використовується NDR."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns an Encoded Polyline from a LineString geometry."
+msgstr "Повертає закодовану полілінію з геометрії LineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the geometry as an Encoded Polyline. This format is used by Google "
+"Maps with precision=5 and by Open Source Routing Machine with precision=5 "
+"and 6."
+msgstr ""
+"Повертає геометрію у вигляді закодованої полілінії. Цей формат "
+"використовується Google Maps з точністю = 5 та Open Source Routing Machine з "
+"точністю = 5 і 6."
+
+#. Tag: para
+#, no-c-format
+msgid "Basic"
+msgstr "Базовий"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use in conjunction with geography linestring and geography segmentize, and "
+"put on google maps"
+msgstr ""
+"Використовуйте разом із географічними лініями та географічною сегментацією, "
+"а також розмістіть на картах Google"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"javascript will look something like this where $ variable you replace with "
+"query result"
+msgstr ""
+"javascript буде виглядати приблизно так, де змінну $ ви замінюєте "
+"результатом запиту"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Segmentize\"/>"
+msgstr ", <xref linkend=\"ST_Segmentize\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a FlatGeobuf representation of a set of rows."
+msgstr "Повернути представлення FlatGeobuf набору рядків."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a FlatGeobuf representation (<link xlink:href=\"http://flatgeobuf."
+"org\">http://flatgeobuf.org</link>) of a set of rows corresponding to a "
+"FeatureCollection. NOTE: PostgreSQL bytea cannot exceed 1GB."
+msgstr ""
+"Повертає представлення FlatGeobuf (<link xlink:href=\"http://flatgeobuf."
+"org\">http://flatgeobuf.org</link>) набору рядків, що відповідають "
+"FeatureCollection. ПРИМІТКА: PostgreSQL bytea не може перевищувати 1 ГБ."
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>row</varname> row data with at least a geometry column."
+msgstr ""
+"<varname>row</varname> дані рядка, що містять принаймні стовпець геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>index</varname> toggle spatial index creation. Default is false."
+msgstr ""
+"<varname>index</varname> вмикає/вимикає створення просторового індексу. За "
+"замовчуванням встановлено значення false."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geom_name</varname> is the name of the geometry column in the row "
+"data. If NULL it will default to the first found geometry column."
+msgstr ""
+"<varname>geom_name</varname> — це назва стовпця геометрії в даних рядка. "
+"Якщо NULL, за замовчуванням буде використано перший знайдений стовпець "
+"геометрії."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a Geobuf representation of a set of rows."
+msgstr "Повернути представлення Geobuf набору рядків."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a Geobuf representation (<link xlink:href=\"https://github.com/mapbox/"
+"geobuf\">https://github.com/mapbox/geobuf</link>) of a set of rows "
+"corresponding to a FeatureCollection. Every input geometry is analyzed to "
+"determine maximum precision for optimal storage. Note that Geobuf in its "
+"current form cannot be streamed so the full output will be assembled in "
+"memory."
+msgstr ""
+"Повертає представлення Geobuf (<link xlink:href=\"https://github.com/mapbox/"
+"geobuf\">https://github.com/mapbox/geobuf</link>) набору рядків, що "
+"відповідають FeatureCollection. Кожна вхідна геометрія аналізується для "
+"визначення максимальної точності для оптимального зберігання. Зверніть "
+"увагу, що Geobuf у його поточній формі не може бути переданий потоком, тому "
+"повний вихід буде зібраний у пам'яті."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a geometry or feature in GeoJSON format."
+msgstr "Повернути геометрію або об'єкт у форматі GeoJSON."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry as a GeoJSON \"geometry\" object, or a row as a GeoJSON "
+"\"feature\" object."
+msgstr ""
+"Повертає геометрію як об'єкт GeoJSON \"geometry\" або рядок як об'єкт GeoJSON "
+"\"feature\"."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The resulting GeoJSON geometry and feature representations conform with the "
+"<link xlink:href=\"https://tools.ietf.org/html/rfc7946\">GeoJSON "
+"specifications RFC 7946</link>, except when the parsed geometries are "
+"referenced with a CRS other than WGS84 longitude and latitude (<link xlink:"
+"href=\"https://epsg.io/4326\">EPSG:4326</link>, <link xlink:href=\"http://"
+"epsg.io/4326.gml\">urn:ogc:def:crs:OGC::CRS84</link>); the GeoJSON geometry "
+"object will then have a short CRS SRID identifier attached by default. 2D "
+"and 3D Geometries are both supported. GeoJSON only supports SFS 1.1 geometry "
+"types (no curve support for example)."
+msgstr ""
+"Отримані геометричні та об'єктні представлення GeoJSON відповідають <link "
+"xlink:href=\"https://tools.ietf.org/html/rfc7946\">специфікаціям GeoJSON RFC "
+"7946</link>, за винятком випадків, коли розібрані геометрії посилаються на "
+"CRS, відмінну від WGS84 довготи та широти (<link xlink:href=\"https://epsg."
+"io/4326\">EPSG:4326</link>, <link xlink:href=\"http://epsg.io/4326.gml\""
+">urn:ogc:def:crs:OGC::CRS84</link>); у такому випадку до об'єкта геометрії "
+"GeoJSON за замовчуванням буде додано короткий ідентифікатор CRS SRID. "
+"Підтримуються як 2D, так і 3D геометрії. GeoJSON підтримує тільки типи "
+"геометрії SFS 1.1 (наприклад, не підтримуються криві)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>geom_column</varname> parameter is used to distinguish between "
+"multiple geometry columns. If omitted, the first geometry column in the "
+"record will be determined. Conversely, passing the parameter will save "
+"column type lookups."
+msgstr ""
+"Параметр <varname>geom_column</varname> використовується для розрізнення "
+"декількох стовпців геометрії. Якщо його опустити, буде визначено перший "
+"стовпець геометрії в записі. І навпаки, передача цього параметра збереже "
+"пошуки типів стовпців."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>maxdecimaldigits</varname> argument may be used to reduce the "
+"maximum number of decimal places used in output (defaults to 9). If you are "
+"using EPSG:4326 and are outputting the geometry only for display, "
+"<varname>maxdecimaldigits</varname>=6 can be a good choice for many maps."
+msgstr ""
+"Аргумент <varname>maxdecimaldigits</varname> можна використовувати для "
+"зменшення максимальної кількості десяткових знаків, що використовуються у "
+"вихідних даних (за замовчуванням — 9). Якщо ви використовуєте EPSG:4326 і "
+"виводите геометрію тільки для відображення, для багатьох карт хорошим "
+"вибором може бути <varname>maxdecimaldigits</varname>=6."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>options</varname> argument can be used to add BBOX or CRS in "
+"GeoJSON output:"
+msgstr ""
+"Аргумент <varname>options</varname> можна використовувати для додавання BBOX "
+"або CRS у вихідні дані GeoJSON:"
+
+#. Tag: para
+#, no-c-format
+msgid "0: means no option"
+msgstr "0: означає відсутність опції"
+
+#. Tag: para
+#, no-c-format
+msgid "1: GeoJSON BBOX"
+msgstr "1: GeoJSON BBOX"
+
+#. Tag: para
+#, no-c-format
+msgid "2: GeoJSON Short CRS (e.g EPSG:4326)"
+msgstr "2: GeoJSON коротка CRS (наприклад, EPSG:4326)"
+
+#. Tag: para
+#, no-c-format
+msgid "4: GeoJSON Long CRS (e.g urn:ogc:def:crs:EPSG::4326)"
+msgstr "4: GeoJSON Long CRS (наприклад, urn:ogc:def:crs:EPSG::4326)"
+
+#. Tag: para
+#, no-c-format
+msgid "8: GeoJSON Short CRS if not EPSG:4326 (default)"
+msgstr "8: GeoJSON Короткий CRS, якщо не EPSG:4326 (за замовчуванням)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>id_column</varname> parameter is used to set the \"id\" member "
+"of the returned GeoJSON features. As per GeoJSON RFC, this SHOULD be used "
+"whenever a feature has a commonly used identifier, such as a primary key. "
+"When not specified, the produced features will not get an \"id\" member and "
+"any columns other than the geometry, including any potential keys, will just "
+"end up inside the feature’s \"properties\" member."
+msgstr ""
+"Параметр <varname>id_column</varname> використовується для встановлення "
+"елемента \"id\" повернутих об'єктів GeoJSON. Відповідно до GeoJSON RFC, це "
+"ПОВИННО використовуватися, коли елемент має загальновживаний ідентифікатор, "
+"такий як первинний ключ. Якщо це не вказано, створені елементи не отримають "
+"елемент \"id\", а всі стовпці, крім геометрії, включаючи будь-які потенційні "
+"ключі, просто потраплять в елемент \"properties\" елемента."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The GeoJSON specification states that polygons are oriented using the Right-"
+"Hand Rule, and some clients require this orientation. This can be ensured by "
+"using <xref linkend=\"ST_ForcePolygonCCW\"/>. The specification also "
+"requires that geometry be in the WGS84 coordinate system (SRID = 4326). If "
+"necessary geometry can be projected into WGS84 using <xref "
+"linkend=\"ST_Transform\"/>: <code>ST_Transform( geom, 4326 )</code>."
+msgstr ""
+"Специфікація GeoJSON визначає, що полігони орієнтуються за правилом правої "
+"руки, і деякі клієнти вимагають такої орієнтації. Це можна забезпечити за "
+"допомогою <xref linkend=\"ST_ForcePolygonCCW\"/>. Специфікація також "
+"вимагає, щоб геометрія була в системі координат WGS84 (SRID = 4326). За "
+"необхідності геометрію можна спроектувати в WGS84 за допомогою <xref linkend="
+"\"ST_Transform\"/>: <code>ST_Transform( geom, 4326 )</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GeoJSON can be tested and viewed online at <link xlink:href=\"http://geojson."
+"io/\">geojson.io</link> and <link xlink:href=\"http://geojson.io/"
+"\">geojsonlint.com</link>. It is widely supported by web mapping frameworks:"
+msgstr ""
+"GeoJSON можна протестувати та переглянути онлайн за адресами <link "
+"xlink:href=\"http://geojson.io/\">geojson.io</link> та <link "
+"xlink:href=\"http://geojson.io/\">geojsonlint.com</link>. Він широко "
+"підтримується веб-картографічними фреймворками:"
+
+#. Tag: link
+#, no-c-format
+msgid "OpenLayers GeoJSON Example"
+msgstr "Приклад OpenLayers GeoJSON"
+
+#. Tag: link
+#, no-c-format
+msgid "Leaflet GeoJSON Example"
+msgstr "Приклад GeoJSON для листівки"
+
+#. Tag: link
+#, no-c-format
+msgid "Mapbox GL GeoJSON Example"
+msgstr "Приклад Mapbox GL GeoJSON"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.3.4"
+msgstr "Доступність: 1.3.4"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 support default args and named args."
+msgstr ""
+"Змінено: 2.0.0 підтримка аргументів за замовчуванням та іменованих "
+"аргументів."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 support records as input"
+msgstr "Змінено: 3.0.0 підтримка записів як вхідних даних"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 output SRID if not EPSG:4326."
+msgstr "Змінено: 3.0.0 виведення SRID, якщо не EPSG:4326."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.5.0 allow specifying the column containing the feature id"
+msgstr "Змінено: 3.5.0 Дозволено вказувати стовпець, що містить feature id"
+
+#. Tag: para
+#, no-c-format
+msgid "Generate a FeatureCollection:"
+msgstr "Створити колекцію об'єктів:"
+
+#. Tag: para
+#, no-c-format
+msgid "Generate a Feature:"
+msgstr "Створити Feature:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Don't forget to transform your data to WGS84 longitude, latitude to conform "
+"with the GeoJSON specification:"
+msgstr ""
+"Не забудьте перетворити дані в довготу WGS84, широту, щоб вони відповідали "
+"специфікації GeoJSON:"
+
+#. Tag: para
+#, no-c-format
+msgid "3D geometries are supported:"
+msgstr "Підтримуються 3D-геометрії:"
+
+#. Tag: para
+#, no-c-format
+msgid "Options argument can be used to add BBOX and CRS in GeoJSON output:"
+msgstr ""
+"Аргумент Options можна використовувати для додавання BBOX і CRS у вихідні "
+"дані GeoJSON:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ForcePolygonCCW\"/>, <xref linkend=\"ST_Transform\"/>"
+msgstr ""
+", <xref linkend=\"ST_ForcePolygonCCW\"/>, <xref linkend=\"ST_Transform\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the geometry as a GML version 2 or 3 element."
+msgstr "Повернути геометрію як елемент GML версії 2 або 3."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the geometry as a Geography Markup Language (GML) element. The "
+"version parameter, if specified, may be either 2 or 3. If no version "
+"parameter is specified then the default is assumed to be 2. The "
+"<varname>maxdecimaldigits</varname> argument may be used to reduce the "
+"maximum number of decimal places used in output (defaults to 15)."
+msgstr ""
+"Повернути геометрію як елемент мови географічної розмітки (GML). Параметр "
+"version, якщо вказано, може мати значення 2 або 3. Якщо параметр version не "
+"вказано, за замовчуванням використовується значення 2. Аргумент "
+"<varname>maxdecimaldigits</varname> можна використовувати для зменшення "
+"максимальної кількості десяткових знаків, що використовуються у вихідних "
+"даних (за замовчуванням 15)."
+
+#. Tag: para
+#, no-c-format
+msgid "GML 2 refer to 2.1.2 version, GML 3 to 3.1.1 version"
+msgstr "GML 2 відноситься до версії 2.1.2, GML 3 – до версії 3.1.1"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The 'options' argument is a bitfield. It could be used to define CRS output "
+"type in GML output, and to declare data as lat/lon:"
+msgstr ""
+"Аргумент \"options\" є бітовим полем. Він може використовуватися для "
+"визначення типу виводу CRS у виводі GML та для оголошення даних як lat/lon:"
+
+#. Tag: para
+#, no-c-format
+msgid "0: GML Short CRS (e.g EPSG:4326), default value"
+msgstr "0: Коротка CRS GML (наприклад, EPSG:4326), значення за замовчуванням"
+
+#. Tag: para
+#, no-c-format
+msgid "1: GML Long CRS (e.g urn:ogc:def:crs:EPSG::4326)"
+msgstr "1: GML Long CRS (наприклад, urn:ogc:def:crs:EPSG::4326)"
+
+#. Tag: para
+#, no-c-format
+msgid "2: For GML 3 only, remove srsDimension attribute from output."
+msgstr "2: Тільки для GML 3, видаліть атрибут srsDimension з вихідних даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"4: For GML 3 only, use <LineString> rather than <Curve> tag for "
+"lines."
+msgstr ""
+"4: Тільки для GML 3 використовуйте тег <LineString> замість "
+"<Curve> для ліній."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"16: Declare that data are lat/lon (e.g srid=4326). Default is to assume that "
+"data are planars. This option is useful for GML 3.1.1 output only, related "
+"to axis order. So if you set it, it will swap the coordinates so order is "
+"lat lon instead of database lon lat."
+msgstr ""
+"16: Заявити, що дані є широтою/довготою (наприклад, srid=4326). За "
+"замовчуванням вважається, що дані є планарними. Ця опція корисна тільки для "
+"виводу GML 3.1.1, пов'язаного з порядком осей. Тому, якщо ви її встановите, "
+"координати будуть поміняні місцями, і порядок буде широта-довгота замість "
+"довгота-широта, як у базі даних."
+
+#. Tag: para
+#, no-c-format
+msgid "32: Output the box of the geometry (envelope)."
+msgstr "32: Вивести прямокутник геометрії (контур)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The 'namespace prefix' argument may be used to specify a custom namespace "
+"prefix or no prefix (if empty). If null or omitted 'gml' prefix is used"
+msgstr ""
+"Аргумент \"namespace prefix\" може використовуватися для вказання власного "
+"префікса простору імен або відсутності префікса (якщо поле порожнє). Якщо "
+"префікс \"gml\" нульовий або пропущений, використовується префікс \"gml\""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.3.2"
+msgstr "Доступність: 1.3.2"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 prefix support was introduced. Option 4 for GML3 was "
+"introduced to allow using LineString instead of Curve tag for lines. GML3 "
+"Support for Polyhedral surfaces and TINS was introduced. Option 32 was "
+"introduced to output the box."
+msgstr ""
+"Покращено: додано підтримку префікса 2.0.0. Додано опцію 4 для GML3, що "
+"дозволяє використовувати тег LineString замість Curve для ліній. Додано "
+"підтримку GML3 для багатогранних поверхонь і TINS. Додано опцію 32 для "
+"виведення прямокутника."
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 use default named args"
+msgstr "Змінено: 2.0.0 використання аргументів із стандартними іменами"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 id support was introduced, for GML 3."
+msgstr "Покращено: 2.1.0 Додано підтримку ідентифікаторів для GML 3."
+
+#. Tag: para
+#, no-c-format
+msgid "Only version 3+ of ST_AsGML supports Polyhedral Surfaces and TINS."
+msgstr "Тільки версія 3+ ST_AsGML підтримує багатогранні поверхні та TINS."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 17.2"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 17.2"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Version 2"
+msgstr "Приклади: Версія 2"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Version 3"
+msgstr "Приклади: Версія 3"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the geometry as a KML element."
+msgstr "Повернути геометрію як елемент KML."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the geometry as a Keyhole Markup Language (KML) element. default "
+"maximum number of decimal places is 15, default namespace is no prefix."
+msgstr ""
+"Повернути геометрію як елемент мови розмітки Keyhole (KML). Максимальна "
+"кількість десяткових знаків за замовчуванням — 15, простір імен за "
+"замовчуванням — без префікса."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Requires PostGIS be compiled with Proj support. Use <xref "
+"linkend=\"PostGIS_Full_Version\"/> to confirm you have proj support compiled "
+"in."
+msgstr ""
+"Потрібно, щоб PostGIS було скомпільовано з підтримкою Proj. Використовуйте "
+"<xref linkend=\"PostGIS_Full_Version\"/>, щоб підтвердити, що підтримка proj "
+"скомпільована."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.2.2 - later variants that include version param came in 1.3.2"
+msgstr ""
+"Доступність: 1.2.2 — пізніші варіанти, що містять параметр версії, з'явилися "
+"в 1.3.2"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 - Add prefix namespace, use default and named args"
+msgstr ""
+"Покращено: 2.0.0 - Додано префікс простору імен, використання аргументів за "
+"замовчуванням та іменованих аргументів"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 - Removed the \"versioned\" variant signature"
+msgstr "Змінено: 3.0.0 - Вилучено підпис варіанту \"versioned\""
+
+#. Tag: para
+#, no-c-format
+msgid "AsKML output will not work with geometries that do not have an SRID"
+msgstr "Вихідні дані AsKML не працюватимуть з геометріями, які не мають SRID"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsGML\"/>"
+msgstr ", <xref linkend=\"ST_AsGML\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the Degrees, Minutes, Seconds representation of the given point."
+msgstr "Повернути представлення градусів, хвилин, секунд заданої точки."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the Degrees, Minutes, Seconds representation of the point."
+msgstr "Повертає представлення точки у градусах, хвилинах і секундах."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It is assumed the point is in a lat/lon projection. The X (lon) and Y (lat) "
+"coordinates are normalized in the output to the \"normal\" range (-180 to "
+"+180 for lon, -90 to +90 for lat)."
+msgstr ""
+"Передбачається, що точка знаходиться в проекції широти/довготи. Координати X "
+"(довгота) та Y (широта) у вихідних даних нормалізовано до \"нормального\" "
+"діапазону (-180 до +180 для довготи, -90 до +90 для широти)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The text parameter is a format string containing the format for the "
+"resulting text, similar to a date format string. Valid tokens are \"D\" for "
+"degrees, \"M\" for minutes, \"S\" for seconds, and \"C\" for cardinal "
+"direction (NSEW). DMS tokens may be repeated to indicate desired width and "
+"precision (\"SSS.SSSS\" means \" 1.0023\")."
+msgstr ""
+"Параметр text є рядком формату, що містить формат для отриманого тексту, "
+"подібний до рядка формату дати. Допустимі символи: \"D\" для градусів, \"M\" для "
+"хвилин, \"S\" для секунд і \"C\" для основних напрямків (NSEW). Символи DMS "
+"можна повторювати, щоб вказати бажану ширину та точність (\"SSS.SSSS\" означає "
+"\"1,0023\")."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"\"M\", \"S\", and \"C\" are optional. If \"C\" is omitted, degrees are shown "
+"with a \"-\" sign if south or west. If \"S\" is omitted, minutes will be "
+"shown as decimal with as many digits of precision as you specify. If \"M\" "
+"is also omitted, degrees are shown as decimal with as many digits precision "
+"as you specify."
+msgstr ""
+"\"M\", \"S\" та \"C\" є необов'язковими. Якщо \"C\" опущено, градуси позначаються "
+"знаком \"-\", якщо вони південні або західні. Якщо \"S\" опущено, хвилини "
+"відображаються у вигляді десяткових чисел із точністю до заданої кількості "
+"цифр. Якщо \"M\" також опущено, градуси відображаються у вигляді десяткових "
+"чисел із точністю до заданої кількості цифр."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the format string is omitted (or zero-length) a default format will be "
+"used."
+msgstr ""
+"Якщо рядок формату пропущено (або має нульову довжину), буде використано "
+"формат за замовчуванням."
+
+#. Tag: para
+#, no-c-format
+msgid "Default format."
+msgstr "Формат за замовчуванням."
+
+#. Tag: para
+#, no-c-format
+msgid "Providing a format (same as the default)."
+msgstr "Надання формату (такого самого, як за замовчуванням)."
+
+#. Tag: para
+#, no-c-format
+msgid "Characters other than D, M, S, C and . are just passed through."
+msgstr "Символи, крім D, M, S, C і ., просто пропускаються."
+
+#. Tag: para
+#, no-c-format
+msgid "Signed degrees instead of cardinal directions."
+msgstr "Підписані ступені замість основних напрямків."
+
+#. Tag: para
+#, no-c-format
+msgid "Decimal degrees."
+msgstr "Десятичні градуси."
+
+#. Tag: para
+#, no-c-format
+msgid "Excessively large values are normalized."
+msgstr "Надмірно великі значення нормалізуються."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns geometry as a MARC21/XML record with a geographic datafield (034)."
+msgstr ""
+"Повертає геометрію у вигляді запису MARC21/XML із полем географічних даних "
+"(034)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function returns a MARC21/XML record with <link xlink:href=\"https://"
+"www.loc.gov/marc/bibliographic/bd034.html\">Coded Cartographic Mathematical "
+"Data</link> representing the bounding box of a given geometry. The "
+"<varname>format</varname> parameter allows to encode the coordinates in "
+"subfields <varname>$d</varname>,<varname>$e</varname>,<varname>$f</varname> "
+"and <varname>$g</varname> in all formats supported by the MARC21/XML "
+"standard. Valid formats are:"
+msgstr ""
+"Ця функція повертає запис MARC21/XML з <link xlink:href=\"https://www.loc.gov/"
+"marc/bibliographic/bd034.html\">Кодованими картографічними математичними "
+"даними</link>, що представляють обмежувальну рамку заданої геометрії. "
+"Параметр <varname>format</varname> дозволяє кодувати координати в підполях "
+"<varname>$d</varname>,<varname>$e</varname>,<varname>$f</varname> та "
+"<varname>$g</varname> у всіх форматах, що підтримуються стандартом MARC21/"
+"XML. Допустимі формати:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"cardinal direction, degrees, minutes and seconds (default): "
+"<varname>hdddmmss</varname>"
+msgstr ""
+"основний напрямок, градуси, хвилини та секунди (за замовчуванням): "
+"<varname>hdddmmss</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "decimal degrees with cardinal direction: <varname>hddd.dddddd</varname>"
+msgstr ""
+"десятиградусні градуси з основним напрямком: <varname>hddd.dddddd</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"decimal degrees without cardinal direction: <varname>ddd.dddddd</varname>"
+msgstr ""
+"десятиградусні градуси без вказівки сторони світу: <varname>ddd."
+"dddddd</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "decimal minutes with cardinal direction: <varname>hdddmm.mmmm</varname>"
+msgstr ""
+"десятикратні хвилини з основним напрямком: <varname>hdddmm.mmmm</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"decimal minutes without cardinal direction: <varname>dddmm.mmmm</varname>"
+msgstr "десятинні хвилини без вказівки напрямку: <varname>dddmm.mmmm</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"decimal seconds with cardinal direction: <varname>hdddmmss.sss</varname>"
+msgstr "десятинні секунди з основним напрямком: <varname>hdddmmss.sss</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The decimal sign may be also a comma, e.g. <varname>hdddmm,mmmm</varname>."
+msgstr ""
+"Знак десяткового числа може бути також комою, наприклад "
+"<varname>hdddmm,mmmm</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The precision of decimal formats can be limited by the number of characters "
+"after the decimal sign, e.g. <varname>hdddmm.mm</varname> for decimal "
+"minutes with a precision of two decimals."
+msgstr ""
+"Точність десяткових форматів може бути обмежена кількістю символів після "
+"десяткового знака, наприклад <varname>hdddmm.mm</varname> для десяткових "
+"хвилин з точністю до двох десяткових знаків."
+
+#. Tag: para
+#, no-c-format
+msgid "This function ignores the Z and M dimensions."
+msgstr "Ця функція ігнорує розміри Z і M."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not support non lon/lat geometries, as they are not "
+"supported by the MARC21/XML standard (Coded Cartographic Mathematical Data)."
+msgstr ""
+"Ця функція не підтримує геометрії, що не є lon/lat, оскільки вони не "
+"підтримуються стандартом MARC21/XML (Coded Cartographic Mathematical Data)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The MARC21/XML Standard does not provide any means to annotate the spatial "
+"reference system for Coded Cartographic Mathematical Data, which means that "
+"this information will be lost after conversion to MARC21/XML."
+msgstr ""
+"Стандарт MARC21/XML не передбачає жодних засобів для анотування просторової "
+"системи координат для кодованих картографічних математичних даних, що "
+"означає, що ця інформація буде втрачена після перетворення у формат MARC21/"
+"XML."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converting a <varname>POINT</varname> to MARC21/XML formatted as hdddmmss "
+"(default)"
+msgstr ""
+"Перетворення <varname>POINT</varname> у формат MARC21/XML у вигляді hdddmmss "
+"(за замовчуванням)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converting a <varname>POLYGON</varname> to MARC21/XML formatted in decimal "
+"degrees"
+msgstr ""
+"Перетворення <varname>POLYGON</varname> у формат MARC21/XML з десятковими "
+"градусами"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converting a <varname>GEOMETRYCOLLECTION</varname> to MARC21/XML formatted "
+"in decimal minutes. The geometries order in the MARC21/XML output correspond "
+"to their order in the collection."
+msgstr ""
+"Перетворення <varname>GEOMETRYCOLLECTION</varname> у формат MARC21/XML з "
+"десятковими хвилинами. Порядок геометрій у вихідних даних MARC21/XML "
+"відповідає їхньому порядку в колекції."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Transforms a geometry into the coordinate space of a MVT tile."
+msgstr "Перетворює геометрію в координатну систему плитки MVT."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Transforms a geometry into the coordinate space of a MVT (<link xlink:"
+"href=\"https://www.mapbox.com/vector-tiles/\">Mapbox Vector Tile</link>) "
+"tile, clipping it to the tile bounds if required. The geometry must be in "
+"the coordinate system of the target map (using <xref "
+"linkend=\"ST_Transform\"/> if needed). Commonly this is <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/Web_Mercator_projection\">Web Mercator</"
+"link> (SRID:3857)."
+msgstr ""
+"Перетворює геометрію в координатну систему плитки MVT (<link "
+"xlink:href=\"https://www.mapbox.com/vector-tiles/\">Mapbox Vector Tile</link>)"
+", обрізаючи її до меж плитки, якщо потрібно. Геометрія повинна бути в "
+"системі координат цільової карти (використовуючи <xref linkend=\"ST_Transform"
+"\"/>, якщо потрібно). Зазвичай це <link xlink:href=\"https://en.wikipedia.org/"
+"wiki/Web_Mercator_projection\">Web Mercator</link> (SRID:3857)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function attempts to preserve geometry validity, and corrects it if "
+"needed. This may cause the result geometry to collapse to a lower dimension."
+msgstr ""
+"Функція намагається зберегти правильність геометрії та виправити її, якщо це "
+"необхідно. Це може призвести до скорочення геометрії результату до нижчого "
+"виміру."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The rectangular bounds of the tile in the target map coordinate space must "
+"be provided, so the geometry can be transformed, and clipped if required. "
+"The bounds can be generated using <xref linkend=\"ST_TileEnvelope\"/>."
+msgstr ""
+"Необхідно вказати прямокутні межі плитки в просторі координат цільової "
+"карти, щоб можна було трансформувати геометрію та обрізати її за "
+"необхідності. Межі можна створити за допомогою <xref linkend="
+"\"ST_TileEnvelope\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is used to convert geometry into the tile coordinate space "
+"required by <xref linkend=\"ST_AsMVT\"/>."
+msgstr ""
+"Ця функція використовується для перетворення геометрії в координатну систему "
+"плиток, необхідну для <xref linkend=\"ST_AsMVT\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geom</varname> is the geometry to transform, in the coordinate "
+"system of the target map."
+msgstr ""
+"<varname>geom</varname> — геометрія, яку потрібно трансформувати в системі "
+"координат цільової карти."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>bounds</varname> is the rectangular bounds of the tile in map "
+"coordinate space, with no buffer."
+msgstr ""
+"<varname>bounds</varname> — прямокутні межі плитки в просторі координат "
+"карти, без буфера."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>extent</varname> is the tile extent size in tile coordinate space "
+"as defined by the <link xlink:href=\"https://www.mapbox.com/vector-tiles/"
+"specification/\">MVT specification</link>. Defaults to 4096."
+msgstr ""
+"<varname>extent</varname> — розмір площі плитки в просторі координат плитки, "
+"як визначено в <link xlink:href=\"https://www.mapbox.com/vector-tiles/"
+"specification/\">специфікації MVT</link>. За замовчуванням — 4096."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>buffer</varname> is the buffer size in tile coordinate space for "
+"geometry clippig. Defaults to 256."
+msgstr ""
+"<varname>buffer</varname> — розмір буфера в просторі координат плиток для "
+"обрізки геометрії. За замовчуванням — 256."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>clip_geom</varname> is a boolean to control if geometries are "
+"clipped or encoded as-is. Defaults to true."
+msgstr ""
+"<varname>clip_geom</varname> — це логічне значення, яке визначає, чи "
+"геометрії обрізаються або кодуються без змін. За замовчуванням встановлено "
+"значення true."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"From 3.0, Wagyu can be chosen at configure time to clip and validate MVT "
+"polygons. This library is faster and produces more correct results than the "
+"GEOS default, but it might drop small polygons."
+msgstr ""
+"Починаючи з версії 3.0, під час конфігурації можна вибрати Wagyu для "
+"обрізання та перевірки полігонів MVT. Ця бібліотека працює швидше та дає "
+"більш правильні результати, ніж стандартна GEOS, але може пропускати "
+"невеликі полігони."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Canonical example for a Web Mercator tile using a computed tile bounds to "
+"query and clip geometry. This assumes the data.geom column has srid of 4326."
+msgstr ""
+"Канонічний приклад для плитки Web Mercator з використанням обчислених меж "
+"плитки для запиту та обрізки геометрії. Припускається, що стовпець data.geom "
+"має srid 4326."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_TileEnvelope\"/>, <xref "
+"linkend=\"PostGIS_Wagyu_Version\"/>"
+msgstr ""
+", <xref linkend=\"ST_TileEnvelope\"/>, <xref linkend=\"PostGIS_Wagyu_Version"
+"\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Aggregate function returning a MVT representation of a set of rows."
+msgstr "Агрегатна функція, що повертає MVT-представлення набору рядків."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function which returns a binary <link xlink:href=\"https://www."
+"mapbox.com/vector-tiles/\">Mapbox Vector Tile</link> representation of a set "
+"of rows corresponding to a tile layer. The rows must contain a geometry "
+"column which will be encoded as a feature geometry. The geometry must be in "
+"tile coordinate space and valid as per the <link xlink:href=\"https://www."
+"mapbox.com/vector-tiles/specification/\">MVT specification</link>. <xref "
+"linkend=\"ST_AsMVTGeom\"/> can be used to transform geometry into tile "
+"coordinate space. Other row columns are encoded as feature attributes."
+msgstr ""
+"Агрегатна функція, яка повертає двійкове <link xlink:href=\"https://www.mapbox"
+".com/vector-tiles/\">Mapbox Vector Tile</link> представлення набору рядків, "
+"що відповідають шару плиток. Рядки повинні містити стовпець геометрії, який "
+"буде закодований як геометрія об'єкта. Геометрія повинна бути в просторі "
+"координат плитки та відповідати <link xlink:href=\"https://www.mapbox.com/"
+"vector-tiles/specification/\">специфікації MVT</link>. <xref linkend="
+"\"ST_AsMVTGeom\"/> можна використовувати для перетворення геометрії в "
+"простір координат плитки. Інші стовпці рядків кодуються як атрибути об'єкта."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <link xlink:href=\"https://www.mapbox.com/vector-tiles/\">Mapbox Vector "
+"Tile</link> format can store features with varying sets of attributes. To "
+"use this capability supply a JSONB column in the row data containing Json "
+"objects one level deep. The keys and values in the JSONB values will be "
+"encoded as feature attributes."
+msgstr ""
+"Формат <link xlink:href=\"https://www.mapbox.com/vector-tiles/\">Mapbox Vector "
+"Tile</link> може зберігати об'єкти з різними наборами атрибутів. Щоб "
+"скористатися цією можливістю, надайте стовпець JSONB у даних рядка, що "
+"містить об'єкти Json одного рівня. Ключі та значення в значеннях JSONB "
+"будуть закодовані як атрибути об'єктів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tiles with multiple layers can be created by concatenating multiple calls to "
+"this function using <varname>||</varname> or <varname>STRING_AGG</varname>."
+msgstr ""
+"Плитки з декількома шарами можна створити, об'єднавши кілька викликів цієї "
+"функції за допомогою <varname>||</varname> або <varname>STRING_AGG</varname>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Do not call with a <varname>GEOMETRYCOLLECTION</varname> as an element in "
+"the row. However you can use <xref linkend=\"ST_AsMVTGeom\"/> to prepare a "
+"geometry collection for inclusion."
+msgstr ""
+"Не викликайте з <varname>GEOMETRYCOLLECTION</varname> як елемент у рядку. "
+"Однак ви можете використовувати <xref linkend=\"ST_AsMVTGeom\"/>, щоб "
+"підготувати колекцію геометрії для включення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>name</varname> is the name of the layer. Default is the string "
+"\"default\"."
+msgstr ""
+"<varname>name</varname> — це назва шару. За замовчуванням використовується "
+"рядок \"default\"."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>extent</varname> is the tile extent in screen space as defined by "
+"the specification. Default is 4096."
+msgstr ""
+"<varname>extent</varname> — це розмір плитки в просторі екрана, як визначено "
+"в специфікації. За замовчуванням — 4096."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geom_name</varname> is the name of the geometry column in the row "
+"data. Default is the first geometry column. Note that PostgreSQL by default "
+"automatically <link xlink:href=\"https://www.postgresql.org/docs/current/sql-"
+"syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS\">folds unquoted identifiers to "
+"lower case</link>, which means that unless the geometry column is quoted, e."
+"g. <varname>\"MyMVTGeom\"</varname>, this parameter must be provided as "
+"lowercase."
+msgstr ""
+"<varname>geom_name</varname> — це ім'я стовпця геометрії в даних рядка. За "
+"замовчуванням це перший стовпець геометрії. Зверніть увагу, що PostgreSQL за "
+"замовчуванням автоматично <link xlink:href=\"https://www.postgresql.org/docs/"
+"current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS\">перетворює "
+"ідентифікатори без лапок у нижній регістр</link>, що означає, що якщо "
+"стовпець геометрії не взято в лапки, наприклад <varname>\"MyMVTGeom\"</"
+"varname>, цей параметр повинен бути вказаний малими літерами."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>feature_id_name</varname> is the name of the Feature ID column in "
+"the row data. If NULL or negative the Feature ID is not set. The first "
+"column matching name and valid type (smallint, integer, bigint) will be used "
+"as Feature ID, and any subsequent column will be added as a property. JSON "
+"properties are not supported."
+msgstr ""
+"<varname>feature_id_name</varname> — це назва стовпця Feature ID у даних "
+"рядка. Якщо значення NULL або від’ємне, Feature ID не встановлюється. Перший "
+"стовпець, що відповідає назві та дійсному типу (smallint, integer, bigint), "
+"буде використано як Feature ID, а всі наступні стовпці будуть додано як "
+"властивості. Властивості JSON не підтримуються."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.0 - added support for Feature ID."
+msgstr "Покращено: 3.0 — додано підтримку ідентифікатора функції."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.5.0 - added support parallel query."
+msgstr "Покращено: 2.5.0 — додано підтримку паралельних запитів."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_TileEnvelope\"/>"
+msgstr ", <xref linkend=\"ST_TileEnvelope\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns SVG path data for a geometry."
+msgstr "Повертає дані SVG-шляху для геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the geometry as Scalar Vector Graphics (SVG) path data. Use 1 as "
+"second argument to have the path data implemented in terms of relative "
+"moves, the default (or 0) uses absolute moves. Third argument may be used to "
+"reduce the maximum number of decimal digits used in output (defaults to 15). "
+"Point geometries will be rendered as cx/cy when 'rel' arg is 0, x/y when "
+"'rel' is 1. Multipoint geometries are delimited by commas (\",\"), "
+"GeometryCollection geometries are delimited by semicolons (\";\")."
+msgstr ""
+"Повернути геометрію як дані шляху Scalar Vector Graphics (SVG). "
+"Використовуйте 1 як другий аргумент, щоб дані шляху були реалізовані у "
+"вигляді відносних переміщень, за замовчуванням (або 0) використовуються "
+"абсолютні переміщення. Третій аргумент може бути використаний для зменшення "
+"максимальної кількості десяткових цифр, що використовуються у вихідних даних "
+"(за замовчуванням 15). Точкові геометрії будуть відображатися як cx/cy, коли "
+"аргумент “rel” дорівнює 0, x/y, коли “rel” дорівнює 1. Багатоточкові "
+"геометрії розділяються комами (\",\"), геометрії GeometryCollection "
+"розділяються крапками з комою (\";\")."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For working with PostGIS SVG graphics, checkout <link xlink:href=\"https://"
+"github.com/dr-jts/pg_svg\">pg_svg</link> library which provides plpgsql "
+"functions for working with outputs from ST_AsSVG."
+msgstr ""
+"Для роботи з графікою PostGIS SVG, ознайомтеся з бібліотекою <link "
+"xlink:href=\"https://github.com/dr-jts/pg_svg\">pg_svg</link>, яка надає "
+"функції plpgsql для роботи з результатами ST_AsSVG."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.4.0 to support all curve types"
+msgstr "Покращено: 3.4.0 для підтримки всіх типів кривих"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0 to use default args and support named args"
+msgstr ""
+"Змінено: 2.0.0 для використання аргументів за замовчуванням та підтримки "
+"іменованих аргументів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.2.2. Availability: 1.4.0 Changed in PostGIS 1.4.0 to include "
+"L command in absolute path to conform to <link xlink:href=\"http://www.w3."
+"org/TR/SVG/paths.html#PathDataBNF\">http://www.w3.org/TR/SVG/paths."
+"html#PathDataBNF</link>"
+msgstr ""
+"Доступність: 1.2.2. Доступність: 1.4.0 Змінено в PostGIS 1.4.0, щоб включити "
+"команду L в абсолютний шлях для відповідності <link xlink:href=\"http://www.w3"
+".org/TR/SVG/paths.html#PathDataBNF\">http://www.w3.org/TR/SVG/paths."
+"html#PathDataBNF</link>"
+
+#. Tag: para
+#, no-c-format
+msgid "Circular string"
+msgstr "Circular string"
+
+#. Tag: para
+#, no-c-format
+msgid "Multi-curve"
+msgstr "Multi-curve"
+
+#. Tag: para
+#, no-c-format
+msgid "Multi-surface"
+msgstr "Multi-surface"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the geometry as TWKB, aka \"Tiny Well-Known Binary\""
+msgstr ""
+"Повертає геометрію у вигляді TWKB, також відомого як \"Tiny Well-Known Binary\""
+" (маленький добре відомий двійковий файл)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the geometry in TWKB (Tiny Well-Known Binary) format. TWKB is a "
+"<link xlink:href=\"https://github.com/TWKB/Specification/blob/master/twkb."
+"md\">compressed binary format</link> with a focus on minimizing the size of "
+"the output."
+msgstr ""
+"Повертає геометрію у форматі TWKB (Tiny Well-Known Binary). TWKB — це <link "
+"xlink:href=\"https://github.com/TWKB/Specification/blob/master/twkb.md\""
+">стислий двійковий формат</link>, орієнтований на мінімізацію розміру "
+"вихідних даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The decimal digits parameters control how much precision is stored in the "
+"output. By default, values are rounded to the nearest unit before encoding. "
+"If you want to transfer more precision, increase the number. For example, a "
+"value of 1 implies that the first digit to the right of the decimal point "
+"will be preserved."
+msgstr ""
+"Параметри десяткових цифр контролюють точність збереження даних у вихідних "
+"даних. За замовчуванням значення округлюються до найближчої одиниці перед "
+"кодуванням. Якщо потрібно передати більш точні дані, збільште це число. "
+"Наприклад, значення 1 означає, що перша цифра праворуч від десяткової крапки "
+"буде збережена."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The sizes and bounding boxes parameters control whether optional information "
+"about the encoded length of the object and the bounds of the object are "
+"included in the output. By default they are not. Do not turn them on unless "
+"your client software has a use for them, as they just use up space (and "
+"saving space is the point of TWKB)."
+msgstr ""
+"Параметри розмірів та обмежувальних рамок визначають, чи буде у вихідні дані "
+"включена додаткова інформація про довжину кодованого об'єкта та межі "
+"об'єкта. За замовчуванням вони не включені. Не вмикайте їх, якщо ваше "
+"програмне забезпечення не використовує їх, оскільки вони лише займають місце "
+"(а економія місця є метою TWKB)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The array-input form of the function is used to convert a collection of "
+"geometries and unique identifiers into a TWKB collection that preserves the "
+"identifiers. This is useful for clients that expect to unpack a collection "
+"and then access further information about the objects inside. You can create "
+"the arrays using the <link xlink:href=\"https://www.postgresql.org/docs/"
+"current/functions-aggregate.html\">array_agg</link> function. The other "
+"parameters operate the same as for the simple form of the function."
+msgstr ""
+"Форма функції з вхідним масивом використовується для перетворення набору "
+"геометрій та унікальних ідентифікаторів у набір TWKB, який зберігає "
+"ідентифікатори. Це корисно для клієнтів, які хочуть розпакувати набір, а "
+"потім отримати доступ до додаткової інформації про об'єкти всередині. Масиви "
+"можна створити за допомогою функції <link xlink:href=\"https://www.postgresql."
+"org/docs/current/functions-aggregate.html\">array_agg</link>. Інші параметри "
+"працюють так само, як і для простої форми функції."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The format specification is available online at <link xlink:href=\"https://"
+"github.com/TWKB/Specification\">https://github.com/TWKB/Specification</"
+"link>, and code for building a JavaScript client can be found at <link xlink:"
+"href=\"https://github.com/TWKB/twkb.js\">https://github.com/TWKB/twkb.js</"
+"link>."
+msgstr ""
+"Специфікація формату доступна в Інтернеті за адресою <link "
+"xlink:href=\"https://github.com/TWKB/Specification\">https://github.com/TWKB/"
+"Specification</link>, а код для створення клієнта JavaScript можна знайти за "
+"адресою <link xlink:href=\"https://github.com/TWKB/twkb.js\">https://github."
+"com/TWKB/twkb.js</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.4.0 memory and speed improvements."
+msgstr "Покращено: 2.4.0 покращення пам'яті та швидкості."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To create an aggregate TWKB object including identifiers aggregate the "
+"desired geometries and objects first, using \"array_agg()\", then call the "
+"appropriate TWKB function."
+msgstr ""
+"Щоб створити агрегований об'єкт TWKB, що містить ідентифікатори, спочатку "
+"агрегуйте потрібні геометрії та об'єкти за допомогою функції \"array_agg()\", "
+"а потім викличте відповідну функцію TWKB."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsBinary\"/>, <xref linkend=\"ST_AsEWKB\"/>, <xref "
+"linkend=\"ST_AsEWKT\"/>, <xref linkend=\"ST_GeomFromText\"/>"
+msgstr ""
+", <xref linkend=\"ST_AsBinary\"/>, <xref linkend=\"ST_AsEWKB\"/>, <xref "
+"linkend=\"ST_AsEWKT\"/>, <xref linkend=\"ST_GeomFromText\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a Geometry in X3D xml node element format: ISO-IEC-19776-1.2-"
+"X3DEncodings-XML"
+msgstr ""
+"Повертає геометрію у форматі елемента вузла X3D xml: ISO-IEC-19776-1.2"
+"-X3DEncodings-XML"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry as an X3D xml formatted node element <link xlink:"
+"href=\"http://www.web3d.org/standards/number/19776-1\">http://www.web3d.org/"
+"standards/number/19776-1</link>. If <varname>maxdecimaldigits</varname> "
+"(precision) is not specified then defaults to 15."
+msgstr ""
+"Повертає геометрію у вигляді елемента вузла у форматі X3D xml <link "
+"xlink:href=\"http://www.web3d.org/standards/number/19776-1\">http://www.web3d."
+"org/standards/number/19776-1</link>. Якщо <varname>maxdecimaldigits</"
+"varname> (точність) не вказано, то за замовчуванням використовується "
+"значення 15."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are various options for translating PostGIS geometries to X3D since "
+"X3D geometry types don't map directly to PostGIS geometry types and some "
+"newer X3D types that might be better mappings we have avoided since most "
+"rendering tools don't currently support them. These are the mappings we have "
+"settled on. Feel free to post a bug ticket if you have thoughts on the idea "
+"or ways we can allow people to denote their preferred mappings."
+msgstr ""
+"Існують різні варіанти перетворення геометрії PostGIS у X3D, оскільки типи "
+"геометрії X3D не відповідають безпосередньо типам геометрії PostGIS, а деякі "
+"новіші типи X3D, які можуть бути кращими відповідниками, ми уникнули, "
+"оскільки більшість інструментів візуалізації наразі їх не підтримують. Ось "
+"відповідники, на яких ми зупинилися. Якщо у вас є думки щодо цієї ідеї або "
+"способів, як ми можемо дозволити користувачам вказувати свої бажані "
+"відповідники, будь ласка, повідомте нам про це."
+
+#. Tag: para
+#, no-c-format
+msgid "Below is how we currently map PostGIS 2D/3D types to X3D types"
+msgstr "Нижче наведено, як ми наразі відображаємо типи PostGIS 2D/3D у типи X3D"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The 'options' argument is a bitfield. For PostGIS 2.2+, this is used to "
+"denote whether to represent coordinates with X3D GeoCoordinates Geospatial "
+"node and also whether to flip the x/y axis. By default, <code>ST_AsX3D</"
+"code> outputs in database form (long,lat or X,Y), but X3D default of lat/"
+"lon, y/x may be preferred."
+msgstr ""
+"Аргумент \"options\" є бітовим полем. У PostGIS 2.2+ він використовується для "
+"позначення того, чи слід представляти координати за допомогою "
+"геопросторового вузла X3D GeoCoordinates, а також чи слід міняти осі x/y. За "
+"замовчуванням <code>ST_AsX3D</code> виводить дані у формі бази даних ("
+"long,lat або X,Y), але може бути краще використовувати стандартні для X3D "
+"значення lat/lon, y/x."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"0: X/Y in database order (e.g. long/lat = X,Y is standard database order), "
+"default value, and non-spatial coordinates (just regular old Coordinate tag)."
+msgstr ""
+"0: X/Y у порядку бази даних (наприклад, long/lat = X,Y є стандартним "
+"порядком бази даних), значення за замовчуванням та непросторові координати ("
+"просто звичайний старий тег Coordinate)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"1: Flip X and Y. If used in conjunction with the GeoCoordinate option "
+"switch, then output will be default \"latitude_first\" and coordinates will "
+"be flipped as well."
+msgstr ""
+"1: Перевернути X і Y. Якщо використовується разом з опцією GeoCoordinate, то "
+"вихідні дані будуть за замовчуванням \"latitude_first\", а координати також "
+"будуть перевернуті."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"2: Output coordinates in GeoSpatial GeoCoordinates. This option will throw "
+"an error if geometries are not in WGS 84 long lat (srid: 4326). This is "
+"currently the only GeoCoordinate type supported. <link xlink:href=\"http://"
+"www.web3d.org/documents/specifications/19775-1/V3.2/Part01/components/"
+"geodata.html#Specifyingaspatialreference\">Refer to X3D specs specifying a "
+"spatial reference system.</link>. Default output will be <code>GeoCoordinate "
+"geoSystem='\"GD\" \"WE\" \"longitude_first\"'</code>. If you prefer the X3D "
+"default of <code>GeoCoordinate geoSystem='\"GD\" \"WE\" \"latitude_first\"'</"
+"code> use <code>(2 + 1)</code> = <code>3</code>"
+msgstr ""
+"2: Вивести координати в GeoSpatial GeoCoordinates. Ця опція видасть помилку, "
+"якщо геометрії не відповідають WGS 84 long lat (srid: 4326). Наразі це "
+"єдиний підтримуваний тип GeoCoordinate. <link xlink:href=\"http://www.web3d."
+"org/documents/specifications/19775-1/V3.2/Part01/components/geodata."
+"html#Specifyingaspatialreference\">Дивіться специфікації X3D, що визначають "
+"систему просторових координат.</link>. Стандартним результатом буде "
+"<code>GeoCoordinate geoSystem=“\"GD\" \"WE\" \"longitude_first\"”</code>. Якщо ви "
+"віддаєте перевагу стандартному для X3D <code>GeoCoordinate geoSystem=“\"GD\" "
+"“WE” \"latitude_first\"”</code>, використовуйте <code>(2 + 1)</code> = "
+"<code>3</code>."
+
+#. Tag: entry
+#, no-c-format
+msgid "PostGIS Type"
+msgstr "Тип PostGIS"
+
+#. Tag: entry
+#, no-c-format
+msgid "2D X3D Type"
+msgstr "2D X3D Тип"
+
+#. Tag: entry
+#, no-c-format
+msgid "3D X3D Type"
+msgstr "Тип 3D X3D"
+
+#. Tag: entry
+#, no-c-format
+msgid "LINESTRING"
+msgstr "LINESTRING"
+
+#. Tag: entry
+#, no-c-format
+msgid "not yet implemented - will be PolyLine2D"
+msgstr "ще не реалізовано - буде PolyLine2D"
+
+#. Tag: entry
+#, no-c-format
+msgid "LineSet"
+msgstr "LineSet"
+
+#. Tag: entry
+#, no-c-format
+msgid "MULTILINESTRING"
+msgstr "MULTILINESTRING"
+
+#. Tag: entry
+#, no-c-format
+msgid "IndexedLineSet"
+msgstr "IndexedLineSet"
+
+#. Tag: entry
+#, no-c-format
+msgid "MULTIPOINT"
+msgstr "MULTIPOINT"
+
+#. Tag: entry
+#, no-c-format
+msgid "Polypoint2D"
+msgstr "Polypoint2D"
+
+#. Tag: entry
+#, no-c-format
+msgid "PointSet"
+msgstr "PointSet"
+
+#. Tag: entry
+#, no-c-format
+msgid "POINT"
+msgstr "POINT"
+
+#. Tag: entry
+#, no-c-format
+msgid "outputs the space delimited coordinates"
+msgstr "виводить координати, розділені пробілами"
+
+#. Tag: entry
+#, no-c-format
+msgid "(MULTI) POLYGON, POLYHEDRALSURFACE"
+msgstr "(MULTI) POLYGON, POLYHEDRALSURFACE"
+
+#. Tag: entry
+#, no-c-format
+msgid "Invalid X3D markup"
+msgstr "Недійсна розмітка X3D"
+
+#. Tag: entry
+#, no-c-format
+msgid "IndexedFaceSet (inner rings currently output as another faceset)"
+msgstr ""
+"IndexedFaceSet (внутрішні кільця наразі виводяться як інший набір облич)"
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>TIN</entry>"
+msgstr "<entry>TIN</entry>"
+
+#. Tag: entry
+#, no-c-format
+msgid "TriangleSet2D (Not Yet Implemented)"
+msgstr "TriangleSet2D (ще не реалізовано)"
+
+#. Tag: entry
+#, no-c-format
+msgid "IndexedTriangleSet"
+msgstr "IndexedTriangleSet"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"2D geometry support not yet complete. Inner rings currently just drawn as "
+"separate polygons. We are working on these."
+msgstr ""
+"Підтримка 2D-геометрії ще не завершена. Внутрішні кільця наразі малюються як "
+"окремі полігони. Ми працюємо над цим."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Lots of advancements happening in 3D space particularly with <link xlink:"
+"href=\"https://www.web3d.org/wiki/index.php/X3D_and_HTML5\">X3D Integration "
+"with HTML5</link>"
+msgstr ""
+"У 3D-просторі відбувається багато прогресивних змін, особливо в області "
+"<link xlink:href=\"https://www.web3d.org/wiki/index.php/X3D_and_HTML5\""
+">інтеграції X3D з HTML5</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There is also a nice open source X3D viewer you can use to view rendered "
+"geometries. Free Wrl <link xlink:href=\"http://freewrl.sourceforge.net/"
+"\">http://freewrl.sourceforge.net/</link> binaries available for Mac, Linux, "
+"and Windows. Use the FreeWRL_Launcher packaged to view the geometries."
+msgstr ""
+"Також є гарний відкритий X3D-переглядач, який можна використовувати для "
+"перегляду відтворених геометрій. Безкоштовні бінарні файли Free Wrl <link "
+"xlink:href=\"http://freewrl.sourceforge.net/\">http://freewrl.sourceforge.net/"
+"</link> доступні для Mac, Linux та Windows. Для перегляду геометрій "
+"використовуйте пакет FreeWRL_Launcher."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Also check out <link xlink:href=\"https://git.osgeo.org/gitea/robe/"
+"postgis_x3d_viewer\">PostGIS minimalist X3D viewer</link> that utilizes this "
+"function and <link xlink:href=\"http://www.x3dom.org/\">x3dDom html/js open "
+"source toolkit</link>."
+msgstr ""
+"Також зверніть увагу на <link xlink:href=\"https://git.osgeo.org/gitea/robe/"
+"postgis_x3d_viewer\">мінімалістичний переглядач PostGIS X3D</link>, який "
+"використовує цю функцію, та <link xlink:href=\"http://www.x3dom.org/\""
+">відкритий набір інструментів x3dDom html/js</link>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0: ISO-IEC-19776-1.2-X3DEncodings-XML"
+msgstr "Доступність: 2.0.0: ISO-IEC-19776-1.2-X3DEncodings-XML"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.2.0: Support for GeoCoordinates and axis (x/y, long/lat) "
+"flipping. Look at options for details."
+msgstr ""
+"Покращено: 2.2.0: Підтримка геокоординат та перевертання осей (x/y, long/lat)"
+". Детальніше дивіться в налаштуваннях."
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"Example: Create a fully functional X3D document - This will generate a cube "
+"that is viewable in FreeWrl and other X3D viewers."
+msgstr ""
+"Приклад: Створити повністю функціональний документ X3D - Це створить куб, "
+"який можна переглянути в FreeWrl та інших переглядачах X3D."
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS buildings"
+msgstr "PostGIS будівлі"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Copy and paste the output of this query to <link xlink:href=\"http://postgis."
+"net/docs/support/viewers/x3d_viewer.htm\">x3d scene viewer</link> and click "
+"Show"
+msgstr ""
+"Скопіюйте та вставте результат цього запиту в <link "
+"xlink:href=\"http://postgis.net/docs/support/viewers/x3d_viewer.htm\">x3d "
+"scene viewer</link> і натисніть Show (Показати)"
+
+#. Tag: para
+#, no-c-format
+msgid "Buildings formed by subdividing PostGIS and extrusion"
+msgstr "Будівлі, утворені шляхом поділу PostGIS та екструзії"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: An Octagon elevated 3 Units and decimal precision of 6"
+msgstr "Приклад: Восьмикутник, піднятий на 3 одиниці, з десятковою точністю 6"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: TIN"
+msgstr "Приклад: TIN"
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Closed multilinestring (the boundary of a polygon with holes)"
+msgstr "Приклад: Замкнута багатолінійна (межа полігону з отворами)"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a GeoHash representation of the geometry."
+msgstr "Повернути представлення геометрії у форматі GeoHash."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"Geohash\">GeoHash</link> representation of a geometry. A GeoHash encodes a "
+"geographic Point into a text form that is sortable and searchable based on "
+"prefixing. A shorter GeoHash is a less precise representation of a point. It "
+"can be thought of as a box that contains the point."
+msgstr ""
+"Обчислює <link xlink:href=\"http://en.wikipedia.org/wiki/Geohash\">GeoHash</"
+"link> представлення геометрії. GeoHash кодує географічну точку в текстову "
+"форму, яку можна сортувати та шукати за префіксом. Коротший GeoHash є менш "
+"точним представленням точки. Його можна уявити як прямокутник, що містить "
+"точку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Non-point geometry values with non-zero extent can also be mapped to GeoHash "
+"codes. The precision of the code depends on the geographic extent of the "
+"geometry."
+msgstr ""
+"Значення геометрії, що не є точками, з ненульовим розміром також можна "
+"відобразити у кодах GeoHash. Точність коду залежить від географічного "
+"розміру геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>maxchars</varname> is not specified, the returned GeoHash code "
+"is for the smallest cell containing the input geometry. Points return a "
+"GeoHash with 20 characters of precision (about enough to hold the full "
+"double precision of the input). Other geometric types may return a GeoHash "
+"with less precision, depending on the extent of the geometry. Larger "
+"geometries are represented with less precision, smaller ones with more "
+"precision. The box determined by the GeoHash code always contains the input "
+"feature."
+msgstr ""
+"Якщо <varname>maxchars</varname> не вказано, повертається код GeoHash для "
+"найменшої комірки, що містить вхідну геометрію. Точки повертають GeoHash з "
+"точністю 20 символів (це приблизно достатньо для повної подвійної точності "
+"вхідних даних). Інші геометричні типи можуть повертати GeoHash з меншою "
+"точністю, залежно від розміру геометрії. Більші геометрії представлені з "
+"меншою точністю, менші — з більшою. Коробка, визначена кодом GeoHash, завжди "
+"містить вхідний об'єкт."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>maxchars</varname> is specified the returned GeoHash code has at "
+"most that many characters. It maps to a (possibly) lower precision "
+"representation of the input geometry. For non-points, the starting point of "
+"the calculation is the center of the bounding box of the geometry."
+msgstr ""
+"Якщо вказано <varname>maxchars</varname>, то повернений код GeoHash має не "
+"більше цього значення символів. Він відображається на (можливо) менш точне "
+"представлення вхідної геометрії. Для не точкових об'єктів початковою точкою "
+"обчислення є центр обмежувальної рамки геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_GeoHash requires input geometry to be in geographic (lon/lat) coordinates."
+msgstr ""
+"ST_GeoHash вимагає, щоб вхідні геометричні дані були в географічних "
+"координатах (довгота/широта)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_PointFromGeoHash\"/>, <xref "
+"linkend=\"ST_Box2dFromGeoHash\"/>"
+msgstr ""
+", <xref linkend=\"ST_PointFromGeoHash\"/>, <xref linkend="
+"\"ST_Box2dFromGeoHash\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Overlay Functions"
+msgstr "Функції накладання"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions compute results arising from the overlay of two geometries. "
+"These are also known as point-set theoretic boolean operations. Some related "
+"functions are also provided."
+msgstr ""
+"Ці функції обчислюють результати, що виникають при накладенні двох "
+"геометрій. Вони також відомі як булеві операції теорії множин точок. Також "
+"надаються деякі пов'язані функції."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the portion of a geometry falling within a rectangle."
+msgstr "Обчислює частину геометрії, що потрапляє в прямокутник."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Clips a geometry by a 2D box in a fast and tolerant but possibly invalid "
+"way. Topologically invalid input geometries do not result in exceptions "
+"being thrown. The output geometry is not guaranteed to be valid (in "
+"particular, self-intersections for a polygon may be introduced)."
+msgstr ""
+"Обрізає геометрію за допомогою 2D-коробки швидким і толерантним, але, "
+"можливо, некоректним способом. Топологічно некоректні вхідні геометрії не "
+"призводять до виникнення виняткових ситуацій. Не гарантується коректність "
+"вихідної геометрії (зокрема, можуть виникнути самоперетини для полігону)."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_MakeBox2D\"/>, <xref linkend=\"ST_MakeEnvelope\"/>"
+msgstr ", <xref linkend=\"ST_MakeBox2D\"/>, <xref linkend=\"ST_MakeEnvelope\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a geometry representing the part of geometry A that does not "
+"intersect geometry B."
+msgstr ""
+"Обчислює геометрію, що представляє частину геометрії A, яка не перетинається "
+"з геометрією B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry representing the part of geometry A that does not "
+"intersect geometry B. This is equivalent to <code>A - ST_Intersection(A,B)</"
+"code>. If A is completely contained in B then an empty atomic geometry of "
+"appropriate type is returned."
+msgstr ""
+"Повертає геометрію, що представляє частину геометрії A, яка не перетинається "
+"з геометрією B. Це еквівалентно <code>A - ST_Intersection(A,B)</code>. Якщо "
+"A повністю міститься в B, то повертається порожня атомарна геометрія "
+"відповідного типу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is the only overlay function where input order matters. "
+"ST_Difference(A, B) always returns a portion of A."
+msgstr ""
+"Це єдина функція накладання, де порядок введення має значення. ST_Difference("
+"A, B) завжди повертає частину A."
+
+#. Tag: refsection
+#, no-c-format
+msgid "&overlay_gridsize_arg;"
+msgstr "&overlay_gridsize_arg;"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.1.0 accept a gridSize parameter."
+msgstr "Покращено: 3.1.0 приймає параметр gridSize."
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.9.0 to use the gridSize parameter."
+msgstr "Для використання параметра gridSize необхідна версія GEOS >= 3.9.0."
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.1.3"
+msgstr "&sfs_compliant; s2.1.1.3"
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.20"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.20"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&Z_support; However, the result is computed using XY only. The result Z "
+"values are copied, averaged or interpolated."
+msgstr ""
+"&Z_support; Однак результат обчислюється тільки за допомогою XY. Значення "
+"результату Z копіюються, усереднюються або інтерполюються."
+
+#. Tag: para
+#, no-c-format
+msgid "The input linestrings"
+msgstr "Вхідні ліній"
+
+#. Tag: para
+#, no-c-format
+msgid "The difference of the two linestrings"
+msgstr "Різниця між двома рядками"
+
+#. Tag: para
+#, no-c-format
+msgid "The difference of 2D linestrings."
+msgstr "Різниця між 2D лініями."
+
+#. Tag: para
+#, no-c-format
+msgid "The difference of 3D points."
+msgstr "Різниця між 3D-точками."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Intersection\"/>, <xref linkend=\"ST_Union\"/>, <xref "
+"linkend=\"ST_ReducePrecision\"/>"
+msgstr ""
+", <xref linkend=\"ST_Intersection\"/>, <xref linkend=\"ST_Union\"/>, <xref "
+"linkend=\"ST_ReducePrecision\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a geometry representing the shared portion of geometries A and B."
+msgstr "Обчислює геометрію, що представляє спільну частину геометрій A і B."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry representing the point-set intersection of two "
+"geometries. In other words, that portion of geometry A and geometry B that "
+"is shared between the two geometries."
+msgstr ""
+"Повертає геометрію, що представляє перетин двох геометрій. Іншими словами, "
+"це та частина геометрії A і геометрії B, яка є спільною для обох геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the geometries have no points in common (i.e. are disjoint) then an empty "
+"atomic geometry of appropriate type is returned."
+msgstr ""
+"Якщо геометрії не мають спільних точок (тобто є роз'єднаними), то "
+"повертається порожня атомарна геометрія відповідного типу."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Intersection in conjunction with <xref linkend=\"ST_Intersects\"/> is "
+"useful for clipping geometries such as in bounding box, buffer, or region "
+"queries where you only require the portion of a geometry that is inside a "
+"country or region of interest."
+msgstr ""
+"ST_Intersection у поєднанні з <xref linkend=\"ST_Intersects\"/> корисний для "
+"обрізання геометрій, наприклад, у запитах на обмежувальну рамку, буфер або "
+"регіон, де потрібна лише частина геометрії, що знаходиться всередині країни "
+"або регіону, що цікавить."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&geography_transform; It first determines the best SRID that fits the "
+"bounding box of the 2 geography objects (if geography objects are within one "
+"half zone UTM but not same UTM will pick one of those) (favoring UTM or "
+"Lambert Azimuthal Equal Area (LAEA) north/south pole, and falling back on "
+"mercator in worst case scenario) and then intersection in that best fit "
+"planar spatial ref and retransforms back to WGS84 geography."
+msgstr ""
+"&geography_transform; Спочатку визначається найкращий SRID, який відповідає "
+"обмежувальній рамці 2 географічних об'єктів (якщо географічні об'єкти "
+"знаходяться в межах однієї половини зони UTM, але не в одній і тій же UTM, "
+"вибирається одна з них) (віддаючи перевагу UTM або Ламберту Азимутальному "
+"рівновеликому (LAEA) північному/південному полюсу, а в найгіршому випадку "
+"використовуючи проекцію Меркатора), а потім перетинається в найкращому "
+"плоскому просторовому відліку і перетворюється назад в географію WGS84."
+
+#. Tag: para
+#, no-c-format
+msgid "This function will drop the M coordinate values if present."
+msgstr "Ця функція видалить значення координати M, якщо вони присутні."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If working with 3D geometries, you may want to use SFGCAL based <xref "
+"linkend=\"ST_3DIntersection\"/> which does a proper 3D intersection for 3D "
+"geometries. Although this function works with Z-coordinate, it does an "
+"averaging of Z-Coordinate."
+msgstr ""
+"<xref linkend=\"ST_3DIntersection\"/> яка виконує правильне 3D перетин для "
+"3D геометрій. Хоча ця функція працює з Z-координатами, вона виконує "
+"усереднення Z-координат."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.1.0 accept a gridSize parameter"
+msgstr "Покращено: 3.1.0 приймає параметр gridSize"
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.9.0 to use the gridSize parameter"
+msgstr "Для використання параметра gridSize необхідна версія GEOS >= 3.9.0"
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 does not depend on SFCGAL."
+msgstr "Змінено: 3.0.0 не залежить від SFCGAL."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5 support for geography data type was introduced."
+msgstr "Доступність: 1.5 додано підтримку типу даних географії."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.18"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.18"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Clip all lines (trails) by country. Here we assume country geom are POLYGON "
+"or MULTIPOLYGONS. NOTE: we are only keeping intersections that result in a "
+"LINESTRING or MULTILINESTRING because we don't care about trails that just "
+"share a point. The dump is needed to expand a geometry collection into "
+"individual single MULT* parts. The below is fairly generic and will work for "
+"polys, etc. by just changing the where clause."
+msgstr ""
+"Виріжте всі лінії (треки) за країною. Тут ми припускаємо, що геометрія "
+"країни є POLYGON або MULTIPOLYGONS. ПРИМІТКА: ми зберігаємо тільки перетини, "
+"які утворюють LINESTRING або MULTILINESTRING, оскільки нас не цікавлять "
+"траси, які просто мають спільну точку. Дамп необхідний для розширення "
+"колекції геометрії в окремі частини MULT*. Нижче наведено досить загальний "
+"приклад, який підійде для полігонів тощо, якщо змінити умову where."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For polys e.g. polygon landmarks, you can also use the sometimes faster hack "
+"that buffering anything by 0.0 except a polygon results in an empty geometry "
+"collection. (So a geometry collection containing polys, lines and points "
+"buffered by 0.0 would only leave the polygons and dissolve the collection "
+"shell.)"
+msgstr ""
+"Для полігонів, наприклад, орієнтирів полігону, ви також можете "
+"використовувати іноді швидший хак, який буферизує все, крім полігону, на "
+"0,0, що призводить до порожньої колекції геометрії. (Таким чином, колекція "
+"геометрії, що містить полігони, лінії та точки, буферизовані на 0,0, "
+"залишить тільки полігони і розчиниться оболонку колекції.)"
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: 2.5Dish"
+msgstr "Приклади: 2.5D"
+
+#. Tag: para
+#, fuzzy, no-c-format
+msgid ""
+"Note this is not a true intersection, compare to the same example using "
+"<xref linkend=\"ST_3DIntersection\"/>."
+msgstr "Приклади: 2.5D"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Difference\"/>, <xref linkend=\"ST_Union\"/>, <xref "
+"linkend=\"ST_ClipByBox2D\"/>, <xref linkend=\"ST_Dimension\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_Force2D\"/>, <xref "
+"linkend=\"ST_SymDifference\"/>, <xref linkend=\"ST_Intersects\"/>, <xref "
+"linkend=\"ST_Multi\"/>, <xref linkend=\"ST_ReducePrecision\"/>"
+msgstr ""
+", <xref linkend=\"ST_Difference\"/>, <xref linkend=\"ST_Union\"/>, <xref "
+"linkend=\"ST_ClipByBox2D\"/>, <xref linkend=\"ST_Dimension\"/>, <xref "
+"linkend=\"ST_Dump\"/>, <xref linkend=\"ST_Force2D\"/>, <xref linkend="
+"\"ST_SymDifference\"/>, <xref linkend=\"ST_Intersects\"/>, <xref linkend="
+"\"ST_Multi\"/>, <xref linkend=\"ST_ReducePrecision\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Aggregate function which unions geometries in a memory-efficent but slower "
+"way"
+msgstr ""
+"Агрегатна функція, яка об'єднує геометрії в пам'яті ефективним, але "
+"повільнішим способом."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An aggregate function that unions the input geometries, merging them to "
+"produce a result geometry with no overlaps. The output may be a single "
+"geometry, a MultiGeometry, or a Geometry Collection."
+msgstr ""
+"Агрегатна функція, яка об'єднує вхідні геометрії, зливаючи їх для отримання "
+"геометрії результату без перекриттів. Результатом може бути одна геометрія, "
+"MultiGeometry або Geometry Collection."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Produces the same result as <xref linkend=\"ST_Union\"/>, but uses less "
+"memory and more processor time. This aggregate function works by unioning "
+"the geometries incrementally, as opposed to the ST_Union aggregate which "
+"first accumulates an array and then unions the contents using a fast "
+"algorithm."
+msgstr ""
+"Дає той самий результат, що й <xref linkend=\"ST_Union\"/>, але використовує "
+"менше пам'яті та більше процесорного часу. Ця агрегатна функція працює "
+"шляхом послідовного об'єднання геометрій, на відміну від агрегату ST_Union, "
+"який спочатку накопичує масив, а потім об'єднує вміст за допомогою швидкого "
+"алгоритму."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Nodes a collection of lines."
+msgstr "Вузли — сукупність ліній."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a (Multi)LineString representing the fully noded version of a "
+"collection of linestrings. The noding preserves all of the input nodes, and "
+"introduces the least possible number of new nodes. The resulting linework is "
+"dissolved (duplicate lines are removed)."
+msgstr ""
+"Повертає (Multi)LineString, що представляє повністю вузлову версію колекції "
+"лінійних рядків. Вузли зберігають усі вхідні вузли та вводять мінімально "
+"можливу кількість нових вузлів. Результуюча лінія розчиняється (дублі ліній "
+"видаляються)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a good way to create fully-noded linework suitable for use as input "
+"to <xref linkend=\"ST_Polygonize\"/>."
+msgstr ""
+"Це хороший спосіб створити повністю вузлові лінії, які можна використовувати "
+"як вхідні дані для <xref linkend=\"ST_Polygonize\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"can also be used to node and dissolve linework. It provides an option to "
+"specify a gridSize, which can provide simpler and more robust output. See "
+"also <xref linkend=\"ST_Union\"/> for an aggregate variant."
+msgstr ""
+"також може використовуватися для з'єднання та роз'єднання ліній. Він надає "
+"можливість вказати розмір сітки gridSize, що дозволяє отримати простіший та "
+"надійніший результат. Див. також <xref linkend=\"ST_Union\"/>для "
+"агрегованого варіанту."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.4.0 this function uses GEOSNode internally instead of "
+"GEOSUnaryUnion. This may cause the resulting linestrings to have a different "
+"order and direction compared to PostGIS < 2.4."
+msgstr ""
+"Змінено: 2.4.0 ця функція використовує GEOSNode внутрішньо замість "
+"GEOSUnaryUnion. Це може призвести до того, що отримані лінійні рядки "
+"матимуть інший порядок і напрямок порівняно з PostGIS < 2.4."
+
+#. Tag: para
+#, no-c-format
+msgid "Noding a 3D LineString which self-intersects"
+msgstr "Вузли 3D-лінії, що перетинається сама з собою"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Noding two LineStrings which share common linework. Note that the result "
+"linework is dissolved."
+msgstr ""
+"З'єднання двох лінійних об'єктів, які мають спільні лінії. Зверніть увагу, "
+"що лінія результату розчиняється."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a collection of geometries created by splitting a geometry by "
+"another geometry."
+msgstr ""
+"Повертає колекцію геометрій, створених шляхом розділення однієї геометрії "
+"іншою геометрією."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function supports splitting a LineString by a (Multi)Point, "
+"(Multi)LineString or (Multi)Polygon boundary, or a (Multi)Polygon by a "
+"LineString. When a (Multi)Polygon is used as as the blade, its linear "
+"components (the boundary) are used for splitting the input. The result "
+"geometry is always a collection."
+msgstr ""
+"Функція підтримує розділення LineString за межею (Multi)Point, (Multi)"
+"LineString або (Multi)Polygon, або (Multi)Polygon за LineString. Коли (Multi)"
+"Polygon використовується як лезо, його лінійні компоненти (межа) "
+"використовуються для розділення вхідних даних. Результуюча геометрія завжди "
+"є колекцією."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is in a sense the opposite of <xref linkend=\"ST_Union\"/>. "
+"Applying ST_Union to the returned collection should theoretically yield the "
+"original geometry (although due to numerical rounding this may not be "
+"exactly the case)."
+msgstr ""
+"Ця функція в певному сенсі є протилежною до <xref linkend=\"ST_Union\"/>. "
+"Застосування ST_Union до повернутої колекції теоретично повинно дати вихідну "
+"геометрію (хоча через числове округлення це може бути не зовсім так)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the the input and blade do not intersect due to numerical precision "
+"issues, the input may not be split as expected. To avoid this situation it "
+"may be necessary to snap the input to the blade first, using <xref "
+"linkend=\"ST_Snap\"/> with a small tolerance."
+msgstr ""
+"Якщо вхідні дані та лезо не перетинаються через проблеми з числовою "
+"точністю, вхідні дані можуть не розділитися як очікується. Щоб уникнути "
+"такої ситуації, може бути необхідним спочатку прив'язати вхідні дані до леза "
+"за допомогою <xref linkend=\"ST_Snap\"/> з невеликим допуском."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0 requires GEOS"
+msgstr "Доступність: 2.0.0 вимагає GEOS"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.2.0 support for splitting a line by a multiline, a multipoint or "
+"(multi)polygon boundary was introduced."
+msgstr ""
+"Покращено: 2.2.0 додано підтримку розділення лінії мультилінією, "
+"мультиточкою або (мульти)полігоном."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.5.0 support for splitting a polygon by a multiline was "
+"introduced."
+msgstr "Покращено: 2.5.0 додано підтримку розділення полігону мультилінією."
+
+#. Tag: para
+#, no-c-format
+msgid "Split a Polygon by a Line."
+msgstr "Розділити полігон лінією."
+
+#. Tag: para
+#, no-c-format
+msgid "Before Split"
+msgstr "До розділення"
+
+#. Tag: para
+#, no-c-format
+msgid "After split"
+msgstr "Після розділення"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Split a MultiLineString by a Point, where the point lies exactly on both "
+"LineStrings elements."
+msgstr ""
+"Розділити MultiLineString за точкою, яка лежить точно на обох елементах "
+"LineStrings."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Split a LineString by a Point, where the point does not lie exactly on the "
+"line. Shows using <xref linkend=\"ST_Snap\"/> to snap the line to the point "
+"to allow it to be split."
+msgstr ""
+"Розділити лінію String за точкою, яка не лежить точно на лінії. Показано за "
+"допомогою <xref linkend=\"ST_Snap\"/>, щоб прив'язати лінію до точки, щоб її "
+"можна було розділити."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes a rectilinear subdivision of a geometry."
+msgstr "Обчислює прямолінійний поділ геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of geometries that are the result of dividing <varname>geom</"
+"varname> into parts using rectilinear lines, with each part containing no "
+"more than <code>max_vertices</code>."
+msgstr ""
+"Повертає набір геометрій, які є результатом поділу <varname>geom</varname> "
+"на частини за допомогою прямолінійних ліній, причому кожна частина містить "
+"не більше ніж <code>max_vertices</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>max_vertices</code> must be 5 or more, as 5 points are needed to "
+"represent a closed box."
+msgstr ""
+"<code>max_vertices</code> має бути 5 або більше, оскільки для зображення "
+"закритого прямокутника потрібно 5 точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Point-in-polygon and other spatial operations are normally faster for "
+"indexed subdivided datasets. Since the bounding boxes for the parts usually "
+"cover a smaller area than the original geometry bbox, index queries produce "
+"fewer \"hit\" cases. The \"hit\" cases are faster because the spatial "
+"operations executed by the index recheck process fewer points."
+msgstr ""
+"Операції типу \"точка в полігоні\" та інші просторові операції зазвичай "
+"виконуються швидше для індексованих підрозділених набори даних. Оскільки "
+"обмежувальні рамки для частин зазвичай охоплюють меншу площу, ніж "
+"оригінальна геометрія bbox, запити до індексу дають менше випадків \"влучання\""
+". Випадки \"влучання\" обробляються швидше, оскільки просторові операції, що "
+"виконуються індексом, перевіряють менше точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a <link xlink:href=\"https://www.postgresql.org/docs/current/queries-"
+"table-expressions.html#QUERIES-TABLEFUNCTIONS\">set-returning function</"
+"link> (SRF) that return a set of rows containing single geometry values. It "
+"can be used in a SELECT list or a FROM clause to produce a result set with "
+"one record for each result geometry."
+msgstr ""
+"Це <link xlink:href=\"https://www.postgresql.org/docs/current/queries-table-"
+"expressions.html#QUERIES-TABLEFUNCTIONS\">функція повернення набору</link> "
+"(SRF), яка повертає набір рядків, що містять окремі значення геометрії. Її "
+"можна використовувати в списку SELECT або в розділі FROM для створення "
+"набору результатів з одним записом для кожної геометрії результату."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.5.0 reuses existing points on polygon split, vertex count is "
+"lowered from 8 to 5."
+msgstr ""
+"Покращено: 2.5.0 повторно використовує існуючі точки при розділенні "
+"полігону, кількість вершин зменшено з 8 до 5."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Subdivide a polygon into parts "
+"with no more than 10 vertices, and assign each part a unique id."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Розділіть полігон на частини з "
+"не більше ніж 10 вершинами та присвойте кожній частині унікальний "
+"ідентифікатор."
+
+#. Tag: para
+#, no-c-format
+msgid "Subdivided to maximum 10 vertices"
+msgstr "Розділено на максимум 10 вершин"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Densify a long geography line "
+"using ST_Segmentize(geography, distance), and use ST_Subdivide to split the "
+"resulting line into sublines of 8 vertices."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Ущільніть довгу географічну "
+"лінію за допомогою ST_Segmentize(geography, distance) і використовуйте "
+"ST_Subdivide, щоб розділити отриману лінію на підлінії з 8 вершин."
+
+#. Tag: para
+#, no-c-format
+msgid "The densified and split lines."
+msgstr "Ущільнені та розділені лінії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Subdivide the complex geometries "
+"of a table in-place. The original geometry records are deleted from the "
+"source table, and new records for each subdivided result geometry are "
+"inserted."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Розділіть складні геометрії "
+"таблиці на місці. Оригінальні записи геометрії видаляються з вихідної "
+"таблиці, а нові записи для кожної розділеної геометрії результату "
+"вставляються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Create a new table containing "
+"subdivided geometries, retaining the key of the original geometry so that "
+"the new table can be joined to the source table. Since ST_Subdivide is a set-"
+"returning (table) function that returns a set of single-value rows, this "
+"syntax automatically produces a table with one row for each result part."
+msgstr ""
+"<emphasis role=\"bold\">Приклад:</emphasis> Створіть нову таблицю, що "
+"містить поділені геометрії, зберігаючи ключ оригінальної геометрії, щоб нову "
+"таблицю можна було об'єднати з вихідною таблицею. Оскільки ST_Subdivide є "
+"функцією, що повертає набір (таблицю) і повертає набір рядків з одним "
+"значенням, ця синтаксична конструкція автоматично створює таблицю з одним "
+"рядком для кожної частини результату."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Segmentize\"/>, <xref linkend=\"ST_Split\"/>, <xref "
+"linkend=\"ST_NPoints\"/>, <xref linkend=\"ST_ReducePrecision\"/>"
+msgstr ""
+", <xref linkend=\"ST_Segmentize\"/>, <xref linkend=\"ST_Split\"/>, <xref "
+"linkend=\"ST_NPoints\"/>, <xref linkend=\"ST_ReducePrecision\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a geometry representing the portions of geometries A and B that do "
+"not intersect."
+msgstr ""
+"Обчислює геометрію, що представляє частини геометрій A і B, які не "
+"перетинаються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry representing the portions of geonetries A and B that do "
+"not intersect. This is equivalent to <code>ST_Union(A,B) - ST_Intersection(A,"
+"B)</code>. It is called a symmetric difference because "
+"<code>ST_SymDifference(A,B) = ST_SymDifference(B,A)</code>."
+msgstr ""
+"Повертає геометрію, що представляє частини геометрій A і B, які не "
+"перетинаються. Це еквівалентно <code>ST_Union(A,B) - ST_Intersection(A,B)</"
+"code>. Це називається симетричною різницею, оскільки "
+"<code>ST_SymDifference(A,B) = ST_SymDifference(B,A)</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.21"
+msgstr "&sqlmm_compliant; SQL-MM 3: 5.1.21"
+
+#. Tag: para
+#, no-c-format
+msgid "The original linestrings shown together"
+msgstr "Оригінальні лініЇ, показані разом"
+
+#. Tag: para
+#, no-c-format
+msgid "The symmetric difference of the two linestrings"
+msgstr "Симетрична різниця двох лінійних рядків"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the union of the components of a single geometry."
+msgstr "Обчислює об'єднання компонентів однієї геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A single-input variant of <xref linkend=\"ST_Union\"/>. The input may be a "
+"single geometry, a MultiGeometry, or a GeometryCollection. The union is "
+"applied to the individual elements of the input."
+msgstr ""
+"Одновхідний варіант <xref linkend=\"ST_Union\"/>. Вхідними даними може бути "
+"одна геометрія, MultiGeometry або GeometryCollection. Об'єднання "
+"застосовується до окремих елементів вхідних даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function can be used to fix MultiPolygons which are invalid due to "
+"overlapping components. However, the input components must each be valid. An "
+"invalid input component such as a bow-tie polygon may cause an error. For "
+"this reason it may be better to use <xref linkend=\"ST_MakeValid\"/>."
+msgstr ""
+"Цю функцію можна використовувати для виправлення полігонів MultiPolygons, "
+"які є недійсними через перекриття компонентів. Однак кожний з компонентів "
+"вхідних даних повинен бути дійсним. Недійсний компонент вхідних даних, такий "
+"як полігон у формі метелика, може спричинити помилку. З цієї причини краще "
+"використовувати <xref linkend=\"ST_MakeValid\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Another use of this function is to node and dissolve a collection of "
+"linestrings which cross or overlap to make them <link "
+"linkend=\"Simple_Geometry\">simple</link>. (<xref linkend=\"ST_Node\"/> also "
+"does this, but it does not provide the <code>gridSize</code> option.)"
+msgstr ""
+"Інше застосування цієї функції — об'єднання та роз'єднання набору лінійних "
+"рядків, які перетинаються або перекриваються, щоб зробити їх <link linkend="
+"\"Simple_Geometry\">простими</link>. (<xref linkend=\"ST_Node\"/> також "
+"виконує цю функцію, але не надає опцію <code>gridSize</code>.)"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It is possible to combine ST_UnaryUnion with <xref linkend=\"ST_Collect\"/> "
+"to fine-tune how many geometries are be unioned at once. This allows trading "
+"off between memory usage and compute time, striking a balance between "
+"ST_Union and <xref linkend=\"ST_MemUnion\"/>."
+msgstr ""
+"Можна поєднати ST_UnaryUnion з <xref linkend=\"ST_Collect\"/>, щоб точно "
+"налаштувати кількість геометрій, які об'єднуються одночасно. Це дозволяє "
+"досягти компромісу між використанням пам'яті та часом обчислення, "
+"забезпечуючи баланс між ST_Union та <xref linkend=\"ST_MemUnion\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MemUnion\"/>, <xref linkend=\"ST_MakeValid\"/>, <xref "
+"linkend=\"ST_Collect\"/>, <xref linkend=\"ST_Node\"/>, <xref "
+"linkend=\"ST_ReducePrecision\"/>"
+msgstr ""
+", <xref linkend=\"ST_MemUnion\"/>, <xref linkend=\"ST_MakeValid\"/>, <xref "
+"linkend=\"ST_Collect\"/>, <xref linkend=\"ST_Node\"/>, <xref linkend="
+"\"ST_ReducePrecision\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a geometry representing the point-set union of the input geometries."
+msgstr ""
+"Обчислює геометрію, що представляє об'єднання множин точок вхідних геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unions the input geometries, merging geometry to produce a result geometry "
+"with no overlaps. The output may be an atomic geometry, a MultiGeometry, or "
+"a Geometry Collection. Comes in several variants:"
+msgstr ""
+"Об'єднує геометрії вхідних даних, об'єднуючи геометрію для отримання "
+"геометрії результату без перекриттів. Результатом може бути атомна "
+"геометрія, MultiGeometry або колекція геометрій. Існує в декількох варіантах:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Two-input variant:</emphasis> returns a geometry "
+"that is the union of two input geometries. If either input is NULL, then "
+"NULL is returned."
+msgstr ""
+"<emphasis role=\"bold\">Варіант з двома входами:</emphasis> повертає "
+"геометрію, яка є об'єднанням двох вхідних геометрій. Якщо будь-який з входів "
+"має значення NULL, то повертається NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Array variant:</emphasis> returns a geometry that is "
+"the union of an array of geometries."
+msgstr ""
+"<emphasis role=\"bold\">Варіант масиву:</emphasis> повертає геометрію, яка є "
+"об'єднанням масиву геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Aggregate variant:</emphasis> returns a geometry "
+"that is the union of a rowset of geometries. The ST_Union() function is an "
+"\"aggregate\" function in the terminology of PostgreSQL. That means that it "
+"operates on rows of data, in the same way the SUM() and AVG() functions do "
+"and like most aggregates, it also ignores NULL geometries."
+msgstr ""
+"<emphasis role=\"bold\">Агрегований варіант:</emphasis> повертає геометрію, "
+"яка є об'єднанням набору рядків геометрій. Функція ST_Union() є \"агрегованою\""
+" функцією в термінології PostgreSQL. Це означає, що вона працює з рядками "
+"даних так само, як функції SUM() та AVG(), і, як більшість агрегатів, "
+"ігнорує геометрії NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"See <xref linkend=\"ST_UnaryUnion\"/> for a non-aggregate, single-input "
+"variant."
+msgstr ""
+"Див. <xref linkend=\"ST_UnaryUnion\"/>для неагрегованого варіанту з одним "
+"вхідним параметром."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The ST_Union array and set variants use the fast Cascaded Union algorithm "
+"described in <link xlink:href=\"http://blog.cleverelephant.ca/2009/01/must-"
+"faster-unions-in-postgis-14.html\">http://blog.cleverelephant.ca/2009/01/"
+"must-faster-unions-in-postgis-14.html</link>"
+msgstr ""
+"Масив ST_Union та варіанти набору використовують швидкий алгоритм каскадного "
+"об'єднання, описаний у <link xlink:href=\"http://blog.cleverelephant.ca/2009/"
+"01/must-faster-unions-in-postgis-14.html\">http://blog.cleverelephant.ca/"
+"2009/01/must-faster-unions-in-postgis-14.html</link>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"may sometimes be used in place of ST_Union, if the result is not required to "
+"be non-overlapping. ST_Collect is usually faster than ST_Union because it "
+"performs no processing on the collected geometries."
+msgstr ""
+"іноді може використовуватися замість ST_Union, якщо результат не повинен "
+"бути неперекривним. ST_Collect зазвичай працює швидше, ніж ST_Union, "
+"оскільки не виконує обробку зібраних геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Union creates MultiLineString and does not sew LineStrings into a single "
+"LineString. Use <xref linkend=\"ST_LineMerge\"/> to sew LineStrings."
+msgstr ""
+"ST_Union створює MultiLineString і не з'єднує LineStrings в один LineString. "
+"Для з'єднання LineStrings використовуйте <xref linkend=\"ST_LineMerge\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: this function was formerly called GeomUnion(), which was renamed from "
+"\"Union\" because UNION is an SQL reserved word."
+msgstr ""
+"ПРИМІТКА: раніше ця функція називалася GeomUnion(), але була перейменована з "
+"\"Union\", оскільки UNION є зарезервованим словом SQL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.4.0 - ST_Union was enhanced. ST_Union(geomarray) was "
+"introduced and also faster aggregate collection in PostgreSQL."
+msgstr ""
+"Доступність: 1.4.0 — ST_Union було вдосконалено. Було впроваджено "
+"ST_Union(geomarray), а також пришвидшено збір агрегатів у PostgreSQL."
+
+#. Tag: para
+#, no-c-format
+msgid "Aggregate version is not explicitly defined in OGC SPEC."
+msgstr "Агрегована версія не визначена явно в OGC SPEC."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM 3: 5.1.19 the z-index (elevation) when polygons are "
+"involved."
+msgstr ""
+"&sqlmm_compliant; SQL-MM 3: 5.1.19 z-індекс (висота) при використанні "
+"полігонів."
+
+#. Tag: para
+#, no-c-format
+msgid "Aggregate example"
+msgstr "Приклад агрегату"
+
+#. Tag: para
+#, no-c-format
+msgid "Non-Aggregate example"
+msgstr "Неагрегований приклад"
+
+#. Tag: para
+#, no-c-format
+msgid "3D example - sort of supports 3D (and with mixed dimensions!)"
+msgstr "3D-приклад — часткова підтримка 3D (і з змішаними розмірами!)"
+
+#. Tag: para
+#, no-c-format
+msgid "3d example not mixing dimensions"
+msgstr "3D-приклад без змішування розмірів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_UnaryUnion\"/>, <xref linkend=\"ST_MemUnion\"/>, <xref "
+"linkend=\"ST_Intersection\"/>, <xref linkend=\"ST_Difference\"/>, <xref "
+"linkend=\"ST_SymDifference\"/>, <xref linkend=\"ST_ReducePrecision\"/>"
+msgstr ""
+", <xref linkend=\"ST_UnaryUnion\"/>, <xref linkend=\"ST_MemUnion\"/>, <xref "
+"linkend=\"ST_Intersection\"/>, <xref linkend=\"ST_Difference\"/>, <xref "
+"linkend=\"ST_SymDifference\"/>, <xref linkend=\"ST_ReducePrecision\"/>"
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Processing"
+msgstr "Обробка геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions compute geometric constructions, or alter geometry size or "
+"shape."
+msgstr ""
+"Ці функції обчислюють геометричні конструкції або змінюють розмір чи форму "
+"геометрії."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a geometry covering all points within a given distance from a "
+"geometry."
+msgstr ""
+"Обчислює геометрію, що охоплює всі точки в межах заданої відстані від "
+"геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a POLYGON or MULTIPOLYGON that represents all points whose distance "
+"from a geometry/geography is less than or equal to a given distance. A "
+"negative distance shrinks the geometry rather than expanding it. A negative "
+"distance may shrink a polygon completely, in which case POLYGON EMPTY is "
+"returned. For points and lines negative distances always return empty "
+"results."
+msgstr ""
+"Обчислює POLYGON або MULTIPOLYGON, що представляє всі точки, відстань яких "
+"від геометрії/географії менше або дорівнює заданій відстані. Від'ємна "
+"відстань зменшує геометрію, а не розширює її. Від'ємна відстань може "
+"повністю зменшити полігон, і в цьому випадку повертається POLYGON EMPTY. Для "
+"точок і ліній від'ємні відстані завжди повертають порожні результати."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geometry, the distance is specified in the units of the Spatial "
+"Reference System of the geometry. For geography, the distance is specified "
+"in meters."
+msgstr ""
+"Для геометрії відстань вказується в одиницях просторової системи координат "
+"геометрії. Для географії відстань вказується в метрах."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The optional third parameter controls the buffer accuracy and style. The "
+"accuracy of circular arcs in the buffer is specified as the number of line "
+"segments used to approximate a quarter circle (default is 8). The buffer "
+"style can be specified by providing a list of blank-separated key=value "
+"pairs as follows:"
+msgstr ""
+"Опціональний третій параметр контролює точність і стиль буфера. Точність "
+"кругових дуг у буфері визначається як кількість лінійних сегментів, що "
+"використовуються для апроксимації чверті кола (за замовчуванням — 8). Стиль "
+"буфера можна вказати, надавши список пар ключ=значення, розділених "
+"пробілами, як показано нижче:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'quad_segs=#' : number of line segments used to approximate a quarter circle "
+"(default is 8)."
+msgstr ""
+"“quad_segs=#” : кількість відрізків лінії, що використовуються для "
+"апроксимації чверті кола (за замовчуванням — 8)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'endcap=round|flat|square' : endcap style (defaults to \"round\"). 'butt' is "
+"accepted as a synonym for 'flat'."
+msgstr ""
+"“endcap=round|flat|square” : стиль кінцевої частини (за замовчуванням "
+"\"round\"). “butt” приймається як синонім “flat”."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'join=round|mitre|bevel' : join style (defaults to \"round\"). 'miter' is "
+"accepted as a synonym for 'mitre'."
+msgstr ""
+"“join=round|mitre|bevel” : стиль з'єднання (за замовчуванням \"round\"). "
+"“miter” приймається як синонім “mitre”."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'mitre_limit=#.#' : mitre ratio limit (only affects mitered join style). "
+"'miter_limit' is accepted as a synonym for 'mitre_limit'."
+msgstr ""
+"“mitre_limit=#.#” : обмеження кута зрізу (впливає тільки на стиль з'єднання "
+"з кутом зрізу). “miter_limit” приймається як синонім “mitre_limit”."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'side=both|left|right' : 'left' or 'right' performs a single-sided buffer on "
+"the geometry, with the buffered side relative to the direction of the line. "
+"This is only applicable to LINESTRING geometry and does not affect POINT or "
+"POLYGON geometries. By default end caps are square."
+msgstr ""
+"“side=both|left|right” : “left” або “right” виконує односторонній буфер на "
+"геометрії, причому сторона буфера відносна до напрямку лінії. Це "
+"застосовується тільки до геометрії LINESTRING і не впливає на геометрії "
+"POINT або POLYGON. За замовчуванням кінці є квадратними."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&geography_transform; It determines a planar spatial reference system that "
+"best fits the bounding box of the geography object (trying UTM, Lambert "
+"Azimuthal Equal Area (LAEA) North/South pole, and finally Mercator ). The "
+"buffer is computed in the planar space, and then transformed back to WGS84. "
+"This may not produce the desired behavior if the input object is much larger "
+"than a UTM zone or crosses the dateline"
+msgstr ""
+"&geography_transform; Визначає плоску систему просторових координат, яка "
+"найкраще відповідає обмежувальній рамці географічного об'єкта (спробує UTM, "
+"рівновелику азимутальну проекцію Ламберта (LAEA) з північним/південним "
+"полюсом і, нарешті, проекцію Меркатора). Буфер обчислюється в плоскому "
+"просторі, а потім перетворюється назад у WGS84. Це може не дати бажаного "
+"результату, якщо вхідний об'єкт набагато більший за зону UTM або перетинає "
+"лінію зміни дати"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Buffer can handle invalid inputs and the output is always a valid polygonal "
+"geometry. Buffering by distance 0 is sometimes used as a way of repairing "
+"invalid polygons. <xref linkend=\"ST_MakeValid\"/> is more suitable for this "
+"process as it can handle multi-polygons."
+msgstr ""
+"Буфер може обробляти недійсні вхідні дані, а вихідні дані завжди мають "
+"дійсну полігональну геометрію. Буферизація за відстанню 0 іноді "
+"використовується як спосіб виправлення недійсних полігонів. <xref linkend="
+"\"ST_MakeValid\"/>більш підходить для цього процесу, оскільки може обробляти "
+"мультиполігони."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Buffering is sometimes used to perform a within-distance search. For this "
+"use case it is more efficient to use <xref linkend=\"ST_DWithin\"/>."
+msgstr ""
+"Буферизація іноді використовується для виконання пошуку в межах певної "
+"відстані. Для цього випадку використання ефективніше використовувати <xref "
+"linkend=\"ST_DWithin\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function ignores the Z dimension. It always gives a 2D result even when "
+"used on a 3D geometry."
+msgstr ""
+"Ця функція ігнорує вимір Z. Вона завжди дає двовимірний результат, навіть "
+"якщо використовується для тривимірної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.5.0 - ST_Buffer geometry support was enhanced to allow for side "
+"buffering specification <code>side=both|left|right</code>."
+msgstr ""
+"Покращено: 2.5.0 - Підтримка геометрії ST_Buffer була покращена, щоб "
+"дозволити вказати бічне буферизування <code>side=both|left|right</code>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 1.5 - ST_Buffer was enhanced to support different endcaps and "
+"join types. These are useful for example to convert road linestrings into "
+"polygon roads with flat or square edges instead of rounded edges. Thin "
+"wrapper for geography was added."
+msgstr ""
+"Доступність: 1.5 - ST_Buffer було вдосконалено для підтримки різних кінцевих "
+"капсул та типів з'єднання. Це корисно, наприклад, для перетворення лінійних "
+"дорожніх об'єктів у полігонні дороги з плоскими або квадратними краями "
+"замість заокруглених. Додано тонкий обгортковий об'єкт для географії."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.30"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.30"
+
+#. Tag: para
+#, no-c-format
+msgid "quad_segs=8 (default)"
+msgstr "quad_segs=8 (за замовчуванням)"
+
+#. Tag: para
+#, no-c-format
+msgid "quad_segs=2 (lame)"
+msgstr "quad_segs=2 (неповноцінний)"
+
+#. Tag: para
+#, no-c-format
+msgid "endcap=round join=round (default)"
+msgstr "endcap=round join=round (за замовчуванням)"
+
+#. Tag: para
+#, no-c-format
+msgid "endcap=square"
+msgstr "endcap=square"
+
+#. Tag: para
+#, no-c-format
+msgid "endcap=flat"
+msgstr "endcap=flat"
+
+#. Tag: para
+#, no-c-format
+msgid "join=bevel"
+msgstr "join=bevel"
+
+#. Tag: para
+#, no-c-format
+msgid "join=mitre mitre_limit=5.0 (default mitre limit)"
+msgstr "join=mitre mitre_limit=5.0 (стандартне обмеження mitre)"
+
+#. Tag: para
+#, no-c-format
+msgid "join=mitre mitre_limit=1"
+msgstr "join=mitre mitre_limit=1"
+
+#. Tag: para
+#, no-c-format
+msgid "side=left"
+msgstr "side=left"
+
+#. Tag: para
+#, no-c-format
+msgid "side=right"
+msgstr "side=right"
+
+#. Tag: para
+#, no-c-format
+msgid "side=left join=mitre"
+msgstr "side=left join=mitre"
+
+#. Tag: para
+#, no-c-format
+msgid "right-hand-winding, polygon boundary side=left"
+msgstr "right-hand-winding, polygon boundary side=left"
+
+#. Tag: para
+#, no-c-format
+msgid "right-hand-winding, polygon boundary side=right"
+msgstr "right-hand-winding, polygon boundary side=right"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_SetSRID\"/>, <xref "
+"linkend=\"ST_Transform\"/>, <xref linkend=\"ST_Union\"/>, <xref "
+"linkend=\"ST_MakeValid\"/>"
+msgstr ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_SetSRID\"/>, <xref "
+"linkend=\"ST_Transform\"/>, <xref linkend=\"ST_Union\"/>, <xref linkend="
+"\"ST_MakeValid\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Creates a polygonal geometry formed by the linework of a geometry."
+msgstr "Створює полігональну геометрію, утворену лініями геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates an areal geometry formed by the constituent linework of the input "
+"geometry. The input can be a LineString, MultiLineString, Polygon, "
+"MultiPolygon or a GeometryCollection. The result is a Polygon or "
+"MultiPolygon, depending on input. If the input linework does not form "
+"polygons, NULL is returned."
+msgstr ""
+"Створює площинну геометрію, утворену лініями, що складають вхідну геометрію. "
+"Вхідними даними можуть бути LineString, MultiLineString, Polygon, "
+"MultiPolygon або GeometryCollection. Результатом є Polygon або MultiPolygon, "
+"залежно від вхідних даних. Якщо вхідні лінії не утворюють полігонів, "
+"повертається NULL."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unlike <xref linkend=\"ST_MakePolygon\"/>, this function accepts rings "
+"formed by multiple lines, and can form any number of polygons."
+msgstr ""
+"На відміну від <xref linkend=\"ST_MakePolygon\"/>, ця функція приймає "
+"кільця, утворені декількома лініями, і може утворювати будь-яку кількість "
+"полігонів."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function converts inner rings into holes. To turn inner rings into "
+"polygons as well, use <xref linkend=\"ST_Polygonize\"/>."
+msgstr ""
+"Ця функція перетворює внутрішні кільця на отвори. Щоб перетворити внутрішні "
+"кільця також на полігони, використовуйте <xref linkend=\"ST_Polygonize\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Input linework must be correctly noded for this function to work properly. "
+"<xref linkend=\"ST_Node\"/> can be used to node lines."
+msgstr ""
+"Для коректної роботи цієї функції вхідні лінії повинні бути правильно "
+"позначені вузлами. Для позначення ліній можна використовувати <xref linkend="
+"\"ST_Node\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the input linework crosses, this function will produce invalid polygons. "
+"<xref linkend=\"ST_MakeValid\"/> can be used to ensure the output is valid."
+msgstr ""
+"Якщо вхідні лінії перетинаються, ця функція створить недійсні полігони. "
+"<xref linkend=\"ST_MakeValid\"/>можна використовувати для забезпечення "
+"дійсності вихідних даних."
+
+#. Tag: para
+#, no-c-format
+msgid "Input lines"
+msgstr "Вхідні лінії"
+
+#. Tag: para
+#, no-c-format
+msgid "Area result"
+msgstr "Результати за площею"
+
+#. Tag: para
+#, no-c-format
+msgid "Create a donut from two circular polygons"
+msgstr "Створити кільце з двох круглих полігонів"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MakePolygon\"/>, <xref linkend=\"ST_MakeValid\"/>, "
+"<xref linkend=\"ST_Node\"/>, <xref linkend=\"ST_Polygonize\"/>, <xref "
+"linkend=\"ST_BdPolyFromText\"/>, <xref linkend=\"ST_BdMPolyFromText\"/> "
+"(wrappers to this function with standard OGC interface)"
+msgstr ""
+", <xref linkend=\"ST_MakePolygon\"/>, <xref linkend=\"ST_MakeValid\"/>, "
+"<xref linkend=\"ST_Node\"/>, <xref linkend=\"ST_Polygonize\"/>, <xref "
+"linkend=\"ST_BdPolyFromText\"/>, <xref linkend=\"ST_BdMPolyFromText\"/> ("
+"обгортки для цієї функції зі стандартним інтерфейсом OGC)"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the geometric center of a geometry."
+msgstr "Повертає геометричний центр геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a point which is the geometric center of mass of a geometry. For "
+"[<varname>MULTI</varname>]<varname>POINT</varname>s, the centroid is the "
+"arithmetic mean of the input coordinates. For [<varname>MULTI</"
+"varname>]<varname>LINESTRING</varname>s, the centroid is computed using the "
+"weighted length of each line segment. For [<varname>MULTI</"
+"varname>]<varname>POLYGON</varname>s, the centroid is computed in terms of "
+"area. If an empty geometry is supplied, an empty "
+"<varname>GEOMETRYCOLLECTION</varname> is returned. If <varname>NULL</"
+"varname> is supplied, <varname>NULL</varname> is returned. If "
+"<varname>CIRCULARSTRING</varname> or <varname>COMPOUNDCURVE</varname> are "
+"supplied, they are converted to linestring with CurveToLine first, then same "
+"than for <varname>LINESTRING</varname>"
+msgstr ""
+"Обчислює точку, яка є геометричним центром маси геометрії. Для "
+"[<varname>MULTI</varname>]<varname>POINT</varname>s, центроїд є середнім "
+"арифметичним вхідних координат. Для "
+"[<varname>MULTI</varname>]<varname>LINESTRING</varname>s, центроїд "
+"обчислюється за допомогою зваженої довжини кожного відрізка лінії. Для "
+"[<varname>MULTI</varname>]<varname>POLYGON</varname>s, центроїд обчислюється "
+"за площею. Якщо надано порожню геометрію, повертається порожній "
+"<varname>GEOMETRYCOLLECTION</varname>. Якщо вказано <varname>NULL</varname>, "
+"повертається <varname>NULL</varname>. Якщо вказано <varname>CIRCULARSTRING</"
+"varname> або <varname>COMPOUNDCURVE</varname>, вони спочатку перетворюються "
+"на лінії за допомогою CurveToLine, а потім так само, як для "
+"<varname>LINESTRING</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For mixed-dimension input, the result is equal to the centroid of the "
+"component Geometries of highest dimension (since the lower-dimension "
+"geometries contribute zero \"weight\" to the centroid)."
+msgstr ""
+"Для вхідних даних змішаного розміру результат дорівнює центроїду компонента "
+"Геометрії найвищого розміру (оскільки геометрії нижчого розміру не мають "
+"\"ваги\" для центроїда)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that for polygonal geometries the centroid does not necessarily lie in "
+"the interior of the polygon. For example, see the diagram below of the "
+"centroid of a C-shaped polygon. To construct a point guaranteed to lie in "
+"the interior of a polygon use <xref linkend=\"ST_PointOnSurface\"/>."
+msgstr ""
+"Зверніть увагу, що для полігональних геометрій центр ваги не обов'язково "
+"лежить всередині полігону. Наприклад, дивіться схему нижче, що зображує "
+"центр ваги С-подібного полігону. Щоб побудувати точку, яка гарантовано "
+"лежить всередині полігону, використовуйте <xref linkend=\"ST_PointOnSurface\""
+"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"New in 2.3.0 : supports <varname>CIRCULARSTRING</varname> and "
+"<varname>COMPOUNDCURVE</varname> (using CurveToLine)"
+msgstr ""
+"Нове в версії 2.3.0: підтримка <varname>CIRCULARSTRING</varname> та "
+"<varname>COMPOUNDCURVE</varname> (за допомогою CurveToLine)"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.4.0 support for geography was introduced."
+msgstr "Доступність: 2.4.0 додано підтримку географії."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 8.1.4, 9.5.5"
+msgstr "&sqlmm_compliant; SQL-MM 3: 8.1.4, 9.5.5"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the following illustrations the red dot is the centroid of the source "
+"geometry."
+msgstr ""
+"На наступних ілюстраціях червона точка є центром ваги вихідної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid "Centroid of a <varname>MULTIPOINT</varname>"
+msgstr "Центроїд <varname>MULTIPOINT</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "Centroid of a <varname>LINESTRING</varname>"
+msgstr "Центроїд <varname>LINESTRING</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "Centroid of a <varname>POLYGON</varname>"
+msgstr "Центроїд <varname>POLYGON</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid "Centroid of a <varname>GEOMETRYCOLLECTION</varname>"
+msgstr "Центроїд <varname>GEOMETRYCOLLECTION</varname>"
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_GeometricMedian\"/>"
+msgstr ", <xref linkend=\"ST_GeometricMedian\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a smoothed version of a geometry, using the Chaikin algorithm"
+msgstr "Повертає згладжену версію геометрії, використовуючи алгоритм Чайкіна."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Smoothes a linear or polygonal geometry using <link xlink:href=\"http://www."
+"idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm."
+"html\">Chaikin's algorithm</link>. The degree of smoothing is controlled by "
+"the <varname>nIterations</varname> parameter. On each iteration, each "
+"interior vertex is replaced by two vertices located at 1/4 of the length of "
+"the line segments before and after the vertex. A reasonable degree of "
+"smoothing is provided by 3 iterations; the maximum is limited to 5."
+msgstr ""
+"Згладжує лінійну або полігональну геометрію за допомогою <link "
+"xlink:href=\"http://www.idav.ucdavis.edu/education/CAGDNotes/"
+"Chaikins-Algorithm/Chaikins-Algorithm.html\">алгоритму Чайкіна</link>. "
+"Ступінь згладжування контролюється параметром <varname>nIterations</"
+"varname>. На кожній ітерації кожна внутрішня вершина замінюється двома "
+"вершинами, розташованими на 1/4 довжини відрізків лінії перед і після "
+"вершини. Розумний ступінь згладжування забезпечується 3 ітераціями; "
+"максимальне значення обмежено 5."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>preserveEndPoints</varname> is true, the endpoints of Polygon "
+"rings are not smoothed. The endpoints of LineStrings are always preserved."
+msgstr ""
+"Якщо <varname>preserveEndPoints</varname> має значення true, кінцеві точки "
+"кілець полігону не згладжуються. Кінцеві точки лінійних об'єктів завжди "
+"зберігаються."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The number of vertices doubles with each iteration, so the result geometry "
+"may have many more points than the input. To reduce the number of points use "
+"a simplification function on the result (see <xref linkend=\"ST_Simplify\"/"
+">, <xref linkend=\"ST_SimplifyPreserveTopology\"/> and <xref "
+"linkend=\"ST_SimplifyVW\"/>)."
+msgstr ""
+"Кількість вершин подвоюється з кожною ітерацією, тому геометрія результату "
+"може мати набагато більше точок, ніж вхідні дані. Щоб зменшити кількість "
+"точок, скористайтеся функцією спрощення результату (див. <xref linkend="
+"\"ST_Simplify\"/>, <xref linkend=\"ST_SimplifyPreserveTopology\"/>та <xref "
+"linkend=\"ST_SimplifyVW\"/>)."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The result has interpolated values for the Z and M dimensions when present."
+msgstr ""
+"Результатом є інтерпольовані значення для розмірів Z і M, якщо вони присутні."
+
+#. Tag: para
+#, no-c-format
+msgid "Smoothing a triangle:"
+msgstr "Згладжування трикутника:"
+
+#. Tag: para
+#, no-c-format
+msgid "Smoothing a Polygon using 1, 2 and 3 iterations:"
+msgstr "Згладжування полігону за допомогою 1, 2 і 3 ітерацій:"
+
+#. Tag: para
+#, no-c-format
+msgid "nIterations = 1"
+msgstr "nIterations = 1"
+
+#. Tag: para
+#, no-c-format
+msgid "nIterations = 2"
+msgstr "nIterations = 2"
+
+#. Tag: para
+#, no-c-format
+msgid "nIterations = 3"
+msgstr "nIterations = 3"
+
+#. Tag: para
+#, no-c-format
+msgid "Smoothing a LineString using 1, 2 and 3 iterations:"
+msgstr "Згладжування LineString за допомогою 1, 2 і 3 ітерацій:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SimplifyPreserveTopology\"/>, <xref "
+"linkend=\"ST_SimplifyVW\"/>"
+msgstr ""
+", <xref linkend=\"ST_SimplifyPreserveTopology\"/>, <xref linkend="
+"\"ST_SimplifyVW\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a possibly concave geometry that contains all input geometry "
+"vertices"
+msgstr ""
+"Обчислює можливу увігнуту геометрію, яка містить усі вершини вхідної "
+"геометрії"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A concave hull is a (usually) concave geometry which contains the input, and "
+"whose vertices are a subset of the input vertices. In the general case the "
+"concave hull is a Polygon. The concave hull of two or more collinear points "
+"is a two-point LineString. The concave hull of one or more identical points "
+"is a Point. The polygon will not contain holes unless the optional "
+"<varname>param_allow_holes</varname> argument is specified as true."
+msgstr ""
+"Увігнутий контур — це (зазвичай) увігнута геометрія, яка містить вхідні "
+"дані, а її вершини є підмножиною вершин вхідних даних. У загальному випадку "
+"увігнутий корпус є полігоном. Увігнутий корпус двох або більше колінеарних "
+"точок є двоточковим LineString. Увігнутий корпус однієї або більше "
+"ідентичних точок є точкою. Полігон не буде містити отворів, якщо "
+"опціональний аргумент <varname>param_allow_holes</varname> не вказано як "
+"true."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"One can think of a concave hull as \"shrink-wrapping\" a set of points. This "
+"is different to the <link linkend=\"ST_ConvexHull\">convex hull</link>, "
+"which is more like wrapping a rubber band around the points. A concave hull "
+"generally has a smaller area and represents a more natural boundary for the "
+"input points."
+msgstr ""
+"Уявіть собі увігнутий контур, що \"обгортає\" набір точок. Це відрізняється "
+"від <link linkend=\"ST_ConvexHull\">опуклого контуру</link>, який більше "
+"нагадує гумку, натягнуту навколо точок. Увігнутий контур зазвичай має меншу "
+"площу і є більш природною межею для вхідних точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>param_pctconvex</varname> controls the concaveness of the "
+"computed hull. A value of 1 produces the convex hull. Values between 1 and 0 "
+"produce hulls of increasing concaveness. A value of 0 produces a hull with "
+"maximum concaveness (but still a single polygon). Choosing a suitable value "
+"depends on the nature of the input data, but often values between 0.3 and "
+"0.1 produce reasonable results."
+msgstr ""
+"Параметр <varname>param_pctconvex</varname> контролює увігнутість "
+"обчислюваної оболонки. Значення 1 створює опуклу оболонку. Значення від 1 до "
+"0 створюють оболонки із зростаючою увігнутістю. Значення 0 створює оболонку "
+"з максимальною увігнутістю (але все одно єдиний полігон). Вибір відповідного "
+"значення залежить від характеру вхідних даних, але часто значення між 0,3 і "
+"0,1 дають прийнятні результати."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Technically, the <varname>param_pctconvex</varname> determines a length as a "
+"fraction of the difference between the longest and shortest edges in the "
+"Delaunay Triangulation of the input points. Edges longer than this length "
+"are \"eroded\" from the triangulation. The triangles remaining form the "
+"concave hull."
+msgstr ""
+"Технічно, параметр <varname>param_pctconvex</varname> визначає довжину як "
+"частку різниці між найдовшим і найкоротшим ребрами в триангуляції Делоне "
+"вхідних точок. Ребра, довші за цю довжину, \"видаляються\" з триангуляції. "
+"Трикутники, що залишаються, утворюють увігнуту оболонку."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For point and linear inputs, the hull will enclose all the points of the "
+"inputs. For polygonal inputs, the hull will enclose all the points of the "
+"input <emphasis>and also</emphasis> all the areas covered by the input. If "
+"you want a point-wise hull of a polygonal input, convert it to points first "
+"using <xref linkend=\"ST_Points\"/>."
+msgstr ""
+"Для точкових і лінійних вхідних даних оболонка охоплюватиме всі точки "
+"вхідних даних. Для полігональних вхідних даних оболонка охоплюватиме всі "
+"точки вхідних даних <emphasis>а також</emphasis> всі області, що охоплюються "
+"вхідними даними. Якщо ви хочете отримати точкову оболонку полігональних "
+"вхідних даних, спочатку перетворіть їх у точки за допомогою <xref linkend="
+"\"ST_Points\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is not an aggregate function. To compute the concave hull of a set of "
+"geometries use <xref linkend=\"ST_Collect\"/> (e.g. "
+"<code>ST_ConcaveHull( ST_Collect( geom ), 0.80)</code>."
+msgstr ""
+"Це не агрегатна функція. Для обчислення увігнутої оболонки набору геометрій "
+"використовуйте <xref linkend=\"ST_Collect\"/>(наприклад, "
+"<code>ST_ConcaveHull( ST_Collect( geom ), 0.80)</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.3.0, GEOS native implementation enabled for GEOS 3.11+"
+msgstr "Покращено: 3.3.0, увімкнено вбудовану реалізацію GEOS для GEOS 3.11+"
+
+#. Tag: para
+#, no-c-format
+msgid "Concave Hull of a MultiPoint"
+msgstr "Увігнутий корпус багатоточкового пристрою"
+
+#. Tag: para
+#, no-c-format
+msgid "Concave Hull of a MultiPoint, allowing holes"
+msgstr "Увігнутий корпус багатоточкового пристрою, що дозволяє робити отвори"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Comparing a concave hull of a Polygon to the concave hull of the constituent "
+"points. The hull respects the boundary of the polygon, whereas the points-"
+"based hull does not."
+msgstr ""
+"Порівняння увігнутого корпусу полігону з увігнутим корпусом складових точок. "
+"Корпус дотримується меж полігону, тоді як оболонка на основі точок цього не "
+"робить."
+
+#. Tag: para
+#, no-c-format
+msgid "Using with ST_Collect to compute the concave hull of a geometry set."
+msgstr ""
+"Використання з ST_Collect для обчислення увігнутої оболонки набору геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Collect\"/>, <xref linkend=\"ST_AlphaShape\"/>, <xref "
+"linkend=\"ST_OptimalAlphaShape\"/>"
+msgstr ""
+", <xref linkend=\"ST_Collect\"/>, <xref linkend=\"ST_AlphaShape\"/>, <xref "
+"linkend=\"ST_OptimalAlphaShape\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the convex hull of a geometry."
+msgstr "Обчислює опуклу оболонку геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the convex hull of a geometry. The convex hull is the smallest "
+"convex geometry that encloses all geometries in the input."
+msgstr ""
+"Обчислює опуклу оболонку геометрії. Опукла оболонка — це найменша опукла "
+"геометрія, яка охоплює всі геометрії у вхідних даних."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"One can think of the convex hull as the geometry obtained by wrapping an "
+"rubber band around a set of geometries. This is different from a <link "
+"linkend=\"ST_ConcaveHull\">concave hull</link> which is analogous to "
+"\"shrink-wrapping\" the geometries. A convex hull is often used to determine "
+"an affected area based on a set of point observations."
+msgstr ""
+"Опуклу оболонку можна уявити як геометрію, отриману шляхом обертання гумової "
+"стрічки навколо набору геометрій. Це відрізняється від <link linkend="
+"\"ST_ConcaveHull\">увігнутої оболонки</link>, яка аналогічна \"упаковці\" "
+"геометрій. Опукла оболонка часто використовується для визначення зони впливу "
+"на основі набору точкових спостережень."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the general case the convex hull is a Polygon. The convex hull of two or "
+"more collinear points is a two-point LineString. The convex hull of one or "
+"more identical points is a Point."
+msgstr ""
+"У загальному випадку опукла оболонка є полігоном. Опукла оболонка двох або "
+"більше колінеарних точок є двоточковою лінією. Опукла оболонка однієї або "
+"більше однакових точок є точкою."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is not an aggregate function. To compute the convex hull of a set of "
+"geometries, use <xref linkend=\"ST_Collect\"/> to aggregate them into a "
+"geometry collection (e.g. <code>ST_ConvexHull(ST_Collect(geom))</code>."
+msgstr ""
+"Це не агрегатна функція. Щоб обчислити опуклу оболонку набору геометрій, "
+"використовуйте <xref linkend=\"ST_Collect\"/>, щоб об'єднати їх у колекцію "
+"геометрій (наприклад, <code>ST_ConvexHull(ST_Collect(geom))</code>."
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.16"
+msgstr "&sqlmm_compliant; SQL-MM IEC 13249-3: 5.1.16"
+
+#. Tag: para
+#, no-c-format
+msgid "Convex Hull of a MultiLinestring and a MultiPoint"
+msgstr "Опукла оболонка багатолінійної та мультиточкової фігури"
+
+#. Tag: para
+#, no-c-format
+msgid "Using with ST_Collect to compute the convex hulls of geometry sets."
+msgstr ""
+"Використання разом із ST_Collect для обчислення опуклих оболонок наборів "
+"геометричних фігур."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ConcaveHull\"/>, <xref "
+"linkend=\"ST_MinimumBoundingCircle\"/>"
+msgstr ""
+", <xref linkend=\"ST_ConcaveHull\"/>, <xref linkend="
+"\"ST_MinimumBoundingCircle\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the Delaunay triangulation of the vertices of a geometry."
+msgstr "Повертає триангуляцію Делауея вершин геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"Delaunay_triangulation\">Delaunay triangulation</link> of the vertices of "
+"the input geometry. The optional <varname>tolerance</varname> can be used to "
+"snap nearby input vertices together, which improves robustness in some "
+"situations. The result geometry is bounded by the convex hull of the input "
+"vertices. The result geometry representation is determined by the "
+"<varname>flags</varname> code:"
+msgstr ""
+"Обчислює <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"Delaunay_triangulation\">триангуляцію Делоне</link> вершин вхідної геометрії. "
+"Опціональний параметр <varname>tolerance</varname> можна використовувати для "
+"з'єднання сусідніх вхідних вершин, що в деяких ситуаціях підвищує "
+"надійність. Результуюча геометрія обмежується опуклою оболонкою вхідних "
+"вершин. Представлення результуючої геометрії визначається кодом "
+"<varname>flags</varname>:"
+
+#. Tag: para
+#, no-c-format
+msgid "<code>0</code> - a GEOMETRYCOLLECTION of triangular POLYGONs (default)"
+msgstr ""
+"<code>0</code> - GEOMETRYCOLLECTION трикутних полігонів (за замовчуванням)"
+
+#. Tag: para
+#, no-c-format
+msgid "<code>1</code> - a MULTILINESTRING of the edges of the triangulation"
+msgstr "<code>1</code> - MULTILINESTRING граней триангуляції"
+
+#. Tag: para
+#, no-c-format
+msgid "<code>2</code> - A TIN of the triangulation"
+msgstr "<code>2</code> - TIN триангуляції"
+
+#. Tag: para
+#, no-c-format
+msgid "Original polygons"
+msgstr "Оригінальні полігони"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_DelaunayTriangles of 2 polygons: delaunay triangle polygons each triangle "
+"themed in different color"
+msgstr ""
+"ST_DelaunayTriangles з 2 полігонів: трикутники Делоне, кожен трикутник "
+"виділений різним кольором"
+
+#. Tag: para
+#, no-c-format
+msgid "-- delaunay triangles as multilinestring"
+msgstr "-- трикутники Делоне як мультилінія"
+
+#. Tag: para
+#, no-c-format
+msgid "-- delaunay triangles of 45 points as 55 triangle polygons"
+msgstr "-- трикутники Делоне з 45 точками як 55 трикутних полігонів"
+
+#. Tag: para
+#, no-c-format
+msgid "Example using vertices with Z values."
+msgstr "Приклад використання вершин із значеннями Z."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_TriangulatePolygon\"/>, <xref "
+"linkend=\"ST_ConstrainedDelaunayTriangles\"/>, <xref "
+"linkend=\"ST_VoronoiLines\"/>, <xref linkend=\"ST_ConvexHull\"/>"
+msgstr ""
+", <xref linkend=\"ST_TriangulatePolygon\"/>, <xref linkend="
+"\"ST_ConstrainedDelaunayTriangles\"/>, <xref linkend=\"ST_VoronoiLines\"/>, "
+"<xref linkend=\"ST_ConvexHull\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Removes vertices based on their M value"
+msgstr "Видаляє вершини на основі їхнього значення M"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Filters out vertex points based on their M-value. Returns a geometry with "
+"only vertex points that have a M-value larger or equal to the min value and "
+"smaller or equal to the max value. If max-value argument is left out only "
+"min value is considered. If fourth argument is left out the m-value will not "
+"be in the resulting geometry. If resulting geometry have too few vertex "
+"points left for its geometry type an empty geometry will be returned. In a "
+"geometry collection geometries without enough points will just be left out "
+"silently."
+msgstr ""
+"Відфільтровує вершинні точки на основі їх M-значення. Повертає геометрію, що "
+"містить тільки вершинні точки, M-значення яких більше або дорівнює "
+"мінімальному значенню і менше або дорівнює максимальному значенню. Якщо "
+"аргумент max-value не вказано, враховується тільки значення min. Якщо "
+"четвертий аргумент не вказано, m-значення не буде включено в результуючу "
+"геометрію. Якщо в результуючій геометрії залишилося занадто мало вершинних "
+"точок для її типу, буде повернута порожня геометрія. У колекції геометрій "
+"геометрії без достатньої кількості точок просто пропускаються без "
+"повідомлення."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is mainly intended to be used in conjunction with "
+"ST_SetEffectiveArea. ST_EffectiveArea sets the effective area of a vertex in "
+"its m-value. With ST_FilterByM it then is possible to get a simplified "
+"version of the geometry without any calculations, just by filtering"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There is a difference in what ST_SimplifyVW returns when not enough points "
+"meet the criteria compared to ST_FilterByM. ST_SimplifyVW returns the "
+"geometry with enough points while ST_FilterByM returns an empty geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Note that the returned geometry might be invalid"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function returns all dimensions, including the Z and M values"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A linestring is filtered"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_SimplifyVW\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Generates a multipoint of random points contained in a Polygon or "
+"MultiPolygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_GeneratePoints generates a multipoint consisting of a given number of "
+"pseudo-random points which lie within the input area. The optional "
+"<varname>seed</varname> is used to regenerate a deterministic sequence of "
+"points, and must be greater than zero."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.0.0, added seed parameter"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generated a multipoint consisting of 12 Points overlaid on top of original "
+"polygon using a random seed value 1996"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given a table of polygons s, return 12 individual points per polygon. "
+"Results will be different each time you run."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the geometric median of a MultiPoint."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the approximate geometric median of a MultiPoint geometry using the "
+"Weiszfeld algorithm. The geometric median is the point minimizing the sum of "
+"distances to the input points. It provides a centrality measure that is less "
+"sensitive to outlier points than the centroid (center of mass)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The algorithm iterates until the distance change between successive "
+"iterations is less than the supplied <varname>tolerance</varname> parameter. "
+"If this condition has not been met after <varname>max_iterations</varname> "
+"iterations, the function produces an error and exits, unless "
+"<varname>fail_if_not_converged</varname> is set to <code>false</code> (the "
+"default)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If a <varname>tolerance</varname> argument is not provided, the tolerance "
+"value is calculated based on the extent of the input geometry."
+msgstr ""
+"Якщо аргумент <varname>tolerance</varname> не вказано, значення допуску "
+"обчислюється на основі розмірів вхідної геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If present, the input point M values are interpreted as their relative "
+"weights."
+msgstr ""
+"Якщо присутні, значення вхідної точки M інтерпретуються як їх відносні ваги."
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.5.0 Added support for M as weight of points."
+msgstr "Покращено: 2.5.0 Додано підтримку M як ваги точок."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Comparison of the geometric median (red) and centroid (turquoise) of a "
+"MultiPoint."
+msgstr ""
+"Порівняння геометричної медіани (червоний) та центроїда (бірюзовий) "
+"MultiPoint."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the lines formed by sewing together a MultiLineString."
+msgstr "Повернути лінії, утворені зшиванням MultiLineString."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a LineString or MultiLineString formed by joining together the line "
+"elements of a MultiLineString. Lines are joined at their endpoints at 2-way "
+"intersections. Lines are not joined across intersections of 3-way or greater "
+"degree."
+msgstr ""
+"Повертає LineString або MultiLineString, утворений шляхом з'єднання лінійних "
+"елементів MultiLineString. Лінії з'єднуються в кінцевих точках на "
+"двосторонніх перетинах. Лінії не з'єднуються на перетинах з трьома або "
+"більше точками."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <emphasis role=\"bold\">directed</emphasis> is TRUE, then ST_LineMerge "
+"will not change point order within LineStrings, so lines with opposite "
+"directions will not be merged"
+msgstr ""
+"Якщо <emphasis role=\"bold\">directed</emphasis> має значення TRUE, то "
+"ST_LineMerge не змінюватиме порядок точок у LineStrings, тому лінії з "
+"протилежними напрямками не будуть об'єднані"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Only use with MultiLineString/LineStrings. Other geometry types return an "
+"empty GeometryCollection"
+msgstr ""
+"Використовуйте тільки з MultiLineString/LineStrings. Інші типи геометрії "
+"повертають порожній GeometryCollection"
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.3.0 accept a directed parameter."
+msgstr "Покращено: 3.3.0 приймає спрямований параметр."
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.11.0 to use the directed parameter."
+msgstr "Для використання параметра directed необхідна версія GEOS >= 3.11.0."
+
+#. Tag: para
+#, no-c-format
+msgid "This function strips the M dimension."
+msgstr "Ця функція видаляє розмірність M."
+
+#. Tag: para
+#, no-c-format
+msgid "Merging lines with different orientation."
+msgstr "Об'єднання ліній з різною орієнтацією."
+
+#. Tag: para
+#, no-c-format
+msgid "Lines are not merged across intersections with degree > 2."
+msgstr "Лінії не об'єднуються на перетинах зі ступенем > 2."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If merging is not possible due to non-touching lines, the original "
+"MultiLineString is returned."
+msgstr ""
+"Якщо об'єднання неможливе через непересічні лінії, повертається оригінальний "
+"MultiLineString."
+
+#. Tag: para
+#, no-c-format
+msgid "Lines with opposite directions are not merged if directed = TRUE."
+msgstr "Лінії з протилежними напрямками не об'єднуються, якщо directed = TRUE."
+
+#. Tag: para
+#, no-c-format
+msgid "Example showing Z-dimension handling."
+msgstr "Приклад, що ілюструє обробку Z-виміру."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LineSubstring\"/>"
+msgstr ", <xref linkend=\"ST_LineSubstring\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the largest circle contained within a geometry."
+msgstr "Обчислює найбільше коло, що міститься в геометрії."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Finds the largest circle that is contained within a (multi)polygon, or which "
+"does not overlap any lines and points. Returns a record with fields:"
+msgstr ""
+"Знаходить найбільше коло, яке міститься в (мульти)полігоні або не "
+"перетинається з лініями та точками. Повертає запис із полями:"
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>center</varname> - center point of the circle"
+msgstr "<varname>center</varname> - центр кола"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>nearest</varname> - a point on the geometry nearest to the center"
+msgstr "<varname>nearest</varname> - точка на геометрії, найближча до центру"
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>radius</varname> - radius of the circle"
+msgstr "<varname>radius</varname> - радіус кола"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For polygonal inputs, the circle is inscribed within the boundary rings, "
+"using the internal rings as boundaries. For linear and point inputs, the "
+"circle is inscribed within the convex hull of the input, using the input "
+"lines and points as further boundaries."
+msgstr ""
+"Для полігональних вхідних даних коло вписується в межі кільця, "
+"використовуючи внутрішні кільця як межі. Для лінійних і точкових вхідних "
+"даних коло вписується в опуклу оболонку вхідних даних, використовуючи лінії "
+"і точки вхідних даних як додаткові межі."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.1.0."
+msgstr "Доступність: 3.1.0."
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.9.0."
+msgstr "Потрібна версія GEOS >= 3.9.0."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Maximum inscribed circle of a polygon. Center, nearest point, and radius are "
+"returned."
+msgstr ""
+"Максимальне вписане коло полігону. Повертаються центр, найближча точка та "
+"радіус."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Maximum inscribed circle of a multi-linestring. Center, nearest point, and "
+"radius are returned."
+msgstr ""
+"Максимальне вписане коло багатолінійної фігури. Повертаються центр, "
+"найближча точка та радіус."
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_LargestEmptyCircle\"/>"
+msgstr ", <xref linkend=\"ST_LargestEmptyCircle\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the largest circle not overlapping a geometry."
+msgstr "Обчислює найбільше коло, яке не перетинається з геометрією."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Finds the largest circle which does not overlap a set of point and line "
+"obstacles. (Polygonal geometries may be included as obstacles, but only "
+"their boundary lines are used.) The center of the circle is constrained to "
+"lie inside a polygonal boundary, which by default is the convex hull of the "
+"input geometry. The circle center is the point in the interior of the "
+"boundary which has the farthest distance from the obstacles. The circle "
+"itself is provided by the center point and a nearest point lying on an "
+"obstacle determining the circle radius."
+msgstr ""
+"Знаходить найбільше коло, яке не перетинається з набором точкових і лінійних "
+"перешкод. (Полігональні геометрії можуть бути включені як перешкоди, але "
+"використовуються тільки їх межі.) Центр кола обмежений межами полігональної "
+"фігури, яка за замовчуванням є опуклою оболонкою вхідної геометрії. Центр "
+"кола — це точка всередині межі, яка має найбільшу відстань від перешкод. "
+"Саме коло задається центром і найближчою точкою, що лежить на перешкоді, яка "
+"визначає радіус кола."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The circle center is determined to a given accuracy specified by a distance "
+"tolerance, using an iterative algorithm. If the accuracy distance is not "
+"specified a reasonable default is used."
+msgstr ""
+"Центр кола визначається з заданою точністю, яка визначається допуском на "
+"відстань, за допомогою ітераційного алгоритму. Якщо точність відстані не "
+"вказана, використовується розумне значення за замовчуванням."
+
+#. Tag: para
+#, no-c-format
+msgid "Returns a record with fields:"
+msgstr "Повертає запис із полями:"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To find the largest empty circle in the interior of a polygon, see <xref "
+"linkend=\"ST_MaximumInscribedCircle\"/>."
+msgstr ""
+"Щоб знайти найбільше порожнє коло всередині полігону, див. <xref linkend="
+"\"ST_MaximumInscribedCircle\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.4.0."
+msgstr "Доступність: 3.4.0."
+
+#. Tag: para
+#, no-c-format
+msgid "Largest Empty Circle within a set of lines."
+msgstr "Найбільше порожнє коло в наборі ліній."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Largest Empty Circle within a set of points, constrained to lie in a "
+"polygon. The constraint polygon boundary must be included as an obstacle, as "
+"well as specified as the constraint for the circle center."
+msgstr ""
+"Найбільше порожнє коло в наборі точок, обмежене полігоном. Межа полігону "
+"обмеження повинна бути включена як перешкода, а також вказана як обмеження "
+"для центру кола."
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the smallest circle polygon that contains a geometry.</"
+"refpurpose>"
+msgstr ""
+"<refpurpose>Повертає найменший полігон кола, що містить "
+"геометрію.</refpurpose>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the smallest circle polygon that contains a geometry.</para>"
+msgstr "<para>Повертає найменший полігон кола, що містить геометрію.</para>"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The bounding circle is approximated by a polygon with a default of 48 "
+"segments per quarter circle. Because the polygon is an approximation of the "
+"minimum bounding circle, some points in the input geometry may not be "
+"contained within the polygon. The approximation can be improved by "
+"increasing the number of segments. For applications where an approximation "
+"is not suitable <xref linkend=\"ST_MinimumBoundingRadius\"/> may be used."
+msgstr ""
+"Обмежувальне коло наближається полігоном із 48 сегментами на чверть кола за "
+"замовчуванням. Оскільки полігон є наближенням мінімального обмежувального "
+"кола, деякі точки в геометрії вхідних даних можуть не міститися в полігоні. "
+"Наближення можна поліпшити, збільшивши кількість сегментів. Для додатків, де "
+"наближення не підходить, можна використовувати <xref linkend="
+"\"ST_MinimumBoundingRadius\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use with <xref linkend=\"ST_Collect\"/> to get the minimum bounding circle "
+"of a set of geometries."
+msgstr ""
+"Використовуйте з <xref linkend=\"ST_Collect\"/>, щоб отримати мінімальне "
+"обмежуюче коло набору геометрій."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To compute two points lying on the minimum circle (the \"maximum diameter\") "
+"use <xref linkend=\"ST_LongestLine\"/>."
+msgstr ""
+"Щоб обчислити дві точки, що лежать на мінімальному колі (максимальний "
+"діаметр), використовуйте <xref linkend=\"ST_LongestLine\"/>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The ratio of the area of a polygon divided by the area of its Minimum "
+"Bounding Circle is referred to as the <emphasis>Reock compactness score</"
+"emphasis>."
+msgstr ""
+"Відношення площі полігону до площі його мінімального обмежувального кола "
+"називається <emphasis>коефіцієнтом компактності Реока</emphasis>."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Minimum bounding circle of a point and linestring. Using 8 segs to "
+"approximate a quarter circle"
+msgstr ""
+"Мінімальне обмежуюче коло точки та лінії. Використання 8 сегментів для "
+"наближення чверті кола"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MinimumBoundingRadius\"/>, <xref "
+"linkend=\"ST_LargestEmptyCircle\"/>, <xref linkend=\"ST_LongestLine\"/>"
+msgstr ""
+", <xref linkend=\"ST_MinimumBoundingRadius\"/>, <xref linkend="
+"\"ST_LargestEmptyCircle\"/>, <xref linkend=\"ST_LongestLine\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the center point and radius of the smallest circle that contains a "
+"geometry."
+msgstr "Повертає центр і радіус найменшого кола, що містить геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the center point and radius of the smallest circle that contains a "
+"geometry. Returns a record with fields:"
+msgstr ""
+"Обчислює центр і радіус найменшого кола, що містить геометрію. Повертає "
+"запис із полями:"
+
+#. Tag: para
+#, no-c-format
+msgid "Availability - 2.3.0"
+msgstr "Доступність - 2.3.0"
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MinimumBoundingCircle\"/>, <xref "
+"linkend=\"ST_LongestLine\"/>"
+msgstr ""
+", <xref linkend=\"ST_MinimumBoundingCircle\"/>, <xref linkend="
+"\"ST_LongestLine\"/>"
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a minimum-area rectangle containing a geometry."
+msgstr "Повертає прямокутник з мінімальною площею, що містить геометрію."
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the minimum-area rotated rectangle enclosing a geometry. Note that "
+"more than one such rectangle may exist. May return a Point or LineString in "
+"the case of degenerate inputs."
+msgstr ""
+"Повертає прямокутник з мінімальною площею, що охоплює геометрію. Зверніть "
+"увагу, що може існувати більше одного такого прямокутника. У разі вироджених "
+"вхідних даних може повертати Point або LineString."
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.5.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.6.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Oriented envelope of a point and linestring."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns an offset line at a given distance and side from an input line."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return an offset line at a given distance and side from an input line. All "
+"points of the returned geometries are not further than the given distance "
+"from the input geometry. Useful for computing parallel lines about a center "
+"line."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For positive distance the offset is on the left side of the input line and "
+"retains the same direction. For a negative distance it is on the right side "
+"and in the opposite direction."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Units of distance are measured in units of the spatial reference system."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that output may be a MULTILINESTRING or EMPTY for some jigsaw-shaped "
+"input geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The optional third parameter allows specifying a list of blank-separated "
+"key=value pairs to tweak operations as follows:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'quad_segs=#' : number of segments used to approximate a quarter circle "
+"(defaults to 8)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'join=round|mitre|bevel' : join style (defaults to \"round\"). 'miter' is "
+"also accepted as a synonym for 'mitre'."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'mitre_limit=#.#' : mitre ratio limit (only affects mitred join style). "
+"'miter_limit' is also accepted as a synonym for 'mitre_limit'."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Behavior changed in GEOS 3.11 so offset curves now have the same direction "
+"as the input line, for both positive and negative offsets."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.5 - added support for GEOMETRYCOLLECTION and MULTILINESTRING"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Compute an open buffer around roads"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "15, 'quad_segs=4 join=round' original line and its offset 15 units."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "-15, 'quad_segs=4 join=round' original line and its offset -15 units"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"double-offset to get more curvy, note the first reverses direction, so -30 + "
+"15 = -15"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"double-offset to get more curvy,combined with regular offset 15 to get "
+"parallel lines. Overlaid with original."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "15, 'quad_segs=4 join=bevel' shown with original line"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "15,-15 collected, join=mitre mitre_limit=2.1"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes a point guaranteed to lie in a polygon, or on a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <varname>POINT</varname> which is guaranteed to lie in the "
+"interior of a surface (<varname>POLYGON</varname>, <varname>MULTIPOLYGON</"
+"varname>, and <varname>CURVEPOLYGON</varname>). In PostGIS this function "
+"also works on line and point geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s3.2.14.2 // s3.2.18.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sqlmm_compliant; SQL-MM 3: 8.1.5, 9.5.6. The specifications define "
+"ST_PointOnSurface for surface geometries only. PostGIS extends the function "
+"to support all common geometry types. Other databases (Oracle, DB2, ArcSDE) "
+"seem to support this function only for surfaces. SQL Server 2008 supports "
+"all common geometry types."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Point on surface of a <varname>MULTIPOINT</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Point on surface of a <varname>LINESTRING</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Point on surface of a <varname>POLYGON</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Point on surface of a <varname>GEOMETRYCOLLECTION</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> The result of ST_PointOnSurface "
+"is guaranteed to lie within polygons, whereas the point computed by <xref "
+"linkend=\"ST_Centroid\"/> may be outside."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Red: point on surface; Green: centroid"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_MaximumInscribedCircle\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a collection of polygons formed from the linework of a set of "
+"geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a GeometryCollection containing the polygons formed by the linework "
+"of a set of geometries. If the input linework does not form any polygons, an "
+"empty GeometryCollection is returned."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function creates polygons covering all delimited areas. If the result "
+"is intended to form a valid polygonal geometry, use <xref "
+"linkend=\"ST_BuildArea\"/> to prevent holes being filled."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The input linework must be correctly noded for this function to work "
+"properly. To ensure input is noded use <xref linkend=\"ST_Node\"/> on the "
+"input geometry before polygonizing."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GeometryCollections can be difficult to handle with external tools. Use "
+"<xref linkend=\"ST_Dump\"/> to convert the polygonized result into separate "
+"polygons."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Polygonized result"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Polygonizing a table of linestrings:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Dump\"/>, <xref linkend=\"ST_Node\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a valid geometry with points rounded to a grid tolerance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a valid geometry with all points rounded to the provided grid "
+"tolerance, and features below the tolerance removed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unlike <xref linkend=\"ST_SnapToGrid\"/> the returned geometry will be "
+"valid, with no ring self-intersections or collapsed components."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Precision reduction can be used to:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "match coordinate precision to the data accuracy"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "reduce the number of coordinates needed to represent a geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ensure valid geometry output to formats which use lower precision (e.g. text "
+"formats such as WKT, GeoJSON or KML when the number of output decimal places "
+"is limited)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"export valid geometry to systems which use lower or limited precision (e.g. "
+"SDE, Oracle tolerance value)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Precision reduction can reduce number of vertices"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Precision reduction splits polygons if needed to ensure validity"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Simplify\"/>, <xref linkend=\"ST_SimplifyVW\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a collection containing paths shared by the two input linestrings/"
+"multilinestrings."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a collection containing paths shared by the two input geometries. "
+"Those going in the same direction are in the first element of the "
+"collection, those going in the opposite direction are in the second element. "
+"The paths themselves are given in the direction of the first geometry."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Finding shared paths"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A multilinestring and a linestring"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The shared path of multilinestring and linestring overlaid with original "
+"geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_GeometryN\"/>, <xref linkend=\"ST_NumGeometries\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a simplified representation of a geometry, using the Douglas-Peucker "
+"algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a simplified representation of a geometry using the <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/"
+"Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm\">Douglas-Peucker algorithm</"
+"link>. The simplification <varname>tolerance</varname> is a distance value, "
+"in the units of the input SRS. Simplification removes vertices which are "
+"within the tolerance distance of the simplified linework. The result may not "
+"be valid even if the input is."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function can be called with any kind of geometry (including "
+"GeometryCollections), but only line and polygon elements are simplified. "
+"Endpoints of linear geometry are preserved."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>preserveCollapsed</varname> flag retains small geometries that "
+"would otherwise be removed at the given tolerance. For example, if a 1m long "
+"line is simplified with a 10m tolerance, when <varname>preserveCollapsed</"
+"varname> is true the line will not disappear. This flag is useful for "
+"rendering purposes, to prevent very small features disappearing from a map."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The returned geometry may lose its simplicity (see <xref "
+"linkend=\"ST_IsSimple\"/>), topology may not be preserved, and polygonal "
+"results may be invalid (see <xref linkend=\"ST_IsValid\"/>). Use <xref "
+"linkend=\"ST_SimplifyPreserveTopology\"/> to preserve topology and ensure "
+"validity."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not preserve boundaries shared between polygons. Use "
+"<xref linkend=\"ST_CoverageSimplify\"/> if this is required."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A circle simplified too much becomes a triangle, medium an octagon,"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplifying a set of lines. Lines may intersect after simplification."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplifying a MultiPolygon. Polygonal results may be invalid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SimplifyPreserveTopology\"/>, <xref "
+"linkend=\"ST_SimplifyVW\"/>, <xref linkend=\"ST_CoverageSimplify\"/>, "
+"Topology <xref linkend=\"TP_ST_Simplify\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a simplified and valid representation of a geometry, using the "
+"Douglas-Peucker algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a simplified representation of a geometry using a variant of the "
+"<link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm\">Douglas-Peucker algorithm</"
+"link> which limits simplification to ensure the result has the same topology "
+"as the input. The simplification <varname>tolerance</varname> is a distance "
+"value, in the units of the input SRS. Simplification removes vertices which "
+"are within the tolerance distance of the simplified linework, as long as "
+"topology is preserved. The result will be valid and simple if the input is."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function can be called with any kind of geometry (including "
+"GeometryCollections), but only line and polygon elements are simplified. For "
+"polygonal inputs, the result will have the same number of rings (shells and "
+"holes), and the rings will not cross. Ring endpoints may be simplified. For "
+"linear inputs, the result will have the same number of lines, and lines will "
+"not intersect if they did not do so in the original geometry. Endpoints of "
+"linear geometry are preserved."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.3.3"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the same example as <xref linkend=\"ST_Simplify\"/>, "
+"ST_SimplifyPreserveTopology prevents oversimplification. The circle can at "
+"most become a square."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Simplifying a set of lines, preserving topology of non-intersecting lines."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplifying a MultiPolygon, preserving topology of shells and holes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SimplifyVW\"/>, <xref linkend=\"ST_CoverageSimplify\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes a simplified topology-preserving outer or inner hull of a polygonal "
+"geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a simplified topology-preserving outer or inner hull of a polygonal "
+"geometry. An outer hull completely covers the input geometry. An inner hull "
+"is completely covered by the input geometry. The result is a polygonal "
+"geometry formed by a subset of the input vertices. MultiPolygons and holes "
+"are handled and produce a result with the same structure as the input."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The reduction in vertex count is controlled by the <varname>vertex_fraction</"
+"varname> parameter, which is a number in the range 0 to 1. Lower values "
+"produce simpler results, with smaller vertex count and less concaveness. For "
+"both outer and inner hulls a vertex fraction of 1.0 produces the original "
+"geometry. For outer hulls a value of 0.0 produces the convex hull (for a "
+"single polygon); for inner hulls it produces a triangle."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The simplification process operates by progressively removing concave "
+"corners that contain the least amount of area, until the vertex count target "
+"is reached. It prevents edges from crossing, so the result is always a valid "
+"polygonal geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To get better results with geometries that contain relatively long line "
+"segments, it might be necessary to \"segmentize\" the input, as shown below."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.3.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS >= 3.11.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Outer hull of a Polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Inner hull of a Polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Outer hull simplification of a MultiPolygon, with segmentization"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SimplifyVW\"/>, <xref linkend=\"ST_ConcaveHull\"/>, "
+"<xref linkend=\"ST_Segmentize\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a simplified representation of a geometry, using the Visvalingam-"
+"Whyatt algorithm"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a simplified representation of a geometry using the <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/"
+"Visvalingam%E2%80%93Whyatt_algorithm\">Visvalingam-Whyatt algorithm</link>. "
+"The simplification <varname>tolerance</varname> is an area value, in the "
+"units of the input SRS. Simplification removes vertices which form "
+"\"corners\" with area less than the tolerance. The result may not be valid "
+"even if the input is."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The returned geometry may lose its simplicity (see <xref "
+"linkend=\"ST_IsSimple\"/>), topology may not be preserved, and polygonal "
+"results may be invalid (see <xref linkend=\"ST_IsValid\"/>). Use <xref "
+"linkend=\"ST_SimplifyPreserveTopology\"/> to preserve topology and ensure "
+"validity. <xref linkend=\"ST_CoverageSimplify\"/> also preserves topology "
+"and validity."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function handles 3D and the third dimension will affect the result."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A LineString is simplified with a minimum-area tolerance of 30."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplifying a line."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplifying a polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Simplify\"/>, <xref "
+"linkend=\"ST_SimplifyPreserveTopology\"/>, <xref "
+"linkend=\"ST_CoverageSimplify\"/>, Topology <xref linkend=\"TP_ST_Simplify\"/"
+">"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Sets the effective area for each vertex, using the Visvalingam-Whyatt "
+"algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the effective area for each vertex, using the Visvalingam-Whyatt "
+"algorithm. The effective area is stored as the M-value of the vertex. If the "
+"optional \"threshold\" parameter is used, a simplified geometry will be "
+"returned, containing only vertices with an effective area greater than or "
+"equal to the threshold value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function can be used for server-side simplification when a threshold is "
+"specified. Another option is to use a threshold value of zero. In this case, "
+"the full geometry will be returned with effective areas as M-values, which "
+"can be used by the client to simplify very quickly."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Will actually do something only with (multi)lines and (multi)polygons but "
+"you can safely call it with any kind of geometry. Since simplification "
+"occurs on a object-by-object basis you can also feed a GeometryCollection to "
+"this function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that returned geometry might lose its simplicity (see <xref "
+"linkend=\"ST_IsSimple\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note topology may not be preserved and may result in invalid geometries. Use "
+"(see <xref linkend=\"ST_SimplifyPreserveTopology\"/>) to preserve topology."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The output geometry will lose all previous information in the M-values"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function handles 3D and the third dimension will affect the effective "
+"area"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculating the effective area of a LineString. Because we use a threshold "
+"value of zero, all vertices in the input geometry are returned."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the constrained Delaunay triangulation of polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the constrained Delaunay triangulation of polygons. Holes and "
+"Multipolygons are supported."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The \"constrained Delaunay triangulation\" of a polygon is a set of "
+"triangles formed from the vertices of the polygon, and covering it exactly, "
+"with the maximum total interior angle over all possible triangulations. It "
+"provides the \"best quality\" triangulation of the polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Triangulation of a square."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Triangulation of the letter P."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Polygon Triangulation"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Same example as ST_Tesselate"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "ST_AsText output"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Triangulated Polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DelaunayTriangles\"/>, <xref linkend=\"ST_Tesselate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the boundaries of the Voronoi diagram of the vertices of a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a two-dimensional <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Voronoi_diagram\">Voronoi diagram</link> from the vertices of the supplied "
+"geometry and returns the boundaries between cells in the diagram as a "
+"MultiLineString. Returns null if input geometry is null. Returns an empty "
+"geometry collection if the input geometry contains only one vertex. Returns "
+"an empty geometry collection if the <varname>extend_to</varname> envelope "
+"has zero area."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Optional parameters:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>tolerance</varname>: The distance within which vertices will be "
+"considered equivalent. Robustness of the algorithm can be improved by "
+"supplying a nonzero tolerance distance. (default = 0.0)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>extend_to</varname>: If present, the diagram is extended to cover "
+"the envelope of the supplied geometry, unless smaller than the default "
+"envelope (default = NULL, default envelope is the bounding box of the input "
+"expanded by about 50%)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Voronoi diagram lines, with tolerance of 30 units"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_VoronoiPolygons\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the cells of the Voronoi diagram of the vertices of a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes a two-dimensional <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Voronoi_diagram\">Voronoi diagram</link> from the vertices of the supplied "
+"geometry. The result is a GEOMETRYCOLLECTION of POLYGONs that covers an "
+"envelope larger than the extent of the input vertices. Returns null if input "
+"geometry is null. Returns an empty geometry collection if the input geometry "
+"contains only one vertex. Returns an empty geometry collection if the "
+"<varname>extend_to</varname> envelope has zero area."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Points overlaid on top of Voronoi diagram"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Voronoi diagram, with tolerance of 30 units"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_VoronoiLines\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Reference"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>raster</varname> is a PostGIS type for storing and analyzing raster "
+"data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For loading rasters from raster files please refer to <xref "
+"linkend=\"RT_Loading_Rasters\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Some examples in this reference use a raster table of dummy data, created "
+"with the following code:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions below are ones which a user of PostGIS Raster is likely to "
+"need. There are other raster support functions which are not of interest to "
+"a general user."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Support Data types"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the PostgreSQL data types specifically created to support "
+"raster functionality."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A spatial datatype with two fields - geom (holding a geometry object) and "
+"val (holding a double precision pixel value from a raster band)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"geomval is a compound data type consisting of a geometry object referenced "
+"by the .geom field and val, a double precision value that represents the "
+"pixel value at a particular geometric location in a raster band. It is used "
+"by the ST_DumpAsPolygon and Raster intersection family of functions as an "
+"output type to explode a raster band into geometry polygons."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>A composite type used as input into the ST_AddBand function "
+"defining the attributes and initial value of the new band.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>A composite type used as input into the ST_AddBand function defining "
+"the attributes and initial value of the new band.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"1-based value indicating the position where the new band will be added "
+"amongst the raster's bands. If NULL, the new band will be added at the end "
+"of the raster's bands."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Pixel type of the new band. One of defined pixel types as described in <xref "
+"linkend=\"RT_ST_BandPixelType\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Initial value that all pixels of new band will be set to."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NODATA value of the new band. If NULL, the new band will not have a NODATA "
+"value assigned."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>A composite type for use when needing to express a raster and a "
+"band index of that raster.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>A composite type for use when needing to express a raster and a band "
+"index of that raster.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The raster in question/"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "1-based value indicating the band of raster"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "raster spatial data type."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"raster is a spatial data type used to represent raster data such as those "
+"imported from JPEGs, TIFFs, PNGs, digital elevation models. Each raster has "
+"1 or more bands each having a set of pixel values. Rasters can be "
+"georeferenced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Requires PostGIS be compiled with GDAL support. Currently rasters can be "
+"implicitly converted to geometry type, but the conversion returns the <xref "
+"linkend=\"RT_ST_ConvexHull\"/> of the raster. This auto casting may be "
+"removed in the near future so don't rely on it."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A composite type used as input into the ST_Reclass function defining the "
+"behavior of reclassification."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A composite type used as input into the <xref linkend=\"RT_ST_Reclass\"/> "
+"function defining the behavior of reclassification."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The band number of band to reclassify."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"range expression consisting of comma delimited range:map_range mappings. : "
+"to define mapping that defines how to map old band values to new band "
+"values. ( means >, ) means less than, ] < or equal, [ means > or "
+"equal"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "( notation is optional so a-b means the same as (a-b)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"One of defined pixel types as described in <xref "
+"linkend=\"RT_ST_BandPixelType\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Value to treat as no data. For image outputs that support transparency, "
+"these will be blank."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Reclassify band 2 as an 8BUI where 255 is nodata value"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Reclassify band 1 as an 1BB and no nodata value defined"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"A composite type returned by the ST_SummaryStats and ST_SummaryStatsAgg "
+"functions."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A composite type returned by the <xref linkend=\"RT_ST_SummaryStats\"/> and "
+"<xref linkend=\"RT_ST_SummaryStatsAgg\"/> functions."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "count integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Number of pixels counted for the summary statistics."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "sum double precision"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Sum of all counted pixel values."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "mean double precision"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Arithmetic mean of all counted pixel values."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "stddev double precision"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Standard deviation of all counted pixel values."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "min double precision"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Minimum value of counted pixel values."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "max double precision"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Maximum value of counted pixel values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SummaryStatsAgg\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>A composite type used as input into the ST_Union function "
+"defining the bands to be processed and behavior of the UNION operation.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>A composite type used as input into the ST_Union function defining the "
+"bands to be processed and behavior of the UNION operation.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "1-based value indicating the band of each input raster to be processed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Type of UNION operation. One of defined types as described in <xref "
+"linkend=\"RT_ST_Union\"/>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Management"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Adds raster constraints to a loaded raster table for a specific column that "
+"constrains spatial ref, scaling, blocksize, alignment, bands, band type and "
+"a flag to denote if raster column is regularly blocked. The table must be "
+"loaded with data for the constraints to be inferred. Returns true if the "
+"constraint setting was accomplished and issues a notice otherwise."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates constraints on a raster column that are used to display "
+"information in the <varname>raster_columns</varname> raster catalog. The "
+"<varname>rastschema</varname> is the name of the table schema the table "
+"resides in. The <varname>srid</varname> must be an integer value reference "
+"to an entry in the SPATIAL_REF_SYS table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>raster2pgsql</varname> loader uses this function to register raster "
+"tables"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Valid constraint names to pass in: refer to <xref "
+"linkend=\"RT_Raster_Columns\"/> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>blocksize</varname> sets both X and Y blocksize"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>blocksize_x</varname> sets X tile (width in pixels of each tile)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>blocksize_y</varname> sets Y tile (height in pixels of each tile)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>extent</varname> computes extent of whole table and applies "
+"constraint all rasters must be within that extent"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>num_bands</varname> number of bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>pixel_types</varname> reads array of pixel types for each band "
+"ensure all band n have same pixel type"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>regular_blocking</varname> sets spatially unique (no two rasters "
+"can be spatially the same) and coverage tile (raster is aligned to a "
+"coverage) constraints"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>same_alignment</varname> ensures they all have same alignment "
+"meaning any two tiles you compare will return true for. Refer to <xref "
+"linkend=\"RT_ST_SameAlignment\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>srid</varname> ensures all have same srid"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "More -- any listed as inputs into the above functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function infers the constraints from the data already present in the "
+"table. As such for it to work, you must create the raster column first and "
+"then load it with data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you need to load more data in your tables after you have already applied "
+"constraints, you may want to run the DropRasterConstraints if the extent of "
+"your data has changed."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Apply all possible constraints on column based on data"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Apply single constraint"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AddBand\"/>, <xref linkend=\"RT_ST_MakeEmptyRaster\"/"
+">, <xref linkend=\"RT_DropRasterConstraints\"/>, <xref "
+"linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Drops PostGIS raster constraints that refer to a raster table column. Useful "
+"if you need to reload data or update your raster column data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Drops PostGIS raster constraints that refer to a raster table column that "
+"were added by <xref linkend=\"RT_AddRasterConstraints\"/>. Useful if you "
+"need to load more data or update your raster column data. You do not need to "
+"do this if you want to get rid of a raster table or a raster column."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "To drop a raster table use the standard"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To drop just a raster column and leave the rest of the table, use standard "
+"SQL"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the table will disappear from the <varname>raster_columns</varname> catalog "
+"if the column or table is dropped. However if only the constraints are "
+"dropped, the raster column will still be listed in the "
+"<varname>raster_columns</varname> catalog, but there will be no other "
+"information about it aside from the column name and table."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tag a raster column as being an overview of another."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Adds constraints on a raster column that are used to display information in "
+"the <varname>raster_overviews</varname> raster catalog."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>ovfactor</varname> parameter represents the scale multiplier in "
+"the overview column: higher overview factors have lower resolution."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When the <varname>ovschema</varname> and <varname>refschema</varname> "
+"parameters are omitted, the first table found scanning the "
+"<varname>search_path</varname> will be used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_DropOverviewConstraints\"/>, <xref "
+"linkend=\"RT_CreateOverview\"/>, <xref linkend=\"RT_AddRasterConstraints\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Untag a raster column from being an overview of another."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Remove from a raster column the constraints used to show it as being an "
+"overview of another in the <varname>raster_overviews</varname> raster "
+"catalog."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When the <varname>ovschema</varname> parameter is omitted, the first table "
+"found scanning the <varname>search_path</varname> will be used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_AddOverviewConstraints\"/>, <xref "
+"linkend=\"RT_DropRasterConstraints\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Reports the version of the GDAL library in use by PostGIS."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reports the version of the GDAL library in use by PostGIS. Will also check "
+"and report if GDAL can find its data files."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Reports full raster library build date."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Reports raster build date"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Reports full raster version and build configuration infos.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Reports full raster version and build configuration infos.</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a list of raster formats supported by PostGIS through GDAL. Only "
+"those formats with can_write=True can be used by ST_AsGDALRaster"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a list of raster formats short_name,long_name and creator options of "
+"each format supported by GDAL. Use the short_name as input in the "
+"<varname>format</varname> parameter of <xref linkend=\"RT_ST_AsGDALRaster\"/"
+">. Options vary depending on what drivers your libgdal was compiled with. "
+"<varname>create_options</varname> returns an xml formatted set of "
+"CreationOptionList/Option consisting of name and optional <varname>type</"
+"varname>, <varname>description</varname> and set of <varname>VALUE</varname> "
+"for each creator option for the specific driver."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.5.0 - add can_read and can_write columns."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.6, 2.1.3 - by default no drivers are enabled, unless GUC or "
+"Environment variable gdal_enabled_drivers is set."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0 - requires GDAL >= 1.6.0."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: List of Drivers"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: List of options for each driver"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SRID\"/>, <xref "
+"linkend=\"postgis_gdal_enabled_drivers\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Generates a set of vector contours from the provided raster "
+"band, using the <link xlink:href=\"https://gdal.org/api/gdal_alg.html?"
+"highlight=contour#_CPPv421GDALContourGenerateEx15GDALRasterBandHPv12CSLConstList16GDALProgressFuncPv\">GDAL "
+"contouring algorithm</link>.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Generates a set of vector contours from the provided raster band, "
+"using the <link xlink:href=\"https://gdal.org/api/gdal_alg.html?"
+"highlight=contour#_CPPv421GDALContourGenerateEx15GDALRasterBandHPv12CSLConstList16GDALProgressFuncPv\">GDAL "
+"contouring algorithm</link>.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When the <varname>fixed_levels</varname> parameter is a non-empty array, the "
+"<varname>level_interval</varname> and <varname>level_base</varname> "
+"parameters are ignored."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Input parameters are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The raster to generate the contour of"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The band to generate the contour of"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The elevation interval between contours generated"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The \"base\" relative to which contour intervals are applied, this is "
+"normally zero, but could be different. To generate 10m contours at 5, 15, "
+"25, ... the LEVEL_BASE would be 5."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <literal>true</literal>, contour polygons will be created, rather than "
+"polygon lines."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Return values are a set of records with the following attributes:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The geometry of the contour line."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A unique identifier given to the contour line by GDAL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The raster value the line represents. For an elevation DEM input, this would "
+"be the elevation of the output contour."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Interpolates a gridded surface based on an input set of 3-d points, using "
+"the X- and Y-values to position the points on the grid and the Z-value of "
+"the points as the surface elevation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Interpolates a gridded surface based on an input set of 3-d points, using "
+"the X- and Y-values to position the points on the grid and the Z-value of "
+"the points as the surface elevation. There are five interpolation algorithms "
+"available: inverse distance, inverse distance nearest-neighbor, moving "
+"average, nearest neighbor, and linear interpolation. See the <link xlink:"
+"href=\"https://gdal.org/programs/gdal_grid.html#interpolation-"
+"algorithms\">gdal_grid documentation</link> for more details on the "
+"algorithms and their parameters. For more information on how interpolations "
+"are calculated, see the <link xlink:href=\"https://gdal.org/tutorials/"
+"gdal_grid_tut.html\">GDAL grid tutorial</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The points to drive the interpolation. Any geometry with Z-values is "
+"acceptable, all points in the input will be used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A string defining the algorithm and algorithm options, in the format used by "
+"<link xlink:href=\"https://gdal.org/programs/gdal_grid.html#interpolation-"
+"algorithms\">gdal_grid</link>. For example, for an inverse-distance "
+"interpolation with a smoothing of 2, you would use \"invdist:smoothing=2.0\""
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A raster template to drive the geometry of the output raster. The width, "
+"height, pixel size, spatial extent and pixel type will be read from this "
+"template."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default the first band in the template raster is used to drive the output "
+"raster, but that can be adjusted with this parameter."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Change the SRID of all rasters in the user-specified column and table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Change the SRID of all rasters in the user-specified column and table. The "
+"function will drop all appropriate column constraints (extent, alignment and "
+"SRID) before changing the SRID of the specified column's rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The data (band pixel values) of the rasters are not touched by this "
+"function. Only the raster's metadata is changed."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Create an reduced resolution version of a given raster coverage."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create an overview table with resampled tiles from the source table. Output "
+"tiles will have the same size of input tiles and cover the same spatial "
+"extent with a lower resolution (pixel size will be 1/<varname>factor</"
+"varname> of the original in both directions)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The overview table will be made available in the <varname>raster_overviews</"
+"varname> catalog and will have raster constraints enforced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Algorithm options are: 'NearestNeighbor', 'Bilinear', 'Cubic', "
+"'CubicSpline', and 'Lanczos'. Refer to: <link xlink:href=\"http://www.gdal."
+"org/gdalwarp.html\">GDAL Warp resampling methods</link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Output to generally better quality but slower to product format"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Output to faster to process default nearest neighbor"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_AddOverviewConstraints\"/>, <xref "
+"linkend=\"RT_AddRasterConstraints\"/>, <xref linkend=\"RT_Raster_Overviews\"/"
+">"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Constructors"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a raster with the new band(s) of given type added with given initial "
+"value in the given index location. If no index is specified, the band is "
+"added to the end."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a raster with a new band added in given position (index), of given "
+"type, of given initial value, and of given nodata value. If no index is "
+"specified, the band is added to the end. If no <varname>fromband</varname> "
+"is specified, band 1 is assumed. Pixel type is a string representation of "
+"one of the pixel types specified in <xref linkend=\"RT_ST_BandPixelType\"/>. "
+"If an existing index is specified all subsequent bands >= that index are "
+"incremented by 1. If an initial value greater than the max of the pixel type "
+"is specified, then the initial value is set to the highest value allowed by "
+"the pixel type."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the variant that takes an array of <xref linkend=\"addbandarg\"/> "
+"(Variant 1), a specific addbandarg's index value is relative to the raster "
+"at the time when the band described by that addbandarg is being added to the "
+"raster. See the Multiple New Bands example below."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the variant that takes an array of rasters (Variant 5), if "
+"<varname>torast</varname> is NULL then the <varname>fromband</varname> band "
+"of each raster in the array is accumulated into a new raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the variants that take <varname>outdbfile</varname> (Variants 6 and 7), "
+"the value must include the full path to the raster file. The file must also "
+"be accessible to the postgres server process."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 support for addbandarg added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 support for new out-db bands added."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Single New Band"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Multiple New Bands"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: New Out-db band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_BandPixelType\"/>, <xref "
+"linkend=\"RT_ST_MakeEmptyRaster\"/>, <xref linkend=\"RT_ST_MetaData\"/>, "
+"<xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=\"RT_ST_Reclass\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Converts a PostGIS geometry to a PostGIS raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Converts a PostGIS geometry to a PostGIS raster. The many variants offers "
+"three groups of possibilities for setting the alignment and pixelsize of the "
+"resulting raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The first group, composed of the two first variants, produce a raster having "
+"the same alignment (<varname>scalex</varname>, <varname>scaley</varname>, "
+"<varname>gridx</varname> and <varname>gridy</varname>), pixel type and "
+"nodata value as the provided reference raster. You generally pass this "
+"reference raster by joining the table containing the geometry with the table "
+"containing the reference raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The second group, composed of four variants, let you set the dimensions of "
+"the raster by providing the parameters of a pixel size (<varname>scalex</"
+"varname> & <varname>scaley</varname> and <varname>skewx</varname> & "
+"<varname>skewy</varname>). The <varname>width</varname> & "
+"<varname>height</varname> of the resulting raster will be adjusted to fit "
+"the extent of the geometry. In most cases, you must cast integer "
+"<varname>scalex</varname> & <varname>scaley</varname> arguments to "
+"double precision so that PostgreSQL choose the right variant."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The third group, composed of four variants, let you fix the dimensions of "
+"the raster by providing the dimensions of the raster (<varname>width</"
+"varname> & <varname>height</varname>). The parameters of the pixel size "
+"(<varname>scalex</varname> & <varname>scaley</varname> and "
+"<varname>skewx</varname> & <varname>skewy</varname>) of the resulting "
+"raster will be adjusted to fit the extent of the geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The two first variants of each of those two last groups let you specify the "
+"alignment with an arbitrary corner of the alignment grid (<varname>gridx</"
+"varname> & <varname>gridy</varname>) and the two last variants takes the "
+"upper left corner (<varname>upperleftx</varname> & <varname>upperlefty</"
+"varname>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Each group of variant allows producing a one band raster or a multiple bands "
+"raster. To produce a multiple bands raster, you must provide an array of "
+"pixel types (<varname>pixeltype[]</varname>), an array of initial values "
+"(<varname>value</varname>) and an array of nodata values "
+"(<varname>nodataval</varname>). If not provided pixeltyped defaults to 8BUI, "
+"values to 1 and nodataval to 0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The output raster will be in the same spatial reference as the source "
+"geometry. The only exception is for variants with a reference raster. In "
+"this case the resulting raster will get the same SRID as the reference "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The optional <varname>touched</varname> parameter defaults to false and maps "
+"to the GDAL ALL_TOUCHED rasterization option, which determines if pixels "
+"touched by lines or polygons will be burned. Not just those on the line "
+"render path, or whose center point is within the polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is particularly useful for rendering jpegs and pngs of geometries "
+"directly from the database when using in combination with <xref "
+"linkend=\"RT_ST_AsPNG\"/> and other <xref linkend=\"RT_ST_AsGDALRaster\"/> "
+"family of functions."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Not yet capable of rendering complex geometry types such as curves, TINS, "
+"and PolyhedralSurfaces, but should be able too once GDAL can."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Output geometries as PNG files"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "black circle"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "example from buffer rendered with just PostGIS"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Buffer\"/>, <xref linkend=\"RT_ST_GDALDrivers\"/>, "
+"<xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, "
+"<xref linkend=\"RT_ST_AsJPEG\"/>, <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Aggregate. Renders PostGIS geometries into a new raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a single-band raster containing the rendered version of all incoming "
+"geometries, each with its associated value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_DumpAsPolygons\"/>, <xref linkend=\"RT_ST_Union\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns one or more bands of an existing raster as a new raster. Useful for "
+"building new rasters from existing rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns one or more bands of an existing raster as a new raster. Useful for "
+"building new rasters from existing rasters or export of only selected bands "
+"of a raster or rearranging the order of bands in a raster. If no band is "
+"specified or any of specified bands does not exist in the raster, then all "
+"bands are returned. Used as a helper function in various functions such as "
+"for deleting a band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the <code>nbands</code> as text variant of function, the default "
+"delimiter is <code>,</code> which means you can ask for <code>'1,2,3'</code> "
+"and if you wanted to use a different delimiter you would do "
+"<code>ST_Band(rast, '1@2@3', '@')</code>. For asking for multiple bands, we "
+"strongly suggest you use the array form of this function e.g. "
+"<code>ST_Band(rast, '{1,2,3}'::int[]);</code> since the <code>text</code> "
+"list of bands form may be removed in future versions of PostGIS."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "original (column rast)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "dupe_band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "sing_band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=\"RT_ST_Reclass\"/>, "
+"<xref linkend=\"RT_reference\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Cover georeferenced area with a grid of empty raster tiles."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a set of raster tiles with <xref linkend=\"RT_ST_MakeEmptyRaster\"/>. "
+"Grid dimension is <varname>width</varname> & <varname>height</varname>. "
+"Tile dimension is <varname>tilewidth</varname> & <varname>tileheight</"
+"varname>. The covered georeferenced area is from upper left corner "
+"(<varname>upperleftx</varname>, <varname>upperlefty</varname>) to lower "
+"right corner (<varname>upperleftx</varname> + <varname>width</varname> * "
+"<varname>scalex</varname>, <varname>upperlefty</varname> + <varname>height</"
+"varname> * <varname>scaley</varname>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that scaley is generally negative for rasters and scalex is generally "
+"positive. So lower right corner will have a lower y value and higher x value "
+"than the upper left corner."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples Basic"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create 16 tiles in a 4x4 grid to cover the WGS84 area from upper left corner "
+"(22, 77) to lower right corner (55, 33)."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns an empty raster (having no bands) of given dimensions (width & "
+"height), upperleft X and Y, pixel size and rotation (scalex, scaley, skewx "
+"& skewy) and reference system (srid). If a raster is passed in, returns "
+"a new raster with the same size, alignment and SRID. If srid is left out, "
+"the spatial ref is set to unknown (0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns an empty raster (having no band) of given dimensions (width & "
+"height) and georeferenced in spatial (or world) coordinates with upper left "
+"X (upperleftx), upper left Y (upperlefty), pixel size and rotation (scalex, "
+"scaley, skewx & skewy) and reference system (srid)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The last version use a single parameter to specify the pixel size "
+"(pixelsize). scalex is set to this argument and scaley is set to the "
+"negative value of this argument. skewx and skewy are set to 0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If an existing raster is passed in, it returns a new raster with the same "
+"meta data settings (without the bands)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no srid is specified it defaults to 0. After you create an empty raster "
+"you probably want to add bands to it and maybe edit it. Refer to <xref "
+"linkend=\"RT_ST_AddBand\"/> to define bands and <xref "
+"linkend=\"RT_ST_SetValue\"/> to set initial pixel values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MetaData\"/>, <xref linkend=\"RT_ST_ScaleX\"/>, "
+"<xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_ST_SetValue\"/>, <xref "
+"linkend=\"RT_ST_SkewX\"/>, , <xref linkend=\"RT_ST_SkewY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns a set of rasters resulting from the split of the input "
+"raster based upon the desired dimensions of the output rasters.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns a set of rasters resulting from the split of the input raster "
+"based upon the desired dimensions of the output rasters.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>padwithnodata</varname> = FALSE, edge tiles on the right and "
+"bottom sides of the raster may have different dimensions than the rest of "
+"the tiles. If <varname>padwithnodata</varname> = TRUE, all tiles will have "
+"the same dimensions with the possibility that edge tiles being padded with "
+"NODATA values. If raster band(s) do not have NODATA value(s) specified, one "
+"can be specified by setting <varname>nodataval</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If a specified band of the input raster is out-of-db, the corresponding band "
+"in the output rasters will also be out-of-db."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_Retile\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a set of configured tiles from an arbitrarily tiled raster coverage."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a set of tiles having the specified scale (<varname>sfx</varname>, "
+"<varname>sfy</varname>) and max size (<varname>tw</varname>, <varname>th</"
+"varname>) and covering the specified extent (<varname>ext</varname>) with "
+"data coming from the specified raster coverage (<varname>tab</varname>, "
+"<varname>col</varname>)."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a raster from a supported GDAL raster file."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a raster from a supported GDAL raster file. <varname>gdaldata</"
+"varname> is of type bytea and should be the contents of the GDAL raster file."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>srid</varname> is NULL, the function will try to automatically "
+"assign the SRID from the GDAL raster. If <varname>srid</varname> is "
+"provided, the value provided will override any automatically assigned SRID."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Accessors"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the georeference meta data in GDAL or ESRI format as commonly seen "
+"in a world file. Default is GDAL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the georeference meta data including carriage return in GDAL or ESRI "
+"format as commonly seen in a <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"World_file\">world file</link>. Default is GDAL if no type specified. type "
+"is string 'GDAL' or 'ESRI'."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Difference between format representations is as follows:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>GDAL</varname>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>ESRI</varname>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the height of the raster in pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the height of the raster."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns true if the raster is empty (width = 0 and height = 0). "
+"Otherwise, returns false.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns true if the raster is empty (width = 0 and height = 0). "
+"Otherwise, returns false.</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the amount of space (in bytes) the raster takes.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns the amount of space (in bytes) the raster takes.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a nice compliment to PostgreSQL built in functions pg_column_size, "
+"pg_size_pretty, pg_relation_size, pg_total_relation_size."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"pg_relation_size which gives the byte size of a table may return byte size "
+"lower than ST_MemSize. This is because pg_relation_size does not add toasted "
+"table contribution and large geometries are stored in TOAST tables. "
+"pg_column_size might return lower because it returns the compressed size."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns basic meta data about a raster object such as pixel size, rotation "
+"(skew), upper, lower left, etc."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns basic meta data about a raster object such as pixel size, rotation "
+"(skew), upper, lower left, etc. Columns returned: upperleftx | upperlefty | "
+"width | height | scalex | scaley | skewx | skewy | srid | numbands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_NumBands\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the number of bands in the raster object.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns the number of bands in the raster object.</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the pixel height in geometric units of the spatial reference system."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the height of a pixel in geometric units of the spatial reference "
+"system. In the common case where there is no skew, the pixel height is just "
+"the scale ratio between geometric coordinates and raster pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to <xref linkend=\"RT_ST_PixelWidth\"/> for a diagrammatic "
+"visualization of the relationship."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Rasters with no skew"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Rasters with skew different than 0"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref "
+"linkend=\"RT_ST_SkewX\"/>, <xref linkend=\"RT_ST_SkewY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the pixel width in geometric units of the spatial reference system."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the width of a pixel in geometric units of the spatial reference "
+"system. In the common case where there is no skew, the pixel width is just "
+"the scale ratio between geometric coordinates and raster pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The following diagram demonstrates the relationship:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Pixel Height: Pixel size in the j direction"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Pixel Width: Pixel size in the i direction"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the X component of the pixel width in units of coordinate reference "
+"system."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the X component of the pixel width in units of coordinate reference "
+"system. Refer to <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"World_file\">World File</link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0. In WKTRaster versions this was called ST_PixelSizeX."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the Y component of the pixel height in units of coordinate reference "
+"system."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the Y component of the pixel height in units of coordinate reference "
+"system. May be negative. Refer to <link xlink:href=\"http://en.wikipedia.org/"
+"wiki/World_file\">World File</link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.0.0. In WKTRaster versions this was called ST_PixelSizeY."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the raster's upper left corner as geometric X and Y (longitude and "
+"latitude) given a column and row. Column and row starts at 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the upper left corner as geometric X and Y (longitude and latitude) "
+"given a column and row. Returned X and Y are in geometric units of the "
+"georeferenced raster. Numbering of column and row starts at 1 but if either "
+"parameter is passed a zero, a negative number or a number greater than the "
+"respective dimension of the raster, it will return coordinates outside of "
+"the raster assuming the raster's grid is applicable outside the raster's "
+"bounds."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref "
+"linkend=\"RT_ST_SetSkew\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the geometric X coordinate upper left of a raster, column and row. "
+"Numbering of columns and rows starts at 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the upper left X coordinate of a raster column row in geometric "
+"units of the georeferenced raster. Numbering of columns and rows starts at 1 "
+"but if you pass in a negative number or number higher than number of columns "
+"in raster, it will give you coordinates outside of the raster file to left "
+"or right with the assumption that the skew and pixel sizes are same as "
+"selected raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For non-skewed rasters, providing the X column is sufficient. For skewed "
+"rasters, the georeferenced coordinate is a function of the ST_ScaleX and "
+"ST_SkewX and row and column. An error will be raised if you give just the X "
+"column for a skewed raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordX"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref "
+"linkend=\"RT_ST_SetSkew\"/>, <xref linkend=\"RT_ST_SkewX\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the geometric Y coordinate upper left corner of a raster, column and "
+"row. Numbering of columns and rows starts at 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the upper left Y coordinate of a raster column row in geometric "
+"units of the georeferenced raster. Numbering of columns and rows starts at 1 "
+"but if you pass in a negative number or number higher than number of columns/"
+"rows in raster, it will give you coordinates outside of the raster file to "
+"left or right with the assumption that the skew and pixel sizes are same as "
+"selected raster tile."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For non-skewed rasters, providing the Y column is sufficient. For skewed "
+"rasters, the georeferenced coordinate is a function of the ST_ScaleY and "
+"ST_SkewY and row and column. An error will be raised if you give just the Y "
+"row for a skewed raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordY"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_RasterToWorldCoordX\"/>, <xref "
+"linkend=\"RT_ST_SetSkew\"/>, <xref linkend=\"RT_ST_SkewY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the rotation of the raster in radian."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the uniform rotation of the raster in radian. If a raster does not "
+"have uniform rotation, NaN is returned. Refer to <link xlink:href=\"http://"
+"en.wikipedia.org/wiki/World_file\">World File</link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetScale\"/>, <xref linkend=\"RT_ST_SetSkew\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the georeference X skew (or rotation parameter)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the georeference X skew (or rotation parameter). Refer to <link "
+"xlink:href=\"http://en.wikipedia.org/wiki/World_file\">World File</link> for "
+"more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SkewY\"/>, <xref linkend=\"RT_ST_SetSkew\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the georeference Y skew (or rotation parameter)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the georeference Y skew (or rotation parameter). Refer to <link "
+"xlink:href=\"http://en.wikipedia.org/wiki/World_file\">World File</link> for "
+"more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SkewX\"/>, <xref linkend=\"RT_ST_SetSkew\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the spatial reference identifier of the raster as defined in "
+"spatial_ref_sys table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the spatial reference identifier of the raster object as defined in "
+"the spatial_ref_sys table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"From PostGIS 2.0+ the srid of a non-georeferenced raster/geometry is 0 "
+"instead of the prior -1."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns a text summary of the contents of the raster.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns a text summary of the contents of the raster.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_BandMetaData\"/>, <xref linkend=\"ST_Summary\"/> "
+"<xref linkend=\"ST_Extent\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the upper left X coordinate of raster in projected "
+"spatial ref.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the upper left X coordinate of raster in projected spatial ref."
+"</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_GeoReference\"/>, <xref linkend=\"RT_Box3D\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the upper left Y coordinate of raster in projected "
+"spatial ref.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the upper left Y coordinate of raster in projected spatial ref."
+"</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "<refpurpose>Returns the width of the raster in pixels.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns the width of the raster in pixels.</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the upper left corner as column and row given geometric X and Y "
+"(longitude and latitude) or a point geometry expressed in the spatial "
+"reference coordinate system of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the upper left corner as column and row given geometric X and Y "
+"(longitude and latitude) or a point geometry. This function works regardless "
+"of whether or not the geometric X and Y or point geometry is outside the "
+"extent of the raster. Geometric X and Y must be expressed in the spatial "
+"reference coordinate system of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_WorldToRasterCoordY\"/>, <xref "
+"linkend=\"RT_ST_RasterToWorldCoordX\"/>, <xref "
+"linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the column in the raster of the point geometry (pt) or a X and Y "
+"world coordinate (xw, yw) represented in world spatial reference system of "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the column in the raster of the point geometry (pt) or a X and Y "
+"world coordinate (xw, yw). A point, or (both xw and yw world coordinates are "
+"required if a raster is skewed). If a raster is not skewed then xw is "
+"sufficient. World coordinates are in the spatial reference coordinate system "
+"of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordX"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref "
+"linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the row in the raster of the point geometry (pt) or a X and Y world "
+"coordinate (xw, yw) represented in world spatial reference system of raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the row in the raster of the point geometry (pt) or a X and Y world "
+"coordinate (xw, yw). A point, or (both xw and yw world coordinates are "
+"required if a raster is skewed). If a raster is not skewed then xw is "
+"sufficient. World coordinates are in the spatial reference coordinate system "
+"of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordY"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Band Accessors"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns basic meta data for a specific raster band. band num 1 is assumed if "
+"none-specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns basic meta data about a raster band. Columns returned: pixeltype, "
+"nodatavalue, isoutdb, path, outdbbandnum, filesize, filetimestamp."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "If raster contains no bands then an error is thrown."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "If band has no NODATA value, nodatavalue are NULL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If isoutdb is False, path, outdbbandnum, filesize and filetimestamp are "
+"NULL. If outdb access is disabled, filesize and filetimestamp will also be "
+"NULL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.5.0 to include <emphasis>outdbbandnum</emphasis>, "
+"<emphasis>filesize</emphasis> and <emphasis>filetimestamp</emphasis> for "
+"outdb rasters."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variant 1"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variant 2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_BandPixelType\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the value in a given band that represents no data. If no band num 1 "
+"is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the value that represents no data for the band"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns true if the band is filled with only nodata values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if the band is filled with only nodata values. Band 1 is "
+"assumed if not specified. If the last argument is TRUE, the entire band is "
+"checked pixel by pixel. Otherwise, the function simply returns the value of "
+"the isnodata flag for the band. The default value for this parameter is "
+"FALSE, if not specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the flag is dirty (this is, the result is different using TRUE as last "
+"parameter and not using it) you should update the raster to set this flag to "
+"true, by using ST_SetBandIsNodata(), or ST_SetBandNodataValue() with TRUE as "
+"last argument. See <xref linkend=\"RT_ST_SetBandIsNoData\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_NumBands\"/>, <xref "
+"linkend=\"RT_ST_SetBandNoDataValue\"/>, <xref "
+"linkend=\"RT_ST_SetBandIsNoData\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns system file path to a band stored in file system. If no bandnum "
+"specified, 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns system file path to a band. Throws an error if called with an in db "
+"band."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the file size of a band stored in file system. If no bandnum "
+"specified, 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the file size of a band stored in file system. Throws an error if "
+"called with an in db band, or if outdb access is not enabled."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is typically used in conjunction with ST_BandPath() and "
+"ST_BandFileTimestamp() so a client can determine if the filename of a outdb "
+"raster as seen by it is the same as the one seen by the server."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the file timestamp of a band stored in file system. If no bandnum "
+"specified, 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the file timestamp (number of seconds since Jan 1st 1970 00:00:00 "
+"UTC) of a band stored in file system. Throws an error if called with an in "
+"db band, or if outdb access is not enabled."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is typically used in conjunction with ST_BandPath() and "
+"ST_BandFileSize() so a client can determine if the filename of a outdb "
+"raster as seen by it is the same as the one seen by the server."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the type of pixel for given band. If no bandnum specified, 1 is "
+"assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns name describing data type and size of values stored in each cell of "
+"given band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "There are 11 pixel types. Pixel Types supported are as follows:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "1BB - 1-bit boolean"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "2BUI - 2-bit unsigned integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "4BUI - 4-bit unsigned integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "8BSI - 8-bit signed integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "8BUI - 8-bit unsigned integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "16BSI - 16-bit signed integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "16BUI - 16-bit unsigned integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "32BSI - 32-bit signed integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "32BUI - 32-bit unsigned integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "32BF - 32-bit float"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "64BF - 64-bit float"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the minimum value this pixeltype can store.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns the minimum value this pixeltype can store.</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns true if there is no band with given band number. If no "
+"band number is specified, then band number 1 is assumed.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns true if there is no band with given band number. If no band "
+"number is specified, then band number 1 is assumed.</para>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Pixel Accessors and Setters"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the polygon geometry that bounds the pixel for a "
+"particular row and column.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the polygon geometry that bounds the pixel for a particular "
+"row and column.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_PixelAsPolygons\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPoint\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, "
+"<xref linkend=\"RT_ST_PixelAsCentroid\"/>, <xref "
+"linkend=\"RT_ST_PixelAsCentroids\"/>, <xref linkend=\"RT_ST_Intersection\"/"
+">, <xref linkend=\"ST_AsText\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the polygon geometry that bounds every pixel of a raster band along "
+"with the value, the X and the Y raster coordinates of each pixel."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the polygon geometry that bounds every pixel of a raster band along "
+"with the value (double precision), the X and the Y raster coordinates "
+"(integers) of each pixel."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return record format: <parameter>geom</parameter> <xref linkend=\"geometry\"/"
+">, <parameter>val</parameter> double precision, <parameter>x</parameter> "
+"integer, <parameter>y</parameter> integers."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When <parameter>exclude_nodata_value</parameter> = TRUE, only those pixels "
+"whose values are not NODATA are returned as points."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_PixelAsPolygons returns one polygon geometry for every pixel. This is "
+"different than ST_DumpAsPolygons where each geometry represents one or more "
+"pixels with the same pixel value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 exclude_nodata_value optional argument was added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.1 Changed behavior of exclude_nodata_value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPoint\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, "
+"<xref linkend=\"RT_ST_PixelAsCentroid\"/>, <xref "
+"linkend=\"RT_ST_PixelAsCentroids\"/>, <xref linkend=\"ST_AsText\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns a point geometry of the pixel's upper-left corner.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns a point geometry of the pixel's upper-left corner.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/"
+">, <xref linkend=\"RT_ST_PixelAsCentroid\"/>, <xref "
+"linkend=\"RT_ST_PixelAsCentroids\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns a point geometry for each pixel of a raster band along "
+"with the value, the X and the Y raster coordinates of each pixel. The "
+"coordinates of the point geometry are of the pixel's upper-left corner.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns a point geometry for each pixel of a raster band along with "
+"the value, the X and the Y raster coordinates of each pixel. The coordinates "
+"of the point geometry are of the pixel's upper-left corner.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, "
+"<xref linkend=\"RT_ST_PixelAsCentroid\"/>, <xref "
+"linkend=\"RT_ST_PixelAsCentroids\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the centroid (point geometry) of the area represented by "
+"a pixel.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the centroid (point geometry) of the area represented by a "
+"pixel.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.2.0 Faster now implemented in C."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, "
+"<xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref "
+"linkend=\"RT_ST_PixelAsCentroids\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the centroid (point geometry) for each pixel of a raster "
+"band along with the value, the X and the Y raster coordinates of each pixel. "
+"The point geometry is the centroid of the area represented by a pixel.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the centroid (point geometry) for each pixel of a raster band "
+"along with the value, the X and the Y raster coordinates of each pixel. The "
+"point geometry is the centroid of the area represented by a pixel.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, "
+"<xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref "
+"linkend=\"RT_ST_PixelAsCentroid\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the value of a given band in a given columnx, rowy pixel or at a "
+"particular geometric point. Band numbers start at 1 and assumed to be 1 if "
+"not specified. If <varname>exclude_nodata_value</varname> is set to false, "
+"then all pixels include <varname>nodata</varname> pixels are considered to "
+"intersect and return value. If <varname>exclude_nodata_value</varname> is "
+"not passed in then reads it from metadata of raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the value of a given band in a given columnx, rowy pixel or at a "
+"given geometry point. Band numbers start at 1 and band is assumed to be 1 if "
+"not specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>exclude_nodata_value</varname> is set to true, then only non "
+"<varname>nodata</varname> pixels are considered. If "
+"<varname>exclude_nodata_value</varname> is set to false, then all pixels are "
+"considered."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The allowed values of the <varname>resample</varname> parameter are "
+"\"nearest\" which performs the default nearest-neighbor resampling, and "
+"\"bilinear\" which performs a <link xlink:href=\"https://en.wikipedia.org/"
+"wiki/Bilinear_interpolation\">bilinear interpolation</link> to estimate the "
+"value between pixel centers."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.2.0 resample optional argument was added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 exclude_nodata_value optional argument was added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SetValue\"/>, <xref linkend=\"RT_ST_DumpAsPolygons\"/"
+">, <xref linkend=\"RT_ST_NumBands\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=\"RT_ST_ScaleX\"/>, <xref "
+"linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_ST_UpperLeftX\"/>, <xref "
+"linkend=\"RT_ST_UpperLeftY\"/>, <xref linkend=\"RT_ST_SRID\"/>, <xref "
+"linkend=\"ST_AsText\"/>, <xref linkend=\"ST_Point\"/>, <xref "
+"linkend=\"ST_MakeEnvelope\"/>, <xref linkend=\"ST_Intersects\"/>, <xref "
+"linkend=\"ST_Intersection\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the nearest non-<varname>NODATA</varname> value of a given band's "
+"pixel specified by a columnx and rowy or a geometric point expressed in the "
+"same spatial reference coordinate system as the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the nearest non-<varname>NODATA</varname> value of a given band in a "
+"given columnx, rowy pixel or at a specific geometric point. If the columnx, "
+"rowy pixel or the pixel at the specified geometric point is <varname>NODATA</"
+"varname>, the function will find the nearest pixel to the columnx, rowy "
+"pixel or geometric point whose value is not <varname>NODATA</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Band numbers start at 1 and <varname>bandnum</varname> is assumed to be 1 if "
+"not specified. If <varname>exclude_nodata_value</varname> is set to false, "
+"then all pixels include <varname>nodata</varname> pixels are considered to "
+"intersect and return value. If <varname>exclude_nodata_value</varname> is "
+"not passed in then reads it from metadata of raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "ST_NearestValue is a drop-in replacement for ST_Value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Value\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a geometry with the same X/Y coordinates as the input geometry, and "
+"values from the raster copied into the Z dimension using the requested "
+"resample algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry with the same X/Y coordinates as the input geometry, and "
+"values from the raster copied into the Z dimensions using the requested "
+"resample algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>resample</varname> parameter can be set to \"nearest\" to copy "
+"the values from the cell each vertex falls within, or \"bilinear\" to use "
+"<link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Bilinear_interpolation\">bilinear interpolation</link> to calculate a value "
+"that takes neighboring cells into account also."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetM\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a geometry with the same X/Y coordinates as the input geometry, and "
+"values from the raster copied into the M dimension using the requested "
+"resample algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a geometry with the same X/Y coordinates as the input geometry, and "
+"values from the raster copied into the M dimensions using the requested "
+"resample algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetZ\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a 2-D double precision array of the non-<varname>NODATA</varname> "
+"values around a given band's pixel specified by either a columnX and rowY or "
+"a geometric point expressed in the same spatial reference coordinate system "
+"as the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a 2-D double precision array of the non-<varname>NODATA</varname> "
+"values around a given band's pixel specified by either a columnX and rowY or "
+"a geometric point expressed in the same spatial reference coordinate system "
+"as the raster. The <varname>distanceX</varname> and <varname>distanceY</"
+"varname> parameters define the number of pixels around the specified pixel "
+"in the X and Y axes, e.g. I want all values within 3 pixel distance along "
+"the X axis and 2 pixel distance along the Y axis around my pixel of "
+"interest. The center value of the 2-D array will be the value at the pixel "
+"specified by the columnX and rowY or the geometric point."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The number of elements along each axis of the returning 2-D array is 2 * "
+"(<varname>distanceX</varname>|<varname>distanceY</varname>) + 1. So for a "
+"<varname>distanceX</varname> and <varname>distanceY</varname> of 1, the "
+"returning array will be 3x3."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The 2-D array output can be passed to any of the raster processing builtin "
+"functions, e.g. ST_Min4ma, ST_Sum4ma, ST_Mean4ma."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Min4ma\"/>, <xref linkend=\"RT_ST_Max4ma\"/>, <xref "
+"linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref "
+"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref "
+"linkend=\"RT_ST_StdDev4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns modified raster resulting from setting the value of a given band in "
+"a given columnx, rowy pixel or the pixels that intersect a particular "
+"geometry. Band numbers start at 1 and assumed to be 1 if not specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns modified raster resulting from setting the specified pixels' values "
+"to new value for the designated band given the raster's row and column or a "
+"geometry. If no band is specified, then band 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 Geometry variant of ST_SetValue() now supports any geometry "
+"type, not just point. The geometry variant is a wrapper around the geomval[] "
+"variant of ST_SetValues()"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_DumpAsPolygons\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns modified raster resulting from setting the values of a given band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns modified raster resulting from setting specified pixels to new "
+"value(s) for the designated band. <varname>columnx</varname> and "
+"<varname>rowy</varname> are 1-indexed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>keepnodata</varname> is TRUE, those pixels whose values are "
+"NODATA will not be set with the corresponding value in <varname>newvalueset</"
+"varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Variant 1, the specific pixels to be set are determined by the "
+"<varname>columnx</varname>, <varname>rowy</varname> pixel coordinates and "
+"the dimensions of the <varname>newvalueset</varname> array. <varname>noset</"
+"varname> can be used to prevent pixels with values present in "
+"<varname>newvalueset</varname> from being set (due to PostgreSQL not "
+"permitting ragged/jagged arrays). See example Variant 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 2 is like Variant 1 but with a simple double precision "
+"<varname>nosetvalue</varname> instead of a boolean <varname>noset</varname> "
+"array. Elements in <varname>newvalueset</varname> with the "
+"<varname>nosetvalue</varname> value with be skipped. See example Variant 2."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Variant 3, the specific pixels to be set are determined by the "
+"<varname>columnx</varname>, <varname>rowy</varname> pixel coordinates, "
+"<varname>width</varname> and <varname>height</varname>. See example Variant "
+"3."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 4 is the same as Variant 3 with the exception that it assumes that "
+"the first band's pixels of <varname>rast</varname> will be set."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Variant 5, an array of <xref linkend=\"geomval\"/> is used to determine "
+"the specific pixels to be set. If all the geometries in the array are of "
+"type POINT or MULTIPOINT, the function uses a shortcut where the longitude "
+"and latitude of each point is used to set a pixel directly. Otherwise, the "
+"geometries are converted to rasters and then iterated through in one pass. "
+"See example Variant 5."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variant 3"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variant 5"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The following shows that geomvals later in the array can overwrite prior "
+"geomvals"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This example is the opposite of the prior example"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SetValue\"/>, <xref "
+"linkend=\"RT_ST_PixelAsPolygons\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Get the values of the specified band as a 2-dimension array."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Get the values of the specified band as a 2-dimension array (first index is "
+"row, second is column). If <varname>nband</varname> is NULL or not provided, "
+"all raster bands are processed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SetValue\"/>, <xref linkend=\"RT_ST_SetValues\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Get the columnx, rowy coordinates of the pixel whose value equals the search "
+"value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Get the columnx, rowy coordinates of the pixel whose value equals the search "
+"value. If no band is specified, then band 1 is assumed."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Editors"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Set Georeference 6 georeference parameters in a single call. Numbers should "
+"be separated by white space. Accepts inputs in GDAL or ESRI format. Default "
+"is GDAL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Set Georeference 6 georeference parameters in a single call. Accepts inputs "
+"in 'GDAL' or 'ESRI' format. Default is GDAL. If 6 coordinates are not "
+"provided will return null."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the raster has out-db bands, changing the georeference may result in "
+"incorrect access of the band's externally stored data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 Addition of ST_SetGeoReference(raster, double "
+"precision, ...) variant"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref "
+"linkend=\"RT_ST_UpperLeftX\"/>, <xref linkend=\"RT_ST_UpperLeftY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Set the rotation of the raster in radian."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Uniformly rotate the raster. Rotation is in radian. Refer to <link xlink:"
+"href=\"http://en.wikipedia.org/wiki/World_file\">World File</link> for more "
+"details."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Sets the X and Y size of pixels in units of coordinate reference system. "
+"Number units/pixel width/height."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the X and Y size of pixels in units of coordinate reference system. "
+"Number units/pixel width/height. If only one unit passed in, assumed X and Y "
+"are the same number."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_SetScale is different from <xref linkend=\"RT_ST_Rescale\"/> in that "
+"ST_SetScale do not resample the raster to match the raster extent. It only "
+"changes the metadata (or georeference) of the raster to correct an "
+"originally mis-specified scaling. ST_Rescale results in a raster having "
+"different width and height computed to fit the geographic extent of the "
+"input raster. ST_SetScale do not modify the width, nor the height of the "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 In WKTRaster versions this was called ST_SetPixelSize. This "
+"was changed in 2.0.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_Box3D\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Sets the georeference X and Y skew (or rotation parameter). If only one is "
+"passed in, sets X and Y to the same value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the georeference X and Y skew (or rotation parameter). If only one is "
+"passed in, sets X and Y to the same value. Refer to <link xlink:"
+"href=\"http://en.wikipedia.org/wiki/World_file\">World File</link> for more "
+"details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SetGeoReference\"/>, <xref linkend=\"RT_ST_SkewX\"/"
+">, <xref linkend=\"RT_ST_SkewY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Sets the SRID of a raster to a particular integer srid defined in the "
+"spatial_ref_sys table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Sets the SRID on a raster to a particular integer value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not transform the raster in any way - it simply sets meta "
+"data defining the spatial ref of the coordinate reference system that it's "
+"currently in. Useful for transformations later."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Sets the value of the upper left corner of the pixel of the raster to "
+"projected X and Y coordinates."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Set the value of the upper left corner of raster to the projected X and Y "
+"coordinates"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_UpperLeftY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Resample a raster using a specified resampling algorithm, new dimensions, an "
+"arbitrary grid corner and a set of raster georeferencing attributes defined "
+"or borrowed from another raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Resample a raster using a specified resampling algorithm, new dimensions "
+"(width & height), a grid corner (gridx & gridy) and a set of raster "
+"georeferencing attributes (scalex, scaley, skewx & skewy) defined or "
+"borrowed from another raster. If using a reference raster, the two rasters "
+"must have the same SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"New pixel values are computed using one of the following resampling "
+"algorithms:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "NearestNeighbor (english or american spelling)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Bilinear"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Cubic"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "CubicSpline"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Lanczos"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Max</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Min</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The default is NearestNeighbor which is the fastest but results in the worst "
+"interpolation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A maxerror percent of 0.125 is used if no <varname>maxerr</varname> is "
+"specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to: <link xlink:href=\"http://www.gdal.org/gdalwarp.html\">GDAL Warp "
+"resampling methods</link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0 Requires GDAL 1.6.1+"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.4.0 max and min resampling options added"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Resize\"/>, <xref linkend=\"RT_ST_Transform\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Resample a raster by adjusting only its scale (or pixel size). New pixel "
+"values are computed using the NearestNeighbor (english or american "
+"spelling), Bilinear, Cubic, CubicSpline, Lanczos, Max or Min resampling "
+"algorithm. Default is NearestNeighbor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Resample a raster by adjusting only its scale (or pixel size). New pixel "
+"values are computed using one of the following resampling algorithms:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>scalex</varname> and <varname>scaley</varname> define the new pixel "
+"size. scaley must often be negative to get well oriented raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When the new scalex or scaley is not a divisor of the raster width or "
+"height, the extent of the resulting raster is expanded to encompass the "
+"extent of the provided raster. If you want to be sure to retain exact input "
+"extent see <xref linkend=\"RT_ST_Resize\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>maxerr</varname> is the threshold for transformation approximation "
+"by the resampling algorithm (in pixel units). A default of 0.125 is used if "
+"no <varname>maxerr</varname> is specified, which is the same value used in "
+"GDAL gdalwarp utility. If set to zero, no approximation takes place."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Rescale is different from <xref linkend=\"RT_ST_SetScale\"/> in that "
+"ST_SetScale do not resample the raster to match the raster extent. "
+"ST_SetScale only changes the metadata (or georeference) of the raster to "
+"correct an originally mis-specified scaling. ST_Rescale results in a raster "
+"having different width and height computed to fit the geographic extent of "
+"the input raster. ST_SetScale do not modify the width, nor the height of the "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.1.0 Works on rasters with no SRID"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A simple example rescaling a raster from a pixel size of 0.001 degree to a "
+"pixel size of 0.0015 degree."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Resample\"/>, <xref linkend=\"RT_ST_SetScale\"/>, "
+"<xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref "
+"linkend=\"RT_ST_Transform\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Resample a raster by adjusting only its skew (or rotation parameters). New "
+"pixel values are computed using the NearestNeighbor (english or american "
+"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. "
+"Default is NearestNeighbor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Resample a raster by adjusting only its skew (or rotation parameters). New "
+"pixel values are computed using the NearestNeighbor (english or american "
+"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. The "
+"default is NearestNeighbor which is the fastest but results in the worst "
+"interpolation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>skewx</varname> and <varname>skewy</varname> define the new skew."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The extent of the new raster will encompass the extent of the provided "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A maxerror percent of 0.125 if no <varname>maxerr</varname> is specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Reskew is different from <xref linkend=\"RT_ST_SetSkew\"/> in that "
+"ST_SetSkew do not resample the raster to match the raster extent. ST_SetSkew "
+"only changes the metadata (or georeference) of the raster to correct an "
+"originally mis-specified skew. ST_Reskew results in a raster having "
+"different width and height computed to fit the geographic extent of the "
+"input raster. ST_SetSkew do not modify the width, nor the height of the "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A simple example reskewing a raster from a skew of 0.0 to a skew of 0.0015."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_SetSkew\"/>, "
+"<xref linkend=\"RT_ST_SetRotation\"/>, <xref linkend=\"RT_ST_SkewX\"/>, "
+"<xref linkend=\"RT_ST_SkewY\"/>, <xref linkend=\"RT_ST_Transform\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Resample a raster by snapping it to a grid. New pixel values are computed "
+"using the NearestNeighbor (english or american spelling), Bilinear, Cubic, "
+"CubicSpline or Lanczos resampling algorithm. Default is NearestNeighbor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Resample a raster by snapping it to a grid defined by an arbitrary pixel "
+"corner (gridx & gridy) and optionally a pixel size (scalex & "
+"scaley). New pixel values are computed using the NearestNeighbor (english or "
+"american spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling "
+"algorithm. The default is NearestNeighbor which is the fastest but results "
+"in the worst interpolation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>gridx</varname> and <varname>gridy</varname> define any arbitrary "
+"pixel corner of the new grid. This is not necessarily the upper left corner "
+"of the new raster and it does not have to be inside or on the edge of the "
+"new raster extent."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can optionally define the pixel size of the new grid with "
+"<varname>scalex</varname> and <varname>scaley</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use <xref linkend=\"RT_ST_Resample\"/> if you need more control over the "
+"grid parameters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A simple example snapping a raster to a slightly different grid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_UpperLeftX\"/>, "
+"<xref linkend=\"RT_ST_UpperLeftY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Resize a raster to a new width/height"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Resize a raster to a new width/height. The new width/height can be specified "
+"in exact number of pixels or a percentage of the raster's width/height. The "
+"extent of the the new raster will be the same as the extent of the provided "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"New pixel values are computed using the NearestNeighbor (english or american "
+"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. The "
+"default is NearestNeighbor which is the fastest but results in the worst "
+"interpolation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Variant 1 expects the actual width/height of the output raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 2 expects decimal values between zero (0) and one (1) indicating the "
+"percentage of the input raster's width/height."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 3 takes either the actual width/height of the output raster or a "
+"textual percentage (\"20%\") indicating the percentage of the input raster's "
+"width/height."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.1.0 Requires GDAL 1.6.1+"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_Reskew\"/>, <xref "
+"linkend=\"RT_ST_SnapToGrid\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Reprojects a raster in a known spatial reference system to another known "
+"spatial reference system using specified resampling algorithm. Options are "
+"NearestNeighbor, Bilinear, Cubic, CubicSpline, Lanczos defaulting to "
+"NearestNeighbor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reprojects a raster in a known spatial reference system to another known "
+"spatial reference system using specified pixel warping algorithm. Uses "
+"'NearestNeighbor' if no algorithm is specified and maxerror percent of 0.125 "
+"if no maxerr is specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Transform is often confused with ST_SetSRID(). ST_Transform actually "
+"changes the coordinates of a raster (and resamples the pixel values) from "
+"one spatial reference system to another, while ST_SetSRID() simply changes "
+"the SRID identifier of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unlike the other variants, Variant 3 requires a reference raster as "
+"<varname>alignto</varname>. The transformed raster will be transformed to "
+"the spatial reference system (SRID) of the reference raster and be aligned "
+"(ST_SameAlignment = TRUE) to the reference raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you find your transformation support is not working right, you may need "
+"to set the environment variable PROJSO to the .so or .dll projection library "
+"your PostGIS is using. This just needs to have the name of the file. So for "
+"example on windows, you would in Control Panel -> System -> "
+"Environment Variables add a system variable called <varname>PROJSO</varname> "
+"and set it to <varname>libproj.dll</varname> (if you are using proj 4.6.1). "
+"You'll have to restart your PostgreSQL service/daemon after this change."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When transforming a coverage of tiles, you almost always want to use a "
+"reference raster to insure same alignment and no gaps in your tiles as "
+"demonstrated in example: Variant 3."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 Addition of ST_Transform(rast, alignto) variant"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "original mass state plane meters (mass_stm)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "After transform to wgs 84 long lat (wgs_84)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After transform to wgs 84 long lat with bilinear algorithm instead of NN "
+"default (wgs_84_bilin)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The following shows the difference between using ST_Transform(raster, srid) "
+"and ST_Transform(raster, alignto)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "not_aligned"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "aligned"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetSRID\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Band Editors"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Sets the value for the given band that represents no data. Band 1 is assumed "
+"if no band is specified. To mark a band as having no nodata value, set the "
+"nodata value = NULL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the value that represents no data for the band. Band 1 is assumed if "
+"not specified. This will affect results from <xref linkend=\"RT_ST_Polygon\"/"
+">, <xref linkend=\"RT_ST_DumpAsPolygons\"/>, and the ST_PixelAs...() "
+"functions."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Sets the isnodata flag of the band to TRUE."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the isnodata flag for the band to true. Band 1 is assumed if not "
+"specified. This function should be called only when the flag is considered "
+"dirty. That is, when the result calling <xref linkend=\"RT_ST_BandIsNoData\"/"
+"> is different using TRUE as last argument and without using it"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_NumBands\"/>, <xref "
+"linkend=\"RT_ST_SetBandNoDataValue\"/>, <xref linkend=\"RT_ST_BandIsNoData\"/"
+">"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Update the external path and band number of an out-db band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Updates an out-db band's external raster file path and external band number."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>force</varname> is set to true, no tests are done to ensure "
+"compatibility (e.g. alignment, pixel support) between the external raster "
+"file and the PostGIS raster. This mode is intended for file system changes "
+"where the external raster resides."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetBandIndex\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Update the external band number of an out-db band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Updates an out-db band's external band number. This does not touch the "
+"external raster file associated with the out-db band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>force</varname> is set to true, no tests are done to ensure "
+"compatibility (e.g. alignment, pixel support) between the external raster "
+"file and the PostGIS raster. This mode is intended for where bands are moved "
+"around in the external raster file."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Internally, this method replaces the PostGIS raster's band at index "
+"<varname>band</varname> with a new band instead of updating the existing "
+"path information."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetBandPath\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Band Statistics and Analytics"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the number of pixels in a given band of a raster or raster coverage. "
+"If no band is specified defaults to band 1. If exclude_nodata_value is set "
+"to true, will only count pixels that are not equal to the nodata value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the number of pixels in a given band of a raster or raster coverage. "
+"If no band is specified <varname>nband</varname> defaults to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>exclude_nodata_value</varname> is set to true, will only count "
+"pixels with value not equal to the <varname>nodata</varname> value of the "
+"raster. Set <varname>exclude_nodata_value</varname> to false to get count "
+"all pixels"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.1.0 - The ST_Count(rastertable, rastercolumn, ...) variants "
+"removed. Use <xref linkend=\"RT_ST_CountAgg\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref "
+"linkend=\"RT_ST_SetBandNoDataValue\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Aggregate. Returns the number of pixels in a given band of a set of rasters. "
+"If no band is specified defaults to band 1. If exclude_nodata_value is set "
+"to true, will only count pixels that are not equal to the NODATA value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the number of pixels in a given band of a set of rasters. If no band "
+"is specified <varname>nband</varname> defaults to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>exclude_nodata_value</varname> is set to true, will only count "
+"pixels with value not equal to the <varname>NODATA</varname> value of the "
+"raster. Set <varname>exclude_nodata_value</varname> to false to get count "
+"all pixels"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default will sample all pixels. To get faster response, set "
+"<varname>sample_percent</varname> to value between zero (0) and one (1)"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of record summarizing a raster or raster coverage data "
+"distribution separate bin ranges. Number of bins are autocomputed if not "
+"specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns set of records consisting of min, max, count, percent for a given "
+"raster band for each bin. If no band is specified <varname>nband</varname> "
+"defaults to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default only considers pixel values not equal to the <varname>nodata</"
+"varname> value . Set <varname>exclude_nodata_value</varname> to false to get "
+"count all pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"width: an array indicating the width of each category/bin. If the number of "
+"bins is greater than the number of widths, the widths are repeated."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example: 9 bins, widths are [a, b, c] will have the output be [a, b, c, a, "
+"b, c, a, b, c]"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Number of breakouts -- this is the number of records you'll get back from "
+"the function if specified. If not specified then the number of breakouts is "
+"autocomputed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"compute the histogram from the right rather than from the left (default). "
+"This changes the criteria for evaluating a value x from [a, b) to (a, b]"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.1.0 Removed ST_Histogram(table_name, column_name) variant."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"Example: Single raster tile - compute histograms for bands 1, 2, 3 and "
+"autocompute bins"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Just band 2 but for 6 bins"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref "
+"linkend=\"RT_ST_SummaryStatsAgg\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Compute quantiles for a raster or raster table coverage in the "
+"context of the sample or population. Thus, a value could be examined to be "
+"at the raster's 25%, 50%, 75% percentile.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Compute quantiles for a raster or raster table coverage in the context "
+"of the sample or population. Thus, a value could be examined to be at the "
+"raster's 25%, 50%, 75% percentile.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>exclude_nodata_value</varname> is set to false, will also count "
+"pixels with no data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.1.0 Removed ST_Quantile(table_name, column_name) variant."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref "
+"linkend=\"RT_ST_SummaryStatsAgg\"/>, <xref "
+"linkend=\"RT_ST_SetBandNoDataValue\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns summarystats consisting of count, sum, mean, stddev, min, max for a "
+"given raster band of a raster or raster coverage. Band 1 is assumed if no "
+"band is specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <xref linkend=\"summarystats\"/> consisting of count, sum, mean, "
+"stddev, min, max for a given raster band of a raster or raster coverage. If "
+"no band is specified <varname>nband</varname> defaults to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default only considers pixel values not equal to the <varname>nodata</"
+"varname> value. Set <varname>exclude_nodata_value</varname> to false to get "
+"count of all pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default will sample all pixels. To get faster response, set "
+"<varname>sample_percent</varname> to lower than 1"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.1.0 ST_SummaryStats(rastertable, rastercolumn, ...) variants are "
+"removed. Use <xref linkend=\"RT_ST_SummaryStatsAgg\"/> instead."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Single raster tile"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Summarize pixels that intersect buildings of interest"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This example took 574ms on PostGIS windows 64-bit with all of Boston "
+"Buildings and aerial Tiles (tiles each 150x150 pixels ~ 134,000 tiles), "
+"~102,000 building records"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Raster coverage"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SummaryStatsAgg\"/>, <xref linkend=\"RT_ST_Count\"/"
+">, <xref linkend=\"RT_ST_Clip\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Aggregate. Returns summarystats consisting of count, sum, mean, stddev, min, "
+"max for a given raster band of a set of raster. Band 1 is assumed if no band "
+"is specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default only considers pixel values not equal to the <varname>NODATA</"
+"varname> value. Set <varname>exclude_nodata_value</varname> to False to get "
+"count of all pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default will sample all pixels. To get faster response, set "
+"<varname>sample_percent</varname> to value between 0 and 1"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref linkend=\"RT_ST_Count\"/>, "
+"<xref linkend=\"RT_ST_Clip\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of records containing a pixel band value and count of the "
+"number of pixels in a given band of a raster (or a raster coverage) that "
+"have a given set of values. If no band is specified defaults to band 1. By "
+"default nodata value pixels are not counted. and all other values in the "
+"pixel are output and pixel band values are rounded to the nearest integer."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of records with columns <varname>value</varname> "
+"<varname>count</varname> which contain the pixel band value and count of "
+"pixels in the raster tile or raster coverage of selected band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If no band is specified <varname>nband</varname> defaults to 1. If no "
+"<varname>searchvalues</varname> are specified, will return all pixel values "
+"found in the raster or raster coverage. If one searchvalue is given, will "
+"return an integer instead of records denoting the count of pixels having "
+"that pixel band value"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SetBandNoDataValue\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Inputs"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a raster value from a Well-Known Binary (WKB) raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Given a Well-Known Binary (WKB) raster, return a raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_RastFromHexWKB\"/>, <xref linkend=\"RT_ST_AsBinary\"/"
+">, <xref linkend=\"RT_ST_AsHexWKB\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a raster value from a Hex representation of Well-Known Binary (WKB) "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given a Well-Known Binary (WKB) raster in Hex representation, return a "
+"raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_RastFromWKB\"/>, <xref linkend=\"RT_ST_AsBinary\"/>, "
+"<xref linkend=\"RT_ST_AsHexWKB\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Outputs"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the Well-Known Binary (WKB) representation of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the Binary representation of the raster. If <varname>outasin</"
+"varname> is TRUE, out-db bands are treated as in-db. Refer to raster/doc/"
+"RFC2-WellKnownBinaryFormat located in the PostGIS source folder for details "
+"of the representation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is useful in binary cursors to pull data out of the database without "
+"converting it to a string representation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default, WKB output contains the external file path for out-db bands. If "
+"the client does not have access to the raster file underlying an out-db "
+"band, set <varname>outasin</varname> to TRUE."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 Addition of <varname>outasin</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.5.0 Addition of <varname>ST_AsWKB</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_AsHexWKB\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the Well-Known Binary (WKB) in Hex representation of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the Binary representation in Hex representation of the raster. If "
+"<varname>outasin</varname> is TRUE, out-db bands are treated as in-db. Refer "
+"to raster/doc/RFC2-WellKnownBinaryFormat located in the PostGIS source "
+"folder for details of the representation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default, Hex WKB output contains the external file path for out-db bands. "
+"If the client does not have access to the raster file underlying an out-db "
+"band, set <varname>outasin</varname> to TRUE."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_AsBinary\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the raster tile in the designated GDAL Raster format. Raster formats "
+"are one of those supported by your compiled library. Use ST_GDALDrivers() to "
+"get a list of formats supported by your library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the raster tile in the designated format. Arguments are itemized "
+"below:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>format</varname> format to output. This is dependent on the drivers "
+"compiled in your libgdal library. Generally available are 'JPEG', 'GTIff', "
+"'PNG'. Use <xref linkend=\"RT_ST_GDALDrivers\"/> to get a list of formats "
+"supported by your library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>options</varname> text array of GDAL options. Valid options are "
+"dependent on the format. Refer to <link xlink:href=\"http://www.gdal.org/"
+"frmt_various.html\">GDAL Raster format options</link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>srs</varname> The proj4text or srtext (from spatial_ref_sys) to "
+"embed in the image"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "JPEG Output Example, multiple tiles as single raster"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using PostgreSQL Large Object Support to export raster"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"One way to export raster into another format is using <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/static/lo-funcs."
+"html\">PostgreSQL large object export functions</link>. We'lll repeat the "
+"prior example but also exporting. Note for this you'll need to have super "
+"user access to db since it uses server side lo functions. It will also "
+"export to path on server network. If you need export locally, use the psql "
+"equivalent lo_ functions which export to the local file system instead of "
+"the server file system."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "GTIFF Output Examples"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_GDALDrivers\"/>, <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the raster tile selected bands as a single Joint Photographic Exports "
+"Group (JPEG) image (byte array). If no band is specified and 1 or more than "
+"3 bands, then only the first band is used. If only 3 bands then all 3 bands "
+"are used and mapped to RGB."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the selected bands of the raster as a single Joint Photographic "
+"Exports Group Image (JPEG). Use <xref linkend=\"RT_ST_AsGDALRaster\"/> if "
+"you need to export as less common raster types. If no band is specified and "
+"1 or more than 3 bands, then only the first band is used. If 3 bands then "
+"all 3 bands are used. There are many variants of the function with many "
+"options. These are itemized below:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>nband</varname> is for single band exports."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>nbands</varname> is an array of bands to export (note that max is 3 "
+"for JPEG) and the order of the bands is RGB. e.g ARRAY[3,2,1] means map band "
+"3 to Red, band 2 to green and band 1 to blue"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>quality</varname> number from 0 to 100. The higher the number the "
+"crisper the image."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>options</varname> text Array of GDAL options as defined for JPEG "
+"(look at create_options for JPEG <xref linkend=\"RT_ST_GDALDrivers\"/>). For "
+"JPEG valid ones are <varname>PROGRESSIVE</varname> ON or OFF and "
+"<varname>QUALITY</varname> a range from 0 to 100 and default to 75. Refer to "
+"<link xlink:href=\"http://www.gdal.org/frmt_various.html\">GDAL Raster "
+"format options</link> for more details."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Output"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_GDALDrivers\"/>, <xref "
+"linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, <xref "
+"linkend=\"RT_ST_AsTIFF\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the raster tile selected bands as a single portable network graphics "
+"(PNG) image (byte array). If 1, 3, or 4 bands in raster and no bands are "
+"specified, then all bands are used. If more 2 or more than 4 bands and no "
+"bands specified, then only band 1 is used. Bands are mapped to RGB or RGBA "
+"space."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the selected bands of the raster as a single Portable Network "
+"Graphics Image (PNG). Use <xref linkend=\"RT_ST_AsGDALRaster\"/> if you need "
+"to export as less common raster types. If no band is specified, then the "
+"first 3 bands are exported. There are many variants of the function with "
+"many options. If no <varname>srid</varname> is specified then then srid of "
+"the raster is used. These are itemized below:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>nbands</varname> is an array of bands to export (note that max is 4 "
+"for PNG) and the order of the bands is RGBA. e.g ARRAY[3,2,1] means map band "
+"3 to Red, band 2 to green and band 1 to blue"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>compression</varname> number from 1 to 9. The higher the number the "
+"greater the compression."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>options</varname> text Array of GDAL options as defined for PNG "
+"(look at create_options for PNG of <xref linkend=\"RT_ST_GDALDrivers\"/>). "
+"For PNG valid one is only ZLEVEL (amount of time to spend on compression -- "
+"default 6) e.g. ARRAY['ZLEVEL=9']. WORLDFILE is not allowed since the "
+"function would have to output two outputs. Refer to <link xlink:"
+"href=\"http://www.gdal.org/frmt_various.html\">GDAL Raster format options</"
+"link> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_ColorMap\"/>, <xref linkend=\"RT_ST_GDALDrivers\"/>, "
+"<xref linkend=\"RT_Raster_Applications\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the raster selected bands as a single TIFF image (byte array). If no "
+"band is specified or any of specified bands does not exist in the raster, "
+"then will try to use all bands."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the selected bands of the raster as a single Tagged Image File "
+"Format (TIFF). If no band is specified, will try to use all bands. This is a "
+"wrapper around <xref linkend=\"RT_ST_AsGDALRaster\"/>. Use <xref "
+"linkend=\"RT_ST_AsGDALRaster\"/> if you need to export as less common raster "
+"types. There are many variants of the function with many options. If no "
+"spatial reference SRS text is present, the spatial reference of the raster "
+"is used. These are itemized below:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>nbands</varname> is an array of bands to export (note that max is 3 "
+"for PNG) and the order of the bands is RGB. e.g ARRAY[3,2,1] means map band "
+"3 to Red, band 2 to green and band 1 to blue"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>compression</varname> Compression expression -- JPEG90 (or some "
+"other percent), LZW, JPEG, DEFLATE9."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>options</varname> text Array of GDAL create options as defined for "
+"GTiff (look at create_options for GTiff of <xref "
+"linkend=\"RT_ST_GDALDrivers\"/>). or refer to <link xlink:href=\"http://www."
+"gdal.org/frmt_various.html\">GDAL Raster format options</link> for more "
+"details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>srid</varname> srid of spatial_ref_sys of the raster. This is used "
+"to populate the georeference information"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Use jpeg compression 90%"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Processing: Map Algebra"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the raster clipped by the input geometry. If band number is not "
+"specified, all bands are processed. If <varname>crop</varname> is not "
+"specified or TRUE, the output raster is cropped. If <varname>touched</"
+"varname> is set to TRUE, then touched pixels are included, otherwise only if "
+"the center of the pixel is in the geometry it is included."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a raster that is clipped by the input geometry <varname>geom</"
+"varname>. If band index is not specified, all bands are processed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rasters resulting from ST_Clip must have a nodata value assigned for areas "
+"clipped, one for each band. If none are provided and the input raster do not "
+"have a nodata value defined, nodata values of the resulting raster are set "
+"to ST_MinPossibleValue(ST_BandPixelType(rast, band)). When the number of "
+"nodata value in the array is smaller than the number of band, the last one "
+"in the array is used for the remaining bands. If the number of nodata value "
+"is greater than the number of band, the extra nodata values are ignored. All "
+"variants accepting an array of nodata values also accept a single value "
+"which will be assigned to each band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>crop</varname> is not specified, true is assumed meaning the "
+"output raster is cropped to the intersection of the <varname>geom</"
+"varname>and <varname>rast</varname> extents. If <varname>crop</varname> is "
+"set to false, the new raster gets the same extent as <varname>rast</"
+"varname>. If <varname>touched</varname> is set to true, then all pixels in "
+"the <varname>rast</varname> that intersect the geometry are selected."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The default behavior is touched=false, which will only select pixels where "
+"the center of the pixel is covered by the geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.5.0 - touched argument added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 Rewritten in C"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Examples here use Massachusetts aerial data available on MassGIS site <link "
+"xlink:href=\"https://www.mass.gov/info-details/massgis-data-20082009-aerial-"
+"imagery\">MassGIS Aerial Orthos</link>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Comparing selecting all touched vs. not all touched"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: 1 band clipping (not touched)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Full raster tile before clipping"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "After Clipping"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"Examples: 1 band clipping with no crop and add back other bands unchanged"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "After Clipping - surreal"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Clip all bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Count\"/>, <xref linkend=\"RT_ST_MapAlgebra\"/>, "
+"<xref linkend=\"RT_ST_Intersection\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a new raster of up to four 8BUI bands (grayscale, RGB, RGBA) from "
+"the source raster and a specified band. Band 1 is assumed if not specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Apply a <varname>colormap</varname> to the band at <varname>nband</varname> "
+"of <varname>rast</varname> resulting a new raster comprised of up to four "
+"8BUI bands. The number of 8BUI bands in the new raster is determined by the "
+"number of color components defined in <varname>colormap</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "If <varname>nband</varname> is not specified, then band 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>colormap</varname> can be a keyword of a pre-defined colormap or a "
+"set of lines defining the value and the color components."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Valid pre-defined <varname>colormap</varname> keyword:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>grayscale</varname> or <varname>greyscale</varname> for a one 8BUI "
+"band raster of shades of gray."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>pseudocolor</varname> for a four 8BUI (RGBA) band raster with "
+"colors going from blue to green to red."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>fire</varname> for a four 8BUI (RGBA) band raster with colors going "
+"from black to red to pale yellow."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>bluered</varname> for a four 8BUI (RGBA) band raster with colors "
+"going from blue to pale white to red."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Users can pass a set of entries (one per line) to <varname>colormap</"
+"varname> to specify custom colormaps. Each entry generally consists of five "
+"values: the pixel value and corresponding Red, Green, Blue, Alpha components "
+"(color components between 0 and 255). Percent values can be used instead of "
+"pixel values where 0% and 100% are the minimum and maximum values found in "
+"the raster band. Values can be separated with commas (','), tabs, colons "
+"(':') and/or spaces. The pixel value can be set to <emphasis>nv</emphasis>, "
+"<emphasis>null</emphasis> or <emphasis>nodata</emphasis> for the NODATA "
+"value. An example is provided below."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The syntax of <varname>colormap</varname> is similar to that of the color-"
+"relief mode of GDAL <link xlink:href=\"http://www.gdal.org/gdaldem."
+"html#gdaldem_color_relief\">gdaldem</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Valid keywords for <varname>method</varname>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>INTERPOLATE</varname> to use linear interpolation to smoothly blend "
+"the colors between the given pixel values"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>EXACT</varname> to strictly match only those pixels values found in "
+"the colormap. Pixels whose value does not match a colormap entry will be set "
+"to 0 0 0 0 (RGBA)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>NEAREST</varname> to use the colormap entry whose value is closest "
+"to the pixel value"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A great reference for colormaps is <link xlink:href=\"http://www."
+"colorbrewer2.org\">ColorBrewer</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The resulting bands of new raster will have no NODATA value set. Use <xref "
+"linkend=\"RT_ST_SetBandNoDataValue\"/> to set a NODATA value if one is "
+"needed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This is a junk table to play with"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Compare different color map looks using ST_AsPNG"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "orig_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "grey_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "pseudo_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "fire_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "bluered_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "red_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AsRaster\"/> <xref linkend=\"RT_ST_MapAlgebra\"/>, "
+"<xref linkend=\"RT_ST_Grayscale\"/> <xref linkend=\"RT_ST_NumBands\"/>, "
+"<xref linkend=\"RT_ST_Reclass\"/>, <xref "
+"linkend=\"RT_ST_SetBandNoDataValue\"/>, <xref linkend=\"RT_ST_Union\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a new one-8BUI band raster from the source raster and specified "
+"bands representing Red, Green and Blue"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a raster with one 8BUI band given three input bands (from one or more "
+"rasters). Any input band whose pixel type is not 8BUI will be reclassified "
+"using <xref linkend=\"RT_ST_Reclass\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is not like <xref linkend=\"RT_ST_ColorMap\"/> with the "
+"<varname>grayscale</varname> keyword as ST_ColorMap operates on only one "
+"band while this function expects three bands for RGB. This function applies "
+"the following equation for converting RGB to Grayscale: 0.2989 * RED + "
+"0.5870 * GREEN + 0.1140 * BLUE"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "original_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "grayscale_png"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Reclass\"/>, <xref linkend=\"RT_ST_ColorMap\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns a raster or a set of geometry-pixelvalue pairs "
+"representing the shared portion of two rasters or the geometrical "
+"intersection of a vectorization of the raster and a geometry.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns a raster or a set of geometry-pixelvalue pairs representing "
+"the shared portion of two rasters or the geometrical intersection of a "
+"vectorization of the raster and a geometry.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The first three variants, returning a setof geomval, works in vector space. "
+"The raster is first vectorized (using <xref linkend=\"RT_ST_DumpAsPolygons\"/"
+">) into a set of geomval rows and those rows are then intersected with the "
+"geometry using the <xref linkend=\"ST_Intersection\"/> (geometry, geometry) "
+"PostGIS function. Geometries intersecting only with a nodata value area of a "
+"raster returns an empty geometry. They are normally excluded from the "
+"results by the proper usage of <xref linkend=\"RT_ST_Intersects\"/> in the "
+"WHERE clause."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can access the geometry and the value parts of the resulting set of "
+"geomval by surrounding them with parenthesis and adding '.geom' or '.val' at "
+"the end of the expression. e.g. (ST_Intersection(rast, geom)).geom"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The other variants, returning a raster, works in raster space. They are "
+"using the two rasters version of ST_MapAlgebraExpr to perform the "
+"intersection."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The extent of the resulting raster corresponds to the geometrical "
+"intersection of the two raster extents. The resulting raster includes "
+"'BAND1', 'BAND2' or 'BOTH' bands, following what is passed as the "
+"<varname>returnband</varname> parameter. Nodata value areas present in any "
+"band results in nodata value areas in every bands of the result. In other "
+"words, any pixel intersecting with a nodata value pixel becomes a nodata "
+"value pixel in the result."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rasters resulting from ST_Intersection must have a nodata value assigned for "
+"areas not intersecting. You can define or replace the nodata value for any "
+"resulting band by providing a <varname>nodataval[]</varname> array of one or "
+"two nodata values depending if you request 'BAND1', 'BAND2' or 'BOTH' bands. "
+"The first value in the array replace the nodata value in the first band and "
+"the second value replace the nodata value in the second band. If one input "
+"band do not have a nodata value defined and none are provided as an array, "
+"one is chosen using the ST_MinPossibleValue function. All variant accepting "
+"an array of nodata value can also accept a single value which will be "
+"assigned to each requested band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In all variants, if no band number is specified band 1 is assumed. If you "
+"need an intersection between a raster and geometry that returns a raster, "
+"refer to <xref linkend=\"RT_ST_Clip\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To get more control on the resulting extent or on what to return when "
+"encountering a nodata value, use the two rasters version of <xref "
+"linkend=\"RT_ST_MapAlgebraExpr2\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To compute the intersection of a raster band with a geometry in raster "
+"space, use <xref linkend=\"RT_ST_Clip\"/>. ST_Clip works on multiple bands "
+"rasters and does not return a band corresponding to the rasterized geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Intersection should be used in conjunction with <xref "
+"linkend=\"RT_ST_Intersects\"/> and an index on the raster column and/or the "
+"geometry column."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 - Intersection in the raster space was introduced. In "
+"earlier pre-2.0.0 versions, only intersection performed in vector space were "
+"supported."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Geometry, Raster -- resulting in geometry vals"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Intersects\"/>, <xref "
+"linkend=\"RT_ST_MapAlgebraExpr2\"/>, <xref linkend=\"RT_ST_Clip\"/>, <xref "
+"linkend=\"ST_AsText\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Callback function version - Returns a one-band raster given one or more "
+"input rasters, band indexes and one user-specified callback function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a one-band raster given one or more input rasters, band indexes and "
+"one user-specified callback function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Rasters on which the map algebra process is evaluated."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>rastbandargset</varname> allows the use of a map algebra operation "
+"on many rasters and/or many bands. See example Variant 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Band numbers of the raster to be evaluated. nband can be an integer or "
+"integer[] denoting the bands. nband1 is band on rast1 and nband2 is band on "
+"rast2 for the 2 raster/2band case."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>callbackfunc</varname> parameter must be the name and signature "
+"of an SQL or PL/pgSQL function, cast to a regprocedure. An example PL/pgSQL "
+"function example is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>callbackfunc</varname> must have three arguments: a 3-dimension "
+"double precision array, a 2-dimension integer array and a variadic 1-"
+"dimension text array. The first argument <varname>value</varname> is the set "
+"of values (as double precision) from all input rasters. The three dimensions "
+"(where indexes are 1-based) are: raster #, row y, column x. The second "
+"argument <varname>position</varname> is the set of pixel positions from the "
+"output raster and input rasters. The outer dimension (where indexes are 0-"
+"based) is the raster #. The position at outer dimension index 0 is the "
+"output raster's pixel position. For each outer dimension, there are two "
+"elements in the inner dimension for X and Y. The third argument "
+"<varname>userargs</varname> is for passing through any user-specified "
+"arguments."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Passing a <type>regprocedure</type> argument to a SQL function requires the "
+"full function signature to be passed, then cast to a <type>regprocedure</"
+"type> type. To pass the above example PL/pgSQL function as an argument, the "
+"SQL for the argument is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that the argument contains the name of the function, the types of the "
+"function arguments, quotes around the name and argument types, and a cast to "
+"a <type>regprocedure</type>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An n-dimensional array (matrix) of numbers used to filter what cells get "
+"passed to map algebra call-back function. 0 means a neighbor cell value "
+"should be treated as no-data and 1 means value should be treated as data. If "
+"weight is set to true, then the values, are used as multipliers to multiple "
+"the pixel value of that value in the neighborhood position."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"boolean (true/false) to denote if a mask value should be weighted "
+"(multiplied by original value) or not (only applies to proto that takes a "
+"mask)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>pixeltype</varname> is passed in, the one band of the new raster "
+"will be of that pixeltype. If pixeltype is passed NULL or left out, the new "
+"raster band will have the same pixeltype as the specified band of the first "
+"raster (for extent types: INTERSECTION, UNION, FIRST, CUSTOM) or the "
+"specified band of the appropriate raster (for extent types: SECOND, LAST). "
+"If in doubt, always specify <varname>pixeltype</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The resulting pixel type of the output raster must be one listed in <xref "
+"linkend=\"RT_ST_BandPixelType\"/> or left out or set to NULL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Possible values are INTERSECTION (default), UNION, FIRST (default for one "
+"raster variants), SECOND, LAST, CUSTOM."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>extentype</varname> is CUSTOM, a raster must be provided for "
+"<varname>customextent</varname>. See example 4 of Variant 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The distance in pixels from the reference cell in x direction. So width of "
+"resulting matrix would be <code>2*distancex + 1</code>.If not specified only "
+"the reference cell is considered (neighborhood of 0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The distance in pixels from reference cell in y direction. Height of "
+"resulting matrix would be <code>2*distancey + 1</code> .If not specified "
+"only the reference cell is considered (neighborhood of 0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The third argument to the <varname>callbackfunc</varname> is a "
+"<type>variadic text</type> array. All trailing text arguments are passed "
+"through to the specified <varname>callbackfunc</varname>, and are contained "
+"in the <varname>userargs</varname> argument."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information about the VARIADIC keyword, please refer to the "
+"PostgreSQL documentation and the \"SQL Functions with Variable Numbers of "
+"Arguments\" section of <link xlink:href=\"http://www.postgresql.org/docs/"
+"current/static/xfunc-sql.html\">Query Language (SQL) Functions</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <type>text[]</type> argument to the <varname>callbackfunc</varname> is "
+"required, regardless of whether you choose to pass any arguments to the "
+"callback function for processing or not."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 1 accepts an array of <varname>rastbandarg</varname> allowing the "
+"use of a map algebra operation on many rasters and/or many bands. See "
+"example Variant 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variants 2 and 3 operate upon one or more bands of one raster. See example "
+"Variant 2 and 3."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 4 operate upon two rasters with one band per raster. See example "
+"Variant 4."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.2.0: Ability to add a mask"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "One raster, one band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "One raster, several bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Several rasters, several bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Complete example of tiles of a coverage with neighborhood. This query only "
+"works with PostgreSQL 9.1 or higher."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example like the prior one for tiles of a coverage with neighborhood but "
+"works with PostgreSQL 9.0."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variants 2 and 3"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variant 4"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Two rasters, two bands"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Using Masks"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "original"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "no mask mean value (same as having all 1s in mask matrix)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "mask only consider neighbors, exclude center"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"mask weighted only consider neighbors, exclude center multi other pixel "
+"values by 2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Union\"/>, <xref linkend=\"RT_ST_MapAlgebra_expr\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Expression version - Returns a one-band raster given one or two "
+"input rasters, band indexes and one or more user-specified SQL expressions.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Expression version - Returns a one-band raster given one or two input "
+"rasters, band indexes and one or more user-specified SQL expressions.</para>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Description: Variants 1 and 2 (one raster)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new one band raster formed by applying a valid PostgreSQL "
+"algebraic operation defined by the <varname>expression</varname> on the "
+"input raster (<varname>rast</varname>). If <varname>nband</varname> is not "
+"provided, band 1 is assumed. The new raster will have the same georeference, "
+"width, and height as the original raster but will only have one band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>pixeltype</varname> is passed in, then the new raster will have "
+"a band of that pixeltype. If pixeltype is passed NULL, then the new raster "
+"band will have the same pixeltype as the input <varname>rast</varname> band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Keywords permitted for <varname>expression</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>[rast]</varname> - Pixel value of the pixel of interest"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>[rast.val]</varname> - Pixel value of the pixel of interest"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast.x]</varname> - 1-based pixel column of the pixel of interest"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast.y]</varname> - 1-based pixel row of the pixel of interest"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Description: Variants 3 and 4 (two raster)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new one band raster formed by applying a valid PostgreSQL "
+"algebraic operation to the two bands defined by the <varname>expression</"
+"varname> on the two input raster bands <varname>rast1</varname>, "
+"(<varname>rast2</varname>). If no <varname>band1</varname>, <varname>band2</"
+"varname> is specified band 1 is assumed. The resulting raster will be "
+"aligned (scale, skew and pixel corners) on the grid defined by the first "
+"raster. The resulting raster will have the extent defined by the "
+"<varname>extenttype</varname> parameter."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A PostgreSQL algebraic expression involving the two rasters and PostgreSQL "
+"defined functions/operators that will define the pixel value when pixels "
+"intersect. e.g. (([rast1] + [rast2])/2.0)::integer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The resulting pixel type of the output raster. Must be one listed in <xref "
+"linkend=\"RT_ST_BandPixelType\"/>, left out or set to NULL. If not passed in "
+"or set to NULL, will default to the pixeltype of the first raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Controls the extent of resulting raster"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>INTERSECTION</varname> - The extent of the new raster is the "
+"intersection of the two rasters. This is the default."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>UNION</varname> - The extent of the new raster is the union of the "
+"two rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>FIRST</varname> - The extent of the new raster is the same as the "
+"one of the first raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>SECOND</varname> - The extent of the new raster is the same as the "
+"one of the second raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An algebraic expression involving only <varname>rast2</varname> or a "
+"constant that defines what to return when pixels of <varname>rast1</varname> "
+"are nodata values and spatially corresponding rast2 pixels have values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An algebraic expression involving only <varname>rast1</varname> or a "
+"constant that defines what to return when pixels of <varname>rast2</varname> "
+"are nodata values and spatially corresponding rast1 pixels have values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A numeric constant to return when spatially corresponding rast1 and rast2 "
+"pixels are both nodata values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Keywords permitted in <varname>expression</varname>, <varname>nodata1expr</"
+"varname> and <varname>nodata2expr</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast1]</varname> - Pixel value of the pixel of interest from "
+"<varname>rast1</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast1.val]</varname> - Pixel value of the pixel of interest from "
+"<varname>rast1</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast1.x]</varname> - 1-based pixel column of the pixel of interest "
+"from <varname>rast1</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast1.y]</varname> - 1-based pixel row of the pixel of interest "
+"from <varname>rast1</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast2]</varname> - Pixel value of the pixel of interest from "
+"<varname>rast2</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast2.val]</varname> - Pixel value of the pixel of interest from "
+"<varname>rast2</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast2.x]</varname> - 1-based pixel column of the pixel of interest "
+"from <varname>rast2</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>[rast2.y]</varname> - 1-based pixel row of the pixel of interest "
+"from <varname>rast2</varname>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variants 1 and 2"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Variant 3 and 4"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Union\"/>, <xref linkend=\"RT_ST_MapAlgebra\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"1 raster band version: Creates a new one band raster formed by applying a "
+"valid PostgreSQL algebraic operation on the input raster band and of "
+"pixeltype provided. Band 1 is assumed if no band is specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 2.1.0. Use <xref linkend=\"RT_ST_MapAlgebra_expr\"/> "
+"instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new one band raster formed by applying a valid PostgreSQL "
+"algebraic operation defined by the <varname>expression</varname> on the "
+"input raster (<varname>rast</varname>). If no <varname>band</varname> is "
+"specified band 1 is assumed. The new raster will have the same georeference, "
+"width, and height as the original raster but will only have one band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the expression you can use the term <varname>[rast]</varname> to refer to "
+"the pixel value of the original band, <varname>[rast.x]</varname> to refer "
+"to the 1-based pixel column index, <varname>[rast.y]</varname> to refer to "
+"the 1-based pixel row index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new 1 band raster from our original that is a function of modulo 2 "
+"of the original raster band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new 1 band raster of pixel-type 2BUI from our original that is "
+"reclassified and set the nodata value to be 0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "original (column rast_view)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "rast_view_ma"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new 3 band raster same pixel type from our original 3 band raster "
+"with first band altered by map algebra and remaining 2 bands unaltered."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebraFct\"/>, <xref "
+"linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference\"/>, "
+"<xref linkend=\"RT_ST_Value\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"2 raster band version: Creates a new one band raster formed by applying a "
+"valid PostgreSQL algebraic operation on the two input raster bands and of "
+"pixeltype provided. band 1 of each raster is assumed if no band numbers are "
+"specified. The resulting raster will be aligned (scale, skew and pixel "
+"corners) on the grid defined by the first raster and have its extent defined "
+"by the \"extenttype\" parameter. Values for \"extenttype\" can be: "
+"INTERSECTION, UNION, FIRST, SECOND."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>pixeltype</varname> is passed in, then the new raster will have "
+"a band of that pixeltype. If pixeltype is passed NULL or no pixel type "
+"specified, then the new raster band will have the same pixeltype as the "
+"input <varname>rast1</varname> band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use the term <varname>[rast1.val]</varname> <varname>[rast2.val]</varname> "
+"to refer to the pixel value of the original raster bands and <varname>[rast1."
+"x]</varname>, <varname>[rast1.y]</varname> etc. to refer to the column / row "
+"positions of the pixels."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: 2 Band Intersection and Union"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "mapalgebra intersection"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "map algebra union"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Overlaying rasters on a canvas as separate bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "rast1"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "rast2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "rast3"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "final_rast"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"Example: Overlay 2 meter boundary of select parcels over an aerial imagery"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The blue lines are the boundaries of select parcels"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AddBand\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, <xref "
+"linkend=\"RT_ST_AsRaster\"/>, <xref linkend=\"RT_ST_MapAlgebraFct\"/>, <xref "
+"linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference\"/>, "
+"<xref linkend=\"RT_ST_Value\"/>, <xref linkend=\"RT_ST_Union\"/>, <xref "
+"linkend=\"ST_Union\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"1 band version - Creates a new one band raster formed by applying a valid "
+"PostgreSQL function on the input raster band and of pixeltype provided. Band "
+"1 is assumed if no band is specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 2.1.0. Use <xref linkend=\"RT_ST_MapAlgebra\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new one band raster formed by applying a valid PostgreSQL function "
+"specified by the <varname>onerasteruserfunc</varname> on the input raster "
+"(<varname>rast</varname>). If no <varname>band</varname> is specified, band "
+"1 is assumed. The new raster will have the same georeference, width, and "
+"height as the original raster but will only have one band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>onerasteruserfunc</varname> parameter must be the name and "
+"signature of a SQL or PL/pgSQL function, cast to a regprocedure. A very "
+"simple and quite useless PL/pgSQL function example is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>userfunction</varname> may accept two or three arguments: a "
+"float value, an optional integer array, and a variadic text array. The first "
+"argument is the value of an individual raster cell (regardless of the raster "
+"datatype). The second argument is the position of the current processing "
+"cell in the form '{x,y}'. The third argument indicates that all remaining "
+"parameters to <xref linkend=\"RT_ST_MapAlgebraFct\"/> shall be passed "
+"through to the <varname>userfunction</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Passing a <type>regprodedure</type> argument to a SQL function requires the "
+"full function signature to be passed, then cast to a <type>regprocedure</"
+"type> type. To pass the above example PL/pgSQL function as an argument, the "
+"SQL for the argument is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The third argument to the <varname>userfunction</varname> is a "
+"<type>variadic text</type> array. All trailing text arguments to any <xref "
+"linkend=\"RT_ST_MapAlgebraFct\"/> call are passed through to the specified "
+"<varname>userfunction</varname>, and are contained in the <varname>args</"
+"varname> argument."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <type>text[]</type> argument to the <varname>userfunction</varname> is "
+"required, regardless of whether you choose to pass any arguments to your "
+"user function for processing or not."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new 1 band raster of pixel-type 2BUI from our original that is "
+"reclassified and set the nodata value to a passed parameter to the user "
+"function (0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "original (column rast-view)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_BandPixelType\"/>, <xref "
+"linkend=\"RT_ST_GeoReference\"/>, <xref linkend=\"RT_ST_SetValue\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"2 band version - Creates a new one band raster formed by applying a valid "
+"PostgreSQL function on the 2 input raster bands and of pixeltype provided. "
+"Band 1 is assumed if no band is specified. Extent type defaults to "
+"INTERSECTION if not specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new one band raster formed by applying a valid PostgreSQL function "
+"specified by the <varname>tworastuserfunc</varname> on the input raster "
+"<varname>rast1</varname>, <varname>rast2</varname>. If no <varname>band1</"
+"varname> or <varname>band2</varname> is specified, band 1 is assumed. The "
+"new raster will have the same georeference, width, and height as the "
+"original rasters but will only have one band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>pixeltype</varname> is passed in, then the new raster will have "
+"a band of that pixeltype. If pixeltype is passed NULL or left out, then the "
+"new raster band will have the same pixeltype as the input <varname>rast1</"
+"varname> band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>tworastuserfunc</varname> parameter must be the name and "
+"signature of an SQL or PL/pgSQL function, cast to a regprocedure. An example "
+"PL/pgSQL function example is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>tworastuserfunc</varname> may accept three or four arguments: a "
+"double precision value, a double precision value, an optional integer array, "
+"and a variadic text array. The first argument is the value of an individual "
+"raster cell in <varname>rast1</varname> (regardless of the raster datatype). "
+"The second argument is an individual raster cell value in <varname>rast2</"
+"varname>. The third argument is the position of the current processing cell "
+"in the form '{x,y}'. The fourth argument indicates that all remaining "
+"parameters to <xref linkend=\"RT_ST_MapAlgebraFct2\"/> shall be passed "
+"through to the <varname>tworastuserfunc</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The fourth argument to the <varname>tworastuserfunc</varname> is a "
+"<type>variadic text</type> array. All trailing text arguments to any <xref "
+"linkend=\"RT_ST_MapAlgebraFct2\"/> call are passed through to the specified "
+"<varname>tworastuserfunc</varname>, and are contained in the "
+"<varname>userargs</varname> argument."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <type>text[]</type> argument to the <varname>tworastuserfunc</varname> "
+"is required, regardless of whether you choose to pass any arguments to your "
+"user function for processing or not."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "map bands overlay (canvas) (R: small road, G: circle, B: big road)"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "User Defined function that takes extra args"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "user defined with extra args and different bands from same raster"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"1-band version: Map Algebra Nearest Neighbor using user-defined PostgreSQL "
+"function. Return a raster which values are the result of a PLPGSQL user "
+"function involving a neighborhood of values from the input raster band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(one raster version) Return a raster which values are the result of a "
+"PLPGSQL user function involving a neighborhood of values from the input "
+"raster band. The user function takes the neighborhood of pixel values as an "
+"array of numbers, for each pixel, returns the result from the user function, "
+"replacing pixel value of currently inspected pixel with the function result."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Raster on which the user function is evaluated."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Band number of the raster to be evaluated. Default to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The resulting pixel type of the output raster. Must be one listed in <xref "
+"linkend=\"RT_ST_BandPixelType\"/> or left out or set to NULL. If not passed "
+"in or set to NULL, will default to the pixeltype of the <varname>rast</"
+"varname>. Results are truncated if they are larger than what is allowed for "
+"the pixeltype."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The width of the neighborhood, in cells."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The height of the neighborhood, in cells."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PLPGSQL/psql user function to apply to neighborhood pixels of a single band "
+"of a raster. The first element is a 2-dimensional array of numbers "
+"representing the rectangular pixel neighborhood"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Defines what value to pass to the function for a neighborhood pixel that is "
+"nodata or NULL"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'ignore': any NODATA values encountered in the neighborhood are ignored by "
+"the computation -- this flag must be sent to the user callback function, and "
+"the user function decides how to ignore it."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'NULL': any NODATA values encountered in the neighborhood will cause the "
+"resulting pixel to be NULL -- the user callback function is skipped in this "
+"case."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"'value': any NODATA values encountered in the neighborhood are replaced by "
+"the reference pixel (the one in the center of the neighborhood). Note that "
+"if this value is NODATA, the behavior is the same as 'NULL' (for the "
+"affected neighborhood)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Arguments to pass into the user function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Examples utilize the katrina raster loaded as a single tile described in "
+"<link xlink:href=\"https://gdal.org/user/drivers/raster/postgisraster."
+"html\">https://gdal.org/user/drivers/raster/postgisraster.html</link> and "
+"then prepared in the <xref linkend=\"RT_ST_Rescale\"/> examples"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "First band of our raster"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "new raster after averaging pixels within 4x4 pixels of each other"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebraExpr\"/>, <xref linkend=\"RT_ST_Rescale\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a new raster composed of band types reclassified from original. The "
+"nband is the band to be changed. If nband is not specified assumed to be 1. "
+"All other bands are returned unchanged. Use case: convert a 16BUI band to a "
+"8BUI and so forth for simpler rendering as viewable formats."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new raster formed by applying a reclassification operation defined "
+"by the <varname>reclassexpr</varname> on the input raster (<varname>rast</"
+"varname>). Refer to <xref linkend=\"reclassarg\"/> for the description of "
+"reclassification expressions. If no <varname>band</varname> is specified "
+"band 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The new raster will have the same georeference, width, and height as the "
+"original raster. The bands of the new raster have pixel type of "
+"<varname>pixeltype</varname>. If <varname>reclassargset</varname> is "
+"specified then each <varname>reclassarg</varname> defines the type of the "
+"target band. Bands not designated are returned unchanged."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Basic"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new raster from the original where band 2 is converted from 8BUI to "
+"4BUI and all values from 101-254 are set to nodata value."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example: Advanced using multiple reclassargs"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new raster from the original where band 1,2,3 is converted to "
+"1BB,4BUI, 4BUI respectively and reclassified. Note this uses the variadic "
+"<varname>reclassarg</varname> argument which can take as input an indefinite "
+"number of reclassargs (theoretically as many bands as you have)"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"Example: Advanced Map a single band 32BF raster to multiple viewable bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a new 3 band (8BUI,8BUI,8BUI viewable raster) from a raster that has "
+"only one 32bf band"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Band\"/>, <xref linkend=\"RT_ST_BandPixelType\"/>, "
+"<xref linkend=\"RT_ST_MakeEmptyRaster\"/>, <xref linkend=\"reclassarg\"/>, "
+"<xref linkend=\"RT_ST_Value\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Creates a new raster composed of bands reclassified from original, using a "
+"1:1 mapping from values in the original band to new values in the "
+"destination band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new raster formed by applying a reclassification operation defined "
+"by the <varname>inputvalues</varname> and <varname>outputvalues</varname> "
+"arrays. Pixel values found in the input array are mapped to the "
+"corresponding value in the output array. All other pixel values are mapped "
+"to the <varname>nodatavalue</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The output pixel type defaults to float, but can be specified using the "
+"<varname>pixeltype</varname> parameter. If no <varname>bandnumber</varname> "
+"is specified band 1 is assumed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The new raster will have the same georeference, width, and height as the "
+"original raster. Bands not designated are returned unchanged."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a small raster and map its pixels to new values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AddBand\"/>, <xref linkend=\"RT_ST_Band\"/>, <xref "
+"linkend=\"RT_ST_MakeEmptyRaster\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the union of a set of raster tiles into a single raster composed of "
+"1 or more bands."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the union of a set of raster tiles into a single raster composed of "
+"at least one band. The resulting raster's extent is the extent of the whole "
+"set. In the case of intersection, the resulting value is defined by "
+"<varname>uniontype</varname> which is one of the following: LAST (default), "
+"FIRST, MIN, MAX, COUNT, SUM, MEAN, RANGE."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In order for rasters to be unioned, they must all have the same alignment. "
+"Use <xref linkend=\"RT_ST_SameAlignment\"/> and <xref "
+"linkend=\"RT_ST_NotSameAlignmentReason\"/> for more details and help. One "
+"way to fix alignment issues is to use <xref linkend=\"RT_ST_Resample\"/> and "
+"use the same reference raster for alignment."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 Improved Speed (fully C-Based)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.1.0 ST_Union(rast, unionarg) variant was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 ST_Union(rast) (variant 1) unions all bands of all input "
+"rasters. Prior versions of PostGIS assumed the first band."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 ST_Union(rast, uniontype) (variant 4) unions all bands of "
+"all input rasters."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Reconstitute a single band chunked raster tile"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"Examples: Return a multi-band raster that is the union of tiles intersecting "
+"geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Here we use the longer syntax if we only wanted a subset of bands or we want "
+"to change order of bands"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Envelope\"/>, <xref linkend=\"RT_ST_ConvexHull\"/>, "
+"<xref linkend=\"RT_ST_Clip\"/>, <xref linkend=\"ST_Union\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Built-in Map Algebra Callback Functions"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the number of unique pixel values "
+"in a neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculate the number of unique pixel values in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 1 is a specialized callback function for use as a callback parameter "
+"to <xref linkend=\"RT_ST_MapAlgebraFctNgb\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Variant 2 is a specialized callback function for use as a callback parameter "
+"to <xref linkend=\"RT_ST_MapAlgebra\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use of Variant 1 is discouraged since <xref "
+"linkend=\"RT_ST_MapAlgebraFctNgb\"/> has been deprecated as of 2.1.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 Addition of Variant 2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, "
+"<xref linkend=\"RT_ST_Max4ma\"/>, <xref linkend=\"RT_ST_Sum4ma\"/>, <xref "
+"linkend=\"RT_ST_Mean4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref "
+"linkend=\"RT_ST_StdDev4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that interpolates a pixel's value from the "
+"pixel's neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculate an interpolated value for a pixel using the Inverse Distance "
+"Weighted method."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are two optional parameters that can be passed through "
+"<varname>userargs</varname>. The first parameter is the power factor "
+"(variable k in the equation below) between 0 and 1 used in the Inverse "
+"Distance Weighted equation. If not specified, default value is 1. The second "
+"parameter is the weight percentage applied only when the value of the pixel "
+"of interest is included with the interpolated value from the neighborhood. "
+"If not specified and the pixel of interest has a value, that value is "
+"returned."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The basic inverse distance weight equation is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "k = power factor, a real number between 0 and 1"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is a specialized callback function for use as a callback "
+"parameter to <xref linkend=\"RT_ST_MapAlgebra\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_MinDist4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the maximum pixel value in a "
+"neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Calculate the maximum pixel value in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For Variant 2, a substitution value for NODATA pixels can be specified by "
+"passing that value to userargs."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, "
+"<xref linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref "
+"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref "
+"linkend=\"RT_ST_StdDev4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the mean pixel value in a "
+"neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Calculate the mean pixel value in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, "
+"<xref linkend=\"RT_ST_Max4ma\"/>, <xref linkend=\"RT_ST_Sum4ma\"/>, <xref "
+"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_StdDev4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the minimum pixel value in a "
+"neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Calculate the minimum pixel value in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Max4ma\"/>, "
+"<xref linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref "
+"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref "
+"linkend=\"RT_ST_StdDev4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that returns the minimum distance (in number of "
+"pixels) between the pixel of interest and a neighboring pixel with value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the shortest distance (in number of pixels) between the pixel of "
+"interest and the closest pixel with value in the neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The intent of this function is to provide an informative data point that "
+"helps infer the usefulness of the pixel of interest's interpolated value "
+"from <xref linkend=\"RT_ST_InvDistWeight4ma\"/>. This function is "
+"particularly useful when the neighborhood is sparsely populated."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_InvDistWeight4ma\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the range of pixel values in a "
+"neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Calculate the range of pixel values in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the standard deviation of pixel "
+"values in a neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculate the standard deviation of pixel values in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Raster processing function that calculates the sum of all pixel values in a "
+"neighborhood."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Calculate the sum of all pixel values in a neighborhood of pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, "
+"<xref linkend=\"RT_ST_Max4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref "
+"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref "
+"linkend=\"RT_ST_StdDev4ma\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Processing: DEM (Elevation)"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the aspect (in degrees by default) of an elevation raster band. "
+"Useful for analyzing terrain."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the aspect (in degrees by default) of an elevation raster band. "
+"Utilizes map algebra and applies the aspect equation to neighboring pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>units</varname> indicates the units of the aspect. Possible values "
+"are: RADIANS, DEGREES (default)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When <varname>units</varname> = RADIANS, values are between 0 and 2 * pi "
+"radians measured clockwise from North."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When <varname>units</varname> = DEGREES, values are between 0 and 360 "
+"degrees measured clockwise from North."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "If slope of pixel is zero, aspect of pixel is -1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information about Slope, Aspect and Hillshade, please refer to "
+"<link xlink:href=\"http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?"
+"TopicName=How%20Hillshade%20works\">ESRI - How hillshade works</link> and "
+"<link xlink:href=\"http://e2b.erdas.com/fieldguide/wwhelp/wwhimpl/common/"
+"html/wwhelp.htm?context=FieldGuide&file=Aspect_Images.html\">ERDAS Field "
+"Guide - Aspect Images</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 Uses ST_MapAlgebra() and added optional "
+"<varname>interpolate_nodata</varname> function parameter"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.1.0 In prior versions, return values were in radians. Now, return "
+"values default to degrees"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Complete example of tiles of a coverage. This query only works with "
+"PostgreSQL 9.1 or higher."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref "
+"linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref "
+"linkend=\"RT_ST_Slope\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the hypothetical illumination of an elevation raster band using "
+"provided azimuth, altitude, brightness and scale inputs."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the hypothetical illumination of an elevation raster band using the "
+"azimuth, altitude, brightness, and scale inputs. Utilizes map algebra and "
+"applies the hill shade equation to neighboring pixels. Return pixel values "
+"are between 0 and 255."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>azimuth</varname> is a value between 0 and 360 degrees measured "
+"clockwise from North."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>altitude</varname> is a value between 0 and 90 degrees where 0 "
+"degrees is at the horizon and 90 degrees is directly overhead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>max_bright</varname> is a value between 0 and 255 with 0 as no "
+"brightness and 255 as max brightness."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>scale</varname> is the ratio of vertical units to horizontal. For "
+"Feet:LatLon use scale=370400, for Meters:LatLon use scale=111120."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>interpolate_nodata</varname> is TRUE, values for NODATA pixels "
+"from the input raster will be interpolated using <xref "
+"linkend=\"RT_ST_InvDistWeight4ma\"/> before computing the hillshade "
+"illumination."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information about Hillshade, please refer to <link xlink:"
+"href=\"http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?"
+"TopicName=How%20Hillshade%20works\">How hillshade works</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.1.0 In prior versions, azimuth and altitude were expressed in "
+"radians. Now, azimuth and altitude are expressed in degrees"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref "
+"linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_Aspect\"/>, <xref "
+"linkend=\"RT_ST_Slope\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a raster with the calculated \"roughness\" of a DEM."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculates the \"roughness\" of a DEM, by subtracting the maximum from the "
+"minimum for a given area."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref "
+"linkend=\"RT_ST_Slope\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref "
+"linkend=\"RT_ST_Aspect\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the slope (in degrees by default) of an elevation raster band. "
+"Useful for analyzing terrain."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the slope (in degrees by default) of an elevation raster band. "
+"Utilizes map algebra and applies the slope equation to neighboring pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>units</varname> indicates the units of the slope. Possible values "
+"are: RADIANS, DEGREES (default), PERCENT."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>interpolate_nodata</varname> is TRUE, values for NODATA pixels "
+"from the input raster will be interpolated using <xref "
+"linkend=\"RT_ST_InvDistWeight4ma\"/> before computing the surface slope."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information about Slope, Aspect and Hillshade, please refer to "
+"<link xlink:href=\"http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?"
+"TopicName=How%20Hillshade%20works\">ESRI - How hillshade works</link> and "
+"<link xlink:href=\"http://e2b.erdas.com/fieldguide/wwhelp/wwhimpl/common/"
+"html/wwhelp.htm?context=FieldGuide&file=Slope_Images.html\">ERDAS Field "
+"Guide - Slope Images</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 Uses ST_MapAlgebra() and added optional <varname>units</"
+"varname>, <varname>scale</varname>, <varname>interpolate_nodata</varname> "
+"function parameters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref "
+"linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref "
+"linkend=\"RT_ST_Aspect\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a raster with the calculated Topographic Position Index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Calculates the Topographic Position Index, which is defined as the focal "
+"mean with radius of one minus the center cell."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function only supports a focalmean radius of one."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_Roughness\"/>, <xref "
+"linkend=\"RT_ST_Slope\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref "
+"linkend=\"RT_ST_Aspect\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a raster with the calculated Terrain Ruggedness Index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Terrain Ruggedness Index is calculated by comparing a central pixel with its "
+"neighbors, taking the absolute values of the differences, and averaging the "
+"result."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref "
+"linkend=\"RT_ST_Slope\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref "
+"linkend=\"RT_ST_Aspect\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Processing: Raster to Geometry"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the box 3d representation of the enclosing box of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the box representing the extent of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The polygon is defined by the corner points of the bounding box "
+"((<varname>MINX</varname>, <varname>MINY</varname>), (<varname>MAXX</"
+"varname>, <varname>MAXY</varname>))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.0.0 In pre-2.0 versions, there used to be a box2d instead of "
+"box3d. Since box2d is a deprecated type, this was changed to box3d."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return the convex hull geometry of the raster including pixel values equal "
+"to BandNoDataValue. For regular shaped and non-skewed rasters, this gives "
+"the same result as ST_Envelope so only useful for irregularly shaped or "
+"skewed rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the convex hull geometry of the raster including the NoDataBandValue "
+"band pixels. For regular shaped and non-skewed rasters, this gives more or "
+"less the same result as ST_Envelope so only useful for irregularly shaped or "
+"skewed rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Envelope floors the coordinates and hence add a little buffer around the "
+"raster so the answer is subtly different from ST_ConvexHull which does not "
+"floor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to <link xlink:href=\"http://trac.osgeo.org/postgis/wiki/WKTRaster/"
+"SpecificationWorking01\">PostGIS Raster Specification</link> for a diagram "
+"of this."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_MinConvexHull\"/>, <xref linkend=\"ST_ConvexHull\"/"
+">, <xref linkend=\"ST_AsText\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a set of geomval (geom,val) rows, from a given raster band. If no "
+"band number is specified, band num defaults to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a set-returning function (SRF). It returns a set of geomval rows, "
+"formed by a geometry (geom) and a pixel band value (val). Each polygon is "
+"the union of all pixels for that band that have the same pixel value denoted "
+"by val."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_DumpAsPolygon is useful for polygonizing rasters. It is the reverse of a "
+"GROUP BY in that it creates new rows. For example it can be used to expand a "
+"single raster into multiple POLYGONS/MULTIPOLYGONS."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed 3.3.0, validation and fixing is disabled to improve performance. May "
+"result invalid geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: Requires GDAL 1.7 or higher."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If there is a no data value set for a band, pixels with that value will not "
+"be returned except in the case of exclude_nodata_value=false."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you only care about count of pixels with a given value in a raster, it is "
+"faster to use <xref linkend=\"RT_ST_ValueCount\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is different than ST_PixelAsPolygons where one geometry is returned for "
+"each pixel regardless of pixel value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_AsRasterAgg\"/>, <xref linkend=\"RT_ST_Value\"/>, "
+"<xref linkend=\"RT_ST_Polygon\"/>, <xref linkend=\"RT_ST_ValueCount\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the polygon representation of the extent of the raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the polygon representation of the extent of the raster in spatial "
+"coordinate units defined by srid. It is a float8 minimum bounding box "
+"represented as a polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The polygon is defined by the corner points of the bounding box "
+"((<varname>MINX</varname>, <varname>MINY</varname>), (<varname>MINX</"
+"varname>, <varname>MAXY</varname>), (<varname>MAXX</varname>, <varname>MAXY</"
+"varname>), (<varname>MAXX</varname>, <varname>MINY</varname>), "
+"(<varname>MINX</varname>, <varname>MINY</varname>))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsText\"/>, <xref linkend=\"RT_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the convex hull geometry of the raster excluding NODATA pixels."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return the convex hull geometry of the raster excluding NODATA pixels. If "
+"<varname>nband</varname> is NULL, all bands of the raster are considered."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_ConvexHull\"/>, <xref linkend=\"ST_ConvexHull\"/>, "
+"<xref linkend=\"ST_AsText\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a multipolygon geometry formed by the union of pixels that have a "
+"pixel value that is not no data value. If no band number is specified, band "
+"num defaults to 1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 0.1.6 Requires GDAL 1.7 or higher."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.1.0 Improved Speed (fully C-Based) and the returning "
+"multipolygon is ensured to be valid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.1.0 In prior versions would sometimes return a polygon, changed "
+"to always return multipolygon."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Operators"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box intersects B's bounding "
+"box."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&&</varname> operator returns <varname>TRUE</varname> "
+"if the bounding box of raster/geometr A intersects the bounding box of "
+"raster/geometr B."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will make use of any indexes that may be available on the "
+"rasters."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is to the left of B's."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&<</varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of raster A overlaps or is to the left of the bounding box "
+"of raster B, or more accurately, overlaps or is NOT to the right of the "
+"bounding box of raster B."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is to the right of B's."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>&></varname> operator returns <varname>TRUE</varname> if "
+"the bounding box of raster A overlaps or is to the right of the bounding box "
+"of raster B, or more accurately, overlaps or is NOT to the left of the "
+"bounding box of raster B."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is the same as B's. Uses "
+"double precision bounding box."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>=</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of raster A is the same as the bounding box of raster B. "
+"PostgreSQL uses the =, <, and > operators defined for rasters to "
+"perform internal orderings and comparison of rasters (ie. in a GROUP BY or "
+"ORDER BY clause)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This operand will NOT make use of any indexes that may be available on the "
+"rasters. Use <xref linkend=\"RT_Raster_Same\"/> instead. This operator "
+"exists mostly so one can group by the raster column."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is contained by B's. "
+"Uses double precision bounding box."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>@</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of raster/geometry A is contained by bounding box of raster/"
+"geometr B."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This operand will use spatial indexes on the rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.0 raster @ raster, raster @ geometry introduced"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0.5 geometry @ raster introduced"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~=</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of raster A is the same as the bounding box of raster B."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Very useful usecase is for taking two sets of single band rasters that are "
+"of the same chunk but represent different themes and creating a multi-band "
+"raster"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_Raster_EQ\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A's bounding box is contains B's. Uses "
+"double precision bounding box."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>~</varname> operator returns <varname>TRUE</varname> if the "
+"bounding box of raster/geometry A is contains bounding box of raster/geometr "
+"B."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster and Raster Band Spatial Relationships"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if no points of raster rastB lie in the exterior of raster rastA "
+"and at least one point of the interior of rastB lies in the interior of "
+"rastA."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raster rastA contains rastB if and only if no points of rastB lie in the "
+"exterior of rastA and at least one point of the interior of rastB lies in "
+"the interior of rastA. If the band number is not provided (or set to NULL), "
+"only the convex hull of the raster is considered in the test. If the band "
+"number is provided, only those pixels with value (not NODATA) are considered "
+"in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function will make use of any indexes that may be available on the "
+"rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_Contains(ST_Polygon(raster), geometry) or "
+"ST_Contains(geometry, ST_Polygon(raster))."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Contains() is the inverse of ST_Within(). So, ST_Contains(rastA, rastB) "
+"implies ST_Within(rastB, rastA)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if rastB intersects the interior of rastA but not the boundary "
+"or exterior of rastA."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raster rastA contains properly rastB if rastB intersects the interior of "
+"rastA but not the boundary or exterior of rastA. If the band number is not "
+"provided (or set to NULL), only the convex hull of the raster is considered "
+"in the test. If the band number is provided, only those pixels with value "
+"(not NODATA) are considered in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Raster rastA does not contain properly itself but does contain itself."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_ContainsProperly(ST_Polygon(raster), geometry) or "
+"ST_ContainsProperly(geometry, ST_Polygon(raster))."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Contains\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return true if no points of raster rastB lie outside raster rastA."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raster rastA covers rastB if and only if no points of rastB lie in the "
+"exterior of rastA. If the band number is not provided (or set to NULL), only "
+"the convex hull of the raster is considered in the test. If the band number "
+"is provided, only those pixels with value (not NODATA) are considered in the "
+"test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_Covers(ST_Polygon(raster), geometry) or "
+"ST_Covers(geometry, ST_Polygon(raster))."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_CoveredBy\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return true if no points of raster rastA lie outside raster rastB."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raster rastA is covered by rastB if and only if no points of rastA lie in "
+"the exterior of rastB. If the band number is not provided (or set to NULL), "
+"only the convex hull of the raster is considered in the test. If the band "
+"number is provided, only those pixels with value (not NODATA) are considered "
+"in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_CoveredBy(ST_Polygon(raster), geometry) or "
+"ST_CoveredBy(geometry, ST_Polygon(raster))."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Covers\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return true if raster rastA does not spatially intersect rastB."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raster rastA and rastB are disjointed if they do not share any space "
+"together. If the band number is not provided (or set to NULL), only the "
+"convex hull of the raster is considered in the test. If the band number is "
+"provided, only those pixels with value (not NODATA) are considered in the "
+"test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function does NOT use any indexes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_Disjoint(ST_Polygon(raster), geometry)."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return true if raster rastA spatially intersects raster rastB."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return true if raster rastA spatially intersects raster rastB. If the band "
+"number is not provided (or set to NULL), only the convex hull of the raster "
+"is considered in the test. If the band number is provided, only those pixels "
+"with value (not NODATA) are considered in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 support raster/raster intersects was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.1.0 The behavior of the ST_Intersects(raster, geometry) variants "
+"changed to match that of ST_Intersects(geometry, raster)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_Disjoint\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if raster rastA and rastB intersect but one does not completely "
+"contain the other."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return true if raster rastA spatially overlaps raster rastB. This means that "
+"rastA and rastB intersect but one does not completely contain the other. If "
+"the band number is not provided (or set to NULL), only the convex hull of "
+"the raster is considered in the test. If the band number is provided, only "
+"those pixels with value (not NODATA) are considered in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_Overlaps(ST_Polygon(raster), geometry)."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if raster rastA and rastB have at least one point in common but "
+"their interiors do not intersect."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return true if raster rastA spatially touches raster rastB. This means that "
+"rastA and rastB have at least one point in common but their interiors do not "
+"intersect. If the band number is not provided (or set to NULL), only the "
+"convex hull of the raster is considered in the test. If the band number is "
+"provided, only those pixels with value (not NODATA) are considered in the "
+"test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_Touches(ST_Polygon(raster), geometry)."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns true if rasters have same skew, scale, spatial ref, and offset "
+"(pixels can be put on same grid without cutting into pixels) and false if "
+"they don't with notice detailing issue."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Non-Aggregate version (Variants 1 and 2): Returns true if the two rasters "
+"(either provided directly or made using the values for upperleft, scale, "
+"skew and srid) have the same scale, skew, srid and at least one of any of "
+"the four corners of any pixel of one raster falls on any corner of the grid "
+"of the other raster. Returns false if they don't and a NOTICE detailing the "
+"alignment issue."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Aggregate version (Variant 3): From a set of rasters, returns true if all "
+"rasters in the set are aligned. The ST_SameAlignment() function is an "
+"\"aggregate\" function in the terminology of PostgreSQL. That means that it "
+"operates on rows of data, in the same way the SUM() and AVG() functions do."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 addition of Aggregate variant"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples: Rasters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_NotSameAlignmentReason\"/>, <xref "
+"linkend=\"RT_ST_MakeEmptyRaster\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns text stating if rasters are aligned and if not aligned, "
+"a reason why.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns text stating if rasters are aligned and if not aligned, a "
+"reason why.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If there are several reasons why the rasters are not aligned, only one "
+"reason (the first test to fail) will be returned."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_SameAlignment\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if no points of raster rastA lie in the exterior of raster rastB "
+"and at least one point of the interior of rastA lies in the interior of "
+"rastB."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raster rastA is within rastB if and only if no points of rastA lie in the "
+"exterior of rastB and at least one point of the interior of rastA lies in "
+"the interior of rastB. If the band number is not provided (or set to NULL), "
+"only the convex hull of the raster is considered in the test. If the band "
+"number is provided, only those pixels with value (not NODATA) are considered "
+"in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_Within(ST_Polygon(raster), geometry) or "
+"ST_Within(geometry, ST_Polygon(raster))."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Within() is the inverse of ST_Contains(). So, ST_Within(rastA, rastB) "
+"implies ST_Contains(rastB, rastA)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"RT_ST_Contains\"/>, <xref linkend=\"RT_ST_DWithin\"/>, "
+"<xref linkend=\"RT_ST_DFullyWithin\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if rasters rastA and rastB are within the specified distance of "
+"each other."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return true if rasters rastA and rastB are within the specified distance of "
+"each other. If the band number is not provided (or set to NULL), only the "
+"convex hull of the raster is considered in the test. If the band number is "
+"provided, only those pixels with value (not NODATA) are considered in the "
+"test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The distance is specified in units defined by the spatial reference system "
+"of the rasters. For this function to make sense, the source rasters must "
+"both be of the same coordinate projection, having the same SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_DWithin(ST_Polygon(raster), geometry)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_DFullyWithin\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return true if rasters rastA and rastB are fully within the specified "
+"distance of each other."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return true if rasters rastA and rastB are fully within the specified "
+"distance of each other. If the band number is not provided (or set to NULL), "
+"only the convex hull of the raster is considered in the test. If the band "
+"number is provided, only those pixels with value (not NODATA) are considered "
+"in the test."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test the spatial relationship of a raster and a geometry, use ST_Polygon "
+"on the raster, e.g. ST_DFullyWithin(ST_Polygon(raster), geometry)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"RT_ST_DWithin\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Tips"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section documents various gotchas and tips related to PostGIS Raster."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Out-DB Rasters"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Directory containing many files"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When GDAL opens a file, GDAL eagerly scans the directory of that file to "
+"build a catalog of other files. If this directory contains many files (e.g. "
+"thousands, millions), opening that file becomes extremely slow (especially "
+"if that file happens to be on a network drive such as NFS)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To control this behavior, GDAL provides the following environment variable: "
+"<link xlink:href=\"https://gdal.org/user/configoptions.html#config-"
+"GDAL_DISABLE_READDIR_ON_OPEN\">GDAL_DISABLE_READDIR_ON_OPEN</link>. Set "
+"<varname>GDAL_DISABLE_READDIR_ON_OPEN</varname> to <varname>TRUE</varname> "
+"to disable directory scanning."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In Ubuntu (and assuming you are using PostgreSQL's packages for Ubuntu), "
+"<varname>GDAL_DISABLE_READDIR_ON_OPEN</varname> can be set in <emphasis>/etc/"
+"postgresql/POSTGRESQL_VERSION/CLUSTER_NAME/environment</emphasis> (where "
+"POSTGRESQL_VERSION is the version of PostgreSQL, e.g. 9.6 and CLUSTER_NAME "
+"is the name of the cluster, e.g. maindb). You can also set PostGIS "
+"environment variables here as well."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Maximum Number of Open Files"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The maximum number of open files permitted by Linux and PostgreSQL are "
+"typically conservative (typically 1024 open files per process) given the "
+"assumption that the system is consumed by human users. For Out-DB Rasters, a "
+"single valid query can easily exceed this limit (e.g. a dataset of 10 year's "
+"worth of rasters with one raster for each day containing minimum and maximum "
+"temperatures and we want to know the absolute min and max value for a pixel "
+"in that dataset)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The easiest change to make is the following PostgreSQL setting: <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/static/runtime-config-"
+"resource.html#GUC-MAX-FILES-PER-PROCESS\">max_files_per_process</link>. The "
+"default is set to 1000, which is far too low for Out-DB Rasters. A safe "
+"starting value could be 65536 but this really depends on your datasets and "
+"the queries run against those datasets. This setting can only be made on "
+"server start and probably only in the PostgreSQL configuration file (e.g. "
+"<emphasis>/etc/postgresql/POSTGRESQL_VERSION/CLUSTER_NAME/postgresql.conf</"
+"emphasis> in Ubuntu environments)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The major change to make is the Linux kernel's open files limits. There are "
+"two parts to this:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Maximum number of open files for the entire system</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Maximum number of open files per process</para>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "<title>Maximum number of open files for the entire system</title>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can inspect the current maximum number of open files for the entire "
+"system with the following example:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the value returned is not large enough, add a file to <emphasis>/etc/"
+"sysctl.d/</emphasis> as per the following example:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "<title>Maximum number of open files per process</title>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"We need to increase the maximum number of open files per process for the "
+"PostgreSQL server processes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To see what the current PostgreSQL service processes are using for maximum "
+"number of open files, do as per the following example (make sure to have "
+"PostgreSQL running):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the example above, we inspected the open files limit for Process 31718. "
+"It doesn't matter which PostgreSQL process, any of them will do. The "
+"response we are interested in is <emphasis>Max open files</emphasis>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"We want to increase <emphasis>Soft Limit</emphasis> and <emphasis>Hard "
+"Limit</emphasis> of <emphasis>Max open files</emphasis> to be greater than "
+"the value we specified for the PostgreSQL setting "
+"<varname>max_files_per_process</varname>. In our example, we set "
+"<varname>max_files_per_process</varname> to 65536."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In Ubuntu (and assuming you are using PostgreSQL's packages for Ubuntu), the "
+"easiest way to change the <emphasis>Soft Limit</emphasis> and <emphasis>Hard "
+"Limit</emphasis> is to edit <emphasis role=\"strong\">/etc/init.d/"
+"postgresql</emphasis> (SysV) or <emphasis role=\"strong\">/lib/systemd/"
+"system/postgresql*.service</emphasis> (systemd)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Let's first address the SysV Ubuntu case where we add <emphasis "
+"role=\"strong\">ulimit -H -n 262144</emphasis> and <emphasis "
+"role=\"strong\">ulimit -n 131072</emphasis> to <emphasis role=\"strong\">/"
+"etc/init.d/postgresql</emphasis>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Now to address the systemd Ubuntu case. We will add <emphasis "
+"role=\"strong\">LimitNOFILE=131072</emphasis> to every <emphasis "
+"role=\"strong\">/lib/systemd/system/postgresql*.service</emphasis> file in "
+"the <emphasis role=\"strong\">[Service]</emphasis> section."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After making the necessary systemd changes, make sure to reload the daemon"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Relationships"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "These functions determine spatial relationships between geometries."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Topological Relationships"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries spatially intersect in 3D - only for points, "
+"linestrings, polygons, polyhedral surface (area)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Overlaps, Touches, Within all imply spatial intersection. If any of the "
+"aforementioned returns true, then the geometries also spatially intersect. "
+"Disjoint implies false for spatial intersection."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&index_aware;"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Because of floating robustness failures, geometries don't always intersect "
+"as you'd expect them to after geometric processing. For example the closest "
+"point on a linestring to a geometry may not lie on the linestring. For these "
+"kind of issues where a distance of a centimeter you want to just consider as "
+"intersecting, use <xref linkend=\"ST_3DDWithin\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.0.0 SFCGAL backend removed, GEOS backend supports TINs."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "TIN Examples"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Intersects\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if every point of B lies in A, and their interiors have a point in "
+"common"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns TRUE if geometry A contains geometry B. A contains B if and only if "
+"all points of B lie inside (i.e. in the interior or boundary of) A (or "
+"equivalently, no points of B lie in the exterior of A), and the interiors of "
+"A and B have at least one point in common."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Contains(A, B) ⇔ (A ⋂ B = B) ∧ (Int(A) ⋂ "
+"Int(B) ≠ ∅) </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The contains relationship is reflexive: every geometry contains itself. (In "
+"contrast, in the <xref linkend=\"ST_ContainsProperly\"/> predicate a "
+"geometry does <emphasis>not</emphasis> properly contain itself.) The "
+"relationship is antisymmetric: if <code>ST_Contains(A,B) = true</code> and "
+"<code>ST_Contains(B,A) = true</code>, then the two geometries must be "
+"topologically equal (<code>ST_Equals(A,B) = true</code>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Contains is the converse of <xref linkend=\"ST_Within\"/>. So, "
+"<code>ST_Contains(A,B) = ST_Within(B,A)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Because the interiors must have a common point, a subtlety of the definition "
+"is that polygons and lines do <emphasis>not</emphasis> contain lines and "
+"points lying fully in their boundary. For further details see <link xlink:"
+"href=\"http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-"
+"covers-spatial.html\">Subtleties of OGC Covers, Contains, Within</link>. The "
+"<xref linkend=\"ST_Covers\"/> predicate provides a more inclusive "
+"relationship."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid index use, use the function <function>_ST_Contains</"
+"function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.3.0 Enhancement to PIP short-circuit extended to support "
+"MultiPoints with few points. Prior versions only supported point in polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.0.0 enabled support for <varname>GEOMETRYCOLLECTION</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Do not use this function with invalid geometries. You will get unexpected "
+"results."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: this is the \"allowable\" version that returns a boolean, not an "
+"integer."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sfs_compliant; s2.1.1.2 // s2.1.13.3 - same as within(geometry B, geometry "
+"A)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.31"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<function>ST_Contains</function> returns <varname>TRUE</varname> in the "
+"following situations:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>LINESTRING</varname> / <varname>MULTIPOINT</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>POLYGON</varname> / <varname>POINT</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>POLYGON</varname> / <varname>LINESTRING</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>POLYGON</varname> / <varname>POLYGON</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<function>ST_Contains</function> returns <varname>FALSE</varname> in the "
+"following situations:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>POLYGON</varname> / <varname>MULTIPOINT</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Due to the interior intersection condition <function>ST_Contains</function> "
+"returns <varname>FALSE</varname> in the following situations (whereas "
+"<function>ST_Covers</function> returns <varname>TRUE</varname>):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>LINESTRING</varname> / <varname>POINT</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ContainsProperly\"/>, <xref linkend=\"ST_Covers\"/>, "
+"<xref linkend=\"ST_CoveredBy\"/>, <xref linkend=\"ST_Equals\"/>, <xref "
+"linkend=\"ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if every point of B lies in the interior of A"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>true</varname> if every point of B lies in the interior of "
+"A (or equivalently, no point of B lies in the the boundary or exterior of A)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_ContainsProperly(A, B) ⇔ Int(A) ⋂ B = B "
+"</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A contains B properly if the DE-9IM Intersection Matrix for the two "
+"geometries matches [T**FF*FF*]"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A does not properly contain itself, but does contain itself."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A use for this predicate is computing the intersections of a set of "
+"geometries with a large polygonal geometry. Since intersection is a fairly "
+"slow operation, it can be more efficient to use containsProperly to filter "
+"out test geometries which lie fully inside the area. In these cases the "
+"intersection is known a priori to be exactly the original test geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid index use, use the function "
+"<function>_ST_ContainsProperly</function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The advantage of this predicate over <xref linkend=\"ST_Contains\"/> and "
+"<xref linkend=\"ST_Intersects\"/> is that it can be computed more "
+"efficiently, with no need to compute topology at individual points."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Boundary\"/>, <xref linkend=\"ST_Contains\"/>, <xref "
+"linkend=\"ST_Covers\"/>, <xref linkend=\"ST_CoveredBy\"/>, <xref "
+"linkend=\"ST_Equals\"/>, <xref linkend=\"ST_Relate\"/>, <xref "
+"linkend=\"ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if every point of A lies in B"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>true</varname> if every point in Geometry/Geography A lies "
+"inside (i.e. intersects the interior or boundary of) Geometry/Geography B. "
+"Equivalently, tests that no point of A lies outside (in the exterior of) B."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_CoveredBy(A, B) ⇔ A ⋂ B = A </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_CoveredBy is the converse of <xref linkend=\"ST_Covers\"/>. So, "
+"<code>ST_CoveredBy(A,B) = ST_Covers(B,A)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generally this function should be used instead of <xref "
+"linkend=\"ST_Within\"/>, since it has a simpler definition which does not "
+"have the quirk that \"boundaries are not within their geometry\"."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid index use, use the function <function>_ST_CoveredBy</"
+"function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Not an OGC standard, but Oracle has it too."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Covers\"/>, <xref linkend=\"ST_ExteriorRing\"/>, <xref "
+"linkend=\"ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if every point of B lies in A"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>true</varname> if every point in Geometry/Geography B lies "
+"inside (i.e. intersects the interior or boundary of) Geometry/Geography A. "
+"Equivalently, tests that no point of B lies outside (in the exterior of) A."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Covers(A, B) ⇔ A ⋂ B = B </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Covers is the converse of <xref linkend=\"ST_CoveredBy\"/>. So, "
+"<code>ST_Covers(A,B) = ST_CoveredBy(B,A)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generally this function should be used instead of <xref "
+"linkend=\"ST_Contains\"/>, since it has a simpler definition which does not "
+"have the quirk that \"geometries do not contain their boundary\"."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid index use, use the function <function>_ST_Covers</"
+"function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.4.0 Support for polygon in polygon and line in polygon added for "
+"geography type"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.3.0 Enhancement to PIP short-circuit for geometry extended to "
+"support MultiPoints with few points. Prior versions only supported point in "
+"polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Geometry example"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Geeography Example"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_CoveredBy\"/>, <xref linkend=\"ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries have some, but not all, interior points in common"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Compares two geometry objects and returns <varname>true</varname> if their "
+"intersection \"spatially crosses\"; that is, the geometries have some, but "
+"not all interior points in common. The intersection of the interiors of the "
+"geometries must be non-empty and must have dimension less than the maximum "
+"dimension of the two input geometries, and the intersection of the two "
+"geometries must not equal either geometry. Otherwise, it returns "
+"<varname>false</varname>. The crosses relation is symmetric and irreflexive."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Crosses(A, B) ⇔ (dim( Int(A) ⋂ Int(B) ) "
+"< max( dim( Int(A) ), dim( Int(B) ) )) ∧ (A ⋂ B ≠ A) ∧ (A ⋂ B ≠ B) </"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Geometries cross if their DE-9IM Intersection Matrix matches:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>T*T******</code> for Point/Line, Point/Area, and Line/Area situations"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>T*****T**</code> for Line/Point, Area/Point, and Area/Line situations"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<code>0********</code> for Line/Line situations"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the result is <varname>false</varname> for Point/Point and Area/Area "
+"situations"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The OpenGIS Simple Features Specification defines this predicate only for "
+"Point/Line, Point/Area, Line/Line, and Line/Area situations. JTS / GEOS "
+"extends the definition to apply to Line/Point, Area/Point and Area/Line "
+"situations as well. This makes the relation symmetric."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.13.3"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.29"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The following situations all return <varname>true</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>MULTIPOINT</varname> / <varname>LINESTRING</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>MULTIPOINT</varname> / <varname>POLYGON</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>LINESTRING</varname> / <varname>POLYGON</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>LINESTRING</varname> / <varname>LINESTRING</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Consider a situation where a user has two tables: a table of roads and a "
+"table of highways."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To determine a list of roads that cross a highway, use a query similar to:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Overlaps\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if two geometries have no points in common"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>true</varname> if two geometries are disjoint. Geometries "
+"are disjoint if they have no point in common."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If any other spatial relationship is true for a pair of geometries, they are "
+"not disjoint. Disjoint implies that <xref linkend=\"ST_Intersects\"/> is "
+"false."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Disjoint(A, B) ⇔ A ⋂ B = ∅ </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function call does not use indexes. A negated <xref "
+"linkend=\"ST_Intersects\"/> predicate can be used as a more performant "
+"alternative that uses indexes: <code>ST_Disjoint(A,B) = NOT ST_Intersects(A,"
+"B)</code>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.1.2 //s2.1.13.3 - a.Relate(b, 'FF*FF****')"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.26"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if two geometries include the same set of points"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>true</varname> if the given geometries are \"topologically "
+"equal\". Use this for a 'better' answer than '='. Topological equality means "
+"that the geometries have the same dimension, and their point-sets occupy the "
+"same space. This means that the order of vertices may be different in "
+"topologically equal geometries. To verify the order of points is consistent "
+"use <xref linkend=\"ST_OrderingEquals\"/> (it must be noted "
+"ST_OrderingEquals is a little more stringent than simply verifying order of "
+"points are the same)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "In mathematical terms: <emphasis>ST_Equals(A, B) ⇔ A = B </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The following relation holds: <emphasis>ST_Equals(A, B) ⇔ ST_Within(A,B) ∧ "
+"ST_Within(B,A) </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.1.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.24"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 2.2.0 Returns true even for invalid geometries if they are binary "
+"equal"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_OrderingEquals\"/>, <xref linkend=\"ST_Reverse\"/>, "
+"<xref linkend=\"ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries intersect (they have at least one point in common)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>true</varname> if two geometries intersect. Geometries "
+"intersect if they have any point in common."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography, a distance tolerance of 0.00001 meters is used (so points "
+"that are very close are considered to intersect)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅ </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometries intersect if their DE-9IM Intersection Matrix matches one of:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial intersection is implied by all the other spatial relationship tests, "
+"except <xref linkend=\"ST_Disjoint\"/>, which tests that geometries do NOT "
+"intersect."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.0.0 SFCGAL version removed and native support for 2D TINS added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.5.0 Supports GEOMETRYCOLLECTION."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Performed by the GEOS module (for geometry), geography is native"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5 support for geography was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography, this function has a distance tolerance of about 0.00001 "
+"meters and uses the sphere rather than spheroid calculation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&sfs_compliant; s2.1.1.2 //s2.1.13.3 - ST_Intersects(g1, g2 ) --> Not "
+"(ST_Disjoint(g1, g2 ))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.27"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DIntersects\"/>, <xref linkend=\"ST_Disjoint\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a number indicating the crossing behavior of two LineStrings"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Given two linestrings returns an integer between -3 and 3 indicating what "
+"kind of crossing behavior exists between them. 0 indicates no crossing. This "
+"is only supported for <varname>LINESTRING</varname>s."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The crossing number has the following meaning:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "0: LINE NO CROSS"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "-1: LINE CROSS LEFT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "1: LINE CROSS RIGHT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "-2: LINE MULTICROSS END LEFT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "2: LINE MULTICROSS END RIGHT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "-3: LINE MULTICROSS END SAME FIRST LEFT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "3: LINE MULTICROSS END SAME FIRST RIGHT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.4"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> LINE CROSS LEFT and LINE CROSS "
+"RIGHT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Blue: Line A; Green: Line B"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> LINE MULTICROSS END SAME FIRST "
+"LEFT and LINE MULTICROSS END SAME FIRST RIGHT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> LINE MULTICROSS END LEFT and "
+"LINE MULTICROSS END RIGHT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Example:</emphasis> Finds all streets that cross"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries represent the same geometry and have points in the "
+"same directional order"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_OrderingEquals compares two geometries and returns t (TRUE) if the "
+"geometries are equal and the coordinates are in the same order; otherwise it "
+"returns f (FALSE)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function is implemented as per the ArcSDE SQL specification rather than "
+"SQL-MM. http://edndoc.esri.com/arcsde/9.1/sql_api/sqlapi3."
+"htm#ST_OrderingEquals"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.43"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Equals\"/>, <xref linkend=\"ST_Reverse\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries have the same dimension and intersect, but each has "
+"at least one point not in the other"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns TRUE if geometry A and B \"spatially overlap\". Two geometries "
+"overlap if they have the same dimension, their interiors intersect in that "
+"dimension. and each has at least one point inside the other (or "
+"equivalently, neither one covers the other). The overlaps relation is "
+"symmetric and irreflexive."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Overlaps(A, B) ⇔ ( dim(A) = dim(B) = "
+"dim( Int(A) ⋂ Int(B) )) ∧ (A ⋂ B ≠ A) ∧ (A ⋂ B ≠ B) </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid index use, use the function <function>_ST_Overlaps</"
+"function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.1.2 // s2.1.13.3"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.32"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<function>ST_Overlaps</function> returns <varname>TRUE</varname> in the "
+"following situations:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>MULTIPOINT</varname> / <varname>MULTIPOINT</varname>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A Point on a LineString is contained, but since it has lower dimension it "
+"does not overlap or cross."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A LineString that partly covers a Polygon intersects and crosses, but does "
+"not overlap since it has different dimension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Two Polygons that intersect but with neither contained by the other overlap, "
+"but do not cross because their intersection has the same dimension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Crosses\"/>, <xref linkend=\"ST_Dimension\"/>, <xref "
+"linkend=\"ST_Intersects\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries have a topological relationship matching an "
+"Intersection Matrix pattern, or computes their Intersection Matrix"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions allow testing and evaluating the spatial (topological) "
+"relationship between two geometries, as defined by the <link xlink:"
+"href=\"http://en.wikipedia.org/wiki/DE-9IM\">Dimensionally Extended 9-"
+"Intersection Model</link> (DE-9IM)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The DE-9IM is specified as a 9-element matrix indicating the dimension of "
+"the intersections between the Interior, Boundary and Exterior of two "
+"geometries. It is represented by a 9-character text string using the symbols "
+"'F', '0', '1', '2' (e.g. <code>'FF1FF0102'</code>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A specific kind of spatial relationship can be tested by matching the "
+"intersection matrix to an <emphasis>intersection matrix pattern</emphasis>. "
+"Patterns can include the additional symbols 'T' (meaning \"intersection is "
+"non-empty\") and '*' (meaning \"any value\"). Common spatial relationships "
+"are provided by the named functions <xref linkend=\"ST_Contains\"/>, <xref "
+"linkend=\"ST_ContainsProperly\"/>, <xref linkend=\"ST_Covers\"/>, <xref "
+"linkend=\"ST_CoveredBy\"/>, <xref linkend=\"ST_Crosses\"/>, <xref "
+"linkend=\"ST_Disjoint\"/>, <xref linkend=\"ST_Equals\"/>, <xref "
+"linkend=\"ST_Intersects\"/>, <xref linkend=\"ST_Overlaps\"/>, <xref "
+"linkend=\"ST_Touches\"/>, and <xref linkend=\"ST_Within\"/>. Using an "
+"explicit pattern allows testing multiple conditions of intersects, crosses, "
+"etc in one step. It also allows testing spatial relationships which do not "
+"have a named spatial relationship function. For example, the relationship "
+"\"Interior-Intersects\" has the DE-9IM pattern <code>T********</code>, which "
+"is not evaluated by any named predicate."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "For more information refer to <xref linkend=\"eval_spatial_rel\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 1:</emphasis> Tests if two geometries are "
+"spatially related according to the given <varname>intersectionMatrixPattern</"
+"varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unlike most of the named spatial relationship predicates, this does NOT "
+"automatically include an index call. The reason is that some relationships "
+"are true for geometries which do NOT intersect (e.g. Disjoint). If you are "
+"using a relationship pattern that requires intersection, then include the "
+"&& index call."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It is better to use a named relationship function if available, since they "
+"automatically use a spatial index where one exists. Also, they may implement "
+"performance optimizations which are not available with full relate "
+"evaluation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 2:</emphasis> Returns the DE-9IM matrix "
+"string for the spatial relationship between the two input geometries. The "
+"matrix string can be tested for matching a DE-9IM pattern using <xref "
+"linkend=\"ST_RelateMatch\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Variant 3:</emphasis> Like variant 2, but allows "
+"specifying a <emphasis role=\"bold\">Boundary Node Rule</emphasis>. A "
+"boundary node rule allows finer control over whether the endpoints of "
+"MultiLineStrings are considered to lie in the DE-9IM Interior or Boundary. "
+"The <varname>boundaryNodeRule</varname> values are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>1</code>: <emphasis role=\"bold\">OGC-Mod2</emphasis> - line endpoints "
+"are in the Boundary if they occur an odd number of times. This is the rule "
+"defined by the OGC SFS standard, and is the default for <function>ST_Relate</"
+"function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>2</code>: <emphasis role=\"bold\">Endpoint</emphasis> - all endpoints "
+"are in the Boundary."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>3</code>: <emphasis role=\"bold\">MultivalentEndpoint</emphasis> - "
+"endpoints are in the Boundary if they occur more than once. In other words, "
+"the boundary is all the \"attached\" or \"inner\" endpoints (but not the "
+"\"unattached/outer\" ones)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>4</code>: <emphasis role=\"bold\">MonovalentEndpoint</emphasis> - "
+"endpoints are in the Boundary if they occur only once. In other words, the "
+"boundary is all the \"unattached\" or \"outer\" endpoints."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function is not in the OGC spec, but is implied. see s2.1.13.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.0 - added support for specifying boundary node rule."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Using the boolean-valued function to test spatial relationships."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Testing a custom spatial relationship pattern as a query condition, with "
+"<code>&&</code> to enable using a spatial index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computing the intersection matrix for spatial relationships."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using different Boundary Node Rules to compute the spatial relationship "
+"between a LineString and a MultiLineString with a duplicate endpoint "
+"<code>(3 3)</code>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using the <emphasis role=\"bold\">OGC-Mod2</emphasis> rule (1) the duplicate "
+"endpoint is in the <emphasis role=\"bold\">interior</emphasis> of the "
+"MultiLineString, so the DE-9IM matrix entry [aB:bI] is <code>0</code> and "
+"[aB:bB] is <code>F</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using the <emphasis role=\"bold\">Endpoint</emphasis> rule (2) the duplicate "
+"endpoint is in the <emphasis role=\"bold\">boundary</emphasis> of the "
+"MultiLineString, so the DE-9IM matrix entry [aB:bI] is <code>F</code> and "
+"[aB:bB] is <code>0</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_RelateMatch\"/>, <xref linkend=\"ST_Contains\"/>, <xref "
+"linkend=\"ST_ContainsProperly\"/>, <xref linkend=\"ST_Covers\"/>, <xref "
+"linkend=\"ST_CoveredBy\"/>, <xref linkend=\"ST_Crosses\"/>, <xref "
+"linkend=\"ST_Disjoint\"/>, <xref linkend=\"ST_Equals\"/>, <xref "
+"linkend=\"ST_Intersects\"/>, <xref linkend=\"ST_Overlaps\"/>, <xref "
+"linkend=\"ST_Touches\"/>, <xref linkend=\"ST_Within\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if a DE-9IM Intersection Matrix matches an Intersection Matrix pattern"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tests if a <link xlink:href=\"http://en.wikipedia.org/wiki/"
+"DE-9IM\">Dimensionally Extended 9-Intersection Model</link> (DE-9IM) "
+"<varname>intersectionMatrix</varname> value satisfies an "
+"<varname>intersectionMatrixPattern</varname>. Intersection matrix values can "
+"be computed by <xref linkend=\"ST_Relate\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Patterns for common spatial relationships matched against intersection "
+"matrix values, for a line in various positions relative to a polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Relate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if two geometries have at least one point in common, but their "
+"interiors do not intersect"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns <varname>TRUE</varname> if A and B intersect, but their interiors do "
+"not intersect. Equivalently, A and B have at least one point in common, and "
+"the common points lie in at least one boundary. For Point/Point inputs the "
+"relationship is always <varname>FALSE</varname>, since points do not have a "
+"boundary."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Touches(A, B) ⇔ (Int(A) ⋂ Int(B) = ∅) ∧ "
+"(A ⋂ B ≠ ∅) </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This relationship holds if the DE-9IM Intersection Matrix for the two "
+"geometries matches one of:"
+msgstr ""
+
+#. Tag: markup
+#, no-c-format
+msgid "FT*******"
+msgstr ""
+
+#. Tag: markup
+#, no-c-format
+msgid "F**T*****"
+msgstr ""
+
+#. Tag: markup
+#, no-c-format
+msgid "F***T****"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid using an index, use <function>_ST_Touches</function> "
+"instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.28"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <function>ST_Touches</function> predicate returns <varname>TRUE</"
+"varname> in the following examples."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if every point of A lies in B, and their interiors have a point in "
+"common"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns TRUE if geometry A is within geometry B. A is within B if and only "
+"if all points of A lie inside (i.e. in the interior or boundary of) B (or "
+"equivalently, no points of A lie in the exterior of B), and the interiors of "
+"A and B have at least one point in common."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For this function to make sense, the source geometries must both be of the "
+"same coordinate projection, having the same SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In mathematical terms: <emphasis>ST_Within(A, B) ⇔ (A ⋂ B = A) ∧ (Int(A) ⋂ "
+"Int(B) ≠ ∅) </emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The within relation is reflexive: every geometry is within itself. The "
+"relation is antisymmetric: if <code>ST_Within(A,B) = true</code> and "
+"<code>ST_Within(B,A) = true</code>, then the two geometries must be "
+"topologically equal (<code>ST_Equals(A,B) = true</code>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Within is the converse of <xref linkend=\"ST_Contains\"/>. So, "
+"<code>ST_Within(A,B) = ST_Contains(B,A)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Because the interiors must have a common point, a subtlety of the definition "
+"is that lines and points lying fully in the boundary of polygons or lines "
+"are <emphasis>not</emphasis> within the geometry. For further details see "
+"<link xlink:href=\"http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-"
+"of-ogc-covers-spatial.html\">Subtleties of OGC Covers, Contains, Within</"
+"link>. The <xref linkend=\"ST_CoveredBy\"/> predicate provides a more "
+"inclusive relationship."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"&index_aware; To avoid index use, use the function <function>_ST_Within</"
+"function>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfs_compliant; s2.1.1.2 // s2.1.13.3 - a.Relate(b, 'T*F**F***')"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.30"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_CoveredBy\"/>, <xref linkend=\"ST_Equals\"/>, <xref "
+"linkend=\"ST_IsValid\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Distance Relationships"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if two 3D geometries are within a given 3D distance"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if the 3D distance between two geometry values is no larger "
+"than distance <varname>distance_of_srid</varname>. The distance is specified "
+"in units defined by the spatial reference system of the geometries. For this "
+"function to make sense the source geometries must be in the same coordinate "
+"system (have the same SRID)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM ?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_DFullyWithin\"/>, <xref "
+"linkend=\"ST_3DDistance\"/>, <xref linkend=\"ST_Distance\"/>, <xref "
+"linkend=\"ST_3DMaxDistance\"/>, <xref linkend=\"ST_Transform\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if two 3D geometries are entirely within a given 3D distance"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if the 3D geometries are fully within the specified distance of "
+"one another. The distance is specified in units defined by the spatial "
+"reference system of the geometries. For this function to make sense, the "
+"source geometries must both be of the same coordinate projection, having the "
+"same SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_DFullyWithin\"/>, <xref "
+"linkend=\"ST_3DMaxDistance\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if a geometry is entirely inside a distance of another"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if <code>g2</code> is entirely within <code>distance</code> of "
+"<code>g1</code>. Visually, the condition is true if <code>g2</code> is "
+"contained within a <code>distance</code> buffer of <code>g1</code>. The "
+"distance is specified in units defined by the spatial reference system of "
+"the geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.5.0 : the logic behind the function now uses a test of "
+"containment within a buffer, rather than the ST_MaxDistance algorithm. "
+"Results will differ from prior versions, but should be closer to user "
+"expectations."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DWithin\"/>, <xref linkend=\"ST_3DDWithin\"/>, <xref "
+"linkend=\"ST_3DDFullyWithin\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if two geometries are within a given distance"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns true if the geometries are within a given distance"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For <type>geometry</type>: The distance is specified in units defined by the "
+"spatial reference system of the geometries. For this function to make sense, "
+"the source geometries must be in the same coordinate system (have the same "
+"SRID)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For <type>geography</type>: units are in meters and distance measurement "
+"defaults to <varname>use_spheroid = true</varname>. For faster evaluation "
+"use <varname>use_spheroid = false</varname> to measure on the sphere."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Use <xref linkend=\"ST_3DDWithin\"/> for 3D geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function call includes a bounding box comparison that makes use of any "
+"indexes that are available on the geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.5.0 support for geography was introduced"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0 support for curved geometries was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Prior to 1.3, <xref linkend=\"ST_Expand\"/> was commonly used in conjunction "
+"with && and ST_Distance to test for distance, and in pre-1.3.4 this "
+"function used that logic. From 1.3.4, ST_DWithin uses a faster short-circuit "
+"distance function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DDWithin\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if a point geometry is inside a circle defined by a center and radius"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns true if the geometry is a point and is inside the circle with center "
+"<varname>center_x</varname>,<varname>center_y</varname> and radius "
+"<varname>radius</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Does not use spatial indexes. Use <xref linkend=\"ST_DWithin\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 2.2.0 In prior versions this was called ST_Point_Inside_Circle"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SFCGAL Functions Reference"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SFCGAL is a C++ wrapper library around CGAL that provides advanced 2D and 3D "
+"spatial functions. For robustness, geometry coordinates have an exact "
+"rational number representation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Installation instructions for the library can be found on the SFCGAL home "
+"page (<link xlink:href=\"http://www.sfcgal.org\">http://www.sfcgal.org</"
+"link>). To enable the functions use <code>create extension postgis_sfcgal</"
+"code>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SFCGAL Management Functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists functions for determining version of SFCGAL and library "
+"dependencies you are running."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "<refpurpose>Returns the version of SFCGAL in use</refpurpose>"
+msgstr ""
+
+#. Tag: funcdef
+#, no-c-format
+msgid "text <function>postgis_sfcgal_version</function>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns the version of SFCGAL in use</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sfcgal_required;"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the full version of SFCGAL in use including CGAL and "
+"Boost versions</refpurpose>"
+msgstr ""
+
+#. Tag: funcdef
+#, no-c-format
+msgid "text <function>postgis_sfcgal_full_version</function>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the full version of SFCGAL in use including CGAL and Boost "
+"versions</para>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SFCGAL Accessors and Setters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions access or set properties of geometries. Geometries primarily "
+"supported by these functions are TINS and Polyhedral Surfaces."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Force LHR orientation"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Check if a surface is or not planar"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Test if the geometry is a solid. No validity check is performed."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Cast the geometry into a solid. No check is performed. To obtain a valid "
+"solid, the input geometry must be a closed Polyhedral Surface or a closed "
+"TIN."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Determine surface orientation"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function only applies to polygons. It returns -1 if the polygon is "
+"counterclockwise oriented and 1 if the polygon is clockwise oriented."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Calculates the area of a geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Calculates the area of a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Performed by the SFCGAL module"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: this function returns a double precision value representing the area."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Area\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes area of 3D surface geometries. Will return 0 for solids."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 8.1, 10.5"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note: By default a PolyhedralSurface built from WKT is a surface geometry, "
+"not solid. It therefore has surface area. Once converted to a solid, no area."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CG_MakeSolid\"/>, <xref linkend=\"CG_IsSolid\"/>, <xref "
+"linkend=\"CG_Area\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes the volume of a 3D solid. If applied to surface (even closed) "
+"geometries will return 0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 9.1 (same as CG_3DVolume)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When closed surfaces are created with WKT, they are treated as areal rather "
+"than solid. To make them solid, you need to use <xref "
+"linkend=\"CG_MakeSolid\"/>. Areal geometries have no volume. Here is an "
+"example to demonstrate."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_MakeSolid\"/>, <xref linkend=\"CG_IsSolid\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_ForceLHR\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_IsPlanar\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Availability: 2.2.0: This was documented in 2.1.0 but got accidentally left "
+"out in 2.1 release."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_IsSolid\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_MakeSolid\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_Orientation\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_3DArea\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_MakeSolid\"/>, <xref linkend=\"ST_IsSolid\"/>, <xref "
+"linkend=\"ST_Area\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_Volume\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM IEC 13249-3: 9.1 (same as ST_3DVolume)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When closed surfaces are created with WKT, they are treated as areal rather "
+"than solid. To make them solid, you need to use <xref "
+"linkend=\"ST_MakeSolid\"/>. Areal geometries have no volume. Here is an "
+"example to demonstrate."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_MakeSolid\"/>, <xref linkend=\"ST_IsSolid\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SFCGAL Processing and Relationship Functions"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the intersection of two geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes the intersection of two geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "NOTE: this function returns a geometry representing the intersection."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_3DIntersects\"/>, <xref linkend=\"ST_Intersects\"/>, "
+"<xref linkend=\"ST_Disjoint\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if two 3D geometries intersect"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tests if two 3D geometries intersect. 3D geometries intersect if they have "
+"any point in common in the three-dimensional space."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the geometric difference between two geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the geometric difference between two geometries. The resulting "
+"geometry is a set of points that are present in geomA but not in geomB."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "NOTE: this function returns a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Difference\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Perform 3D difference"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_3DDifference\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns that part of geom1 that is not part of geom2."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"3D images were generated using PostGIS <xref linkend=\"ST_AsX3D\"/> and "
+"rendering in HTML using <link xlink:href=\"http://www.x3dom.org\">X3Dom HTML "
+"Javascript rendering library</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Original 3D geometries overlaid. geom2 is the part that will be removed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What's left after removing geom2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsX3D\"/>, <xref linkend=\"CG_3DIntersection\"/> <xref "
+"linkend=\"CG_3DUnion\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the minimum distance between two geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes the minimum distance between two geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: this function returns a double precision value representing the "
+"distance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_Distance\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the minimum 3D distance between two geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes the minimum 3D distance between two geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: this function returns a double precision value representing the 3D "
+"distance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DDistance\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the 3D convex hull of a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_3DConvexHull\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original geometry overlaid with 3D convex hull"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsX3D\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Perform 3D intersection"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_3DIntersection\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Return a geometry that is the shared portion between geom1 and geom2."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original 3D geometries overlaid. geom2 is shown semi-transparent"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Intersection of geom1 and geom2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "3D linestrings and polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Cube (closed Polyhedral Surface) and Polygon Z"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Intersection of 2 solids that result in volumetric intersection is also a "
+"solid (ST_Dimension returns 3)"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the union of two geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes the union of two geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "NOTE: this function returns a geometry representing the union."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Perform 3D union."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_3DUnion\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.3.0 aggregate variant was added"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Aggregate variant:</emphasis> returns a geometry "
+"that is the 3D union of a rowset of geometries. The ST_3DUnion() function is "
+"an \"aggregate\" function in the terminology of PostgreSQL. That means that "
+"it operates on rows of data, in the same way the SUM() and AVG() functions "
+"do and like most aggregates, it also ignores NULL geometries."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Perform 3D union using postgis_sfcgal."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">Aggregate variant:</emphasis> returns a geometry "
+"that is the 3D union of a rowset of geometries. The CG_3DUnion() function is "
+"an \"aggregate\" function in the terminology of PostgreSQL. That means that "
+"it operates on rows of data, in the same way the SUM() and AVG() functions "
+"do and like most aggregates, it also ignores NULL geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original 3D geometries overlaid. geom2 is the one with transparency."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Union of geom1 and geom2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_AsX3D\"/>, <xref linkend=\"CG_3DIntersection\"/> <xref "
+"linkend=\"CG_3DDifference\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes an Alpha-shape enclosing a geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_AlphaShape\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Alpha_shape\">Alpha-Shape</link> of the points in a geometry. An alpha-shape "
+"is a (usually) concave polygonal geometry which contains all the vertices of "
+"the input, and whose vertices are a subset of the input vertices. An alpha-"
+"shape provides a closer fit to the shape of the input than the shape "
+"produced by the <link linkend=\"ST_ConvexHull\">convex hull</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The \"closeness of fit\" is controlled by the <varname>alpha</varname> "
+"parameter, which can have values from 0 to infinity. Smaller alpha values "
+"produce more concave results. Alpha values greater than some data-dependent "
+"value produce the convex hull of the input."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Following the CGAL implementation, the alpha value is the <emphasis>square</"
+"emphasis> of the radius of the disc used in the Alpha-Shape algorithm to "
+"\"erode\" the Delaunay Triangulation of the input points. See <link xlink:"
+"href=\"https://doc.cgal.org/latest/Alpha_shapes_2/index."
+"html#Chapter_2D_Alpha_Shapes\">CGAL Alpha-Shapes</link> for more "
+"information. This is different from the original definition of alpha-shapes, "
+"which defines alpha as the radius of the eroding disc."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The computed shape does not contain holes unless the optional "
+"<varname>allow_holes</varname> argument is specified as true."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function effectively computes a concave hull of a geometry in a similar "
+"way to <xref linkend=\"ST_ConcaveHull\"/>, but uses CGAL and a different "
+"algorithm."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.5.0 - requires SFCGAL >= 1.4.1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alpha-shape of a MultiPoint (same example As <xref "
+"linkend=\"CG_OptimalAlphaShape\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alpha-shape of a MultiPoint, allowing holes (same example as <xref "
+"linkend=\"CG_OptimalAlphaShape\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alpha-shape of a MultiPoint, allowing holes (same example as <xref "
+"linkend=\"ST_ConcaveHull\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_OptimalAlphaShape\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes approximal convex partition of the polygon geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes approximal convex partition of the polygon geometry (using a "
+"triangulation)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A partition of a polygon P is a set of polygons such that the interiors of "
+"the polygons do not intersect and the union of the polygons is equal to the "
+"interior of the original polygon P. CG_ApproxConvexPartition and "
+"CG_GreeneApproxConvexPartition functions produce approximately optimal "
+"convex partitions. Both these functions produce convex decompositions by "
+"first decomposing the polygon into simpler polygons; "
+"CG_ApproxConvexPartition uses a triangulation and "
+"CG_GreeneApproxConvexPartition a monotone partition. These two functions "
+"both guarantee that they will produce no more than four times the optimal "
+"number of convex pieces but they differ in their runtime complexities. "
+"Though the triangulation-based approximation algorithm often results in "
+"fewer convex pieces, this is not always the case."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.5.0 - requires SFCGAL >= 1.5.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires SFCGAL >= 1.5.0"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Approximal Convex Partition (same example As <xref "
+"linkend=\"CG_YMonotonePartition\"/>, <xref "
+"linkend=\"CG_GreeneApproxConvexPartition\"/> and <xref "
+"linkend=\"CG_OptimalConvexPartition\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CG_GreeneApproxConvexPartition\"/>, <xref "
+"linkend=\"CG_OptimalConvexPartition\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Compute the approximate medial axis of an areal geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_ApproximateMedialAxis\"/> "
+"instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return an approximate medial axis for the areal input based on its straight "
+"skeleton. Uses an SFCGAL specific API when built against a capable version "
+"(1.2.0+). Otherwise the function is just a wrapper around "
+"CG_StraightSkeleton (slower case)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A polygon and its approximate medial axis"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_StraightSkeletonPartition\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a constrained Delaunay triangulation around the given input geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref "
+"linkend=\"CG_ConstrainedDelaunayTriangles\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Constrained_Delaunay_triangulation\">Constrained Delaunay triangulation</"
+"link> around the vertices of the input geometry. Output is a TIN."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "CG_ConstrainedDelaunayTriangles of 2 polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "of 2 polygons. Triangle edges cross polygon boundaries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_TriangulatePolygon\"/>, <xref linkend=\"CG_Tesselate\"/"
+">, <xref linkend=\"ST_ConcaveHull\"/>, <xref linkend=\"ST_Dump\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Extrude a surface to a related volume"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "is deprecated as of 3.5.0. Use <xref linkend=\"CG_Extrude\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original octagon formed from buffering point"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Hexagon extruded 30 units along Z produces a PolyhedralSurfaceZ"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original linestring"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "LineString Extruded along Z produces a PolyhedralSurfaceZ"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_ExtrudeStraightSkeleton\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Straight Skeleton Extrusion"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes an extrusion with a maximal height of the polygon geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Perhaps the first (historically) use-case of straight skeletons: given a "
+"polygonal roof, the straight skeleton directly gives the layout of each "
+"tent. If each skeleton edge is lifted from the plane a height equal to its "
+"offset distance, the resulting roof is \"correct\" in that water will always "
+"fall down to the contour edges (the roof's border), regardless of where it "
+"falls on the roof. The function computes this extrusion aka \"roof\" on a "
+"polygon. If the argument body_height > 0, so the polygon is extruded like "
+"with CG_Extrude(polygon, 0, 0, body_height). The result is an union of these "
+"polyhedralsurfaces."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CG_ExtrudeStraightSkeleton\"/>, <xref "
+"linkend=\"CG_StraightSkeleton\"/>, <xref "
+"linkend=\"CG_StraightSkeletonPartition\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes approximal monotone convex partition of the polygon geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Greene Approximal Convex Partition (same example As <xref "
+"linkend=\"CG_YMonotonePartition\"/>, <xref "
+"linkend=\"CG_ApproxConvexPartition\"/> and <xref "
+"linkend=\"CG_OptimalConvexPartition\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CG_ApproxConvexPartition\"/>, <xref "
+"linkend=\"CG_OptimalConvexPartition\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Performs Minkowski sum"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_MinkowskiSum\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function performs a 2D minkowski sum of a point, line or polygon with a "
+"polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A minkowski sum of two geometries A and B is the set of all points that are "
+"the sum of any point in A and B. Minkowski sums are often used in motion "
+"planning and computer-aided design. More details on <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/Minkowski_addition\">Wikipedia "
+"Minkowski addition</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The first parameter can be any 2D geometry (point, linestring, polygon). If "
+"a 3D geometry is passed, it will be converted to 2D by forcing Z to 0, "
+"leading to possible cases of invalidity. The second parameter must be a 2D "
+"polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Implementation utilizes <link xlink:href=\"http://doc.cgal.org/latest/"
+"Minkowski_sum_2/\">CGAL 2D Minkowskisum</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Minkowski Sum of Linestring and circle polygon where Linestring cuts thru "
+"the circle"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Before Summing"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "After summing"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Minkowski Sum of a polygon and multipoint"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After summing: polygon is duplicated and translated to position of points"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Computes an Alpha-shape enclosing a geometry using an \"optimal\" alpha "
+"value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_OptimalAlphaShape\"/> "
+"instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the \"optimal\" alpha-shape of the points in a geometry. The alpha-"
+"shape is computed using a value of α chosen so that:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the number of polygon elements is equal to or smaller than "
+"<varname>nb_components</varname> (which defaults to 1)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "all input points are contained in the shape"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The result will not contain holes unless the optional <varname>allow_holes</"
+"varname> argument is specified as true."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.3.0 - requires SFCGAL >= 1.4.1."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Optimal alpha-shape of a MultiPoint (same example as <xref "
+"linkend=\"CG_AlphaShape\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Optimal alpha-shape of a MultiPoint, allowing holes (same example as <xref "
+"linkend=\"CG_AlphaShape\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_AlphaShape\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes an optimal convex partition of the polygon geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes an optimal convex partition of the polygon geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A partition of a polygon P is a set of polygons such that the interiors of "
+"the polygons do not intersect and the union of the polygons is equal to the "
+"interior of the original polygon P. CG_OptimalConvexPartition produces a "
+"partition that is optimal in the number of pieces."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Optimal Convex Partition (same example As <xref "
+"linkend=\"CG_YMonotonePartition\"/>, <xref "
+"linkend=\"CG_ApproxConvexPartition\"/> and <xref "
+"linkend=\"CG_GreeneApproxConvexPartition\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CG_ApproxConvexPartition\"/>, <xref "
+"linkend=\"CG_GreeneApproxConvexPartition\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Compute a straight skeleton from a geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires SFCGAL >= 1.3.8 for option use_distance_as_m"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that valid inputs with rings that touch at a single point will raise an "
+"error."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Straight Skeleton of polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_StraightSkeleton\"/> "
+"instead."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Perform surface Tessellation of a polygon or polyhedralsurface and returns "
+"as a TIN or collection of TINS"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"is deprecated as of 3.5.0. Use <xref linkend=\"CG_Tesselate\"/> instead."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Takes as input a surface such a MULTI(POLYGON) or POLYHEDRALSURFACE and "
+"returns a TIN representation via the process of tessellation using triangles."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"does similar to this function except that it returns a geometry collection "
+"of polygons instead of a TIN and also only works with 2D geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Original Cube"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "ST_AsText output:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Tessellated Cube with triangles colored"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Tessellated Polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DelaunayTriangles\"/>, <xref "
+"linkend=\"ST_TriangulatePolygon\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Triangulates a polygonal geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Triangulates a polygonal geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"NOTE: this function returns a geometry representing the triangulated result."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Compute a visibility polygon from a point or a segment in a polygon geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Visibility from the point"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Visibility from the segment"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes y-monotone partition of the polygon geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Computes y-monotone partition of the polygon geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A partition of a polygon P is a set of polygons such that the interiors of "
+"the polygons do not intersect and the union of the polygons is equal to the "
+"interior of the original polygon P. A y-monotone polygon is a polygon whose "
+"vertices v1,…,vn can be divided into two chains v1,…,vk and vk,…,vn,v1, such "
+"that any horizontal line intersects either chain at most once. This "
+"algorithm does not guarantee a bound on the number of polygons produced with "
+"respect to the optimal number."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Y-Monotone Partition (same example As <xref "
+"linkend=\"CG_ApproxConvexPartition\"/>, <xref "
+"linkend=\"CG_GreeneApproxConvexPartition\"/> and <xref "
+"linkend=\"CG_OptimalConvexPartition\"/>)"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes the straight skeleton partition of a polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the straight skeleton partition of the input polygon geometry "
+"<parameter>geom</parameter>. The straight skeleton is a partitioning of the "
+"polygon into faces formed by tracing the collapse of its edges. If "
+"<parameter>auto_orientation</parameter> is set to true, the function will "
+"automatically adjust the orientation of the input polygon to ensure correct "
+"results."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.6.0 - requires SFCGAL >= 2.0.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Straight Skeleton Partition of polygon"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes a 3D buffer around a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generates a 3D buffer around the input geometry <parameter>geom</parameter> "
+"with a specified <parameter>radius</parameter>. The buffer is constructed in "
+"3D space, creating a volumetric representation of the geometry's "
+"surroundings. The <parameter>segments</parameter> parameter defines the "
+"number of segments used to approximate the curved sections of the buffer, "
+"with a minimum value of 4 segments required. The <parameter>buffer_type</"
+"parameter> specifies the type of buffer to create: 0: Rounded buffer "
+"(default) 1: Flat buffer 2: Square buffer"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Input geometry must be a Point or LineString."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.6.0 - requires SFCGAL >= 2.0.0"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The following images were rendered pasting the output of the ST_AsX3D query "
+"into <link xlink:href=\"https://postgis.net/docs/support/viewers/x3d_viewer."
+"htm\">X3D Viewer</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "segments=32 (rounded buffer)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "5 segments rounded"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "32 segments, round"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "32 segments, square"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_3DConvexHull\"/>, <xref linkend=\"ST_AsX3D\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry by a given angle around the origin (0,0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates the input geometry <parameter>geom</parameter> by <parameter>angle</"
+"parameter> radians around the origin point (0,0). The rotation is performed "
+"in 2D space; Z coordinates are not modified. Positive angles rotate the "
+"geometry counter-clockwise."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Rotate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry by a given angle around a specified point in 2D."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates the input geometry <parameter>geom</parameter> by <parameter>angle</"
+"parameter> radians around the point (<parameter>cx</parameter>, "
+"<parameter>cy</parameter>). The rotation is performed in 2D space; Z "
+"coordinates are dropped. Positive angles rotate the geometry counter-"
+"clockwise."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_3DRotate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry in 3D space around an axis vector."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates the input geometry <parameter>geom</parameter> by <parameter>angle</"
+"parameter> radians around an axis defined by the vector (<parameter>ax</"
+"parameter>, <parameter>ay</parameter>, <parameter>az</parameter>) passing "
+"through the origin (0,0,0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_RotateY\"/>, <xref linkend=\"CG_RotateZ\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry around the X-axis by a given angle."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates the input geometry <parameter>geom</parameter> by <parameter>angle</"
+"parameter> radians around the X-axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_RotateZ\"/>, <xref linkend=\"CG_3DRotate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry around the Y-axis by a given angle."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates the input geometry <parameter>geom</parameter> by <parameter>angle</"
+"parameter> radians around the Y-axis passing."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry around the Z-axis by a given angle."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates the input geometry <parameter>geom</parameter> by <parameter>angle</"
+"parameter> radians around the Z-axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_RotateY\"/>, <xref linkend=\"CG_3DRotate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Scales a geometry uniformly in all dimensions by a given factor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Scales the input geometry <parameter>geom</parameter> by a uniform scale "
+"<parameter>factor</parameter> in all dimensions (X, Y, and Z). The scaling "
+"is performed relative to the origin point (0,0,0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"CG_3DScaleAroundCenter\"/>, <xref linkend=\"ST_Scale\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Scales a geometry by separate factors along X, Y, and Z axes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Scales the input geometry <parameter>geom</parameter> by different factors "
+"along the X, Y, and Z axes. The scaling is performed relative to the origin "
+"point (0,0,0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_3DScaleAroundCenter\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Scales a geometry in 3D space around a specified center point."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Scales the input geometry <parameter>geom</parameter> by different factors "
+"along the X, Y, and Z axes, relative to a specified center point "
+"(<parameter>centerX</parameter>, <parameter>centerY</parameter>, "
+"<parameter>centerZ</parameter>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"CG_3DScale\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Translates (moves) a geometry by given offsets in 2D space."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Translates the input geometry <parameter>geom</parameter> by adding "
+"<parameter>deltaX</parameter> to the X coordinates and <parameter>deltaY</"
+"parameter> to the Y coordinates. Z coordinates are dropped."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Translate\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Translates (moves) a geometry by given offsets in 3D space."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Translates the input geometry <parameter>geom</parameter> by adding "
+"<parameter>deltaX</parameter> to the X coordinates, <parameter>deltaY</"
+"parameter> to the Y coordinates, and <parameter>deltaZ</parameter> to the Z "
+"coordinates."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Reduces the complexity of a geometry while preserving essential features and "
+"Z/M values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Simplifies a geometry using SFCGAL's simplification algorithm, which reduces "
+"the number of points or vertices while preserving the essential features of "
+"the geometry. This function preserves Z and M values during simplification."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The algorithm is based on constrained triangulation and uses the <link xlink:"
+"href=\"https://doc.cgal.org/latest/Polyline_simplification_2/index."
+"html\">CGAL Polyline Simplification 2</link> library with additional "
+"handling to preserve Z and M coordinates. When topology is preserved and "
+"geometries intersect, Z and M values are interpolated at intersection points."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function works well with 3D terrain-like geometries (2.5D) but is not "
+"designed for vertical surfaces like walls."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 3.6.0 - requires SFCGAL >= 2.1.0"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Parameters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Input geometry"
+msgstr ""
+
+#. Tag: parameter
+#, no-c-format
+msgid "threshold"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Maximum distance threshold (in geometry unit) for simplification. The higher "
+"this value, the more simplified the resulting geometry will be."
+msgstr ""
+
+#. Tag: parameter
+#, no-c-format
+msgid "preserveTopology"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If set to true, the function ensures that the topology of the geometry is "
+"preserved. When geometries intersect in this mode, Z and M values at "
+"intersection points are interpolated. The default value is false."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Return Value"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns a simplified geometry with preserved Z and M values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Originals geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplification with 0.5 and topology preserved"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Simplification with 0.5 without topology preservation"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_SimplifyPreserveTopology\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Computes a 3D Alpha-wrapping strictly enclosing a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computes the <link xlink:href=\"https://doc.cgal.org/latest/Alpha_wrap_3/"
+"index.html\">3D Alpha Wrapping</link> of the points in a geometry. An alpha "
+"wrapping is a watertight and orientable surface mesh that strictly encloses "
+"the input. It can be seen as an extension or refinement of an <link "
+"linkend=\"CG_AlphaShape\">alpha-shape</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>relative_alpha</varname> parameter controls which features will "
+"appear in the output. It can can have values from 0 to infinity. Smaller "
+"relative_alpha values result in simpler outputs, but they are less accurate "
+"representations of the original input."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>relative_offset</varname> parameter controls the tightness of "
+"the result. It can can have values from 0 to infinity. If this parameter is "
+"set to 0, its value is automatically determined based on the relative_alpha "
+"parameter."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alpha wrapping of a MultiPoint (same example As <xref "
+"linkend=\"CG_OptimalAlphaShape\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alpha wrapping of a MultiPoint (same example as <xref "
+"linkend=\"ST_ConcaveHull\"/>)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Effect of the <varname>relative_alpha</varname> parameter with values 5, 10 "
+"and 20. A value of 5 results in a coarse output. Increasing the parameter up "
+"to 20 significantly improves the precision and granularity of the result."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Reference System Functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions work with the Spatial Reference System of geometries as "
+"defined in the <varname>spatial_ref_sys</varname> table."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a new geometry with coordinates transformed to a different spatial "
+"reference system using the inverse of a defined coordinate transformation "
+"pipeline."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a new geometry with coordinates transformed to a different spatial "
+"reference system using a defined coordinate transformation pipeline to go in "
+"the inverse direction."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to <xref linkend=\"ST_TransformPipeline\"/> for details on writing a "
+"transformation pipeline."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The SRID of the input geometry is ignored, and the SRID of the output "
+"geometry will be set to zero unless a value is provided via the optional "
+"<varname>to_srid</varname> parameter. When using <xref "
+"linkend=\"ST_TransformPipeline\"/> the pipeline is executed in a forward "
+"direction. Using `ST_InverseTransformPipeline()` the pipeline is executed in "
+"the inverse direction."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Transforms using pipelines are a specialised version of <xref "
+"linkend=\"ST_Transform\"/>. In most cases `ST_Transform` will choose the "
+"correct operations to convert between coordinate systems, and should be "
+"preferred."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Change WGS 84 long lat to UTM 31N using the EPSG:16031 conversion"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "GDA2020 example."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_TransformPipeline\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Set the SRID on a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sets the SRID on a geometry to a particular integer value. Useful in "
+"constructing bounding boxes for queries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function does not transform the geometry coordinates in any way - it "
+"simply sets the meta data defining the spatial reference system the geometry "
+"is assumed to be in. Use <xref linkend=\"ST_Transform\"/> if you want to "
+"transform the geometry into a new projection."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "-- Mark a point as WGS 84 long lat --"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"-- Mark a point as WGS 84 long lat and then transform to web mercator "
+"(Spherical Mercator) --"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SRID\"/>, <xref linkend=\"ST_Transform\"/>, <xref "
+"linkend=\"UpdateGeometrySRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the spatial reference identifier for a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.5"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_Transform\"/>, <xref "
+"linkend=\"RT_ST_SRID\"/>, <xref linkend=\"TG_ST_SRID\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return a new geometry with coordinates transformed to a different spatial "
+"reference system."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a new geometry with its coordinates transformed to a different "
+"spatial reference system. The destination spatial reference "
+"<varname>to_srid</varname> may be identified by a valid SRID integer "
+"parameter (i.e. it must exist in the <varname>spatial_ref_sys</varname> "
+"table). Alternatively, a spatial reference defined as a PROJ.4 string can be "
+"used for <varname>to_proj</varname> and/or <varname>from_proj</varname>, "
+"however these methods are not optimized. If the destination spatial "
+"reference system is expressed with a PROJ.4 string instead of an SRID, the "
+"SRID of the output geometry will be set to zero. With the exception of "
+"functions with <varname>from_proj</varname>, input geometries must have a "
+"defined SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Transform is often confused with <xref linkend=\"ST_SetSRID\"/>. "
+"ST_Transform actually changes the coordinates of a geometry from one spatial "
+"reference system to another, while ST_SetSRID() simply changes the SRID "
+"identifier of the geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"ST_Transform automatically selects a suitable conversion pipeline given the "
+"source and target spatial reference systems. To use a specific conversion "
+"method, use <xref linkend=\"ST_TransformPipeline\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Requires PostGIS be compiled with PROJ support. Use <xref "
+"linkend=\"PostGIS_Full_Version\"/> to confirm you have PROJ support compiled "
+"in."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If using more than one transformation, it is useful to have a functional "
+"index on the commonly used transformations to take advantage of index usage."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.3.0 support for direct PROJ.4 text was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.6"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Change Massachusetts state plane US feet geometry to WGS 84 long lat"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example of creating a partial functional index. For tables where you are not "
+"sure all the geometries will be filled in, its best to use a partial index "
+"that leaves out null geometries which will both conserve space and make your "
+"index smaller and more efficient."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Examples of using PROJ.4 text to transform with custom spatial references."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Configuring transformation behavior"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sometimes coordinate transformation involving a grid-shift can fail, for "
+"example if PROJ.4 has not been built with grid-shift files or the coordinate "
+"does not lie within the range for which the grid shift is defined. By "
+"default, PostGIS will throw an error if a grid shift file is not present, "
+"but this behavior can be configured on a per-SRID basis either by testing "
+"different <varname>to_proj</varname> values of PROJ.4 text, or altering the "
+"<varname>proj4text</varname> value within the <varname>spatial_ref_sys</"
+"varname> table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For example, the proj4text parameter +datum=NAD87 is a shorthand form for "
+"the following +nadgrids parameter:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The @ prefix means no error is reported if the files are not present, but if "
+"the end of the list is reached with no file having been appropriate (ie. "
+"found and overlapping) then an error is issued."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If, conversely, you wanted to ensure that at least the standard files were "
+"present, but that if all files were scanned without a hit a null "
+"transformation is applied you could use:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The null grid shift file is a valid grid shift file covering the whole world "
+"and applying no shift. So for a complete example, if you wanted to alter "
+"PostGIS so that transformations to SRID 4267 that didn't lie within the "
+"correct range did not throw an ERROR, you would use the following:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_SetSRID\"/>, <xref linkend=\"ST_SRID\"/>, <xref "
+"linkend=\"UpdateGeometrySRID\"/>, <xref linkend=\"ST_TransformPipeline\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Return a new geometry with coordinates transformed to a "
+"different spatial reference system using a defined coordinate transformation "
+"pipeline.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Return a new geometry with coordinates transformed to a different "
+"spatial reference system using a defined coordinate transformation pipeline."
+"</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Transformation pipelines are defined using any of the following string "
+"formats:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>urn:ogc:def:coordinateOperation:AUTHORITY::CODE</varname>. Note "
+"that a simple <varname>EPSG:CODE</varname> string does not uniquely identify "
+"a coordinate operation: the same EPSG code can be used for a CRS definition."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A PROJ pipeline string of the form: <varname>+proj=pipeline ...</varname>. "
+"Automatic axis normalisation will not be applied, and if necessary the "
+"caller will need to add an additional pipeline step, or remove "
+"<varname>axisswap</varname> steps."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Concatenated operations of the form: <varname>urn:ogc:def:"
+"coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:"
+"EPSG::1618</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The SRID of the input geometry is ignored, and the SRID of the output "
+"geometry will be set to zero unless a value is provided via the optional "
+"<varname>to_srid</varname> parameter. When using `ST_TransformPipeline()` "
+"the pipeline is executed in a forward direction. Using <xref "
+"linkend=\"ST_InverseTransformPipeline\"/> the pipeline is executed in the "
+"inverse direction."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_InverseTransformPipeline\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return the list of SRS codes associated with the given authority."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of all <varname>auth_srid</varname> for the given "
+"<varname>auth_name</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Proj version 6+"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "List the first ten codes associated with the EPSG authority."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"postgis_srs_all\"/>, <xref linkend=\"postgis_srs_search\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Return a metadata record for the requested authority and srid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a metadata record for the requested <varname>auth_srid</varname> for "
+"the given <varname>auth_name</varname>. The record will have the "
+"<varname>auth_name</varname>, <varname>auth_srid</varname>, <varname>srname</"
+"varname>, <varname>srtext</varname>, <varname>proj4text</varname>, and the "
+"corners of the area of usage, <varname>point_sw</varname> and "
+"<varname>point_ne</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Get the metadata for EPSG:3005."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return metadata records for every spatial reference system in the underlying "
+"Proj database."
+msgstr ""
+
+#. Tag: funcdef
+#, no-c-format
+msgid "setof record <function>postgis_srs_all</function>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a set of all metadata records in the underlying Proj database. The "
+"records will have the <varname>auth_name</varname>, <varname>auth_srid</"
+"varname>, <varname>srname</varname>, <varname>srtext</varname>, "
+"<varname>proj4text</varname>, and the corners of the area of usage, "
+"<varname>point_sw</varname> and <varname>point_ne</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Get the first 10 metadata records from the Proj database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"postgis_srs\"/>, <xref linkend=\"postgis_srs_search\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Return metadata records for projected coordinate systems that have areas of "
+"usage that fully contain the bounds parameter."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Return a set of metadata records for projected coordinate systems that have "
+"areas of usage that fully contain the bounds parameter. Each record will "
+"have the <varname>auth_name</varname>, <varname>auth_srid</varname>, "
+"<varname>srname</varname>, <varname>srtext</varname>, <varname>proj4text</"
+"varname>, and the corners of the area of usage, <varname>point_sw</varname> "
+"and <varname>point_ne</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The search only looks for projected coordinate systems, and is intended for "
+"users to explore the possible systems that work for the extent of their data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Search for projected coordinate systems in Louisiana."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Scan a table for max extent and find projected coordinate systems that might "
+"suit."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"postgis_srs_all\"/>, <xref linkend=\"postgis_srs\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Trajectory Functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions support working with trajectories. A trajectory is a linear "
+"geometry with increasing measures (M value) on each coordinate. Spatio-"
+"temporal data can be modeled by using relative times (such as the epoch) as "
+"the measure values."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if the geometry is a valid trajectory."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tests if a geometry encodes a valid trajectory. A valid trajectory is "
+"represented as a <varname>LINESTRING</varname> with measures (M values). The "
+"measure values must increase from each vertex to the next."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Valid trajectories are expected as input to spatio-temporal functions like "
+"<xref linkend=\"ST_ClosestPointOfApproach\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns a measure at the closest point of approach of two trajectories."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the smallest measure at which points interpolated along the given "
+"trajectories are the least distance apart."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Inputs must be valid trajectories as checked by <xref "
+"linkend=\"ST_IsValidTrajectory\"/>. Null is returned if the trajectories do "
+"not overlap in their M ranges."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To obtain the actual points at the computed measure use <xref "
+"linkend=\"ST_LocateAlong\"/> ."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_DistanceCPA\"/>, <xref linkend=\"ST_LocateAlong\"/>, "
+"<xref linkend=\"ST_AddMeasure\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the distance between the closest point of approach of two "
+"trajectories."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the distance (in 2D) between two trajectories at their closest point "
+"of approach."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClosestPointOfApproach\"/>, <xref "
+"linkend=\"ST_AddMeasure\"/>, <xref linkend=\"geometry_distance_cpa\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Tests if the closest point of approach of two trajectories is within the "
+"specified distance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tests whether two moving objects have ever been closer than the specified "
+"distance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Inputs must be valid trajectories as checked by <xref "
+"linkend=\"ST_IsValidTrajectory\"/>. False is returned if the trajectories do "
+"not overlap in their M ranges."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_ClosestPointOfApproach\"/>, <xref "
+"linkend=\"ST_DistanceCPA\"/>, <xref linkend=\"geometry_distance_cpa\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Affine Transformations"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions change the position and shape of geometries using <link "
+"xlink:href=\"https://en.wikipedia.org/wiki/Affine_transformation\">affine "
+"transformations</link>."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Apply a 3D affine transformation to a geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Applies a 3D affine transformation to the geometry to do things like "
+"translate, rotate, scale in one step."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Version 1: The call <programlisting>ST_Affine(geom, a, b, c, d, e, f, g, h, "
+"i, xoff, yoff, zoff) </programlisting> represents the transformation matrix "
+"<programlisting>/ a b c xoff \\\n"
+"| d e f yoff |\n"
+"| g h i zoff |\n"
+"\\ 0 0 0 1 /</programlisting> and the vertices are transformed as "
+"follows: <programlisting>x' = a*x + b*y + c*z + xoff\n"
+"y' = d*x + e*y + f*z + yoff\n"
+"z' = g*x + h*y + i*z + zoff</programlisting> All of the translate / scale "
+"functions below are expressed via such an affine transformation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Version 2: Applies a 2d affine transformation to the geometry. The call "
+"<programlisting>ST_Affine(geom, a, b, d, e, xoff, yoff)</programlisting> "
+"represents the transformation matrix <programlisting>/ a b 0 xoff "
+"\\ / a b xoff \\\n"
+"| d e 0 yoff | rsp. | d e yoff |\n"
+"| 0 0 1 0 | \\ 0 0 1 /\n"
+"\\ 0 0 0 1 /</programlisting> and the vertices are transformed as "
+"follows: <programlisting>x' = a*x + b*y + xoff\n"
+"y' = d*x + e*y + yoff\n"
+"z' = z </programlisting> This method is a subcase of the 3D method above."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.2. Name changed from Affine to ST_Affine in 1.2.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Scale\"/>, <xref linkend=\"ST_Translate\"/>, <xref "
+"linkend=\"ST_TransScale\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry about an origin point."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Rotates geometry rotRadians counter-clockwise about the origin point. The "
+"rotation origin can be specified either as a POINT geometry, or as x and y "
+"coordinates. If the origin is not specified, the geometry is rotated about "
+"POINT(0 0)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.0.0 additional parameters for specifying the origin of rotation "
+"were added."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.2. Name changed from Rotate to ST_Rotate in 1.2.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_RotateX\"/>, <xref linkend=\"ST_RotateY\"/>, <xref "
+"linkend=\"ST_RotateZ\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry about the X axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Rotates a geometry geomA - rotRadians about the X axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>ST_RotateX(geomA, rotRadians)</code> is short-hand for "
+"<code>ST_Affine(geomA, 1, 0, 0, 0, cos(rotRadians), -sin(rotRadians), 0, "
+"sin(rotRadians), cos(rotRadians), 0, 0, 0)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.2. Name changed from RotateX to ST_RotateX in 1.2.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_RotateY\"/>, <xref linkend=\"ST_RotateZ\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry about the Y axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Rotates a geometry geomA - rotRadians about the y axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>ST_RotateY(geomA, rotRadians)</code> is short-hand for "
+"<code>ST_Affine(geomA, cos(rotRadians), 0, sin(rotRadians), 0, 1, 0, -"
+"sin(rotRadians), 0, cos(rotRadians), 0, 0, 0)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.2. Name changed from RotateY to ST_RotateY in 1.2.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_RotateX\"/>, <xref linkend=\"ST_RotateZ\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Rotates a geometry about the Z axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Rotates a geometry geomA - rotRadians about the Z axis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This is a synonym for ST_Rotate"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>ST_RotateZ(geomA, rotRadians)</code> is short-hand for <code>SELECT "
+"ST_Affine(geomA, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), "
+"cos(rotRadians), 0, 0, 0, 1, 0, 0, 0)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.2. Name changed from RotateZ to ST_RotateZ in 1.2.2"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_RotateX\"/>, <xref linkend=\"ST_RotateY\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Scales a geometry by given factors."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Scales the geometry to a new size by multiplying the ordinates with the "
+"corresponding factor parameters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The version taking a geometry as the <varname>factor</varname> parameter "
+"allows passing a 2d, 3dm, 3dz or 4d point to set scaling factor for all "
+"supported dimensions. Missing dimensions in the <varname>factor</varname> "
+"point are equivalent to no scaling the corresponding dimension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The three-geometry variant allows a \"false origin\" for the scaling to be "
+"passed in. This allows \"scaling in place\", for example using the centroid "
+"of the geometry as the false origin. Without a false origin, scaling takes "
+"place relative to the actual origin, so all coordinates are just multiplied "
+"by the scale factor."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 1.1.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.2.0 support for scaling all dimension (<varname>factor</varname> "
+"parameter) was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 2.5.0 support for scaling relative to a local origin "
+"(<varname>origin</varname> parameter) was introduced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_TransScale\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Translates a geometry by given offsets."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a new geometry whose coordinates are translated delta x,delta y,"
+"delta z units. Units are based on the units defined in spatial reference "
+"(SRID) for this geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Move a point 1 degree longitude"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Move a linestring 1 degree longitude and 1/2 degree latitude"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Move a 3d point"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Move a curve and a point"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_AsText\"/>, <xref linkend=\"ST_GeomFromText\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Translates and scales a geometry by given offsets and factors."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Translates the geometry using the deltaX and deltaY args, then scales it "
+"using the XFactor, YFactor args, working in 2D only."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<code>ST_TransScale(geomA, deltaX, deltaY, XFactor, YFactor)</code> is short-"
+"hand for <code>ST_Affine(geomA, XFactor, 0, 0, 0, YFactor, 0, 0, 0, 1, "
+"deltaX*XFactor, deltaY*YFactor, 0)</code>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Troubleshooting Functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions are utilities for troubleshooting and repairing geometry "
+"data. They are only needed if the geometry data is corrupted in some way, "
+"which should never happen under normal circumstances."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Geometry/Geography/Box Data Types"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This section lists the custom PostgreSQL data types installed by PostGIS to "
+"represent spatial data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Each data type describes its type casting behavior. A <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/sql-expressions.html#SQL-"
+"SYNTAX-TYPE-CASTS\">type cast</link> converts values of one data type into "
+"another type. PostgreSQL allows defining casting behavior for custom types, "
+"along with the functions used to convert type values. Casts can have "
+"<emphasis role=\"bold\">automatic</emphasis> behavior, which allows "
+"automatic conversion of a function argument to a type supported by the "
+"function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Some casts have <emphasis role=\"bold\">explicit</emphasis> behavior, which "
+"means the cast must be specified using the syntax <varname>CAST(myval As "
+"sometype)</varname> or <varname>myval::sometype</varname>. Explicit casting "
+"avoids the issue of ambiguous casts, which can occur when using an "
+"overloaded function which does not support a given type. For example, a "
+"function may accept a box2d or a box3d, but not a geometry. Since geometry "
+"has an automatic cast to both box types, this produces an \"ambiguous "
+"function\" error. To prevent the error use an explicit cast to the desired "
+"box type."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All data types can be cast to <varname>text</varname>, so this does not need "
+"to be specified explicitly."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "The type representing a 2-dimensional bounding box."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>box2d</varname> is a spatial data type used to represent the two-"
+"dimensional bounding box enclosing a geometry or collection of geometries. "
+"For example, the <xref linkend=\"ST_Extent\"/> aggregate function returns a "
+"<varname>box2d</varname> object."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The representation contains the values <varname>xmin, ymin, xmax, ymax</"
+"varname>. These are the minimum and maximum values of the X and Y extents."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>box2d</varname> objects have a text representation which looks like "
+"<code>BOX(1 2,5 6)</code>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This table lists the automatic and explicit casts allowed for this data type:"
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>box3d</entry>"
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>geometry</entry>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "The type representing a 3-dimensional bounding box."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>box3d</varname> is a PostGIS spatial data type used to represent "
+"the three-dimensional bounding box enclosing a geometry or collection of "
+"geometries. For example, the <xref linkend=\"ST_3DExtent\"/> aggregate "
+"function returns a <varname>box3d</varname> object."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The representation contains the values <varname>xmin, ymin, zmin, xmax, "
+"ymax, zmax</varname>. These are the minimum and maximum values of the X, Y "
+"and Z extents."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>box3d</varname> objects have a text representation which looks like "
+"<code>BOX3D(1 2 3,5 6 5)</code>."
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>box</entry>"
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>box2d</entry>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "The type representing spatial features with planar coordinate systems."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geometry</varname> is a fundamental PostGIS spatial data type used "
+"to represent a feature in planar (Euclidean) coordinate systems."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All spatial operations on geometry use the units of the Spatial Reference "
+"System the geometry is in."
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "bytea"
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "<entry>geography</entry>"
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "text"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"PostGIS_SQLMM_Functions\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "A composite type used to describe the parts of complex geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geometry_dump</varname> is a <link xlink:href=\"https://www."
+"postgresql.org/docs/current/rowtypes.html\">composite data type</link> "
+"containing the fields:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geom</varname> - a geometry representing a component of the dumped "
+"geometry. The geometry type depends on the originating function."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>path[]</varname> - an integer array that defines the navigation "
+"path within the dumped geometry to the <varname>geom</varname> component. "
+"The path array is 1-based (i.e. <varname>path[1]</varname> is the first "
+"element.)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It is used by the <varname>ST_Dump*</varname> family of functions as an "
+"output type to explode a complex geometry into its constituent parts."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"The type representing spatial features with geodetic (ellipsoidal) "
+"coordinate systems."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>geography</varname> is a spatial data type used to represent a "
+"feature in geodetic coordinate systems. Geodetic coordinate systems model "
+"the earth using an ellipsoid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial operations on the geography type provide more accurate results by "
+"taking the ellipsoidal model into account."
+msgstr ""
+
+#. Tag: entry
+#, no-c-format
+msgid "explicit"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"PostGIS_GeographyFunctions\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Validation"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These functions test whether geometries are valid according to the OGC SFS "
+"standard. They also provide information about the nature and location of "
+"invalidity. There is also a function to create a valid geometry out of an "
+"invalid one."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Tests if a geometry is well-formed in 2D."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Tests if an ST_Geometry value is well-formed and valid in 2D according to "
+"the OGC rules. For geometries with 3 and 4 dimensions, the validity is still "
+"only tested in 2 dimensions. For geometries that are invalid, a PostgreSQL "
+"NOTICE is emitted providing details of why it is not valid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the version with the <varname>flags</varname> parameter, supported "
+"values are documented in <xref linkend=\"ST_IsValidDetail\"/> This version "
+"does not print a NOTICE explaining invalidity."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information on the definition of geometry validity, refer to <xref "
+"linkend=\"OGC_Validity\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SQL-MM defines the result of ST_IsValid(NULL) to be 0, while PostGIS returns "
+"NULL."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The version accepting flags is available starting with 2.0.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&sqlmm_compliant; SQL-MM 3: 5.1.9"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Neither OGC-SFS nor SQL-MM specifications include a flag argument for "
+"ST_IsValid. The flag is a PostGIS extension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_IsValidReason\"/>, <xref linkend=\"ST_IsValidDetail\"/>,"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns a <varname>valid_detail</varname> row stating if a geometry is valid "
+"or if not a reason and a location."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns a <varname>valid_detail</varname> row, containing a boolean "
+"(<varname>valid</varname>) stating if a geometry is valid, a varchar "
+"(<varname>reason</varname>) stating a reason why it is invalid and a "
+"geometry (<varname>location</varname>) pointing out where it is invalid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Useful to improve on the combination of <xref linkend=\"ST_IsValid\"/> and "
+"<xref linkend=\"ST_IsValidReason\"/> to generate a detailed report of "
+"invalid geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The optional <varname>flags</varname> parameter is a bitfield. It can have "
+"the following values:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "0: Use usual OGC SFS validity semantics."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"1: Consider certain kinds of self-touching rings (inverted shells and "
+"exverted holes) as valid. This is also known as \"the ESRI flag\", since "
+"this is the validity model used by those tools. Note that this is invalid "
+"under the OGC model."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_IsValidReason\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns text stating if a geometry is valid, or a reason for invalidity."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns text stating if a geometry is valid, or if invalid a reason why."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Useful in combination with <xref linkend=\"ST_IsValid\"/> to generate a "
+"detailed report of invalid geometries and reasons."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Allowed <varname>flags</varname> are documented in <xref "
+"linkend=\"ST_IsValidDetail\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 2.0 version taking flags."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"ST_Summary\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Attempts to make an invalid geometry valid without losing vertices."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The function attempts to create a valid representation of a given invalid "
+"geometry without losing any of the input vertices. Valid geometries are "
+"returned unchanged."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Supported inputs are: POINTS, MULTIPOINTS, LINESTRINGS, MULTILINESTRINGS, "
+"POLYGONS, MULTIPOLYGONS and GEOMETRYCOLLECTIONS containing any mix of them."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In case of full or partial dimensional collapses, the output geometry may be "
+"a collection of lower-to-equal dimension geometries, or a geometry of lower "
+"dimension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Single polygons may become multi-geometries in case of self-intersections."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>params</varname> argument can be used to supply an options "
+"string to select the method to use for building valid geometry. The options "
+"string is in the format \"method=linework|structure keepcollapsed=true|"
+"false\". If no \"params\" argument is provided, the \"linework\" algorithm "
+"will be used as the default."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The \"method\" key has two values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"\"linework\" is the original algorithm, and builds valid geometries by first "
+"extracting all lines, noding that linework together, then building a value "
+"output from the linework."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"\"structure\" is an algorithm that distinguishes between interior and "
+"exterior rings, building new geometry by unioning exterior rings, and then "
+"differencing all interior rings."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The \"keepcollapsed\" key is only valid for the \"structure\" algorithm, and "
+"takes a value of \"true\" or \"false\". When set to \"false\", geometry "
+"components that collapse to a lower dimensionality, for example a one-point "
+"linestring would be dropped."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.0.1, speed improvements"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 2.1.0, added support for GEOMETRYCOLLECTION and MULTIPOINT."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced: 3.1.0, added removal of Coordinates with NaN values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.2.0, added algorithm options, 'linework' and 'structure' which "
+"requires GEOS >= 3.10.0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "before_geom: MULTIPOLYGON of 2 overlapping polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "after_geom: MULTIPOLYGON of 4 non-overlapping polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "after_geom_structure: MULTIPOLYGON of 1 non-overlapping polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "before_geom: MULTIPOLYGON of 6 overlapping polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "after_geom: MULTIPOLYGON of 14 Non-overlapping polygons"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "after_geom_structure: MULTIPOLYGON of 1 Non-overlapping polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"ST_Collect\"/>, <xref linkend=\"ST_CollectionExtract\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Version Functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "These functions report and upgrade PostGIS versions."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Packages and upgrades PostGIS extensions (e.g. postgis_raster, "
+"postgis_topology, postgis_sfcgal) to given or latest version."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Packages and upgrades PostGIS extensions to given or latest version. Only "
+"extensions you have installed in the database will be packaged and upgraded "
+"if needed. Reports full PostGIS version and build configuration infos after. "
+"This is short-hand for doing multiple CREATE EXTENSION .. FROM unpackaged "
+"and ALTER EXTENSION .. UPDATE for each PostGIS extension. Currently only "
+"tries to upgrade extensions postgis, postgis_raster, postgis_sfcgal, "
+"postgis_topology, and postgis_tiger_geocoder."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Changed: 3.4.0 to add target_version argument."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.3.0 support for upgrades from any PostGIS version. Does not work "
+"on all systems."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Changed: 3.0.0 to repackage loose extensions and support postgis_raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_GEOS_Version\"/>, <xref "
+"linkend=\"PostGIS_Lib_Version\"/>, <xref linkend=\"PostGIS_LibXML_Version\"/"
+">, <xref linkend=\"PostGIS_PROJ_Version\"/>, <xref "
+"linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Reports full PostGIS version and build configuration infos."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reports full PostGIS version and build configuration infos. Also informs "
+"about synchronization between libraries and scripts suggesting upgrades as "
+"needed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.4.0 now includes extra PROJ configurations NETWORK_ENABLED, "
+"URL_ENDPOINT and DATABASE_PATH of proj.db location"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_GEOS_Version\"/>, <xref "
+"linkend=\"PostGIS_Lib_Version\"/>, <xref linkend=\"PostGIS_LibXML_Version\"/"
+">, <xref linkend=\"PostGIS_PROJ_Version\"/>, <xref "
+"linkend=\"PostGIS_Wagyu_Version\"/>, <xref linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the version number of the GEOS library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the version number of the GEOS library, or <varname>NULL</varname> "
+"if GEOS support is not enabled."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Lib_Version\"/>, <xref "
+"linkend=\"PostGIS_LibXML_Version\"/>, <xref linkend=\"PostGIS_PROJ_Version\"/"
+">, <xref linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the version number of the GEOS library against which PostGIS was "
+"built."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the version number of the GEOS library, or against which PostGIS was "
+"built."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ", <xref linkend=\"PostGIS_Full_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the version number of the liblwgeom library. This should match the "
+"version of PostGIS."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the version number of the liblwgeom library/"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the version number of the libxml2 library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the version number of the LibXML2 library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Lib_Version\"/>, <xref "
+"linkend=\"PostGIS_PROJ_Version\"/>, <xref linkend=\"PostGIS_GEOS_Version\"/"
+">, <xref linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the version number of the libjson-c library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Returns the version number of the LibJSON-C library."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "<refpurpose>Returns build date of the PostGIS library.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns build date of the PostGIS library.</para>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the version number of the PostGIS library.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns the version number of the PostGIS library.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_GEOS_Version\"/>, <xref "
+"linkend=\"PostGIS_LibXML_Version\"/>, <xref linkend=\"PostGIS_PROJ_Version\"/"
+">, <xref linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the version number of the PROJ4 library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the version number of the PROJ library and some configuration "
+"options of proj."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Enhanced: 3.4.0 now includes NETWORK_ENABLED, URL_ENDPOINT and DATABASE_PATH "
+"of proj.db location"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Full_Version\"/>, <xref "
+"linkend=\"PostGIS_GEOS_Version\"/>, <xref linkend=\"PostGIS_Lib_Version\"/>, "
+"<xref linkend=\"PostGIS_LibXML_Version\"/>, <xref "
+"linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"Returns the version number of the PROJ library against which PostGIS was "
+"built."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the version number of the PROJ library, or against which PostGIS was "
+"built."
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "Returns the version number of the internal Wagyu library."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Returns the version number of the internal Wagyu library, or <varname>NULL</"
+"varname> if Wagyu support is not enabled."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_GEOS_Version\"/>, <xref "
+"linkend=\"PostGIS_PROJ_Version\"/>, <xref linkend=\"PostGIS_Lib_Version\"/>, "
+"<xref linkend=\"PostGIS_LibXML_Version\"/>, <xref "
+"linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid "<refpurpose>Returns build date of the PostGIS scripts.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns build date of the PostGIS scripts.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_GEOS_Version\"/>, <xref "
+"linkend=\"PostGIS_Lib_Version\"/>, <xref linkend=\"PostGIS_LibXML_Version\"/"
+">, <xref linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns version of the PostGIS scripts installed in this "
+"database.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns version of the PostGIS scripts installed in this database.</"
+"para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the output of this function doesn't match the output of <xref "
+"linkend=\"PostGIS_Scripts_Released\"/> you probably missed to properly "
+"upgrade an existing database. See the <link linkend=\"upgrading\">Upgrading</"
+"link> section for more info."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Availability: 0.9.0"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Scripts_Released\"/>, <xref "
+"linkend=\"PostGIS_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns the version number of the postgis.sql script released "
+"with the installed PostGIS lib.</refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<para>Returns the version number of the postgis.sql script released with the "
+"installed PostGIS lib.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Starting with version 1.1.0 this function returns the same value of <xref "
+"linkend=\"PostGIS_Lib_Version\"/>. Kept for backward compatibility."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_Scripts_Installed\"/>, <xref "
+"linkend=\"PostGIS_Lib_Version\"/>"
+msgstr ""
+
+#. Tag: refpurpose
+#, no-c-format
+msgid ""
+"<refpurpose>Returns PostGIS version number and compile-time options.</"
+"refpurpose>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<para>Returns PostGIS version number and compile-time options.</para>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+", <xref linkend=\"PostGIS_GEOS_Version\"/>, <xref "
+"linkend=\"PostGIS_Lib_Version\"/>, <xref linkend=\"PostGIS_LibXML_Version\"/"
+">, <xref linkend=\"PostGIS_PROJ_Version\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Appendix"
+msgstr ""
+
+#. Tag: subtitle
+#, no-c-format
+msgid "Release Notes"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS 3.6.0beta1"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "2025/07/19"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This version requires PostgreSQL 12-18beta2, GEOS 3.8 or higher, and Proj "
+"6.1+. To take advantage of all features, GEOS 3.14+ is needed. To take "
+"advantage of all SFCGAL features, SFCGAL 2.2+ is needed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Many thanks to our translation teams, in particular:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Teramoto Ikuhiro (Japanese Team)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Daniel Nylander (Swedish Team)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Dapeng Wang, Zuo Chenwei from HighGo (Chinese Team)"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Breaking Changes"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5799\">#5799</"
+"link>, make ST_TileEnvelope clips envelopes to tile plane extent (Paul "
+"Ramsey)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5829\">#5829</"
+"link>, remove constraint checking from geometry_columns view (Paul Ramsey)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/3373\">#3373</"
+"link>, <link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/"
+"pulls/255\">GT-255</link>, [topology] Support for upgrading domains (Ayo "
+"Adesugba, U.S. Census Bureau)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/"
+"pulls/252\">GT-252</link>, ST_NumGeometries/ST_GeometryN treat TIN and "
+"PolyhedralSurface as unitary geometries, use ST_NumPatches/ST_PatchN for "
+"patch access (Loïc Bartoletti)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/3110\">#3110</"
+"link>, <link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/"
+"pulls/242\">GT-242</link>, [topology] Support for bigint (Ayo Adesugba, U.S. "
+"Census Bureau)"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Removed / Deprecate signatures"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "New Features"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://github.com/postgis/postgis/pull/803\">GH-803</"
+"link>, [sfcgal] ADD CG_Simplify function (Loïc Bartoletti)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://github.com/postgis/postgis/pull/805\">GH-805</"
+"link>, [sfcgal] Add M support for SFCGAL >= 1.5.0 (Loïc Bartoletti)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://github.com/postgis/postgis/pull/801\">GH-801</"
+"link>, [sfcgal] ADD CG_3DAlphaWrapping function (Jean Felder)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5894\">#5894</"
+"link>, [topology] TotalTopologySize (Sandro Santilli)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5890\">#5890</"
+"link>, [topology] ValidateTopologyPrecision, MakeTopologyPrecise (Sandro "
+"Santilli)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5861\">#5861</"
+"link>, [topology] Add --drop-topology switch to pgtopo_import (Sandro "
+"Santilli)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/1247\">#1247</"
+"link>, [raster] ST_AsRasterAgg (Sandro Santilli)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5784\">#5784</"
+"link>, <link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/"
+"pulls/223\">GT-223</link> Export circ_tree_distance_tree_internal for "
+"mobilitydb use (Maxime Schoemans)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/"
+"pulls/228\">GT-228</link> [sfcgal] Add new functions (Scale, Translate, "
+"Rotate, Buffer 3D and Straight Skeleton Partition) from SFCGAL 2 (Loïc "
+"Bartoletti)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"[raster] New GUC postgis.gdal_cpl_debug, enables GDAL debugging messages and "
+"routes them into the PostgreSQL logging system. (Paul Ramsey)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"https://trac.osgeo.org/postgis/ticket/5841\">#5841</"
+"link>, Change interrupt handling to remove use of pqsignal to support PG 18 "
+"(Paul Ramsey)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Add ST_CoverageClean to edge match and gap remove polygonal coverages (Paul "
+"Ramsey) from GEOS 3.14 (Martin Davis)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Add ST_ReclassExact to quickly remap values in raster (Paul Ramsey)"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Reporting Problems"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Reporting Software Bugs"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reporting bugs effectively is a fundamental way to help PostGIS development. "
+"The most effective bug report is that enabling PostGIS developers to "
+"reproduce it, so it would ideally contain a script triggering it and every "
+"information regarding the environment in which it was detected. Good enough "
+"info can be extracted running <code>SELECT postgis_full_version()</code> "
+"[for PostGIS] and <code>SELECT version()</code> [for postgresql]."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you aren't using the latest release, it's worth taking a look at its "
+"<link xlink:href=\"https://git.osgeo.org/gitea/postgis/postgis/raw/branch/"
+"master/NEWS\">release changelog</link> first, to find out if your bug has "
+"already been fixed."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using the <link xlink:href=\"http://trac.osgeo.org/postgis/\">PostGIS bug "
+"tracker</link> will ensure your reports are not discarded, and will keep you "
+"informed on its handling process. Before reporting a new bug please query "
+"the database to see if it is a known one, and if it is please add any new "
+"information you have about it."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You might want to read Simon Tatham's paper about <link xlink:href=\"http://"
+"www.chiark.greenend.org.uk/~sgtatham/bugs.html\">How to Report Bugs "
+"Effectively</link> before filing a new report."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Reporting Documentation Issues"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The documentation should accurately reflect the features and behavior of the "
+"software. If it doesn't, it could be because of a software bug or because "
+"the documentation is in error or deficient."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Documentation issues can also be reported to the <link xlink:href=\"http://"
+"trac.osgeo.org/postgis\">PostGIS bug tracker</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If your revision is trivial, just describe it in a new bug tracker issue, "
+"being specific about its location in the documentation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If your changes are more extensive, a patch is definitely preferred. This is "
+"a four step process on Unix (assuming you already have <link xlink:"
+"href=\"https://git-scm.com/\">git</link> installed):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Clone the PostGIS' git repository. On Unix, type:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This will be stored in the directory postgis"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Make your changes to the documentation with your favorite text editor. On "
+"Unix, type (for example):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that the documentation is written in DocBook XML rather than HTML, so "
+"if you are not familiar with it please follow the example of the rest of the "
+"documentation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Make a patch file containing the differences from the master copy of the "
+"documentation. On Unix, type:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Attach the patch to a new issue in bug tracker."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Data Management"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Data Model"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "OGC Geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The Open Geospatial Consortium (OGC) developed the <link xlink:"
+"href=\"https://www.ogc.org/standards/sfa\"><emphasis>Simple Features Access</"
+"emphasis></link> standard (SFA) to provide a model for geospatial data. It "
+"defines the fundamental spatial type of <emphasis role=\"bold\">Geometry</"
+"emphasis>, along with operations which manipulate and transform geometry "
+"values to perform spatial analysis tasks. PostGIS implements the OGC "
+"Geometry model as the PostgreSQL data types <link "
+"linkend=\"PostGIS_Geometry\">geometry</link> and <link "
+"linkend=\"PostGIS_Geography\">geography</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry is an <emphasis>abstract</emphasis> type. Geometry values belong to "
+"one of its <emphasis>concrete</emphasis> subtypes which represent various "
+"kinds and dimensions of geometric shapes. These include the <emphasis "
+"role=\"bold\">atomic</emphasis> types <link linkend=\"Point\">Point</link>, "
+"<link linkend=\"LineString\">LineString</link>, <link "
+"linkend=\"LinearRing\">LinearRing</link> and <link "
+"linkend=\"Polygon\">Polygon</link>, and the <emphasis "
+"role=\"bold\">collection</emphasis> types <link "
+"linkend=\"MultiPoint\">MultiPoint</link>, <link "
+"linkend=\"MultiLineString\">MultiLineString</link>, <link "
+"linkend=\"MultiPolygon\">MultiPolygon</link> and <link "
+"linkend=\"GeometryCollection\">GeometryCollection</link>. The <link xlink:"
+"href=\"https://portal.ogc.org/files/?artifact_id=25355\"><emphasis>Simple "
+"Features Access - Part 1: Common architecture v1.2.1</emphasis></link> adds "
+"subtypes for the structures <link "
+"linkend=\"PolyhedralSurface\">PolyhedralSurface</link>, <link "
+"linkend=\"Triangle\">Triangle</link> and <link linkend=\"TIN\">TIN</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry models shapes in the 2-dimensional Cartesian plane. The "
+"PolyhedralSurface, Triangle, and TIN types can also represent shapes in 3-"
+"dimensional space. The size and location of shapes are specified by their "
+"<emphasis role=\"bold\">coordinates</emphasis>. Each coordinate has a X and "
+"Y <emphasis role=\"bold\">ordinate</emphasis> value determining its location "
+"in the plane. Shapes are constructed from points or line segments, with "
+"points specified by a single coordinate, and line segments by two "
+"coordinates."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Coordinates may contain optional Z and M ordinate values. The Z ordinate is "
+"often used to represent elevation. The M ordinate contains a measure value, "
+"which may represent time or distance. If Z or M values are present in a "
+"geometry value, they must be defined for each point in the geometry. If a "
+"geometry has Z or M ordinates the <emphasis role=\"bold\">coordinate "
+"dimension</emphasis> is 3D; if it has both Z and M the coordinate dimension "
+"is 4D."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry values are associated with a <emphasis role=\"bold\">spatial "
+"reference system</emphasis> indicating the coordinate system in which it is "
+"embedded. The spatial reference system is identified by the geometry SRID "
+"number. The units of the X and Y axes are determined by the spatial "
+"reference system. In <emphasis role=\"bold\">planar</emphasis> reference "
+"systems the X and Y coordinates typically represent easting and northing, "
+"while in <emphasis role=\"bold\">geodetic</emphasis> systems they represent "
+"longitude and latitude. SRID 0 represents an infinite Cartesian plane with "
+"no units assigned to its axes. See <xref linkend=\"spatial_ref_sys\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geometry <emphasis role=\"bold\">dimension</emphasis> is a property of "
+"geometry types. Point types have dimension 0, linear types have dimension 1, "
+"and polygonal types have dimension 2. Collections have the dimension of the "
+"maximum element dimension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A geometry value may be <emphasis role=\"bold\">empty</emphasis>. Empty "
+"values contain no vertices (for atomic geometry types) or no elements (for "
+"collections)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An important property of geometry values is their spatial <emphasis "
+"role=\"bold\">extent</emphasis> or <emphasis role=\"bold\">bounding box</"
+"emphasis>, which the OGC model calls <emphasis role=\"bold\">envelope</"
+"emphasis>. This is the 2 or 3-dimensional box which encloses the coordinates "
+"of a geometry. It is an efficient way to represent a geometry's extent in "
+"coordinate space and to check whether two geometries interact."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geometry model allows evaluating topological spatial relationships as "
+"described in <xref linkend=\"DE-9IM\"/>. To support this the concepts of "
+"<emphasis role=\"bold\">interior</emphasis>, <emphasis "
+"role=\"bold\">boundary</emphasis> and <emphasis role=\"bold\">exterior</"
+"emphasis> are defined for each geometry type. Geometries are topologically "
+"closed, so they always contain their boundary. The boundary is a geometry of "
+"dimension one less than that of the geometry itself."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The OGC geometry model defines validity rules for each geometry type. These "
+"rules ensure that geometry values represents realistic situations (e.g. it "
+"is possible to specify a polygon with a hole lying outside the shell, but "
+"this makes no sense geometrically and is thus invalid). PostGIS also allows "
+"storing and manipulating invalid geometry values. This allows detecting and "
+"fixing them if needed. See <xref linkend=\"OGC_Validity\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Point"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A Point is a 0-dimensional geometry that represents a single location in "
+"coordinate space."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "LineString"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A LineString is a 1-dimensional line formed by a contiguous sequence of line "
+"segments. Each line segment is defined by two points, with the end point of "
+"one segment forming the start point of the next segment. An OGC-valid "
+"LineString has either zero or two or more points, but PostGIS also allows "
+"single-point LineStrings. LineStrings may cross themselves (self-intersect). "
+"A LineString is <emphasis role=\"bold\">closed</emphasis> if the start and "
+"end points are the same. A LineString is <emphasis role=\"bold\">simple</"
+"emphasis> if it does not self-intersect."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "LinearRing"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A LinearRing is a LineString which is both closed and simple. The first and "
+"last points must be equal, and the line must not self-intersect."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Polygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A Polygon is a 2-dimensional planar region, delimited by an exterior "
+"boundary (the shell) and zero or more interior boundaries (holes). Each "
+"boundary is a <link linkend=\"LinearRing\">LinearRing</link>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "MultiPoint"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A MultiPoint is a collection of Points."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "MultiLineString"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A MultiLineString is a collection of LineStrings. A MultiLineString is "
+"closed if each of its elements is closed."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "MultiPolygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A MultiPolygon is a collection of non-overlapping, non-adjacent Polygons. "
+"Polygons in the collection may touch only at a finite number of points."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "GeometryCollection"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A GeometryCollection is a heterogeneous (mixed) collection of geometries."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "PolyhedralSurface"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A PolyhedralSurface is a contiguous collection of patches or facets which "
+"share some edges. Each patch is a planar Polygon. If the Polygon coordinates "
+"have Z ordinates then the surface is 3-dimensional."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Triangle"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A Triangle is a polygon defined by three distinct non-collinear vertices. "
+"Because a Triangle is a polygon it is specified by four coordinates, with "
+"the first and fourth being equal."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "<title>TIN</title>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A TIN is a collection of non-overlapping <link "
+"linkend=\"Triangle\">Triangle</link>s representing a <link xlink:"
+"href=\"https://en.wikipedia.org/wiki/"
+"Triangulated_irregular_network\">Triangulated Irregular Network</link>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SQL/MM Part 3 - Curves"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <link xlink:href=\"https://www.iso.org/obp/ui/#iso:std:iso-iec:13249:-3:"
+"ed-5:v1:en\"><emphasis>ISO/IEC 13249-3 SQL Multimedia - Spatial</emphasis></"
+"link> standard (SQL/MM) extends the OGC SFA to define Geometry subtypes "
+"containing curves with circular arcs. The SQL/MM types support 3DM, 3DZ and "
+"4D coordinates."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All floating point comparisons within the SQL-MM implementation are "
+"performed to a specified tolerance, currently 1E-8."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "CircularString"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"CircularString is the basic curve type, similar to a LineString in the "
+"linear world. A single arc segment is specified by three points: the start "
+"and end points (first and third) and some other point on the arc. To specify "
+"a closed circle the start and end points are the same and the middle point "
+"is the opposite point on the circle diameter (which is the center of the "
+"arc). In a sequence of arcs the end point of the previous arc is the start "
+"point of the next arc, just like the segments of a LineString. This means "
+"that a CircularString must have an odd number of points greater than 1."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "CompoundCurve"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A CompoundCurve is a single continuous curve that may contain both circular "
+"arc segments and linear segments. That means that in addition to having well-"
+"formed components, the end point of every component (except the last) must "
+"be coincident with the start point of the following component."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "CurvePolygon"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A CurvePolygon is like a polygon, with an outer ring and zero or more inner "
+"rings. The difference is that a ring can be a CircularString or "
+"CompoundCurve as well as a LineString."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "As of PostGIS 1.4 PostGIS supports compound curves in a curve polygon."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Example: A CurvePolygon with the shell defined by a CompoundCurve containing "
+"a CircularString and a LineString, and a hole defined by a CircularString"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "MultiCurve"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A MultiCurve is a collection of curves which can include LineStrings, "
+"CircularStrings or CompoundCurves."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "MultiSurface"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A MultiSurface is a collection of surfaces, which can be (linear) Polygons "
+"or CurvePolygons."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "WKT and WKB"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The OGC SFA specification defines two formats for representing geometry "
+"values for external use: Well-Known Text (WKT) and Well-Known Binary (WKB). "
+"Both WKT and WKB include information about the type of the object and the "
+"coordinates which define it."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Well-Known Text (WKT) provides a standard textual representation of spatial "
+"data. Examples of WKT representations of spatial objects are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT(0 0)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT Z (0 0 0)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT ZM (0 0 0 0)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT EMPTY"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "LINESTRING(0 0,1 1,1 2)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "LINESTRING EMPTY"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "MULTIPOINT((0 0),(1 2))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "MULTIPOINT Z ((0 0 0),(1 2 3))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "MULTIPOINT EMPTY"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 "
+"-2,-2 -1,-1 -1)))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "GEOMETRYCOLLECTION EMPTY"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Input and output of WKT is provided by the functions <xref "
+"linkend=\"ST_AsText\"/> and <xref linkend=\"ST_GeomFromText\"/>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For example, a statement to create and insert a spatial object from WKT and "
+"a SRID is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Well-Known Binary (WKB) provides a portable, full-precision representation "
+"of spatial data as binary data (arrays of bytes). Examples of the WKB "
+"representations of spatial objects are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "WKT: POINT(1 1)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "WKB: 0101000000000000000000F03F000000000000F03"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "WKT: LINESTRING (2 2, 9 9)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"WKB: "
+"0102000000020000000000000000000040000000000000004000000000000022400000000000002240"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Input and output of WKB is provided by the functions <xref "
+"linkend=\"ST_AsBinary\"/> and <xref linkend=\"ST_GeomFromWKB\"/>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For example, a statement to create and insert a spatial object from WKB is:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Geometry Data Type"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS implements the OGC Simple Features model by defining a PostgreSQL "
+"data type called <varname>geometry</varname>. It represents all of the "
+"geometry subtypes by using an internal type code (see <xref "
+"linkend=\"GeometryType\"/> and <xref linkend=\"ST_GeometryType\"/>). This "
+"allows modelling spatial features as rows of tables defined with a column of "
+"type <varname>geometry</varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>geometry</varname> data type is <emphasis>opaque</emphasis>, "
+"which means that all access is done via invoking functions on geometry "
+"values. Functions allow creating geometry objects, accessing or updating all "
+"internal fields, and compute new geometry values. PostGIS supports all the "
+"functions specified in the OGC <link xlink:href=\"https://portal.ogc.org/"
+"files/?artifact_id=25354\"><emphasis>Simple feature access - Part 2: SQL "
+"option</emphasis></link> (SFS) specification, as well many others. See <xref "
+"linkend=\"reference\"/> for the full list of functions."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS follows the SFA standard by prefixing spatial functions with "
+"\"ST_\". This was intended to stand for \"Spatial and Temporal\", but the "
+"temporal part of the standard was never developed. Instead it can be "
+"interpreted as \"Spatial Type\"."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The SFA standard specifies that spatial objects include a Spatial Reference "
+"System identifier (SRID). The SRID is required when creating spatial objects "
+"for insertion into the database (it may be defaulted to 0). See <xref "
+"linkend=\"ST_SRID\"/> and <xref linkend=\"spatial_ref_sys\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To make querying geometry efficient PostGIS defines various kinds of spatial "
+"indexes, and spatial operators to use them. See <xref linkend=\"build-"
+"indexes\"/> and <xref linkend=\"using-query-indexes\"/> for details."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS EWKB and EWKT"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"OGC SFA specifications initially supported only 2D geometries, and the "
+"geometry SRID is not included in the input/output representations. The OGC "
+"SFA specification 1.2.1 (which aligns with the ISO 19125 standard) adds "
+"support for 3D (ZYZ) and measured (XYM and XYZM) coordinates, but still does "
+"not include the SRID value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Because of these limitations PostGIS defined extended EWKB and EWKT formats. "
+"They provide 3D (XYZ and XYM) and 4D (XYZM) coordinate support and include "
+"SRID information. Including all geometry information allows PostGIS to use "
+"EWKB as the format of record (e.g. in DUMP files)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"EWKB and EWKT are used for the \"canonical forms\" of PostGIS data objects. "
+"For input, the canonical form for binary data is EWKB, and for text data "
+"either EWKB or EWKT is accepted. This allows geometry values to be created "
+"by casting a text value in either HEXEWKB or EWKT to a geometry value using "
+"<varname>::geometry</varname>. For output, the canonical form for binary is "
+"EWKB, and for text it is HEXEWKB (hex-encoded EWKB)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For example this statement creates a geometry by casting from an EWKT text "
+"value, and outputs it using the canonical form of HEXEWKB:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "PostGIS EWKT output has a few differences to OGC WKT:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "For 3DZ geometries the Z qualifier is omitted:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "OGC: POINT Z (1 2 3)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "EWKT: POINT (1 2 3)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "For 3DM geometries the M qualifier is included:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "OGC: POINT M (1 2 3)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "EWKT: POINTM (1 2 3)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "For 4D geometries the ZM qualifier is omitted:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "OGC: POINT ZM (1 2 3 4)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "EWKT: POINT (1 2 3 4)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"EWKT avoids over-specifying dimensionality and the inconsistencies that can "
+"occur with the OGC/ISO format, such as:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT ZM (1 1)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT ZM (1 1 1)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT (1 1 1 1)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS extended formats are currently a superset of the OGC ones, so that "
+"every valid OGC WKB/WKT is also valid EWKB/EWKT. However, this might vary in "
+"the future, if the OGC extends a format in a way that conflicts with the "
+"PosGIS definition. Thus you SHOULD NOT rely on this compatibility!"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Examples of the EWKT text representation of spatial objects are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT(0 0 0) -- XYZ"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "SRID=32632;POINT(0 0) -- XY with SRID"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINTM(0 0 0) -- XYM"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "POINT(0 0 0 0) -- XYZM"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "SRID=4326;MULTIPOINTM(0 0 0,1 2 1) -- XYM with SRID"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "MULTILINESTRING((0 0 0,1 1 0,1 2 1),(2 3 1,3 2 1,5 4 1))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"POLYGON((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0),(1 1 0,2 1 0,2 2 0,1 2 0,1 1 0))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"MULTIPOLYGON(((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0),(1 1 0,2 1 0,2 2 0,1 2 0,1 1 "
+"0)),((-1 -1 0,-1 -2 0,-2 -2 0,-2 -1 0,-1 -1 0)))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "GEOMETRYCOLLECTIONM( POINTM(2 3 9), LINESTRINGM(2 3 4, 3 4 5) )"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "MULTICURVE( (0 0, 5 5), CIRCULARSTRING(4 0, 4 4, 8 4) )"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 "
+"1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), ((1 1 0, 1 1 1, "
+"1 0 1, 1 0 0, 1 1 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 "
+"1, 1 1 1, 0 1 1, 0 0 1)) )"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "TRIANGLE ((0 0, 0 10, 10 0, 0 0))"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "TIN( ((0 0 0, 0 0 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 0 0 0)) )"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Input and output using these formats is available using the following "
+"functions:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For example, a statement to create and insert a PostGIS spatial object using "
+"EWKT is:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Geography Data Type"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS <varname>geography</varname> data type provides native support "
+"for spatial features represented on \"geographic\" coordinates (sometimes "
+"called \"geodetic\" coordinates, or \"lat/lon\", or \"lon/lat\"). Geographic "
+"coordinates are spherical coordinates expressed in angular units (degrees)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The basis for the PostGIS geometry data type is a plane. The shortest path "
+"between two points on the plane is a straight line. That means functions on "
+"geometries (areas, distances, lengths, intersections, etc) are calculated "
+"using straight line vectors and cartesian mathematics. This makes them "
+"simpler to implement and faster to execute, but also makes them inaccurate "
+"for data on the spheroidal surface of the earth."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS geography data type is based on a spherical model. The shortest "
+"path between two points on the sphere is a great circle arc. Functions on "
+"geographies (areas, distances, lengths, intersections, etc) are calculated "
+"using arcs on the sphere. By taking the spheroidal shape of the world into "
+"account, the functions provide more accurate results."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Because the underlying mathematics is more complicated, there are fewer "
+"functions defined for the geography type than for the geometry type. Over "
+"time, as new algorithms are added the capabilities of the geography type "
+"will expand. As a workaround one can convert back and forth between geometry "
+"and geography types."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Like the geometry data type, geography data is associated with a spatial "
+"reference system via a spatial reference system identifier (SRID). Any "
+"geodetic (long/lat based) spatial reference system defined in the "
+"<varname>spatial_ref_sys</varname> table can be used. (Prior to PostGIS 2.2, "
+"the geography type supported only WGS 84 geodetic (SRID:4326)). You can add "
+"your own custom geodetic spatial reference system as described in <xref "
+"linkend=\"user-spatial-ref-sys\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For all spatial reference systems the units returned by measurement "
+"functions (e.g. <xref linkend=\"ST_Distance\"/>, <xref linkend=\"ST_Length\"/"
+">, <xref linkend=\"ST_Perimeter\"/>, <xref linkend=\"ST_Area\"/>) and for "
+"the distance argument of <xref linkend=\"ST_DWithin\"/> are in meters."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Creating Geography Tables"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can create a table to store geography data using the <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/sql-createtable.html\">CREATE "
+"TABLE</link> SQL statement with a column of type <varname>geography</"
+"varname>. The following example creates a table with a geography column "
+"storing 2D LineStrings in the WGS84 geodetic coordinate system (SRID 4326):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The geography type supports two optional type modifiers:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the spatial type modifier restricts the kind of shapes and dimensions "
+"allowed in the column. Values allowed for the spatial type are: POINT, "
+"LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, "
+"GEOMETRYCOLLECTION. The geography type does not support curves, TINS, or "
+"POLYHEDRALSURFACEs. The modifier supports coordinate dimensionality "
+"restrictions by adding suffixes: Z, M and ZM. For example, a modifier of "
+"'LINESTRINGM' only allows linestrings with three dimensions, and treats the "
+"third dimension as a measure. Similarly, 'POINTZM' requires four dimensional "
+"(XYZM) data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the SRID modifier restricts the spatial reference system SRID to a "
+"particular number. If omitted, the SRID defaults to 4326 (WGS84 geodetic), "
+"and all calculations are performed using WGS84."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Examples of creating tables with geography columns:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a table with 2D POINT geography with the default SRID 4326 (WGS84 "
+"long/lat):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a table with 2D POINT geography in NAD83 longlat:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a table with 3D (XYZ) POINTs and an explicit SRID of 4326:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a table with 2D LINESTRING geography with the default SRID 4326:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a table with 2D POLYGON geography with the SRID 4267 (NAD 1927 long "
+"lat):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geography fields are registered in the <varname>geography_columns</varname> "
+"system view. You can query the <varname>geography_columns</varname> view and "
+"see that the table is listed:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creating a spatial index works the same as for geometry columns. PostGIS "
+"will note that the column type is GEOGRAPHY and create an appropriate sphere-"
+"based index instead of the usual planar index used for GEOMETRY."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using Geography Tables"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can insert data into geography tables in the same way as geometry. "
+"Geometry data will autocast to the geography type if it has SRID 4326. The "
+"<link linkend=\"EWKB_EWKT\">EWKT and EWKB</link> formats can also be used to "
+"specify geography values."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Any geodetic (long/lat) spatial reference system listed in "
+"<varname>spatial_ref_sys</varname> table may be specified as a geography "
+"SRID. Non-geodetic coordinate systems raise an error if used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Query and measurement functions use units of meters. So distance parameters "
+"should be expressed in meters, and return values should be expected in "
+"meters (or square meters for areas)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can see the power of geography in action by calculating how close a "
+"plane flying a great circle route from Seattle to London (LINESTRING(-122.33 "
+"47.606, 0.0 51.5)) comes to Reykjavik (POINT(-21.96 64.15)) (<link xlink:"
+"href=\"http://gc.kls2.com/cgi-bin/gc?PATH=SEA-LHR\">map the route</link>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geography type calculates the true shortest distance of 122.235 km over "
+"the sphere between Reykjavik and the great circle flight path between "
+"Seattle and London."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geometry type calculates a meaningless cartesian distance between "
+"Reykjavik and the straight line path from Seattle to London plotted on a "
+"flat map of the world. The nominal units of the result is \"degrees\", but "
+"the result doesn't correspond to any true angular difference between the "
+"points, so even calling them \"degrees\" is inaccurate."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "When to use the Geography data type"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The geography data type allows you to store data in longitude/latitude "
+"coordinates, but at a cost: there are fewer functions defined on GEOGRAPHY "
+"than there are on GEOMETRY; those functions that are defined take more CPU "
+"time to execute."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The data type you choose should be determined by the expected working area "
+"of the application you are building. Will your data span the globe or a "
+"large continental area, or is it local to a state, county or municipality?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If your data is contained in a small area, you might find that choosing an "
+"appropriate projection and using GEOMETRY is the best solution, in terms of "
+"performance and functionality available."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If your data is global or covers a continental region, you may find that "
+"GEOGRAPHY allows you to build a system without having to worry about "
+"projection details. You store your data in longitude/latitude, and use the "
+"functions that have been defined on GEOGRAPHY."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you don't understand projections, and you don't want to learn about them, "
+"and you're prepared to accept the limitations in functionality available in "
+"GEOGRAPHY, then it might be easier for you to use GEOGRAPHY than GEOMETRY. "
+"Simply load your data up as longitude/latitude and go from there."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Refer to <xref linkend=\"PostGIS_TypeFunctionMatrix\"/> for compare between "
+"what is supported for Geography vs. Geometry. For a brief listing and "
+"description of Geography functions, refer to <xref "
+"linkend=\"PostGIS_GeographyFunctions\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Geography Advanced FAQ"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Do you calculate on the sphere or the spheroid?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default, all distance and area calculations are done on the spheroid. You "
+"should find that the results of calculations in local areas match up will "
+"with local planar results in good local projections. Over larger areas, the "
+"spheroidal calculations will be more accurate than any calculation done on a "
+"projected plane."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All the geography functions have the option of using a sphere calculation, "
+"by setting a final boolean parameter to 'FALSE'. This will somewhat speed up "
+"calculations, particularly for cases where the geometries are very simple."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What about the date-line and the poles?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"All the calculations have no conception of date-line or poles, the "
+"coordinates are spherical (longitude/latitude) so a shape that crosses the "
+"dateline is, from a calculation point of view, no different from any other "
+"shape."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What is the longest arc you can process?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"We use great circle arcs as the \"interpolation line\" between two points. "
+"That means any two points are actually joined up two ways, depending on "
+"which direction you travel along the great circle. All our code assumes that "
+"the points are joined by the *shorter* of the two paths along the great "
+"circle. As a consequence, shapes that have arcs of more than 180 degrees "
+"will not be correctly modelled."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Why is it so slow to calculate the area of Europe / Russia / insert big "
+"geographic region here ?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Because the polygon is so darned huge! Big areas are bad for two reasons: "
+"their bounds are huge, so the index tends to pull the feature no matter what "
+"query you run; the number of vertices is huge, and tests (distance, "
+"containment) have to traverse the vertex list at least once and sometimes N "
+"times (with N being the number of vertices in the other candidate feature)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As with GEOMETRY, we recommend that when you have very large polygons, but "
+"are doing queries in small areas, you \"denormalize\" your geometric data "
+"into smaller chunks so that the index can effectively subquery parts of the "
+"object and so queries don't have to pull out the whole object every time. "
+"Please consult <xref linkend=\"ST_Subdivide\"/> function documentation. Just "
+"because you *can* store all of Europe in one polygon doesn't mean you "
+"*should*."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS is compliant with the Open Geospatial Consortium’s (OGC) Simple "
+"Features specification. That standard defines the concepts of geometry being "
+"<emphasis>simple</emphasis> and <emphasis>valid</emphasis>. These "
+"definitions allow the Simple Features geometry model to represent spatial "
+"objects in a consistent and unambiguous way that supports efficient "
+"computation. (Note: the OGC SF and SQL/MM have the same definitions for "
+"simple and valid.)"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Simple Geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <emphasis>simple</emphasis> geometry is one that has no anomalous "
+"geometric points, such as self intersection or self tangency."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <varname>POINT</varname> is inherently <emphasis>simple</emphasis> as a 0-"
+"dimensional geometry object."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>MULTIPOINT</varname>s are <emphasis>simple</emphasis> if no two "
+"coordinates (<varname>POINT</varname>s) are equal (have identical coordinate "
+"values)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <varname>LINESTRING</varname> is <emphasis>simple</emphasis> if it does "
+"not pass through the same point twice, except for the endpoints. If the "
+"endpoints of a simple LineString are identical it is called "
+"<emphasis>closed</emphasis> and referred to as a Linear Ring."
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">(a)</emphasis> and <emphasis role=\"bold\">(c)</"
+"emphasis> are simple <varname>LINESTRING</varname>s. <emphasis "
+"role=\"bold\">(b)</emphasis> and <emphasis role=\"bold\">(d)</emphasis> are "
+"not simple. <emphasis role=\"bold\">(c)</emphasis> is a closed Linear Ring."
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(a)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(b)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(c)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(d)</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <varname>MULTILINESTRING</varname> is <emphasis>simple</emphasis> only if "
+"all of its elements are simple and the only intersection between any two "
+"elements occurs at points that are on the boundaries of both elements."
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">(e)</emphasis> and <emphasis role=\"bold\">(f)</"
+"emphasis> are simple <varname>MULTILINESTRING</varname>s. <emphasis "
+"role=\"bold\">(g)</emphasis> is not simple."
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(e)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(f)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(g)</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>POLYGON</varname>s are formed from linear rings, so valid polygonal "
+"geometry is always <emphasis>simple</emphasis>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test if a geometry is simple use the <xref linkend=\"ST_IsSimple\"/> "
+"function:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generally, PostGIS functions do not require geometric arguments to be "
+"simple. Simplicity is primarily used as a basis for defining geometric "
+"validity. It is also a requirement for some kinds of spatial data models "
+"(for example, linear networks often disallow lines that cross). Multipoint "
+"and linear geometry can be made simple using <xref linkend=\"ST_UnaryUnion\"/"
+">."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Valid Geometry"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Geometry validity primarily applies to 2-dimensional geometries "
+"(<varname>POLYGON</varname>s and <varname>MULTIPOLYGON</varname>s) . "
+"Validity is defined by rules that allow polygonal geometry to model planar "
+"areas unambiguously."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A <varname>POLYGON</varname> is <emphasis>valid</emphasis> if:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the polygon boundary rings (the exterior shell ring and interior hole rings) "
+"are <emphasis>simple</emphasis> (do not cross or self-touch). Because of "
+"this a polygon cannot have cut lines, spikes or loops. This implies that "
+"polygon holes must be represented as interior rings, rather than by the "
+"exterior ring self-touching (a so-called \"inverted hole\")."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "boundary rings do not cross"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"boundary rings may touch at points but only as a tangent (i.e. not in a line)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "interior rings are contained in the exterior ring"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the polygon interior is simply connected (i.e. the rings must not touch in a "
+"way that splits the polygon into more than one part)"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">(h)</emphasis> and <emphasis role=\"bold\">(i)</"
+"emphasis> are valid <varname>POLYGON</varname>s. <emphasis role=\"bold\">(j-"
+"m)</emphasis> are invalid. <emphasis role=\"bold\">(j)</emphasis> can be "
+"represented as a valid <varname>MULTIPOLYGON</varname>."
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(h)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(i)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(j)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(k)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(l)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(m)</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A <varname>MULTIPOLYGON</varname> is <emphasis>valid</emphasis> if:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "its element <varname>POLYGON</varname>s are valid"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "elements do not overlap (i.e. their interiors must not intersect)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "elements touch only at points (i.e. not along a line)"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">(n)</emphasis> is a valid <varname>MULTIPOLYGON</"
+"varname>. <emphasis role=\"bold\">(o)</emphasis> and <emphasis "
+"role=\"bold\">(p)</emphasis> are invalid."
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(n)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(o)</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis>(p)</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These rules mean that valid polygonal geometry is also <emphasis>simple</"
+"emphasis>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For linear geometry the only validity rule is that <varname>LINESTRING</"
+"varname>s must have at least two points and have non-zero length (or "
+"equivalently, have at least two distinct points.) Note that non-simple (self-"
+"intersecting) lines are valid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>POINT</varname> and <varname>MULTIPOINT</varname> geometries have "
+"no validity rules."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Managing Validity"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS allows creating and storing both valid and invalid Geometry. This "
+"allows invalid geometry to be detected and flagged or fixed. There are also "
+"situations where the OGC validity rules are stricter than desired (examples "
+"of this are zero-length linestrings and polygons with inverted holes.)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Many of the functions provided by PostGIS rely on the assumption that "
+"geometry arguments are valid. For example, it does not make sense to "
+"calculate the area of a polygon that has a hole defined outside of the "
+"polygon, or to construct a polygon from a non-simple boundary line. Assuming "
+"valid geometric inputs allows functions to operate more efficiently, since "
+"they do not need to check for topological correctness. (Notable exceptions "
+"are that zero-length lines and polygons with inversions are generally "
+"handled correctly.) Also, most PostGIS functions produce valid geometry "
+"output if the inputs are valid. This allows PostGIS functions to be chained "
+"together safely."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you encounter unexpected error messages when calling PostGIS functions "
+"(such as \"GEOS Intersection() threw an error!\"), you should first confirm "
+"that the function arguments are valid. If they are not, then consider using "
+"one of the techniques below to ensure the data you are processing is valid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If a function reports an error with valid inputs, then you may have found an "
+"error in either PostGIS or one of the libraries it uses, and you should "
+"report this to the PostGIS project. The same is true if a PostGIS function "
+"returns an invalid geometry for valid input."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test if a geometry is valid use the <xref linkend=\"ST_IsValid\"/> "
+"function:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Information about the nature and location of an geometry invalidity are "
+"provided by the <xref linkend=\"ST_IsValidDetail\"/> function:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In some situations it is desirable to correct invalid geometry "
+"automatically. Use the <xref linkend=\"ST_MakeValid\"/> function to do this. "
+"(<code>ST_MakeValid</code> is a case of a spatial function that "
+"<emphasis>does</emphasis> allow invalid input!)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"By default, PostGIS does not check for validity when loading geometry, "
+"because validity testing can take a lot of CPU time for complex geometries. "
+"If you do not trust your data sources, you can enforce a validity check on "
+"your tables by adding a check constraint:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Reference Systems"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <link xlink:href=\"https://en.wikipedia.org/wiki/"
+"Spatial_reference_system\">Spatial Reference System</link> (SRS) (also "
+"called a Coordinate Reference System (CRS)) defines how geometry is "
+"referenced to locations on the Earth's surface. There are three types of SRS:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <emphasis role=\"bold\">geodetic</emphasis> SRS uses angular coordinates "
+"(longitude and latitude) which map directly to the surface of the earth."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <emphasis role=\"bold\">projected</emphasis> SRS uses a mathematical "
+"projection transformation to \"flatten\" the surface of the spheroidal earth "
+"onto a plane. It assigns location coordinates in a way that allows direct "
+"measurement of quantities such as distance, area, and angle. The coordinate "
+"system is Cartesian, which means it has a defined origin point and two "
+"perpendicular axes (usually oriented North and East). Each projected SRS "
+"uses a stated length unit (usually metres or feet). A projected SRS may be "
+"limited in its area of applicability to avoid distortion and fit within the "
+"defined coordinate bounds."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A <emphasis role=\"bold\">local</emphasis> SRS is a Cartesian coordinate "
+"system which is not referenced to the earth's surface. In PostGIS this is "
+"specified by a SRID value of 0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are many different spatial reference systems in use. Common SRSes are "
+"standardized in the European Petroleum Survey Group <link xlink:"
+"href=\"http://www.epsg.org/\">EPSG database</link>. For convenience PostGIS "
+"(and many other spatial systems) refers to SRS definitions using an integer "
+"identifier called a SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A geometry is associated with a Spatial Reference System by its SRID value, "
+"which is accessed by <xref linkend=\"ST_SRID\"/>. The SRID for a geometry "
+"can be assigned using <xref linkend=\"ST_SetSRID\"/>. Some geometry "
+"constructor functions allow supplying a SRID (such as <xref "
+"linkend=\"ST_Point\"/> and <xref linkend=\"ST_MakeEnvelope\"/>). The <link "
+"linkend=\"EWKB_EWKT\">EWKT</link> format supports SRIDs with the "
+"<code>SRID=n;</code> prefix."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial functions processing pairs of geometries (such as <link "
+"linkend=\"Overlay_Functions\">overlay</link> and <link "
+"linkend=\"Spatial_Relationships\">relationship</link> functions) require "
+"that the input geometries are in the same spatial reference system (have the "
+"same SRID). Geometry data can be transformed into a different spatial "
+"reference system using <xref linkend=\"ST_Transform\"/> and <xref "
+"linkend=\"ST_TransformPipeline\"/>. Geometry returned from functions has the "
+"same SRS as the input geometries."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SPATIAL_REF_SYS Table"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>SPATIAL_REF_SYS</varname> table used by PostGIS is an OGC-"
+"compliant database table that defines the available spatial reference "
+"systems. It holds the numeric SRIDs and textual descriptions of the "
+"coordinate systems."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The <varname>spatial_ref_sys</varname> table definition is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The columns are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An integer code that uniquely identifies the <link xlink:href=\"http://en."
+"wikipedia.org/wiki/SRID\">Spatial Reference System</link> (SRS) within the "
+"database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The name of the standard or standards body that is being cited for this "
+"reference system. For example, \"EPSG\" is a valid <varname>auth_name</"
+"varname>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The ID of the Spatial Reference System as defined by the Authority cited in "
+"the <varname>auth_name</varname>. In the case of EPSG, this is the EPSG code."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The Well-Known Text representation of the Spatial Reference System. An "
+"example of a WKT SRS representation is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For a discussion of SRS WKT, see the OGC standard <link xlink:href=\"http://"
+"docs.opengeospatial.org/is/12-063r5/12-063r5.html\">Well-known text "
+"representation of coordinate reference systems</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"PostGIS uses the PROJ library to provide coordinate transformation "
+"capabilities. The <varname>proj4text</varname> column contains the PROJ "
+"coordinate definition string for a particular SRID. For example:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information see the <link xlink:href=\"https://proj.org/\">PROJ web "
+"site</link>. The <filename>spatial_ref_sys.sql</filename> file contains both "
+"<varname>srtext</varname> and <varname>proj4text</varname> definitions for "
+"all EPSG projections."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When retrieving spatial reference system definitions for use in "
+"transformations, PostGIS uses fhe following strategy:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>auth_name</varname> and <varname>auth_srid</varname> are present "
+"(non-NULL) use the PROJ SRS based on those entries (if one exists)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>srtext</varname> is present create a SRS using it, if possible."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <varname>proj4text</varname> is present create a SRS using it, if "
+"possible."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "User-Defined Spatial Reference Systems"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The PostGIS <varname>spatial_ref_sys</varname> table contains over 3000 of "
+"the most common spatial reference system definitions that are handled by the "
+"<link xlink:href=\"https://proj.org\">PROJ</link> projection library. But "
+"there are many coordinate systems that it does not contain. You can add SRS "
+"definitions to the table if you have the required information about the "
+"spatial reference system. Or, you can define your own custom spatial "
+"reference system if you are familiar with PROJ constructs. Keep in mind that "
+"most spatial reference systems are regional and have no meaning when used "
+"outside of the bounds they were intended for."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A resource for finding spatial reference systems not defined in the core set "
+"is <link xlink:href=\"http://spatialreference.org/\">http://spatialreference."
+"org/</link>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Some commonly used spatial reference systems are: <link xlink:href=\"http://"
+"spatialreference.org/ref/epsg/4326/\">4326 - WGS 84 Long Lat</link>, <link "
+"xlink:href=\"http://spatialreference.org/ref/epsg/4269/\">4269 - NAD 83 Long "
+"Lat</link>, <link xlink:href=\"http://spatialreference.org/ref/epsg/3395/"
+"\">3395 - WGS 84 World Mercator</link>, <link xlink:href=\"http://"
+"spatialreference.org/ref/epsg/2163/\">2163 - US National Atlas Equal Area</"
+"link>, and the 60 WGS84 UTM zones. UTM zones are one of the most ideal for "
+"measurement, but only cover 6-degree regions. (To determine which UTM zone "
+"to use for your area of interest, see the <link xlink:href=\"http://trac."
+"osgeo.org/postgis/wiki/UsersWikiplpgsqlfunctionsDistance\">utmzone PostGIS "
+"plpgsql helper function</link>.)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"US states use State Plane spatial reference systems (meter or feet based) - "
+"usually one or 2 exists per state. Most of the meter-based ones are in the "
+"core set, but many of the feet-based ones or ESRI-created ones will need to "
+"be copied from <link xlink:href=\"http://spatialreference."
+"org\">spatialreference.org</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can even define non-Earth-based coordinate systems, such as <link xlink:"
+"href=\"http://spatialreference.org/ref/iau2000/mars-2000/\">Mars 2000</link> "
+"This Mars coordinate system is non-planar (it's in degrees spheroidal), but "
+"you can use it with the <varname>geography</varname> type to obtain length "
+"and proximity measurements in meters instead of degrees."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Here is an example of loading a custom coordinate system using an unassigned "
+"SRID and the PROJ definition for a US-centric Lambert Conformal projection:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Tables"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Creating a Spatial Table"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can create a table to store geometry data using the <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/sql-createtable.html\">CREATE "
+"TABLE</link> SQL statement with a column of type <varname>geometry</"
+"varname>. The following example creates a table with a geometry column "
+"storing 2D (XY) LineStrings in the BC-Albers coordinate system (SRID 3005):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>geometry</varname> type supports two optional <emphasis "
+"role=\"bold\">type modifiers</emphasis>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the <emphasis role=\"bold\">spatial type modifier</emphasis> restricts the "
+"kind of shapes and dimensions allowed in the column. The value can be any of "
+"the supported <link linkend=\"RefObject\">geometry subtypes</link> (e.g. "
+"POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, "
+"GEOMETRYCOLLECTION, etc). The modifier supports coordinate dimensionality "
+"restrictions by adding suffixes: Z, M and ZM. For example, a modifier of "
+"'LINESTRINGM' allows only linestrings with three dimensions, and treats the "
+"third dimension as a measure. Similarly, 'POINTZM' requires four dimensional "
+"(XYZM) data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"the <emphasis role=\"bold\">SRID modifier</emphasis> restricts the <link "
+"linkend=\"spatial_ref_sys\">spatial reference system</link> SRID to a "
+"particular number. If omitted, the SRID defaults to 0."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Examples of creating tables with geometry columns:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a table holding any kind of geometry with the default SRID:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a table with 2D POINT geometry with the default SRID:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a table with 3D (XYZ) POINTs and an explicit SRID of 3005:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a table with 4D (XYZM) LINESTRING geometry with the default SRID:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a table with 2D POLYGON geometry with the SRID 4267 (NAD 1927 long "
+"lat):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"It is possible to have more than one geometry column in a table. This can be "
+"specified when the table is created, or a column can be added using the "
+"<link xlink:href=\"https://www.postgresql.org/docs/current/sql-altertable."
+"html\">ALTER TABLE</link> SQL statement. This example adds a column that can "
+"hold 3D LineStrings:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "GEOMETRY_COLUMNS View"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The OGC <emphasis>Simple Features Specification for SQL</emphasis> defines "
+"the <varname>GEOMETRY_COLUMNS</varname> metadata table to describe geometry "
+"table structure. In PostGIS <varname>geometry_columns</varname> is a view "
+"reading from database system catalog tables. This ensures that the spatial "
+"metadata information is always consistent with the currently defined tables "
+"and views. The view structure is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The fully qualified name of the feature table containing the geometry "
+"column. There is no PostgreSQL analogue of \"catalog\" so that column is "
+"left blank. For \"schema\" the PostgreSQL schema name is used "
+"(<varname>public</varname> is the default)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The name of the geometry column in the feature table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The coordinate dimension (2, 3 or 4) of the column."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The ID of the spatial reference system used for the coordinate geometry in "
+"this table. It is a foreign key reference to the <varname>spatial_ref_sys</"
+"varname> table (see <xref linkend=\"spatial_ref_sys_table\"/>)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The type of the spatial object. To restrict the spatial column to a single "
+"type, use one of: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, "
+"MULTIPOLYGON, GEOMETRYCOLLECTION or corresponding XYM versions POINTM, "
+"LINESTRINGM, POLYGONM, MULTIPOINTM, MULTILINESTRINGM, MULTIPOLYGONM, "
+"GEOMETRYCOLLECTIONM. For heterogeneous (mixed-type) collections, you can use "
+"\"GEOMETRY\" as the type."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Manually Registering Geometry Columns"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Two of the cases where you may need this are the case of SQL Views and bulk "
+"inserts. For bulk insert case, you can correct the registration in the "
+"geometry_columns table by constraining the column or doing an alter table. "
+"For views, you could expose using a CAST operation. Note, if your column is "
+"typmod based, the creation process would register it correctly, so no need "
+"to do anything. Also views that have no spatial function applied to the "
+"geometry will register the same as the underlying table geometry column."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Although the old-constraint based method is still supported, a constraint-"
+"based geometry column used directly in a view, will not register correctly "
+"in geometry_columns, as will a typmod one. In this example we define a "
+"column using typmod and another using constraints."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "If we run in psql"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"We observe they are defined differently -- one is typmod, one is constraint"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "In geometry_columns, they both register correctly"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "However -- if we were to create a view like this"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The typmod based geom view column registers correctly, but the constraint "
+"based one does not."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This may change in future versions of PostGIS, but for now to force the "
+"constraint-based view column to register correctly, you need to do this:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Loading Spatial Data"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you have created a spatial table, you are ready to upload spatial data "
+"to the database. There are two built-in ways to get spatial data into a "
+"PostGIS/PostgreSQL database: using formatted SQL statements or using the "
+"Shapefile loader."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using SQL to Load Data"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If spatial data can be converted to a text representation (as either WKT or "
+"WKB), then using SQL might be the easiest way to get data into PostGIS. Data "
+"can be bulk-loaded into PostGIS/PostgreSQL by loading a text file of SQL "
+"<code>INSERT</code> statements using the <code>psql</code> SQL utility."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A SQL load file (<filename>roads.sql</filename> for example) might look like "
+"this:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The SQL file can be loaded into PostgreSQL using <code>psql</code>:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using the Shapefile Loader"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <filename>shp2pgsql</filename> data loader converts Shapefiles into SQL "
+"suitable for insertion into a PostGIS/PostgreSQL database either in geometry "
+"or geography format. The loader has several operating modes selected by "
+"command line flags."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There is also a <filename>shp2pgsql-gui</filename> graphical interface with "
+"most of the options as the command-line loader. This may be easier to use "
+"for one-off non-scripted loading or if you are new to PostGIS. It can also "
+"be configured as a plugin to PgAdminIII."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "(c|a|d|p) These are mutually exclusive options:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates a new table and populates it from the Shapefile. <emphasis>This is "
+"the default mode.</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Appends data from the Shapefile into the database table. Note that to use "
+"this option to load multiple files, the files must have the same attributes "
+"and same data types."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Drops the database table before creating a new table with the data in the "
+"Shapefile."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Only produces the table creation SQL code, without adding any actual data. "
+"This can be used if you need to completely separate the table creation and "
+"data loading steps."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Display help screen."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use the PostgreSQL \"dump\" format for the output data. This can be combined "
+"with -a, -c and -d. It is much faster to load than the default \"insert\" "
+"SQL format. Use this for very large data sets."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Creates and populates the geometry tables with the specified SRID. "
+"Optionally specifies that the input shapefile uses the given FROM_SRID, in "
+"which case the geometries will be reprojected to the target SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Keep identifiers' case (column, schema and attributes). Note that attributes "
+"in Shapefile are all UPPERCASE."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Coerce all integers to standard 32-bit integers, do not create 64-bit "
+"bigints, even if the DBF header signature appears to warrant it."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a GiST index on the geometry column."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"-m <filename>a_file_name</filename> Specify a file containing a set of "
+"mappings of (long) column names to 10 character DBF column names. The "
+"content of the file is one or more lines of two names separated by white "
+"space and no trailing or leading space. For example:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Generate simple geometries instead of MULTI geometries. Will only succeed if "
+"all the geometries are actually single (I.E. a MULTIPOLYGON with a single "
+"shell, or or a MULTIPOINT with a single vertex)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Force the output geometry to have the specified dimensionality. Use the "
+"following strings to indicate the dimensionality: 2D, 3DZ, 3DM, 4D."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the input has fewer dimensions that specified, the output will have those "
+"dimensions filled in with zeroes. If the input has more dimensions that "
+"specified, the unwanted dimensions will be stripped."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Output WKT format, instead of WKB. Note that this can introduce coordinate "
+"drifts due to loss of precision."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Execute each statement on its own, without using a transaction. This allows "
+"loading of the majority of good data when there are some bad geometries that "
+"generate errors. Note that this cannot be used with the -D flag as the "
+"\"dump\" format always uses a transaction."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Specify encoding of the input data (dbf file). When used, all attributes of "
+"the dbf are converted from the specified encoding to UTF8. The resulting SQL "
+"output will contain a <code>SET CLIENT_ENCODING to UTF8</code> command, so "
+"that the backend will be able to reconvert from UTF8 to whatever encoding "
+"the database is configured to use internally."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "NULL geometries handling policy (insert*,skip,abort)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"-n Only import DBF file. If your data has no corresponding shapefile, it "
+"will automatically switch to this mode and load just the dbf. So setting "
+"this flag is only needed if you have a full shapefile set, and you only want "
+"the attribute data and no geometry."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use geography type instead of geometry (requires lon/lat data) in WGS84 long "
+"lat (SRID=4326)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Specify the tablespace for the new table. Indexes will still use the default "
+"tablespace unless the -X parameter is also used. The PostgreSQL "
+"documentation has a good description on when to use custom tablespaces."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Specify the tablespace for the new table's indexes. This applies to the "
+"primary key index, and the GIST spatial index if -I is also used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When used, this flag will prevent the generation of <code>ANALYZE</code> "
+"statements. Without the -Z flag (default behavior), the <code>ANALYZE</code> "
+"statements will be generated."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An example session using the loader to create an input file and loading it "
+"might look like this:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A conversion and load can be done in one step using UNIX pipes:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Extracting Spatial Data"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial data can be extracted from the database using either SQL or the "
+"Shapefile dumper. The section on SQL presents some of the functions "
+"available to do comparisons and queries on spatial tables."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using SQL to Extract Data"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The most straightforward way of extracting spatial data out of the database "
+"is to use a SQL <code>SELECT</code> query to define the data set to be "
+"extracted and dump the resulting columns into a parsable text file:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There will be times when some kind of restriction is necessary to cut down "
+"the number of records returned. In the case of attribute-based restrictions, "
+"use the same SQL syntax as used with a non-spatial table. In the case of "
+"spatial restrictions, the following functions are useful:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function tells whether two geometries share any space."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This tests whether two geometries are geometrically identical. For example, "
+"if 'POLYGON((0 0,1 1,1 0,0 0))' is the same as 'POLYGON((0 0,1 1,1 0,0 "
+"0))' (it is)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Next, you can use these operators in queries. Note that when specifying "
+"geometries and boxes on the SQL command line, you must explicitly turn the "
+"string representations into geometries function. The 312 is a fictitious "
+"spatial reference system that matches our data. So, for example:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above query would return the single record from the \"ROADS_GEOM\" table "
+"in which the geometry was equal to that value."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To check whether some of the roads passes in the area defined by a polygon:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The most common spatial query will probably be a \"frame-based\" query, used "
+"by client software, like data browsers and web mappers, to grab a \"map "
+"frame\" worth of data for display."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When using the \"&&\" operator, you can specify either a BOX3D as "
+"the comparison feature or a GEOMETRY. When you specify a GEOMETRY, however, "
+"its bounding box will be used for the comparison."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Using a \"BOX3D\" object for the frame, such a query looks like this:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note the use of the SRID 312, to specify the projection of the envelope."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using the Shapefile Dumper"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <filename>pgsql2shp</filename> table dumper connects to the database and "
+"converts a table (possibly defined by a query) into a shape file. The basic "
+"syntax is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The commandline options are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Write the output to a particular filename."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The database host to connect to."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The port to connect to on the database host."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The password to use when connecting to the database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The username to use when connecting to the database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the case of tables with multiple geometry columns, the geometry column to "
+"use when writing the shape file."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use a binary cursor. This will make the operation faster, but will not work "
+"if any NON-geometry attribute in the table lacks a cast to text."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Raw mode. Do not drop the <varname>gid</varname> field, or escape column "
+"names."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Remap identifiers to ten character names. The content of the file is lines "
+"of two symbols separated by a single white space and no trailing or leading "
+"space: VERYLONGSYMBOL SHORTONE ANOTHERVERYLONGSYMBOL SHORTER etc."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Indexes"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial indexes make using a spatial database for large data sets possible. "
+"Without indexing, a search for features requires a sequential scan of every "
+"record in the database. Indexing speeds up searching by organizing the data "
+"into a structure which can be quickly traversed to find matching records."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The B-tree index method commonly used for attribute data is not very useful "
+"for spatial data, since it only supports storing and querying data in a "
+"single dimension. Data such as geometry (which has 2 or more dimensions) "
+"requires an index method that supports range query across all the data "
+"dimensions. One of the key advantages of PostgreSQL for spatial data "
+"handling is that it offers several kinds of index methods which work well "
+"for multi-dimensional data: GiST, BRIN and SP-GiST indexes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">GiST (Generalized Search Tree)</emphasis> indexes "
+"break up data into \"things to one side\", \"things which overlap\", "
+"\"things which are inside\" and can be used on a wide range of data-types, "
+"including GIS data. PostGIS uses an R-Tree index implemented on top of GiST "
+"to index spatial data. GiST is the most commonly-used and versatile spatial "
+"index method, and offers very good query performance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">BRIN (Block Range Index)</emphasis> indexes operate "
+"by summarizing the spatial extent of ranges of table records. Search is done "
+"via a scan of the ranges. BRIN is only appropriate for use for some kinds of "
+"data (spatially sorted, with infrequent or no update). But it provides much "
+"faster index create time, and much smaller index size."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis role=\"bold\">SP-GiST (Space-Partitioned Generalized Search Tree)</"
+"emphasis> is a generic index method that supports partitioned search trees "
+"such as quad-trees, k-d trees, and radix trees (tries)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial indexes store only the bounding box of geometries. Spatial queries "
+"use the index as a <emphasis role=\"bold\">primary filter</emphasis> to "
+"quickly determine a set of geometries potentially matching the query "
+"condition. Most spatial queries require a <emphasis role=\"bold\">secondary "
+"filter</emphasis> that uses a spatial predicate function to test a more "
+"specific spatial condition. For more information on queying with spatial "
+"predicates see <xref linkend=\"using-query-indexes\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"See also the <link xlink:href=\"https://postgis.net/workshops/postgis-intro/"
+"indexing.html\">PostGIS Workshop section on spatial indexes</link>, and the "
+"<link xlink:href=\"https://www.postgresql.org/docs/current/indexes."
+"html\">PostgreSQL manual</link>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "GiST Indexes"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"GiST stands for \"Generalized Search Tree\" and is a generic form of "
+"indexing for multi-dimensional data. PostGIS uses an R-Tree index "
+"implemented on top of GiST to index spatial data. GiST is the most commonly-"
+"used and versatile spatial index method, and offers very good query "
+"performance. Other implementations of GiST are used to speed up searches on "
+"all kinds of irregular data structures (integer arrays, spectral data, etc) "
+"which are not amenable to normal B-Tree indexing. For more information see "
+"the <link xlink:href=\"https://www.postgresql.org/docs/current/gist."
+"html\">PostgreSQL manual</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once a spatial data table exceeds a few thousand rows, you will want to "
+"build an index to speed up spatial searches of the data (unless all your "
+"searches are based on attributes, in which case you'll want to build a "
+"normal index on the attribute fields)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The syntax for building a GiST index on a \"geometry\" column is as follows:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above syntax will always build a 2D-index. To get the an n-dimensional "
+"index for the geometry type, you can create one using this syntax:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Building a spatial index is a computationally intensive exercise. It also "
+"blocks write access to your table for the time it creates, so on a "
+"production system you may want to do in in a slower CONCURRENTLY-aware way:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"After building an index, it is sometimes helpful to force PostgreSQL to "
+"collect table statistics, which are used to optimize query plans:"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "BRIN Indexes"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"BRIN stands for \"Block Range Index\". It is a general-purpose index method "
+"introduced in PostgreSQL 9.5. BRIN is a <emphasis>lossy</emphasis> index "
+"method, meaning that a secondary check is required to confirm that a record "
+"matches a given search condition (which is the case for all provided spatial "
+"indexes). It provides much faster index creation and much smaller index "
+"size, with reasonable read performance. Its primary purpose is to support "
+"indexing very large tables on columns which have a correlation with their "
+"physical location within the table. In addition to spatial indexing, BRIN "
+"can speed up searches on various kinds of attribute data structures "
+"(integer, arrays etc). For more information see the <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/brin.html\">PostgreSQL "
+"manual</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once a spatial table exceeds a few thousand rows, you will want to build an "
+"index to speed up spatial searches of the data. GiST indexes are very "
+"performant as long as their size doesn't exceed the amount of RAM available "
+"for the database, and as long as you can afford the index storage size, and "
+"the cost of index update on write. Otherwise, for very large tables BRIN "
+"index can be considered as an alternative."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A BRIN index stores the bounding box enclosing all the geometries contained "
+"in the rows in a contiguous set of table blocks, called a <emphasis>block "
+"range</emphasis>. When executing a query using the index the block ranges "
+"are scanned to find the ones that intersect the query extent. This is "
+"efficient only if the data is physically ordered so that the bounding boxes "
+"for block ranges have minimal overlap (and ideally are mutually exclusive). "
+"The resulting index is very small in size, but is typically less performant "
+"for read than a GiST index over the same data."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Building a BRIN index is much less CPU-intensive than building a GiST index. "
+"It's common to find that a BRIN index is ten times faster to build than a "
+"GiST index over the same data. And because a BRIN index stores only one "
+"bounding box for each range of table blocks, it's common to use up to a "
+"thousand times less disk space than a GiST index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can choose the number of blocks to summarize in a range. If you decrease "
+"this number, the index will be bigger but will probably provide better "
+"performance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For BRIN to be effective, the table data should be stored in a physical "
+"order which minimizes the amount of block extent overlap. It may be that the "
+"data is already sorted appropriately (for instance, if it is loaded from "
+"another dataset that is already sorted in spatial order). Otherwise, this "
+"can be accomplished by sorting the data by a one-dimensional spatial key. "
+"One way to do this is to create a new table sorted by the geometry values "
+"(which in recent PostGIS versions uses an efficient Hilbert curve ordering):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Alternatively, data can be sorted in-place by using a GeoHash as a "
+"(temporary) index, and clustering on that index:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The syntax for building a BRIN index on a <code>geometry</code> column is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above syntax builds a 2D index. To build a 3D-dimensional index, use "
+"this syntax:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "You can also get a 4D-dimensional index using the 4D operator class:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above commands use the default number of blocks in a range, which is "
+"128. To specify the number of blocks to summarise in a range, use this syntax"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Keep in mind that a BRIN index only stores one index entry for a large "
+"number of rows. If your table stores geometries with a mixed number of "
+"dimensions, it's likely that the resulting index will have poor performance. "
+"You can avoid this performance penalty by choosing the operator class with "
+"the least number of dimensions of the stored geometries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <code>geography</code> datatype is supported for BRIN indexing. The "
+"syntax for building a BRIN index on a geography column is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above syntax builds a 2D-index for geospatial objects on the spheroid."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Currently, only \"inclusion support\" is provided, meaning that just the "
+"<varname>&&</varname>, <varname>~</varname> and <varname>@</varname> "
+"operators can be used for the 2D cases (for both <code>geometry</code> and "
+"<code>geography</code>), and just the <varname>&&&</varname> "
+"operator for 3D geometries. There is currently no support for kNN searches."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An important difference between BRIN and other index types is that the "
+"database does not maintain the index dynamically. Changes to spatial data in "
+"the table are simply appended to the end of the index. This will cause index "
+"search performance to degrade over time. The index can be updated by "
+"performing a <code>VACUUM</code>, or by using a special function "
+"<code>brin_summarize_new_values(regclass)</code>. For this reason BRIN may "
+"be most appropriate for use with data that is read-only, or only rarely "
+"changing. For more information refer to the <link xlink:href=\"https://www."
+"postgresql.org/docs/current/brin-intro.html#BRIN-OPERATION\">manual</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "To summarize using BRIN for spatial data:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Index build time is very fast, and index size is very small."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Index query time is slower than GiST, but can still be very acceptable."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires table data to be sorted in a spatial ordering."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires manual index maintenance."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Most appropriate for very large tables, with low or no overlap (e.g. "
+"points), which are static or change infrequently."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"More effective for queries which return relatively large numbers of data "
+"records."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "SP-GiST Indexes"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"SP-GiST stands for \"Space-Partitioned Generalized Search Tree\" and is a "
+"generic form of indexing for multi-dimensional data types that supports "
+"partitioned search trees, such as quad-trees, k-d trees, and radix trees "
+"(tries). The common feature of these data structures is that they repeatedly "
+"divide the search space into partitions that need not be of equal size. In "
+"addition to spatial indexing, SP-GiST is used to speed up searches on many "
+"kinds of data, such as phone routing, ip routing, substring search, etc. For "
+"more information see the <link xlink:href=\"https://www.postgresql.org/docs/"
+"current/spgist.html\">PostgreSQL manual</link>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"As it is the case for GiST indexes, SP-GiST indexes are lossy, in the sense "
+"that they store the bounding box enclosing spatial objects. SP-GiST indexes "
+"can be considered as an alternative to GiST indexes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once a GIS data table exceeds a few thousand rows, an SP-GiST index may be "
+"used to speed up spatial searches of the data. The syntax for building an SP-"
+"GiST index on a \"geometry\" column is as follows:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The above syntax will build a 2-dimensional index. A 3-dimensional index for "
+"the geometry type can be created using the 3D operator class:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Building a spatial index is a computationally intensive operation. It also "
+"blocks write access to your table for the time it creates, so on a "
+"production system you may want to do in in a slower CONCURRENTLY-aware way:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An SP-GiST index can accelerate queries involving the following operators:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<<, &<, &>, >>, <<|, &<|, |&>, "
+"|>>, &&, @>, <@, and ~=, for 2-dimensional indexes,"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "&/&, ~==, @>>, and <<@, for 3-dimensional indexes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "There is no support for kNN searches at the moment."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Tuning Index Usage"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Ordinarily, indexes invisibly speed up data access: once an index is built, "
+"the PostgreSQL query planner automatically decides when to use it to improve "
+"query performance. But there are some situations where the planner does not "
+"choose to use existing indexes, so queries end up using slow sequential "
+"scans instead of a spatial index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you find your spatial indexes are not being used, there are a few things "
+"you can do:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Examine the query plan and check your query actually computes the thing you "
+"need. An erroneous JOIN, either forgotten or to the wrong table, can "
+"unexpectedly retrieve table records multiple times. To get the query plan, "
+"execute with <code>EXPLAIN</code> in front of the query."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Make sure statistics are gathered about the number and distributions of "
+"values in a table, to provide the query planner with better information to "
+"make decisions around index usage. <command>VACUUM ANALYZE</command> will "
+"compute both."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You should regularly vacuum your databases anyways. Many PostgreSQL DBAs run "
+"<command>VACUUM</command> as an off-peak cron job on a regular basis."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If vacuuming does not help, you can temporarily force the planner to use the "
+"index information by using the command <command>SET ENABLE_SEQSCAN TO OFF;</"
+"command>. This way you can check whether the planner is at all able to "
+"generate an index-accelerated query plan for your query. You should only use "
+"this command for debugging; generally speaking, the planner knows better "
+"than you do about when to use indexes. Once you have run your query, do not "
+"forget to run <command>SET ENABLE_SEQSCAN TO ON;</command> so that the "
+"planner will operate normally for other queries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <command>SET ENABLE_SEQSCAN TO OFF;</command> helps your query to run "
+"faster, your Postgres is likely not tuned for your hardware. If you find the "
+"planner wrong about the cost of sequential versus index scans try reducing "
+"the value of <varname>RANDOM_PAGE_COST</varname> in <code>postgresql.conf</"
+"code>, or use <command>SET RANDOM_PAGE_COST TO 1.1;</command>. The default "
+"value for <varname>RANDOM_PAGE_COST</varname> is 4.0. Try setting it to 1.1 "
+"(for SSD) or 2.0 (for fast magnetic disks). Decreasing the value makes the "
+"planner more likely to use index scans."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If <command>SET ENABLE_SEQSCAN TO OFF;</command> does not help your query, "
+"the query may be using a SQL construct that the Postgres planner is not yet "
+"able to optimize. It may be possible to rewrite the query in a way that the "
+"planner is able to handle. For example, a subquery with an inline SELECT may "
+"not produce an efficient plan, but could possibly be rewritten using a "
+"LATERAL JOIN."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information see the Postgres manual section on <link xlink:"
+"href=\"https://www.postgresql.org/docs/current/runtime-config-query."
+"html\">Query Planning</link>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Spatial Queries"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <emphasis>raison d'etre</emphasis> of spatial databases is to perform "
+"queries inside the database which would ordinarily require desktop GIS "
+"functionality. Using PostGIS effectively requires knowing what spatial "
+"functions are available, how to use them in queries, and ensuring that "
+"appropriate indexes are in place to provide good performance."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Determining Spatial Relationships"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial relationships indicate how two geometries interact with one another. "
+"They are a fundamental capability for querying geometry."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Dimensionally Extended 9-Intersection Model"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"According to the <link xlink:href=\"http://www.opengeospatial.org/standards/"
+"sfs\">OpenGIS Simple Features Implementation Specification for SQL</link>, "
+"\"the basic approach to comparing two geometries is to make pair-wise tests "
+"of the intersections between the Interiors, Boundaries and Exteriors of the "
+"two geometries and to classify the relationship between the two geometries "
+"based on the entries in the resulting 'intersection' matrix.\""
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In the theory of point-set topology, the points in a geometry embedded in 2-"
+"dimensional space are categorized into three sets:"
+msgstr ""
+
+#. Tag: glossterm
+#, no-c-format
+msgid "<glossterm>Boundary</glossterm>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The boundary of a geometry is the set of geometries of the next lower "
+"dimension. For <varname>POINT</varname>s, which have a dimension of 0, the "
+"boundary is the empty set. The boundary of a <varname>LINESTRING</varname> "
+"is the two endpoints. For <varname>POLYGON</varname>s, the boundary is the "
+"linework of the exterior and interior rings."
+msgstr ""
+
+#. Tag: glossterm
+#, no-c-format
+msgid "<glossterm>Interior</glossterm>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The interior of a geometry are those points of a geometry that are not in "
+"the boundary. For <varname>POINT</varname>s, the interior is the point "
+"itself. The interior of a <varname>LINESTRING</varname> is the set of points "
+"between the endpoints. For <varname>POLYGON</varname>s, the interior is the "
+"areal surface inside the polygon."
+msgstr ""
+
+#. Tag: glossterm
+#, no-c-format
+msgid "<glossterm>Exterior</glossterm>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The exterior of a geometry is the rest of the space in which the geometry is "
+"embedded; in other words, all points not in the interior or on the boundary "
+"of the geometry. It is a 2-dimensional non-closed surface."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <link xlink:href=\"http://en.wikipedia.org/wiki/DE-9IM\">Dimensionally "
+"Extended 9-Intersection Model</link> (DE-9IM) describes the spatial "
+"relationship between two geometries by specifying the dimensions of the 9 "
+"intersections between the above sets for each geometry. The intersection "
+"dimensions can be formally represented in a 3x3 <emphasis "
+"role=\"bold\">intersection matrix</emphasis>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For a geometry <emphasis>g</emphasis> the <emphasis>Interior</emphasis>, "
+"<emphasis>Boundary</emphasis>, and <emphasis>Exterior</emphasis> are denoted "
+"using the notation <emphasis>I(g)</emphasis>, <emphasis>B(g)</emphasis>, and "
+"<emphasis>E(g)</emphasis>. Also, <emphasis>dim(s)</emphasis> denotes the "
+"dimension of a set <emphasis>s</emphasis> with the domain of <literal>{0,1,2,"
+"F}</literal>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<literal>0</literal> => point"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<literal>1</literal> => line"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<literal>2</literal> => area"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<literal>F</literal> => empty set"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using this notation, the intersection matrix for two geometries <emphasis>a</"
+"emphasis> and <emphasis>b</emphasis> is:"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis role=\"bold\">Interior</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis role=\"bold\">Boundary</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "<emphasis role=\"bold\">Exterior</emphasis>"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( I(a) ∩ I(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( I(a) ∩ B(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( I(a) ∩ E(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( B(a) ∩ I(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( B(a) ∩ B(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( B(a) ∩ E(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( E(a) ∩ I(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( E(a) ∩ B(b) )"
+msgstr ""
+
+#. Tag: emphasis
+#, no-c-format
+msgid "dim( E(a) ∩ E(b) )"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Visually, for two overlapping polygonal geometries, this looks like:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( I(a) ∩ I(b) ) = </emphasis><emphasis role=\"bold\">2</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( I(a) ∩ B(b) = </emphasis><emphasis role=\"bold\">1</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( I(a) ∩ E(b) ) = </emphasis><emphasis role=\"bold\">2</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( B(a) ∩ I(b) ) = </emphasis><emphasis role=\"bold\">1</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( B(a) ∩ B(b) ) = </emphasis><emphasis role=\"bold\">0</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( B(a) ∩ E(b) ) = </emphasis><emphasis role=\"bold\">1</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( E(a) ∩ I(b) ) = </emphasis><emphasis role=\"bold\">2</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( E(a) ∩ B(b) ) = </emphasis><emphasis role=\"bold\">1</"
+"emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<emphasis>dim( E(a) ∩ E(b) = </emphasis><emphasis role=\"bold\">2</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Reading from left to right and top to bottom, the intersection matrix is "
+"represented as the text string '<emphasis role=\"bold\">212101212</"
+"emphasis>'."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "For more information, refer to:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<link xlink:href=\"http://www.opengeospatial.org/standards/sfs\">OpenGIS "
+"Simple Features Implementation Specification for SQL</link> (version 1.1, "
+"section 2.1.13.2)"
+msgstr ""
+
+#. Tag: link
+#, no-c-format
+msgid "Wikipedia: Dimensionally Extended Nine-Intersection Model (DE-9IM)"
+msgstr ""
+
+#. Tag: link
+#, no-c-format
+msgid "GeoTools: Point Set Theory and the DE-9IM Matrix"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Named Spatial Relationships"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To make it easy to determine common spatial relationships, the OGC SFS "
+"defines a set of <emphasis>named spatial relationship predicates</emphasis>. "
+"PostGIS provides these as the functions <xref linkend=\"ST_Contains\"/>, "
+"<xref linkend=\"ST_Crosses\"/>, <xref linkend=\"ST_Disjoint\"/>, <xref "
+"linkend=\"ST_Equals\"/>, <xref linkend=\"ST_Intersects\"/>, <xref "
+"linkend=\"ST_Overlaps\"/>, <xref linkend=\"ST_Touches\"/>, <xref "
+"linkend=\"ST_Within\"/>. It also defines the non-standard relationship "
+"predicates <xref linkend=\"ST_Covers\"/>, <xref linkend=\"ST_CoveredBy\"/>, "
+"and <xref linkend=\"ST_ContainsProperly\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial predicates are usually used as conditions in SQL <code>WHERE</code> "
+"or <code>JOIN</code> clauses. The named spatial predicates automatically use "
+"a spatial index if one is available, so there is no need to use the bounding "
+"box operator <code>&&</code> as well. For example:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more details and illustrations, see the <link xlink:href=\"https://"
+"postgis.net/workshops/postgis-intro/spatial_relationships.html\">PostGIS "
+"Workshop.</link>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "General Spatial Relationships"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In some cases the named spatial relationships are insufficient to provide a "
+"desired spatial filter condition."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For example, consider a linear dataset representing a road network. It may "
+"be required to identify all road segments that cross each other, not at a "
+"point, but in a line (perhaps to validate some business rule). In this case "
+"<xref linkend=\"ST_Crosses\"/> does not provide the necessary spatial "
+"filter, since for linear features it returns <varname>true</varname> only "
+"where they cross at a point."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A two-step solution would be to first compute the actual intersection (<xref "
+"linkend=\"ST_Intersection\"/>) of pairs of road lines that spatially "
+"intersect (<xref linkend=\"ST_Intersects\"/>), and then check if the "
+"intersection's <xref linkend=\"ST_GeometryType\"/> is '<varname>LINESTRING</"
+"varname>' (properly dealing with cases that return "
+"<varname>GEOMETRYCOLLECTION</varname>s of <varname>[MULTI]POINT</varname>s, "
+"<varname>[MULTI]LINESTRING</varname>s, etc.)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Clearly, a simpler and faster solution is desirable."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"A second example is locating wharves that intersect a lake's boundary on a "
+"line and where one end of the wharf is up on shore. In other words, where a "
+"wharf is within but not completely contained by a lake, intersects the "
+"boundary of a lake on a line, and where exactly one of the wharf's endpoints "
+"is within or on the boundary of the lake. It is possible to use a "
+"combination of spatial predicates to find the required features:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "(lake, wharf) = TRUE"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "(lake, wharf) = FALSE"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "(<xref linkend=\"ST_Intersection\"/>(wharf, lake)) = 'LINESTRING'"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"(<xref linkend=\"ST_Multi\"/>(<xref linkend=\"ST_Intersection\"/>(<xref "
+"linkend=\"ST_Boundary\"/>(wharf), <xref linkend=\"ST_Boundary\"/>(lake)))) = "
+"1"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "... but needless to say, this is quite complicated."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"These requirements can be met by computing the full DE-9IM intersection "
+"matrix. PostGIS provides the <xref linkend=\"ST_Relate\"/> function to do "
+"this:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To test a particular spatial relationship, an <emphasis "
+"role=\"bold\">intersection matrix pattern</emphasis> is used. This is the "
+"matrix representation augmented with the additional symbols <literal>{T,*}</"
+"literal>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<literal>T</literal> => intersection dimension is non-empty; i.e. is in "
+"<literal>{0,1,2}</literal>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<literal>*</literal> => don't care"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Using intersection matrix patterns, specific spatial relationships can be "
+"evaluated in a more succinct way. The <xref linkend=\"ST_Relate\"/> and the "
+"<xref linkend=\"ST_RelateMatch\"/> functions can be used to test "
+"intersection matrix patterns. For the first example above, the intersection "
+"matrix pattern specifying two lines intersecting in a line is '<emphasis "
+"role=\"bold\">1*1***1**</emphasis>':"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For the second example, the intersection matrix pattern specifying a line "
+"partly inside and partly outside a polygon is '<emphasis "
+"role=\"bold\">102101FF2</emphasis>':"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using Spatial Indexes"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When constructing queries using spatial conditions, for best performance it "
+"is important to ensure that a spatial index is used, if one exists (see "
+"<xref linkend=\"build-indexes\"/>). To do this, a spatial operator or index-"
+"aware function must be used in a <code>WHERE</code> or <code>ON</code> "
+"clause of the query."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Spatial operators include the bounding box operators (of which the most "
+"commonly used is <xref linkend=\"geometry_overlaps\"/>; see <xref "
+"linkend=\"operators-bbox\"/> for the full list) and the distance operators "
+"used in nearest-neighbor queries (the most common being <xref "
+"linkend=\"geometry_distance_knn\"/>; see <xref linkend=\"operators-"
+"distance\"/> for the full list.)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index-aware functions automatically add a bounding box operator to the "
+"spatial condition. Index-aware functions include the named spatial "
+"relationship predicates <xref linkend=\"ST_Contains\"/>, <xref "
+"linkend=\"ST_ContainsProperly\"/>, <xref linkend=\"ST_CoveredBy\"/>, <xref "
+"linkend=\"ST_Covers\"/>, <xref linkend=\"ST_Crosses\"/>, <xref "
+"linkend=\"ST_Intersects\"/>, <xref linkend=\"ST_Overlaps\"/>, <xref "
+"linkend=\"ST_Touches\"/>, <xref linkend=\"ST_Within\"/>, <xref "
+"linkend=\"ST_Within\"/>, and <xref linkend=\"ST_3DIntersects\"/>, and the "
+"distance predicates <xref linkend=\"ST_DWithin\"/>, <xref "
+"linkend=\"ST_DFullyWithin\"/>, <xref linkend=\"ST_3DDFullyWithin\"/>, and "
+"<xref linkend=\"ST_3DDWithin\"/> .)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Functions such as <xref linkend=\"ST_Distance\"/> do <emphasis>not</"
+"emphasis> use indexes to optimize their operation. For example, the "
+"following query would be quite slow on a large table:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This query selects all the geometries in <code>geom_table</code> which are "
+"within 100 units of the point (100000, 200000). It will be slow because it "
+"is calculating the distance between each point in the table and the "
+"specified point, ie. one <varname>ST_Distance()</varname> calculation is "
+"computed for <emphasis role=\"bold\">every</emphasis> row in the table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The number of rows processed can be reduced substantially by using the index-"
+"aware function <xref linkend=\"ST_DWithin\"/>:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This query selects the same geometries, but it does it in a more efficient "
+"way. This is enabled by <varname>ST_DWithin()</varname> using the "
+"<varname>&&</varname> operator internally on an expanded bounding "
+"box of the query geometry. If there is a spatial index on <code>geom</code>, "
+"the query planner will recognize that it can use the index to reduce the "
+"number of rows scanned before calculating the distance. The spatial index "
+"allows retrieving only records with geometries whose bounding boxes overlap "
+"the expanded extent and hence which <emphasis>might</emphasis> be within the "
+"required distance. The actual distance is then computed to confirm whether "
+"to include the record in the result set."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For more information and examples see the <link xlink:href=\"https://postgis."
+"net/workshops/postgis-intro/indexing.html\">PostGIS Workshop</link>."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Examples of Spatial SQL"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The examples in this section make use of a table of linear roads, and a "
+"table of polygonal municipality boundaries. The definition of the "
+"<varname>bc_roads</varname> table is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The definition of the <varname>bc_municipality</varname> table is:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What is the total length of all roads, expressed in kilometers?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "You can answer this question with a very simple piece of SQL:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "How large is the city of Prince George, in hectares?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This query combines an attribute condition (on the municipality name) with a "
+"spatial calculation (of the polygon area):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What is the largest municipality in the province, by area?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This query uses a spatial measurement as an ordering value. There are "
+"several ways of approaching this problem, but the most efficient is below:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note that in order to answer this query we have to calculate the area of "
+"every polygon. If we were doing this a lot it would make sense to add an "
+"area column to the table that could be indexed for performance. By ordering "
+"the results in a descending direction, and them using the PostgreSQL "
+"\"LIMIT\" command we can easily select just the largest value without using "
+"an aggregate function like MAX()."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What is the length of roads fully contained within each municipality?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is an example of a \"spatial join\", which brings together data from "
+"two tables (with a join) using a spatial interaction (\"contained\") as the "
+"join condition (rather than the usual relational approach of joining on a "
+"common key):"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This query takes a while, because every road in the table is summarized into "
+"the final result (about 250K roads for the example table). For smaller "
+"datasets (several thousand records on several hundred) the response can be "
+"very fast."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a new table with all the roads within the city of Prince George."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is an example of an \"overlay\", which takes in two tables and outputs "
+"a new table that consists of spatially clipped or cut resultants. Unlike the "
+"\"spatial join\" demonstrated above, this query creates new geometries. An "
+"overlay is like a turbo-charged spatial join, and is useful for more exact "
+"analysis work:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What is the length in kilometers of \"Douglas St\" in Victoria?"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "What is the largest municipality polygon that has a hole?"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Data Management, Queries, and Applications"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Loading and Creating Rasters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For most use cases, you will create PostGIS rasters by loading existing "
+"raster files using the packaged <varname>raster2pgsql</varname> raster "
+"loader."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using raster2pgsql to load rasters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>raster2pgsql</varname> is a raster loader executable that loads "
+"GDAL supported raster formats into SQL suitable for loading into a PostGIS "
+"raster table. It is capable of loading folders of raster files as well as "
+"creating overviews of rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Since the raster2pgsql is compiled as part of PostGIS most often (unless you "
+"compile your own GDAL library), the raster types supported by the executable "
+"will be the same as those compiled in the GDAL dependency library. To get a "
+"list of raster types your particular <varname>raster2pgsql</varname> "
+"supports use the <varname>-G</varname> switch."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"When creating overviews of a specific factor from a set of rasters that are "
+"aligned, it is possible for the overviews to not align. Visit <link xlink:"
+"href=\"http://trac.osgeo.org/postgis/ticket/1764\">http://trac.osgeo.org/"
+"postgis/ticket/1764</link> for an example where the overviews do not align."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Example Usage"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"An example session using the loader to create an input file and uploading it "
+"chunked in 100x100 tiles might look like this:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you do not specify the schema as part of the target table name, the table "
+"will be created in the default schema of the database or user you are "
+"connecting with."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "A conversion and upload can be done all in one step using UNIX pipes:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Load rasters Massachusetts state plane meters aerial tiles into a schema "
+"called <varname>aerial</varname> and create a full view, 2 and 4 level "
+"overview tables, use copy mode for inserting (no intermediary file just "
+"straight to db), and -e don't force everything in a transaction (good if you "
+"want to see data in tables right away without waiting). Break up the rasters "
+"into 128x128 pixel tiles and apply raster constraints. Use copy mode instead "
+"of table insert. (-F) Include a field called filename to hold the name of "
+"the file the tiles were cut from."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "The -G commands outputs a list something like"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "raster2pgsql options"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Display help screen. Help will also display if you don't pass in any "
+"arguments."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Print the supported raster formats."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create new table and populate it with raster(s), <emphasis>this is the "
+"default mode</emphasis>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Append raster(s) to an existing table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Drop table, create new one and populate it with raster(s)"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Prepare mode, only create the table."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid ""
+"Raster processing: Applying constraints for proper registering in raster "
+"catalogs"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Apply raster constraints -- srid, pixelsize etc. to ensure raster is "
+"properly registered in <varname>raster_columns</varname> view."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Disable setting the max extent constraint. Only applied if -C flag is also "
+"used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Set the constraints (spatially unique and coverage tile) for regular "
+"blocking. Only applied if -C flag is also used."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid ""
+"Raster processing: Optional parameters used to manipulate input raster "
+"dataset"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Assign output raster with specified SRID. If not provided or is zero, "
+"raster's metadata will be checked to determine an appropriate SRID."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Index (1-based) of band to extract from raster. For more than one band "
+"index, separate with comma (,). If unspecified, all bands of raster will be "
+"extracted."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Cut raster into tiles to be inserted one per table row. <varname>TILE_SIZE</"
+"varname> is expressed as WIDTHxHEIGHT or set to the value \"auto\" to allow "
+"the loader to compute an appropriate tile size using the first raster and "
+"applied to all rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Pad right-most and bottom-most tiles to guarantee that all tiles have the "
+"same width and height."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Register the raster as a filesystem (out-db) raster."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Only the metadata of the raster and path location to the raster is stored in "
+"the database (not the pixels)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create overview of the raster. For more than one factor, separate with "
+"comma(,). Overview table name follows the pattern o_<varname>overview "
+"factor</varname>_<varname>table</varname>, where <varname>overview factor</"
+"varname> is a placeholder for numerical overview factor and <varname>table</"
+"varname> is replaced with the base table name. Created overview is stored in "
+"the database and is not affected by -R. Note that your generated sql file "
+"will contain both the main table and overview tables."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "NODATA value to use on bands without a NODATA value."
+msgstr ""
+
+#. Tag: term
+#, no-c-format
+msgid "Optional parameters used to manipulate database objects"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Specify name of destination raster column, default is 'rast'"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Add a column with the name of the file"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Specify the name of the filename column. Implies -F."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Wrap PostgreSQL identifiers in quotes."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Create a GiST index on the raster column."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Vacuum analyze the raster table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Keeps empty tiles and skips NODATA value checks for each raster band. Note "
+"you save time in checking, but could end up with far more junk rows in your "
+"database and those junk rows are not marked as empty tiles."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Specify the tablespace for the new table. Note that indices (including the "
+"primary key) will still use the default tablespace unless the -X flag is "
+"also used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Specify the tablespace for the table's new index. This applies to the "
+"primary key and the spatial index if the -I flag is used."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Use copy statements instead of insert statements. Optionally specify "
+"<varname>max_rows_per_copy</varname>; default 50 when not specified."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Execute each statement individually, do not use a transaction."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Control endianness of generated binary output of raster; specify 0 for XDR "
+"and 1 for NDR (default); only NDR output is supported now"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Specify version of output format. Default is 0. Only 0 is supported at this "
+"time."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Creating rasters using PostGIS raster functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"On many occasions, you'll want to create rasters and raster tables right in "
+"the database. There are a plethora of functions to do that. The general "
+"steps to follow."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Create a table with a raster column to hold the new raster records which can "
+"be accomplished with:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are many functions to help with that goal. If you are creating rasters "
+"not as a derivative of other rasters, you will want to start with: <xref "
+"linkend=\"RT_ST_MakeEmptyRaster\"/>, followed by <xref "
+"linkend=\"RT_ST_AddBand\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can also create rasters from geometries. To achieve that you'll want to "
+"use <xref linkend=\"RT_ST_AsRaster\"/> perhaps accompanied with other "
+"functions such as <xref linkend=\"RT_ST_Union\"/> or <xref "
+"linkend=\"RT_ST_MapAlgebraFct2\"/> or any of the family of other map algebra "
+"functions."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are even many more options for creating new raster tables from "
+"existing tables. For example you can create a raster table in a different "
+"projection from an existing one using <xref linkend=\"RT_ST_Transform\"/>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you are done populating your table initially, you'll want to create a "
+"spatial index on the raster column with something like:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Note the use of <xref linkend=\"RT_ST_ConvexHull\"/> since most raster "
+"operators are based on the convex hull of the rasters."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Pre-2.0 versions of PostGIS raster were based on the envelop rather than the "
+"convex hull. For the spatial indexes to work properly you'll need to drop "
+"those and replace with convex hull based index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Apply raster constraints using <xref linkend=\"RT_AddRasterConstraints\"/>"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Using \"out db\" cloud rasters"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>raster2pgsql</varname> tool uses GDAL to access raster data, "
+"and can take advantage of a key GDAL feature: the ability to read from "
+"rasters that are <link xlink:href=\"https://gdal.org/user/"
+"virtual_file_systems.html#network-based-file-systems\">stored remotely</"
+"link> in cloud \"object stores\" (e.g. AWS S3, Google Cloud Storage)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Efficient use of cloud stored rasters requires the use of a \"cloud "
+"optimized\" format. The most well-known and widely used is the \"<link xlink:"
+"href=\"https://gdal.org/drivers/raster/cog.html\">cloud optimized GeoTIFF</"
+"link>\" format. Using a non-cloud format, like a JPEG, or an un-tiled TIFF "
+"will result in very poor performance, as the system will have to download "
+"the entire raster each time it needs to access a subset."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"First, load your raster into the cloud storage of your choice. Once it is "
+"loaded, you will have a URI to access it with, either an \"http\" URI, or "
+"sometimes a URI specific to the service. (e.g., \"s3://bucket/object\"). To "
+"access non-public buckets, you will need to supply GDAL config options to "
+"authenticate your connection. Note that this command is <emphasis>reading</"
+"emphasis> from the cloud raster and <emphasis>writing</emphasis> to the "
+"database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once the table is loaded, you need to give the database permission to read "
+"from remote rasters, by setting two permissions, <xref "
+"linkend=\"postgis_enable_outdb_rasters\"/> and <xref "
+"linkend=\"postgis_gdal_enabled_drivers\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"To make the changes sticky, set them directly on your database. You will "
+"need to re-connect to experience the new settings."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For non-public rasters, you may have to provide access keys to read from the "
+"cloud rasters. The same keys you used to write the <varname>raster2pgsql</"
+"varname> call can be set for use inside the database, with the <xref "
+"linkend=\"postgis_gdal_vsi_options\"/> configuration. Note that multiple "
+"options can be set by space-separating the <varname>key=value</varname> "
+"pairs."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Once you have the data loaded and permissions set you can interact with the "
+"raster table like any other raster table, using the same functions. The "
+"database will handle all the mechanics of connecting to the cloud data when "
+"it needs to read pixel data."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Catalogs"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"There are two raster catalog views that come packaged with PostGIS. Both "
+"views utilize information embedded in the constraints of the raster tables. "
+"As a result the catalog views are always consistent with the raster data in "
+"the tables since the constraints are enforced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>raster_columns</varname> this view catalogs all the raster table "
+"columns in your database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>raster_overviews</varname> this view catalogs all the raster table "
+"columns in your database that serve as overviews for a finer grained table. "
+"Tables of this type are generated when you use the <varname>-l</varname> "
+"switch during load."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Columns Catalog"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>raster_columns</varname> is a catalog of all raster table "
+"columns in your database that are of type raster. It is a view utilizing the "
+"constraints on the tables so the information is always consistent even if "
+"you restore one raster table from a backup of another database. The "
+"following columns exist in the <varname>raster_columns</varname> catalog."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If you created your tables not with the loader or forgot to specify the "
+"<varname>-C</varname> flag during load, you can enforce the constraints "
+"after the fact using <xref linkend=\"RT_AddRasterConstraints\"/> so that the "
+"<varname>raster_columns</varname> catalog registers the common information "
+"about your raster tiles."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_table_catalog</varname> The database the table is in. This will "
+"always read the current database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_table_schema</varname> The database schema the raster table "
+"belongs to."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>r_table_name</varname> raster table"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_raster_column</varname> the column in the <varname>r_table_name</"
+"varname> table that is of type raster. There is nothing in PostGIS "
+"preventing you from having multiple raster columns per table so its possible "
+"to have a raster table listed multiple times with a different raster column "
+"for each."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>srid</varname> The spatial reference identifier of the raster. "
+"Should be an entry in the <xref linkend=\"spatial_ref_sys\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>scale_x</varname> The scaling between geometric spatial coordinates "
+"and pixel. This is only available if all tiles in the raster column have the "
+"same <varname>scale_x</varname> and this constraint is applied. Refer to "
+"<xref linkend=\"RT_ST_ScaleX\"/> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>scale_y</varname> The scaling between geometric spatial coordinates "
+"and pixel. This is only available if all tiles in the raster column have the "
+"same <varname>scale_y</varname> and the <varname>scale_y</varname> "
+"constraint is applied. Refer to <xref linkend=\"RT_ST_ScaleY\"/> for more "
+"details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>blocksize_x</varname> The width (number of pixels across) of each "
+"raster tile . Refer to <xref linkend=\"RT_ST_Width\"/> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>blocksize_y</varname> The width (number of pixels down) of each "
+"raster tile . Refer to <xref linkend=\"RT_ST_Height\"/> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>same_alignment</varname> A boolean that is true if all the raster "
+"tiles have the same alignment . Refer to <xref "
+"linkend=\"RT_ST_SameAlignment\"/> for more details."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>regular_blocking</varname> If the raster column has the spatially "
+"unique and coverage tile constraints, the value with be TRUE. Otherwise, it "
+"will be FALSE."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>num_bands</varname> The number of bands in each tile of your raster "
+"set. This is the same information as what is provided by"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>pixel_types</varname> An array defining the pixel type for each "
+"band. You will have the same number of elements in this array as you have "
+"number of bands. The pixel_types are one of the following defined in <xref "
+"linkend=\"RT_ST_BandPixelType\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>nodata_values</varname> An array of double precision numbers "
+"denoting the <varname>nodata_value</varname> for each band. You will have "
+"the same number of elements in this array as you have number of bands. These "
+"numbers define the pixel value for each band that should be ignored for most "
+"operations. This is similar information provided by <xref "
+"linkend=\"RT_ST_BandNoDataValue\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>out_db</varname> An array of boolean flags indicating if the raster "
+"bands data is maintained outside the database. You will have the same number "
+"of elements in this array as you have number of bands."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>extent</varname> This is the extent of all the raster rows in your "
+"raster set. If you plan to load more data that will change the extent of the "
+"set, you'll want to run the <xref linkend=\"RT_DropRasterConstraints\"/> "
+"function before load and then reapply constraints with <xref "
+"linkend=\"RT_AddRasterConstraints\"/> after load."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>spatial_index</varname> A boolean that is true if raster column has "
+"a spatial index."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Raster Overviews"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>raster_overviews</varname> catalogs information about raster table "
+"columns used for overviews and additional information about them that is "
+"useful to know when utilizing overviews. Overview tables are cataloged in "
+"both <varname>raster_columns</varname> and <varname>raster_overviews</"
+"varname> because they are rasters in their own right but also serve an "
+"additional special purpose of being a lower resolution caricature of a "
+"higher resolution table. These are generated along-side the main raster "
+"table when you use the <varname>-l</varname> switch in raster loading or can "
+"be generated manually using <xref linkend=\"RT_AddOverviewConstraints\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Overview tables contain the same constraints as other raster tables as well "
+"as additional informational only constraints specific to overviews."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The information in <varname>raster_overviews</varname> does not duplicate "
+"the information in <varname>raster_columns</varname>. If you need the "
+"information about an overview table present in <varname>raster_columns</"
+"varname> you can join the <varname>raster_overviews</varname> and "
+"<varname>raster_columns</varname> together to get the full set of "
+"information you need."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Two main reasons for overviews are:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Low resolution representation of the core tables commonly used for fast "
+"mapping zoom-out."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Computations are generally faster to do on them than their higher resolution "
+"parents because there are fewer records and each pixel covers more "
+"territory. Though the computations are not as accurate as the high-res "
+"tables they support, they can be sufficient in many rule-of-thumb "
+"computations."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The <varname>raster_overviews</varname> catalog contains the following "
+"columns of information."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>o_table_catalog</varname> The database the overview table is in. "
+"This will always read the current database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>o_table_schema</varname> The database schema the overview raster "
+"table belongs to."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "<varname>o_table_name</varname> raster overview table name"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>o_raster_column</varname> the raster column in the overview table."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_table_catalog</varname> The database the raster table that this "
+"overview services is in. This will always read the current database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_table_schema</varname> The database schema the raster table that "
+"this overview services belongs to."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_table_name</varname> raster table that this overview services."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>r_raster_column</varname> the raster column that this overview "
+"column services."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"<varname>overview_factor</varname> - this is the pyramid level of the "
+"overview table. The higher the number the lower the resolution of the table. "
+"raster2pgsql if given a folder of images, will compute overview of each "
+"image file and load separately. Level 1 is assumed and always the original "
+"file. Level 2 is will have each tile represent 4 of the original. So for "
+"example if you have a folder of 5000x5000 pixel image files that you chose "
+"to chunk 125x125, for each image file your base table will have (5000*5000)/"
+"(125*125) records = 1600, your (l=2) <varname>o_2</varname> table will have "
+"ceiling(1600/Power(2,2)) = 400 rows, your (l=3) <varname>o_3</varname> will "
+"have ceiling(1600/Power(2,3) ) = 200 rows. If your pixels aren't divisible "
+"by the size of your tiles, you'll get some scrap tiles (tiles not completely "
+"filled). Note that each overview tile generated by raster2pgsql has the same "
+"number of pixels as its parent, but is of a lower resolution where each "
+"pixel of it represents (Power(2,overview_factor) pixels of the original)."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Building Custom Applications with PostGIS Raster"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The fact that PostGIS raster provides you with SQL functions to render "
+"rasters in known image formats gives you a lot of options for rendering "
+"them. For example you can use OpenOffice / LibreOffice for rendering as "
+"demonstrated in <link xlink:href=\"http://www.postgresonline.com/journal/"
+"archives/244-Rendering-PostGIS-Raster-graphics-with-LibreOffice-Base-Reports."
+"html\">Rendering PostGIS Raster graphics with LibreOffice Base Reports</"
+"link>. In addition you can use a wide variety of languages as demonstrated "
+"in this section."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"PHP Example Outputting using ST_AsPNG in concert with other raster functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In this section, we'll demonstrate how to use the PHP PostgreSQL driver and "
+"the <xref linkend=\"RT_ST_AsGDALRaster\"/> family of functions to output "
+"band 1,2,3 of a raster to a PHP request stream that can then be embedded in "
+"an img src html tag."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The sample query demonstrates how to combine a whole bunch of raster "
+"functions together to grab all tiles that intersect a particular wgs 84 "
+"bounding box and then unions with <xref linkend=\"RT_ST_Union\"/> the "
+"intersecting tiles together returning all bands, transforms to user "
+"specified projection using <xref linkend=\"RT_ST_Transform\"/>, and then "
+"outputs the results as a png using <xref linkend=\"RT_ST_AsPNG\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You would call the below using <programlisting>http://mywebserver/"
+"test_raster.php?srid=2249</programlisting> to get the raster image in "
+"Massachusetts state plane feet."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid ""
+"ASP.NET C# Example Outputting using ST_AsPNG in concert with other raster "
+"functions"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"In this section, we'll demonstrate how to use Npgsql PostgreSQL .NET driver "
+"and the <xref linkend=\"RT_ST_AsGDALRaster\"/> family of functions to output "
+"band 1,2,3 of a raster to a PHP request stream that can then be embedded in "
+"an img src html tag."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You will need the npgsql .NET PostgreSQL driver for this exercise which you "
+"can get the latest of from <link xlink:href=\"http://npgsql.projects."
+"postgresql.org/\">http://npgsql.projects.postgresql.org/</link>. Just "
+"download the latest and drop into your ASP.NET bin folder and you'll be good "
+"to go."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is same example as <xref linkend=\"RT_PHP_Output\"/> except implemented "
+"in C#."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You would call the below using <programlisting>http://mywebserver/TestRaster."
+"ashx?srid=2249</programlisting> to get the raster image in Massachusetts "
+"state plane feet."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Java console app that outputs raster query as Image file"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a simple java console app that takes a query that returns one image "
+"and outputs to specified file."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"You can download the latest PostgreSQL JDBC drivers from <link xlink:"
+"href=\"http://jdbc.postgresql.org/download.html\">http://jdbc.postgresql.org/"
+"download.html</link>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "You can compile the following code using a command something like:"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "And call it from the command-line with something like"
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Use PLPython to dump out images via SQL"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This is a plpython stored function that creates a file in the server "
+"directory for each record. Requires you have plpython installed. Should work "
+"fine with both plpythonu and plpython3u."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "Outputting Rasters with PSQL"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Sadly PSQL doesn't have easy to use built-in functionality for outputting "
+"binaries. This is a bit of a hack that piggy backs on PostgreSQL somewhat "
+"legacy large object support. To use first launch your psql commandline "
+"connected to your database."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"Unlike the python approach, this approach creates the file on your local "
+"computer."
+msgstr ""
+
+#. Tag: title
+#, no-c-format
+msgid "PostGIS Functions new or enhanced in %"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"The functions given below are PostGIS functions that were added or enhanced."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Functions new in PostGIS %"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Functions enhanced in PostGIS %"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Functions changed in PostGIS %"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This method needs address_standardizer extension."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This method supports Circular Strings and Curves."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"For geography this is a thin wrapper around the geometry implementation."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function automatically includes a bounding box comparison that makes "
+"use of any spatial indexes that are available on the geometries."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function supports M coordinates."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function supports Polyhedral surfaces."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This method is also provided by SFCGAL backend."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This method needs SFCGAL backend."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This method implements the <link xlink:href=\"http://www.opengeospatial.org/"
+"standards/sfs\">OGC Simple Features Implementation Specification for SQL 1.1."
+"</link>"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This method implements the SQL/MM specification."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"This function supports Triangles and Triangulated Irregular Network Surfaces "
+"(TIN)."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "This function supports 3d and will not drop the z-index."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid ""
+"If the optional <code>gridSize</code> parameter is given (GEOS-3.9.0 or "
+"higher required), all result vertices are guaranteed to fall on a grid of "
+"the specified size. For the operation to give predictable results all the "
+"input vertices must fall already on the specified grid, see <xref "
+"linkend=\"ST_ReducePrecision\"/>."
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "New in this release"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Enhanced in this release"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Aggregate"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Window function"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires GEOS (3.9,3.10,3.11,3.12) or higher"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Requires SFCGAL 1.5 or higher"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "2.5/3D support"
+msgstr ""
+
+#. Tag: para
+#, no-c-format
+msgid "Supports geography"
+msgstr ""
diff --git a/contrib/postgis/doc/release_notes.xml b/contrib/postgis/doc/release_notes.xml
index f58ee56..bf8a795 100644
--- a/contrib/postgis/doc/release_notes.xml
+++ b/contrib/postgis/doc/release_notes.xml
@@ -2,28 +2,7 @@
<appendix xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="release_notes">
<title>Appendix</title>
<subtitle>Release Notes</subtitle>
- <section>
- <title>PostGIS 3.6.2</title>
- <para>2026/02/09</para>
- <para>If you are upgrading postgis_topology and have topogeometry columns, make sure to run after the upgrade to fix topogeometry corruption: <code>SELECT topology.FixCorruptTopoGeometryColumn(schema_name, table_name, feature_column) FROM topology.layer</code></para>
-
- <simplesect>
- <title>Fixes</title>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/6023">6023</link>, Fix robustness issue in ptarray_contains_point (Sandro Santilli)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/6027">6027</link>, Fix RemoveUnusedPrimitives without topology in search_path
- (Sandro Santilli)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/6019">6019</link>, make clean does not remove cunit generated files
- (Bas Couwenberg)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/6020">6020</link>, schema qualify call in ST_MPointFromText (Paul Ramsey)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/6028">6028</link>, crash indexing malformed empty polygon (Paul Ramsey)</para>
- <para><link xlink:href="https://github.com/postgis/postgis/pull/841">GH-841</link>, small memory leak in address_standardizer (Maxim Korotkov)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5853">5853</link>, Issue with topology and tiger geocoder upgrade scripts
- (Regina Obe, Spencer Bryson)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/6032">6032</link>, Fix postgis_tiger_geocoder upgrade for PostgreSQL < 16
- (Regina Obe)</para>
- </simplesect>
- </section>
<section>
<title>PostGIS 3.6.1</title>
<para>2025/11/13</para>
diff --git a/contrib/postgis/extensions/address_standardizer/parseaddress-api.c b/contrib/postgis/extensions/address_standardizer/parseaddress-api.c
index 1582c3c..593b37e 100644
--- a/contrib/postgis/extensions/address_standardizer/parseaddress-api.c
+++ b/contrib/postgis/extensions/address_standardizer/parseaddress-api.c
@@ -203,8 +203,8 @@
s[uj] = s[ui];
uj++;
}
- if (uj > 0 && isspace(s[uj-1])) uj--;
- s[uj] = '\0';
+ if (uj > 0 && isspace(s[uj-1])) uj--; /*#<<<DIA_SVACE_MAJOR>>>*/
+ s[uj] = '\0';
/* clean trailing punctuation */
(void)clean_trailing_punct(s);
diff --git a/contrib/postgis/extensions/address_standardizer/standard.c b/contrib/postgis/extensions/address_standardizer/standard.c
index e286a35..d0c3f70 100644
--- a/contrib/postgis/extensions/address_standardizer/standard.c
+++ b/contrib/postgis/extensions/address_standardizer/standard.c
@@ -374,7 +374,7 @@
return 0;
}
-
+/*#<<<DIA_SVACE_CRITICAL*/
void std_free(STANDARDIZER *std)
{
if (std == NULL)
@@ -401,6 +401,7 @@
DBG("Calling free");
free(std);
}
+/*#DIA_SVACE_CRITICAL>>>*/
void stdaddr_free(STDADDR *stdaddr)
diff --git a/contrib/postgis/extensions/address_standardizer/std_pg_hash.c b/contrib/postgis/extensions/address_standardizer/std_pg_hash.c
index 7b18b18..a586692 100644
--- a/contrib/postgis/extensions/address_standardizer/std_pg_hash.c
+++ b/contrib/postgis/extensions/address_standardizer/std_pg_hash.c
@@ -251,8 +251,8 @@
for (i=0; i<STD_CACHE_ITEMS; i++) {
StdCacheItem *ci = &STDCache->StdCache[i];
if (ci->lextab && !strcmp(ci->lextab, lextab) &&
- !strcmp(ci->gaztab, gaztab) &&
- !strcmp(ci->rultab, rultab))
+ ci->gaztab && !strcmp(ci->gaztab, gaztab) &&
+ ci->rultab && !strcmp(ci->rultab, rultab))
return STDCache->StdCache[i].std;
}
diff --git a/contrib/postgis/extensions/postgis_extension_helper.sql.in b/contrib/postgis/extensions/postgis_extension_helper.sql.in
index 3341f9e..d5f473d 100644
--- a/contrib/postgis/extensions/postgis_extension_helper.sql.in
+++ b/contrib/postgis/extensions/postgis_extension_helper.sql.in
@@ -14,6 +14,73 @@
-- This is a suite of SQL helper functions for use during a PostGIS extension install/upgrade
-- The functions get uninstalled after the extension install/upgrade process
---------------------------
+-- postgis_extension_remove_objects: This function removes objects of a particular class from an extension
+-- this is needed because there is no ALTER EXTENSION DROP FUNCTION/AGGREGATE command
+-- and we can't CREATE OR REPLACE functions whose signatures have changed and we can drop them if they are part of an extension
+-- So we use this to remove it from extension first before we drop
+CREATE FUNCTION postgis_extension_remove_objects(param_extension text, param_type text)
+ RETURNS boolean AS
+$$
+DECLARE
+ var_sql text := '';
+ var_r record;
+ var_result boolean := false;
+ var_class text := '';
+ var_is_aggregate boolean := false;
+ var_sql_list text := '';
+ var_pgsql_version integer := pg_catalog.current_setting('server_version_num');
+BEGIN
+ var_class := CASE WHEN pg_catalog.lower(param_type) OPERATOR(pg_catalog.=)'function' OR pg_catalog.lower(param_type) OPERATOR(pg_catalog.=) 'aggregate' THEN 'pg_catalog.pg_proc' ELSE '' END;
+ var_is_aggregate := CASE WHEN pg_catalog.lower(param_type) OPERATOR(pg_catalog.=) 'aggregate' THEN true ELSE false END;
+
+ IF var_pgsql_version OPERATOR(pg_catalog.<) 110000 THEN
+ var_sql_list := $sql$SELECT 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) e.extname OPERATOR(pg_catalog.||) ' DROP ' OPERATOR(pg_catalog.||) $3 OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) COALESCE(proc.proname OPERATOR(pg_catalog.||) '(' OPERATOR(pg_catalog.||) oidvectortypes(proc.proargtypes) OPERATOR(pg_catalog.||) ')' ,typ.typname, cd.relname, op.oprname,
+ cs.typname OPERATOR(pg_catalog.||) ' AS ' OPERATOR(pg_catalog.||) ct.typname OPERATOR(pg_catalog.||) ') ', opcname, opfname) OPERATOR(pg_catalog.||) ';' AS remove_command
+ FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
+ ON d.refobjid OPERATOR(pg_catalog.=) e.oid INNER JOIN pg_catalog.pg_class As c ON
+ c.oid OPERATOR(pg_catalog.=) d.classid
+ LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_class As cd ON cd.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_operator As op ON op.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource OPERATOR(pg_catalog.=) cs.oid
+ LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget OPERATOR(pg_catalog.=) ct.oid
+ LEFT JOIN pg_opclass As oc ON oc.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_opfamily As ofa ON ofa.oid OPERATOR(pg_catalog.=) d.objid
+ WHERE d.deptype OPERATOR(pg_catalog.=) 'e' and e.extname OPERATOR(pg_catalog.=) $1 and c.relname OPERATOR(pg_catalog.=) $2 AND COALESCE(proc.proisagg, false) OPERATOR(pg_catalog.=) $4;$sql$;
+ ELSE -- for PostgreSQL 11 and above, they removed proc.proisagg among others and replaced with some func type thing
+ var_sql_list := $sql$SELECT 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) e.extname OPERATOR(pg_catalog.||) ' DROP ' OPERATOR(pg_catalog.||) $3 OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) COALESCE(proc.proname OPERATOR(pg_catalog.||) '(' OPERATOR(pg_catalog.||) oidvectortypes(proc.proargtypes) OPERATOR(pg_catalog.||) ')' ,typ.typname, cd.relname, op.oprname,
+ cs.typname OPERATOR(pg_catalog.||) ' AS ' OPERATOR(pg_catalog.||) ct.typname OPERATOR(pg_catalog.||) ') ', opcname, opfname) OPERATOR(pg_catalog.||) ';' AS remove_command
+ FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
+ ON d.refobjid OPERATOR(pg_catalog.=) e.oid INNER JOIN pg_catalog.pg_class As c ON
+ c.oid OPERATOR(pg_catalog.=) d.classid
+ LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_class As cd ON cd.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_operator As op ON op.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource OPERATOR(pg_catalog.=) cs.oid
+ LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget OPERATOR(pg_catalog.=) ct.oid
+ LEFT JOIN pg_opclass As oc ON oc.oid OPERATOR(pg_catalog.=) d.objid
+ LEFT JOIN pg_opfamily As ofa ON ofa.oid OPERATOR(pg_catalog.=) d.objid
+ WHERE d.deptype OPERATOR(pg_catalog.=) 'e' and e.extname OPERATOR(pg_catalog.=) $1 and c.relname OPERATOR(pg_catalog.=) $2 AND (proc.prokind OPERATOR(pg_catalog.=) 'a') OPERATOR(pg_catalog.=) $4;$sql$;
+ END IF;
+
+ FOR var_r IN EXECUTE var_sql_list USING param_extension, var_class, param_type, var_is_aggregate
+ LOOP
+ var_sql := var_sql OPERATOR(pg_catalog.||) var_r.remove_command OPERATOR(pg_catalog.||) ';';
+ END LOOP;
+ IF var_sql > '' THEN
+ EXECUTE var_sql;
+ var_result := true;
+ END IF;
+
+ RETURN var_result;
+END;
+$$
+LANGUAGE plpgsql VOLATILE;
+
CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_statement text)
RETURNS boolean AS
$$
diff --git a/contrib/postgis/extensions/postgis_extension_helper_uninstall.sql b/contrib/postgis/extensions/postgis_extension_helper_uninstall.sql
index 756dc80..2fb1d17 100644
--- a/contrib/postgis/extensions/postgis_extension_helper_uninstall.sql
+++ b/contrib/postgis/extensions/postgis_extension_helper_uninstall.sql
@@ -13,6 +13,7 @@
--
-- This drops extension helper functions
-- and should be called at the end of the extension upgrade file
+DROP FUNCTION postgis_extension_remove_objects(text, text);
DROP FUNCTION postgis_extension_drop_if_exists(text, text);
DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar);
DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text);
diff --git a/contrib/postgis/extensions/postgis_tiger_geocoder/Makefile.in b/contrib/postgis/extensions/postgis_tiger_geocoder/Makefile.in
index e0faf1c..ce3db16 100644
--- a/contrib/postgis/extensions/postgis_tiger_geocoder/Makefile.in
+++ b/contrib/postgis/extensions/postgis_tiger_geocoder/Makefile.in
@@ -31,12 +31,6 @@
REGRESS = test-normalize_address test-upgrade
REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis --load-extension=$(EXTENSION)
-EXTSCHEMA_SUPPORTED = yes
-
-## PostgreSQL < 16 doesn't understand new @extschema:extname@ syntax, so strip it
-ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" "<" 160),1)
-EXTSCHEMA_SUPPORTED = no
-endif
SQL_BITS = $(wildcard sql_bits/*.sql)
EXTRA_CLEAN = sql expected ${SQL_BITS}
@@ -57,14 +51,14 @@
sql:
mkdir -p $@
-ifeq ($(EXTSCHEMA_SUPPORTED),yes)
+
+## PostgreSQL < 16 doesn't understand new @extschema:extname@ syntax, so strip it
+ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" "<" 160),1)
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
- cp $< $@
+ $(PERL) -lpe "s/\@extschema:[a-z]+\@\./ /g" < $< > $@
else
-# PG < 16 doesn't support new @extschema:<extension_name>@
-# so we need to strip those out
-sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
- $(PERL) -lpe "s/\@extschema:[^@]+\@\./ /g" < $< > $@
+ sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
+ cp $< $@
endif
expected/test-normalize_address.out: sql_bits/test_tuples_only_unaligned.sql.in ../../extras/tiger_geocoder/regress/normalize_address_regress | expected
@@ -80,14 +74,14 @@
sql/test-upgrade.sql: | sql
echo 'ALTER EXTENSION ${EXTENSION} UPDATE TO "ANY"; ALTER EXTENSION ${EXTENSION} UPDATE TO "$(EXTVERSION)"' > $@
-## no_relocate clause is only available in PostgreSQL 16 and above, so strip it for lower
-ifeq ($(EXTSCHEMA_SUPPORTED),yes)
+## no_relocate clause is only availabe in PostgreSQL 16 and above, so strip it for lower
+ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" "<" 160),1)
+%.control: %.control.in Makefile
+ $(PERL) -lpe 's/^no_relocate.*//g; s/\@EXTVERSION\@/$(EXTVERSION)/g' < "$<" > "$@"
+else
%.control: %.control.in Makefile
$(PERL) -lpe "s'@EXTVERSION@'$(EXTVERSION)'g" \
< "$<" > "$@"
-else
-%.control: %.control.in Makefile
- $(PERL) -lpe 's/^no_relocate.*//g; s/\@EXTVERSION\@/$(EXTVERSION)/g' < "$<" > "$@"
endif
expected/test-upgrade.out: sql/test-upgrade.sql | expected
@@ -104,7 +98,7 @@
| $(PERL) @top_srcdir@/utils/create_or_replace_to_create.pl sql/$(EXTENSION)_pre.sql \
> $@
-sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: ../postgis_extension_helper.sql sql/tiger_geocoder_upgrade_minor.sql sql_bits/mark_editable_objects.sql.in | sql
+sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql/tiger_geocoder_upgrade_minor.sql sql_bits/mark_editable_objects.sql.in | sql
cat $^ > $@
echo "SELECT postgis_extension_drop_if_exists('${EXTENSION}', 'DROP SCHEMA tiger_data');" >> $@
cat @srcdir@/../postgis_extension_helper_uninstall.sql >> $@
@@ -211,14 +205,9 @@
#aggregates are special
#they can be dropped but we need to remove
#them from the extension first
-ifeq ($(EXTSCHEMA_SUPPORTED),yes)
sql/tiger_geocoder_upgrade_minor.sql: sql/tiger_geocoder_minor.sql.in | sql
- $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
-else
-sql/tiger_geocoder_upgrade_minor.sql: sql/tiger_geocoder_minor.sql.in | sql
- $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g ; s/\@extschema:[^@]+\@\.//g' $< > $@
-endif
-
+ sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
+ $< > $@
#only extension files
EXTRA_CLEAN += $(wildcard expected/*--*.out)
diff --git a/contrib/postgis/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in b/contrib/postgis/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in
new file mode 100644
index 0000000..c0fc12a
--- /dev/null
+++ b/contrib/postgis/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in
@@ -0,0 +1,19 @@
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+--
+----
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.net
+--
+-- Copyright (C) 2011 Regina Obe <lr@pcorp.us>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+--
+-- Author: Regina Obe <lr@pcorp.us>
+--
+-- This drops extension helper functions
+-- and should be called at the end of the extension upgrade file
+-- removes all postgis_topology functions from postgis_topology extension since they will be read
+-- during upgrade
+SELECT postgis_extension_remove_objects('postgis_tiger_geocoder', 'FUNCTION');
+SELECT postgis_extension_remove_objects('postgis_tiger_geocoder', 'AGGREGATE');
diff --git a/contrib/postgis/extensions/postgis_topology/Makefile.in b/contrib/postgis/extensions/postgis_topology/Makefile.in
index 0bc04fc..ef3f603 100644
--- a/contrib/postgis/extensions/postgis_topology/Makefile.in
+++ b/contrib/postgis/extensions/postgis_topology/Makefile.in
@@ -42,6 +42,7 @@
EXTENSION_UPGRADE_SCRIPTS = \
extlock.sql \
../postgis_extension_helper.sql \
+ sql_bits/remove_from_extension.sql.in \
sql/topology_upgrade.sql \
sql_bits/mark_editable_objects.sql.in \
../postgis_extension_helper_uninstall.sql
diff --git a/contrib/postgis/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in b/contrib/postgis/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in
new file mode 100644
index 0000000..cc4cca8
--- /dev/null
+++ b/contrib/postgis/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in
@@ -0,0 +1,19 @@
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+--
+----
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.net
+--
+-- Copyright (C) 2011 Regina Obe <lr@pcorp.us>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+--
+-- Author: Regina Obe <lr@pcorp.us>
+--
+-- This drops extension helper functions
+-- and should be called at the end of the extension upgrade file
+-- removes all postgis_topology functions from postgis_topology extension since they will be read
+-- during upgrade
+SELECT postgis_extension_remove_objects('postgis_topology', 'FUNCTION');
+SELECT postgis_extension_remove_objects('postgis_topology', 'AGGREGATE');
diff --git a/contrib/postgis/extensions/upgradeable_versions.mk b/contrib/postgis/extensions/upgradeable_versions.mk
index e778dc6..045f94b 100644
--- a/contrib/postgis/extensions/upgradeable_versions.mk
+++ b/contrib/postgis/extensions/upgradeable_versions.mk
@@ -71,7 +71,6 @@
3.0.9 \
3.0.10 \
3.0.11 \
- 3.0.12 \
3.1.0 \
3.1.1 \
3.1.2 \
@@ -86,7 +85,6 @@
3.1.10 \
3.1.11 \
3.1.12 \
- 3.1.13 \
3.2.0 \
3.2.1 \
3.2.2 \
@@ -96,7 +94,6 @@
3.2.6 \
3.2.7 \
3.2.8 \
- 3.2.9 \
3.3.0 \
3.3.1 \
3.3.2 \
@@ -106,18 +103,14 @@
3.3.6 \
3.3.7 \
3.3.8 \
- 3.3.9 \
3.4.0 \
3.4.1 \
3.4.2 \
3.4.3 \
3.4.4 \
- 3.4.5 \
3.5.0 \
3.5.1 \
3.5.2 \
3.5.3 \
- 3.5.4 \
- 3.5.5 \
3.6.0 \
- 3.6.1
+ 3.6.1dev
diff --git a/contrib/postgis/liblwgeom/cunit/cu_gserialized2.c b/contrib/postgis/liblwgeom/cunit/cu_gserialized2.c
index dd32828..6df3aa1 100644
--- a/contrib/postgis/liblwgeom/cunit/cu_gserialized2.c
+++ b/contrib/postgis/liblwgeom/cunit/cu_gserialized2.c
@@ -271,48 +271,33 @@
{
int i = 0;
struct gserialized_empty_cases {
- int ishex;
- const char* txt;
+ const char* wkt;
int isempty;
};
struct gserialized_empty_cases cases[] = {
- { 0, "POINT EMPTY", 1 },
- { 0, "POINT(1 1)", 0 },
- { 0, "LINESTRING EMPTY", 1 },
- { 0, "MULTILINESTRING EMPTY", 1 },
- { 0, "MULTILINESTRING(EMPTY)", 1 },
- { 0, "MULTILINESTRING(EMPTY,EMPTY)", 1 },
- { 0, "MULTILINESTRING(EMPTY,(0 0,1 1))", 0 },
- { 0, "MULTILINESTRING((0 0,1 1),EMPTY)", 0 },
- { 0, "MULTILINESTRING(EMPTY,(0 0,1 1),EMPTY)", 0 },
- { 0, "MULTILINESTRING(EMPTY,EMPTY,EMPTY)", 1 },
- { 0, "MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)", 0 },
- { 0, "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY,EMPTY))", 1 },
- { 0, "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY),POINT(1 1))", 0 },
- { 0, "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY, (0 0)),POINT EMPTY)", 0 },
- { 0, "GEOMETRYCOLLECTION(POLYGON EMPTY,POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
- { 0, "GEOMETRYCOLLECTION(POLYGON EMPTY,GEOMETRYCOLLECTION(POINT EMPTY),MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
- { 1, "0101000000000000000000F87F000000000000F87F", 1 }, /* POINT EMPTY */
- { 1, "010200000000000000", 1 }, /* LINESTRING EMPTY */
- { 1, "010400000000000000", 1 }, /* MULTIPOINT EMPTY */
- { 1, "0105000000020000000102000000020000000000000000000000000000000000000000000000000000000000000000000000010200000000000000", 0 }, /* MULTILINESTRING ((0 0, 0 0), EMPTY) */
- { 1, "0105000000020000000102000000000000000102000000020000000000000000000000000000000000000000000000000000000000000000000000", 0 }, /* MULTILINESTRING (EMPTY,(0 0, 0 0)) */
- { 1, "010300000000000000", 1 }, /* POLYGON EMPTY */
- { 1, "01030000000100000000000000", 1 }, /* POLYGON(EMPTY) */
- { 1, "010300000002000000000000000100000000000000000000000000000000000000", 0 }, /* POLYGON(EMPTY, (0 0)) */
- { 1, "0107000000030000000102000000000000000103000000020000000000000000000000010200000000000000", 1}, /* GEOMETRYCOLLECTION(LINESTRING EMPTY, POLYGON(EMPTY, EMPTY), LINESTRING EMPTY) */
- { 1, NULL, 0 }
+ { "POINT EMPTY", 1 },
+ { "POINT(1 1)", 0 },
+ { "LINESTRING EMPTY", 1 },
+ { "MULTILINESTRING EMPTY", 1 },
+ { "MULTILINESTRING(EMPTY)", 1 },
+ { "MULTILINESTRING(EMPTY,EMPTY)", 1 },
+ { "MULTILINESTRING(EMPTY,(0 0,1 1))", 0 },
+ { "MULTILINESTRING((0 0,1 1),EMPTY)", 0 },
+ { "MULTILINESTRING(EMPTY,(0 0,1 1),EMPTY)", 0 },
+ { "MULTILINESTRING(EMPTY,EMPTY,EMPTY)", 1 },
+ { "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY,EMPTY))", 1 },
+ { "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY),POINT(1 1))", 0 },
+ { "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY, (0 0)),POINT EMPTY)", 0 },
+ { "GEOMETRYCOLLECTION(POLYGON EMPTY,POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
+ { "GEOMETRYCOLLECTION(POLYGON EMPTY,GEOMETRYCOLLECTION(POINT EMPTY),MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
+ { NULL, 0 }
};
- while( cases[i].txt )
+ while( cases[i].wkt )
{
- LWGEOM *lw = NULL;
- if (cases[i].ishex)
- lw = lwgeom_from_hexwkb(cases[i].txt, LW_PARSER_CHECK_NONE);
- else
- lw = lwgeom_from_wkt(cases[i].txt, LW_PARSER_CHECK_NONE);
-
+ // i = 11;
+ LWGEOM *lw = lwgeom_from_wkt(cases[i].wkt, LW_PARSER_CHECK_NONE);
GSERIALIZED *g = gserialized2_from_lwgeom(lw, 0);
int ie = gserialized2_is_empty(g);
// printf("%s: we say %d, they say %d\n", cases[i].wkt, cases[i].isempty, ie);
@@ -324,6 +309,7 @@
}
+
static void test_on_gser2_lwgeom_count_vertices(void)
{
LWGEOM *lwgeom;
diff --git a/contrib/postgis/liblwgeom/cunit/cu_ptarray.c b/contrib/postgis/liblwgeom/cunit/cu_ptarray.c
index 6d8ea2f..99c689a 100644
--- a/contrib/postgis/liblwgeom/cunit/cu_ptarray.c
+++ b/contrib/postgis/liblwgeom/cunit/cu_ptarray.c
@@ -427,17 +427,6 @@
CU_ASSERT_EQUAL(rv, LW_INSIDE);
lwline_free(lwline);
-
-
- /* Test for https://trac.osgeo.org/postgis/ticket/6023 */
- lwline = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(11.230120879533454 62.84897119848748,11.230120879533905 62.8489711984873,11.23020501303477 62.84900750109812,11.230170431987244 62.84904481447776,11.230117909393426 62.8489943480894,11.230120879533454 62.84897119848748)"));
- pa = lwline->points;
- pt = getPoint2d(lwline->points, 0);
- rv = ptarray_contains_point(pa, &pt);
- ASSERT_INT_EQUAL(rv, LW_BOUNDARY);
-
-
- lwline_free(lwline);
}
static void test_ptarrayarc_contains_point()
diff --git a/contrib/postgis/liblwgeom/gserialized2.c b/contrib/postgis/liblwgeom/gserialized2.c
index f2d824b..5c40615 100644
--- a/contrib/postgis/liblwgeom/gserialized2.c
+++ b/contrib/postgis/liblwgeom/gserialized2.c
@@ -224,19 +224,16 @@
static size_t gserialized2_is_empty_recurse(const uint8_t *p, int *isempty);
static size_t gserialized2_is_empty_recurse(const uint8_t *p, int *isempty)
{
- uint32_t type = 0, num = 0;
-
- /* Short circuit if we found any non-empty component */
- if (!*isempty) return 0;
+ int i;
+ int32_t type, num;
memcpy(&type, p, 4);
memcpy(&num, p+4, 4);
if (lwtype_is_collection(type))
{
- /* Recurse into collections */
size_t lz = 8;
- for ( uint32_t i = 0; i < num; i++ )
+ for ( i = 0; i < num; i++ )
{
lz += gserialized2_is_empty_recurse(p+lz, isempty);
if (!*isempty)
@@ -247,44 +244,14 @@
}
else
{
- size_t lz = 8;
- /* Any non-collection with zero elements is empty */
- if ( num == 0 )
- {
- *isempty = LW_TRUE;
- }
- /*
- * Special case to handle polygon with a non-zero
- * set of empty rings
- * https://trac.osgeo.org/postgis/ticket/6028
- */
- else if ( num > 0 && type == POLYGONTYPE )
- {
- for ( uint32_t i = 0; i < num; i++ )
- {
- uint32_t lrnum;
- memcpy(&lrnum, p+lz, 4);
- lz += 4;
- if ( lrnum > 0 )
- {
- *isempty = LW_FALSE;
- return lz;
- }
- }
- *isempty = LW_TRUE;
- }
- /* Any other non-collection with more than zero elements is not empty */
- else
- {
- *isempty = LW_FALSE;
- }
- return lz;
+ *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
+ return 8;
}
}
int gserialized2_is_empty(const GSERIALIZED *g)
{
- int isempty = LW_TRUE;
+ int isempty = 0;
uint8_t *p = gserialized2_get_geometry_p(g);
gserialized2_is_empty_recurse(p, &isempty);
return isempty;
diff --git a/contrib/postgis/liblwgeom/lwalgorithm.c b/contrib/postgis/liblwgeom/lwalgorithm.c
index 9f9e425..5cb90a0 100644
--- a/contrib/postgis/liblwgeom/lwalgorithm.c
+++ b/contrib/postgis/liblwgeom/lwalgorithm.c
@@ -31,33 +31,33 @@
int
p4d_same(const POINT4D *p1, const POINT4D *p2)
{
- return p1->x == p2->x
- && p1->y == p2->y
- && p1->z == p2->z
- && p1->m == p2->m;
+ return FP_EQUALS(p1->x, p2->x)
+ && FP_EQUALS(p1->y, p2->y)
+ && FP_EQUALS(p1->z, p2->z)
+ && FP_EQUALS(p1->m, p2->m);
}
int
p3d_same(const POINT3D *p1, const POINT3D *p2)
{
- return p1->x == p2->x
- && p1->y == p2->y
- && p1->z == p2->z;
+ return FP_EQUALS(p1->x, p2->x)
+ && FP_EQUALS(p1->y, p2->y)
+ && FP_EQUALS(p1->z, p2->z);
}
int
p3dz_same(const POINT3DZ *p1, const POINT3DZ *p2)
{
- return p1->x == p2->x
- && p1->y == p2->y
- && p1->z == p2->z;
+ return FP_EQUALS(p1->x, p2->x)
+ && FP_EQUALS(p1->y, p2->y)
+ && FP_EQUALS(p1->z, p2->z);
}
int
p2d_same(const POINT2D *p1, const POINT2D *p2)
{
- return p1->x == p2->x
- && p1->y == p2->y;
+ return FP_EQUALS(p1->x, p2->x)
+ && FP_EQUALS(p1->y, p2->y);
}
/**
diff --git a/contrib/postgis/liblwgeom/lwgeom_log.h b/contrib/postgis/liblwgeom/lwgeom_log.h
index 5caf9db..92e814a 100644
--- a/contrib/postgis/liblwgeom/lwgeom_log.h
+++ b/contrib/postgis/liblwgeom/lwgeom_log.h
@@ -136,8 +136,9 @@
* For debugging, use LWDEBUG() or LWDEBUGF().
* @ingroup logging
*/
-void lwerror(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
-
+/*#<<<DIA_SVACE_CRITICAL*/
+void lwerror(const char *fmt, ...) __attribute__((noreturn)) __attribute__ ((format (printf, 1, 2)));
+/*#DIA_SVACE_CRITICAL>>>*/
/**
* Write a debug message out.
* Don't call this function directly, use the
diff --git a/contrib/postgis/liblwgeom/lwin_twkb.c b/contrib/postgis/liblwgeom/lwin_twkb.c
index a09f07a..981bf9d 100644
--- a/contrib/postgis/liblwgeom/lwin_twkb.c
+++ b/contrib/postgis/liblwgeom/lwin_twkb.c
@@ -635,6 +635,7 @@
break;
}
+/*#<<<DIA_SVACE_CRITICAL*/
if (has_bbox)
{
if (geom)
@@ -642,6 +643,7 @@
else
lwerror("unexpected NULL geometry object while bbox is present");
}
+/*#DIA_SVACE_CRITICAL>>>*/
return geom;
}
diff --git a/contrib/postgis/liblwgeom/lwin_wkb.c b/contrib/postgis/liblwgeom/lwin_wkb.c
index 26a59f1..476ff8e 100644
--- a/contrib/postgis/liblwgeom/lwin_wkb.c
+++ b/contrib/postgis/liblwgeom/lwin_wkb.c
@@ -578,14 +578,6 @@
return NULL;
}
- /* Skip zero-member rings, they add nothing */
- if ( pa->npoints == 0)
- {
- LWDEBUGF(2, "Skipping empty ring [%d]", i);
- ptarray_free(pa);
- continue;
- }
-
/* Add ring to polygon */
if ( lwpoly_add_ring(poly, pa) == LW_FAILURE )
{
diff --git a/contrib/postgis/liblwgeom/lwin_wkt_lex.c b/contrib/postgis/liblwgeom/lwin_wkt_lex.c
index f194112..27f6232 100644
--- a/contrib/postgis/liblwgeom/lwin_wkt_lex.c
+++ b/contrib/postgis/liblwgeom/lwin_wkt_lex.c
@@ -1,6 +1,6 @@
-#line 1 "lwin_wkt_lex.c"
+#line 2 "lwin_wkt_lex.c"
-#line 3 "lwin_wkt_lex.c"
+#line 4 "lwin_wkt_lex.c"
#define YY_INT_ALIGNED short int
@@ -293,7 +293,7 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -310,7 +310,7 @@
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
@@ -421,10 +421,10 @@
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-
+
#define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -903,10 +903,10 @@
#define NAN 0.0/0.0
#endif
-#line 906 "lwin_wkt_lex.c"
+#line 907 "lwin_wkt_lex.c"
#define YY_NO_INPUT 1
/* Suppress the default implementations. */
-#line 909 "lwin_wkt_lex.c"
+#line 910 "lwin_wkt_lex.c"
#define INITIAL 0
@@ -966,7 +966,7 @@
#endif
#ifndef YY_NO_UNPUT
-
+
#endif
#ifndef yytext_ptr
@@ -1093,7 +1093,7 @@
yy_state_type yy_current_state;
char *yy_cp, *yy_bp;
int yy_act;
-
+
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -1124,7 +1124,7 @@
#line 60 "lwin_wkt_lex.l"
-#line 1127 "lwin_wkt_lex.c"
+#line 1128 "lwin_wkt_lex.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1337,7 +1337,7 @@
#line 118 "lwin_wkt_lex.l"
ECHO;
YY_BREAK
-#line 1340 "lwin_wkt_lex.c"
+#line 1341 "lwin_wkt_lex.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1621,7 +1621,7 @@
{
yy_state_type yy_current_state;
char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1685,7 +1685,7 @@
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1752,12 +1752,12 @@
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void yyrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1770,11 +1770,11 @@
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* yypop_buffer_state();
@@ -1814,13 +1814,13 @@
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -1843,11 +1843,11 @@
/** Destroy the buffer.
* @param b a buffer created with yy_create_buffer()
- *
+ *
*/
void yy_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1868,7 +1868,7 @@
{
int oerrno = errno;
-
+
yy_flush_buffer( b );
b->yy_input_file = file;
@@ -1884,13 +1884,13 @@
}
b->yy_is_interactive = 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void yy_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1919,7 +1919,7 @@
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1949,7 +1949,7 @@
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void yypop_buffer_state (void)
{
@@ -1973,7 +1973,7 @@
static void yyensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -2016,13 +2016,13 @@
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2051,14 +2051,14 @@
/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead.
*/
YY_BUFFER_STATE yy_scan_string (const char * yystr )
{
-
+
return yy_scan_bytes( yystr, (int) strlen(yystr) );
}
@@ -2066,7 +2066,7 @@
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
@@ -2075,7 +2075,7 @@
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = (yy_size_t) (_yybytes_len + 2);
buf = (char *) yyalloc( n );
@@ -2129,16 +2129,16 @@
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int yyget_lineno (void)
{
-
+
return yylineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *yyget_in (void)
{
@@ -2146,7 +2146,7 @@
}
/** Get the output stream.
- *
+ *
*/
FILE *yyget_out (void)
{
@@ -2154,7 +2154,7 @@
}
/** Get the length of the current token.
- *
+ *
*/
int yyget_leng (void)
{
@@ -2162,7 +2162,7 @@
}
/** Get the current token.
- *
+ *
*/
char *yyget_text (void)
@@ -2172,18 +2172,18 @@
/** Set the current line number.
* @param _line_number line number
- *
+ *
*/
void yyset_lineno (int _line_number )
{
-
+
yylineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param _in_str A readable stream.
- *
+ *
* @see yy_switch_to_buffer
*/
void yyset_in (FILE * _in_str )
@@ -2237,7 +2237,7 @@
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
yy_delete_buffer( YY_CURRENT_BUFFER );
@@ -2263,7 +2263,7 @@
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
-
+
int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
@@ -2317,5 +2317,3 @@
{
wkt_yy_delete_buffer(wkt_yy_buf_state);
}
-
-
diff --git a/contrib/postgis/liblwgeom/lwutil.c b/contrib/postgis/liblwgeom/lwutil.c
index 522ef35..1c0c621 100644
--- a/contrib/postgis/liblwgeom/lwutil.c
+++ b/contrib/postgis/liblwgeom/lwutil.c
@@ -138,6 +138,7 @@
}
}
+/*#<<<DIA_SVACE_CRITICAL*/
static void
__attribute__((noreturn))
default_errorreporter(const char *fmt, va_list ap)
@@ -149,6 +150,7 @@
va_end(ap);
exit(1);
}
+/*#DIA_SVACE_CRITICAL>>>*/
/**
* This function is called by programs which want to set up custom handling
@@ -188,6 +190,7 @@
va_end(ap);
}
+/*#<<<DIA_SVACE_CRITICAL*/
void
__attribute__((noreturn))
lwerror(const char *fmt, ...)
@@ -201,6 +204,7 @@
__builtin_unreachable();
}
+/*#DIA_SVACE_CRITICAL>>>*/
void
lwdebug(int level, const char *fmt, ...)
diff --git a/contrib/postgis/liblwgeom/ptarray.c b/contrib/postgis/liblwgeom/ptarray.c
index 3e142fa..9820293 100644
--- a/contrib/postgis/liblwgeom/ptarray.c
+++ b/contrib/postgis/liblwgeom/ptarray.c
@@ -768,12 +768,6 @@
seg2 = getPoint2d_cp(pa, i);
- /* This is required for robustness, see #6023 */
- if (p2d_same(seg1, pt))
- {
- return LW_BOUNDARY;
- }
-
/* Zero length segments are ignored. */
if (p2d_same(seg1, seg2))
{
@@ -1840,9 +1834,11 @@
/* Append last point */
kept_it++;
if (kept_it != last_it)
+/*#<<<DIA_SVACE_CRITICAL*/
memmove(pa->serialized_pointlist + pt_size * kept_it,
pa->serialized_pointlist + pt_size * last_it,
pt_size);
+/*#DIA_SVACE_CRITICAL>>>*/
pa->npoints = kept_it + 1;
}
@@ -1908,9 +1904,11 @@
{
/* If there are 2 points remaining, it has to be first and last as
* we added those at the start */
+/*#<<<DIA_SVACE_CRITICAL*/
memmove(pa->serialized_pointlist + pt_size * kept_it,
pa->serialized_pointlist + pt_size * (pa->npoints - 1),
pt_size);
+/*#DIA_SVACE_CRITICAL>>>*/
}
else if (pa->npoints != keptn) /* We don't need to move any points if we are keeping them all */
{
diff --git a/contrib/postgis/libpgcommon/lwgeom_pg.c b/contrib/postgis/libpgcommon/lwgeom_pg.c
index ce23e92..379c2cf 100644
--- a/contrib/postgis/libpgcommon/lwgeom_pg.c
+++ b/contrib/postgis/libpgcommon/lwgeom_pg.c
@@ -350,8 +350,10 @@
pfree(ptr);
}
-pg_noreturn
-static void
+static void pg_error(const char *fmt, va_list ap) __attribute__ (( format(printf, 1, 0) ));
+
+/*#<<<DIA_SVACE_CRITICAL*/
+pg_noreturn static void
pg_error(const char *fmt, va_list ap)
{
char errmsg[PGC_ERRMSG_MAXLEN+1];
@@ -362,6 +364,7 @@
va_end(ap);
ereport(ERROR, (errmsg_internal("%s", errmsg)));
}
+/*#DIA_SVACE_CRITICAL>>>*/
static void pg_warning(const char *fmt, va_list ap) __attribute__ (( format(printf, 1, 0) ));
@@ -472,9 +475,8 @@
va_end(ap);
}
-pg_noreturn
-void
-// pg_attribute_noreturn()
+/*#<<<DIA_SVACE_CRITICAL*/
+pg_noreturn void
lwpgerror(const char *fmt, ...)
{
va_list ap;
@@ -485,7 +487,7 @@
pg_unreachable();
}
-
+/*#DIA_SVACE_CRITICAL>>>*/
/*
* the bare comparison function for GUC names
diff --git a/contrib/postgis/libpgcommon/lwgeom_pg.h b/contrib/postgis/libpgcommon/lwgeom_pg.h
index 92052f9..835230a 100644
--- a/contrib/postgis/libpgcommon/lwgeom_pg.h
+++ b/contrib/postgis/libpgcommon/lwgeom_pg.h
@@ -261,7 +261,9 @@
Datum LWGEOM_addBBOX(PG_FUNCTION_ARGS);
Datum LWGEOM_dropBBOX(PG_FUNCTION_ARGS);
-pg_noreturn void lwpgerror(const char *fmt, ...); // pg_attribute_noreturn();
+/*#<<<DIA_SVACE_CRITICAL*/
+pg_noreturn void lwpgerror(const char *fmt, ...) __attribute (( format(printf, 1, 2) ));
+/*#DIA_SVACE_CRITICAL>>>*/
void lwpgnotice(const char *fmt, ...) __attribute (( format(printf, 1, 2) ));
void lwpgwarning(const char *fmt, ...) __attribute (( format(printf, 1, 2) ));
diff --git a/contrib/postgis/loader/pgsql2shp-core.c b/contrib/postgis/loader/pgsql2shp-core.c
index d7441e4..e68139c 100644
--- a/contrib/postgis/loader/pgsql2shp-core.c
+++ b/contrib/postgis/loader/pgsql2shp-core.c
@@ -2091,8 +2091,10 @@
{
snprintf(state->message, SHPDUMPERMSGLEN, _("Error parsing HEXEWKB for record %d"), state->currow);
PQclear(state->fetchres);
+/*#<<<DIA_SVACE_MAJOR*/
if (hexewkb) free(hexewkb);
if (hexewkb_binary) PQfreemem(hexewkb_binary);
+/*#DIA_SVACE_MAJOR>>>*/
return SHPDUMPERERR;
}
@@ -2136,8 +2138,10 @@
snprintf(state->message, SHPDUMPERMSGLEN, _("Unknown WKB type (%d) for record %d"), lwgeom->type, state->currow);
PQclear(state->fetchres);
SHPDestroyObject(obj);
+/*#<<<DIA_SVACE_MAJOR*/
if (hexewkb) free(hexewkb);
if (hexewkb_binary) PQfreemem(hexewkb_binary);
+/*#DIA_SVACE_MAJOR>>>*/
return SHPDUMPERERR;
}
@@ -2150,8 +2154,10 @@
snprintf(state->message, SHPDUMPERMSGLEN, _("Error writing shape %d"), state->currow);
PQclear(state->fetchres);
SHPDestroyObject(obj);
+/*#<<<DIA_SVACE_MAJOR*/
if (hexewkb) free(hexewkb);
if (hexewkb_binary) PQfreemem(hexewkb_binary);
+/*#DIA_SVACE_MAJOR>>>*/
return SHPDUMPERERR;
}
@@ -2167,8 +2173,10 @@
state->curresrow++;
state->currow++;
+/*#<<<DIA_SVACE_MAJOR*/
if (hexewkb) free(hexewkb);
if (hexewkb_binary) PQfreemem(hexewkb_binary);
+/*#DIA_SVACE_MAJOR>>>*/
return SHPDUMPEROK;
}
diff --git a/contrib/postgis/loader/shpcommon.c b/contrib/postgis/loader/shpcommon.c
index a27d45d..c705efa 100644
--- a/contrib/postgis/loader/shpcommon.c
+++ b/contrib/postgis/loader/shpcommon.c
@@ -269,6 +269,7 @@
/* Error out if the dbffieldname is > 10 chars */
if (strlen(map->dbffieldnames[curmapsize]) > 10)
{{
+ fclose(fptr); /*#<<<DIA_SVACE_MAJOR>>>*/
int ret = snprintf(errbuf, errbuflen,
_("ERROR: column map file specifies a DBF field name \"%s\" which is longer than 10 characters"),
map->dbffieldnames[curmapsize]);
diff --git a/contrib/postgis/postgis/Makefile.in b/contrib/postgis/postgis/Makefile.in
index 03955ba..67feb69 100644
--- a/contrib/postgis/postgis/Makefile.in
+++ b/contrib/postgis/postgis/Makefile.in
@@ -268,7 +268,6 @@
distclean: clean
rm -f Makefile
rm -f sqldefines.h
- if [ -e "cunit/Makefile" ]; then make -C cunit distclean; fi
check-unit:
diff --git a/contrib/postgis/postgis/flatgeobuf.c b/contrib/postgis/postgis/flatgeobuf.c
index 99b4051..42f00c7 100644
--- a/contrib/postgis/postgis/flatgeobuf.c
+++ b/contrib/postgis/postgis/flatgeobuf.c
@@ -465,10 +465,10 @@
{
HeapTuple heapTuple;
uint32_t natts = ctx->tupdesc->natts;
-
+/*#<<<DIA_SVACE_CRITICAL*/
Datum *values = (Datum *) palloc0(natts * sizeof(Datum));
bool *isnull = (bool *) palloc0(natts * sizeof(bool));
-
+/*#DIA_SVACE_CRITICAL>>>*/
values[0] = Int32GetDatum(ctx->fid);
if (flatgeobuf_decode_feature(ctx->ctx))
diff --git a/contrib/postgis/postgis/geography_centroid.c b/contrib/postgis/postgis/geography_centroid.c
index d7c3448..605c8f1 100644
--- a/contrib/postgis/postgis/geography_centroid.c
+++ b/contrib/postgis/postgis/geography_centroid.c
@@ -62,12 +62,14 @@
SPHEROID s;
/* Get our geometry object loaded into memory. */
- if (!PG_ARGISNULL(0))
- g = PG_GETARG_GSERIALIZED_P(0);
- else
+/*#<<<DIA_SVACE_MAJOR*/
+ if (PG_ARGISNULL(0))
PG_RETURN_NULL();
+/*#DIA_SVACE_MAJOR>>>*/
- lwgeom = lwgeom_from_gserialized(g);
+ g = PG_GETARG_GSERIALIZED_P(0);
+ lwgeom = lwgeom_from_gserialized(g);
+
srid = lwgeom_get_srid(lwgeom);
/* on empty input, return empty output */
diff --git a/contrib/postgis/postgis/gserialized_typmod.c b/contrib/postgis/postgis/gserialized_typmod.c
index 2c9f64b..101e46a 100644
--- a/contrib/postgis/postgis/gserialized_typmod.c
+++ b/contrib/postgis/postgis/gserialized_typmod.c
@@ -138,11 +138,10 @@
if ( typmod_type == POINTTYPE && geom_type == MULTIPOINTTYPE &&
gserialized_is_empty(gser) )
{
- bool is_geodetic = gserialized_is_geodetic(gser);
LWPOINT *empty_point = lwpoint_construct_empty(geom_srid, geom_z, geom_m);
geom_type = POINTTYPE;
pfree(gser);
- if ( is_geodetic )
+ if ( gserialized_is_geodetic(gser) )
gser = geography_serialize(lwpoint_as_lwgeom(empty_point));
else
gser = geometry_serialize(lwpoint_as_lwgeom(empty_point));
@@ -461,4 +460,3 @@
PG_RETURN_INT32(0);
PG_RETURN_INT32(TYPMOD_GET_SRID(typmod));
}
-
diff --git a/contrib/postgis/postgis/lwgeom_functions_analytic.c b/contrib/postgis/postgis/lwgeom_functions_analytic.c
index ee6e3a7..351f3df 100644
--- a/contrib/postgis/postgis/lwgeom_functions_analytic.c
+++ b/contrib/postgis/postgis/lwgeom_functions_analytic.c
@@ -74,9 +74,10 @@
preserve_collapsed = PG_GETARG_BOOL(2);
in = lwgeom_from_gserialized(geom);
+/*#<<<DIA_SVACE_MAJOR*/
if (!in || lwgeom_is_empty(in))
PG_RETURN_NULL();
-
+/*#DIA_SVACE_MAJOR>>>*/
modified = lwgeom_simplify_in_place(in, dist, preserve_collapsed);
if (!modified)
PG_RETURN_POINTER(geom);
diff --git a/contrib/postgis/postgis/lwgeom_in_geohash.c b/contrib/postgis/postgis/lwgeom_in_geohash.c
index b5932df..8a979b7 100644
--- a/contrib/postgis/postgis/lwgeom_in_geohash.c
+++ b/contrib/postgis/postgis/lwgeom_in_geohash.c
@@ -36,15 +36,14 @@
Datum box2d_from_geohash(PG_FUNCTION_ARGS);
Datum point_from_geohash(PG_FUNCTION_ARGS);
-pg_noreturn
-static void
-// pg_attribute_noreturn()
-geohash_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
+/*#<<<DIA_SVACE_CRITICAL*/
+pg_noreturn static void geohash_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
{
POSTGIS_DEBUGF(3, "ST_Box2dFromGeoHash ERROR %i", error_code);
lwpgerror("%s", msg);
pg_unreachable();
}
+/*#DIA_SVACE_CRITICAL>>>*/
static GBOX*
parse_geohash(char *geohash, int precision)
diff --git a/contrib/postgis/postgis/lwgeom_in_gml.c b/contrib/postgis/postgis/lwgeom_in_gml.c
index 99876da..853f812 100644
--- a/contrib/postgis/postgis/lwgeom_in_gml.c
+++ b/contrib/postgis/postgis/lwgeom_in_gml.c
@@ -76,15 +76,15 @@
#define GML_NS ((char *) "http://www.opengis.net/gml")
#define GML32_NS ((char *) "http://www.opengis.net/gml/3.2")
-pg_noreturn
-static void
-// pg_attribute_noreturn()
-gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
+
+/*#<<<DIA_SVACE_CRITICAL*/
+pg_noreturn static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
{
- POSTGIS_DEBUGF(3, "ST_GeomFromGML ERROR %i", error_code);
- lwpgerror("%s", msg);
- pg_unreachable();
+ POSTGIS_DEBUGF(3, "ST_GeomFromGML ERROR %i", error_code);
+ lwpgerror("%s", msg);
+ pg_unreachable();
}
+/*#DIA_SVACE_CRITICAL>>>*/
/**
* Ability to parse GML geometry fragment and to return an LWGEOM
@@ -1134,9 +1134,10 @@
xmlFree(interpolation);
}
+/*#<<<DIA_SVACE_CRITICAL*/
if (lss > 0) ppa = (POINTARRAY**) lwrealloc(ppa,
sizeof(POINTARRAY*) * (lss + 1));
-
+/*#DIA_SVACE_CRITICAL>>>*/
ppa[lss] = parse_gml_data(xa->children, hasz, root_srid);
npoints += ppa[lss]->npoints;
if (ppa[lss]->npoints < 2)
@@ -1299,8 +1300,10 @@
if (!is_gml_namespace(xb, false)) continue;
if (!is_gml_element(xb, "LinearRing")) continue;
+/*#<<<DIA_SVACE_CRITICAL*/
ppa = (POINTARRAY**) lwrealloc(ppa,
sizeof(POINTARRAY*) * (ring + 1));
+/*#DIA_SVACE_CRITICAL>>>*/
ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[ring]->npoints < 4
@@ -1466,8 +1469,10 @@
if (xb->type != XML_ELEMENT_NODE) continue;
if (!is_gml_element(xb, "LinearRing")) continue;
+/*#<<<DIA_SVACE_CRITICAL*/
ppa = (POINTARRAY**) lwrealloc(ppa,
sizeof(POINTARRAY*) * (ring + 1));
+/*#DIA_SVACE_CRITICAL>>>*/
ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[ring]->npoints < 4
diff --git a/contrib/postgis/postgis/lwgeom_inout.c b/contrib/postgis/postgis/lwgeom_inout.c
index dbdd8c3..24d3e10 100644
--- a/contrib/postgis/postgis/lwgeom_inout.c
+++ b/contrib/postgis/postgis/lwgeom_inout.c
@@ -109,11 +109,11 @@
{
/* Roll forward to semi-colon */
char *tmp = str;
- while ( *tmp && *tmp != ';' )
+ while ( *tmp && *tmp != ';' ) /*#<<<DIA_SVACE_MAJOR>>>*/
tmp++;
/* Check next character to see if we have WKB */
- if ( *tmp == ';' && *(tmp+1) == '0' )
+ if ( *tmp == ';' && *(tmp+1) == '0' ) /*#<<<DIA_SVACE_MAJOR>>>*/
{
/* Null terminate the SRID= string */
*tmp = '\0';
diff --git a/contrib/postgis/postgis/mvt.c b/contrib/postgis/postgis/mvt.c
index a4222fc..de676f9 100644
--- a/contrib/postgis/postgis/mvt.c
+++ b/contrib/postgis/postgis/mvt.c
@@ -1106,7 +1106,7 @@
}
/* Zero features => empty bytea output */
- if (ctx->layer && ctx->layer->n_features == 0)
+ if (ctx->layer && ctx->layer->n_features == 0) /*#<<<DIA_SVACE_MAJOR>>>*/
{
bytea* ba_empty = palloc(VARHDRSZ);
SET_VARSIZE(ba_empty, VARHDRSZ);
diff --git a/contrib/postgis/postgis/postgis.sql.in b/contrib/postgis/postgis/postgis.sql.in
index 3980315..c4177ed 100644
--- a/contrib/postgis/postgis/postgis.sql.in
+++ b/contrib/postgis/postgis/postgis.sql.in
@@ -5716,7 +5716,7 @@
RETURNS geometry
AS '
SELECT CASE WHEN @extschema@.ST_GeometryType(@extschema@.ST_GeomFromText($1, $2)) = ''ST_MultiPoint''
- THEN @extschema@.ST_GeomFromText($1, $2)
+ THEN ST_GeomFromText($1, $2)
ELSE NULL END
'
LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE
diff --git a/contrib/postgis/raster/rt_core/rt_geometry.c b/contrib/postgis/raster/rt_core/rt_geometry.c
index 3dd687c..9585bc1 100644
--- a/contrib/postgis/raster/rt_core/rt_geometry.c
+++ b/contrib/postgis/raster/rt_core/rt_geometry.c
@@ -532,52 +532,56 @@
/* specify SRID */
lwgeom_set_srid(mpoly, rt_raster_get_srid(raster));
+/*#<<<DIA_SVACE_MAJOR*/
/* convert to multi */
if (!lwgeom_is_collection(mpoly)) {
tmp = mpoly;
#if POSTGIS_DEBUG_LEVEL > 3
- {
- char *wkt = lwgeom_to_wkt(mpoly, WKT_ISO, DBL_DIG, NULL);
- RASTER_DEBUGF(4, "before multi = %s", wkt);
- rtdealloc(wkt);
- }
+ {
+ char *wkt = lwgeom_to_wkt(mpoly, WKT_ISO, DBL_DIG, NULL);
+ RASTER_DEBUGF(4, "before multi = %s", wkt);
+ rtdealloc(wkt);
+ }
#endif
- RASTER_DEBUGF(4, "mpoly @ %p", mpoly);
+ RASTER_DEBUGF(4, "mpoly @ %p", mpoly);
- /*
- lwgeom_as_multi() only does a shallow clone internally
- so input and output geometries may share memory
- hence the deep clone of the output geometry for returning
- is the only way to guarantee the memory isn't shared
- */
- mpoly = lwgeom_as_multi(tmp);
- clone = lwgeom_clone_deep(mpoly);
- lwgeom_free(tmp);
- lwgeom_free(mpoly);
- mpoly = clone;
+ /*
+ lwgeom_as_multi() only does a shallow clone internally
+ so input and output geometries may share memory
+ hence the deep clone of the output geometry for returning
+ is the only way to guarantee the memory isn't shared
+ */
+ mpoly = lwgeom_as_multi(tmp);
+ clone = lwgeom_clone_deep(mpoly);
+ lwgeom_free(tmp);
+ lwgeom_free(mpoly);
+ mpoly = clone;
- RASTER_DEBUGF(4, "mpoly @ %p", mpoly);
+ RASTER_DEBUGF(4, "mpoly @ %p", mpoly);
+
+#if POSTGIS_DEBUG_LEVEL > 3
+ {
+ char *wkt = lwgeom_to_wkt(mpoly, WKT_ISO, DBL_DIG, NULL);
+ RASTER_DEBUGF(4, "after multi = %s", wkt);
+ rtdealloc(wkt);
+ }
+#endif
+ }
#if POSTGIS_DEBUG_LEVEL > 3
{
char *wkt = lwgeom_to_wkt(mpoly, WKT_ISO, DBL_DIG, NULL);
- RASTER_DEBUGF(4, "after multi = %s", wkt);
+ RASTER_DEBUGF(4, "returning geometry = %s", wkt);
rtdealloc(wkt);
}
#endif
- }
-#if POSTGIS_DEBUG_LEVEL > 3
- {
- char *wkt = lwgeom_to_wkt(mpoly, WKT_ISO, DBL_DIG, NULL);
- RASTER_DEBUGF(4, "returning geometry = %s", wkt);
- rtdealloc(wkt);
- }
-#endif
+ *surface = lwgeom_as_lwmpoly(mpoly);
+ return ES_NONE;
+/*#DIA_SVACE_MAJOR>>>*/
- *surface = lwgeom_as_lwmpoly(mpoly);
return ES_NONE;
}
diff --git a/contrib/postgis/raster/rt_core/rt_raster.c b/contrib/postgis/raster/rt_core/rt_raster.c
index 955a126..49c4221 100644
--- a/contrib/postgis/raster/rt_core/rt_raster.c
+++ b/contrib/postgis/raster/rt_core/rt_raster.c
@@ -1283,12 +1283,13 @@
assert(NULL != torast);
assert(NULL != fromrast);
+/*#<<<DIA_SVACE_CRITICAL*/
/* Check raster dimensions */
if (!torast || torast->height != fromrast->height || torast->width != fromrast->width) {
rtwarn("rt_raster_copy_band: Attempting to add a band with different width or height");
return -1;
}
-
+/*#DIA_SVACE_CRITICAL>>>*/
/* Check bands limits */
if (fromrast->numBands < 1) {
rtwarn("rt_raster_copy_band: Second raster has no band");
diff --git a/contrib/postgis/raster/rt_core/rt_statistics.c b/contrib/postgis/raster/rt_core/rt_statistics.c
index 5b1bf70..4702d7b 100644
--- a/contrib/postgis/raster/rt_core/rt_statistics.c
+++ b/contrib/postgis/raster/rt_core/rt_statistics.c
@@ -1275,7 +1275,7 @@
/* insert */
/* OPTIMIZATION: check to see if value exceeds last value */
- if (NULL != qll->tail && (value > qll->tail->value || FLT_EQ(value, qll->tail->value))) {
+ if (value > qll->tail->value || FLT_EQ(value, qll->tail->value)) { /*#<<<DIA_SVACE_MAJOR>>>*/
idx = qll->count;
qle = quantile_llist_insert(qll->tail, value, &idx);
}
@@ -1329,7 +1329,7 @@
/* insert value */
RASTER_DEBUGF(4, "adding %f to list", value);
/* OPTIMIZATION: check to see if value exceeds last value */
- if (value > qll->tail->value || FLT_EQ(value, qll->tail->value)) {
+ if (value > qll->tail->value || FLT_EQ(value, qll->tail->value)) { /*#<<<DIA_SVACE_MAJOR>>>*/
idx = qll->count;
qle = quantile_llist_insert(qll->tail, value, &idx);
}
@@ -1399,7 +1399,7 @@
/* insert value */
RASTER_DEBUGF(4, "adding %f to list", value);
/* OPTIMIZATION: check to see if value exceeds last value */
- if (value > qll->tail->value || FLT_EQ(value, qll->tail->value)) {
+ if (NULL != qll->tail && (value > qll->tail->value || FLT_EQ(value, qll->tail->value))) {
idx = qll->count;
qle = quantile_llist_insert(qll->tail, value, &idx);
}
diff --git a/contrib/postgis/raster/rt_core/rt_wkb.c b/contrib/postgis/raster/rt_core/rt_wkb.c
index cc53cb2..88daa96 100644
--- a/contrib/postgis/raster/rt_core/rt_wkb.c
+++ b/contrib/postgis/raster/rt_core/rt_wkb.c
@@ -197,7 +197,7 @@
}
/* This is an on-disk band */
- sz = (uint32_t)width * height * pixbytes;
+ sz = (size_t)width * height * pixbytes;
if (((*ptr) + sz) > end) {
rterror("rt_band_from_wkb: Premature end of WKB on band data reading (%s:%d)",
__FILE__, __LINE__);
@@ -236,7 +236,7 @@
}
flipme = band->data.mem;
- sz = (uint32_t)width * height;
+ sz = (size_t)width * height;
for (v = 0; v < sz; ++v) {
flipper(flipme);
flipme += pixbytes;
@@ -252,7 +252,7 @@
uint8_t maxVal = band->pixtype == PT_1BB ? 1 : (band->pixtype == PT_2BUI ? 3 : 15);
uint8_t val;
- sz = (uint32_t)width * height;
+ sz = (size_t)width*height;
for (v = 0; v < sz; ++v) {
val = ((uint8_t*) band->data.mem)[v];
if (val > maxVal) {
diff --git a/contrib/postgis/raster/rt_pg/rtpg_create.c b/contrib/postgis/raster/rt_pg/rtpg_create.c
index 533c9f5..e326d10 100644
--- a/contrib/postgis/raster/rt_pg/rtpg_create.c
+++ b/contrib/postgis/raster/rt_pg/rtpg_create.c
@@ -1213,13 +1213,15 @@
funcctx->user_fctx = arg1;
/* total number of tuples to be returned */
- funcctx->max_calls = ((uint64_t) arg1->tile.nx * (uint64_t) arg1->tile.ny);
+ funcctx->max_calls = ((uint64_t) arg1->tile.nx * (uint64_t) arg1->tile.ny); /*#<<<DIA_SVACE_MAJOR>>>*/
MemoryContextSwitchTo(oldcontext);
}
+/*#<<<DIA_SVACE_MAJOR*/
if (funcctx->max_calls > INT32_MAX)
elog(ERROR, "RASTER_tile: Overflow while working with raster points.");
+/*#DIA_SVACE_MAJOR>>>*/
/* stuff done on every call of the function */
funcctx = SRF_PERCALL_SETUP();
diff --git a/contrib/postgis/raster/rt_pg/rtpg_gdal.c b/contrib/postgis/raster/rt_pg/rtpg_gdal.c
index c5a3456..0d19c4c 100644
--- a/contrib/postgis/raster/rt_pg/rtpg_gdal.c
+++ b/contrib/postgis/raster/rt_pg/rtpg_gdal.c
@@ -250,11 +250,13 @@
break;
}
+/*#<<<DIA_SVACE_CRITICAL*/
if (option && strlen(option)) {
options[j] = (char *) palloc(sizeof(char) * (strlen(option) + 1));
strcpy(options[j], option);
j++;
}
+/*#DIA_SVACE_CRITICAL>>>*/
}
if (j > 0) {
diff --git a/contrib/postgis/raster/rt_pg/rtpg_geometry.c b/contrib/postgis/raster/rt_pg/rtpg_geometry.c
index 03c8505..c6e5871 100644
--- a/contrib/postgis/raster/rt_pg/rtpg_geometry.c
+++ b/contrib/postgis/raster/rt_pg/rtpg_geometry.c
@@ -1218,6 +1218,7 @@
break;
}
+/*#<<<DIA_SVACE_CRITICAL*/
if (pixeltype && strlen(pixeltype)) {
pixtype = rt_pixtype_index_from_name(pixeltype);
if (pixtype == PT_END) {
@@ -1234,6 +1235,7 @@
pixtypes[j] = pixtype;
j++;
}
+/*#DIA_SVACE_CRITICAL>>>*/
}
if (j > 0) {
@@ -1533,8 +1535,9 @@
options_len++;
options = (char **) repalloc(options, sizeof(char *) * options_len);
}
-
+/*#<<<DIA_SVACE_CRITICAL*/
options[options_len - 1] = (char *) palloc(sizeof(char) * (strlen("ALL_TOUCHED=TRUE") + 1));
+/*#DIA_SVACE_CRITICAL>>>*/
strcpy(options[options_len - 1], "ALL_TOUCHED=TRUE");
}
diff --git a/contrib/postgis/raster/rt_pg/rtpg_internal.c b/contrib/postgis/raster/rt_pg/rtpg_internal.c
index 630b6c8..5452670 100644
--- a/contrib/postgis/raster/rt_pg/rtpg_internal.c
+++ b/contrib/postgis/raster/rt_pg/rtpg_internal.c
@@ -69,7 +69,7 @@
while ((tmp = strstr(tmp, oldstr)) != NULL && found != limit)
found++, tmp += oldlen;
- length = strlen(str) + found * (newlen - oldlen);
+ length = (int64_t) strlen(str) + found * ((int64_t) newlen - (int64_t) oldlen); /*#<<<DIA_SVACE_MAJOR>>>*/
if ((result = (char *) palloc(length + 1)) == NULL) {
fprintf(stderr, "Not enough memory\n");
found = -1;
diff --git a/contrib/postgis/regress/loader/ReprojectPtsD.select.sql b/contrib/postgis/regress/loader/ReprojectPtsD.select.sql
index 060f333..302ce25 100644
--- a/contrib/postgis/regress/loader/ReprojectPtsD.select.sql
+++ b/contrib/postgis/regress/loader/ReprojectPtsD.select.sql
@@ -1,2 +1 @@
select ST_AsText(ST_SnapToGrid(the_geom,0.00000001), 8) from loadedshp;
-
diff --git a/contrib/postgis/regress/loader/ReprojectPtsGeogD.select.sql b/contrib/postgis/regress/loader/ReprojectPtsGeogD.select.sql
index 899d3cb..3ca05e8 100644
--- a/contrib/postgis/regress/loader/ReprojectPtsGeogD.select.sql
+++ b/contrib/postgis/regress/loader/ReprojectPtsGeogD.select.sql
@@ -1,2 +1 @@
select ST_AsText(ST_SnapToGrid(the_geom::geometry,0.00000001), 8) from loadedshp;
-
diff --git a/contrib/postgis/sfcgal/regress/sfcgal_v2.sql b/contrib/postgis/sfcgal/regress/sfcgal_v2.sql
index 49ba93a..aedb60a 100644
--- a/contrib/postgis/sfcgal/regress/sfcgal_v2.sql
+++ b/contrib/postgis/sfcgal/regress/sfcgal_v2.sql
@@ -11,7 +11,7 @@
SELECT 'CG_Translate', ST_AsText(CG_Translate('LINESTRING(1 1, 2 2)', 1, -1), 0);
SELECT 'CG_3DTranslate', ST_AsText(CG_3DTranslate('POINT(1 1 1)', 1, -1, 2), 0);
SELECT 'CG_StraightSkeletonPartition', ST_AsText(ST_Collect(dmp.geom), 2) FROM ST_Dump(CG_StraightSkeletonPartition('POLYGON((0 0, 4 0, 2 2, 0 0))', true)) as dmp;
-SELECT 'CG_3DBuffer', ST_GeometryType(CG_3DBuffer('POINT(0 0 0)', 1, 8, 0));
+SELECT 'CG_3DBuffer', ST_AsText(CG_3DBuffer('POINT(0 0 0)', 1, 8, 0), 2);
SELECT 'CG_Rotate', ST_AsText(ST_ReducePrecision(CG_Rotate('LINESTRING EMPTY', pi()/2), 0.1));
SELECT 'CG_2DRotate', ST_AsText(CG_2DRotate('POINT EMPTY', pi()/2, 1, 1), 0);
SELECT 'CG_3DRotate', ST_AsText(ST_ReducePrecision(CG_3DRotate('POINT EMPTY', pi()/2, 0, 0, 1), 0.1));
diff --git a/contrib/postgis/sfcgal/regress/sfcgal_v2_expected b/contrib/postgis/sfcgal/regress/sfcgal_v2_expected
index 7696edd..4560a09 100644
--- a/contrib/postgis/sfcgal/regress/sfcgal_v2_expected
+++ b/contrib/postgis/sfcgal/regress/sfcgal_v2_expected
@@ -10,7 +10,7 @@
CG_Translate|LINESTRING(2 0,3 1)
CG_3DTranslate|POINT Z (2 0 3)
CG_StraightSkeletonPartition|MULTIPOLYGON(((0 0,2 0.83,2 2)),((4 0,2 0.83,0 0)),((2 2,2 0.83,4 0)))
-CG_3DBuffer|ST_PolyhedralSurface
+CG_3DBuffer|POLYHEDRALSURFACE Z (((0 0 1,0.5 -0.5 0.71,0 -0.71 0.71,0 0 1)),((0 0 1,0.71 -4.33e-17 0.71,0.5 -0.5 0.71,0 0 1)),((0 0 1,0.5 0.5 0.71,0.71 -4.33e-17 0.71,0 0 1)),((0 0 1,8.66e-17 0.71 0.71,0.5 0.5 0.71,0 0 1)),((0 0 1,-0.5 0.5 0.71,8.66e-17 0.71 0.71,0 0 1)),((0 0 1,-0.71 1.3e-16 0.71,-0.5 0.5 0.71,0 0 1)),((0 0 1,-0.5 -0.5 0.71,-0.71 1.3e-16 0.71,0 0 1)),((0 0 1,0 -0.71 0.71,-0.5 -0.5 0.71,0 0 1)),((0 -0.71 0.71,0.5 -0.5 0.71,0.71 -0.71 6.12e-17,0 -0.71 0.71)),((0 -0.71 0.71,0.71 -0.71 6.12e-17,0 -1 6.12e-17,0 -0.71 0.71)),((0.5 -0.5 0.71,0.71 -4.33e-17 0.71,1 -6.12e-17 6.12e-17,0.5 -0.5 0.71)),((0.5 -0.5 0.71,1 -6.12e-17 6.12e-17,0.71 -0.71 6.12e-17,0.5 -0.5 0.71)),((0.71 -4.33e-17 0.71,0.5 0.5 0.71,0.71 0.71 6.12e-17,0.71 -4.33e-17 0.71)),((0.71 -4.33e-17 0.71,0.71 0.71 6.12e-17,1 -6.12e-17 6.12e-17,0.71 -4.33e-17 0.71)),((0.5 0.5 0.71,8.66e-17 0.71 0.71,1.22e-16 1 6.12e-17,0.5 0.5 0.71)),((0.5 0.5 0.71,1.22e-16 1 6.12e-17,0.71 0.71 6.12e-17,0.5 0.5 0.71)),((8.66e-17 0.71 0.71,-0.5 0.5 0.71,-0.71 0.71 6.12e-17,8.66e-17 0.71 0.71)),((8.66e-17 0.71 0.71,-0.71 0.71 6.12e-17,1.22e-16 1 6.12e-17,8.66e-17 0.71 0.71)),((-0.5 0.5 0.71,-0.71 1.3e-16 0.71,-1 1.84e-16 6.12e-17,-0.5 0.5 0.71)),((-0.5 0.5 0.71,-1 1.84e-16 6.12e-17,-0.71 0.71 6.12e-17,-0.5 0.5 0.71)),((-0.71 1.3e-16 0.71,-0.5 -0.5 0.71,-0.71 -0.71 6.12e-17,-0.71 1.3e-16 0.71)),((-0.71 1.3e-16 0.71,-0.71 -0.71 6.12e-17,-1 1.84e-16 6.12e-17,-0.71 1.3e-16 0.71)),((-0.5 -0.5 0.71,0 -0.71 0.71,0 -1 6.12e-17,-0.5 -0.5 0.71)),((-0.5 -0.5 0.71,0 -1 6.12e-17,-0.71 -0.71 6.12e-17,-0.5 -0.5 0.71)),((0 -1 6.12e-17,0.71 -0.71 6.12e-17,0.5 -0.5 -0.71,0 -1 6.12e-17)),((0 -1 6.12e-17,0.5 -0.5 -0.71,0 -0.71 -0.71,0 -1 6.12e-17)),((0.71 -0.71 6.12e-17,1 -6.12e-17 6.12e-17,0.71 -4.33e-17 -0.71,0.71 -0.71 6.12e-17)),((0.71 -0.71 6.12e-17,0.71 -4.33e-17 -0.71,0.5 -0.5 -0.71,0.71 -0.71 6.12e-17)),((1 -6.12e-17 6.12e-17,0.71 0.71 6.12e-17,0.5 0.5 -0.71,1 -6.12e-17 6.12e-17)),((1 -6.12e-17 6.12e-17,0.5 0.5 -0.71,0.71 -4.33e-17 -0.71,1 -6.12e-17 6.12e-17)),((0.71 0.71 6.12e-17,1.22e-16 1 6.12e-17,8.66e-17 0.71 -0.71,0.71 0.71 6.12e-17)),((0.71 0.71 6.12e-17,8.66e-17 0.71 -0.71,0.5 0.5 -0.71,0.71 0.71 6.12e-17)),((1.22e-16 1 6.12e-17,-0.71 0.71 6.12e-17,-0.5 0.5 -0.71,1.22e-16 1 6.12e-17)),((1.22e-16 1 6.12e-17,-0.5 0.5 -0.71,8.66e-17 0.71 -0.71,1.22e-16 1 6.12e-17)),((-0.71 0.71 6.12e-17,-1 1.84e-16 6.12e-17,-0.71 1.3e-16 -0.71,-0.71 0.71 6.12e-17)),((-0.71 0.71 6.12e-17,-0.71 1.3e-16 -0.71,-0.5 0.5 -0.71,-0.71 0.71 6.12e-17)),((-1 1.84e-16 6.12e-17,-0.71 -0.71 6.12e-17,-0.5 -0.5 -0.71,-1 1.84e-16 6.12e-17)),((-1 1.84e-16 6.12e-17,-0.5 -0.5 -0.71,-0.71 1.3e-16 -0.71,-1 1.84e-16 6.12e-17)),((-0.71 -0.71 6.12e-17,0 -1 6.12e-17,0 -0.71 -0.71,-0.71 -0.71 6.12e-17)),((-0.71 -0.71 6.12e-17,0 -0.71 -0.71,-0.5 -0.5 -0.71,-0.71 -0.71 6.12e-17)),((0 0 -1,0 -0.71 -0.71,0.5 -0.5 -0.71,0 0 -1)),((0 0 -1,0.5 -0.5 -0.71,0.71 -4.33e-17 -0.71,0 0 -1)),((0 0 -1,0.71 -4.33e-17 -0.71,0.5 0.5 -0.71,0 0 -1)),((0 0 -1,0.5 0.5 -0.71,8.66e-17 0.71 -0.71,0 0 -1)),((0 0 -1,8.66e-17 0.71 -0.71,-0.5 0.5 -0.71,0 0 -1)),((0 0 -1,-0.5 0.5 -0.71,-0.71 1.3e-16 -0.71,0 0 -1)),((0 0 -1,-0.71 1.3e-16 -0.71,-0.5 -0.5 -0.71,0 0 -1)),((0 0 -1,-0.5 -0.5 -0.71,0 -0.71 -0.71,0 0 -1)))
CG_Rotate|LINESTRING EMPTY
CG_2DRotate|POINT EMPTY
CG_3DRotate|POINT Z EMPTY
diff --git a/contrib/postgis/topology/sql/cleanup/RemoveUnusedPrimitives.sql.in b/contrib/postgis/topology/sql/cleanup/RemoveUnusedPrimitives.sql.in
index 288655a..31951bf 100644
--- a/contrib/postgis/topology/sql/cleanup/RemoveUnusedPrimitives.sql.in
+++ b/contrib/postgis/topology/sql/cleanup/RemoveUnusedPrimitives.sql.in
@@ -41,7 +41,7 @@
moreMergedFaces BIGINT[];
BEGIN
- topo := topology.findTopology(atopology);
+ topo := findTopology(atopology);
IF topo.id IS NULL THEN
RAISE EXCEPTION 'Could not find topology "%"', atopology;
END IF;
@@ -698,4 +698,3 @@
RETURN deletedEdges + deletedNodes + deletedNodesDeg2;
END;
$BODY$ LANGUAGE 'plpgsql' VOLATILE;
-
diff --git a/contrib/postgis/topology/test/regress/fix_topogeometry_columns.sql b/contrib/postgis/topology/test/regress/fix_topogeometry_columns.sql
index dd3454d..725e363 100644
--- a/contrib/postgis/topology/test/regress/fix_topogeometry_columns.sql
+++ b/contrib/postgis/topology/test/regress/fix_topogeometry_columns.sql
@@ -5,8 +5,7 @@
\i ../more_features.sql
\i ../hierarchy.sql
SELECT topology.FixCorruptTopoGeometryColumn(schema_name, table_name, feature_column)
-FROM topology.layer
-ORDER BY schema_name, table_name, feature_column;
+FROM topology.layer;
SELECT topology.DropTopology('city_data');
DROP SCHEMA features CASCADE;
diff --git a/contrib/postgis/topology/test/regress/fix_topogeometry_columns_expected b/contrib/postgis/topology/test/regress/fix_topogeometry_columns_expected
index c17525c..3652720 100644
--- a/contrib/postgis/topology/test/regress/fix_topogeometry_columns_expected
+++ b/contrib/postgis/topology/test/regress/fix_topogeometry_columns_expected
@@ -1,7 +1,7 @@
-0 rows updated for features.big_parcels.feature column to bigint id type
-0 rows updated for features.big_signs.feature column to bigint id type
-0 rows updated for features.big_streets.feature column to bigint id type
-0 rows updated for features.city_streets.feature column to bigint id type
0 rows updated for features.land_parcels.feature column to bigint id type
0 rows updated for features.traffic_signs.feature column to bigint id type
+0 rows updated for features.city_streets.feature column to bigint id type
+0 rows updated for features.big_parcels.feature column to bigint id type
+0 rows updated for features.big_streets.feature column to bigint id type
+0 rows updated for features.big_signs.feature column to bigint id type
Topology 'city_data' dropped
diff --git a/contrib/postgis/topology/test/regress/removeunusedprimitives.sql b/contrib/postgis/topology/test/regress/removeunusedprimitives.sql
index 23817d0..be35c69 100644
--- a/contrib/postgis/topology/test/regress/removeunusedprimitives.sql
+++ b/contrib/postgis/topology/test/regress/removeunusedprimitives.sql
@@ -1,5 +1,4 @@
set client_min_messages to WARNING;
-set search_path to public,pg_catalog;
\i :top_builddir/topology/test/load_topology.sql
\i ../load_features.sql
@@ -75,7 +74,7 @@
DELETE FROM features.city_streets WHERE feature_name IN ( 'R1' )
RETURNING feature
), clear AS (
- SELECT topology.clearTopoGeom(feature) FROM deleted
+ SELECT clearTopoGeom(feature) FROM deleted
) SELECT NULL FROM clear;
--set client_min_messages to DEBUG;
@@ -89,7 +88,7 @@
DELETE FROM features.traffic_signs WHERE feature_name IN ( 'S3' )
RETURNING feature
), clear AS (
- SELECT topology.clearTopoGeom(feature) FROM deleted
+ SELECT clearTopoGeom(feature) FROM deleted
) SELECT NULL FROM clear;
--set client_min_messages to DEBUG;
@@ -103,7 +102,7 @@
DELETE FROM features.traffic_signs WHERE feature_name IN ( 'S4' )
RETURNING feature
), clear AS (
- SELECT topology.clearTopoGeom(feature) FROM deleted
+ SELECT clearTopoGeom(feature) FROM deleted
) SELECT NULL FROM clear;
--set client_min_messages to DEBUG;
@@ -125,16 +124,16 @@
FROM deleted
),
clear AS (
- SELECT sp, topology.clearTopoGeom(feature)
+ SELECT sp, clearTopoGeom(feature)
FROM start_point
)
INSERT INTO features.traffic_signs ( feature_name, feature )
SELECT
'TS1',
- topology.toTopoGeom(
+ toTopoGeom(
sp,
'city_data',
- layer_id(topology.findLayer('features', 'traffic_signs', 'feature')),
+ layer_id(findLayer('features', 'traffic_signs', 'feature')),
0
)
FROM clear;
@@ -175,12 +174,12 @@
FROM features.traffic_signs WHERE feature_name = 'S1'
),
triangle_right AS (
- SELECT topology.TopoGeo_addLineString( 'city_data',
+ SELECT TopoGeo_addLineString( 'city_data',
features.triangle(g, 4, 4)
) FROM node
),
triangle_left AS (
- SELECT topology.TopoGeo_addLineString( 'city_data',
+ SELECT TopoGeo_addLineString( 'city_data',
features.triangle(g, -4, 4)
) FROM node
)
@@ -195,7 +194,7 @@
RETURNING feature
),
clear AS (
- SELECT topology.clearTopoGeom(feature)
+ SELECT clearTopoGeom(feature)
FROM deleted
)
SELECT NULL FROM clear;
@@ -208,7 +207,7 @@
-- See https://trac.osgeo.org/postgis/ticket/5289
SELECT NULL FROM (
- SELECT topology.toTopoGeom(
+ SELECT toTopoGeom(
ST_MakeLine(
ST_EndPoint( ST_GeometryN(feature,1) ),
ST_StartPoint( ST_GeometryN(feature,1) )
@@ -231,7 +230,7 @@
-- being required as endpoint of closed edge 2) while
-- edges themselves would still be both used by R4 feature.
UPDATE features.city_streets
-SET feature = topology.TopoGeom_addElement(feature, ARRAY[2, 2])
+SET feature = TopoGeom_addElement(feature, ARRAY[2, 2])
WHERE feature_name = 'R4';
UPDATE features.city_streets SET geom = feature::geometry
WHERE feature_name = 'R4';
@@ -244,6 +243,5 @@
-- Cleanup
--
-SELECT NULL FROM topology.DropTopology('city_data');
+SELECT NULL FROM DropTopology('city_data');
DROP SCHEMA features CASCADE;
-RESET search_path;
diff --git a/contrib/procdate/expected/proc_date.out b/contrib/procdate/expected/proc_date.out
index e98d5d4..e25adbc 100644
--- a/contrib/procdate/expected/proc_date.out
+++ b/contrib/procdate/expected/proc_date.out
@@ -1,123 +1,123 @@
-SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_drop_trigger';
- ?column?
-----------
- t
-(1 row)
-
-SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_modification_trigger';
- ?column?
-----------
- t
-(1 row)
-
-CREATE FUNCTION test_fn() RETURNS INT AS $$ SELECT 1 $$ LANGUAGE SQL;
-CREATE FUNCTION
-
-SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_fn';
- ?column?
-----------
- t
-(1 row)
-
-SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_fn';
- ?column?
-----------
- t
-(1 row)
-
-ALTER FUNCTION test_fn() RENAME TO test_fn_modified;
-ALTER FUNCTION
-
-SELECT
- (modification_date > creation_date) AS modified,
- name = 'test_fn_modified' AS name_updated
-FROM proc_date_modification
-WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_fn_modified');
- modified | name_updated
-----------+--------------
- t | t
-(1 row)
-
-DROP FUNCTION test_fn_modified();
-DROP FUNCTION
-
-SELECT
- prooid = -1 AS marked_deleted,
- deletion_user IS NOT NULL,
- deletion_date IS NOT NULL
-FROM proc_date_modification
-WHERE name = 'test_fn_modified';
- marked_deleted | ?column? | ?column?
-----------------+----------+----------
- t | t | t
-(1 row)
-
-SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_fn_modified';
- ?column?
-----------
- t
-(1 row)
-
-CREATE PROCEDURE test_proc() AS $$ BEGIN END; $$ LANGUAGE plpgsql;
-CREATE PROCEDURE
-
-SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_proc';
- ?column?
-----------
- t
-(1 row)
-
-SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_proc';
- ?column?
-----------
- t
-(1 row)
-
-ALTER PROCEDURE test_proc() RENAME TO test_proc_modified;
-ALTER PROCEDURE
-
-SELECT
- (modification_date > creation_date) AS modified,
- name = 'test_proc_modified' AS name_updated
-FROM proc_date_modification
-WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_proc_modified');
- modified | name_updated
-----------+--------------
- t | t
-(1 row)
-
-DROP PROCEDURE test_proc_modified();
-DROP PROCEDURE
-
-SELECT
- prooid = -1 AS marked_deleted,
- deletion_user IS NOT NULL,
- deletion_date IS NOT NULL
-FROM proc_date_modification
-WHERE name = 'test_proc_modified';
- marked_deleted | ?column? | ?column?
-----------------+----------+----------
- t | t | t
-(1 row)
-
-SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_proc_modified';
- ?column?
-----------
- t
-(1 row)
-
-CALL proc_date_clear();
-CALL
-
-SELECT * FROM proc_date_modification WHERE name LIKE 'test_%' AND prooid = -1;
- prooid | name | creation_user | creation_date | modification_user | modification_date | deletion_user | deletion_date
---------+------+---------------+---------------+-------------------+-------------------+---------------+---------------
+SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_drop_trigger';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_modification_trigger';
+ ?column?
+----------
+ t
+(1 row)
+
+CREATE FUNCTION test_fn() RETURNS INT AS $$ SELECT 1 $$ LANGUAGE SQL;
+CREATE FUNCTION
+
+SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_fn';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_fn';
+ ?column?
+----------
+ t
+(1 row)
+
+ALTER FUNCTION test_fn() RENAME TO test_fn_modified;
+ALTER FUNCTION
+
+SELECT
+ (modification_date > creation_date) AS modified,
+ name = 'test_fn_modified' AS name_updated
+FROM proc_date_modification
+WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_fn_modified');
+ modified | name_updated
+----------+--------------
+ t | t
+(1 row)
+
+DROP FUNCTION test_fn_modified();
+DROP FUNCTION
+
+SELECT
+ prooid = -1 AS marked_deleted,
+ deletion_user IS NOT NULL,
+ deletion_date IS NOT NULL
+FROM proc_date_modification
+WHERE name = 'test_fn_modified';
+ marked_deleted | ?column? | ?column?
+----------------+----------+----------
+ t | t | t
+(1 row)
+
+SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_fn_modified';
+ ?column?
+----------
+ t
+(1 row)
+
+CREATE PROCEDURE test_proc() AS $$ BEGIN END; $$ LANGUAGE plpgsql;
+CREATE PROCEDURE
+
+SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_proc';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_proc';
+ ?column?
+----------
+ t
+(1 row)
+
+ALTER PROCEDURE test_proc() RENAME TO test_proc_modified;
+ALTER PROCEDURE
+
+SELECT
+ (modification_date > creation_date) AS modified,
+ name = 'test_proc_modified' AS name_updated
+FROM proc_date_modification
+WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_proc_modified');
+ modified | name_updated
+----------+--------------
+ t | t
+(1 row)
+
+DROP PROCEDURE test_proc_modified();
+DROP PROCEDURE
+
+SELECT
+ prooid = -1 AS marked_deleted,
+ deletion_user IS NOT NULL,
+ deletion_date IS NOT NULL
+FROM proc_date_modification
+WHERE name = 'test_proc_modified';
+ marked_deleted | ?column? | ?column?
+----------------+----------+----------
+ t | t | t
+(1 row)
+
+SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_proc_modified';
+ ?column?
+----------
+ t
+(1 row)
+
+CALL proc_date_clear();
+CALL
+
+SELECT * FROM proc_date_modification WHERE name LIKE 'test_%' AND prooid = -1;
+ prooid | name | creation_user | creation_date | modification_user | modification_date | deletion_user | deletion_date
+--------+------+---------------+---------------+-------------------+-------------------+---------------+---------------
(0 rows)
\ No newline at end of file
diff --git a/contrib/procdate/sql/proc_date.sql b/contrib/procdate/sql/proc_date.sql
index 526e99e..d19b1dc 100644
--- a/contrib/procdate/sql/proc_date.sql
+++ b/contrib/procdate/sql/proc_date.sql
@@ -1,83 +1,83 @@
--- Проверка созданных объектов
-SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_drop_trigger';
-SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_modification_trigger';
-
--- Тест 1: Создание функции
-CREATE FUNCTION test_fn() RETURNS INT AS $$ SELECT 1 $$ LANGUAGE SQL;
-
--- Проверка записи
-SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_fn';
-
--- Проверка времени создания
-SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_fn';
-
--- Тест 2: Изменение функции
-ALTER FUNCTION test_fn() RENAME TO test_fn_modified;
-
--- Проверка времени изменений
-SELECT
- (modification_date > creation_date) AS modified,
- name = 'test_fn_modified' AS name_updated
-FROM proc_date_modification
-WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_fn_modified');
-
--- Тест 3: Удаление функции
-DROP FUNCTION test_fn_modified();
-
--- Проверка пометки на удаление
-SELECT
- prooid = -1 AS marked_deleted,
- deletion_user IS NOT NULL,
- deletion_date IS NOT NULL
-FROM proc_date_modification
-WHERE name = 'test_fn_modified';
-
--- Проверка времени удаления
-SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_fn_modified';
-
--- Тест 4: Создание процедуры
-CREATE PROCEDURE test_proc() AS $$ BEGIN END; $$ LANGUAGE plpgsql;
-
--- Проверка записи
-SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_proc';
-
--- Проверка времени создания
-SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_proc';
-
--- Тест 5: Изменение процедуры
-ALTER PROCEDURE test_proc() RENAME TO test_proc_modified;
-
--- Проверка времени изменений
-SELECT
- (modification_date > creation_date) AS modified,
- name = 'test_proc_modified' AS name_updated
-FROM proc_date_modification
-WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_proc_modified');
-
--- Тест 6: Удаление процедуры
-DROP PROCEDURE test_proc_modified();
-
--- Проверка пометки на удаление
-SELECT
- prooid = -1 AS marked_deleted,
- deletion_user IS NOT NULL,
- deletion_date IS NOT NULL
-FROM proc_date_modification
-WHERE name = 'test_proc_modified';
-
--- Проверка времени удаления
-SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
-FROM proc_date_modification
-WHERE name = 'test_proc_modified';
-
--- Тест 7: Очистка удаленных записей
-CALL proc_date_clear();
-
--- Проверка отсутствия удаленных объектов
-SELECT * FROM proc_date_modification WHERE name LIKE 'test_%' AND prooid = -1;
+-- Проверка созданных объектов
+SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_drop_trigger';
+SELECT oid is not null FROM pg_event_trigger WHERE evtname = 'proc_date_modification_trigger';
+
+-- Тест 1: Создание функции
+CREATE FUNCTION test_fn() RETURNS INT AS $$ SELECT 1 $$ LANGUAGE SQL;
+
+-- Проверка записи
+SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_fn';
+
+-- Проверка времени создания
+SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_fn';
+
+-- Тест 2: Изменение функции
+ALTER FUNCTION test_fn() RENAME TO test_fn_modified;
+
+-- Проверка времени изменений
+SELECT
+ (modification_date > creation_date) AS modified,
+ name = 'test_fn_modified' AS name_updated
+FROM proc_date_modification
+WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_fn_modified');
+
+-- Тест 3: Удаление функции
+DROP FUNCTION test_fn_modified();
+
+-- Проверка пометки на удаление
+SELECT
+ prooid = -1 AS marked_deleted,
+ deletion_user IS NOT NULL,
+ deletion_date IS NOT NULL
+FROM proc_date_modification
+WHERE name = 'test_fn_modified';
+
+-- Проверка времени удаления
+SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_fn_modified';
+
+-- Тест 4: Создание процедуры
+CREATE PROCEDURE test_proc() AS $$ BEGIN END; $$ LANGUAGE plpgsql;
+
+-- Проверка записи
+SELECT prooid is not null FROM proc_date_modification WHERE name = 'test_proc';
+
+-- Проверка времени создания
+SELECT to_char(creation_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_proc';
+
+-- Тест 5: Изменение процедуры
+ALTER PROCEDURE test_proc() RENAME TO test_proc_modified;
+
+-- Проверка времени изменений
+SELECT
+ (modification_date > creation_date) AS modified,
+ name = 'test_proc_modified' AS name_updated
+FROM proc_date_modification
+WHERE prooid = (SELECT oid FROM pg_proc WHERE proname = 'test_proc_modified');
+
+-- Тест 6: Удаление процедуры
+DROP PROCEDURE test_proc_modified();
+
+-- Проверка пометки на удаление
+SELECT
+ prooid = -1 AS marked_deleted,
+ deletion_user IS NOT NULL,
+ deletion_date IS NOT NULL
+FROM proc_date_modification
+WHERE name = 'test_proc_modified';
+
+-- Проверка времени удаления
+SELECT to_char(deletion_date, 'YYYY-MM-DD HH24:MI') = (SELECT to_char(current_timestamp, 'YYYY-MM-DD HH24:MI'))
+FROM proc_date_modification
+WHERE name = 'test_proc_modified';
+
+-- Тест 7: Очистка удаленных записей
+CALL proc_date_clear();
+
+-- Проверка отсутствия удаленных объектов
+SELECT * FROM proc_date_modification WHERE name LIKE 'test_%' AND prooid = -1;
diff --git a/db_cr_all.sh b/db_cr_all.sh
index 5226589..646576d 100755
--- a/db_cr_all.sh
+++ b/db_cr_all.sh
@@ -16,29 +16,91 @@
BIN_PATH="/usr/local/rudb/bin"
DATA_DIR="/usr/local/rudb/data1"
PORT=5432
-DBUSER="postgres"
+DBUSER="${RUDB_DBUSER:-postgres}"
+DBOSUSER="${RUDB_OS_USER:-}"
LOG_FILE="$DATA_DIR/server.log"
-# Получаем ID текущего пользователя
-CUR_UID=$(id -u)
-CUR_GID=$(id -g)
+pick_dbosuser() {
+ if [ -n "$DBOSUSER" ] && id "$DBOSUSER" > /dev/null 2>&1; then
+ echo "$DBOSUSER"
+ return 0
+ fi
-echo ">>> Запуск инициализации RUDB для UID: $CUR_UID..."
+ for candidate in qdbadmin postgres; do
+ if id "$candidate" > /dev/null 2>&1; then
+ echo "$candidate"
+ return 0
+ fi
+ done
+
+ if [ -n "${SUDO_USER:-}" ] && id "$SUDO_USER" > /dev/null 2>&1; then
+ echo "$SUDO_USER"
+ return 0
+ fi
+
+ id -un
+}
+
+run_as_dbosuser() {
+ if [ "$(id -un)" = "$DBOSUSER" ]; then
+ "$@"
+ else
+ sudo -u "$DBOSUSER" "$@"
+ fi
+}
+
+run_as_root() {
+ if [ "$(id -u)" -eq 0 ]; then
+ "$@"
+ else
+ sudo "$@"
+ fi
+}
+
+DBOSUSER=$(pick_dbosuser)
+CUR_UID=$(id -u "$DBOSUSER")
+CUR_GID=$(id -g "$DBOSUSER")
+
+if systemctl list-unit-files | grep -q rudb.service; then
+ managed_by_systemd=true
+else
+ managed_by_systemd=false
+fi
+
+start_rudb() {
+ if $managed_by_systemd; then
+ run_as_root systemctl start rudb.service
+ else
+ run_as_dbosuser "$BIN_PATH/pg_ctl" -D "$DATA_DIR" -l "$LOG_FILE" start
+ sleep 2
+ run_as_dbosuser "$BIN_PATH/pg_ctl" -D "$DATA_DIR" status
+ fi
+}
+
+stop_rudb() {
+ if $managed_by_systemd; then
+ run_as_root systemctl stop rudb.service
+ else
+ run_as_dbosuser "$BIN_PATH/pg_ctl" -D "$DATA_DIR" stop
+ fi
+}
+
+echo ">>> Инициализация RUDB: OS user=$DBOSUSER, DB user=$DBUSER, UID=$CUR_UID"
# 1. Останавливаем старый экземпляр
-$BIN_PATH/pg_ctl -D "$DATA_DIR" stop > /dev/null 2>&1
+stop_rudb
# 2. Подготавливаем директорию с правильными правами
if [ -d "$DATA_DIR" ]; then
- sudo rm -rf "$DATA_DIR"
+ run_as_root rm -rf "$DATA_DIR"
fi
-sudo mkdir -p "$DATA_DIR"
+run_as_root mkdir -p "$DATA_DIR"
-sudo chown -R $CUR_UID:$CUR_GID "$DATA_DIR"
-sudo chmod 700 "$DATA_DIR"
+run_as_root chown -R "$CUR_UID:$CUR_GID" "$DATA_DIR"
+run_as_root chmod 700 "$DATA_DIR"
# 3. Инициализация
-$BIN_PATH/initdb -D "$DATA_DIR" --locale=ru_RU.UTF-8 --encoding=UTF8 --username=$DBUSER
+run_as_dbosuser "$BIN_PATH/initdb" -D "$DATA_DIR" --locale=ru_RU.UTF-8 --encoding=UTF8 --username="$DBUSER"
if [ $? -ne 0 ]; then
echo "!!! Ошибка во время initdb. Проверьте права доступа."
@@ -46,14 +108,12 @@
fi
# 4. Обновление конфигурации
-sed -i "s/^#port =.*/port = $PORT/" "$DATA_DIR/postgresql.conf"
-sed -i "s/^#logging_collector =.*/logging_collector = on/" "$DATA_DIR/postgresql.conf"
-sed -i "s|^#log_directory.*|log_directory = 'log'|" "$DATA_DIR/postgresql.conf"
+run_as_dbosuser sed -i "s/^#port =.*/port = $PORT/" "$DATA_DIR/postgresql.conf"
+run_as_dbosuser sed -i "s/^#logging_collector =.*/logging_collector = on/" "$DATA_DIR/postgresql.conf"
+run_as_dbosuser sed -i "s|^#log_directory.*|log_directory = 'log'|" "$DATA_DIR/postgresql.conf"
# 5. Запуск сервера
-$BIN_PATH/pg_ctl -D "$DATA_DIR" -l "$LOG_FILE" start
-sleep 2
-$BIN_PATH/pg_ctl -D "$DATA_DIR" status
+start_rudb
# --- БЛОК 5.5: ИНИЦИАЛИЗАЦИЯ TEMPLATE1 ---
echo ">>> Инициализация template1 из $SQL_INIT_FILE..."
@@ -62,11 +122,11 @@
echo ">>> Применяем init.sql к template1..."
- $BIN_PATH/psql -p $PORT -U $DBUSER -d template1 -f "$SQL_INIT_FILE"
+ "$BIN_PATH/psql" -p "$PORT" -U "$DBUSER" -d template1 -f "$SQL_INIT_FILE"
if [ $? -ne 0 ]; then
echo "!!! Ошибка при выполнении init.sql для template1. Прерывание..."
- $BIN_PATH/pg_ctl -D "$DATA_DIR" stop
+ stop_rudb
exit 1
fi
else
@@ -75,21 +135,21 @@
# 6. Создаем БД
echo ">>> Создание базы данных..."
-$BIN_PATH/createdb -p $PORT -U $DBUSER rudb
+run_as_dbosuser "$BIN_PATH/createdb" -p "$PORT" -U "$DBUSER" rudb
# 7. ОСТАНАВЛИВАЕМ сервер (Обязательно перед созданием архива!)
echo ">>> Остановка сервера перед архивированием..."
-$BIN_PATH/pg_ctl -D "$DATA_DIR" stop
+stop_rudb
sleep 2
# 8. УПАКОВЫВАЕМ АРХИВ
-sudo tar -czf rudb_data1.tar.gz -C "$DATA_DIR" .
+run_as_root tar -czf rudb_data1.tar.gz -C "$DATA_DIR" .
echo ">>> Архив БД успешно создан!"
# 9. Финальный запуск
if [ "$STOP_AT_END" -eq 0 ]; then
echo ">>> Повторный запуск сервера..."
- $BIN_PATH/pg_ctl -D "$DATA_DIR" -l "$LOG_FILE" start
+ start_rudb
else
echo ">>> Указан ключ --stop. Финальный запуск сервера пропущен."
-fi
\ No newline at end of file
+fi
diff --git a/distr/ALT/11/cr_service.sh b/distr/ALT/11/cr_service.sh
index 4ef19b4..9791128 100755
--- a/distr/ALT/11/cr_service.sh
+++ b/distr/ALT/11/cr_service.sh
@@ -48,7 +48,7 @@
ExecStart=$RUDB_PATH/bin/dgridd
Type=idle
KillMode=process
-
+
SyslogIdentifier=DGrid
SyslogFacility=daemon
StandardOutput=syslog
@@ -56,9 +56,10 @@
Environment="LANG=C.UTF-8"
Environment="LC_MESSAGES=C.UTF-8"
Environment="LC_ALL=C.UTF-8"
-
+Environment="LD_LIBRARY_PATH=$RUDB_PATH/lib"
+
Restart=on-failure
-
+
[Install]
WantedBy=multi-user.target
EOF_SYSTEMD
diff --git a/distr/ALT/11/cr_spec.sh b/distr/ALT/11/cr_spec.sh
index 9e78fe8..55a36ae 100755
--- a/distr/ALT/11/cr_spec.sh
+++ b/distr/ALT/11/cr_spec.sh
@@ -35,6 +35,9 @@
Requires: systemd
Requires(pre): shadow-utils
Requires: libpq5
+Requires: libgeos
+Requires: libproj
+Requires: libprotobuf-c1
Source1: <RUDB_SERVICE>
BuildRoot: %{_tmppath}/%{name}-%{version}-root
diff --git a/distr/ASTRA/1.8/mkcontrol.sh b/distr/ASTRA/1.8/mkcontrol.sh
index 72aeb2e..27d2b17 100755
--- a/distr/ASTRA/1.8/mkcontrol.sh
+++ b/distr/ASTRA/1.8/mkcontrol.sh
@@ -11,7 +11,8 @@
mkdir -p rudb_deb_package/rudb/DEBIAN
# Инициализация переменных для версии ОС (по умолчанию)
OS_VERSION="astra1.8"
-ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, libc6 (>= 2.29)"
+POSTGIS_DEB_RUNTIME=", libgdal32, libgeos-c1v5, libjson-c5, libproj25, libprotobuf-c1, libsfcgal1"
+ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, libc6 (>= 2.29), libxml2, libxslt1.1${POSTGIS_DEB_RUNTIME}"
# Обработка аргументов командной строки
while [[ $# -gt 0 ]]; do
@@ -24,11 +25,11 @@
RUDB_DB_PATH="$2"
shift 2
;;
- -rudb_log_path)
+ -rudb_log_path)
LOG_PATH="$2"
shift 2
;;
- -rudb_version)
+ -rudb_version)
MAJOR_VERSION="$2"
shift 2
;;
@@ -36,7 +37,7 @@
case "$2" in
a17)
OS_VERSION="astra1.7"
- ADD_DEB=", libboost-system1.67.0, libboost-thread1.67.0, libboost-chrono1.67.0, libboost-date-time1.67.0, libboost-atomic1.67.0, freetds-bin, freetds-common, libc6 (>= 2.28)"
+ ADD_DEB=", libboost-system1.67.0, libboost-thread1.67.0, libboost-chrono1.67.0, libboost-date-time1.67.0, libboost-atomic1.67.0, freetds-bin, freetds-common, libc6 (>= 2.28)"
;;
a18)
OS_VERSION=$OS_VERSION # по умолчанию
@@ -44,11 +45,11 @@
;;
u22)
OS_VERSION="ubuntu22.04"
- ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, freetds-bin, freetds-common, libsybdb5,libc6 (>= 2.34), libicu70, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap-2.5-0, libkrb5-3, libedit2, libuuid1, libpam0g"
+ ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, freetds-bin, freetds-common, libsybdb5,libc6 (>= 2.34), libicu70, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap-2.5-0, libkrb5-3, libedit2, libuuid1, libpam0g${POSTGIS_DEB_RUNTIME}"
;;
u24)
OS_VERSION="ubuntu24.04"
- ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, freetds-bin, freetds-common, libsybdb5,libc6 (>= 2.34), libicu74, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap2 (>= 2.6), libkrb5-3, libedit2, libuuid1, libpam0g"
+ ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, freetds-bin, freetds-common, libsybdb5,libc6 (>= 2.34), libicu74, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap2 (>= 2.6), libkrb5-3, libedit2, libuuid1, libpam0g${POSTGIS_DEB_RUNTIME}"
;;
*)
echo "Неизвестная версия ОС: $2"
@@ -71,7 +72,7 @@
fi
# Формирование имени сервиса на базе номера версии RUDB
-RUDB_SERVICE="rudb-$MAJOR_VERSION"
+RUDB_SERVICE="rudb-$MAJOR_VERSION"
# Получение версии PostgreSQL из команды `psql -V`
PG_VERSION=$(psql -V | awk '{print $3}')
@@ -223,33 +224,62 @@
BIN_PATH="\$RUDB_PATH/bin"
LINK_PATH="/usr/bin"
+LINK_BACKUP_DIR="\$(dirname "\$RUDB_DB_PATH")/link-backup"
-# Проверка: есть ли доступный psql
-if command -v psql >/dev/null 2>&1; then
- NEED_ORIGINAL_LINKS=false
-else
- NEED_ORIGINAL_LINKS=true
-fi
+create_rudb_link() {
+ local src="\$1"
+ local target="\$2"
+ local src_path="\${BIN_PATH}/\${src}"
+ local link="\${LINK_PATH}/\${target}"
+ local backup_target="\${LINK_BACKUP_DIR}/\${target}.target"
+ local missing_marker="\${LINK_BACKUP_DIR}/\${target}.missing"
+ local current_target=""
+
+ if [ ! -e "\$src_path" ]; then
+ echo "Skip \$link: source \$src_path not found"
+ return 0
+ fi
+
+ mkdir -p "\$LINK_BACKUP_DIR"
+
+ if [ -L "\$link" ]; then
+ current_target="\$(readlink "\$link")"
+
+ if [ "\$current_target" != "\$src_path" ]; then
+ if [ ! -e "\$backup_target" ] && [ ! -e "\$missing_marker" ]; then
+ printf '%s\n' "\$current_target" > "\$backup_target"
+ echo "Backup symlink: \$link -> \$current_target"
+ fi
+ fi
+
+ rm -f "\$link"
+ ln -s "\$src_path" "\$link"
+ echo "Linked: \$link -> \$src_path"
+ return 0
+ fi
+
+ if [ ! -e "\$link" ]; then
+ if [ ! -e "\$backup_target" ] && [ ! -e "\$missing_marker" ]; then
+ touch "\$missing_marker"
+ echo "Marked missing command: \$link"
+ fi
+
+ ln -s "\$src_path" "\$link"
+ echo "Linked: \$link -> \$src_path"
+ return 0
+ fi
+
+ echo "WARNING: \$link exists and is not a symlink. Not replacing it."
+}
for src in "\${!LINKS[@]}"; do
target="\${LINKS[\$src]}"
-
- # Создаём симлинк
- rm -f "\${LINK_PATH}/\${target}"
- ln -s "\${BIN_PATH}/\${src}" "\${LINK_PATH}/\${target}"
-# echo "Created symlink: \${LINK_PATH}/\${target} -> \${BIN_PATH}/\${src}"
-
- # Если нужно — создаём ещё и оригинальное имя (только если src != target)
- if [[ "\$NEED_ORIGINAL_LINKS" == "true" ]] && [[ "\$src" != "\$target" ]]; then
- rm -f "\${LINK_PATH}/\${src}"
- ln -s "\${BIN_PATH}/\${src}" "\${LINK_PATH}/\${src}"
-# echo "Created original symlink: \${LINK_PATH}/\${src} -> \${BIN_PATH}/\${src}"
- fi
+ create_rudb_link "\$src" "\$target"
done
sudo cp $RUDB_PATH/bin/dgridd.conf /etc/
-sudo rm /usr/lib/x86_64-linux-gnu/libpq.so.5
-sudo ln -sf $RUDB_PATH/lib/libpq.so.5.17 /usr/lib/x86_64-linux-gnu/libpq.so.5
+# Не заменяем системную libpq.so.5: это может сломать системные PostgreSQL-клиенты.
+# RUDB-библиотеки подключаются через отдельный ld.so.conf.d файл.
echo "$RUDB_PATH/lib" | sudo tee /etc/ld.so.conf.d/rudb.conf
sudo ldconfig
@@ -282,11 +312,12 @@
ExecStart=$RUDB_PATH/bin/dgridd
Type=idle
KillMode=process
-
+
SyslogIdentifier=DGrid
SyslogFacility=daemon
StandardOutput=syslog
StandardError=syslog
+Environment="LD_LIBRARY_PATH=$RUDB_PATH/lib"
Restart=on-failure
[Install]
@@ -383,9 +414,11 @@
# Очищаем состояние "неудачных" сервисов в systemd
sudo systemctl reset-failed || true
+services=("$RUDB_SERVICE" "dgrid")
+
# Удаление юнит-файлов
for service in "\${services[@]}"; do
- unit_file="/etc/systemd/system/\${service}"
+ unit_file="/etc/systemd/system/\${service}.service"
if [[ -f "\$unit_file" ]]; then
echo "Удаление юнит-файла: \$unit_file"
sudo rm -f "\$unit_file"
@@ -397,49 +430,66 @@
# Перезагрузка systemd для применения изменений
sudo systemctl daemon-reload || true
-# Удаление системного пользователя $DBADMIN
-if id "$DBADMIN" >/dev/null 2>&1; then
- sudo pkill -u $DBADMIN 2>/dev/null || true
- sleep 1
- sudo pkill -9 -u $DBADMIN 2>/dev/null || true
- sleep 1
- sudo deluser --remove-home $DBADMIN || true
-fi
+# Пользователь $DBADMIN может быть создан не этим пакетом и использоваться другими сервисами.
+# Поэтому при удалении пакета его не удаляем.
-# Удаление симлинков
-sudo rm -f /usr/local/bin/pg_ctl
-sudo rm -f /usr/local/bin/initdb
-sudo rm -f /usr/local/bin/clusterdb
-sudo rm -f /usr/local/bin/createdb
-sudo rm -f /usr/local/bin/dropdb
-sudo rm -f /usr/local/bin/reindexdb
-sudo rm -f /usr/local/bin/vacuumdb
-sudo rm -f /usr/local/bin/vacuumlo
-sudo rm -f /usr/local/bin/createuser
-sudo rm -f /usr/local/bin/dropuser
-sudo rm -f /usr/local/bin/psql
-sudo rm -f /usr/local/bin/pg_isready
-sudo rm -f /usr/local/bin/pgbench
-sudo rm -f /usr/local/bin/pg_dump
-sudo rm -f /usr/local/bin/pg_dumpall
-sudo rm -f /usr/local/bin/pg_restore
-sudo rm -f /usr/local/bin/pg_basebackup
-sudo rm -f /usr/local/bin/pg_combinebackup
-sudo rm -f /usr/local/bin/pg_verifybackup
-sudo rm -f /usr/local/bin/pg_receivewal
-sudo rm -f /usr/local/bin/pg_recvlogical
-sudo rm -f /usr/local/bin/pg_resetwal
-sudo rm -f /usr/local/bin/pg_rewind
-sudo rm -f /usr/local/bin/pg_waldump
-sudo rm -f /usr/local/bin/pg_walsummary
-sudo rm -f /usr/local/bin/pg_amcheck
-sudo rm -f /usr/local/bin/pg_checksums
-sudo rm -f /usr/local/bin/pg_controldata
-sudo rm -f /usr/local/bin/pg_upgrade
-sudo rm -f /usr/local/bin/pg_test_fsync
-sudo rm -f /usr/local/bin/pg_test_timing
-sudo rm -f /usr/local/bin/ecpg
-sudo rm -f /usr/local/bin/oid2name
+LINK_PATH="/usr/bin"
+RUDB_DB_PATH='$RUDB_DB_PATH'
+LINK_BACKUP_DIR="\$(dirname "\$RUDB_DB_PATH")/link-backup"
+
+tools=(
+ pg_ctl initdb clusterdb createdb dropdb reindexdb vacuumdb vacuumlo
+ createuser dropuser psql pg_isready pgbench pg_dump pg_dumpall pg_restore
+ pg_basebackup pg_combinebackup pg_verifybackup pg_receivewal pg_recvlogical
+ pg_resetwal pg_rewind pg_waldump pg_walsummary pg_amcheck pg_checksums
+ pg_controldata pg_upgrade pg_test_fsync pg_test_timing ecpg oid2name
+)
+
+restore_or_remove_rudb_link() {
+ local tool="\$1"
+ local link="\${LINK_PATH}/\${tool}"
+ local rudb_target="\${RUDB_PATH}/bin/\${tool}"
+ local backup_target="\${LINK_BACKUP_DIR}/\${tool}.target"
+ local missing_marker="\${LINK_BACKUP_DIR}/\${tool}.missing"
+ local current_target=""
+ local old_target=""
+
+ if [ -L "\$link" ]; then
+ current_target="\$(readlink "\$link")"
+ if [ "\$current_target" = "\$rudb_target" ]; then
+ rm -f "\$link"
+ echo "Removed RuDB link: \$link"
+ else
+ echo "Skip \$link: it does not point to RUDB"
+ fi
+ fi
+
+ if [ -f "\$backup_target" ]; then
+ old_target="\$(cat "\$backup_target")"
+ if [ ! -e "\$link" ] && [ ! -L "\$link" ]; then
+ ln -s "\$old_target" "\$link"
+ rm -f "\$backup_target"
+ echo "Restored symlink: \$link -> \$old_target"
+ else
+ echo "WARNING: \$link already exists; backup was not restored automatically: \$backup_target"
+ fi
+ return 0
+ fi
+
+ if [ -f "\$missing_marker" ]; then
+ rm -f "\$missing_marker"
+ echo "No previous command for \$link; left absent"
+ fi
+}
+
+for tool in "\${tools[@]}"; do
+ restore_or_remove_rudb_link "\$tool"
+done
+
+rmdir "\$LINK_BACKUP_DIR" 2>/dev/null || true
+
+sudo rm -f /etc/ld.so.conf.d/rudb.conf
+sudo ldconfig || true
exit 0
EOF
diff --git a/distr/UBUNTU/24/mkcontrol.sh b/distr/UBUNTU/24/mkcontrol.sh
index a459948..5b56a6c 100755
--- a/distr/UBUNTU/24/mkcontrol.sh
+++ b/distr/UBUNTU/24/mkcontrol.sh
@@ -11,8 +11,8 @@
mkdir -p rudb_deb_package/rudb/DEBIAN
# Инициализация переменных для версии ОС (по умолчанию)
OS_VERSION="ubuntu24.04"
-ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, freetds-bin, freetds-common, libsybdb5,libc6 (>= 2.34), libicu74, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap2 (>= 2.6), libkrb5-3, libedit2, libuuid1, libpam0g"
-
+POSTGIS_DEB_RUNTIME=", libgdal34t64, libgeos-c1t64, libjson-c5, libproj25, libprotobuf-c1, libsfcgal1t64"
+ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, freetds-bin, freetds-common, libsybdb5,libc6 (>= 2.34), libicu74, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap2 (>= 2.6), libkrb5-3, libedit2, libuuid1, libpam0g${POSTGIS_DEB_RUNTIME}, locales"
# Обработка аргументов командной строки
while [[ $# -gt 0 ]]; do
@@ -25,11 +25,11 @@
RUDB_DB_PATH="$2"
shift 2
;;
- -rudb_log_path)
+ -rudb_log_path)
LOG_PATH="$2"
shift 2
;;
- -rudb_version)
+ -rudb_version)
MAJOR_VERSION="$2"
shift 2
;;
@@ -37,7 +37,7 @@
case "$2" in
a17)
OS_VERSION="astra1.7"
- ADD_DEB=", libboost-system1.67.0, libboost-thread1.67.0, libboost-chrono1.67.0, libboost-date-time1.67.0, libboost-atomic1.67.0, freetds-bin, freetds-common, libc6 (>= 2.28)"
+ ADD_DEB=", libboost-system1.67.0, libboost-thread1.67.0, libboost-chrono1.67.0, libboost-date-time1.67.0, libboost-atomic1.67.0, freetds-bin, freetds-common, libc6 (>= 2.28)"
;;
a18)
OS_VERSION="astra1.8"
@@ -45,7 +45,7 @@
;;
u22)
OS_VERSION="ubuntu22.04"
- ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, libsybdb5,libc6 (>= 2.34), libicu70, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap-2.5-0, libkrb5-3, libedit2, libuuid1, libpam0g"
+ ADD_DEB=", libboost-system1.74.0, libboost-thread1.74.0, libsybdb5,libc6 (>= 2.34), libicu70, libcurl4, libssl3, zlib1g, libxml2, libxslt1.1, libreadline8, libldap-2.5-0, libkrb5-3, libedit2, libuuid1, libpam0g${POSTGIS_DEB_RUNTIME}"
;;
u24)
OS_VERSION=$OS_VERSION # по умолчанию
@@ -72,7 +72,7 @@
fi
# Формирование имени сервиса на базе номера версии RUDB
-RUDB_SERVICE="rudb-$MAJOR_VERSION"
+RUDB_SERVICE="rudb-$MAJOR_VERSION"
# Получение версии PostgreSQL из команды `psql -V`
PG_VERSION=$(psql -V | awk '{print $3}')
@@ -123,6 +123,24 @@
LOG_PATH='$LOG_PATH'
DBADMIN='$DBADMIN'
+# Генерация локалей (английской и русской), установка русской - по умолчанию
+if command -v locale-gen >/dev/null 2>&1; then
+ echo "Настройка и генерация локалей en_US.UTF-8 и ru_RU.UTF-8..."
+
+ # Жестко раскомментируем локали в системном файле Ubuntu
+ if [ -f /etc/locale.gen ]; then
+ sudo sed -i '/^# *ru_RU.UTF-8 UTF-8/s/^# *//' /etc/locale.gen
+ sudo sed -i '/^# *en_US.UTF-8 UTF-8/s/^# *//' /etc/locale.gen
+ fi
+
+ # Генерируем локали
+ sudo locale-gen
+
+ # Обновляем глобальные настройки системы
+ sudo update-locale LANG=ru_RU.UTF-8
+ echo "Локаль ru_RU.UTF-8 успешно добавлена в систему."
+fi
+
if [ -z "$RUDB_PATH" ] || [ -z "$RUDB_DB_PATH" ] || [ -z "$LOG_PATH" ]; then
echo "Ошибка: переменные RUDB_PATH, RUDB_DB_PATH или LOG_PATH не заданы."
exit 1
@@ -223,33 +241,62 @@
BIN_PATH="\$RUDB_PATH/bin"
LINK_PATH="/usr/bin"
+LINK_BACKUP_DIR="\$(dirname "\$RUDB_DB_PATH")/link-backup"
-# Проверка: есть ли доступный psql
-if command -v psql >/dev/null 2>&1; then
- NEED_ORIGINAL_LINKS=false
-else
- NEED_ORIGINAL_LINKS=true
-fi
+create_rudb_link() {
+ local src="\$1"
+ local target="\$2"
+ local src_path="\${BIN_PATH}/\${src}"
+ local link="\${LINK_PATH}/\${target}"
+ local backup_target="\${LINK_BACKUP_DIR}/\${target}.target"
+ local missing_marker="\${LINK_BACKUP_DIR}/\${target}.missing"
+ local current_target=""
+
+ if [ ! -e "\$src_path" ]; then
+ echo "Skip \$link: source \$src_path not found"
+ return 0
+ fi
+
+ mkdir -p "\$LINK_BACKUP_DIR"
+
+ if [ -L "\$link" ]; then
+ current_target="\$(readlink "\$link")"
+
+ if [ "\$current_target" != "\$src_path" ]; then
+ if [ ! -e "\$backup_target" ] && [ ! -e "\$missing_marker" ]; then
+ printf '%s\n' "\$current_target" > "\$backup_target"
+ echo "Backup symlink: \$link -> \$current_target"
+ fi
+ fi
+
+ rm -f "\$link"
+ ln -s "\$src_path" "\$link"
+ echo "Linked: \$link -> \$src_path"
+ return 0
+ fi
+
+ if [ ! -e "\$link" ]; then
+ if [ ! -e "\$backup_target" ] && [ ! -e "\$missing_marker" ]; then
+ touch "\$missing_marker"
+ echo "Marked missing command: \$link"
+ fi
+
+ ln -s "\$src_path" "\$link"
+ echo "Linked: \$link -> \$src_path"
+ return 0
+ fi
+
+ echo "WARNING: \$link exists and is not a symlink. Not replacing it."
+}
for src in "\${!LINKS[@]}"; do
target="\${LINKS[\$src]}"
-
- # Создаём симлинк
- rm -f "\${LINK_PATH}/\${target}"
- ln -s "\${BIN_PATH}/\${src}" "\${LINK_PATH}/\${target}"
-# echo "Created symlink: \${LINK_PATH}/\${target} -> \${BIN_PATH}/\${src}"
-
- # Если нужно — создаём ещё и оригинальное имя (только если src != target)
- if [[ "\$NEED_ORIGINAL_LINKS" == "true" ]] && [[ "\$src" != "\$target" ]]; then
- rm -f "\${LINK_PATH}/\${src}"
- ln -s "\${BIN_PATH}/\${src}" "\${LINK_PATH}/\${src}"
-# echo "Created original symlink: \${LINK_PATH}/\${src} -> \${BIN_PATH}/\${src}"
- fi
+ create_rudb_link "\$src" "\$target"
done
sudo cp $RUDB_PATH/bin/dgridd.conf /etc/
-sudo rm /usr/lib/x86_64-linux-gnu/libpq.so.5
-sudo ln -sf $RUDB_PATH/lib/libpq.so.5.17 /usr/lib/x86_64-linux-gnu/libpq.so.5
+# Не заменяем системную libpq.so.5: это может сломать системные PostgreSQL-клиенты.
+# RUDB-библиотеки подключаются через отдельный ld.so.conf.d файл.
echo "$RUDB_PATH/lib" | sudo tee /etc/ld.so.conf.d/rudb.conf
sudo ldconfig
@@ -282,11 +329,12 @@
ExecStart=$RUDB_PATH/bin/dgridd
Type=idle
KillMode=process
-
+
SyslogIdentifier=DGrid
SyslogFacility=daemon
StandardOutput=syslog
StandardError=syslog
+Environment="LD_LIBRARY_PATH=$RUDB_PATH/lib"
Restart=on-failure
[Install]
@@ -383,9 +431,11 @@
# Очищаем состояние "неудачных" сервисов в systemd
sudo systemctl reset-failed || true
+services=("$RUDB_SERVICE" "dgrid")
+
# Удаление юнит-файлов
for service in "\${services[@]}"; do
- unit_file="/etc/systemd/system/\${service}"
+ unit_file="/etc/systemd/system/\${service}.service"
if [[ -f "\$unit_file" ]]; then
echo "Удаление юнит-файла: \$unit_file"
sudo rm -f "\$unit_file"
@@ -397,49 +447,66 @@
# Перезагрузка systemd для применения изменений
sudo systemctl daemon-reload || true
-# Удаление системного пользователя $DBADMIN
-if id "$DBADMIN" >/dev/null 2>&1; then
- sudo pkill -u $DBADMIN 2>/dev/null || true
- sleep 1
- sudo pkill -9 -u $DBADMIN 2>/dev/null || true
- sleep 1
- sudo deluser --remove-home $DBADMIN || true
-fi
+# Пользователь $DBADMIN может быть создан не этим пакетом и использоваться другими сервисами.
+# Поэтому при удалении пакета его не удаляем.
-# Удаление симлинков
-sudo rm -f /usr/local/bin/pg_ctl
-sudo rm -f /usr/local/bin/initdb
-sudo rm -f /usr/local/bin/clusterdb
-sudo rm -f /usr/local/bin/createdb
-sudo rm -f /usr/local/bin/dropdb
-sudo rm -f /usr/local/bin/reindexdb
-sudo rm -f /usr/local/bin/vacuumdb
-sudo rm -f /usr/local/bin/vacuumlo
-sudo rm -f /usr/local/bin/createuser
-sudo rm -f /usr/local/bin/dropuser
-sudo rm -f /usr/local/bin/psql
-sudo rm -f /usr/local/bin/pg_isready
-sudo rm -f /usr/local/bin/pgbench
-sudo rm -f /usr/local/bin/pg_dump
-sudo rm -f /usr/local/bin/pg_dumpall
-sudo rm -f /usr/local/bin/pg_restore
-sudo rm -f /usr/local/bin/pg_basebackup
-sudo rm -f /usr/local/bin/pg_combinebackup
-sudo rm -f /usr/local/bin/pg_verifybackup
-sudo rm -f /usr/local/bin/pg_receivewal
-sudo rm -f /usr/local/bin/pg_recvlogical
-sudo rm -f /usr/local/bin/pg_resetwal
-sudo rm -f /usr/local/bin/pg_rewind
-sudo rm -f /usr/local/bin/pg_waldump
-sudo rm -f /usr/local/bin/pg_walsummary
-sudo rm -f /usr/local/bin/pg_amcheck
-sudo rm -f /usr/local/bin/pg_checksums
-sudo rm -f /usr/local/bin/pg_controldata
-sudo rm -f /usr/local/bin/pg_upgrade
-sudo rm -f /usr/local/bin/pg_test_fsync
-sudo rm -f /usr/local/bin/pg_test_timing
-sudo rm -f /usr/local/bin/ecpg
-sudo rm -f /usr/local/bin/oid2name
+LINK_PATH="/usr/bin"
+RUDB_DB_PATH='$RUDB_DB_PATH'
+LINK_BACKUP_DIR="\$(dirname "\$RUDB_DB_PATH")/link-backup"
+
+tools=(
+ pg_ctl initdb clusterdb createdb dropdb reindexdb vacuumdb vacuumlo
+ createuser dropuser psql pg_isready pgbench pg_dump pg_dumpall pg_restore
+ pg_basebackup pg_combinebackup pg_verifybackup pg_receivewal pg_recvlogical
+ pg_resetwal pg_rewind pg_waldump pg_walsummary pg_amcheck pg_checksums
+ pg_controldata pg_upgrade pg_test_fsync pg_test_timing ecpg oid2name
+)
+
+restore_or_remove_rudb_link() {
+ local tool="\$1"
+ local link="\${LINK_PATH}/\${tool}"
+ local rudb_target="\${RUDB_PATH}/bin/\${tool}"
+ local backup_target="\${LINK_BACKUP_DIR}/\${tool}.target"
+ local missing_marker="\${LINK_BACKUP_DIR}/\${tool}.missing"
+ local current_target=""
+ local old_target=""
+
+ if [ -L "\$link" ]; then
+ current_target="\$(readlink "\$link")"
+ if [ "\$current_target" = "\$rudb_target" ]; then
+ rm -f "\$link"
+ echo "Removed RuDB link: \$link"
+ else
+ echo "Skip \$link: it does not point to RUDB"
+ fi
+ fi
+
+ if [ -f "\$backup_target" ]; then
+ old_target="\$(cat "\$backup_target")"
+ if [ ! -e "\$link" ] && [ ! -L "\$link" ]; then
+ ln -s "\$old_target" "\$link"
+ rm -f "\$backup_target"
+ echo "Restored symlink: \$link -> \$old_target"
+ else
+ echo "WARNING: \$link already exists; backup was not restored automatically: \$backup_target"
+ fi
+ return 0
+ fi
+
+ if [ -f "\$missing_marker" ]; then
+ rm -f "\$missing_marker"
+ echo "No previous command for \$link; left absent"
+ fi
+}
+
+for tool in "\${tools[@]}"; do
+ restore_or_remove_rudb_link "\$tool"
+done
+
+rmdir "\$LINK_BACKUP_DIR" 2>/dev/null || true
+
+sudo rm -f /etc/ld.so.conf.d/rudb.conf
+sudo ldconfig || true
exit 0
EOF
diff --git a/distr/readme.md b/distr/readme.md
index c03daba..5a10b45 100644
--- a/distr/readme.md
+++ b/distr/readme.md
@@ -25,8 +25,17 @@
- Все сценарии сборки запускаются через `prep.sh`
- Перед сборкой должно быть собрано ядро RuDB
+- Перед упаковкой PostGIS должен быть установлен в тот же префикс, что и RuDB (`/usr/local/rudb` по умолчанию)
- Рекомендуется выполнять сборку в чистом окружении
+### Зависимости для сборки PostGIS
+
+Для сборки встроенного `contrib/postgis` в окружении сборки должны быть доступны:
+
+- Debian / Ubuntu / Astra: `docbook-xsl-ns`, `gettext`, `libgdal-dev`, `libgeos-dev`, `libjson-c-dev`, `libproj-dev`, `libprotobuf-c-dev`, `libxml2-dev`, `libxml2-utils`, `libxslt1-dev`, `protobuf-c-compiler`, `xsltproc`
+- Debian / Ubuntu / Astra: `libsfcgal-dev` рекомендуется, если нужен `postgis_sfcgal`
+- ALT Linux 11: `gettext-tools`, `libgdal-devel`, `libgeos-devel`, `libproj-devel`, `libprotobuf-c-devel`, `libxml2-devel`, `libxslt-devel`, `protobuf-c-compiler`, `xsltproc`
+
---
# DEB пакеты
@@ -128,4 +137,3 @@
- `dpkg-dev`, `debhelper` (для DEB)
- `rpm-build` (для RPM)
-
diff --git "a/doc/\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217_RuDB.pdf" "b/doc/\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217_RuDB.pdf"
index 419ab1e..d3e9f68 100644
--- "a/doc/\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217_RuDB.pdf"
+++ "b/doc/\320\240\321\203\320\272\320\276\320\262\320\276\320\264\321\201\321\202\320\262\320\276_\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217_RuDB.pdf"
Binary files differ
diff --git a/full_build.sh b/full_build.sh
index d5a157f..63d77c0 100755
--- a/full_build.sh
+++ b/full_build.sh
@@ -7,6 +7,8 @@
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INSTALL_PATH="/usr/local/rudb"
LOG_FILE="${ROOT_DIR}/build_report.log"
+POSTGIS_PATH="${ROOT_DIR}/contrib/postgis"
+BUILD_JOBS="$(nproc)"
export PATH="$INSTALL_PATH/bin:$PATH"
export PG_CONFIG="$INSTALL_PATH/bin/pg_config"
export OPTIMIZATION=2
@@ -57,6 +59,34 @@
echo "$1" >> "$LOG_FILE"
}
+run_logged() {
+ "$@" 2>&1 | tee -a "$LOG_FILE"
+ return ${PIPESTATUS[0]}
+}
+
+build_postgis() {
+ if [ ! -d "$POSTGIS_PATH" ]; then
+ echo -e "\e[1;31m[ FAIL ] Не найдена директория $POSTGIS_PATH\e[0m"
+ return 1
+ fi
+
+ (
+ cd "$POSTGIS_PATH" || exit 1
+ make distclean > /dev/null 2>&1 || true
+
+ if [ ! -x ./configure ]; then
+ run_logged ./autogen.sh || exit 1
+ fi
+
+ run_logged env PATH="$INSTALL_PATH/bin:$PATH" ./configure \
+ --prefix="$INSTALL_PATH" \
+ --with-pgconfig="$INSTALL_PATH/bin/pg_config" || exit 1
+
+ run_logged make USE_PGXS=1 -j"$BUILD_JOBS" || exit 1
+ run_logged sudo env PATH="$INSTALL_PATH/bin:$PATH" make USE_PGXS=1 install || exit 1
+ )
+}
+
# 1. КОНФИГУРАЦИЯ
print_header "Этап 1: Конфигурация ядра"
@@ -139,7 +169,7 @@
if [ "$MODE" == "PROD" ]; then
echo -e "\e[1;36mЗапуск стандартной сборки через contrib/Makefile...\e[0m"
- make -C contrib -j$(nproc) 2>&1 | tee -a "$LOG_FILE"
+ make -C contrib -j"$BUILD_JOBS" 2>&1 | tee -a "$LOG_FILE"
if [ ${PIPESTATUS[0]} -eq 0 ]; then
echo -e "\n\e[1;32m[ OK ] Сборка contrib успешна\e[0m"
@@ -150,6 +180,12 @@
exit 1
fi
+ print_header "Этап 7: Сборка и установка PostGIS"
+ if ! build_postgis; then
+ echo -e "\n\e[1;31m[ FAIL ] Сборка или установка PostGIS упала!\e[0m"
+ exit 1
+ fi
+
echo -e "\e[1;33mПропущены:\e[0m ${SKIPPED_LIST:-нет}" >> "$LOG_FILE"
echo -e "\n\e[1;32m=== ИТОГИ: УСПЕШНАЯ PROD СБОРКА ===\e[0m"
else
@@ -177,16 +213,24 @@
continue
fi
- cd "$ext_name"
if [ "$ext_name" = "postgis" ]; then
- make distclean > /dev/null 2>&1
- ./configure
- else
- make clean > /dev/null 2>&1
+ if build_postgis; then
+ echo -e "\e[1;32m[ OK ] $ext_name успешно собран\e[0m"
+ SUCCESS_LIST+="$ext_name "
+ DEV_SUMMARY+="--- Сборка $ext_name --- [ \e[1;32mOK\e[0m ]\n"
+ else
+ echo -e "\e[1;31m[ FAIL ] Ошибка в $ext_name\e[0m"
+ FAILED_LIST+="$ext_name "
+ DEV_SUMMARY+="--- Сборка $ext_name --- [ \e[1;31mFAIL\e[0m ]\n"
+ fi
+ continue
fi
+ cd "$ext_name"
+ make clean > /dev/null 2>&1
+
# Сборка и установка
- if make 2>&1 | tee -a "$LOG_FILE" && \
+ if make -j"$BUILD_JOBS" 2>&1 | tee -a "$LOG_FILE" && \
sudo env PATH=$INSTALL_PATH/bin:$PATH PG_CONFIG=$INSTALL_PATH/bin/pg_config make install 2>&1 | tee -a "$LOG_FILE"; then
echo -e "\e[1;32m[ OK ] $ext_name успешно собран\e[0m"
SUCCESS_LIST+="$ext_name "
diff --git a/full_build_db_create_run_tests.sh b/full_build_db_create_run_tests.sh
new file mode 100755
index 0000000..180bd54
--- /dev/null
+++ b/full_build_db_create_run_tests.sh
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+set -Eeuo pipefail
+IFS=$'\n\t'
+
+TEST_NAME=""
+JOBS=4
+
+usage() {
+ cat <<EOF
+Usage:
+ ./build_script.sh
+ ./build_script.sh --test_name=dbms_tns
+ ./build_script.sh --test_name dbms_tns
+ ./build_script.sh --test_name="dbms_tns another_test" -j 4
+
+Options:
+ --test_name NAME Optional regression test name or list of tests
+ -j, --jobs N Parallel jobs for make, default: 4
+ -h, --help Show this help
+EOF
+}
+
+log() {
+ echo
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"
+}
+
+fail() {
+ echo "ERROR: $*" >&2
+ exit 1
+}
+
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --test_name=*)
+ TEST_NAME="${1#*=}"
+ ;;
+ --test_name)
+ ARG_NAME="$1"
+ shift
+ [[ $# -gt 0 ]] || fail "После $ARG_NAME нужно указать имя теста"
+ TEST_NAME="$1"
+ ;;
+ -j|--jobs)
+ ARG_NAME="$1"
+ shift
+ [[ $# -gt 0 ]] || fail "После $ARG_NAME нужно указать число потоков"
+ JOBS="$1"
+ ;;
+ --jobs=*)
+ JOBS="${1#*=}"
+ ;;
+ -h|--help)
+ usage
+ exit 0
+ ;;
+ *)
+ fail "Неизвестный аргумент: $1"
+ ;;
+ esac
+ shift
+done
+
+[[ "$JOBS" =~ ^[0-9]+$ ]] || fail "jobs должен быть числом: $JOBS"
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+cd "$SCRIPT_DIR"
+
+[[ -f "./full_build.sh" ]] || fail "Не найден ./full_build.sh. Запусти скрипт из корня репозитория или положи его туда."
+[[ -f "./db_cr_all.sh" ]] || fail "Не найден ./db_cr_all.sh"
+[[ -d "./src/test/regress" ]] || fail "Не найдена директория ./src/test/regress"
+
+log "Start build pipeline"
+log "Current OS user: $(id -un)"
+log "Repository dir: $SCRIPT_DIR"
+log "Jobs: $JOBS"
+
+if [[ -n "$TEST_NAME" ]]; then
+ log "Test name: $TEST_NAME"
+else
+ log "Test name not specified: regression tests will be skipped"
+fi
+
+log "1/4 make clean"
+if [[ -f "./GNUmakefile" && -f "./src/Makefile.global" ]]; then
+ make clean
+else
+ log "Skipping make clean: build tree is not configured yet"
+fi
+
+log "2/4 bash ./full_build.sh --dev"
+bash ./full_build.sh --dev
+
+log "3/4 bash ./db_cr_all.sh"
+bash ./db_cr_all.sh
+
+log "4/4 checking qsql connection"
+qsql -p 5432 -d postgres -U postgres <<'SQL'
+SELECT 1;
+\q
+SQL
+
+if [[ -n "$TEST_NAME" ]]; then
+ log "Running regression tests"
+ make -C src/test/regress check-tests TESTS="$TEST_NAME" -j"$JOBS"
+else
+ log "Skipping regression tests because --test_name was not specified"
+fi
+
+log "Done"
diff --git a/src/backend/catalog/system_functions.sql b/src/backend/catalog/system_functions.sql
index cd67c1c..ac61f9e 100644
--- a/src/backend/catalog/system_functions.sql
+++ b/src/backend/catalog/system_functions.sql
@@ -654,77 +654,365 @@
dbms_lob_compare(blob1 BLOB, blob2 BLOB, amount number DEFAULT NULL, offset1 number DEFAULT NULL, offset2 number DEFAULT NULL)
RETURNS number
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_compare_ovr1';
CREATE OR REPLACE FUNCTION
dbms_lob_compare(clob1 CLOB, clob2 CLOB, amount number DEFAULT NULL, offset1 number DEFAULT NULL, offset2 number DEFAULT NULL)
RETURNS number
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_compare_ovr2';
CREATE OR REPLACE FUNCTION
dbms_lob_loadfromfile(blob1 BLOB, src_file BFILE, amount number, dest_offset number DEFAULT 1, src_offset number DEFAULT 1)
RETURNS BLOB
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_loadfromfile_ovr1';
CREATE OR REPLACE FUNCTION
dbms_lob_loadfromfile(clob1 CLOB, src_file BFILE, amount number, dest_offset number DEFAULT 1, src_offset number DEFAULT 1)
RETURNS CLOB
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_loadfromfile_ovr2';
CREATE OR REPLACE FUNCTION
dbms_lob_substr(blob1 BLOB, amount number DEFAULT NULL, offset1 number DEFAULT NULL)
RETURNS raw
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_substr_ovr1';
CREATE OR REPLACE FUNCTION
dbms_lob_substr(clob1 CLOB, amount number DEFAULT NULL, offset1 number DEFAULT NULL)
RETURNS varchar2
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_substr_ovr2';
CREATE OR REPLACE FUNCTION
dbms_lob_instr(clob1 BLOB, raw_pattern RAW, blob_offset number DEFAULT NULL, nch number DEFAULT NULL)
RETURNS number
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_instr_ovr1';
CREATE OR REPLACE FUNCTION
dbms_lob_instr(clob1 CLOB, text_pattern varchar2, blob_offset number DEFAULT NULL, nch number DEFAULT NULL)
RETURNS number
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_lob_instr_ovr2';
CREATE OR REPLACE FUNCTION
dbms_assert_enquote_name(name varchar2, capitalize BOOLEAN DEFAULT TRUE)
RETURNS varchar2
LANGUAGE INTERNAL
-CALLED ON NULL INPUT VOLATILE
+CALLED ON NULL INPUT VOLATILE
AS 'dbms_assert_enquote_name';
-CREATE OR REPLACE FUNCTION pg_catalog.dbms_alert_register(name varchar2, cleanup BOOLEAN DEFAULT TRUE)
-RETURNS void
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_alert_register(name varchar2, cleanup BOOLEAN DEFAULT TRUE)
+RETURNS void
LANGUAGE internal
PARALLEL SAFE
AS 'dbms_alert_register';
-CREATE OR REPLACE FUNCTION pg_catalog.dbms_xmlgen_getxml(ctx number, dtdorschema number DEFAULT 0)
-RETURNS clob
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_add_warning_setting_cat(
+ warning_category varchar2,
+ warning_value varchar2,
+ scope varchar2)
+RETURNS void
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_add_warning_setting_cat';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_add_warning_setting_num(
+ warning_number binary_integer,
+ warning_value varchar2,
+ scope varchar2)
+RETURNS void
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_add_warning_setting_num';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_get_category(
+ warning_number binary_integer)
+RETURNS varchar2
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_get_category';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_get_warning_setting_cat(
+ warning_category varchar2)
+RETURNS varchar2
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_get_warning_setting_cat';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_get_warning_setting_num(
+ warning_number binary_integer)
+RETURNS varchar2
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_get_warning_setting_num';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_get_warning_setting_string()
+RETURNS varchar2
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_get_warning_setting_string';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_warning_set_warning_setting_string(
+ value varchar2,
+ scope varchar2)
+RETURNS void
+LANGUAGE internal
+VOLATILE
+AS 'dbms_warning_set_warning_setting_string';
+
+CREATE OR REPLACE FUNCTION
+dbms_sqlset_create_sqlset_0(
+ sqlset_name text DEFAULT NULL,
+ description text DEFAULT NULL,
+ sqlset_owner text DEFAULT NULL)
+RETURNS varchar2
+LANGUAGE internal
+VOLATILE
+AS 'dbms_sqlset_create_sqlset';
+
+CREATE OR REPLACE PROCEDURE
+dbms_sqlset_create_sqlset_1(
+ sqlset_name text,
+ description text DEFAULT NULL,
+ sqlset_owner text DEFAULT NULL)
+LANGUAGE internal
+AS 'dbms_sqlset_create_sqlset_proc';
+
+CREATE OR REPLACE PROCEDURE
+dbms_sqlset_drop_sqlset(
+ sqlset_name text,
+ sqlset_owner text DEFAULT NULL)
+LANGUAGE internal
+AS 'dbms_sqlset_drop_sqlset';
+
+CREATE OR REPLACE PROCEDURE
+dbms_sqlset_load_sqlset(
+ sqlset_name text,
+ populate_cursor refcursor,
+ load_option text DEFAULT 'INSERT',
+ update_option text DEFAULT 'REPLACE',
+ update_condition text DEFAULT NULL,
+ update_attributes text DEFAULT NULL,
+ ignore_null bool DEFAULT true,
+ commit_rows numeric DEFAULT NULL,
+ sqlset_owner text DEFAULT NULL)
+LANGUAGE internal
+AS 'dbms_sqlset_load_sqlset';
+
+CREATE OR REPLACE FUNCTION
+dbms_sqlset_select_sqlset(
+ sqlset_name text,
+ basic_filter text DEFAULT NULL,
+ object_filter text DEFAULT NULL,
+ ranking_measure1 text DEFAULT NULL,
+ ranking_measure2 text DEFAULT NULL,
+ ranking_measure3 text DEFAULT NULL,
+ result_percentage numeric DEFAULT 1,
+ result_limit numeric DEFAULT NULL,
+ attribute_list text DEFAULT 'TYPICAL',
+ plan_filter text DEFAULT NULL,
+ sqlset_owner text DEFAULT NULL,
+ recursive_sql text DEFAULT 'Y',
+ OUT sql_id text,
+ OUT force_matching_signature numeric,
+ OUT sql_text text,
+ OUT parsing_schema_name text,
+ OUT module text,
+ OUT action text,
+ OUT elapsed_time numeric,
+ OUT cpu_time numeric,
+ OUT buffer_gets numeric,
+ OUT disk_reads numeric,
+ OUT direct_writes numeric,
+ OUT rows_processed numeric,
+ OUT fetches numeric,
+ OUT executions numeric,
+ OUT end_of_fetch_count numeric,
+ OUT optimizer_cost numeric,
+ OUT optimizer_env bytea,
+ OUT priority numeric,
+ OUT command_type numeric,
+ OUT first_load_time text,
+ OUT stat_period numeric,
+ OUT active_stat_period numeric,
+ OUT other text,
+ OUT plan_hash_value numeric,
+ OUT con_dbid numeric,
+ OUT last_exec_start_time text,
+ OUT sharable_mem numeric,
+ OUT exact_matching_signature numeric,
+ OUT result_cache_executions numeric,
+ OUT sql_profile text,
+ OUT sql_plan_baseline text,
+ OUT sql_patch text,
+ OUT avg_hard_parse_time numeric,
+ OUT user_io_wait_time numeric,
+ OUT io_interconnect_bytes numeric,
+ OUT parsing_user_name text)
+RETURNS SETOF record
+LANGUAGE internal
+VOLATILE
+AS 'dbms_sqlset_select_sqlset';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_xmlgen_getxml(ctx number, dtdorschema number DEFAULT 0)
+RETURNS clob
LANGUAGE internal
VOLATILE
AS 'dbms_xmlgen_getxml_ovr2';
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_schema_is_schema_valid2(
+ json_data jsonb,
+ service_arg int4
+)
+RETURNS binary_integer
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_schema_is_schema_valid2';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_schema_is_valid(
+ json_data jsonb,
+ json_schema jsonb,
+ raise_err binary_integer DEFAULT 0)
+RETURNS binary_integer
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_schema_is_valid';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_schema_validate_report(
+ json_data varchar2,
+ json_schema varchar2)
+RETURNS clob
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_schema_validate_report';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_schema_validate_report(
+ json_data jsonb,
+ json_schema jsonb)
+RETURNS clob
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_schema_validate_report';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_build_dataguide(
+ json_data jsonb)
+RETURNS jsonb
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_build_dataguide';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_get_index_dataguide(
+ tablename varchar2,
+ jcolname varchar2,
+ format int4,
+ pretty int4 DEFAULT 0)
+RETURNS clob
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_get_index_dataguide';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_get_view_sql(
+ viewname varchar2,
+ tablename varchar2,
+ jcolname varchar2,
+ dataguide jsonb,
+ materialize bool DEFAULT false,
+ mvrefreshmode int4 DEFAULT 1,
+ path varchar2 DEFAULT '$',
+ resolvenameconflicts bool DEFAULT true,
+ colnameprefix varchar2 DEFAULT NULL,
+ mixedcasecolumns bool DEFAULT true)
+RETURNS clob
+LANGUAGE internal
+VOLATILE
+AS 'dbms_json_get_view_sql';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_add_virtual_columns(
+ tablename varchar2,
+ jcolname varchar2,
+ dataguide jsonb,
+ resolvenameconflicts bool DEFAULT true,
+ colnameprefix varchar2 DEFAULT NULL,
+ mixedcasecolumns bool DEFAULT false)
+RETURNS void
+LANGUAGE internal
+AS 'dbms_json_add_virtual_columns';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_create_view(
+ viewname varchar2,
+ tablename varchar2,
+ jcolname varchar2,
+ dataguide jsonb,
+ resourcepath varchar2 DEFAULT NULL,
+ materialize bool DEFAULT false,
+ mvrefreshmode int4 DEFAULT 1,
+ path varchar2 DEFAULT '$',
+ resolvenameconflicts bool DEFAULT true,
+ colnameprefix varchar2 DEFAULT NULL,
+ mixedcasecolumns bool DEFAULT false)
+RETURNS void
+LANGUAGE internal
+AS 'dbms_json_create_view';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_create_view2(
+ viewname varchar2,
+ tablename varchar2,
+ jcolname varchar2,
+ dataguide jsonb,
+ resourcepath varchar2,
+ materialize bool,
+ mvrefreshmode int4,
+ path varchar2,
+ resolvenameconflicts bool,
+ colnameprefix varchar2,
+ mixedcasecolumns bool,
+ service_arg int4
+)
+RETURNS void
+LANGUAGE internal
+AS 'dbms_json_create_view2';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_drop_virtual_columns(
+ tablename varchar2,
+ jcolname varchar2)
+RETURNS void
+LANGUAGE internal
+AS 'dbms_json_drop_virtual_columns';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_json_type_convertible_check(
+ owner varchar2,
+ tablename varchar2,
+ columnname varchar2,
+ statustablename varchar2,
+ fastcheck bool DEFAULT false,
+ appendstatus bool DEFAULT false)
+RETURNS void
+LANGUAGE internal
+AS 'dbms_json_json_type_convertible_check';
+
+CREATE OR REPLACE FUNCTION pg_catalog.dbms_json_create_view_on_path(
+ viewname varchar2,
+ tablename varchar2,
+ jcolname varchar2,
+ path varchar2,
+ frequency int4 DEFAULT 0)
+RETURNS void
+LANGUAGE internal
+AS 'dbms_json_create_view_on_path';
+
+
-- UTL_URL_BLOCK
CREATE OR REPLACE FUNCTION
@@ -1027,6 +1315,64 @@
max_cookies_per_site int4 DEFAULT 20
) RETURNS int4 LANGUAGE internal AS 'utl_http_create_request_context';
+CREATE OR REPLACE FUNCTION owa_init_cgi_env(
+ num_cgi_vars int4 DEFAULT 0,
+ param_name text[] DEFAULT NULL,
+ param_val text[] DEFAULT NULL
+)
+RETURNS void
+LANGUAGE internal
+AS 'owa_init_cgi_env';
+
+CREATE OR REPLACE FUNCTION owa_init_cgi_env2(
+ num_cgi_vars int4,
+ param_name text[],
+ param_val text[],
+ service_arg int4
+)
+RETURNS void
+LANGUAGE internal
+AS 'owa_init_cgi_env2';
+
+CREATE OR REPLACE FUNCTION owa_cookie_send(
+ name varchar2,
+ value varchar2,
+ expires timestamptz DEFAULT NULL,
+ path varchar2 DEFAULT NULL,
+ domain varchar2 DEFAULT NULL,
+ secure varchar2 DEFAULT NULL
+)
+RETURNS void
+LANGUAGE internal
+AS 'owa_cookie_send';
+
+CREATE OR REPLACE FUNCTION owa_cookie_send2(
+ name varchar2,
+ value varchar2,
+ expires timestamptz,
+ path varchar2,
+ domain varchar2,
+ secure varchar2,
+ service_arg int4
+)
+RETURNS void
+LANGUAGE internal
+AS 'owa_cookie_send2';
+
+CREATE OR REPLACE FUNCTION owa_cache_get_etag2(
+ service_arg int4
+)
+RETURNS varchar2
+LANGUAGE internal
+AS 'owa_cache_get_etag2';
+
+CREATE OR REPLACE FUNCTION owa_util_showpage_utils(
+ service_arg int4
+)
+RETURNS void
+LANGUAGE internal
+AS 'owa_util_showpage_utils';
+
-- ==== DEFAULT wrappers for UTL_RAW ====
-- endianess DEFAULT 1
@@ -1215,6 +1561,69 @@
AS 'utl_tcp_write_text';
+-- DBMS HTP Functions
+
+-- HTP_EM
+CREATE OR REPLACE FUNCTION pg_catalog.htp_em(
+ ctext VARCHAR2,
+ cattributes VARCHAR2 DEFAULT NULL
+) RETURNS void
+LANGUAGE internal
+AS 'htp_em';
+
+-- HTP_EMPHASIS
+CREATE OR REPLACE FUNCTION pg_catalog.htp_emphasis(
+ ctext VARCHAR2,
+ cattributes VARCHAR2 DEFAULT NULL
+) RETURNS void
+LANGUAGE internal
+AS 'htp_emphasis';
+
+-- HTP_FRAME
+CREATE OR REPLACE FUNCTION pg_catalog.htp_frame(
+ csrc VARCHAR2,
+ cname VARCHAR2 DEFAULT NULL,
+ cmarginwidth VARCHAR2 DEFAULT NULL,
+ cmarginheight VARCHAR2 DEFAULT NULL,
+ cscrolling VARCHAR2 DEFAULT NULL,
+ cnoresize VARCHAR2 DEFAULT NULL,
+ cattributes VARCHAR2 DEFAULT NULL
+) RETURNS void
+LANGUAGE internal
+AS 'htp_frame';
+
+-- HTP_HEADER
+CREATE OR REPLACE FUNCTION pg_catalog.htp_header(
+ nsize number,
+ cheader VARCHAR2,
+ calign VARCHAR2 DEFAULT NULL,
+ cnowrap VARCHAR2 DEFAULT NULL,
+ cclear VARCHAR2 DEFAULT NULL,
+ cattributes VARCHAR2 DEFAULT NULL
+) RETURNS void
+LANGUAGE internal
+AS 'htp_header';
+
+-- HTP_DLISTTERM
+CREATE OR REPLACE FUNCTION pg_catalog.htp_dlistterm(
+ ctext VARCHAR2 DEFAULT NULL,
+ cclear VARCHAR2 DEFAULT NULL,
+ cattributes VARCHAR2 DEFAULT NULL
+) RETURNS void
+LANGUAGE internal
+AS 'htp_dlistterm';
+
+-- OWA_MATCH.MATCH
+CREATE OR REPLACE FUNCTION pg_catalog.owa_match_match(
+ p_sting VARCHAR2,
+ p_simple_pattern VARCHAR2[] DEFAULT NULL,
+ p_complex_pattern VARCHAR2[] DEFAULT NULL,
+ p_use_special_chars BOOLEAN DEFAULT TRUE
+) RETURNS BOOLEAN
+LANGUAGE internal
+AS 'owa_match_match';
+
+
--
-- The default permissions for functions mean that anyone can execute them.
-- A number of functions shouldn't be executable by just anyone, but rather
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 08f780a..cb16de1 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -70,6 +70,48 @@
useconfig
FROM pg_shadow;
+CREATE VIEW plsql_trace_runs AS
+ SELECT
+ run_id,
+ trace_mask,
+ started_at,
+ ended_at,
+ event_count,
+ is_active
+ FROM pg_catalog.dbms_trace_plsql_trace_runs()
+ AS t(run_id bigint,
+ trace_mask integer,
+ started_at timestamptz,
+ ended_at timestamptz,
+ event_count integer,
+ is_active boolean);
+
+CREATE VIEW plsql_trace_events AS
+ SELECT
+ event_type,
+ run_id,
+ event_seq,
+ event_timestamp,
+ unit_name,
+ subprogram_name,
+ nesting_depth,
+ line_no,
+ sql_text,
+ error_code,
+ comment
+ FROM pg_catalog.dbms_trace_plsql_trace_events()
+ AS t(event_type text,
+ run_id bigint,
+ event_seq bigint,
+ event_timestamp timestamptz,
+ unit_name text,
+ subprogram_name text,
+ nesting_depth integer,
+ line_no integer,
+ sql_text text,
+ error_code integer,
+ comment text);
+
CREATE VIEW pg_policies AS
SELECT
N.nspname AS schemaname,
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 583bbbf..c0649d4 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -1593,6 +1593,7 @@
* parameter. This is mere pedantry, really, but some folks insisted.
*/
if (fargnames != NIL && !expand_variadic && nargs > 0 &&
+ best_candidate->argnumbers != NULL &&
best_candidate->argnumbers[nargs - 1] != nargs - 1)
return FUNCDETAIL_NOTFOUND;
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index 9cd489d..ef95728 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -13,7 +13,7 @@
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-OBJS = fmgrtab.o
+OBJS = fmgrtab.o coder.o
SUBDIRS = \
activity \
adt \
diff --git a/src/backend/utils/adt/string_array.c b/src/backend/utils/adt/string_array.c
index db6837e..646aff8 100644
--- a/src/backend/utils/adt/string_array.c
+++ b/src/backend/utils/adt/string_array.c
@@ -1,116 +1,116 @@
-#ifndef STRING_ARRAY_C
-#define STRING_ARRAY_C
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MAX_STRINGS 1000
-
-typedef struct {
- char* strings[MAX_STRINGS];
- int count;
- int internalIndex;
-} StringArray;
-
-StringArray* initializeStringArray(void);
-void addString(StringArray* array, const char* str, int str_len);
-const char* getStringByIndex(StringArray* array, int index);
-const char* getNextString(StringArray* array);
-void resetInternalIndex(StringArray* array);
-int getCount(StringArray* array);
-void clearStringArray(StringArray* array);
-void logStringArray(StringArray* array);
-void freeStringArray(StringArray* array);
-
-StringArray* initializeStringArray() {
- StringArray* array = (StringArray*)malloc(sizeof(StringArray));
- if (array == NULL) {
- fprintf(stderr, "Memory allocation failed\n");
- exit(1);
- }
- array->count = 0;
- array->internalIndex = 0;
- return array;
-}
-
-/*
- addString - функция добавляет константу в список констант
- str_len - количество символов из константы, которое надо использовать,
- если str_len = 0, то все символы
-*/
-void addString(StringArray* array, const char* str, int str_len) {
- if (array->count >= MAX_STRINGS) {
- fprintf(stderr, "Max number of strings reached\n");
- return;
- }
- if (str_len==0)
- str_len = strlen(str);
- array->strings[array->count] = (char*)malloc(str_len + 1);
- if (array->strings[array->count] == NULL) {
- fprintf(stderr, "Memory allocation failed\n");
- exit(1);
- }
- strncpy(array->strings[array->count], str, str_len);
- array->strings[array->count][str_len] = '\0';
- array->count++;
-}
-
-const char* getStringByIndex(StringArray* array, int index) {
- if (index >= array->count || index < 0) {
- fprintf(stderr, "Index out of bounds\n");
- return NULL;
- }
- return array->strings[index];
-}
-
-const char* getNextString(StringArray* array) {
- if (array->internalIndex >= array->count) {
- return NULL;
- }
- return array->strings[array->internalIndex++];
-}
-
-void resetInternalIndex(StringArray* array) {
- array->internalIndex = 0;
-}
-
-int getCount(StringArray* array) {
- return array->count;
-}
-
-void clearStringArray(StringArray* array) {
- for (int i = 0; i < array->count; i++) {
- free(array->strings[i]);
- }
- array->count = 0;
- array->internalIndex = 0;
-}
-
-void freeStringArray(StringArray* array) {
- clearStringArray(array);
- free(array);
-}
-
-#include "utils/elog.h" // Подключаем заголовочный файл для elog
-
-void logStringArray(StringArray* array) {
- if (!array) {
- elog(ERROR, "StringArray is NULL");
- return;
- }
-
- // Выводим общее количество строк в массиве
- elog(LOG, "StringArray содержит %d строк:", array->count);
-
- // Проходим по всем строкам в массиве
- for (int i = 0; i < array->count; i++) {
- const char* str = array->strings[i];
- if (str) {
- elog(LOG, " [%d]: '%s'", i, str);
- } else {
- elog(LOG, " [%d]: (null)", i);
- }
- }
-}
-#endif // STRING_ARRAY_C
+#ifndef STRING_ARRAY_C
+#define STRING_ARRAY_C
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define MAX_STRINGS 1000
+
+typedef struct {
+ char* strings[MAX_STRINGS];
+ int count;
+ int internalIndex;
+} StringArray;
+
+StringArray* initializeStringArray(void);
+void addString(StringArray* array, const char* str, int str_len);
+const char* getStringByIndex(StringArray* array, int index);
+const char* getNextString(StringArray* array);
+void resetInternalIndex(StringArray* array);
+int getCount(StringArray* array);
+void clearStringArray(StringArray* array);
+void logStringArray(StringArray* array);
+void freeStringArray(StringArray* array);
+
+StringArray* initializeStringArray() {
+ StringArray* array = (StringArray*)malloc(sizeof(StringArray));
+ if (array == NULL) {
+ fprintf(stderr, "Memory allocation failed\n");
+ exit(1);
+ }
+ array->count = 0;
+ array->internalIndex = 0;
+ return array;
+}
+
+/*
+ addString - функция добавляет константу в список констант
+ str_len - количество символов из константы, которое надо использовать,
+ если str_len = 0, то все символы
+*/
+void addString(StringArray* array, const char* str, int str_len) {
+ if (array->count >= MAX_STRINGS) {
+ fprintf(stderr, "Max number of strings reached\n");
+ return;
+ }
+ if (str_len==0)
+ str_len = strlen(str);
+ array->strings[array->count] = (char*)malloc(str_len + 1);
+ if (array->strings[array->count] == NULL) {
+ fprintf(stderr, "Memory allocation failed\n");
+ exit(1);
+ }
+ strncpy(array->strings[array->count], str, str_len);
+ array->strings[array->count][str_len] = '\0';
+ array->count++;
+}
+
+const char* getStringByIndex(StringArray* array, int index) {
+ if (index >= array->count || index < 0) {
+ fprintf(stderr, "Index out of bounds\n");
+ return NULL;
+ }
+ return array->strings[index];
+}
+
+const char* getNextString(StringArray* array) {
+ if (array->internalIndex >= array->count) {
+ return NULL;
+ }
+ return array->strings[array->internalIndex++];
+}
+
+void resetInternalIndex(StringArray* array) {
+ array->internalIndex = 0;
+}
+
+int getCount(StringArray* array) {
+ return array->count;
+}
+
+void clearStringArray(StringArray* array) {
+ for (int i = 0; i < array->count; i++) {
+ free(array->strings[i]);
+ }
+ array->count = 0;
+ array->internalIndex = 0;
+}
+
+void freeStringArray(StringArray* array) {
+ clearStringArray(array);
+ free(array);
+}
+
+#include "utils/elog.h" // Подключаем заголовочный файл для elog
+
+void logStringArray(StringArray* array) {
+ if (!array) {
+ elog(ERROR, "StringArray is NULL");
+ return;
+ }
+
+ // Выводим общее количество строк в массиве
+ elog(LOG, "StringArray содержит %d строк:", array->count);
+
+ // Проходим по всем строкам в массиве
+ for (int i = 0; i < array->count; i++) {
+ const char* str = array->strings[i];
+ if (str) {
+ elog(LOG, " [%d]: '%s'", i, str);
+ } else {
+ elog(LOG, " [%d]: (null)", i);
+ }
+ }
+}
+#endif // STRING_ARRAY_C
diff --git a/src/backend/utils/coder.c b/src/backend/utils/coder.c
new file mode 100644
index 0000000..6359f5a
--- /dev/null
+++ b/src/backend/utils/coder.c
@@ -0,0 +1,237 @@
+#include <string.h>
+#include <stdint.h>
+
+#include "postgres.h"
+
+#include "utils/coder.h"
+
+typedef uint8_t vect[4];
+
+static uint8_t key[32] =
+{
+ 0xff, 0xee, 0xdd, 0xcc,
+ 0xbb, 0xaa, 0x99, 0x88,
+ 0x77, 0x66, 0x55, 0x44,
+ 0x33, 0x22, 0x11, 0x00,
+ 0xf0, 0xf1, 0xf2, 0xf3,
+ 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9, 0xfa, 0xfb,
+ 0xfc, 0xfd, 0xfe, 0xff
+}; //Ключ шифрования
+
+static unsigned char Pi[8][16]=
+{
+ {1,7,14,13,0,5,8,3,4,15,10,6,9,12,11,2},
+ {8,14,2,5,6,9,1,12,15,4,11,0,13,10,3,7},
+ {5,13,15,6,9,2,12,10,11,7,8,1,4,3,14,0},
+ {7,15,5,10,8,1,6,13,0,9,3,14,11,4,2,12},
+ {12,8,2,1,13,4,15,6,7,0,10,5,3,14,9,11},
+ {11,3,5,8,2,15,10,13,14,1,7,4,12,9,6,0},
+ {6,8,2,3,9,10,5,12,1,14,4,7,11,13,0,15},
+ {12,4,6,2,10,5,11,9,14,8,13,7,0,3,15,1}
+}; //Таблица подстановок
+
+
+static void Transform_T(const uint8_t *in_data, uint8_t *out_data)
+{
+ uint8_t first_part_byte, sec_part_byte;
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ // Извлекаем первую 4-битную часть байта
+ first_part_byte = (in_data[i] & 0xf0) >> 4;
+ // Извлекаем вторую 4-битную часть байта
+ sec_part_byte = (in_data[i] & 0x0f);
+ // Выполняем замену в соответствии с таблицей подстановок
+ first_part_byte = Pi[i * 2][first_part_byte];
+ sec_part_byte = Pi[i * 2 + 1][sec_part_byte];
+ // «Склеиваем» обе 4-битные части обратно в байт
+ out_data[i] = (first_part_byte << 4) | sec_part_byte;
+ }
+}
+
+//Сложение двух двоичных векторов по модулю 2
+static void Sum_ABS_2(const uint8_t *a, const uint8_t *b, uint8_t *c)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ c[i] = a[i]^b[i];
+}
+
+//Сложение двух двоичных векторов по модулю 32
+static void Sum_ABS_32(const uint8_t *a, const uint8_t *b, uint8_t *c)
+{
+ int i;
+ unsigned int internal = 0;
+ for (i = 3; i >= 0; i--)
+ {
+ internal = a[i] + b[i] + (internal >> 8);
+ c[i] = internal & 0xff;
+ }
+}
+
+//Развертывание ключа
+static void Expand_Key(vect* iter_key)
+{
+ for(uint8_t i=0; i<8; i++) {
+ memcpy(iter_key[i], key + 4*i, 4);
+ memcpy(iter_key[i+8], key + 4*i, 4);
+ memcpy(iter_key[i+16], key + 4*i, 4);
+ memcpy(iter_key[i+24], key + 4*(7-i), 4);
+ }
+}
+
+static void Transform_g(const uint8_t *k, const uint8_t *a, uint8_t *out_data)
+{
+ uint8_t internal[4];
+ uint32_t out_data_32;
+ // Складываем по модулю 32 правую половину блока с итерационным ключом
+ Sum_ABS_32(a, k, internal);
+ // Производим нелинейное биективное преобразование результата
+ Transform_T(internal, internal);
+ // Преобразовываем четырехбайтный вектор в одно 32-битное число
+ out_data_32 = internal[0];
+ out_data_32 = (out_data_32 << 8) + internal[1];
+ out_data_32 = (out_data_32 << 8) + internal[2];
+ out_data_32 = (out_data_32 << 8) + internal[3];
+ // Циклически сдвигаем все влево на 11 разрядов
+ out_data_32 = (out_data_32 << 11)|(out_data_32 >> 21);
+ // Преобразовываем 32-битный результат сдвига обратно в 4-байтовый вектор
+ out_data[3] = out_data_32;
+ out_data[2] = out_data_32 >> 8;
+ out_data[1] = out_data_32 >> 16;
+ out_data[0] = out_data_32 >> 24;
+}
+
+static void Transform_G(const uint8_t *k, const uint8_t *a, uint8_t *out_data)
+{
+ uint8_t a_0[4]; // Правая половина блока
+ uint8_t a_1[4]; // Левая половина блока
+ uint8_t G[4];
+
+ int i;
+ // Делим 64-битный исходный блок на две части
+ for(i = 0; i < 4; i++)
+ {
+ a_0[i] = a[4 + i];
+ a_1[i] = a[i];
+ }
+
+ // Производим преобразование g
+ Transform_g(k, a_0, G);
+ // Ксорим результат преобразования g с левой половиной блока
+ Sum_ABS_2(a_1, G, G);
+
+ for(i = 0; i < 4; i++)
+ {
+ a_1[i] = a_0[i];
+ a_0[i] = G[i];
+ }
+
+ // Сводим правую и левую части блока в одно целое
+ for(i = 0; i < 4; i++)
+ {
+ out_data[i] = a_1[i];
+ out_data[4 + i] = a_0[i];
+ }
+}
+
+static void Transform_G_Fin(const uint8_t *k, const uint8_t *a, uint8_t *out_data)
+{
+ uint8_t a_0[4]; // Правая половина блока
+ uint8_t a_1[4]; // Левая половина блока
+ uint8_t G[4];
+
+ int i;
+ // Делим 64-битный исходный блок на две части
+ for(i = 0; i < 4; i++)
+ {
+ a_0[i] = a[4 + i];
+ a_1[i] = a[i];
+ }
+
+ // Производим преобразование g
+ Transform_g(k, a_0, G);
+ // Ксорим результат преобразования g с левой половиной блока
+ Sum_ABS_2(a_1, G, G);
+
+ for(i = 0; i < 4; i++)
+ a_1[i] = G[i];
+
+ for(i = 0; i < 4; i++)
+ {
+ out_data[i] = a_1[i];
+ out_data[4 + i] = a_0[i];
+ }
+}
+
+static void Encrypt(const uint8_t *blk, uint8_t *out_blk, vect* iter_key)
+{
+ int i;
+ Transform_G(iter_key[0], blk, out_blk);
+ for(i = 1; i < 31; i++)
+ Transform_G(iter_key[i], out_blk, out_blk);
+ Transform_G_Fin(iter_key[31], out_blk, out_blk);
+}
+
+static void Decrypt(const uint8_t *blk, uint8_t *out_blk, vect* iter_key)
+{
+ int i;
+ Transform_G(iter_key[31], blk, out_blk);
+ for(i = 30; i > 0; i--)
+ Transform_G(iter_key[i], out_blk, out_blk);
+ Transform_G_Fin(iter_key[0], out_blk, out_blk);
+}
+
+char* pg_kuzn_encode(const char *str, size_t len) {
+ vect iter_key[32];
+ size_t i;
+
+ size_t out_len = 8 * ((len + 7) / 8);
+ char *out_str = (char*)palloc(out_len + 1);
+
+ Expand_Key(iter_key);
+
+ for (i = 0; i + 7 < len; i += 8)
+ {
+ Encrypt((uint8_t*)str + i, (uint8_t*)out_str + i, iter_key);
+ }
+ if(i < len)
+ {
+ uint8_t block[8];
+ size_t j = 0;
+ while(j + i < len) {
+ block[j] = (uint8_t)str[i+j];
+ j++;
+ }
+ while(j < 8) {
+ block[j] = (uint8_t)' ';
+ j++;
+ }
+ Encrypt(block, (uint8_t*)out_str + i, iter_key);
+ }
+ out_str[out_len] = '\0';
+ return out_str;
+}
+
+char *pg_kuzn_decode(const char *str, size_t len) {
+ vect iter_key[32];
+ size_t i;
+
+ size_t out_len = 8 * (len / 8);
+ char *out_str = (char*)palloc(out_len + 1);
+
+ Expand_Key(iter_key);
+
+ for (i = 0; i + 7 < len; i += 8)
+ {
+ Decrypt((uint8_t*)str + i, (uint8_t*)out_str + i, iter_key);
+ }
+ if(i > 0)
+ {
+ while (out_str[--i] == ' ') {}
+ out_str[i + 1] = '\0';
+ }
+ out_str[out_len] = '\0';
+ return out_str;
+}
\ No newline at end of file
diff --git a/src/backend/utils/dbms/Makefile b/src/backend/utils/dbms/Makefile
index 1968042..d369a95 100644
--- a/src/backend/utils/dbms/Makefile
+++ b/src/backend/utils/dbms/Makefile
@@ -15,13 +15,20 @@
# ANTLR runtime and Oracle parser headers (PlSqlLexer/PlSqlParser).
# Mirror parser_antlr/Makefile so that dbms helpers can include the same headers.
override CPPFLAGS := -I. -I$(srcdir) \
+ -I$(top_srcdir)/src/backend/utils/dbms \
-I$(top_srcdir)/src/backend/parser_antlr \
+ -I$(top_srcdir)/src/pl/plpgsql/src \
-I/usr/include/antlr4-runtime -I/usr/local/include/antlr4-runtime \
$(CPPFLAGS)
# C++17 required for dbms_sql and other dbms C++ code (e.g. structured bindings, std::optional).
override CXXFLAGS += -std=c++17
+ifdef DEBUG
+ override CXXFLAGS := -O0 -ggdb3 -DDEBUG $(filter-out -O% -g -D_FORTIFY_SOURCE%, $(CXXFLAGS))
+ override CPPFLAGS += -DDEBUG
+endif
+
# BEGIN QDB_DBMS_GEN dbms_alert_SRCS
DBMS_SRCS_DBMS_ALERT = \
dbms_alert/dbms_alert.cpp \
@@ -88,6 +95,101 @@
utils/dbms/dbms_describe/dbms_describe.o \
# END QDB_DBMS_GEN dbms_describe_OBJS
+# BEGIN QDB_DBMS_GEN dbms_json_schema_SRCS
+DBMS_SRCS_DBMS_JSON_SCHEMA = \
+ dbms_json_schema/dbms_json_schema.cpp \
+ dbms_json_schema/vendor/json-patch.cpp \
+ dbms_json_schema/vendor/json-uri.cpp \
+ dbms_json_schema/vendor/json-validator.cpp \
+ dbms_json_schema/vendor/json-schema-draft7.json.cpp \
+ dbms_json_schema/vendor/string-format-check.cpp \
+ dbms_json_schema/vendor/smtp-address-validator.cpp \
+# END QDB_DBMS_GEN dbms_json_schema_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_json_schema_OBJS
+DBMS_OBJS_DBMS_JSON_SCHEMA = \
+ utils/dbms/dbms_json_schema/dbms_json_schema.o \
+ utils/dbms/dbms_json_schema/vendor/json-patch.o \
+ utils/dbms/dbms_json_schema/vendor/json-uri.o \
+ utils/dbms/dbms_json_schema/vendor/json-validator.o \
+ utils/dbms/dbms_json_schema/vendor/json-schema-draft7.json.o \
+ utils/dbms/dbms_json_schema/vendor/string-format-check.o \
+ utils/dbms/dbms_json_schema/vendor/smtp-address-validator.o \
+# END QDB_DBMS_GEN dbms_json_schema_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_json_SRCS
+DBMS_SRCS_DBMS_JSON = \
+ dbms_json/dbms_json.cpp \
+# END QDB_DBMS_GEN dbms_json_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_json_OBJS
+DBMS_OBJS_DBMS_JSON = \
+ utils/dbms/dbms_json/dbms_json.o \
+# END QDB_DBMS_GEN dbms_json_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_trace_SRCS
+DBMS_SRCS_DBMS_TRACE = \
+ dbms_trace/dbms_trace.cpp \
+# END QDB_DBMS_GEN dbms_trace_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_trace_OBJS
+DBMS_OBJS_DBMS_TRACE = \
+ utils/dbms/dbms_trace/dbms_trace.o \
+# END QDB_DBMS_GEN dbms_trace_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_tns_SRCS
+DBMS_SRCS_DBMS_TNS = \
+ dbms_tns/dbms_tns.cpp \
+# END QDB_DBMS_GEN dbms_tns_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_tns_OBJS
+DBMS_OBJS_DBMS_TNS = \
+ utils/dbms/dbms_tns/dbms_tns.o \
+# END QDB_DBMS_GEN dbms_tns_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_warning_SRCS
+DBMS_SRCS_DBMS_WARNING = \
+ dbms_warning/dbms_warning.cpp \
+ dbms_warning/dbms_warning_errors.cpp \
+# END QDB_DBMS_GEN dbms_warning_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_warning_OBJS
+DBMS_OBJS_DBMS_WARNING = \
+ utils/dbms/dbms_warning/dbms_warning.o \
+ utils/dbms/dbms_warning/dbms_warning_errors.o \
+# END QDB_DBMS_GEN dbms_warning_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_system_SRCS
+DBMS_SRCS_DBMS_SYSTEM = \
+ dbms_system/dbms_system.cpp \
+# END QDB_DBMS_GEN dbms_system_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_system_OBJS
+DBMS_OBJS_DBMS_SYSTEM = \
+ utils/dbms/dbms_system/dbms_system.o \
+# END QDB_DBMS_GEN dbms_system_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_file_transfer_SRCS
+DBMS_SRCS_DBMS_FILE_TRANSFER = \
+ dbms_file_transfer/dbms_file_transfer.cpp \
+# END QDB_DBMS_GEN dbms_file_transfer_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_file_transfer_OBJS
+DBMS_OBJS_DBMS_FILE_TRANSFER = \
+ utils/dbms/dbms_file_transfer/dbms_file_transfer.o \
+# END QDB_DBMS_GEN dbms_file_transfer_OBJS
+
+
+# BEGIN QDB_DBMS_GEN dbms_db_version_SRCS
+DBMS_SRCS_DBMS_DB_VERSION = \
+ dbms_db_version/dbms_db_version.cpp \
+# END QDB_DBMS_GEN dbms_db_version_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_db_version_OBJS
+DBMS_OBJS_DBMS_DB_VERSION = \
+ utils/dbms/dbms_db_version/dbms_db_version.o \
+# END QDB_DBMS_GEN dbms_db_version_OBJS
+
# BEGIN QDB_DBMS_GEN dbms_random_SRCS
DBMS_SRCS_DBMS_RANDOM = \
@@ -155,6 +257,36 @@
DBMS_OBJS_DBMS_REPORT = \
utils/dbms/dbms_report/dbms_report.o \
+# BEGIN QDB_DBMS_GEN dbms_stat_funcs_SRCS
+DBMS_SRCS_DBMS_STAT_FUNCS = \
+ dbms_stat_funcs/dbms_stat_funcs.cpp \
+# END QDB_DBMS_GEN dbms_stat_funcs_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_stat_funcs_OBJS
+DBMS_OBJS_DBMS_STAT_FUNCS = \
+ utils/dbms/dbms_stat_funcs/dbms_stat_funcs.o \
+# END QDB_DBMS_GEN dbms_stat_funcs_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_sqlset_SRCS
+DBMS_SRCS_DBMS_SQLSET = \
+ dbms_sqlset/dbms_sqlset.cpp \
+# END QDB_DBMS_GEN dbms_sqlset_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_sqlset_OBJS
+DBMS_OBJS_DBMS_SQLSET = \
+ utils/dbms/dbms_sqlset/dbms_sqlset.o \
+# END QDB_DBMS_GEN dbms_sqlset_OBJS
+
+# BEGIN QDB_DBMS_GEN dbms_ash_SRCS
+DBMS_SRCS_DBMS_ASH = \
+ dbms_ash/dbms_ash.cpp \
+# END QDB_DBMS_GEN dbms_ash_SRCS
+
+# BEGIN QDB_DBMS_GEN dbms_ash_OBJS
+DBMS_OBJS_DBMS_ASH = \
+ utils/dbms/dbms_ash/dbms_ash.o \
+# END QDB_DBMS_GEN dbms_ash_OBJS
+
# ===== UTL_MAIL =====
# BEGIN QDB_DBMS_GEN utl_mail_SRCS
DBMS_SRCS_UTL_MAIL = \
@@ -259,12 +391,100 @@
DBMS_OBJS_UTL_I18N = \
utils/dbms/utl_i18n/utl_i18n.o \
+DBMS_SRCS_UTL_GDK = \
+ utl_gdk/utl_gdk.cpp \
+
+DBMS_OBJS_UTL_GDK = \
+ utils/dbms/utl_gdk/utl_gdk.o \
+
DBMS_SRCS_VERSION = \
version/version.cpp \
DBMS_OBJS_VERSION = \
utils/dbms/version/version.o \
+# BEGIN QDB_DBMS_GEN htf_SRCS
+DBMS_SRCS_HTF = \
+ htf/htf.cpp \
+ htf/htf_common.cpp \
+# END QDB_DBMS_GEN htf_SRCS
+
+# BEGIN QDB_DBMS_GEN htf_OBJS
+DBMS_OBJS_HTF = \
+ utils/dbms/htf/htf.o \
+ utils/dbms/htf/htf_common.o \
+# END QDB_DBMS_GEN htf_OBJS
+
+# BEGIN QDB_DBMS_GEN htp_SRCS
+DBMS_SRCS_HTP = \
+ htp/htp.cpp \
+# END QDB_DBMS_GEN htp_SRCS
+
+# BEGIN QDB_DBMS_GEN htp_OBJS
+DBMS_OBJS_HTP = \
+ utils/dbms/htp/htp.o \
+# END QDB_DBMS_GEN htp_OBJS
+
+# BEGIN QDB_DBMS_GEN owa_SRCS
+DBMS_SRCS_OWA = \
+ owa/owa_cookie.cpp \
+ owa/owa_cache.cpp \
+# END QDB_DBMS_GEN owa_SRCS
+
+# BEGIN QDB_DBMS_GEN owa_OBJS
+DBMS_OBJS_OWA = \
+ utils/dbms/owa/owa_cookie.o \
+ utils/dbms/owa/owa_cache.o \
+# END QDB_DBMS_GEN owa_OBJS
+
+DBMS_SRCS_DBMS_TRANSACTION = \
+ dbms/dbms_transaction/dbms_transaction.cpp
+
+DBMS_OBJS_DBMS_TRANSACTION = \
+ utils/dbms/dbms_transaction/dbms_transaction.o
+
+DBMS_SRCS_DBMS_DDL = \
+ dbms/dbms_ddl/dbms_ddl.cpp
+
+DBMS_OBJS_DBMS_DDL = \
+ utils/dbms/dbms_ddl/dbms_ddl.o
+
+DBMS_SRCS_OWA_TEXT = \
+ dbms/owa_text/owa_text.cpp
+
+DBMS_OBJS_OWA_TEXT = \
+ utils/dbms/owa_text/owa_text.o
+
+DBMS_SRCS_DBMS_XMLSTORE = \
+ dbms/dbms_xmlstore/dbms_xmlstore.cpp
+
+DBMS_OBJS_DBMS_XMLSTORE = \
+ utils/dbms/dbms_xmlstore/dbms_xmlstore.o
+
+DBMS_SRCS_DBMS_XMLSAVE = \
+ dbms/dbms_xmlsave/dbms_xmlsave.cpp
+
+DBMS_OBJS_DBMS_XMLSAVE = \
+ utils/dbms/dbms_xmlsave/dbms_xmlsave.o
+
+DBMS_SRCS_OWA_PATTERN = \
+ dbms/owa_pattern/owa_pattern.cpp
+
+DBMS_OBJS_OWA_PATTERN = \
+ utils/dbms/owa_pattern/owa_pattern.o
+
+DBMS_SRCS_OWA_MATCH = \
+ dbms/owa_match/owa_match.cpp
+
+DBMS_OBJS_OWA_MATCH = \
+ utils/dbms/owa_match/owa_match.o
+
+DBMS_SRCS_OWA_UTIL = \
+ dbms/owa_util/owa_util.cpp
+
+DBMS_OBJS_OWA_UTIL = \
+ utils/dbms/owa_util/owa_util.o
+
# Общий список объектов для линковки
OBJS += $(DBMS_OBJS_DBMS_ALERT) \
$(DBMS_OBJS_DBMS_ASSERT) \
@@ -272,6 +492,17 @@
$(DBMS_OBJS_DBMS_AQADM) \
$(DBMS_OBJS_DBMS_CRYPTO) \
$(DBMS_OBJS_DBMS_DESCRIBE) \
+$(DBMS_OBJS_DBMS_JSON) \
+$(DBMS_OBJS_DBMS_JSON_SCHEMA) \
+$(DBMS_OBJS_DBMS_TRACE) \
+$(DBMS_OBJS_DBMS_TNS) \
+$(DBMS_OBJS_DBMS_ASH) \
+$(DBMS_OBJS_DBMS_SQLSET) \
+$(DBMS_OBJS_DBMS_STAT_FUNCS) \
+$(DBMS_OBJS_DBMS_WARNING) \
+$(DBMS_OBJS_DBMS_SYSTEM) \
+$(DBMS_OBJS_DBMS_FILE_TRANSFER) \
+$(DBMS_OBJS_DBMS_DB_VERSION) \
$(DBMS_OBJS_DBMS_HASH) \
$(DBMS_OBJS_DBMS_LOB) \
$(DBMS_OBJS_DBMS_ODCI) \
@@ -294,7 +525,19 @@
$(DBMS_OBJS_UTL_MAIL) \
$(DBMS_OBJS_UTL_REF) \
$(DBMS_OBJS_UTL_I18N) \
-$(DBMS_OBJS_VERSION)
+$(DBMS_OBJS_UTL_GDK) \
+$(DBMS_OBJS_VERSION) \
+$(DBMS_OBJS_HTF) \
+$(DBMS_OBJS_HTP) \
+$(DBMS_OBJS_OWA) \
+$(DBMS_OBJS_DBMS_TRANSACTION) \
+$(DBMS_OBJS_DBMS_DDL) \
+$(DBMS_OBJS_OWA_TEXT) \
+$(DBMS_OBJS_DBMS_XMLSTORE) \
+$(DBMS_OBJS_DBMS_XMLSAVE) \
+$(DBMS_OBJS_OWA_PATTERN) \
+$(DBMS_OBJS_OWA_MATCH) \
+$(DBMS_OBJS_OWA_UTIL)
#$(DBMS_OBJS_DBMS_ALERT) \
# $(DBMS_OBJS_DBMS_APPLICATION_INFO) \
# $(DBMS_OBJS_DBMS_ASSERT) \
@@ -340,6 +583,7 @@
# $(DBMS_OBJS_DBMS_REPORT)
# Правила компиляции по подпапкам
+
utils/dbms/dbms_alert/%.o: utils/dbms/dbms_alert/%.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
@@ -358,6 +602,47 @@
utils/dbms/dbms_describe/%.o: utils/dbms/dbms_describe/%.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
+utils/dbms/dbms_json/%.o: utils/dbms/dbms_json/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+dbms_json/%.o: dbms_json/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+dbms_json.o: dbms_json/dbms_json.o
+
+utils/dbms/dbms_json_schema/%.o: utils/dbms/dbms_json_schema/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_json_schema/vendor/%.o: utils/dbms/dbms_json_schema/vendor/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_trace/%.o: utils/dbms/dbms_trace/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_tns/%.o: utils/dbms/dbms_tns/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_ash/%.o: utils/dbms/dbms_ash/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_sqlset/%.o: utils/dbms/dbms_sqlset/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_stat_funcs/%.o: utils/dbms/dbms_stat_funcs/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_warning/%.o: utils/dbms/dbms_warning/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_system/%.o: utils/dbms/dbms_system/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_file_transfer/%.o: utils/dbms/dbms_file_transfer/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_db_version/%.o: utils/dbms/dbms_db_version/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
utils/dbms/dbms_output/%.o: utils/dbms/dbms_output/%.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
@@ -418,15 +703,50 @@
utils/dbms/utl_i18n/%.o: utils/dbms/utl_i18n/%.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
+utils/dbms/utl_gdk/%.o: utils/dbms/utl_gdk/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
utils/dbms/dbms_odci/dbms_odci.o: utils/dbms/dbms_odci/dbms_odci.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
-
+
utils/dbms/dbms_report/%.o: utils/dbms/dbms_report/%.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
utils/dbms/version/%.o: utils/dbms/version/%.cpp
$(COMPILE.cc) $(OUTPUT_OPTION) $<
+utils/dbms/htf/%.o: utils/dbms/htf/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/htp/%.o: utils/dbms/htp/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/owa/%.o: utils/dbms/owa/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_transaction/%.o: utils/dbms/dbms_transaction/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_ddl/%.o: utils/dbms/dbms_ddl/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/owa_text/%.o: utils/dbms/owa_text/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_xmlstore/%.o: utils/dbms/dbms_xmlstore/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/dbms_xmlsave/%.o: utils/dbms/dbms_xmlsave/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/owa_pattern/%.o: utils/dbms/owa_pattern/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/owa_match/%.o: utils/dbms/owa_match/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+utils/dbms/owa_util/%.o: utils/dbms/owa_util/%.cpp
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
# Clean rule for dbms objects
.PHONY: clean-dbms
@@ -437,6 +757,16 @@
$(DBMS_OBJS_DBMS_HASH) \
$(DBMS_OBJS_DBMS_LOB) \
$(DBMS_OBJS_DBMS_DESCRIBE) \
+ $(DBMS_OBJS_DBMS_JSON) \
+ $(DBMS_OBJS_DBMS_JSON_SCHEMA) \
+ $(DBMS_OBJS_DBMS_TRACE) \
+ $(DBMS_OBJS_DBMS_TNS) \
+ $(DBMS_OBJS_DBMS_ASH) \
+ $(DBMS_OBJS_DBMS_SQLSET) \
+ $(DBMS_OBJS_DBMS_STAT_FUNCS) \
+ $(DBMS_OBJS_DBMS_WARNING) \
+ $(DBMS_OBJS_DBMS_SYSTEM) \
+ $(DBMS_OBJS_DBMS_FILE_TRANSFER) \
$(DBMS_OBJS_DBMS_RANDOM) \
$(DBMS_OBJS_DBMS_OUTPUT) \
$(DBMS_OBJS_DBMS_UTILITY) \
@@ -457,6 +787,18 @@
$(DBMS_OBJS_UTL_TCP) \
$(DBMS_OBJS_UTL_REF) \
$(DBMS_OBJS_UTL_I18N) \
+ $(DBMS_OBJS_UTL_GDK) \
$(DBMS_OBJS_DBMS_ODCI) \
$(DBMS_OBJS_DBMS_REPORT) \
- $(DBMS_OBJS_VERSION)
+ $(DBMS_OBJS_VERSION) \
+ $(DBMS_OBJS_HTF) \
+ $(DBMS_OBJS_HTP) \
+ $(DBMS_OBJS_OWA) \
+ $(DBMS_OBJS_DBMS_TRANSACTION) \
+ $(DBMS_OBJS_DBMS_DDL) \
+ $(DBMS_OBJS_OWA_TEXT) \
+ $(DBMS_OBJS_DBMS_XMLSTORE) \
+ $(DBMS_OBJS_DBMS_XMLSAVE) \
+ $(DBMS_OBJS_OWA_PATTERN) \
+ $(DBMS_OBJS_OWA_MATCH) \
+ $(DBMS_OBJS_OWA_UTIL)
diff --git a/src/backend/utils/dbms/dbms_ash/dbms_ash.cpp b/src/backend/utils/dbms/dbms_ash/dbms_ash.cpp
new file mode 100644
index 0000000..6ba57e9
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_ash/dbms_ash.cpp
@@ -0,0 +1,709 @@
+#include "dbms_ash.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+} // extern "C"
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_ash_fetch_obj_name);
+PG_FUNCTION_INFO_V1(dbms_ash_fetch_procedure_name);
+PG_FUNCTION_INFO_V1(dbms_ash_fetch_sqltext);
+PG_FUNCTION_INFO_V1(dbms_ash_fetch_user_name);
+PG_FUNCTION_INFO_V1(dbms_ash_getadditionalinfo);
+PG_FUNCTION_INFO_V1(dbms_ash_getawrinfo);
+PG_FUNCTION_INFO_V1(dbms_ash_getcpuinfo);
+PG_FUNCTION_INFO_V1(dbms_ash_getdata);
+PG_FUNCTION_INFO_V1(dbms_ash_getdatahistorical);
+PG_FUNCTION_INFO_V1(dbms_ash_getdatarealtime);
+PG_FUNCTION_INFO_V1(dbms_ash_gethistogramhistorical);
+PG_FUNCTION_INFO_V1(dbms_ash_gethistogramrealtime);
+PG_FUNCTION_INFO_V1(dbms_ash_getsqltext);
+PG_FUNCTION_INFO_V1(dbms_ash_gettimeformat);
+PG_FUNCTION_INFO_V1(dbms_ash_gettimepickerhistorical);
+PG_FUNCTION_INFO_V1(dbms_ash_gettimepickerrealtime);
+PG_FUNCTION_INFO_V1(dbms_ash_getversion);
+PG_FUNCTION_INFO_V1(dbms_ash_get_blocking_session_data);
+PG_FUNCTION_INFO_V1(dbms_ash_incrementdata);
+PG_FUNCTION_INFO_V1(dbms_ash_incrementhistogram);
+PG_FUNCTION_INFO_V1(dbms_ash_incrementtimepicker);
+PG_FUNCTION_INFO_V1(dbms_ash_str_to_ascii);
+PG_FUNCTION_INFO_V1(dbms_ash_get_version);
+PG_FUNCTION_INFO_V1(dbms_ash_mock);
+} // extern "C"
+
+#define RUDB_DBMS_ASH_VERSION "1.0.0"
+
+Datum dbms_ash_fetch_obj_name(PG_FUNCTION_ARGS)
+{
+ const int32 p_obj_id = PG_GETARG_INT32(1);
+ (void) p_obj_id;
+
+ const int32 p_dbid = PG_GETARG_INT32(2);
+ (void) p_dbid;
+
+ const int32 p_con_dbid = PG_GETARG_INT32(3);
+ (void) p_con_dbid;
+
+ const text* p_is_local = PG_GETARG_TEXT_PP(4);
+ (void) p_is_local;
+
+ const text* p_local_type = PG_GETARG_TEXT_PP(5);
+ (void) p_local_type;
+
+ const text* p_is_old = PG_GETARG_TEXT_PP(6);
+ (void) p_is_old;
+
+ const text* p_time_limit = PG_GETARG_TEXT_PP(7);
+ (void) p_time_limit;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.FETCH_OBJ_NAME не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_fetch_procedure_name(PG_FUNCTION_ARGS)
+{
+ const int32 p_obj_id = PG_GETARG_INT32(1);
+ (void) p_obj_id;
+
+ const int32 p_subobj_id = PG_GETARG_INT32(2);
+ (void) p_subobj_id;
+
+ const int32 p_con_dbid = PG_GETARG_INT32(3);
+ (void) p_con_dbid;
+
+ const text* p_time_limit = PG_GETARG_TEXT_PP(4);
+ (void) p_time_limit;
+
+ ereport(ERROR, (errmsg("функция DBMS_ASH.FETCH_PROCEDURE_NAME не реализована.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_fetch_sqltext(PG_FUNCTION_ARGS)
+{
+ const text* p_sqlid = PG_GETARG_TEXT_PP(1);
+ (void) p_sqlid;
+
+ const int32 p_dbid = PG_GETARG_INT32(2);
+ (void) p_dbid;
+
+ const int32 p_con_dbid = PG_GETARG_INT32(3);
+ (void) p_con_dbid;
+
+ const text* p_is_local = PG_GETARG_TEXT_PP(4);
+ (void) p_is_local;
+
+ const text* p_is_pdb = PG_GETARG_TEXT_PP(5);
+ (void) p_is_pdb;
+
+ const text* p_is_old = PG_GETARG_TEXT_PP(6);
+ (void) p_is_old;
+
+ const text* p_time_limit = PG_GETARG_TEXT_PP(7);
+ (void) p_time_limit;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.FETCH_SQLTEXT не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_fetch_user_name(PG_FUNCTION_ARGS)
+{
+ const int32 p_user_id = PG_GETARG_INT32(1);
+ (void) p_user_id;
+
+ const int32 p_con_dbid = PG_GETARG_INT32(2);
+ (void) p_con_dbid;
+
+ const text* p_time_limit = PG_GETARG_TEXT_PP(3);
+ (void) p_time_limit;
+
+ ereport(ERROR, (errmsg("функция DBMS_ASH.FETCH_USER_NAME не реализована.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getadditionalinfo(PG_FUNCTION_ARGS)
+{
+ const int32 dbid = PG_GETARG_INT32(1);
+ (void) dbid;
+
+ const int32 instance_number = PG_GETARG_INT32(2);
+ (void) instance_number;
+
+ const text* real_time_mode = PG_GETARG_TEXT_PP(3);
+ (void) real_time_mode;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(4);
+ (void) show_sql;
+
+ const text* dim_list = PG_GETARG_TEXT_PP(5);
+ (void) dim_list;
+
+ const text* sqlid_list = PG_GETARG_TEXT_PP(6);
+ (void) sqlid_list;
+
+ const text* plsql_list = PG_GETARG_TEXT_PP(7);
+ (void) plsql_list;
+
+ const text* object_list = PG_GETARG_TEXT_PP(8);
+ (void) object_list;
+
+ const text* user_list = PG_GETARG_TEXT_PP(9);
+ (void) user_list;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETADDITIONALINFO не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getawrinfo(PG_FUNCTION_ARGS)
+{
+ const int32 p_dbid = PG_GETARG_INT32(1);
+ (void) p_dbid;
+
+ const text* p_begin_time_utc = PG_GETARG_TEXT_PP(2);
+ (void) p_begin_time_utc;
+
+ const text* p_end_time_utc = PG_GETARG_TEXT_PP(3);
+ (void) p_end_time_utc;
+
+ const int32 p_inst_num = PG_GETARG_INT32(4);
+ (void) p_inst_num;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(5);
+ (void) show_sql;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETAWRINFO не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getcpuinfo(PG_FUNCTION_ARGS)
+{
+ const int32 dbid = PG_GETARG_INT32(1);
+ (void) dbid;
+
+ const text* observationtime = PG_GETARG_TEXT_PP(2);
+ (void) observationtime;
+
+ const int32 instance_number = PG_GETARG_INT32(3);
+ (void) instance_number;
+
+ const text* ignore_cpu_history = PG_GETARG_TEXT_PP(4);
+ (void) ignore_cpu_history;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(5);
+ (void) show_sql;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETCPUINFO не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getdata(PG_FUNCTION_ARGS)
+{
+ const text* data_type = PG_GETARG_TEXT_PP(1);
+ (void) data_type;
+
+ const text* time_type = PG_GETARG_TEXT_PP(2);
+ (void) time_type;
+
+ const text* filter_list = PG_GETARG_TEXT_PP(3);
+ (void) filter_list;
+
+ const text* args = PG_GETARG_TEXT_PP(4);
+ (void) args;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETDATA не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getdatahistorical(PG_FUNCTION_ARGS)
+{
+ const int32 dbid = PG_GETARG_INT32(1);
+ (void) dbid;
+
+ const text* filter_list = PG_GETARG_TEXT_PP(2);
+ (void) filter_list;
+
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(3);
+ (void) begin_time_utc;
+
+ const text* end_time_utc = PG_GETARG_TEXT_PP(4);
+ (void) end_time_utc;
+
+ const int32 time_since_sec = PG_GETARG_INT32(5);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(6);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(7);
+ (void) verbose_xml;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(8);
+ (void) include_bg;
+
+ const int32 instance_number = PG_GETARG_INT32(9);
+ (void) instance_number;
+
+ const text* minimize_cost = PG_GETARG_TEXT_PP(10);
+ (void) minimize_cost;
+
+ const text* resolution = PG_GETARG_TEXT_PP(11);
+ (void) resolution;
+
+ const text* monitoring_mode = PG_GETARG_TEXT_PP(12);
+ (void) monitoring_mode;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(13);
+ (void) memory_only;
+
+ const text* dimensions = PG_GETARG_TEXT_PP(14);
+ (void) dimensions;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETDATAHISTORICAL не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getdatarealtime(PG_FUNCTION_ARGS)
+{
+ const text* filter_list = PG_GETARG_TEXT_PP(1);
+ (void) filter_list;
+
+ const int32 time_since_sec = PG_GETARG_INT32(2);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(3);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(4);
+ (void) verbose_xml;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(5);
+ (void) include_bg;
+
+ const int32 instance_number = PG_GETARG_INT32(6);
+ (void) instance_number;
+
+ const text* minimize_cost = PG_GETARG_TEXT_PP(7);
+ (void) minimize_cost;
+
+ const text* resolution = PG_GETARG_TEXT_PP(8);
+ (void) resolution;
+
+ const text* monitoring_mode = PG_GETARG_TEXT_PP(9);
+ (void) monitoring_mode;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(10);
+ (void) memory_only;
+
+ const text* dimensions = PG_GETARG_TEXT_PP(11);
+ (void) dimensions;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETDATAREALTIME не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_gethistogramhistorical(PG_FUNCTION_ARGS)
+{
+ const int32 dbid = PG_GETARG_INT32(1);
+ (void) dbid;
+
+ const text* filter_list = PG_GETARG_TEXT_PP(2);
+ (void) filter_list;
+
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(3);
+ (void) begin_time_utc;
+
+ const text* end_time_utc = PG_GETARG_TEXT_PP(4);
+ (void) end_time_utc;
+
+ const int32 time_since_sec = PG_GETARG_INT32(5);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(6);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(7);
+ (void) verbose_xml;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(8);
+ (void) include_bg;
+
+ const int32 instance_number = PG_GETARG_INT32(9);
+ (void) instance_number;
+
+ const text* ignore_cpu_history = PG_GETARG_TEXT_PP(10);
+ (void) ignore_cpu_history;
+
+ const text* resolution = PG_GETARG_TEXT_PP(11);
+ (void) resolution;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(12);
+ (void) memory_only;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETHISTOGRAMHISTORICAL не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_gethistogramrealtime(PG_FUNCTION_ARGS)
+{
+ const text* filter_list = PG_GETARG_TEXT_PP(1);
+ (void) filter_list;
+
+ const int32 time_since_sec = PG_GETARG_INT32(2);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(3);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(4);
+ (void) verbose_xml;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(5);
+ (void) include_bg;
+
+ const int32 instance_number = PG_GETARG_INT32(6);
+ (void) instance_number;
+
+ const text* ignore_cpu_history = PG_GETARG_TEXT_PP(7);
+ (void) ignore_cpu_history;
+
+ const text* resolution = PG_GETARG_TEXT_PP(8);
+ (void) resolution;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(9);
+ (void) memory_only;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETHISTOGRAMREALTIME не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getsqltext(PG_FUNCTION_ARGS)
+{
+ const int32 p_dbid = PG_GETARG_INT32(1);
+ (void) p_dbid;
+
+ const text* p_sql_ids = PG_GETARG_TEXT_PP(2);
+ (void) p_sql_ids;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETSQLTEXT не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_gettimeformat(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETTIMEFORMAT не реализована.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_gettimepickerhistorical(PG_FUNCTION_ARGS)
+{
+ const int32 dbid = PG_GETARG_INT32(1);
+ (void) dbid;
+
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(2);
+ (void) begin_time_utc;
+
+ const text* end_time_utc = PG_GETARG_TEXT_PP(3);
+ (void) end_time_utc;
+
+ const int32 time_since_sec = PG_GETARG_INT32(4);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(5);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(6);
+ (void) verbose_xml;
+
+ const int32 instance_number = PG_GETARG_INT32(7);
+ (void) instance_number;
+
+ const text* awr_info = PG_GETARG_TEXT_PP(8);
+ (void) awr_info;
+
+ const text* ignore_cpu_history = PG_GETARG_TEXT_PP(9);
+ (void) ignore_cpu_history;
+
+ const text* resolution = PG_GETARG_TEXT_PP(10);
+ (void) resolution;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(11);
+ (void) include_bg;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(12);
+ (void) memory_only;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETTIMEPICKERHISTORICAL не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_gettimepickerrealtime(PG_FUNCTION_ARGS)
+{
+ const int32 time_since_sec = PG_GETARG_INT32(1);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(2);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(3);
+ (void) verbose_xml;
+
+ const int32 instance_number = PG_GETARG_INT32(4);
+ (void) instance_number;
+
+ const text* awr_info = PG_GETARG_TEXT_PP(5);
+ (void) awr_info;
+
+ const text* ignore_cpu_history = PG_GETARG_TEXT_PP(6);
+ (void) ignore_cpu_history;
+
+ const text* resolution = PG_GETARG_TEXT_PP(7);
+ (void) resolution;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(8);
+ (void) include_bg;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(9);
+ (void) memory_only;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETTIMEPICKERREALTIME не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_getversion(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GETVERSION не реализована.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_get_blocking_session_data(PG_FUNCTION_ARGS)
+{
+ const text* data_type = PG_GETARG_TEXT_PP(1);
+ (void) data_type;
+
+ const text* source_type = PG_GETARG_TEXT_PP(2);
+ (void) source_type;
+
+ const text* filter_list = PG_GETARG_TEXT_PP(3);
+ (void) filter_list;
+
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(4);
+ (void) begin_time_utc;
+
+ const text* end_time_utc = PG_GETARG_TEXT_PP(5);
+ (void) end_time_utc;
+
+ const int32 time_since_sec = PG_GETARG_INT32(6);
+ (void) time_since_sec;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(7);
+ (void) show_sql;
+
+ const text* filter_common_user = PG_GETARG_TEXT_PP(8);
+ (void) filter_common_user;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.GET_BLOCKING_SESSION_DATA не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_incrementdata(PG_FUNCTION_ARGS)
+{
+ const text* filter_list = PG_GETARG_TEXT_PP(1);
+ (void) filter_list;
+
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(2);
+ (void) begin_time_utc;
+
+ const int32 bucket_size = PG_GETARG_INT32(3);
+ (void) bucket_size;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(4);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(5);
+ (void) verbose_xml;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(6);
+ (void) include_bg;
+
+ const int32 instance_number = PG_GETARG_INT32(7);
+ (void) instance_number;
+
+ const text* minimize_cost = PG_GETARG_TEXT_PP(8);
+ (void) minimize_cost;
+
+ const text* resolution = PG_GETARG_TEXT_PP(9);
+ (void) resolution;
+
+ const text* monitoring_mode = PG_GETARG_TEXT_PP(10);
+ (void) monitoring_mode;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(11);
+ (void) memory_only;
+
+ const text* dimensions = PG_GETARG_TEXT_PP(12);
+ (void) dimensions;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.INCREMENTDATA не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_incrementhistogram(PG_FUNCTION_ARGS)
+{
+ const text* filter_list = PG_GETARG_TEXT_PP(1);
+ (void) filter_list;
+
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(2);
+ (void) begin_time_utc;
+
+ const int32 bucket_size = PG_GETARG_INT32(3);
+ (void) bucket_size;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(4);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(5);
+ (void) verbose_xml;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(6);
+ (void) include_bg;
+
+ const int32 instance_number = PG_GETARG_INT32(7);
+ (void) instance_number;
+
+ const text* resolution = PG_GETARG_TEXT_PP(8);
+ (void) resolution;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(9);
+ (void) memory_only;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.INCREMENTHISTOGRAM не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_incrementtimepicker(PG_FUNCTION_ARGS)
+{
+ const text* begin_time_utc = PG_GETARG_TEXT_PP(1);
+ (void) begin_time_utc;
+
+ const int32 bucket_size = PG_GETARG_INT32(2);
+ (void) bucket_size;
+
+ const text* show_sql = PG_GETARG_TEXT_PP(3);
+ (void) show_sql;
+
+ const text* verbose_xml = PG_GETARG_TEXT_PP(4);
+ (void) verbose_xml;
+
+ const int32 instance_number = PG_GETARG_INT32(5);
+ (void) instance_number;
+
+ const text* awr_info = PG_GETARG_TEXT_PP(6);
+ (void) awr_info;
+
+ const text* resolution = PG_GETARG_TEXT_PP(7);
+ (void) resolution;
+
+ const text* include_bg = PG_GETARG_TEXT_PP(8);
+ (void) include_bg;
+
+ const text* memory_only = PG_GETARG_TEXT_PP(9);
+ (void) memory_only;
+
+ /*
+ * ERROR: неподдерживаемый элемент сохранён как заглушка.
+ * ERROR: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация.
+ */
+ ereport(ERROR, (errmsg("функция DBMS_ASH.INCREMENTTIMEPICKER не поддерживается: Неподдерживаемый возвращаемый тип OPAQUE/XMLTYPE; функция сгенерирована как заглушка с catalog return type text. Требуется ручная проверка/реализация. Проверьте соответствующую запись в pg_proc.dat.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_str_to_ascii(PG_FUNCTION_ARGS)
+{
+ const text* s = PG_GETARG_TEXT_PP(1);
+ (void) s;
+
+ ereport(ERROR, (errmsg("функция DBMS_ASH.STR_TO_ASCII не реализована.")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_ash_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_ASH_VERSION));
+}
+
+Datum dbms_ash_mock(PG_FUNCTION_ARGS)
+{
+ /*
+ * ERROR: generated package mock stub.
+ * ERROR: Эта функция является checkpoint-заглушкой и требует ручной реализации.
+ * ERROR: Generated package mock stub: функция DBMS_ASH.MOCK является заглушкой и требует ручной реализации.
+ */
+ ereport(ERROR, (errmsg("Сгенерированная функция DBMS_ASH.MOCK является mock stub; требуется ручная реализация.")));
+ PG_RETURN_NULL();
+}
diff --git a/src/backend/utils/dbms/dbms_ash/dbms_ash.hpp b/src/backend/utils/dbms/dbms_ash/dbms_ash.hpp
new file mode 100644
index 0000000..b5ff38e
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_ash/dbms_ash.hpp
@@ -0,0 +1,556 @@
+#ifndef DBMS_ASH_INTERNAL_HPP
+#define DBMS_ASH_INTERNAL_HPP
+
+/**
+ * @brief DBMS_ASH: Импортировано из Oracle API inventory: /home/dev/rudb_dbms_gen_output/oracle_inventory/rudb_api_inventory.tsv
+ * @details
+ * Назначение:
+ * Импортировано из Oracle API inventory:
+ * /home/dev/rudb_dbms_gen_output/oracle_inventory/rudb_api_inventory.tsv
+ */
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+} // extern "C"
+
+extern "C"
+{
+/**
+ * @brief функция dbms_ash_fetch_obj_name.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_fetch_obj_name(:p_obj_id, :p_dbid, :p_con_dbid, :p_is_local,
+ * :p_local_type, :p_is_old, :p_time_limit) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_fetch_obj_name(42, 42, 42, 'demo_alias',
+ * 'demo_alias', 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_fetch_obj_name(0, 0, 0, 'demo_value', 'demo_value',
+ * 'demo_value', 'demo_value') FROM dual;
+ * @param p_obj_id Аргумент p_obj_id, режим IN, тип number.
+ * @param p_dbid Аргумент p_dbid, режим IN, тип number.
+ * @param p_con_dbid Аргумент p_con_dbid, режим IN, тип number.
+ * @param p_is_local Аргумент p_is_local, режим IN, тип varchar2.
+ * @param p_local_type Аргумент p_local_type, режим IN, тип varchar2.
+ * @param p_is_old Аргумент p_is_old, режим IN, тип varchar2.
+ * @param p_time_limit Аргумент p_time_limit, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_fetch_obj_name(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_fetch_procedure_name.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_fetch_procedure_name(:p_obj_id, :p_subobj_id, :p_con_dbid,
+ * :p_time_limit) FROM dual;
+ * DECLARE v varchar2; BEGIN v := DBMS_ASH.dbms_ash_fetch_procedure_name(42, 42, 42,
+ * 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_fetch_procedure_name(0, 0, 0, 'demo_value') FROM dual;
+ * @param p_obj_id Аргумент p_obj_id, режим IN, тип number.
+ * @param p_subobj_id Аргумент p_subobj_id, режим IN, тип number.
+ * @param p_con_dbid Аргумент p_con_dbid, режим IN, тип number.
+ * @param p_time_limit Аргумент p_time_limit, режим IN, тип varchar2.
+ * @return `varchar2`.
+ */
+Datum dbms_ash_fetch_procedure_name(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_fetch_sqltext.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_fetch_sqltext(:p_sqlid, :p_dbid, :p_con_dbid, :p_is_local,
+ * :p_is_pdb, :p_is_old, :p_time_limit) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_fetch_sqltext('demo_alias', 42, 42,
+ * 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_fetch_sqltext('demo_value', 0, 0, 'demo_value', 'demo_value',
+ * 'demo_value', 'demo_value') FROM dual;
+ * @param p_sqlid Аргумент p_sqlid, режим IN, тип varchar2.
+ * @param p_dbid Аргумент p_dbid, режим IN, тип number.
+ * @param p_con_dbid Аргумент p_con_dbid, режим IN, тип number.
+ * @param p_is_local Аргумент p_is_local, режим IN, тип varchar2.
+ * @param p_is_pdb Аргумент p_is_pdb, режим IN, тип varchar2.
+ * @param p_is_old Аргумент p_is_old, режим IN, тип varchar2.
+ * @param p_time_limit Аргумент p_time_limit, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_fetch_sqltext(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_fetch_user_name.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_fetch_user_name(:p_user_id, :p_con_dbid, :p_time_limit) FROM
+ * dual;
+ * DECLARE v varchar2; BEGIN v := DBMS_ASH.dbms_ash_fetch_user_name(42, 42, 'demo_alias');
+ * END;
+ * SELECT DBMS_ASH.dbms_ash_fetch_user_name(0, 0, 'demo_value') FROM dual;
+ * @param p_user_id Аргумент p_user_id, режим IN, тип number.
+ * @param p_con_dbid Аргумент p_con_dbid, режим IN, тип number.
+ * @param p_time_limit Аргумент p_time_limit, режим IN, тип varchar2.
+ * @return `varchar2`.
+ */
+Datum dbms_ash_fetch_user_name(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getadditionalinfo.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getadditionalinfo(:dbid, :instance_number, :real_time_mode,
+ * :show_sql, :dim_list, :sqlid_list, :plsql_list, :object_list, :user_list) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getadditionalinfo(42, 42, 'demo_alias',
+ * 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias');
+ * END;
+ * SELECT DBMS_ASH.dbms_ash_getadditionalinfo(0, 0, 'demo_value', 'demo_value',
+ * 'demo_value', 'demo_value', 'demo_value', 'demo_value', 'demo_value') FROM dual;
+ * @param dbid Аргумент dbid, режим IN, тип number.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param real_time_mode Аргумент real_time_mode, режим IN, тип varchar2.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param dim_list Аргумент dim_list, режим IN, тип varchar2.
+ * @param sqlid_list Аргумент sqlid_list, режим IN, тип varchar2.
+ * @param plsql_list Аргумент plsql_list, режим IN, тип varchar2.
+ * @param object_list Аргумент object_list, режим IN, тип varchar2.
+ * @param user_list Аргумент user_list, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getadditionalinfo(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getawrinfo.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getawrinfo(:p_dbid, :p_begin_time_utc, :p_end_time_utc,
+ * :p_inst_num, :show_sql) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getawrinfo(42, 'demo_alias', 'demo_alias',
+ * 42, 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_getawrinfo(0, 'demo_value', 'demo_value', 0, 'demo_value') FROM
+ * dual;
+ * @param p_dbid Аргумент p_dbid, режим IN, тип number.
+ * @param p_begin_time_utc Аргумент p_begin_time_utc, режим IN, тип varchar2.
+ * @param p_end_time_utc Аргумент p_end_time_utc, режим IN, тип varchar2.
+ * @param p_inst_num Аргумент p_inst_num, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getawrinfo(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getcpuinfo.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getcpuinfo(:dbid, :observationtime, :instance_number,
+ * :ignore_cpu_history, :show_sql) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getcpuinfo(42, 'demo_alias', 42,
+ * 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_getcpuinfo(0, 'demo_value', 0, 'demo_value', 'demo_value') FROM
+ * dual;
+ * @param dbid Аргумент dbid, режим IN, тип number.
+ * @param observationtime Аргумент observationtime, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param ignore_cpu_history Аргумент ignore_cpu_history, режим IN, тип varchar2.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getcpuinfo(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getdata.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getdata(:data_type, :time_type, :filter_list, :args) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getdata('demo_alias', 'demo_alias',
+ * 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_getdata('demo_value', 'demo_value', 'demo_value', 'demo_value')
+ * FROM dual;
+ * @param data_type Аргумент data_type, режим IN, тип varchar2.
+ * @param time_type Аргумент time_type, режим IN, тип varchar2.
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param args Аргумент args, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getdata(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getdatahistorical.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getdatahistorical(:dbid, :filter_list, :begin_time_utc,
+ * :end_time_utc, :time_since_sec, :show_sql, :verbose_xml, :include_bg, :instance_number,
+ * :minimize_cost, :resolution, :monitoring_mode, :memory_only, :dimensions) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getdatahistorical(42, 'demo_alias',
+ * 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias', 42,
+ * 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_getdatahistorical(0, 'demo_value', 'demo_value', 'demo_value',
+ * 0, 'demo_value', 'demo_value', 'demo_value', 0, 'demo_value', 'demo_value',
+ * 'demo_value', 'demo_value', 'demo_value') FROM dual;
+ * @param dbid Аргумент dbid, режим IN, тип number.
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param end_time_utc Аргумент end_time_utc, режим IN, тип varchar2.
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param minimize_cost Аргумент minimize_cost, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param monitoring_mode Аргумент monitoring_mode, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @param dimensions Аргумент dimensions, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getdatahistorical(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getdatarealtime.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getdatarealtime(:filter_list, :time_since_sec, :show_sql,
+ * :verbose_xml, :include_bg, :instance_number, :minimize_cost, :resolution,
+ * :monitoring_mode, :memory_only, :dimensions) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getdatarealtime('demo_alias', 42,
+ * 'demo_alias', 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias',
+ * 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_getdatarealtime('demo_value', 0, 'demo_value', 'demo_value',
+ * 'demo_value', 0, 'demo_value', 'demo_value', 'demo_value', 'demo_value', 'demo_value')
+ * FROM dual;
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param minimize_cost Аргумент minimize_cost, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param monitoring_mode Аргумент monitoring_mode, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @param dimensions Аргумент dimensions, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getdatarealtime(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_gethistogramhistorical.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_gethistogramhistorical(:dbid, :filter_list, :begin_time_utc,
+ * :end_time_utc, :time_since_sec, :show_sql, :verbose_xml, :include_bg, :instance_number,
+ * :ignore_cpu_history, :resolution, :memory_only) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_gethistogramhistorical(42, 'demo_alias',
+ * 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias', 42,
+ * 'demo_alias', 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_gethistogramhistorical(0, 'demo_value', 'demo_value',
+ * 'demo_value', 0, 'demo_value', 'demo_value', 'demo_value', 0, 'demo_value',
+ * 'demo_value', 'demo_value') FROM dual;
+ * @param dbid Аргумент dbid, режим IN, тип number.
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param end_time_utc Аргумент end_time_utc, режим IN, тип varchar2.
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param ignore_cpu_history Аргумент ignore_cpu_history, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_gethistogramhistorical(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_gethistogramrealtime.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_gethistogramrealtime(:filter_list, :time_since_sec, :show_sql,
+ * :verbose_xml, :include_bg, :instance_number, :ignore_cpu_history, :resolution,
+ * :memory_only) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_gethistogramrealtime('demo_alias', 42,
+ * 'demo_alias', 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias');
+ * END;
+ * SELECT DBMS_ASH.dbms_ash_gethistogramrealtime('demo_value', 0, 'demo_value',
+ * 'demo_value', 'demo_value', 0, 'demo_value', 'demo_value', 'demo_value') FROM dual;
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param ignore_cpu_history Аргумент ignore_cpu_history, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_gethistogramrealtime(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getsqltext.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getsqltext(:p_dbid, :p_sql_ids) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_getsqltext(42, 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_getsqltext(0, 'demo_value') FROM dual;
+ * @param p_dbid Аргумент p_dbid, режим IN, тип number.
+ * @param p_sql_ids Аргумент p_sql_ids, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_getsqltext(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_gettimeformat.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_gettimeformat() FROM dual;
+ * DECLARE v varchar2; BEGIN v := DBMS_ASH.dbms_ash_gettimeformat(); END;
+ * @return `varchar2`.
+ */
+Datum dbms_ash_gettimeformat(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_gettimepickerhistorical.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_gettimepickerhistorical(:dbid, :begin_time_utc, :end_time_utc,
+ * :time_since_sec, :show_sql, :verbose_xml, :instance_number, :awr_info,
+ * :ignore_cpu_history, :resolution, :include_bg, :memory_only) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_gettimepickerhistorical(42, 'demo_alias',
+ * 'demo_alias', 42, 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias',
+ * 'demo_alias', 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_gettimepickerhistorical(0, 'demo_value', 'demo_value', 0,
+ * 'demo_value', 'demo_value', 0, 'demo_value', 'demo_value', 'demo_value', 'demo_value',
+ * 'demo_value') FROM dual;
+ * @param dbid Аргумент dbid, режим IN, тип number.
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param end_time_utc Аргумент end_time_utc, режим IN, тип varchar2.
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param awr_info Аргумент awr_info, режим IN, тип varchar2.
+ * @param ignore_cpu_history Аргумент ignore_cpu_history, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_gettimepickerhistorical(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_gettimepickerrealtime.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_gettimepickerrealtime(:time_since_sec, :show_sql, :verbose_xml,
+ * :instance_number, :awr_info, :ignore_cpu_history, :resolution, :include_bg,
+ * :memory_only) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_gettimepickerrealtime(42, 'demo_alias',
+ * 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias');
+ * END;
+ * SELECT DBMS_ASH.dbms_ash_gettimepickerrealtime(0, 'demo_value', 'demo_value', 0,
+ * 'demo_value', 'demo_value', 'demo_value', 'demo_value', 'demo_value') FROM dual;
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param awr_info Аргумент awr_info, режим IN, тип varchar2.
+ * @param ignore_cpu_history Аргумент ignore_cpu_history, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_gettimepickerrealtime(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_getversion.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_getversion() FROM dual;
+ * DECLARE v varchar2; BEGIN v := DBMS_ASH.dbms_ash_getversion(); END;
+ * @return `varchar2`.
+ */
+Datum dbms_ash_getversion(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_get_blocking_session_data.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_get_blocking_session_data(:data_type, :source_type,
+ * :filter_list, :begin_time_utc, :end_time_utc, :time_since_sec, :show_sql,
+ * :filter_common_user) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_get_blocking_session_data('demo_alias',
+ * 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias');
+ * END;
+ * SELECT DBMS_ASH.dbms_ash_get_blocking_session_data('demo_value', 'demo_value',
+ * 'demo_value', 'demo_value', 'demo_value', 0, 'demo_value', 'demo_value') FROM dual;
+ * @param data_type Аргумент data_type, режим IN, тип varchar2.
+ * @param source_type Аргумент source_type, режим IN, тип varchar2.
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param end_time_utc Аргумент end_time_utc, режим IN, тип varchar2.
+ * @param time_since_sec Аргумент time_since_sec, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param filter_common_user Аргумент filter_common_user, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_get_blocking_session_data(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_incrementdata.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_incrementdata(:filter_list, :begin_time_utc, :bucket_size,
+ * :show_sql, :verbose_xml, :include_bg, :instance_number, :minimize_cost, :resolution,
+ * :monitoring_mode, :memory_only, :dimensions) FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_incrementdata('demo_alias', 'demo_alias',
+ * 42, 'demo_alias', 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias',
+ * 'demo_alias', 'demo_alias', 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_incrementdata('demo_value', 'demo_value', 0, 'demo_value',
+ * 'demo_value', 'demo_value', 0, 'demo_value', 'demo_value', 'demo_value', 'demo_value',
+ * 'demo_value') FROM dual;
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param bucket_size Аргумент bucket_size, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param minimize_cost Аргумент minimize_cost, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param monitoring_mode Аргумент monitoring_mode, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @param dimensions Аргумент dimensions, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_incrementdata(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_incrementhistogram.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_incrementhistogram(:filter_list, :begin_time_utc, :bucket_size,
+ * :show_sql, :verbose_xml, :include_bg, :instance_number, :resolution, :memory_only) FROM
+ * dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_incrementhistogram('demo_alias',
+ * 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias', 42, 'demo_alias',
+ * 'demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_incrementhistogram('demo_value', 'demo_value', 0, 'demo_value',
+ * 'demo_value', 'demo_value', 0, 'demo_value', 'demo_value') FROM dual;
+ * @param filter_list Аргумент filter_list, режим IN, тип varchar2.
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param bucket_size Аргумент bucket_size, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_incrementhistogram(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_incrementtimepicker.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_incrementtimepicker(:begin_time_utc, :bucket_size, :show_sql,
+ * :verbose_xml, :instance_number, :awr_info, :resolution, :include_bg, :memory_only) FROM
+ * dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_incrementtimepicker('demo_alias', 42,
+ * 'demo_alias', 'demo_alias', 42, 'demo_alias', 'demo_alias', 'demo_alias', 'demo_alias');
+ * END;
+ * SELECT DBMS_ASH.dbms_ash_incrementtimepicker('demo_value', 0, 'demo_value',
+ * 'demo_value', 0, 'demo_value', 'demo_value', 'demo_value', 'demo_value') FROM dual;
+ * @param begin_time_utc Аргумент begin_time_utc, режим IN, тип varchar2.
+ * @param bucket_size Аргумент bucket_size, режим IN, тип number.
+ * @param show_sql Аргумент show_sql, режим IN, тип varchar2.
+ * @param verbose_xml Аргумент verbose_xml, режим IN, тип varchar2.
+ * @param instance_number Аргумент instance_number, режим IN, тип number.
+ * @param awr_info Аргумент awr_info, режим IN, тип varchar2.
+ * @param resolution Аргумент resolution, режим IN, тип varchar2.
+ * @param include_bg Аргумент include_bg, режим IN, тип varchar2.
+ * @param memory_only Аргумент memory_only, режим IN, тип varchar2.
+ * @return `text`.
+ */
+Datum dbms_ash_incrementtimepicker(PG_FUNCTION_ARGS);
+/**
+ * @brief функция dbms_ash_str_to_ascii.
+ * @details Это заглушка совместимости: SQL-объявление сохранено, но реализация пока не
+ * предоставлена.
+ * Контракт и типы берутся из inventory/spec, чтобы HPP оставался синхронизированным с
+ * SQL-поверхностью.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_str_to_ascii(:s) FROM dual;
+ * DECLARE v varchar2; BEGIN v := DBMS_ASH.dbms_ash_str_to_ascii('demo_alias'); END;
+ * SELECT DBMS_ASH.dbms_ash_str_to_ascii('demo_value') FROM dual;
+ * @param s Аргумент s, режим IN, тип varchar2.
+ * @return `varchar2`.
+ */
+Datum dbms_ash_str_to_ascii(PG_FUNCTION_ARGS);
+/**
+ * @brief Возвращает версию RUDB пакета DBMS_ASH.
+ * @details Version: 1.0.0.
+ * Это синтетическая zero-arg SQL function, которую генератор добавляет в каждый новый
+ * пакет.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_get_version() FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_get_version(); END;
+ * @return `text`.
+ */
+Datum dbms_ash_get_version(PG_FUNCTION_ARGS);
+/**
+ * @brief Generated mock stub для DBMS_ASH.MOCK.
+ * @details Это сгенерированная package mock stub для нового пакета.
+ * Функция добавляется генератором как checkpoint и должна быть реализована вручную.
+ * Примеры:
+ * SELECT DBMS_ASH.dbms_ash_mock() FROM dual;
+ * DECLARE v text; BEGIN v := DBMS_ASH.dbms_ash_mock(); END;
+ * @return `text`.
+ */
+Datum dbms_ash_mock(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_ASH_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_db_version/dbms_db_version.cpp b/src/backend/utils/dbms/dbms_db_version/dbms_db_version.cpp
new file mode 100644
index 0000000..554cf0d
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_db_version/dbms_db_version.cpp
@@ -0,0 +1,268 @@
+#include "dbms_db_version.hpp"
+
+namespace
+{
+constexpr int32 kDbmsDbVersionVersion = 23;
+constexpr int32 kDbmsDbVersionRelease = 0;
+constexpr char kDbmsDbVersionPackageVersion[] = "1.0.0";
+
+bool
+dbms_db_version_ver_le_value(const int32 version, const int32 release)
+{
+ if (kDbmsDbVersionVersion < version)
+ return true;
+ if (kDbmsDbVersionVersion > version)
+ return false;
+ return kDbmsDbVersionRelease <= release;
+}
+} // namespace
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_db_version_version);
+PG_FUNCTION_INFO_V1(dbms_db_version_release);
+PG_FUNCTION_INFO_V1(dbms_db_version_get_version);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_9_1);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_9_2);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_9);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_10_1);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_10_2);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_10);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_11_1);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_11_2);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_11);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_12_1);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_12_2);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_12);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_18);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_19);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_20);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_21);
+PG_FUNCTION_INFO_V1(dbms_db_version_ver_le_23);
+
+/*
+ * @qdb_func: dbms_db_version_version()
+ */
+Datum dbms_db_version_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsDbVersionVersion);
+}
+
+/*
+ * @qdb_func: dbms_db_version_release()
+ */
+Datum dbms_db_version_release(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsDbVersionRelease);
+}
+
+/*
+ * @qdb_func: dbms_db_version_get_version()
+ */
+Datum dbms_db_version_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(kDbmsDbVersionPackageVersion));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le(int4, int4)
+ */
+Datum dbms_db_version_ver_le(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1))
+ PG_RETURN_BOOL(false);
+
+ const int32 version = PG_GETARG_INT32(0);
+ const int32 release = PG_GETARG_INT32(1);
+
+ PG_RETURN_BOOL(dbms_db_version_ver_le_value(version, release));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_9_1()
+ */
+Datum dbms_db_version_ver_le_9_1(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(9),
+ Int32GetDatum(1))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_9_2()
+ */
+Datum dbms_db_version_ver_le_9_2(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(9),
+ Int32GetDatum(2))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_9()
+ */
+Datum dbms_db_version_ver_le_9(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(9),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_10_1()
+ */
+Datum dbms_db_version_ver_le_10_1(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(10),
+ Int32GetDatum(1))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_10_2()
+ */
+Datum dbms_db_version_ver_le_10_2(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(10),
+ Int32GetDatum(2))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_10()
+ */
+Datum dbms_db_version_ver_le_10(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(10),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_11_1()
+ */
+Datum dbms_db_version_ver_le_11_1(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(11),
+ Int32GetDatum(1))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_11_2()
+ */
+Datum dbms_db_version_ver_le_11_2(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(11),
+ Int32GetDatum(2))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_11()
+ */
+Datum dbms_db_version_ver_le_11(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(11),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_12_1()
+ */
+Datum dbms_db_version_ver_le_12_1(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(12),
+ Int32GetDatum(1))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_12_2()
+ */
+Datum dbms_db_version_ver_le_12_2(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(12),
+ Int32GetDatum(2))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_12()
+ */
+Datum dbms_db_version_ver_le_12(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(12),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_18()
+ */
+Datum dbms_db_version_ver_le_18(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(18),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_19()
+ */
+Datum dbms_db_version_ver_le_19(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(19),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_20()
+ */
+Datum dbms_db_version_ver_le_20(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(20),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_21()
+ */
+Datum dbms_db_version_ver_le_21(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(21),
+ Int32GetDatum(0))));
+}
+
+/*
+ * @qdb_func: dbms_db_version_ver_le_23()
+ */
+Datum dbms_db_version_ver_le_23(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(DatumGetBool(
+ DirectFunctionCall2(dbms_db_version_ver_le,
+ Int32GetDatum(23),
+ Int32GetDatum(0))));
+}
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_db_version/dbms_db_version.hpp b/src/backend/utils/dbms/dbms_db_version/dbms_db_version.hpp
new file mode 100644
index 0000000..c617f8a
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_db_version/dbms_db_version.hpp
@@ -0,0 +1,103 @@
+#ifndef DBMS_DB_VERSION_INTERNAL_HPP
+#define DBMS_DB_VERSION_INTERNAL_HPP
+
+/*
+ * DBMS_DB_VERSION
+ *
+ * Назначение:
+ * Пакет возвращает номер версии, release и compatibility flags RUDB через
+ * callable helpers.
+*/
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+} // extern "C"
+
+extern "C"
+{
+/// @brief Возвращает номер VERSION пакета DBMS_DB_VERSION.
+Datum dbms_db_version_version(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает номер RELEASE пакета DBMS_DB_VERSION.
+Datum dbms_db_version_release(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_DB_VERSION.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_DB_VERSION.GET_VERSION() FROM dual;
+ * SELECT dbms_db_version_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_db_version_get_version(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Проверяет, что compatibility version DBMS_DB_VERSION меньше или равна указанной версии.
+ * @details Сравнивает compatibility constants пакета `VERSION` и `RELEASE`
+ * с переданными значениями.
+ * Примеры:
+ * SELECT dbms_db_version_ver_le(23, 0);
+ * SELECT dbms_db_version_ver_le(21, 0);
+ * SELECT dbms_db_version_ver_le(23, 1);
+ * @param version Проверяемое значение VERSION.
+ * @param release Проверяемое значение RELEASE.
+ * @return `true`, если compatibility version пакета не выше указанной.
+ */
+Datum dbms_db_version_ver_le(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_9_1.
+Datum dbms_db_version_ver_le_9_1(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_9_2.
+Datum dbms_db_version_ver_le_9_2(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_9.
+Datum dbms_db_version_ver_le_9(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_10_1.
+Datum dbms_db_version_ver_le_10_1(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_10_2.
+Datum dbms_db_version_ver_le_10_2(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_10.
+Datum dbms_db_version_ver_le_10(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_11_1.
+Datum dbms_db_version_ver_le_11_1(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_11_2.
+Datum dbms_db_version_ver_le_11_2(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_11.
+Datum dbms_db_version_ver_le_11(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_12_1.
+Datum dbms_db_version_ver_le_12_1(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_12_2.
+Datum dbms_db_version_ver_le_12_2(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_12.
+Datum dbms_db_version_ver_le_12(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_18.
+Datum dbms_db_version_ver_le_18(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_19.
+Datum dbms_db_version_ver_le_19(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_20.
+Datum dbms_db_version_ver_le_20(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_21.
+Datum dbms_db_version_ver_le_21(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает флаг DBMS_DB_VERSION.VER_LE_23.
+Datum dbms_db_version_ver_le_23(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_DB_VERSION_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_ddl/dbms_ddl.cpp b/src/backend/utils/dbms/dbms_ddl/dbms_ddl.cpp
new file mode 100644
index 0000000..358c255
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_ddl/dbms_ddl.cpp
@@ -0,0 +1,599 @@
+#include "dbms_ddl.hpp"
+
+#include <algorithm>
+#include <cctype>
+#include <iomanip>
+#include <optional>
+#include <string>
+#include <sstream>
+
+#include "utils/coder.h"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "common/base64.h"
+#include "port/pg_crc32c.h"
+#include "parser/scanner.h"
+#include "parser/gram.h"
+#include "common/keywords.h"
+}
+
+enum class miniparser_state {
+ start,
+ create,
+ or_,
+ replace,
+ procedure,
+ procedure_ident,
+ args,
+ args_end,
+ language,
+ language_ident,
+ as,
+ end,
+};
+
+static std::string trim_whitespace(std::string str) {
+ auto str_begin_it = std::find_if(
+ str.begin(), str.end(),
+ [](char ch) { return !std::isspace(ch); });
+ auto str_end_it = std::find_if(
+ str.rbegin(), str.rend(),
+ [](char ch) { return !std::isspace(ch); });
+
+ std::string::size_type str_begin_pos = str_begin_it - str.begin();
+ std::string::size_type str_end_pos = str.rend() - str_end_it;
+
+ return str.substr(str_begin_pos, str_end_pos);
+}
+
+/* FIXME: we are using std::optional to convey the error.
+ * This is a poor use of std::optional. std::exceptional would
+ * be a much better fit, but it came only in C++23
+ */
+static std::optional<std::string> wrap_source(std::string source)
+{
+ char *source_encrypted_cstr = pg_kuzn_encode(source.c_str(), source.size());
+ std::string source_encrypted = source_encrypted_cstr;
+ pfree(source_encrypted_cstr);
+
+ std::string source_encoded;
+ source_encoded.resize(pg_b64_enc_len(source_encrypted.size()));
+ int enc_result = pg_b64_encode(
+ reinterpret_cast<const uint8_t*>(source_encrypted.c_str()),
+ source_encrypted.size(),
+ source_encoded.data(),
+ source_encoded.size());
+
+ if (enc_result == -1)
+ {
+ return std::nullopt;
+ }
+
+ source_encoded.resize(enc_result);
+
+ uint32_t crc;
+ INIT_CRC32C(crc);
+ COMP_CRC32C(crc, source_encoded.c_str(), source_encoded.size());
+ FIN_CRC32C(crc);
+
+ std::ostringstream oss;
+ oss << "/* WRAPPEDpgSQL =";
+ oss << source_encoded;
+ oss << std::hex << std::setfill('0') << std::setw(8) << std::uppercase << crc;
+ oss << "= */";
+
+ return oss.str();
+}
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(dbms_ddl_alter_compile);
+PG_FUNCTION_INFO_V1(dbms_ddl_alter_table_not_referenceable);
+PG_FUNCTION_INFO_V1(dbms_ddl_alter_table_referenceable);
+PG_FUNCTION_INFO_V1(dbms_ddl_analyze_object);
+PG_FUNCTION_INFO_V1(dbms_ddl_create_wrapped_ovr1);
+PG_FUNCTION_INFO_V1(dbms_ddl_create_wrapped_ovr2);
+PG_FUNCTION_INFO_V1(dbms_ddl_create_wrapped_ovr3);
+PG_FUNCTION_INFO_V1(dbms_ddl_is_trigger_fire_once);
+PG_FUNCTION_INFO_V1(dbms_ddl_is_trigger_fire_once_internal);
+PG_FUNCTION_INFO_V1(dbms_ddl_set_trigger_firing_property_ovr1);
+PG_FUNCTION_INFO_V1(dbms_ddl_set_trigger_firing_property_ovr2);
+PG_FUNCTION_INFO_V1(dbms_ddl_wrap_ovr1);
+PG_FUNCTION_INFO_V1(dbms_ddl_wrap_ovr2);
+PG_FUNCTION_INFO_V1(dbms_ddl_wrap_ovr3);
+PG_FUNCTION_INFO_V1(dbms_ddl_wrap_ovr4);
+
+/**
+ * @brief Компилирует указанный объект (процедура/функция/пакет).
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param TYPE (in) VARCHAR2: Тип объекта; должен быть одним из - PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY или TRIGGER.
+ * * @param SCHEMA (in) VARCHAR2: Имя схемы.
+ * * @param NAME (in) VARCHAR2: Имя объекта (чувствительно к регистру).
+ * * @param REUSE_SETTINGS (in) BOOLEAN: Указывает, следует ли использовать настройки сессии в объектах или использовать текущие настройки сессии.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_alter_compile(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Изменяет указанную объектную таблицу, чтобы она не была таблицей по умолчанию для ссылок в схеме.
+ * @details Эта процедура изменяет указанную объектную таблицу, чтобы она не была таблицей по умолчанию для ссылок в указанной схеме.
+ * * Parameters:
+ * * @param TABLE_NAME (in) VARCHAR2: Имя таблицы, которую необходимо изменить.
+ * * @param TABLE_SCHEMA (in) VARCHAR2: Имя схемы, владельца таблицы, которую необходимо изменить.
+ * * @param AFFECTED_SCHEMA (in) VARCHAR2: Имя схемы, на которую повлияет это изменение.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_alter_table_not_referenceable(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.alter_table_not_referenceable еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Изменяет указанную объектную таблицу, чтобы она стала таблицей для ссылок в заданной схеме.
+ * @details Эта процедура изменяет указанную объектную таблицу, чтобы она стала таблицей для ссылок в указной схеме.
+ * * Parameters:
+ * * @param TABLE_NAME (in) VARCHAR2: Имя таблицы, которую необходимо изменить.
+ * * @param TABLE_SCHEMA (in) VARCHAR2: Имя схемы, владельца таблицы, которую необходимо изменить.
+ * * @param AFFECTED_SCHEMA (in) VARCHAR2: Имя схемы, на которую повлияет это изменение.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_alter_table_referenceable(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.alter_table_referenceable еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Выполняет анализ указанного объекта в базе данных.
+ * @details Эта процедура выполняет анализ для улучшения производительности запрашиваемого объекта, помогая оптимизатору при выполнении запросов.
+ * * Parameters:
+ * * @param TYPE (in) VARCHAR2: Указывает тип объекта для анализа.
+ * * @param SCHEMA (in) VARCHAR2: Имя схемы, в которой находится объект.
+ * * @param NAME (in) VARCHAR2: Имя объекта, который нужно анализировать.
+ * * @param METHOD (in) VARCHAR2: Метод анализа, который будет использован.
+ * * @param ESTIMATE_ROWS (in) NUMBER: Оценка количества строк в объекте.
+ * * @param ESTIMATE_PERCENT (in) NUMBER: Процент для анализа.
+ * * @param METHOD_OPT (in) VARCHAR2: Указывает дополнительные настройки анализа.
+ * * @param PARTNAME (in) VARCHAR2: Имя раздела для анализа.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_analyze_object(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.analyze_object еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Создает обертку для указанного SQL DDL.
+ * @details Эта процедура создает обертку для указанного DDL, позволяя выполнять его в дальнейшем.
+ * * Parameters:
+ * * @param DDL (in) VARCHAR2: SQL DDL для создания упаковки.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_create_wrapped_ovr1(PG_FUNCTION_ARGS)
+{
+ text *ddl_txt = PG_GETARG_TEXT_P(0);
+ char *ddl = text_to_cstring(ddl_txt);
+
+ core_yy_extra_type yyextra;
+ core_YYSTYPE yylval;
+ YYLTYPE yylloc;
+ int token;
+
+ miniparser_state state = miniparser_state::start;
+
+ core_yyscan_t yyscanner = scanner_init(ddl, &yyextra,
+ &ScanKeywords, ScanKeywordTokens);
+
+
+ int header_start_loc, header_end_loc;
+ std::string body;
+ bool is_procedure = true;
+ int bracket_count = 0;
+
+
+ while ((token = core_yylex(&yylval, &yylloc, yyscanner)) != 0)
+ {
+ switch (state)
+ {
+ case miniparser_state::start:
+ if (token == CREATE)
+ {
+ state = miniparser_state::create;
+ header_start_loc = yylloc;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected CREATE")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::create:
+ if (token == OR)
+ {
+ state = miniparser_state::or_;
+ }
+ else if (token == FUNCTION || token == PROCEDURE)
+ {
+ state = miniparser_state::procedure;
+ is_procedure = (token == PROCEDURE);
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected OR, FUNCTION or PROCEDURE")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::or_:
+ if (token == REPLACE)
+ {
+ state = miniparser_state::replace;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected REPLACE")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::replace:
+ if (token == FUNCTION || token == PROCEDURE)
+ {
+ is_procedure = (token == PROCEDURE);
+ state = miniparser_state::procedure;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected FUNCTION or PROCEDURE")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::procedure:
+ if (token == IDENT)
+ {
+ state = miniparser_state::procedure_ident;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected function name")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::procedure_ident:
+ if (token == '(')
+ {
+ bracket_count = 1;
+ state = miniparser_state::args;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected opening bracket")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::args:
+ if (token == '(')
+ {
+ bracket_count++;
+ }
+ if (token == ')')
+ {
+ bracket_count--;
+ if (bracket_count == 0)
+ {
+ state = miniparser_state::args_end;
+ }
+ }
+ break;
+ case miniparser_state::args_end:
+ if (token == LANGUAGE)
+ {
+ state = miniparser_state::language;
+ }
+ break;
+ case miniparser_state::language:
+ if (token == IDENT)
+ {
+ if (strcasecmp(yylval.str, "plpgsql") == 0)
+ {
+ state = miniparser_state::language_ident;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected language name")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ }
+ break;
+ case miniparser_state::language_ident:
+ if (token == AS)
+ {
+ state = miniparser_state::as;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected AS")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ header_end_loc = yylloc + 2; /* after the end of AS */
+ break;
+ case miniparser_state::as:
+ if (token == SCONST)
+ {
+ body = yylval.str;
+ state = miniparser_state::end;
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected %s body",
+ is_procedure? "procedure" : "function")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ break;
+ case miniparser_state::end:
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Expected end of statement")));
+ scanner_finish(yyscanner);
+ PG_RETURN_VOID();
+ }
+ }
+
+ scanner_finish(yyscanner);
+
+ if (state != miniparser_state::end)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Unexpected end of statement")));
+ PG_RETURN_VOID();
+ }
+
+ std::string_view header(ddl + header_start_loc, header_end_loc - header_start_loc);
+
+ auto wrapped_body_opt = wrap_source(body);
+ if (!wrapped_body_opt.has_value())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Failed to wrap function body")));
+ }
+ std::string wrapped_body = wrapped_body_opt.value();
+
+ std::ostringstream result_ddl;
+ result_ddl << header << " $$\n";
+ result_ddl << wrapped_body << "\n";
+ if (is_procedure)
+ {
+ result_ddl << "BEGIN\n NULL;\nEND;\n$$;";
+ }
+ else
+ {
+ result_ddl << "BEGIN\n RETURN NULL;\nEND;\n$$;";
+ }
+
+ ereport(DEBUG1, errmsg_internal("Result DDL: %s", result_ddl.str().c_str()));
+
+ SPI_connect();
+
+ int ret = SPI_execute(result_ddl.str().c_str(), false, 0);
+
+ if (ret < 0)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to execute DDL: %d", ret)));
+ }
+
+ SPI_finish();
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Создает обертку на основе строки DDL и границ.
+ * @details Эта процедура создает обертку на основе указанных DDL и границ для дальнейшей обработки.
+ * * Parameters:
+ * * @param DDL (in) PL/SQL TABLE: Строка DDL для создания упаковки.
+ * * @param LB (in) BINARY_INTEGER: Нижняя граница для обработки DDL.
+ * * @param UB (in) BINARY_INTEGER: Верхняя граница для обработки DDL.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_create_wrapped_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.create_wrapped еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Создает обертку на основе строки DDL и границ.
+ * @details Эта процедура создает обертку на основе указанных DDL и границ для дальнейшей обработки.
+ * * Parameters:
+ * * @param DDL (in) PL/SQL TABLE: Строка DDL для создания упаковки.
+ * * @param LB (in) BINARY_INTEGER: Нижняя граница для обработки DDL.
+ * * @param UB (in) BINARY_INTEGER: Верхняя граница для обработки DDL.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_create_wrapped_ovr3(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.create_wrapped еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Возвращает TRUE, если указанный DML или DDL триггер настроен на выполнение один раз.
+ * @details Эта функция возвращает TRUE, если указанный DML или DDL триггер настроен на выполнение только один раз. В противном случае возвращает FALSE. Триггер, который выполняется один раз, срабатывает в пользовательской сессии, но не применяется в следующих случаях:
+ * * Parameters:
+ * * @param TRIG_OWNER (in) VARCHAR2: Имя схемы триггера.
+ * * @param TRIG_NAME (in) VARCHAR2: Имя триггера.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_is_trigger_fire_once(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.is_trigger_fire_once еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Возвращает TRUE, если указанный триггер настроен на выполнение единожды.
+ * @details Эта функция проверяет, активен ли триггер, и возвращает TRUE, если он срабатывает только один раз; иначе возвращает FALSE.
+ * * Parameters:
+ * * @param TRIG_OWNER (in) VARCHAR2: Схема, в которой расположен триггер.
+ * * @param TRIG_NAME (in) VARCHAR2: Имя триггера для проверки.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_is_trigger_fire_once_internal(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.is_trigger_fire_once_internal еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Устанавливает свойства активации для указанного триггера.
+ * @details Эта процедура позволяет задавать свойства активации для триггера, устанавливая флаг на выполнение единожды.
+ * * Parameters:
+ * * @param TRIG_OWNER (in) VARCHAR2: Схема, в которой расположен триггер.
+ * * @param TRIG_NAME (in) VARCHAR2: Имя триггера для изменения.
+ * * @param FIRE_ONCE (in) BOOLEAN: Указывает, должен ли триггер срабатывать только один раз.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_set_trigger_firing_property_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.set_trigger_firing_property еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Устанавливает свойства активации для указанного триггера.
+ * @details Эта процедура позволяет задавать свойства активации для триггера, устанавливая флаг на выполнение единожды.
+ * * Parameters:
+ * * @param TRIG_OWNER (in) VARCHAR2: Схема, в которой расположен триггер.
+ * * @param TRIG_NAME (in) VARCHAR2: Имя триггера для изменения.
+ * * @param PROPERTY (in) BINARY_INTEGER: TODO: Описание параметра PROPERTY
+ * * @param SETTING (in) BOOLEAN: TODO: Описание параметра SETTING
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_set_trigger_firing_property_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_ddl.set_trigger_firing_property еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Создает обертку для указанного SQL DDL.
+ * @details Эта функция создает обертку для указанного DDL, позволяя его дальнейшее использование и выполнение.
+ * * Parameters:
+ * * @param DDL (in) VARCHAR2: SQL DDL, который необходимо завернуть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_wrap_ovr1(PG_FUNCTION_ARGS)
+{
+ text *source_txt_packed = PG_GETARG_TEXT_P(0);
+ text *source_txt = pg_detoast_datum_packed(source_txt_packed);
+ std::string source;
+ source.resize(VARSIZE_ANY_EXHDR(source_txt));
+ memcpy(source.data(), VARDATA_ANY(source_txt), source.size());
+
+ source = trim_whitespace(source);
+
+ auto source_wrapped = wrap_source(source);
+
+ if (source_wrapped.has_value())
+ {
+ text *result = cstring_to_text(source_wrapped.value().c_str());
+ PG_RETURN_TEXT_P(result);
+ }
+ else
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to encode source")));
+ PG_RETURN_VOID();
+ }
+}
+
+/**
+ * @brief Создает обертку на основе планов DDL и заданных границ.
+ * @details Эта функция создает обертку на основе указанных данных DDL и значений границ для дальнейшей обработки.
+ * * Parameters:
+ * * @param DDL (in) PL/SQL TABLE: Строка DDL для создания упаковки.
+ * * @param LB (in) BINARY_INTEGER: Нижняя граница для обработки DDL.
+ * * @param UB (in) BINARY_INTEGER: Верхняя граница для обработки DDL.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_wrap_ovr2(PG_FUNCTION_ARGS)
+{
+ Datum ddl = PG_GETARG_DATUM(0);
+ PG_RETURN_DATUM(ddl);
+}
+
+/**
+ * @brief Создает обертку на основе планов DDL и заданных границ.
+ * @details Эта функция создает обертку на основе указанных данных DDL и значений границ для дальнейшей обработки.
+ * * Parameters:
+ * * @param DDL (in) PL/SQL TABLE: Строка DDL для создания упаковки.
+ * * @param LB (in) BINARY_INTEGER: Нижняя граница для обработки DDL.
+ * * @param UB (in) BINARY_INTEGER: Верхняя граница для обработки DDL.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_DDL.html
+ */
+Datum dbms_ddl_wrap_ovr3(PG_FUNCTION_ARGS)
+{
+ Datum ddl = PG_GETARG_DATUM(0);
+ PG_RETURN_DATUM(ddl);
+}
+
+Datum dbms_ddl_wrap_ovr4(PG_FUNCTION_ARGS)
+{
+ bytea *ddl_raw = PG_GETARG_BYTEA_P(0);
+
+ text *ddl = reinterpret_cast<text*>(ddl_raw);
+
+ return DirectFunctionCall1(dbms_ddl_wrap_ovr1, PointerGetDatum(ddl));
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_ddl/dbms_ddl.hpp b/src/backend/utils/dbms/dbms_ddl/dbms_ddl.hpp
new file mode 100644
index 0000000..1fd2151
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_ddl/dbms_ddl.hpp
@@ -0,0 +1,37 @@
+#ifndef DBMS_DDL_INTERNAL_HPP
+#define DBMS_DDL_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+} // extern "C"
+
+extern "C"
+{
+Datum dbms_ddl_alter_compile(PG_FUNCTION_ARGS);
+Datum dbms_ddl_alter_table_not_referenceable(PG_FUNCTION_ARGS);
+Datum dbms_ddl_alter_table_referenceable(PG_FUNCTION_ARGS);
+Datum dbms_ddl_analyze_object(PG_FUNCTION_ARGS);
+Datum dbms_ddl_create_wrapped_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_ddl_create_wrapped_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_ddl_create_wrapped_ovr3(PG_FUNCTION_ARGS);
+Datum dbms_ddl_is_trigger_fire_once(PG_FUNCTION_ARGS);
+Datum dbms_ddl_is_trigger_fire_once_internal(PG_FUNCTION_ARGS);
+Datum dbms_ddl_set_trigger_firing_property_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_ddl_set_trigger_firing_property_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_ddl_wrap_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_ddl_wrap_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_ddl_wrap_ovr3(PG_FUNCTION_ARGS);
+Datum dbms_ddl_wrap_ovr4(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_DDL_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.cpp b/src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.cpp
new file mode 100644
index 0000000..e8df605
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.cpp
@@ -0,0 +1,544 @@
+#include "dbms_file_transfer.hpp"
+
+#include <cstring>
+#include <string>
+#include <vector>
+
+extern "C" {
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "executor/spi.h"
+#include "miscadmin.h"
+#include "storage/fd.h"
+#include "utils/builtins.h"
+#include "utils/bytea.h"
+
+PG_FUNCTION_INFO_V1(dbms_file_transfer_copy_file);
+PG_FUNCTION_INFO_V1(dbms_file_transfer_is_safe_filename);
+PG_FUNCTION_INFO_V1(dbms_file_transfer_get_file);
+PG_FUNCTION_INFO_V1(dbms_file_transfer_put_file);
+PG_FUNCTION_INFO_V1(read_file_chunk);
+PG_FUNCTION_INFO_V1(write_file_chunk);
+PG_FUNCTION_INFO_V1(pg_file_unlink_custom);
+PG_FUNCTION_INFO_V1(dbms_file_transfer_get_version);
+
+/// @brief Версия RUDB пакета DBMS_FILE_TRANSFER (Oracle DBMS_FILE_TRANSFER пакет)
+#define RUDB_DBMS_FILE_TRANSFER_VERSION "1.0.0"
+}
+
+namespace {
+
+constexpr std::size_t kCopyBufferSize = 64 * 1024;
+constexpr int32 kRemoteReadChunkSize = 128 * 1024;
+constexpr std::size_t kRemoteWriteChunkSize = 8 * 1024;
+
+bool
+isSafeFilename(const char* const filename)
+{
+ if (filename == nullptr || filename[0] == '\0') {
+ return false;
+ }
+
+ if (filename[0] == '/' || filename[0] == '\\') {
+ return false;
+ }
+
+ if (std::strcmp(filename, ".") == 0 || std::strcmp(filename, "..") == 0) {
+ return false;
+ }
+
+ for (const char* ptr = filename; *ptr != '\0'; ++ptr) {
+ if (*ptr == '/' || *ptr == '\\') {
+ return false;
+ }
+ }
+
+ return std::strstr(filename, "..") == nullptr;
+}
+
+std::string
+joinPath(const char* const dir, const char* const file)
+{
+ return std::string(dir) + "/" + file;
+}
+
+void
+closeTransientFileIfOpened(int& fd)
+{
+ if (fd >= 0) {
+ CloseTransientFile(fd);
+ fd = -1;
+ }
+}
+
+} // namespace
+
+/*
+ * @qdb_func: dbms_file_transfer_copy_file(text, text, text, text)
+ * @ora_func: DBMS_FILE_TRANSFER.COPY_FILE(VARCHAR2, VARCHAR2, VARCHAR2, VARCHAR2)
+ */
+extern "C" Datum
+dbms_file_transfer_copy_file(PG_FUNCTION_ARGS)
+{
+ const char* const srcDir = TextDatumGetCString(PG_GETARG_DATUM(0));
+ const char* const srcFile = TextDatumGetCString(PG_GETARG_DATUM(1));
+ const char* const dstDir = TextDatumGetCString(PG_GETARG_DATUM(2));
+ const char* const dstFile = TextDatumGetCString(PG_GETARG_DATUM(3));
+
+ const bool srcSafe = DatumGetBool(
+ DirectFunctionCall1(dbms_file_transfer_is_safe_filename,
+ CStringGetTextDatum(srcFile)));
+ const bool dstSafe = DatumGetBool(
+ DirectFunctionCall1(dbms_file_transfer_is_safe_filename,
+ CStringGetTextDatum(dstFile)));
+
+ if (!srcSafe || !dstSafe) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_FILE_TRANSFER: unsafe file name")));
+ }
+
+ const std::string fullSrc = joinPath(srcDir, srcFile);
+ const std::string fullDst = joinPath(dstDir, dstFile);
+
+ int srcFd = -1;
+ int dstFd = -1;
+ std::vector<char> buffer(kCopyBufferSize);
+ bool success = false;
+
+ PG_TRY();
+ {
+ srcFd = OpenTransientFile(fullSrc.c_str(), O_RDONLY | PG_BINARY);
+ if (srcFd < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not open source file \"%s\": %m", fullSrc.c_str())));
+ }
+
+ dstFd = OpenTransientFile(fullDst.c_str(), O_WRONLY | O_CREAT | O_TRUNC | PG_BINARY);
+ if (dstFd < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not create destination file \"%s\": %m", fullDst.c_str())));
+ }
+
+ ssize_t nread = 0;
+ while ((nread = read(srcFd, buffer.data(), buffer.size())) > 0) {
+ CHECK_FOR_INTERRUPTS();
+
+ if (write(dstFd, buffer.data(), nread) != nread) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not write to file \"%s\": %m", fullDst.c_str())));
+ }
+ }
+
+ if (nread < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read from file \"%s\": %m", fullSrc.c_str())));
+ }
+
+ if (pg_fsync(dstFd) != 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not fsync file \"%s\": %m", fullDst.c_str())));
+ }
+
+ closeTransientFileIfOpened(srcFd);
+ closeTransientFileIfOpened(dstFd);
+ success = true;
+ }
+ PG_CATCH();
+ {
+ closeTransientFileIfOpened(srcFd);
+ closeTransientFileIfOpened(dstFd);
+
+ if (!success) {
+ unlink(fullDst.c_str());
+ }
+
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+
+ PG_RETURN_VOID();
+}
+
+/*
+ * @qdb_func: dbms_file_transfer_is_safe_filename(text)
+ */
+extern "C" Datum
+dbms_file_transfer_is_safe_filename(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0)) {
+ PG_RETURN_BOOL(false);
+ }
+
+ const char* const filename = TextDatumGetCString(PG_GETARG_DATUM(0));
+ PG_RETURN_BOOL(isSafeFilename(filename));
+}
+
+/*
+ * @qdb_func: dbms_file_transfer_get_file(text, text, text, text, text)
+ * @ora_func: DBMS_FILE_TRANSFER.GET_FILE(VARCHAR2, VARCHAR2, VARCHAR2, VARCHAR2, VARCHAR2)
+ */
+extern "C" Datum
+dbms_file_transfer_get_file(PG_FUNCTION_ARGS)
+{
+ const char* const srcDir = TextDatumGetCString(PG_GETARG_DATUM(0));
+ const char* const srcFile = TextDatumGetCString(PG_GETARG_DATUM(1));
+ const char* const connName = TextDatumGetCString(PG_GETARG_DATUM(2));
+ const char* const dstDir = TextDatumGetCString(PG_GETARG_DATUM(3));
+ const char* const dstFile = TextDatumGetCString(PG_GETARG_DATUM(4));
+
+ const bool srcSafe = DatumGetBool(
+ DirectFunctionCall1(dbms_file_transfer_is_safe_filename,
+ CStringGetTextDatum(srcFile)));
+ const bool dstSafe = DatumGetBool(
+ DirectFunctionCall1(dbms_file_transfer_is_safe_filename,
+ CStringGetTextDatum(dstFile)));
+
+ if (!srcSafe || !dstSafe) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_FILE_TRANSFER: unsafe file name")));
+ }
+
+ const std::string fullDst = joinPath(dstDir, dstFile);
+ int dstFd = -1;
+ bool success = false;
+
+ if (SPI_connect() != SPI_OK_CONNECT) {
+ ereport(ERROR, (errmsg("could not connect to SPI")));
+ }
+
+ PG_TRY();
+ {
+ dstFd = OpenTransientFile(fullDst.c_str(), O_WRONLY | O_CREAT | O_TRUNC | PG_BINARY);
+ if (dstFd < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not open destination file \"%s\": %m", fullDst.c_str())));
+ }
+
+ int64 offset = 0;
+ bool eof = false;
+
+ while (!eof) {
+ CHECK_FOR_INTERRUPTS();
+
+ char* const sqlReadChunk = psprintf("SELECT read_file_chunk(%s, %s, %lld, %d)",
+ quote_literal_cstr(srcDir),
+ quote_literal_cstr(srcFile),
+ static_cast<long long>(offset),
+ kRemoteReadChunkSize);
+
+ char* const sql = psprintf(
+ "SELECT result FROM dblink(%s, %s) AS t(result bytea)",
+ quote_literal_cstr(connName),
+ quote_literal_cstr(sqlReadChunk));
+
+ const int res = SPI_execute(sql, true, 1);
+ pfree(sql);
+ pfree(sqlReadChunk);
+
+ if (res != SPI_OK_SELECT || SPI_processed == 0) {
+ ereport(ERROR, (errmsg("dblink call failed or returned no data")));
+ }
+
+ bool isNull = false;
+ const Datum binData = SPI_getbinval(SPI_tuptable->vals[0],
+ SPI_tuptable->tupdesc,
+ 1,
+ &isNull);
+
+ if (isNull) {
+ eof = true;
+ } else {
+ const bytea* const chunk = DatumGetByteaP(binData);
+ const int len = VARSIZE(chunk) - VARHDRSZ;
+
+ if (len == 0) {
+ eof = true;
+ } else {
+ if (write(dstFd, VARDATA(chunk), len) != len) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("write to destination failed: %m")));
+ }
+
+ offset += len;
+ }
+ }
+
+ SPI_freetuptable(SPI_tuptable);
+ }
+
+ if (pg_fsync(dstFd) != 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not fsync file \"%s\": %m", fullDst.c_str())));
+ }
+
+ closeTransientFileIfOpened(dstFd);
+ success = true;
+ }
+ PG_CATCH();
+ {
+ closeTransientFileIfOpened(dstFd);
+
+ if (!success) {
+ unlink(fullDst.c_str());
+ }
+
+ SPI_finish();
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+
+ SPI_finish();
+ PG_RETURN_VOID();
+}
+
+/*
+ * @qdb_func: dbms_file_transfer_put_file(text, text, text, text, text)
+ * @ora_func: DBMS_FILE_TRANSFER.PUT_FILE(VARCHAR2, VARCHAR2, VARCHAR2, VARCHAR2, VARCHAR2)
+ */
+extern "C" Datum
+dbms_file_transfer_put_file(PG_FUNCTION_ARGS)
+{
+ const char* const srcDir = TextDatumGetCString(PG_GETARG_DATUM(0));
+ const char* const srcFile = TextDatumGetCString(PG_GETARG_DATUM(1));
+ const char* const connName = TextDatumGetCString(PG_GETARG_DATUM(2));
+ const char* const dstDir = TextDatumGetCString(PG_GETARG_DATUM(3));
+ const char* const dstFile = TextDatumGetCString(PG_GETARG_DATUM(4));
+
+ const bool srcSafe = DatumGetBool(
+ DirectFunctionCall1(dbms_file_transfer_is_safe_filename,
+ CStringGetTextDatum(srcFile)));
+ const bool dstSafe = DatumGetBool(
+ DirectFunctionCall1(dbms_file_transfer_is_safe_filename,
+ CStringGetTextDatum(dstFile)));
+
+ if (!srcSafe || !dstSafe) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_FILE_TRANSFER: unsafe file name")));
+ }
+
+ const std::string fullSrc = joinPath(srcDir, srcFile);
+ int srcFd = OpenTransientFile(fullSrc.c_str(), O_RDONLY | PG_BINARY);
+ bool success = false;
+
+ if (srcFd < 0) {
+ ereport(ERROR, (errmsg("could not open source file \"%s\": %m", fullSrc.c_str())));
+ }
+
+ if (SPI_connect() != SPI_OK_CONNECT) {
+ closeTransientFileIfOpened(srcFd);
+ ereport(ERROR, (errmsg("SPI connect failed")));
+ }
+
+ char buffer[kRemoteWriteChunkSize];
+ int64 offset = 0;
+
+ PG_TRY();
+ {
+ ssize_t nread = 0;
+
+ while ((nread = read(srcFd, buffer, sizeof(buffer))) > 0) {
+ CHECK_FOR_INTERRUPTS();
+
+ const int hexLen = static_cast<int>(nread) * 2;
+ char* const hexData = static_cast<char*>(palloc(hexLen + 1));
+ hex_encode(buffer, nread, hexData);
+ hexData[hexLen] = '\0';
+
+ char* const remoteSql = psprintf(
+ "DO $$ BEGIN PERFORM write_file_chunk(%s, %s, decode('%s', 'hex'), %lld); END $$",
+ quote_literal_cstr(dstDir),
+ quote_literal_cstr(dstFile),
+ hexData,
+ static_cast<long long>(offset));
+
+ char* const dblinkSql = psprintf("SELECT dblink_exec(%s, %s)",
+ quote_literal_cstr(connName),
+ quote_literal_cstr(remoteSql));
+
+ if (SPI_execute(dblinkSql, false, 0) != SPI_OK_SELECT) {
+ pfree(dblinkSql);
+ pfree(remoteSql);
+ pfree(hexData);
+ ereport(ERROR, (errmsg("remote write failed via dblink")));
+ }
+
+ offset += nread;
+
+ pfree(dblinkSql);
+ pfree(remoteSql);
+ pfree(hexData);
+ }
+
+ if (nread < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read from file \"%s\": %m", fullSrc.c_str())));
+ }
+
+ closeTransientFileIfOpened(srcFd);
+ success = true;
+ }
+ PG_CATCH();
+ {
+ closeTransientFileIfOpened(srcFd);
+
+ if (!success) {
+ char* const rmSql = psprintf(
+ "DO $$ BEGIN PERFORM pg_file_unlink_custom(%s || '/' || %s); EXCEPTION WHEN OTHERS THEN NULL; END $$",
+ quote_literal_cstr(dstDir),
+ quote_literal_cstr(dstFile));
+
+ char* const dblinkRm = psprintf("SELECT dblink_exec(%s, %s)",
+ quote_literal_cstr(connName),
+ quote_literal_cstr(rmSql));
+
+ SPI_execute(dblinkRm, false, 0);
+ pfree(dblinkRm);
+ pfree(rmSql);
+ }
+
+ SPI_finish();
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+
+ SPI_finish();
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+read_file_chunk(PG_FUNCTION_ARGS)
+{
+ const char* const dir = TextDatumGetCString(PG_GETARG_DATUM(0));
+ const char* const filename = TextDatumGetCString(PG_GETARG_DATUM(1));
+ const int64 offset = PG_GETARG_INT64(2);
+ const int32 limit = PG_GETARG_INT32(3);
+
+ if (limit <= 0) {
+ PG_RETURN_NULL();
+ }
+
+ const std::string fullPath = joinPath(dir, filename);
+ bytea* result = nullptr;
+ int fd = -1;
+
+ PG_TRY();
+ {
+ fd = OpenTransientFile(fullPath.c_str(), O_RDONLY | PG_BINARY);
+ if (fd < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not open file \"%s\": %m", fullPath.c_str())));
+ }
+
+ if (lseek(fd, offset, SEEK_SET) < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not seek to offset %lld in file \"%s\": %m",
+ static_cast<long long>(offset),
+ fullPath.c_str())));
+ }
+
+ result = static_cast<bytea*>(palloc(limit + VARHDRSZ));
+
+ const ssize_t nread = read(fd, VARDATA(result), limit);
+ if (nread < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read file \"%s\": %m", fullPath.c_str())));
+ }
+
+ SET_VARSIZE(result, static_cast<int>(nread) + VARHDRSZ);
+ closeTransientFileIfOpened(fd);
+ }
+ PG_CATCH();
+ {
+ closeTransientFileIfOpened(fd);
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+
+ PG_RETURN_BYTEA_P(result);
+}
+
+extern "C" Datum
+write_file_chunk(PG_FUNCTION_ARGS)
+{
+ const char* const dir = TextDatumGetCString(PG_GETARG_DATUM(0));
+ const char* const filename = TextDatumGetCString(PG_GETARG_DATUM(1));
+ const bytea* const data = PG_GETARG_BYTEA_PP(2);
+ const int64 offset = PG_GETARG_INT64(3);
+
+ const std::string fullPath = joinPath(dir, filename);
+ const int len = VARSIZE_ANY_EXHDR(data);
+ const char* const dataPtr = VARDATA_ANY(data);
+ int fd = -1;
+
+ PG_TRY();
+ {
+ int flags = O_WRONLY | PG_BINARY;
+ if (offset == 0) {
+ flags |= O_CREAT | O_TRUNC;
+ }
+
+ fd = OpenTransientFile(fullPath.c_str(), flags);
+ if (fd < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not open file \"%s\": %m", fullPath.c_str())));
+ }
+
+ if (lseek(fd, offset, SEEK_SET) < 0) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("seek failed in \"%s\": %m", fullPath.c_str())));
+ }
+
+ if (write(fd, dataPtr, len) != len) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("write failed in \"%s\": %m", fullPath.c_str())));
+ }
+
+ closeTransientFileIfOpened(fd);
+ }
+ PG_CATCH();
+ {
+ closeTransientFileIfOpened(fd);
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+pg_file_unlink_custom(PG_FUNCTION_ARGS)
+{
+ const char* const filename = TextDatumGetCString(PG_GETARG_DATUM(0));
+
+ if (unlink(filename) < 0 && errno != ENOENT) {
+ ereport(WARNING, (errmsg("could not remove file \"%s\": %m", filename)));
+ }
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_file_transfer_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_FILE_TRANSFER_VERSION));
+}
diff --git a/src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.hpp b/src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.hpp
new file mode 100644
index 0000000..6f75698
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_file_transfer/dbms_file_transfer.hpp
@@ -0,0 +1,130 @@
+#ifndef DBMS_FILE_TRANSFER_HPP
+#define DBMS_FILE_TRANSFER_HPP
+
+extern "C" {
+#include "postgres.h"
+#include "fmgr.h"
+}
+
+/*
+ * DBMS_FILE_TRANSFER
+ *
+ * Назначение:
+ * Пакет предоставляет совместимые с Oracle функции копирования файлов
+ * между локальными каталогами и удалёнными серверами через dblink, а
+ * также вспомогательные функции для чтения и записи файлов по частям.
+ */
+
+extern "C" {
+/**
+ * @brief Копирует файл из одной локальной директории в другую.
+ * @details Automatic Storage Management (ASM) не поддерживается.
+ * Примеры:
+ * SELECT DBMS_FILE_TRANSFER.COPY_FILE('/tmp/src', 'a.bin', '/tmp/dst', 'b.bin') FROM dual;
+ * SELECT DBMS_FILE_TRANSFER.COPY_FILE('/var/lib/rudb/in', 'one.dat', '/var/lib/rudb/out', 'two.dat') FROM dual;
+ * @param source_directory Объект DIRECTORY или путь к исходной директории.
+ * @param source_file_name Имя исходного файла.
+ * @param destination_directory Объект DIRECTORY или путь к целевой директории.
+ * @param destination_file_name Имя целевого файла.
+ * @return `void`.
+ */
+Datum dbms_file_transfer_copy_file(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Проверяет, что имя файла допустимо для операций передачи файлов.
+ * @details Допускаются только непустые относительные имена без разделителей
+ * путей и переходов к родительскому каталогу.
+ * Примеры:
+ * SELECT dbms_file_transfer_is_safe_filename('sample.txt');
+ * SELECT dbms_file_transfer_is_safe_filename('../sample.txt');
+ * SELECT dbms_file_transfer_is_safe_filename('/tmp/sample.txt');
+ * @param filename Имя файла без пути.
+ * @return `true`, если имя файла безопасно для передачи.
+ */
+Datum dbms_file_transfer_is_safe_filename(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Копирует файл с удалённой базы данных в локальную файловую систему.
+ * @details Для удалённой стороны используется уже открытое соединение `dblink`.
+ * Automatic Storage Management (ASM) не поддерживается.
+ * Примеры:
+ * SELECT dblink_connect('my_remote_db', 'host=127.0.0.1 port=5444 user=SYSDBA dbname=qdb');
+ * SELECT DBMS_FILE_TRANSFER.GET_FILE('/tmp/remote_dir', 'source.dat', 'my_remote_db', '/tmp/local_dir', 'copied.dat') FROM dual;
+ * SELECT dblink_disconnect('my_remote_db');
+ * @param source_directory Путь к директории на удалённой стороне.
+ * @param source_file_name Имя исходного файла на удалённой стороне.
+ * @param source_database Имя открытого соединения `dblink`.
+ * @param destination_directory Путь к локальной директории назначения.
+ * @param destination_file_name Имя локального файла назначения.
+ * @return `void`.
+ */
+Datum dbms_file_transfer_get_file(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Копирует файл с локальной файловой системы в удалённую базу данных.
+ * @details Для удалённой стороны используется уже открытое соединение `dblink`.
+ * Automatic Storage Management (ASM) не поддерживается.
+ * Примеры:
+ * SELECT dblink_connect('my_link', 'host=127.0.0.1 port=5444 user=SYSDBA dbname=qdb');
+ * SELECT DBMS_FILE_TRANSFER.PUT_FILE('/tmp/put_src', 'original.dat', 'my_link', '/tmp/put_dst', 'delivered.dat') FROM dual;
+ * SELECT dblink_disconnect('my_link');
+ * @param source_directory Путь к локальной исходной директории.
+ * @param source_file_name Имя локального исходного файла.
+ * @param destination_database Имя открытого соединения `dblink`.
+ * @param destination_directory Путь к директории на удалённой стороне.
+ * @param destination_file_name Имя файла назначения на удалённой стороне.
+ * @return `void`.
+ */
+Datum dbms_file_transfer_put_file(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Считывает часть файла по смещению и размеру.
+ * @details Вспомогательная функция для `DBMS_FILE_TRANSFER.GET_FILE`.
+ * Примеры:
+ * SELECT encode(read_file_chunk('/tmp/src', 'a.bin', 0, 16), 'hex');
+ * SELECT read_file_chunk('/tmp/src', 'a.bin', 0, 0) IS NULL;
+ * @param directory Путь к директории с файлом.
+ * @param file_name Имя файла.
+ * @param offset Смещение от начала файла в байтах.
+ * @param limit Максимальное число считываемых байт.
+ * @return `bytea`.
+ */
+Datum read_file_chunk(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Записывает часть данных в файл по указанному смещению.
+ * @details Вспомогательная функция для `DBMS_FILE_TRANSFER.PUT_FILE`.
+ * Примеры:
+ * SELECT write_file_chunk('/tmp/dst', 'a.bin', decode('0102', 'hex'), 0);
+ * SELECT write_file_chunk('/tmp/dst', 'a.bin', decode('0304', 'hex'), 2);
+ * @param directory Путь к директории с файлом.
+ * @param file_name Имя файла.
+ * @param data Блок данных для записи.
+ * @param offset Смещение от начала файла в байтах.
+ * @return `void`.
+ */
+Datum write_file_chunk(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Удаляет файл из файловой системы.
+ * @details Вспомогательная функция для очистки частично переданного файла.
+ * Примеры:
+ * SELECT pg_file_unlink_custom('/tmp/dst/a.bin');
+ * SELECT pg_file_unlink_custom('/tmp/dst/missing.bin');
+ * @param full_path Полный путь к удаляемому файлу.
+ * @return `void`.
+ */
+Datum pg_file_unlink_custom(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_FILE_TRANSFER.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_FILE_TRANSFER.GET_VERSION() FROM dual;
+ * SELECT dbms_file_transfer_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_file_transfer_get_version(PG_FUNCTION_ARGS);
+}
+
+#endif // DBMS_FILE_TRANSFER_HPP
diff --git a/src/backend/utils/dbms/dbms_json/dbms_json.cpp b/src/backend/utils/dbms/dbms_json/dbms_json.cpp
new file mode 100644
index 0000000..b27fb05
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json/dbms_json.cpp
@@ -0,0 +1,2132 @@
+#include "dbms_json.hpp"
+
+extern "C"
+{
+#include "access/htup_details.h"
+#include "catalog/namespace.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "nodes/makefuncs.h"
+#include "nodes/pg_list.h"
+#include "port.h"
+#include "parser/scansup.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/jsonb.h"
+#include "utils/lsyscache.h"
+#include "utils/numeric.h"
+#include "utils/regproc.h"
+#include "utils/varlena.h"
+}
+
+#include <cctype>
+#include <cstring>
+#include <set>
+#include <string>
+#include <vector>
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_json_build_dataguide);
+PG_FUNCTION_INFO_V1(dbms_json_get_index_dataguide);
+PG_FUNCTION_INFO_V1(dbms_json_get_view_sql);
+PG_FUNCTION_INFO_V1(dbms_json_add_virtual_columns);
+PG_FUNCTION_INFO_V1(dbms_json_create_view);
+PG_FUNCTION_INFO_V1(dbms_json_create_view2);
+PG_FUNCTION_INFO_V1(dbms_json_drop_virtual_columns);
+PG_FUNCTION_INFO_V1(dbms_json_json_type_convertible_check);
+PG_FUNCTION_INFO_V1(dbms_json_rename_column);
+PG_FUNCTION_INFO_V1(dbms_json_create_view_on_path);
+}
+
+#define DBMS_JSON_MV_REFRESH_ON_STATEMENT 1
+#define DBMS_JSON_TYPE_NULL 1
+#define DBMS_JSON_TYPE_STRING 2
+#define DBMS_JSON_TYPE_NUMBER 3
+#define DBMS_JSON_TYPE_BOOLEAN 4
+#define DBMS_JSON_TYPE_OBJECT 5
+#define DBMS_JSON_TYPE_ARRAY 6
+
+namespace DbmsJson
+{
+struct ColumnSpec
+{
+ std::string jsonFieldName_;
+ std::string columnName_;
+ std::string columnType_;
+};
+
+struct GuideEntry
+{
+ std::string path_;
+ std::string jsonType_;
+ std::string columnName_;
+ std::string columnType_;
+};
+
+static JsonbValue *
+getobjectfield(JsonbContainer *container, const char *field_name, JsonbValue *value_buffer)
+{
+ if (container == nullptr || !JsonContainerIsObject(container)) {
+ return nullptr;
+ }
+
+ return getKeyJsonValueFromContainer(container,
+ field_name,
+ strlen(field_name),
+ value_buffer);
+}
+
+static std::string
+jsonbvaluetostring(const JsonbValue *json_value)
+{
+ char *valueCString = nullptr;
+ std::string resultValue;
+
+ if (json_value == nullptr) {
+ return resultValue;
+ }
+
+ switch (json_value->type) {
+ case jbvString:
+ return std::string(json_value->val.string.val, json_value->val.string.len);
+ case jbvBinary:
+ valueCString = JsonbToCString(nullptr,
+ json_value->val.binary.data,
+ json_value->val.binary.len);
+ resultValue = valueCString == nullptr ? "" : std::string(valueCString);
+ if (valueCString != nullptr) {
+ pfree(valueCString);
+ }
+ return resultValue;
+ default:
+ break;
+ }
+
+ return resultValue;
+}
+
+static int32
+jsonbvaluetoint32(const JsonbValue *json_value, int32 default_value)
+{
+ if (json_value == nullptr) {
+ return default_value;
+ }
+
+ if (json_value->type != jbvNumeric) {
+ return default_value;
+ }
+
+ return numeric_int4_opt_error(json_value->val.numeric, nullptr);
+}
+
+static std::string
+normalizesqlidentifier(const std::string &identifier_value, bool mixed_case_columns)
+{
+ std::string normalizedValue = identifier_value;
+
+ if (mixed_case_columns) {
+ return normalizedValue;
+ }
+
+ for (char ¤tChar : normalizedValue) {
+ currentChar = static_cast<char>(pg_tolower(static_cast<unsigned char>(currentChar)));
+ }
+
+ return normalizedValue;
+}
+
+static std::string
+normalizepath(const std::string &path_value)
+{
+ if (path_value.empty() || path_value == "$") {
+ return "$[*]";
+ }
+
+ if (path_value.size() >= 3 &&
+ path_value.compare(path_value.size() - 3, 3, "[*]") == 0) {
+ return path_value;
+ }
+
+ return path_value + "[*]";
+}
+
+static std::string
+trimrootpath(const std::string &path_value)
+{
+ if (path_value == "$") {
+ return "";
+ }
+
+ if (path_value.rfind("$.", 0) == 0) {
+ return path_value.substr(2);
+ }
+
+ return path_value;
+}
+
+static std::string
+joinpath(const std::string &base_path, const std::string &field_name)
+{
+ if (base_path.empty()) {
+ return "$." + field_name;
+ }
+
+ return base_path + "." + field_name;
+}
+
+static bool
+ispathunderroot(const std::string &full_path, const std::string &root_path)
+{
+ if (root_path == "$" || root_path.empty()) {
+ return true;
+ }
+
+ if (full_path == root_path) {
+ return true;
+ }
+
+ return full_path.rfind(root_path + ".", 0) == 0;
+}
+
+static std::string
+makerelativepath(const std::string &full_path, const std::string &root_path)
+{
+ std::string rootPrefix = trimrootpath(root_path);
+ std::string fullPrefix = trimrootpath(full_path);
+
+ if (rootPrefix.empty()) {
+ return fullPrefix;
+ }
+
+ if (fullPrefix == rootPrefix) {
+ return "";
+ }
+
+ if (fullPrefix.rfind(rootPrefix + ".", 0) == 0) {
+ return fullPrefix.substr(rootPrefix.size() + 1);
+ }
+
+ return fullPrefix;
+}
+
+static std::string
+buildjsonpathfromrelative(const std::string &relative_path)
+{
+ if (relative_path.empty()) {
+ return "$";
+ }
+
+ return "$." + relative_path;
+}
+
+static std::string
+buildqualifiedname(const std::string &owner_name, const std::string &object_name)
+{
+ return std::string(quote_identifier(owner_name.c_str())) + "." +
+ quote_identifier(object_name.c_str());
+}
+
+static std::string
+buildmetadataqualifiedname(const std::string &owner_name)
+{
+ return buildqualifiedname(owner_name, "dbms_json_metadata");
+}
+
+static std::string
+resolveownername()
+{
+ List *searchPath = fetch_search_path(false);
+
+ if (searchPath != NIL) {
+ Oid schemaOid = linitial_oid(searchPath);
+ char *schemaName = get_namespace_name(schemaOid);
+
+ if (schemaName != nullptr && strcmp(schemaName, "pg_catalog") != 0) {
+ return std::string(schemaName);
+ }
+ }
+
+ return "public";
+}
+
+static std::string
+normalizeidentifierinput(const std::string &identifier_value)
+{
+ char *normalizedIdentifier = downcase_identifier(identifier_value.c_str(),
+ identifier_value.length(),
+ false,
+ false);
+ std::string normalizedValue = normalizedIdentifier == nullptr
+ ? std::string()
+ : std::string(normalizedIdentifier);
+
+ if (normalizedIdentifier != nullptr) {
+ pfree(normalizedIdentifier);
+ }
+
+ return normalizedValue;
+}
+
+static Oid
+resolvetablerelid(const std::string &table_name)
+{
+ text *tableNameText = cstring_to_text(table_name.c_str());
+ List *nameList = textToQualifiedNameList(tableNameText);
+ Oid relationOid = InvalidOid;
+
+ if (list_length(nameList) == 1) {
+ char *relationName = pstrdup(table_name.c_str());
+ List *searchPath = fetch_search_path(false);
+ ListCell *searchPathCell;
+
+ foreach(searchPathCell, searchPath) {
+ Oid namespaceOid = lfirst_oid(searchPathCell);
+
+ relationOid = get_relname_relid(relationName, namespaceOid);
+ if (relationOid == InvalidOid) {
+ char *normalizedRelationName = downcase_identifier(relationName,
+ strlen(relationName),
+ false,
+ false);
+ relationOid = get_relname_relid(normalizedRelationName, namespaceOid);
+ pfree(normalizedRelationName);
+ }
+
+ if (relationOid != InvalidOid) {
+ break;
+ }
+ }
+
+ list_free(searchPath);
+ pfree(relationName);
+ } else if (list_length(nameList) == 2) {
+ char *schemaName = pstrdup(strVal(linitial(nameList)));
+ char *relationName = pstrdup(strVal(lsecond(nameList)));
+ Oid namespaceOid = get_namespace_oid(schemaName, true);
+
+ if (namespaceOid == InvalidOid) {
+ char *normalizedSchemaName = downcase_identifier(schemaName,
+ strlen(schemaName),
+ false,
+ false);
+ namespaceOid = get_namespace_oid(normalizedSchemaName, true);
+ pfree(normalizedSchemaName);
+ }
+
+ if (namespaceOid != InvalidOid) {
+ relationOid = get_relname_relid(relationName, namespaceOid);
+
+ if (relationOid == InvalidOid) {
+ char *normalizedRelationName = downcase_identifier(relationName,
+ strlen(relationName),
+ false,
+ false);
+ relationOid = get_relname_relid(normalizedRelationName, namespaceOid);
+ pfree(normalizedRelationName);
+ }
+ }
+
+ pfree(schemaName);
+ pfree(relationName);
+ }
+
+ pfree(tableNameText);
+ list_free_deep(nameList);
+
+ if (relationOid == InvalidOid) {
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_TABLE),
+ errmsg("relation does not exist"),
+ errdetail("tablename=%s", table_name.c_str())));
+ }
+
+ return relationOid;
+}
+
+static Oid
+resolvetablerelid(const std::string &owner_name, const std::string &table_name)
+{
+ std::string qualifiedName = normalizeidentifierinput(owner_name) + "." +
+ normalizeidentifierinput(table_name);
+
+ return resolvetablerelid(qualifiedName);
+}
+
+static std::string
+resolverelationownername(Oid relation_oid)
+{
+ Oid namespaceOid = get_rel_namespace(relation_oid);
+ char *namespaceName = get_namespace_name(namespaceOid);
+
+ if (namespaceName == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_SCHEMA),
+ errmsg("relation schema does not exist"),
+ errdetail("relation_oid=%u", relation_oid)));
+ }
+
+ return std::string(namespaceName);
+}
+
+static std::string
+resolverelationname(Oid relation_oid)
+{
+ char *relationName = get_rel_name(relation_oid);
+
+ if (relationName == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_TABLE),
+ errmsg("relation name does not exist"),
+ errdetail("relation_oid=%u", relation_oid)));
+ }
+
+ return std::string(relationName);
+}
+
+static std::string
+resolvecolumnname(Oid relation_oid, const std::string &column_name)
+{
+ AttrNumber attributeNumber = get_attnum(relation_oid, column_name.c_str());
+ char *resolvedName = nullptr;
+
+ if (attributeNumber == InvalidAttrNumber) {
+ std::string normalizedName = normalizeidentifierinput(column_name);
+
+ if (normalizedName != column_name) {
+ attributeNumber = get_attnum(relation_oid, normalizedName.c_str());
+ }
+ }
+
+ if (attributeNumber == InvalidAttrNumber) {
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_COLUMN),
+ errmsg("column does not exist"),
+ errdetail("column_name=%s", column_name.c_str())));
+ }
+
+ resolvedName = get_attname(relation_oid, attributeNumber, false);
+ if (resolvedName == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_COLUMN),
+ errmsg("column name does not exist"),
+ errdetail("relation_oid=%u, column_name=%s",
+ relation_oid,
+ column_name.c_str())));
+ }
+
+ return std::string(resolvedName);
+}
+
+static std::string
+resolvetableownername(const std::string &table_name)
+{
+ Oid relationOid = resolvetablerelid(table_name);
+
+ return resolverelationownername(relationOid);
+}
+
+static std::string
+resolvetableownername(const std::string &owner_name, const std::string &table_name)
+{
+ Oid relationOid = resolvetablerelid(owner_name, table_name);
+
+ return resolverelationownername(relationOid);
+}
+
+static std::string
+resolvetablename(const std::string &table_name)
+{
+ Oid relationOid = resolvetablerelid(table_name);
+
+ return resolverelationname(relationOid);
+}
+
+static std::string
+resolvetablename(const std::string &owner_name, const std::string &table_name)
+{
+ Oid relationOid = resolvetablerelid(owner_name, table_name);
+
+ return resolverelationname(relationOid);
+}
+
+static std::string
+resolvejsoncolumnname(const std::string &table_name, const std::string &column_name)
+{
+ Oid relationOid = resolvetablerelid(table_name);
+
+ return resolvecolumnname(relationOid, column_name);
+}
+
+static std::string
+resolvejsoncolumnname(const std::string &owner_name,
+ const std::string &table_name,
+ const std::string &column_name)
+{
+ Oid relationOid = resolvetablerelid(owner_name, table_name);
+
+ return resolvecolumnname(relationOid, column_name);
+}
+
+static std::string
+resolvestatusname(const std::string &status_table_name)
+{
+ return normalizeidentifierinput(status_table_name);
+}
+
+static void
+normalizeexistingtableandcolumn(const std::string &table_name,
+ const std::string &column_name,
+ std::string *owner_name,
+ std::string *normalized_table_name,
+ std::string *normalized_column_name)
+{
+ Oid relationOid = resolvetablerelid(table_name);
+
+ *owner_name = resolverelationownername(relationOid);
+ *normalized_table_name = resolverelationname(relationOid);
+ *normalized_column_name = resolvecolumnname(relationOid, column_name);
+}
+
+static void
+normalizeexistingtableandcolumn(const std::string &owner_name,
+ const std::string &table_name,
+ const std::string &column_name,
+ std::string *normalized_owner_name,
+ std::string *normalized_table_name,
+ std::string *normalized_column_name)
+{
+ Oid relationOid = resolvetablerelid(owner_name, table_name);
+
+ *normalized_owner_name = resolverelationownername(relationOid);
+ *normalized_table_name = resolverelationname(relationOid);
+ *normalized_column_name = resolvecolumnname(relationOid, column_name);
+}
+
+static std::string
+resolvecolumntype(JsonbContainer *column_guide)
+{
+ JsonbValue typeBuffer;
+ JsonbValue lengthBuffer;
+ JsonbValue *typeValue = getobjectfield(column_guide, "type", &typeBuffer);
+ JsonbValue *lengthValue = getobjectfield(column_guide, "o:length", &lengthBuffer);
+ std::string typeName = jsonbvaluetostring(typeValue);
+ int32 columnLength = jsonbvaluetoint32(lengthValue, 0);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON resolve column type"),
+ errdetail("json_type=%s, length=%d",
+ typeName.c_str(),
+ columnLength)));
+
+ if (typeName == "number") {
+ return "number";
+ }
+
+ if (typeName == "string") {
+ if (columnLength > 0) {
+ return "varchar2(" + std::to_string(columnLength) + ")";
+ }
+
+ return "varchar2(4000)";
+ }
+
+ if (typeName == "integer") {
+ return "number";
+ }
+
+ if (typeName == "boolean") {
+ return "varchar2(5)";
+ }
+
+ if (typeName == "null") {
+ return "varchar2(4)";
+ }
+
+ return "";
+}
+
+static std::string
+resolvecolumntypefromname(const std::string &json_type)
+{
+ if (json_type == "number" || json_type == "integer") {
+ return "numeric";
+ }
+
+ if (json_type == "boolean") {
+ return "boolean";
+ }
+
+ if (json_type == "string" || json_type == "null") {
+ return "text";
+ }
+
+ return "";
+}
+
+static bool
+isscalarjsonbvalue(const JsonbValue *json_value)
+{
+ if (json_value == nullptr) {
+ return false;
+ }
+
+ switch (json_value->type) {
+ case jbvString:
+ case jbvNumeric:
+ case jbvBool:
+ case jbvNull:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static std::string
+resolvejsontypename(const JsonbValue *json_value)
+{
+ if (json_value == nullptr) {
+ return "";
+ }
+
+ switch (json_value->type) {
+ case jbvString:
+ return "string";
+ case jbvNumeric:
+ return "number";
+ case jbvBool:
+ return "boolean";
+ case jbvNull:
+ return "null";
+ default:
+ return "";
+ }
+}
+
+static std::string
+resolvejsontypenamefromcode(int32 type_code)
+{
+ switch (type_code) {
+ case DBMS_JSON_TYPE_NULL:
+ return "null";
+ case DBMS_JSON_TYPE_STRING:
+ return "string";
+ case DBMS_JSON_TYPE_NUMBER:
+ return "number";
+ case DBMS_JSON_TYPE_BOOLEAN:
+ return "boolean";
+ case DBMS_JSON_TYPE_OBJECT:
+ return "object";
+ case DBMS_JSON_TYPE_ARRAY:
+ return "array";
+ default:
+ return "";
+ }
+}
+
+static void
+appendguideentry(JsonbParseState **parse_state,
+ const std::string &path_value,
+ const std::string &json_type,
+ const std::string &column_name)
+{
+ JsonbValue keyValue;
+ JsonbValue valueValue;
+
+ (void) pushJsonbValue(parse_state, WJB_BEGIN_OBJECT, nullptr);
+
+ keyValue.type = jbvString;
+ keyValue.val.string.val = const_cast<char *>("path");
+ keyValue.val.string.len = 4;
+ valueValue.type = jbvString;
+ valueValue.val.string.val = pstrdup(path_value.c_str());
+ valueValue.val.string.len = path_value.size();
+ (void) pushJsonbValue(parse_state, WJB_KEY, &keyValue);
+ (void) pushJsonbValue(parse_state, WJB_VALUE, &valueValue);
+
+ keyValue.val.string.val = const_cast<char *>("type");
+ keyValue.val.string.len = 4;
+ valueValue.val.string.val = pstrdup(json_type.c_str());
+ valueValue.val.string.len = json_type.size();
+ (void) pushJsonbValue(parse_state, WJB_KEY, &keyValue);
+ (void) pushJsonbValue(parse_state, WJB_VALUE, &valueValue);
+
+ keyValue.val.string.val = const_cast<char *>("column");
+ keyValue.val.string.len = 6;
+ valueValue.val.string.val = pstrdup(column_name.c_str());
+ valueValue.val.string.len = column_name.size();
+ (void) pushJsonbValue(parse_state, WJB_KEY, &keyValue);
+ (void) pushJsonbValue(parse_state, WJB_VALUE, &valueValue);
+
+ (void) pushJsonbValue(parse_state, WJB_END_OBJECT, nullptr);
+}
+
+static void
+collectguideentries(JsonbContainer *container,
+ const std::string &base_path,
+ JsonbParseState **parse_state)
+{
+ JsonbIterator *iterator = JsonbIteratorInit(container);
+ JsonbValue iteratorValue;
+ JsonbIteratorToken token;
+ std::string currentKey;
+
+ while ((token = JsonbIteratorNext(&iterator, &iteratorValue, true)) != WJB_DONE) {
+ std::string currentPath;
+ std::string currentType;
+
+ if (token == WJB_KEY) {
+ currentKey.assign(iteratorValue.val.string.val, iteratorValue.val.string.len);
+ continue;
+ }
+
+ if (token != WJB_VALUE) {
+ continue;
+ }
+
+ currentPath = joinpath(base_path, currentKey);
+ currentType = resolvejsontypename(&iteratorValue);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.BUILD_DATAGUIDE inspect node"),
+ errdetail("path=%s, type=%s",
+ currentPath.c_str(),
+ currentType.empty() ? "composite" : currentType.c_str())));
+
+ if (isscalarjsonbvalue(&iteratorValue)) {
+ appendguideentry(parse_state,
+ currentPath,
+ currentType,
+ normalizesqlidentifier(currentKey, false));
+ continue;
+ }
+
+ if (iteratorValue.type == jbvBinary &&
+ JsonContainerIsObject(iteratorValue.val.binary.data)) {
+ collectguideentries(iteratorValue.val.binary.data, currentPath, parse_state);
+ }
+ }
+}
+
+static Jsonb *
+builddataguide(Jsonb *json_value)
+{
+ JsonbValue rootValue;
+ JsonbParseState *parseState = nullptr;
+ JsonbValue *resultValue = nullptr;
+
+ JsonbToJsonbValue(json_value, &rootValue);
+
+ if (rootValue.type != jbvBinary ||
+ !JsonContainerIsObject(rootValue.val.binary.data)) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON.BUILD_DATAGUIDE expects root JSON object")));
+ }
+
+ (void) pushJsonbValue(&parseState, WJB_BEGIN_ARRAY, nullptr);
+ collectguideentries(rootValue.val.binary.data, "$", &parseState);
+ resultValue = pushJsonbValue(&parseState, WJB_END_ARRAY, nullptr);
+
+ return JsonbValueToJsonb(resultValue);
+}
+
+static void
+appendguideentryifmissing(JsonbParseState **parse_state,
+ std::set<std::string> *seen_entries,
+ const GuideEntry &entry)
+{
+ std::string entryKey = entry.path_ + "|" + entry.jsonType_ + "|" + entry.columnName_ + "|" +
+ entry.columnType_;
+
+ if (seen_entries->find(entryKey) != seen_entries->end()) {
+ return;
+ }
+
+ seen_entries->insert(entryKey);
+ appendguideentry(parse_state, entry.path_, entry.jsonType_, entry.columnName_);
+}
+
+static Jsonb *
+buildguidefromentries(const std::vector<GuideEntry> &entries)
+{
+ JsonbParseState *parseState = nullptr;
+ JsonbValue *resultValue = nullptr;
+ std::set<std::string> seenEntries;
+
+ (void) pushJsonbValue(&parseState, WJB_BEGIN_ARRAY, nullptr);
+
+ for (const GuideEntry &entry : entries) {
+ appendguideentryifmissing(&parseState, &seenEntries, entry);
+ }
+
+ resultValue = pushJsonbValue(&parseState, WJB_END_ARRAY, nullptr);
+ return JsonbValueToJsonb(resultValue);
+}
+
+static void
+ensuremetadatatable(const std::string &owner_name)
+{
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_UTILITY;
+ std::string createSql =
+ "CREATE TABLE IF NOT EXISTS " + buildmetadataqualifiedname(owner_name) + " ("
+ "tablename text NOT NULL, "
+ "jcolname text NOT NULL, "
+ "path text NOT NULL, "
+ "json_type text NOT NULL, "
+ "preferred_name text NOT NULL, "
+ "PRIMARY KEY(tablename, jcolname, path, json_type)"
+ ")";
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON metadata initialization"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute(createSql.c_str(), false, 0);
+ if (executeStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON metadata table initialization failed"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ SPI_finish();
+}
+
+static void
+applypreferrednames(const std::string &owner_name,
+ const std::string &table_name,
+ const std::string &json_column_name,
+ std::vector<GuideEntry> *entries)
+{
+ Oid argTypes[2] = {TEXTOID, TEXTOID};
+ Datum values[2];
+ const char nulls[2] = {' ', ' '};
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_SELECT;
+ std::string selectSql =
+ "SELECT path, json_type, preferred_name "
+ "FROM " + buildmetadataqualifiedname(owner_name) +
+ " WHERE tablename = $1 AND jcolname = $2";
+
+ if (entries->empty()) {
+ return;
+ }
+
+ values[0] = CStringGetTextDatum(table_name.c_str());
+ values[1] = CStringGetTextDatum(json_column_name.c_str());
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON preferred name lookup"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute_with_args(selectSql.c_str(),
+ 2,
+ argTypes,
+ values,
+ nulls,
+ true,
+ 0);
+ if (executeStatus != SPI_OK_SELECT) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON preferred name lookup failed"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ for (uint64 rowIndex = 0; rowIndex < SPI_processed; ++rowIndex) {
+ HeapTuple rowTuple = SPI_tuptable->vals[rowIndex];
+ TupleDesc rowDesc = SPI_tuptable->tupdesc;
+ bool isNull = false;
+ char *pathCString = TextDatumGetCString(SPI_getbinval(rowTuple, rowDesc, 1, &isNull));
+ char *typeCString = TextDatumGetCString(SPI_getbinval(rowTuple, rowDesc, 2, &isNull));
+ char *preferredCString = TextDatumGetCString(SPI_getbinval(rowTuple, rowDesc, 3, &isNull));
+
+ for (GuideEntry &entry : *entries) {
+ if (entry.path_ == pathCString && entry.jsonType_ == typeCString) {
+ entry.columnName_ = preferredCString;
+ }
+ }
+
+ pfree(pathCString);
+ pfree(typeCString);
+ pfree(preferredCString);
+ }
+
+ SPI_finish();
+}
+
+static void
+parseguideentriesfromproperties(JsonbContainer *properties_container,
+ const std::string &base_path,
+ std::vector<GuideEntry> *entries)
+{
+ JsonbIterator *iterator = JsonbIteratorInit(properties_container);
+ JsonbValue iteratorValue;
+ JsonbIteratorToken token;
+ std::string currentKey;
+
+ while ((token = JsonbIteratorNext(&iterator, &iteratorValue, true)) != WJB_DONE) {
+ if (token == WJB_KEY) {
+ currentKey.assign(iteratorValue.val.string.val, iteratorValue.val.string.len);
+ continue;
+ }
+
+ if (token != WJB_VALUE || iteratorValue.type != jbvBinary ||
+ !JsonContainerIsObject(iteratorValue.val.binary.data)) {
+ continue;
+ }
+
+ {
+ JsonbContainer *childContainer = iteratorValue.val.binary.data;
+ JsonbValue typeBuffer;
+ JsonbValue preferredBuffer;
+ JsonbValue propertiesBuffer;
+ JsonbValue *typeValue = getobjectfield(childContainer, "type", &typeBuffer);
+ JsonbValue *preferredValue =
+ getobjectfield(childContainer, "o:preferred_column_name", &preferredBuffer);
+ JsonbValue *propertiesValue = getobjectfield(childContainer, "properties", &propertiesBuffer);
+ std::string currentPath = joinpath(base_path, currentKey);
+ std::string jsonType = jsonbvaluetostring(typeValue);
+ std::string columnName = preferredValue == nullptr
+ ? normalizesqlidentifier(currentKey, true)
+ : jsonbvaluetostring(preferredValue);
+ std::string columnType = resolvecolumntype(childContainer);
+
+ if (!columnType.empty()) {
+ entries->push_back({currentPath, jsonType, columnName, columnType});
+ }
+
+ if (propertiesValue != nullptr &&
+ propertiesValue->type == jbvBinary &&
+ JsonContainerIsObject(propertiesValue->val.binary.data)) {
+ parseguideentriesfromproperties(propertiesValue->val.binary.data, currentPath, entries);
+ }
+ }
+ }
+}
+
+static void
+parseguideentries(Jsonb *guide_jsonb, std::vector<GuideEntry> *entries)
+{
+ JsonbValue rootValue;
+ JsonbIterator *iterator = JsonbIteratorInit(&guide_jsonb->root);
+ JsonbValue iteratorValue;
+ JsonbIteratorToken token;
+
+ JsonbToJsonbValue(guide_jsonb, &rootValue);
+
+ if (rootValue.type == jbvBinary && JsonContainerIsObject(rootValue.val.binary.data)) {
+ JsonbValue propertiesBuffer;
+ JsonbValue *propertiesValue =
+ getobjectfield(rootValue.val.binary.data, "properties", &propertiesBuffer);
+
+ if (propertiesValue != nullptr &&
+ propertiesValue->type == jbvBinary &&
+ JsonContainerIsObject(propertiesValue->val.binary.data)) {
+ parseguideentriesfromproperties(propertiesValue->val.binary.data, "$", entries);
+ return;
+ }
+ }
+
+ while ((token = JsonbIteratorNext(&iterator, &iteratorValue, true)) != WJB_DONE) {
+ JsonbValue pathBuffer;
+ JsonbValue typeBuffer;
+ JsonbValue columnBuffer;
+ JsonbValue *pathValue = nullptr;
+ JsonbValue *typeValue = nullptr;
+ JsonbValue *columnValue = nullptr;
+
+ if (token != WJB_ELEM || iteratorValue.type != jbvBinary ||
+ !JsonContainerIsObject(iteratorValue.val.binary.data)) {
+ continue;
+ }
+
+ pathValue = getobjectfield(iteratorValue.val.binary.data, "path", &pathBuffer);
+ typeValue = getobjectfield(iteratorValue.val.binary.data, "type", &typeBuffer);
+ columnValue = getobjectfield(iteratorValue.val.binary.data, "column", &columnBuffer);
+
+ if (pathValue == nullptr || typeValue == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid data guide entry"),
+ errdetail("guide entry must contain path and type")));
+ }
+
+ entries->push_back({jsonbvaluetostring(pathValue),
+ jsonbvaluetostring(typeValue),
+ columnValue == nullptr ? "" : jsonbvaluetostring(columnValue),
+ ""});
+ }
+}
+
+static Jsonb *
+builddataguidefortable(const std::string &owner_name,
+ const std::string &table_name,
+ const std::string &json_column_name)
+{
+ Oid argTypes[0];
+ Datum values[0];
+ const char nulls[1] = {' '};
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_SELECT;
+ std::string selectSql =
+ "SELECT CASE "
+ "WHEN " + std::string(quote_identifier(json_column_name.c_str())) + " IS NULL THEN NULL "
+ "ELSE pg_catalog.dbms_json_build_dataguide(" +
+ std::string(quote_identifier(json_column_name.c_str())) + ") END "
+ "FROM " + buildqualifiedname(owner_name, table_name);
+ std::vector<GuideEntry> allEntries;
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON table guide build"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute_with_args(selectSql.c_str(),
+ 0,
+ argTypes,
+ values,
+ nulls,
+ true,
+ 0);
+ if (executeStatus != SPI_OK_SELECT) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON failed to build guide from table"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ for (uint64 rowIndex = 0; rowIndex < SPI_processed; ++rowIndex) {
+ bool isNull = false;
+ Datum guideDatum = SPI_getbinval(SPI_tuptable->vals[rowIndex],
+ SPI_tuptable->tupdesc,
+ 1,
+ &isNull);
+
+ if (!isNull) {
+ Jsonb *rowGuideJsonb = DatumGetJsonbP(guideDatum);
+ parseguideentries(rowGuideJsonb, &allEntries);
+ }
+ }
+
+ SPI_finish();
+ return buildguidefromentries(allEntries);
+}
+
+static text *
+builddataguidetextforformat(Jsonb *guide_jsonb, int32 format_code, int32 pretty_code)
+{
+ text *guideText = nullptr;
+
+ if (format_code != 1 && format_code != 2 && format_code != 3) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON.GET_INDEX_DATAGUIDE invalid format"),
+ errdetail("format=%d", format_code)));
+ }
+
+ if (pretty_code == 1) {
+ guideText = DatumGetTextPP(DirectFunctionCall1(jsonb_pretty, JsonbPGetDatum(guide_jsonb)));
+ } else {
+ guideText = cstring_to_text(JsonbToCString(nullptr, &guide_jsonb->root, VARSIZE(guide_jsonb)));
+ }
+
+ return guideText;
+}
+
+static std::string
+buildjsonpatharrayliteral(const std::string &json_path)
+{
+ std::string trimmedPath = trimrootpath(json_path);
+ std::string resultValue = "{";
+ std::size_t startPos = 0;
+
+ while (startPos <= trimmedPath.size()) {
+ std::size_t dotPos = trimmedPath.find('.', startPos);
+ std::string token = trimmedPath.substr(startPos, dotPos - startPos);
+
+ if (!token.empty()) {
+ if (resultValue.size() > 1) {
+ resultValue += ",";
+ }
+
+ resultValue += token;
+ }
+
+ if (dotPos == std::string::npos) {
+ break;
+ }
+
+ startPos = dotPos + 1;
+ }
+
+ resultValue += "}";
+ return resultValue;
+}
+
+static std::string
+buildvirtualcolumnexpr(const std::string &json_column_name,
+ const std::string &json_path,
+ const std::string &column_type)
+{
+ std::string baseExpr =
+ "(" + std::string(quote_identifier(json_column_name.c_str())) + " #>> '" +
+ buildjsonpatharrayliteral(json_path) + "')";
+
+ if (column_type == "numeric") {
+ return "(" + baseExpr + "::numeric)";
+ }
+
+ if (column_type == "boolean") {
+ return "(" + baseExpr + "::boolean)";
+ }
+
+ return baseExpr;
+}
+
+static void
+buildcolumnsfromguide(const std::vector<GuideEntry> &entries,
+ const std::string &root_path,
+ const std::string &prefix_value,
+ bool resolve_name_conflicts,
+ bool mixed_case_columns,
+ bool prefer_declared_types,
+ std::vector<ColumnSpec> *columns)
+{
+ std::set<std::string> usedNames;
+
+ for (const GuideEntry &entry : entries) {
+ std::string relativePath;
+ std::string leafName;
+ std::string resolvedName;
+ std::string columnType;
+ std::size_t dotPos;
+
+ if (!ispathunderroot(entry.path_, root_path)) {
+ continue;
+ }
+
+ relativePath = makerelativepath(entry.path_, root_path);
+ if (relativePath.empty()) {
+ continue;
+ }
+
+ dotPos = relativePath.rfind('.');
+ leafName = dotPos == std::string::npos ? relativePath : relativePath.substr(dotPos + 1);
+ resolvedName = entry.columnName_.empty() ? leafName : entry.columnName_;
+ resolvedName = normalizesqlidentifier(prefix_value + resolvedName, mixed_case_columns);
+ columnType = prefer_declared_types && !entry.columnType_.empty()
+ ? entry.columnType_
+ : resolvecolumntypefromname(entry.jsonType_);
+
+ if (columnType.empty()) {
+ continue;
+ }
+
+ if (usedNames.find(resolvedName) != usedNames.end()) {
+ if (!resolve_name_conflicts) {
+ ereport(ERROR,
+ (errcode(ERRCODE_DUPLICATE_COLUMN),
+ errmsg("invalid data guide: column name conflict"),
+ errdetail("column_name=%s", resolvedName.c_str())));
+ }
+
+ int suffixValue = 1;
+ std::string uniqueName;
+
+ do {
+ uniqueName = resolvedName + std::to_string(suffixValue);
+ suffixValue++;
+ } while (usedNames.find(uniqueName) != usedNames.end());
+
+ resolvedName = uniqueName;
+ }
+
+ usedNames.insert(resolvedName);
+ columns->push_back({relativePath, resolvedName, columnType});
+ }
+}
+
+static std::string
+buildcolumnclause(const std::vector<ColumnSpec> &columns)
+{
+ std::string resultValue;
+
+ for (std::size_t index = 0; index < columns.size(); ++index) {
+ if (index != 0) {
+ resultValue += ",\n";
+ }
+
+ resultValue += std::string(quote_identifier(columns[index].columnName_.c_str())) + " " +
+ columns[index].columnType_ + " path '" +
+ buildjsonpathfromrelative(columns[index].jsonFieldName_) + "'";
+ }
+
+ return resultValue;
+}
+
+static std::string
+buildselectsql(const std::string &owner_name,
+ const std::string &table_name,
+ const std::string &json_column_name,
+ const std::string &path_value,
+ const std::vector<ColumnSpec> &columns,
+ bool materialize)
+{
+ std::string selectHead = materialize
+ ? "SELECT RT.\"ROWID\" ROW_ID, JT.*\n"
+ : "SELECT JT.*\n";
+
+ return selectHead +
+ "FROM " + buildqualifiedname(owner_name, table_name) + " RT,\n" +
+ "JSON_TABLE(" + std::string(quote_identifier(json_column_name.c_str())) + ", '" +
+ normalizepath(path_value) + "' COLUMNS (\n" +
+ buildcolumnclause(columns) + "))JT";
+}
+
+static std::string
+buildddl(const std::string &owner_name,
+ const std::string &view_name,
+ const std::string &select_sql,
+ bool materialize,
+ int32 mv_refresh_mode)
+{
+ if (view_name.empty()) {
+ return select_sql;
+ }
+
+ if (materialize) {
+ if (mv_refresh_mode != DBMS_JSON_MV_REFRESH_ON_STATEMENT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("unsupported materialized view refresh mode"),
+ errdetail("mvrefreshmode=%d", mv_refresh_mode)));
+ }
+
+ return "CREATE MATERIALIZED VIEW " + buildqualifiedname(owner_name, view_name) +
+ " BUILD IMMEDIATE REFRESH FAST ON STATEMENT WITH ROWID\nAS " + select_sql;
+ }
+
+ return "CREATE OR REPLACE VIEW " + buildqualifiedname(owner_name, view_name) +
+ " AS " + select_sql;
+}
+} // namespace DbmsJson
+
+extern "C" Datum
+dbms_json_build_dataguide(PG_FUNCTION_ARGS)
+{
+ Jsonb *_jsonValue = PG_GETARG_JSONB_P(0);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.BUILD_DATAGUIDE call"),
+ errdetail("input_size=%d", VARSIZE(_jsonValue))));
+
+ PG_RETURN_JSONB_P(DbmsJson::builddataguide(_jsonValue));
+}
+
+extern "C" Datum
+dbms_json_get_index_dataguide(PG_FUNCTION_ARGS)
+{
+ text *_tableNameText = PG_GETARG_TEXT_PP(0);
+ text *_jsonColumnNameText = PG_GETARG_TEXT_PP(1);
+ int32 formatCode = PG_GETARG_INT32(2);
+ int32 prettyCode = PG_NARGS() > 3 && !PG_ARGISNULL(3) ? PG_GETARG_INT32(3) : 0;
+ char *_tableNameCString = text_to_cstring(_tableNameText);
+ char *_jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ std::string tableOwnerName;
+ std::string tableName;
+ std::string jsonColumnName;
+ std::string metadataOwnerName = DbmsJson::resolveownername();
+ Jsonb *guideJsonb = nullptr;
+ text *guideText = nullptr;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.GET_INDEX_DATAGUIDE call"),
+ errdetail("tablename=%s, jcolname=%s, format=%d, pretty=%d",
+ _tableNameCString,
+ _jsonColumnNameCString,
+ formatCode,
+ prettyCode)));
+
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &tableOwnerName,
+ &tableName,
+ &jsonColumnName);
+ guideJsonb = DbmsJson::builddataguidefortable(tableOwnerName,
+ tableName,
+ jsonColumnName);
+ DbmsJson::ensuremetadatatable(metadataOwnerName);
+
+ {
+ std::vector<DbmsJson::GuideEntry> guideEntries;
+ DbmsJson::parseguideentries(guideJsonb, &guideEntries);
+ DbmsJson::applypreferrednames(metadataOwnerName,
+ tableName,
+ jsonColumnName,
+ &guideEntries);
+ guideJsonb = DbmsJson::buildguidefromentries(guideEntries);
+ }
+
+ guideText = DbmsJson::builddataguidetextforformat(guideJsonb, formatCode, prettyCode);
+
+ pfree(_tableNameCString);
+ pfree(_jsonColumnNameCString);
+
+ PG_RETURN_TEXT_P(guideText);
+}
+
+extern "C" Datum
+dbms_json_get_view_sql(PG_FUNCTION_ARGS)
+{
+ text *_viewNameText = PG_ARGISNULL(0) ? nullptr : PG_GETARG_TEXT_PP(0);
+ text *_tableNameText = PG_ARGISNULL(1) ? nullptr : PG_GETARG_TEXT_PP(1);
+ text *_jsonColumnNameText = PG_ARGISNULL(2) ? nullptr : PG_GETARG_TEXT_PP(2);
+ Jsonb *_dataGuideJsonb = PG_ARGISNULL(3) ? nullptr : PG_GETARG_JSONB_P(3);
+ bool materialize = PG_ARGISNULL(4) ? false : PG_GETARG_BOOL(4);
+ int32 mvRefreshMode =
+ PG_ARGISNULL(5) ? DBMS_JSON_MV_REFRESH_ON_STATEMENT : PG_GETARG_INT32(5);
+ text *_pathText = PG_ARGISNULL(6) ? nullptr : PG_GETARG_TEXT_PP(6);
+ bool resolveNameConflicts = PG_ARGISNULL(7) ? true : PG_GETARG_BOOL(7);
+ text *_columnPrefixText = PG_ARGISNULL(8) ? nullptr : PG_GETARG_TEXT_PP(8);
+ bool mixedCaseColumns = PG_ARGISNULL(9) ? true : PG_GETARG_BOOL(9);
+ char *_viewNameCString = nullptr;
+ char *_tableNameCString = nullptr;
+ char *_jsonColumnNameCString = nullptr;
+ char *_pathCString = nullptr;
+ char *_columnPrefixCString = nullptr;
+ std::vector<DbmsJson::GuideEntry> guideEntries;
+ std::vector<DbmsJson::ColumnSpec> columns;
+ std::string viewOwnerName;
+ std::string tableOwnerName;
+ std::string viewName;
+ std::string tableName;
+ std::string jsonColumnName;
+ std::string pathValue = "$";
+ std::string columnPrefix;
+ std::string ddlText;
+ bool isViewNameNull = (_viewNameText == nullptr);
+ bool isTableNameNull = (_tableNameText == nullptr);
+ bool isJsonColumnNameNull = (_jsonColumnNameText == nullptr);
+ bool isDataGuideNull = (_dataGuideJsonb == nullptr);
+ bool isPathNull = (_pathText == nullptr);
+ bool isColumnPrefixNull = (_columnPrefixText == nullptr);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.GET_VIEW_SQL call"),
+ errdetail("viewname_is_null=%s, tablename_is_null=%s, jcolname_is_null=%s, dataguide_is_null=%s, materialize=%s, mvrefreshmode=%d, path_is_null=%s, resolvenameconflicts=%s, colnameprefix_is_null=%s, mixedcasecolumns=%s",
+ isViewNameNull ? "true" : "false",
+ isTableNameNull ? "true" : "false",
+ isJsonColumnNameNull ? "true" : "false",
+ isDataGuideNull ? "true" : "false",
+ materialize ? "true" : "false",
+ mvRefreshMode,
+ isPathNull ? "true" : "false",
+ resolveNameConflicts ? "true" : "false",
+ isColumnPrefixNull ? "true" : "false",
+ mixedCaseColumns ? "true" : "false")));
+
+ if (isTableNameNull || isJsonColumnNameNull || isDataGuideNull) {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_JSON.GET_VIEW_SQL does not allow NULL required arguments")));
+ }
+
+ _viewNameCString = isViewNameNull ? nullptr : text_to_cstring(_viewNameText);
+ _tableNameCString = text_to_cstring(_tableNameText);
+ _jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ _pathCString = isPathNull ? nullptr : text_to_cstring(_pathText);
+ _columnPrefixCString = isColumnPrefixNull ? nullptr : text_to_cstring(_columnPrefixText);
+
+ viewName = _viewNameCString == nullptr
+ ? ""
+ : DbmsJson::normalizeidentifierinput(std::string(_viewNameCString));
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &tableOwnerName,
+ &tableName,
+ &jsonColumnName);
+ pathValue = _pathCString == nullptr ? "$" : std::string(_pathCString);
+ columnPrefix = _columnPrefixCString == nullptr ? "" : std::string(_columnPrefixCString);
+ viewOwnerName = DbmsJson::resolveownername();
+
+ if (!mixedCaseColumns) {
+ ereport(LOG,
+ (errmsg("DBMS_JSON.GET_VIEW_SQL mixed case disabled"),
+ errdetail("column names will be normalized to lower case")));
+ }
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.GET_VIEW_SQL normalized arguments"),
+ errdetail("view_owner=%s, viewname=%s, tablename=%s, jcolname=%s, path=%s, colnameprefix=%s",
+ viewOwnerName.c_str(),
+ viewName.empty() ? "<NULL>" : viewName.c_str(),
+ tableName.c_str(),
+ jsonColumnName.c_str(),
+ pathValue.c_str(),
+ columnPrefix.empty() ? "<NULL>" : columnPrefix.c_str())));
+
+ DbmsJson::parseguideentries(_dataGuideJsonb, &guideEntries);
+ DbmsJson::buildcolumnsfromguide(guideEntries,
+ pathValue,
+ columnPrefix,
+ resolveNameConflicts,
+ mixedCaseColumns,
+ true,
+ &columns);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.GET_VIEW_SQL columns collected"),
+ errdetail("column_count=%zu", columns.size())));
+
+ if (_viewNameCString != nullptr) {
+ pfree(_viewNameCString);
+ }
+ if (_tableNameCString != nullptr) {
+ pfree(_tableNameCString);
+ }
+ if (_jsonColumnNameCString != nullptr) {
+ pfree(_jsonColumnNameCString);
+ }
+ if (_pathCString != nullptr) {
+ pfree(_pathCString);
+ }
+ if (_columnPrefixCString != nullptr) {
+ pfree(_columnPrefixCString);
+ }
+
+ if (columns.empty()) {
+ PG_RETURN_TEXT_P(cstring_to_text(""));
+ }
+
+ ddlText = DbmsJson::buildddl(viewOwnerName,
+ viewName,
+ DbmsJson::buildselectsql(tableOwnerName,
+ tableName,
+ jsonColumnName,
+ pathValue,
+ columns,
+ materialize),
+ materialize,
+ mvRefreshMode);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.GET_VIEW_SQL result"),
+ errdetail("ddl_length=%zu", ddlText.size())));
+
+ PG_RETURN_TEXT_P(cstring_to_text(ddlText.c_str()));
+}
+
+extern "C" Datum
+dbms_json_add_virtual_columns(PG_FUNCTION_ARGS)
+{
+ text *_tableNameText = PG_GETARG_TEXT_PP(0);
+ text *_jsonColumnNameText = PG_GETARG_TEXT_PP(1);
+ Jsonb *_dataGuideJsonb = PG_GETARG_JSONB_P(2);
+ bool resolveNameConflicts = PG_NARGS() > 3 && !PG_ARGISNULL(3) ? PG_GETARG_BOOL(3) : true;
+ text *_columnPrefixText = PG_NARGS() > 4 && !PG_ARGISNULL(4) ? PG_GETARG_TEXT_PP(4) : nullptr;
+ bool mixedCaseColumns = PG_NARGS() > 5 && !PG_ARGISNULL(5) ? PG_GETARG_BOOL(5) : false;
+ char *_tableNameCString = text_to_cstring(_tableNameText);
+ char *_jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ char *_columnPrefixCString = _columnPrefixText == nullptr ? nullptr : text_to_cstring(_columnPrefixText);
+ std::string ownerName;
+ std::string tableName;
+ std::string jsonColumnName;
+ std::vector<DbmsJson::GuideEntry> guideEntries;
+ std::vector<DbmsJson::ColumnSpec> columns;
+ int spiStatus = SPI_OK_CONNECT;
+
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &ownerName,
+ &tableName,
+ &jsonColumnName);
+ DbmsJson::parseguideentries(_dataGuideJsonb, &guideEntries);
+ DbmsJson::buildcolumnsfromguide(guideEntries,
+ "$",
+ _columnPrefixCString == nullptr ? "" : std::string(_columnPrefixCString),
+ resolveNameConflicts,
+ mixedCaseColumns,
+ false,
+ &columns);
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON.ADD_VIRTUAL_COLUMNS"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ for (const DbmsJson::ColumnSpec &columnSpec : columns) {
+ std::string alterSql =
+ "ALTER TABLE " + DbmsJson::buildqualifiedname(ownerName, tableName) +
+ " ADD COLUMN " + std::string(quote_identifier(columnSpec.columnName_.c_str())) +
+ " " + columnSpec.columnType_ + " GENERATED ALWAYS AS " +
+ DbmsJson::buildvirtualcolumnexpr(jsonColumnName,
+ DbmsJson::buildjsonpathfromrelative(columnSpec.jsonFieldName_),
+ columnSpec.columnType_) +
+ " STORED";
+
+ int executeStatus = SPI_execute(alterSql.c_str(), false, 0);
+ if (executeStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.ADD_VIRTUAL_COLUMNS failed"),
+ errdetail("column_name=%s, spi_status=%d",
+ columnSpec.columnName_.c_str(),
+ executeStatus)));
+ }
+ }
+
+ SPI_finish();
+
+ pfree(_tableNameCString);
+ pfree(_jsonColumnNameCString);
+ if (_columnPrefixCString != nullptr) {
+ pfree(_columnPrefixCString);
+ }
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_json_create_view(PG_FUNCTION_ARGS)
+{
+ text *_viewNameText = PG_ARGISNULL(0) ? nullptr : PG_GETARG_TEXT_PP(0);
+ text *_tableNameText = PG_ARGISNULL(1) ? nullptr : PG_GETARG_TEXT_PP(1);
+ text *_jsonColumnNameText = PG_ARGISNULL(2) ? nullptr : PG_GETARG_TEXT_PP(2);
+ Jsonb *_dataGuideJsonb = PG_ARGISNULL(3) ? nullptr : PG_GETARG_JSONB_P(3);
+ text *_resourcePathText = PG_ARGISNULL(4) ? nullptr : PG_GETARG_TEXT_PP(4);
+ bool materialize = PG_ARGISNULL(5) ? false : PG_GETARG_BOOL(5);
+ int32 mvRefreshMode =
+ PG_ARGISNULL(6) ? DBMS_JSON_MV_REFRESH_ON_STATEMENT : PG_GETARG_INT32(6);
+ text *_pathText = PG_ARGISNULL(7) ? nullptr : PG_GETARG_TEXT_PP(7);
+ bool resolveNameConflicts = PG_ARGISNULL(8) ? true : PG_GETARG_BOOL(8);
+ text *_columnPrefixText = PG_ARGISNULL(9) ? nullptr : PG_GETARG_TEXT_PP(9);
+ bool mixedCaseColumns = PG_ARGISNULL(10) ? false : PG_GETARG_BOOL(10);
+ char *_viewNameCString = nullptr;
+ char *_tableNameCString = nullptr;
+ char *_jsonColumnNameCString = nullptr;
+ char *_pathCString = nullptr;
+ char *_columnPrefixCString = nullptr;
+ char *_guideCString = nullptr;
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_UTILITY;
+ std::vector<DbmsJson::GuideEntry> guideEntries;
+ std::vector<DbmsJson::ColumnSpec> columns;
+ std::string viewOwnerName;
+ std::string tableOwnerName;
+ std::string viewName;
+ std::string tableName;
+ std::string jsonColumnName;
+ std::string pathValue = "$";
+ std::string columnPrefix;
+ std::string ddlText;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.CREATE_VIEW call"),
+ errdetail("viewname_is_null=%s, tablename_is_null=%s, jcolname_is_null=%s, dataguide_is_null=%s, resourcepath_is_null=%s, materialize=%s, mvrefreshmode=%d, path_is_null=%s, resolvenameconflicts=%s, colnameprefix_is_null=%s, mixedcasecolumns=%s",
+ _viewNameText == nullptr ? "true" : "false",
+ _tableNameText == nullptr ? "true" : "false",
+ _jsonColumnNameText == nullptr ? "true" : "false",
+ _dataGuideJsonb == nullptr ? "true" : "false",
+ _resourcePathText == nullptr ? "true" : "false",
+ materialize ? "true" : "false",
+ mvRefreshMode,
+ _pathText == nullptr ? "true" : "false",
+ resolveNameConflicts ? "true" : "false",
+ _columnPrefixText == nullptr ? "true" : "false",
+ mixedCaseColumns ? "true" : "false")));
+
+ if (_viewNameText == nullptr || _tableNameText == nullptr ||
+ _jsonColumnNameText == nullptr || _dataGuideJsonb == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_JSON.CREATE_VIEW does not allow NULL required arguments")));
+ }
+
+ if (_resourcePathText != nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_JSON.CREATE_VIEW resourcepath is not supported"),
+ errdetail("resourcepath must be NULL")));
+ }
+
+ _viewNameCString = text_to_cstring(_viewNameText);
+ _tableNameCString = text_to_cstring(_tableNameText);
+ _jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ _pathCString = _pathText == nullptr ? nullptr : text_to_cstring(_pathText);
+ _columnPrefixCString = _columnPrefixText == nullptr ? nullptr : text_to_cstring(_columnPrefixText);
+
+ viewOwnerName = DbmsJson::resolveownername();
+ viewName = DbmsJson::normalizeidentifierinput(std::string(_viewNameCString));
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &tableOwnerName,
+ &tableName,
+ &jsonColumnName);
+ pathValue = _pathCString == nullptr ? "$" : std::string(_pathCString);
+ columnPrefix = _columnPrefixCString == nullptr ? "" : std::string(_columnPrefixCString);
+
+ DbmsJson::parseguideentries(_dataGuideJsonb, &guideEntries);
+ DbmsJson::buildcolumnsfromguide(guideEntries,
+ pathValue,
+ columnPrefix,
+ resolveNameConflicts,
+ mixedCaseColumns,
+ true,
+ &columns);
+
+ if (columns.empty()) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid data guide: no scalar fields found")));
+ }
+
+ ddlText = DbmsJson::buildddl(viewOwnerName,
+ viewName,
+ DbmsJson::buildselectsql(tableOwnerName,
+ tableName,
+ jsonColumnName,
+ pathValue,
+ columns,
+ materialize),
+ materialize,
+ mvRefreshMode);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.CREATE_VIEW ddl"),
+ errdetail("ddl=%s", ddlText.c_str())));
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON.CREATE_VIEW"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute(ddlText.c_str(), false, 0);
+ if (executeStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.CREATE_VIEW failed to execute DDL"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ SPI_finish();
+
+ if (_viewNameCString != nullptr) {
+ pfree(_viewNameCString);
+ }
+ if (_tableNameCString != nullptr) {
+ pfree(_tableNameCString);
+ }
+ if (_jsonColumnNameCString != nullptr) {
+ pfree(_jsonColumnNameCString);
+ }
+ if (_pathCString != nullptr) {
+ pfree(_pathCString);
+ }
+ if (_columnPrefixCString != nullptr) {
+ pfree(_columnPrefixCString);
+ }
+ if (_guideCString != nullptr) {
+ pfree(_guideCString);
+ }
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_json_create_view2(PG_FUNCTION_ARGS)
+{
+ int32 serviceArg = 0;
+
+ if (PG_NARGS() != 12) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON.CREATE_VIEW2 accepts exactly 12 arguments")));
+ }
+
+ if (!PG_ARGISNULL(11)) {
+ serviceArg = PG_GETARG_INT32(11);
+ }
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 11);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 11, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = PG_GETARG_DATUM(0);
+ fcinfo2->args[0].isnull = PG_ARGISNULL(0);
+ fcinfo2->args[1].value = PG_GETARG_DATUM(1);
+ fcinfo2->args[1].isnull = PG_ARGISNULL(1);
+ fcinfo2->args[2].value = PG_GETARG_DATUM(2);
+ fcinfo2->args[2].isnull = PG_ARGISNULL(2);
+ fcinfo2->args[3].value = PG_GETARG_DATUM(3);
+ fcinfo2->args[3].isnull = PG_ARGISNULL(3);
+ fcinfo2->args[4].value = PG_GETARG_DATUM(4);
+ fcinfo2->args[4].isnull = PG_ARGISNULL(4);
+ fcinfo2->args[5].value = PG_GETARG_DATUM(5);
+ fcinfo2->args[5].isnull = PG_ARGISNULL(5);
+ fcinfo2->args[6].value = PG_GETARG_DATUM(6);
+ fcinfo2->args[6].isnull = PG_ARGISNULL(6);
+ fcinfo2->args[7].value = PG_GETARG_DATUM(7);
+ fcinfo2->args[7].isnull = PG_ARGISNULL(7);
+ fcinfo2->args[8].value = PG_GETARG_DATUM(8);
+ fcinfo2->args[8].isnull = PG_ARGISNULL(8);
+ fcinfo2->args[9].value = PG_GETARG_DATUM(9);
+ fcinfo2->args[9].isnull = PG_ARGISNULL(9);
+ fcinfo2->args[10].value = PG_GETARG_DATUM(10);
+ fcinfo2->args[10].isnull = PG_ARGISNULL(10);
+
+ (void) dbms_json_create_view(fcinfo2);
+ }
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_json_drop_virtual_columns(PG_FUNCTION_ARGS)
+{
+ text *_tableNameText = PG_GETARG_TEXT_PP(0);
+ text *_jsonColumnNameText = PG_GETARG_TEXT_PP(1);
+ char *_tableNameCString = text_to_cstring(_tableNameText);
+ char *_jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ std::string ownerName;
+ std::string tableName;
+ std::string jsonColumnName;
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_SELECT;
+ std::string selectSql;
+ std::vector<std::string> columnNames;
+
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &ownerName,
+ &tableName,
+ &jsonColumnName);
+ selectSql =
+ "SELECT attname FROM pg_attribute a "
+ "JOIN pg_class c ON c.oid = a.attrelid "
+ "JOIN pg_namespace n ON n.oid = c.relnamespace "
+ "WHERE n.nspname = " + std::string(quote_literal_cstr(ownerName.c_str())) +
+ " AND c.relname = " + std::string(quote_literal_cstr(tableName.c_str())) +
+ " AND a.attnum > 0 AND NOT a.attisdropped "
+ " AND a.attgenerated <> ''";
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON.DROP_VIRTUAL_COLUMNS"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute(selectSql.c_str(), true, 0);
+ if (executeStatus != SPI_OK_SELECT) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.DROP_VIRTUAL_COLUMNS failed to read columns"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ for (uint64 rowIndex = 0; rowIndex < SPI_processed; ++rowIndex) {
+ HeapTuple rowTuple = SPI_tuptable->vals[rowIndex];
+ TupleDesc rowDesc = SPI_tuptable->tupdesc;
+ bool isNull = false;
+ Datum columnNameDatum = SPI_getbinval(rowTuple, rowDesc, 1, &isNull);
+ char *columnNameCString = pstrdup(NameStr(*DatumGetName(columnNameDatum)));
+
+ if (strcmp(columnNameCString, jsonColumnName.c_str()) != 0) {
+ columnNames.push_back(std::string(columnNameCString));
+ }
+
+ pfree(columnNameCString);
+ }
+
+ for (const std::string &columnName : columnNames) {
+ std::string dropSql =
+ "ALTER TABLE " + DbmsJson::buildqualifiedname(ownerName, tableName) +
+ " DROP COLUMN IF EXISTS " + std::string(quote_identifier(columnName.c_str()));
+ int dropStatus = SPI_execute(dropSql.c_str(), false, 0);
+
+ if (dropStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.DROP_VIRTUAL_COLUMNS failed"),
+ errdetail("column_name=%s, spi_status=%d",
+ columnName.c_str(),
+ dropStatus)));
+ }
+ }
+
+ SPI_finish();
+ pfree(_tableNameCString);
+ pfree(_jsonColumnNameCString);
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_json_json_type_convertible_check(PG_FUNCTION_ARGS)
+{
+ text *_ownerText = PG_GETARG_TEXT_PP(0);
+ text *_tableNameText = PG_GETARG_TEXT_PP(1);
+ text *_columnNameText = PG_GETARG_TEXT_PP(2);
+ text *_statusTableNameText = PG_GETARG_TEXT_PP(3);
+ bool fastCheck = PG_NARGS() > 4 && !PG_ARGISNULL(4) ? PG_GETARG_BOOL(4) : false;
+ bool appendStatus = PG_NARGS() > 5 && !PG_ARGISNULL(5) ? PG_GETARG_BOOL(5) : false;
+ char *_ownerCString = text_to_cstring(_ownerText);
+ char *_tableNameCString = text_to_cstring(_tableNameText);
+ char *_columnNameCString = text_to_cstring(_columnNameText);
+ char *_statusTableNameCString = text_to_cstring(_statusTableNameText);
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_UTILITY;
+ std::string ownerName;
+ std::string tableName;
+ std::string columnName;
+ std::string statusTableName;
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_ownerCString),
+ std::string(_tableNameCString),
+ std::string(_columnNameCString),
+ &ownerName,
+ &tableName,
+ &columnName);
+ statusTableName = DbmsJson::resolvestatusname(std::string(_statusTableNameCString));
+ std::string statusQualified = DbmsJson::buildqualifiedname(ownerName, statusTableName);
+ std::string createSql =
+ "CREATE TABLE IF NOT EXISTS " + statusQualified +
+ " (row_no bigint, is_convertible boolean, error_text text)";
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON.JSON_TYPE_CONVERTIBLE_CHECK"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute(createSql.c_str(), false, 0);
+ if (executeStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.JSON_TYPE_CONVERTIBLE_CHECK failed to create status table"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ if (!appendStatus) {
+ std::string truncateSql = "TRUNCATE TABLE " + statusQualified;
+ executeStatus = SPI_execute(truncateSql.c_str(), false, 0);
+ if (executeStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.JSON_TYPE_CONVERTIBLE_CHECK failed to truncate status table"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+ }
+
+ {
+ std::string inputTypeName = fastCheck ? "json" : "jsonb";
+ std::string insertSql =
+ "INSERT INTO " + statusQualified +
+ " SELECT row_number() OVER (), "
+ " pg_input_is_valid((" + std::string(quote_identifier(columnName.c_str())) + ")::text, " +
+ std::string(quote_literal_cstr(inputTypeName.c_str())) + "), "
+ " CASE "
+ " WHEN pg_input_is_valid((" + std::string(quote_identifier(columnName.c_str())) + ")::text, " +
+ std::string(quote_literal_cstr(inputTypeName.c_str())) + ") "
+ " THEN " + std::string(quote_literal_cstr("ok")) +
+ " ELSE (pg_input_error_info((" + std::string(quote_identifier(columnName.c_str())) + ")::text, " +
+ std::string(quote_literal_cstr(inputTypeName.c_str())) + ")).message "
+ " END " +
+ " FROM " + DbmsJson::buildqualifiedname(ownerName, tableName) +
+ " WHERE " + std::string(quote_identifier(columnName.c_str())) + " IS NOT NULL";
+
+ executeStatus = SPI_execute(insertSql.c_str(), false, 0);
+ if (executeStatus != SPI_OK_INSERT) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.JSON_TYPE_CONVERTIBLE_CHECK failed to populate status table"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+ }
+
+ SPI_finish();
+ pfree(_ownerCString);
+ pfree(_tableNameCString);
+ pfree(_columnNameCString);
+ pfree(_statusTableNameCString);
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_json_rename_column(PG_FUNCTION_ARGS)
+{
+ text *_tableNameText = PG_ARGISNULL(0) ? nullptr : PG_GETARG_TEXT_PP(0);
+ text *_jsonColumnNameText = PG_ARGISNULL(1) ? nullptr : PG_GETARG_TEXT_PP(1);
+ text *_pathText = PG_ARGISNULL(2) ? nullptr : PG_GETARG_TEXT_PP(2);
+ int32 typeCode = PG_ARGISNULL(3) ? 0 : PG_GETARG_INT32(3);
+ text *_preferredNameText = PG_ARGISNULL(4) ? nullptr : PG_GETARG_TEXT_PP(4);
+ char *_tableNameCString = nullptr;
+ char *_jsonColumnNameCString = nullptr;
+ char *_pathCString = nullptr;
+ char *_preferredNameCString = nullptr;
+ Oid argTypes[5] = {TEXTOID, TEXTOID, TEXTOID, TEXTOID, TEXTOID};
+ Datum values[5];
+ const char nulls[5] = {' ', ' ', ' ', ' ', ' '};
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_INSERT;
+ std::string metadataOwnerName;
+ std::string tableOwnerName;
+ std::string tableName;
+ std::string jsonColumnName;
+ std::string jsonType;
+ std::string upsertSql;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.RENAME_COLUMN call"),
+ errdetail("tablename_is_null=%s, jcolname_is_null=%s, path_is_null=%s, type=%d, preferred_name_is_null=%s",
+ _tableNameText == nullptr ? "true" : "false",
+ _jsonColumnNameText == nullptr ? "true" : "false",
+ _pathText == nullptr ? "true" : "false",
+ typeCode,
+ _preferredNameText == nullptr ? "true" : "false")));
+
+ if (_tableNameText == nullptr || _jsonColumnNameText == nullptr ||
+ _pathText == nullptr || _preferredNameText == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_JSON.RENAME_COLUMN does not allow NULL arguments")));
+ }
+
+ jsonType = DbmsJson::resolvejsontypenamefromcode(typeCode);
+ if (jsonType.empty()) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON.RENAME_COLUMN invalid type code"),
+ errdetail("type=%d", typeCode)));
+ }
+
+ _tableNameCString = text_to_cstring(_tableNameText);
+ _jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ _pathCString = text_to_cstring(_pathText);
+ _preferredNameCString = text_to_cstring(_preferredNameText);
+
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &tableOwnerName,
+ &tableName,
+ &jsonColumnName);
+ metadataOwnerName = DbmsJson::resolveownername();
+ DbmsJson::ensuremetadatatable(metadataOwnerName);
+
+ upsertSql =
+ "INSERT INTO " + DbmsJson::buildmetadataqualifiedname(metadataOwnerName) +
+ " (tablename, jcolname, path, json_type, preferred_name) "
+ "VALUES ($1, $2, $3, $4, $5) "
+ "ON CONFLICT (tablename, jcolname, path, json_type) "
+ "DO UPDATE SET preferred_name = EXCLUDED.preferred_name";
+
+ values[0] = CStringGetTextDatum(tableName.c_str());
+ values[1] = CStringGetTextDatum(jsonColumnName.c_str());
+ values[2] = CStringGetTextDatum(_pathCString);
+ values[3] = CStringGetTextDatum(jsonType.c_str());
+ values[4] = CStringGetTextDatum(_preferredNameCString);
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON.RENAME_COLUMN"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute_with_args(upsertSql.c_str(),
+ 5,
+ argTypes,
+ values,
+ nulls,
+ false,
+ 0);
+ if (executeStatus != SPI_OK_INSERT && executeStatus != SPI_OK_UPDATE) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.RENAME_COLUMN failed"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ SPI_finish();
+
+ if (_tableNameCString != nullptr) {
+ pfree(_tableNameCString);
+ }
+ if (_jsonColumnNameCString != nullptr) {
+ pfree(_jsonColumnNameCString);
+ }
+ if (_pathCString != nullptr) {
+ pfree(_pathCString);
+ }
+ if (_preferredNameCString != nullptr) {
+ pfree(_preferredNameCString);
+ }
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_json_create_view_on_path(PG_FUNCTION_ARGS)
+{
+ text *_viewNameText = PG_ARGISNULL(0) ? nullptr : PG_GETARG_TEXT_PP(0);
+ text *_tableNameText = PG_ARGISNULL(1) ? nullptr : PG_GETARG_TEXT_PP(1);
+ text *_jsonColumnNameText = PG_ARGISNULL(2) ? nullptr : PG_GETARG_TEXT_PP(2);
+ text *_pathText = PG_ARGISNULL(3) ? nullptr : PG_GETARG_TEXT_PP(3);
+ int32 frequency = PG_ARGISNULL(4) ? 0 : PG_GETARG_INT32(4);
+ char *_viewNameCString = nullptr;
+ char *_tableNameCString = nullptr;
+ char *_jsonColumnNameCString = nullptr;
+ char *_pathCString = nullptr;
+ std::string viewOwnerName;
+ std::string tableOwnerName;
+ std::string metadataOwnerName;
+ Jsonb *guideJsonb = nullptr;
+ std::vector<DbmsJson::GuideEntry> guideEntries;
+ std::vector<DbmsJson::ColumnSpec> columns;
+ std::string ddlText;
+ int spiStatus = SPI_OK_CONNECT;
+ int executeStatus = SPI_OK_UTILITY;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON.CREATE_VIEW_ON_PATH call"),
+ errdetail("viewname_is_null=%s, tablename_is_null=%s, jcolname_is_null=%s, path_is_null=%s, frequency=%d",
+ _viewNameText == nullptr ? "true" : "false",
+ _tableNameText == nullptr ? "true" : "false",
+ _jsonColumnNameText == nullptr ? "true" : "false",
+ _pathText == nullptr ? "true" : "false",
+ frequency)));
+
+ if (_viewNameText == nullptr || _tableNameText == nullptr ||
+ _jsonColumnNameText == nullptr || _pathText == nullptr) {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_JSON.CREATE_VIEW_ON_PATH does not allow NULL required arguments")));
+ }
+
+ if (frequency != 0) {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_JSON.CREATE_VIEW_ON_PATH frequency is not supported in simplified mode"),
+ errdetail("frequency=%d", frequency)));
+ }
+
+ _viewNameCString = text_to_cstring(_viewNameText);
+ _tableNameCString = text_to_cstring(_tableNameText);
+ _jsonColumnNameCString = text_to_cstring(_jsonColumnNameText);
+ _pathCString = text_to_cstring(_pathText);
+
+ viewOwnerName = DbmsJson::resolveownername();
+ std::string tableName;
+ std::string jsonColumnName;
+ DbmsJson::normalizeexistingtableandcolumn(std::string(_tableNameCString),
+ std::string(_jsonColumnNameCString),
+ &tableOwnerName,
+ &tableName,
+ &jsonColumnName);
+ metadataOwnerName = viewOwnerName;
+ DbmsJson::ensuremetadatatable(metadataOwnerName);
+ guideJsonb = DbmsJson::builddataguidefortable(tableOwnerName,
+ tableName,
+ jsonColumnName);
+ DbmsJson::parseguideentries(guideJsonb, &guideEntries);
+ DbmsJson::applypreferrednames(metadataOwnerName,
+ tableName,
+ jsonColumnName,
+ &guideEntries);
+ DbmsJson::buildcolumnsfromguide(guideEntries,
+ std::string(_pathCString),
+ "",
+ true,
+ false,
+ true,
+ &columns);
+
+ if (columns.empty()) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON.CREATE_VIEW_ON_PATH found no scalar fields"),
+ errdetail("path=%s", _pathCString)));
+ }
+
+ ddlText = DbmsJson::buildddl(viewOwnerName,
+ DbmsJson::normalizeidentifierinput(std::string(_viewNameCString)),
+ DbmsJson::buildselectsql(tableOwnerName,
+ tableName,
+ jsonColumnName,
+ std::string(_pathCString),
+ columns,
+ false),
+ false,
+ DBMS_JSON_MV_REFRESH_ON_STATEMENT);
+
+ spiStatus = SPI_connect();
+ if (spiStatus != SPI_OK_CONNECT) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI_connect failed in DBMS_JSON.CREATE_VIEW_ON_PATH"),
+ errdetail("spi_status=%d", spiStatus)));
+ }
+
+ executeStatus = SPI_execute(ddlText.c_str(), false, 0);
+ if (executeStatus != SPI_OK_UTILITY) {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON.CREATE_VIEW_ON_PATH failed"),
+ errdetail("spi_status=%d", executeStatus)));
+ }
+
+ SPI_finish();
+
+ if (_viewNameCString != nullptr) {
+ pfree(_viewNameCString);
+ }
+ if (_tableNameCString != nullptr) {
+ pfree(_tableNameCString);
+ }
+ if (_jsonColumnNameCString != nullptr) {
+ pfree(_jsonColumnNameCString);
+ }
+ if (_pathCString != nullptr) {
+ pfree(_pathCString);
+ }
+
+ PG_RETURN_VOID();
+}
+
diff --git a/src/backend/utils/dbms/dbms_json/dbms_json.hpp b/src/backend/utils/dbms/dbms_json/dbms_json.hpp
new file mode 100644
index 0000000..2f717cb
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json/dbms_json.hpp
@@ -0,0 +1,24 @@
+#ifndef DBMS_JSON_INTERNAL_HPP
+#define DBMS_JSON_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+}
+
+extern "C"
+{
+Datum dbms_json_build_dataguide(PG_FUNCTION_ARGS);
+Datum dbms_json_get_index_dataguide(PG_FUNCTION_ARGS);
+Datum dbms_json_get_view_sql(PG_FUNCTION_ARGS);
+Datum dbms_json_add_virtual_columns(PG_FUNCTION_ARGS);
+Datum dbms_json_create_view(PG_FUNCTION_ARGS);
+Datum dbms_json_create_view2(PG_FUNCTION_ARGS);
+Datum dbms_json_drop_virtual_columns(PG_FUNCTION_ARGS);
+Datum dbms_json_json_type_convertible_check(PG_FUNCTION_ARGS);
+Datum dbms_json_rename_column(PG_FUNCTION_ARGS);
+Datum dbms_json_create_view_on_path(PG_FUNCTION_ARGS);
+}
+
+#endif // DBMS_JSON_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_json/dbms_json_oracle.sql b/src/backend/utils/dbms/dbms_json/dbms_json_oracle.sql
new file mode 100644
index 0000000..fbd279c
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json/dbms_json_oracle.sql
@@ -0,0 +1,127 @@
+-- Тест 1: Элементарный тест (создание простого представления)
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}';
+ v_res CLOB;
+ v_exp CLOB := 'CREATE OR REPLACE VIEW "HR"."V1" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"id" number path ''$.id'')JT';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL('V1', 'T1', 'J1', v_dg);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 2: Перегрузка с NULL (возвращает только SELECT)
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}';
+ v_res CLOB;
+ v_exp CLOB := 'SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"id" number path ''$.id'')JT';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL(NULL, 'T1', 'J1', v_dg);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 3: Граничное условие (пустой набор узлов в Data Guide)
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{}}';
+ v_res CLOB;
+ v_exp CLOB := '';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL('V_EMPTY', 'T1', 'J1', v_dg);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 4: Тест посложнее (несколько завершённых узлов)
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{"a":{"type":"number","o:length":4,"o:preferred_column_name":"a"},"b":{"type":"string","o:length":10,"o:preferred_column_name":"b"}}}';
+ v_res CLOB;
+ v_exp CLOB := 'CREATE OR REPLACE VIEW "HR"."V_MULTI" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"a" number path ''$.a'',
+"b" varchar2(10) path ''$.b'')JT';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL('V_MULTI', 'T1', 'J1', v_dg);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 5: Исправлено (параметр path требует наличия этого пути в структуре Data Guide)
+SET SERVEROUTPUT ON
+DECLARE
+ -- Чтобы path => '$.info' сработал, DG должен описывать структуру внутри 'info'
+ v_dg CLOB := '{"type":"object","properties":{"info":{"type":"object","properties":{"val":{"type":"number","o:length":4,"o:preferred_column_name":"val"}}}}}';
+ v_res CLOB;
+ v_exp CLOB := 'CREATE OR REPLACE VIEW "HR"."V_PATH" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$.info[*]'' COLUMNS
+"val" number path ''$.val'')JT';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL('V_PATH', 'T1', 'J1', v_dg, path => '$.info');
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 6: Исправлено (параметр materialize => TRUE с точным соответствием вывода 23ai)
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}';
+ v_res CLOB;
+ -- В упрощенной реализации добавляются опции MV и ROWID.
+ v_exp CLOB := 'CREATE MATERIALIZED VIEW "HR"."V_MV" BUILD IMMEDIATE REFRESH FAST ON STATEMENT WITH ROWID
+AS SELECT RT."ROWID" ROW_ID, JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"id" number path ''$.id'')JT';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL('V_MV', 'T1', 'J1', v_dg, materialize => TRUE);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 7: Исключение при ошибке логики (конфликт имен при resolvenameconflicts => FALSE)
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{"f1":{"type":"number","o:length":4,"o:preferred_column_name":"col"},"f2":{"type":"number","o:length":4,"o:preferred_column_name":"col"}}}';
+ v_res CLOB;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ v_res := DBMS_JSON.GET_VIEW_SQL('V_ERR', 'T1', 'J1', v_dg, resolvenameconflicts => FALSE);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- Тест 8: Параметр colnameprefix
+SET SERVEROUTPUT ON
+DECLARE
+ v_dg CLOB := '{"type":"object","properties":{"item":{"type":"number","o:length":4,"o:preferred_column_name":"item"}}}';
+ v_res CLOB;
+ v_exp CLOB := 'CREATE OR REPLACE VIEW "HR"."V_PRE" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"P_item" number path ''$.item'')JT';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: ' || v_exp);
+ v_res := DBMS_JSON.GET_VIEW_SQL('V_PRE', 'T1', 'J1', v_dg, colnameprefix => 'P_');
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
diff --git a/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.cpp b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.cpp
new file mode 100644
index 0000000..d115f97
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.cpp
@@ -0,0 +1,762 @@
+#include "dbms_json_schema.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/fmgroids.h"
+#include "utils/jsonb.h"
+#include "funcapi.h"
+} // extern "C"
+
+#include "../nlohmann/json-schema.hpp"
+
+#include <algorithm>
+#include <exception>
+#include <memory>
+#include <set>
+#include <string>
+#include <cstring>
+#include <vector>
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_json_schema_is_schema_valid);
+PG_FUNCTION_INFO_V1(dbms_json_schema_is_schema_valid2);
+PG_FUNCTION_INFO_V1(dbms_json_schema_is_valid);
+PG_FUNCTION_INFO_V1(dbms_json_schema_validate_report);
+PG_FUNCTION_INFO_V1(dbms_json_schema_get_version);
+}
+
+#define RUDB_DBMS_JSON_SCHEMA_VERSION "1.0.0"
+#define DBMS_JSON_SCHEMA_VALID 1
+#define DBMS_JSON_SCHEMA_INVALID 0
+#define DBMS_JSON_SCHEMA_RAISE_NONE 0
+#define DBMS_JSON_SCHEMA_RAISE_ERROR 1
+
+namespace DbmsJsonSchema
+{
+using JsonDocument = nlohmann::json;
+using JsonValidator = nlohmann::json_schema::json_validator;
+
+struct ValidationIssue
+{
+ std::string schemaPath_;
+ std::string instancePath_;
+ std::string code_;
+ std::string error_;
+};
+
+struct ValidationResult
+{
+ bool schemaValid_{false};
+ bool dataValid_{false};
+ JsonDocument errorsReport_;
+ std::string reportText_;
+};
+
+class CollectingErrorHandler : public nlohmann::json_schema::error_handler
+{
+public:
+ explicit CollectingErrorHandler(const JsonDocument *schema_document)
+ : schemaDocument_(schema_document)
+ {
+ }
+
+ std::vector<ValidationIssue> issues_;
+
+ void error(const nlohmann::json::json_pointer &ptr,
+ const JsonDocument &instance,
+ const std::string &message) override
+ {
+ issues_.push_back(buildIssue(ptr, schemaDocument_, instance, message));
+ }
+
+private:
+ const JsonDocument *schemaDocument_{nullptr};
+
+ static bool
+ isnumerictoken(const std::string &token)
+ {
+ return !token.empty() &&
+ std::all_of(token.begin(), token.end(), [](unsigned char ch) { return std::isdigit(ch) != 0; });
+ }
+
+ static std::vector<std::string>
+ splitpointertokens(const nlohmann::json::json_pointer &ptr)
+ {
+ std::vector<std::string> tokens;
+ std::string pointerString = ptr.to_string();
+
+ if (pointerString.empty()) {
+ return tokens;
+ }
+
+ std::size_t startPos = 1;
+
+ while (startPos <= pointerString.size()) {
+ std::size_t slashPos = pointerString.find('/', startPos);
+ std::string token = pointerString.substr(startPos, slashPos - startPos);
+
+ std::size_t replacePos = 0;
+ while ((replacePos = token.find("~1", replacePos)) != std::string::npos) {
+ token.replace(replacePos, 2, "/");
+ replacePos += 1;
+ }
+
+ replacePos = 0;
+ while ((replacePos = token.find("~0", replacePos)) != std::string::npos) {
+ token.replace(replacePos, 2, "~");
+ replacePos += 1;
+ }
+
+ tokens.push_back(token);
+
+ if (slashPos == std::string::npos) {
+ break;
+ }
+
+ startPos = slashPos + 1;
+ }
+
+ return tokens;
+ }
+
+ static std::string
+ buildpropertyschemapath(const std::vector<std::string> &tokens,
+ bool appendType,
+ bool parentOnly)
+ {
+ std::string schemaPath = "$";
+ std::size_t limit = tokens.size();
+
+ if (parentOnly && limit > 0) {
+ limit -= 1;
+ }
+
+ for (std::size_t index = 0; index < limit; ++index) {
+ if (isnumerictoken(tokens[index])) {
+ schemaPath += ".items";
+ } else {
+ schemaPath += ".properties." + tokens[index];
+ }
+ }
+
+ if (parentOnly) {
+ schemaPath += ".properties";
+ } else if (appendType) {
+ schemaPath += ".type";
+ }
+
+ return schemaPath;
+ }
+
+ static std::string
+ jsonpointertostring(const nlohmann::json::json_pointer &ptr)
+ {
+ std::vector<std::string> tokens = splitpointertokens(ptr);
+ std::string pointerString = "$";
+
+ for (const std::string &token : tokens) {
+ if (isnumerictoken(token)) {
+ pointerString += "[" + token + "]";
+ } else {
+ pointerString += "." + token;
+ }
+ }
+
+ return pointerString;
+ }
+
+ static std::string
+ jsonvaluetypename(const JsonDocument &value)
+ {
+ switch (value.type()) {
+ case JsonDocument::value_t::null:
+ return "null";
+ case JsonDocument::value_t::object:
+ return "object";
+ case JsonDocument::value_t::array:
+ return "array";
+ case JsonDocument::value_t::string:
+ return "string";
+ case JsonDocument::value_t::boolean:
+ return "boolean";
+ case JsonDocument::value_t::number_integer:
+ case JsonDocument::value_t::number_unsigned:
+ case JsonDocument::value_t::number_float:
+ return "number";
+ case JsonDocument::value_t::binary:
+ return "binary";
+ case JsonDocument::value_t::discarded:
+ return "discarded";
+ }
+
+ return "unknown";
+ }
+
+ static std::string
+ resolveexpectedtypefromschema(const JsonDocument *schema_document,
+ const std::vector<std::string> &tokens)
+ {
+ const JsonDocument *currentNode = schema_document;
+
+ if (currentNode == nullptr) {
+ return "";
+ }
+
+ for (const std::string &token : tokens) {
+ if (isnumerictoken(token)) {
+ if (!currentNode->is_object() || !currentNode->contains("items")) {
+ return "";
+ }
+
+ currentNode = &(*currentNode)["items"];
+ } else {
+ if (!currentNode->is_object() || !currentNode->contains("properties")) {
+ return "";
+ }
+
+ const JsonDocument &propertiesNode = (*currentNode)["properties"];
+ if (!propertiesNode.is_object() || !propertiesNode.contains(token)) {
+ return "";
+ }
+
+ currentNode = &propertiesNode[token];
+ }
+ }
+
+ if (!currentNode->is_object() || !currentNode->contains("type")) {
+ return "";
+ }
+
+ if ((*currentNode)["type"].is_string()) {
+ return (*currentNode)["type"].get<std::string>();
+ }
+
+ return "";
+ }
+
+ static ValidationIssue
+ buildIssue(const nlohmann::json::json_pointer &ptr,
+ const JsonDocument *schema_document,
+ const JsonDocument &instance,
+ const std::string &message)
+ {
+ ValidationIssue issue;
+ std::vector<std::string> tokens = splitpointertokens(ptr);
+
+ issue.instancePath_ = jsonpointertostring(ptr);
+ issue.schemaPath_ = "$";
+
+ if (message.rfind("unexpected instance type", 0) == 0) {
+ std::string expectedType = resolveexpectedtypefromschema(schema_document, tokens);
+
+ issue.code_ = "JZN-00503";
+ issue.schemaPath_ = buildpropertyschemapath(tokens, true, false);
+ issue.error_ = "invalid type found, actual: " + jsonvaluetypename(instance) +
+ ", expected: " + (expectedType.empty() ? "unknown" : expectedType);
+ } else if (message.rfind("required property '", 0) == 0) {
+ issue.code_ = "JZN-00515";
+ issue.schemaPath_ = "$.required";
+ issue.error_ = message;
+ } else if (message.rfind("validation failed for additional property '", 0) == 0) {
+ issue.code_ = "JZN-00514";
+ issue.error_ = message;
+ } else {
+ issue.code_ = "JZN-00501";
+ issue.error_ = message;
+ }
+
+ return issue;
+ }
+};
+
+static void
+noopFormatCheck(const std::string &format_name, const std::string &format_value)
+{
+ (void) format_name;
+ (void) format_value;
+}
+
+static void
+noopContentCheck(const std::string &content_encoding,
+ const std::string &content_media_type,
+ const JsonDocument &instance_value)
+{
+ (void) content_encoding;
+ (void) content_media_type;
+ (void) instance_value;
+}
+
+static char *
+jsonbtocstringcopy(Jsonb *jsonb_value)
+{
+ char *jsonCString = JsonbToCString(NULL, &jsonb_value->root, VARSIZE(jsonb_value));
+
+ if (jsonCString == nullptr)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_JSON_SCHEMA.IS_SCHEMA_VALID failed to serialize jsonb")));
+ }
+
+ return jsonCString;
+}
+
+static JsonDocument
+parsejsondocument(const char *json_data)
+{
+ try {
+ return JsonDocument::parse(json_data);
+ } catch (const std::exception &ex) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
+ errmsg("invalid JSON input"),
+ errdetail("%s", ex.what())));
+ }
+
+ return JsonDocument();
+}
+
+static bool
+isschemavaliddocument(const JsonDocument &schemaDocument)
+{
+ JsonValidator metaValidator(nullptr, noopFormatCheck, noopContentCheck);
+ nlohmann::json_schema::basic_error_handler metaErrorHandler;
+ JsonValidator validator(nullptr, noopFormatCheck, noopContentCheck);
+
+ metaValidator.set_root_schema(nlohmann::json_schema::draft7_schema_builtin);
+ metaValidator.validate(schemaDocument, metaErrorHandler);
+
+ if (metaErrorHandler) {
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA schema meta-validation"),
+ errdetail("status=invalid")));
+ return false;
+ }
+
+ validator.set_root_schema(schemaDocument);
+ return true;
+}
+
+static JsonDocument
+builderrorsreport(const CollectingErrorHandler &errorHandler)
+{
+ JsonDocument reportDocument = JsonDocument::object();
+ JsonDocument issuesArray = JsonDocument::array();
+ std::set<std::string> invalidProperties;
+
+ reportDocument["valid"] = errorHandler.issues_.empty();
+
+ if (!errorHandler.issues_.empty()) {
+ JsonDocument rootIssue = JsonDocument::object();
+ rootIssue["schemaPath"] = "$";
+ rootIssue["instancePath"] = "$";
+ rootIssue["code"] = "JZN-00501";
+ rootIssue["error"] = "JSON schema validation failed";
+ issuesArray.push_back(rootIssue);
+ }
+
+ for (const ValidationIssue &issue : errorHandler.issues_) {
+ if (issue.code_ == "JZN-00503" &&
+ issue.instancePath_.rfind("$.", 0) == 0) {
+ invalidProperties.insert(issue.instancePath_.substr(2));
+ }
+ }
+
+ for (const std::string &invalidProperty : invalidProperties) {
+ JsonDocument propertyIssue = JsonDocument::object();
+ propertyIssue["schemaPath"] = "$.properties";
+ propertyIssue["instancePath"] = "$";
+ propertyIssue["code"] = "JZN-00514";
+ propertyIssue["error"] = "invalid properties: ''" + invalidProperty + "''";
+ issuesArray.push_back(propertyIssue);
+ }
+
+ for (const ValidationIssue &issue : errorHandler.issues_) {
+ JsonDocument issueDocument = JsonDocument::object();
+ issueDocument["schemaPath"] = issue.schemaPath_;
+ issueDocument["instancePath"] = issue.instancePath_;
+ issueDocument["code"] = issue.code_;
+ issueDocument["error"] = issue.error_;
+ issuesArray.push_back(issueDocument);
+ }
+
+ reportDocument["errors"] = issuesArray;
+
+ return reportDocument;
+}
+
+static std::string
+jsonquotestring(const std::string &value)
+{
+ return JsonDocument(value).dump();
+}
+
+static std::string
+serializereporttext(const CollectingErrorHandler &errorHandler)
+{
+ std::string reportText = "{\"valid\":";
+ std::set<std::string> invalidProperties;
+
+ reportText += errorHandler.issues_.empty() ? "true" : "false";
+ reportText += ",\"errors\":[";
+
+ if (!errorHandler.issues_.empty()) {
+ reportText += "{\"schemaPath\":\"$\",\"instancePath\":\"$\",\"code\":\"JZN-00501\",\"error\":\"JSON schema validation failed\"}";
+ }
+
+ for (const ValidationIssue &issue : errorHandler.issues_) {
+ if (issue.code_ == "JZN-00503" &&
+ issue.instancePath_.rfind("$.", 0) == 0) {
+ invalidProperties.insert(issue.instancePath_.substr(2));
+ }
+ }
+
+ for (const std::string &invalidProperty : invalidProperties) {
+ if (reportText.back() != '[') {
+ reportText += ",";
+ }
+
+ reportText += "{\"schemaPath\":\"$.properties\",\"instancePath\":\"$\",\"code\":\"JZN-00514\",\"error\":";
+ reportText += jsonquotestring("invalid properties:\n'" + invalidProperty + "'");
+ reportText += "}";
+ }
+
+ for (const ValidationIssue &issue : errorHandler.issues_) {
+ if (reportText.back() != '[') {
+ reportText += ",";
+ }
+
+ reportText += "{\"schemaPath\":";
+ reportText += jsonquotestring(issue.schemaPath_);
+ reportText += ",\"instancePath\":";
+ reportText += jsonquotestring(issue.instancePath_);
+ reportText += ",\"code\":";
+ reportText += jsonquotestring(issue.code_);
+ reportText += ",\"error\":";
+ reportText += jsonquotestring(issue.error_);
+ reportText += "}";
+ }
+
+ reportText += "]}";
+ return reportText;
+}
+
+static ValidationResult
+validatejsondocument(const JsonDocument &dataDocument,
+ const JsonDocument &schemaDocument)
+{
+ ValidationResult result;
+ JsonValidator validator(nullptr, noopFormatCheck, noopContentCheck);
+ CollectingErrorHandler errorHandler(&schemaDocument);
+
+ result.schemaValid_ = isschemavaliddocument(schemaDocument);
+
+ if (!result.schemaValid_) {
+ result.dataValid_ = false;
+ result.errorsReport_ = JsonDocument::object({
+ {"valid", false},
+ {"errors", JsonDocument::array()}
+ });
+ return result;
+ }
+
+ validator.set_root_schema(schemaDocument);
+ validator.validate(dataDocument, errorHandler);
+
+ result.dataValid_ = errorHandler.issues_.empty();
+ result.errorsReport_ = builderrorsreport(errorHandler);
+ result.reportText_ = serializereporttext(errorHandler);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA validation result"),
+ errdetail("schema_valid=%s, data_valid=%s, issues=%zu",
+ result.schemaValid_ ? "true" : "false",
+ result.dataValid_ ? "true" : "false",
+ errorHandler.issues_.size())));
+
+ return result;
+}
+
+static ValidationResult
+validatecstringinput(const char *json_data,
+ const char *json_schema)
+{
+ JsonDocument dataDocument = parsejsondocument(json_data);
+ JsonDocument schemaDocument = parsejsondocument(json_schema);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA validation text input"),
+ errdetail("json_length=%zu, schema_length=%zu",
+ strlen(json_data),
+ strlen(json_schema))));
+
+ return validatejsondocument(dataDocument, schemaDocument);
+}
+
+static Jsonb *
+jsondocumenttojsonb(const JsonDocument &document)
+{
+ std::string jsonText = document.dump();
+ Datum jsonbDatum = DirectFunctionCall1(jsonb_in, CStringGetDatum(jsonText.c_str()));
+
+ return DatumGetJsonbP(jsonbDatum);
+}
+
+static text *
+jsondocumenttotext(const JsonDocument &document)
+{
+ return cstring_to_text(document.dump(-1, ' ', false, JsonDocument::error_handler_t::strict).c_str());
+}
+
+static bool
+isschemavalidinternal(Jsonb *json_schema)
+{
+ char *jsonCString = jsonbtocstringcopy(json_schema);
+ JsonDocument schemaDocument;
+ bool resultValue = false;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.IS_SCHEMA_VALID input"),
+ errdetail("schema_length=%zu", strlen(jsonCString))));
+
+ schemaDocument = parsejsondocument(jsonCString);
+ resultValue = isschemavaliddocument(schemaDocument);
+
+ if (!resultValue) {
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.IS_SCHEMA_VALID meta-schema check"),
+ errdetail("status=invalid")));
+ } else {
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.IS_SCHEMA_VALID result"),
+ errdetail("status=valid")));
+ }
+
+ if (jsonCString != nullptr) {
+ pfree(jsonCString);
+ }
+
+ return resultValue;
+}
+
+static ValidationResult
+isvalidinternal(Jsonb *json_data,
+ Jsonb *json_schema)
+{
+ char *dataCString = jsonbtocstringcopy(json_data);
+ char *schemaCString = jsonbtocstringcopy(json_schema);
+ JsonDocument dataDocument;
+ JsonDocument schemaDocument;
+ ValidationResult validationResult;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.IS_VALID input"),
+ errdetail("json_length=%zu, schema_length=%zu",
+ strlen(dataCString),
+ strlen(schemaCString))));
+
+ dataDocument = parsejsondocument(dataCString);
+ schemaDocument = parsejsondocument(schemaCString);
+ validationResult = validatejsondocument(dataDocument, schemaDocument);
+
+ if (dataCString != nullptr) {
+ pfree(dataCString);
+ }
+
+ if (schemaCString != nullptr) {
+ pfree(schemaCString);
+ }
+
+ return validationResult;
+}
+} // namespace DbmsJsonSchema
+
+/*
+ * @qdb_func: dbms_json_schema_is_schema_valid(jsonb)
+ * @ora_func: DBMS_JSON_SCHEMA.IS_SCHEMA_VALID(JSON)
+ */
+Datum
+dbms_json_schema_is_schema_valid(PG_FUNCTION_ARGS)
+{
+ Jsonb *jsonSchema = nullptr;
+ bool isValid = false;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.IS_SCHEMA_VALID call"),
+ errdetail("nargs=%d, arg0_is_null=%s",
+ PG_NARGS(),
+ PG_ARGISNULL(0) ? "true" : "false")));
+
+ if (PG_ARGISNULL(0)) {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-64403: input cannot be NULL")));
+ }
+
+ jsonSchema = PG_GETARG_JSONB_P_COPY(0);
+ isValid = DbmsJsonSchema::isschemavalidinternal(jsonSchema);
+
+ if (jsonSchema != nullptr) {
+ pfree(jsonSchema);
+ }
+
+ PG_RETURN_INT32(isValid ? DBMS_JSON_SCHEMA_VALID : DBMS_JSON_SCHEMA_INVALID);
+}
+
+Datum
+dbms_json_schema_is_schema_valid2(PG_FUNCTION_ARGS)
+{
+ int32 serviceArg = 0;
+
+ if (PG_NARGS() != 2) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON_SCHEMA.IS_SCHEMA_VALID2 accepts exactly 2 arguments")));
+ }
+
+ if (!PG_ARGISNULL(1)) {
+ serviceArg = PG_GETARG_INT32(1);
+ }
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 1);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 1, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = PG_GETARG_DATUM(0);
+ fcinfo2->args[0].isnull = PG_ARGISNULL(0);
+
+ return dbms_json_schema_is_schema_valid(fcinfo2);
+ }
+}
+
+Datum
+dbms_json_schema_is_valid(PG_FUNCTION_ARGS)
+{
+ Jsonb *jsonData = nullptr;
+ Jsonb *jsonSchema = nullptr;
+ int32 raiseErr = DBMS_JSON_SCHEMA_RAISE_NONE;
+ DbmsJsonSchema::ValidationResult validationResult;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.IS_VALID function call"),
+ errdetail("nargs=%d, arg0_is_null=%s, arg1_is_null=%s, arg2_is_null=%s",
+ PG_NARGS(),
+ PG_ARGISNULL(0) ? "true" : "false",
+ PG_ARGISNULL(1) ? "true" : "false",
+ (PG_NARGS() > 2 && PG_ARGISNULL(2)) ? "true" : "false")));
+
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1)) {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-64403: input cannot be NULL")));
+ }
+
+ if (PG_NARGS() > 2 && !PG_ARGISNULL(2)) {
+ raiseErr = PG_GETARG_INT32(2);
+ }
+
+ if (raiseErr != DBMS_JSON_SCHEMA_RAISE_NONE &&
+ raiseErr != DBMS_JSON_SCHEMA_RAISE_ERROR) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("DBMS_JSON_SCHEMA.IS_VALID invalid raise_err"),
+ errdetail("raise_err=%d", raiseErr)));
+ }
+
+ jsonData = PG_GETARG_JSONB_P_COPY(0);
+ jsonSchema = PG_GETARG_JSONB_P_COPY(1);
+
+ validationResult = DbmsJsonSchema::isvalidinternal(jsonData, jsonSchema);
+
+ if (jsonData != nullptr) {
+ pfree(jsonData);
+ }
+
+ if (jsonSchema != nullptr) {
+ pfree(jsonSchema);
+ }
+
+ if (!validationResult.schemaValid_ &&
+ raiseErr == DBMS_JSON_SCHEMA_RAISE_ERROR) {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("JSON schema validation failed"),
+ errdetail("raise_err=RAISE_ERROR requested exception for invalid schema")));
+ }
+
+ PG_RETURN_INT32(validationResult.dataValid_ ? DBMS_JSON_SCHEMA_VALID
+ : DBMS_JSON_SCHEMA_INVALID);
+}
+
+Datum
+dbms_json_schema_validate_report(PG_FUNCTION_ARGS)
+{
+ char *jsonSchemaCString = nullptr;
+ Jsonb *jsonDataJsonb = nullptr;
+ Jsonb *jsonSchemaJsonb = nullptr;
+ char *jsonDataCString = nullptr;
+ DbmsJsonSchema::ValidationResult validationResult;
+ bool useJsonbInput = false;
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.VALIDATE_REPORT call"),
+ errdetail("nargs=%d, arg0_is_null=%s, arg1_is_null=%s",
+ PG_NARGS(),
+ PG_ARGISNULL(0) ? "true" : "false",
+ PG_ARGISNULL(1) ? "true" : "false")));
+
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1)) {
+ PG_RETURN_NULL();
+ }
+
+ useJsonbInput =
+ get_fn_expr_argtype(fcinfo->flinfo, 0) == JSONBOID &&
+ get_fn_expr_argtype(fcinfo->flinfo, 1) == JSONBOID;
+
+ if (useJsonbInput) {
+ jsonDataJsonb = PG_GETARG_JSONB_P_COPY(0);
+ jsonSchemaJsonb = PG_GETARG_JSONB_P_COPY(1);
+ jsonDataCString = DbmsJsonSchema::jsonbtocstringcopy(jsonDataJsonb);
+ jsonSchemaCString = DbmsJsonSchema::jsonbtocstringcopy(jsonSchemaJsonb);
+ } else {
+ text *jsonDataText = PG_GETARG_TEXT_PP(0);
+ text *jsonSchemaText = PG_GETARG_TEXT_PP(1);
+ jsonDataCString = text_to_cstring(jsonDataText);
+ jsonSchemaCString = text_to_cstring(jsonSchemaText);
+ }
+
+ validationResult = DbmsJsonSchema::validatecstringinput(jsonDataCString, jsonSchemaCString);
+
+ ereport(LOG,
+ (errmsg("DBMS_JSON_SCHEMA.VALIDATE_REPORT result"),
+ errdetail("valid=%s",
+ validationResult.dataValid_ ? "true" : "false")));
+
+ if (jsonDataCString != nullptr) {
+ pfree(jsonDataCString);
+ }
+
+ if (jsonSchemaCString != nullptr) {
+ pfree(jsonSchemaCString);
+ }
+
+ if (jsonDataJsonb != nullptr) {
+ pfree(jsonDataJsonb);
+ }
+
+ if (jsonSchemaJsonb != nullptr) {
+ pfree(jsonSchemaJsonb);
+ }
+
+ PG_RETURN_TEXT_P(cstring_to_text(validationResult.reportText_.c_str()));
+}
+
+Datum
+dbms_json_schema_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_JSON_SCHEMA_VERSION));
+}
diff --git a/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.hpp b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.hpp
new file mode 100644
index 0000000..f42143c
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema.hpp
@@ -0,0 +1,19 @@
+#ifndef DBMS_JSON_SCHEMA_INTERNAL_HPP
+#define DBMS_JSON_SCHEMA_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+} // extern "C"
+
+extern "C"
+{
+Datum dbms_json_schema_is_schema_valid(PG_FUNCTION_ARGS);
+Datum dbms_json_schema_is_schema_valid2(PG_FUNCTION_ARGS);
+Datum dbms_json_schema_is_valid(PG_FUNCTION_ARGS);
+Datum dbms_json_schema_validate_report(PG_FUNCTION_ARGS);
+Datum dbms_json_schema_get_version(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_JSON_SCHEMA_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_is_valid_oracle.sql b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_is_valid_oracle.sql
new file mode 100644
index 0000000..832abe9
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_is_valid_oracle.sql
@@ -0,0 +1,81 @@
+-- ORACLE
+-- Тест 1: Элементарный (Валидная схема типа string)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 1');
+ v_res := DBMS_JSON_SCHEMA.IS_SCHEMA_VALID(JSON('{"type": "string"}'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 2: Пустое значение (Проверка ORA-64403 при передаче NULL)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+ v_input JSON := NULL;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ BEGIN
+ v_res := DBMS_JSON_SCHEMA.IS_SCHEMA_VALID(v_input);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+ EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+ -- ORA-64403: input cannot be NULL
+ END;
+END;
+/
+
+-- Тест 3: Граничное условие (Логически неверная схема - неверный тип данных в определении)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 0');
+ v_res := DBMS_JSON_SCHEMA.IS_SCHEMA_VALID(JSON('{"type": "invalid_type_name"}'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 4: Сложный JSON (Схема с вложенными узлами и ограничениями)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+ v_schema JSON := JSON('{
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {"type": "integer"},
+ "name": {"type": "string"}
+ },
+ "required": ["id"]
+ }
+ }
+ }');
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 1');
+ v_res := DBMS_JSON_SCHEMA.IS_SCHEMA_VALID(v_schema);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- Тест 5: Исключение (Передача некорректного JSON синтаксиса в конструктор)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ BEGIN
+ v_res := DBMS_JSON_SCHEMA.IS_SCHEMA_VALID(JSON('{ "wrong" : }'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+ EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+ -- SQLCODE -40441
+ END;
+END;
+/
diff --git a/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_validate_report_oracle.sql b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_validate_report_oracle.sql
new file mode 100644
index 0000000..65e209f
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/dbms_json_schema_validate_report_oracle.sql
@@ -0,0 +1,119 @@
+-- Test 1: Элементарный тест (Валидный JSON)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(100) := '{"a": 1}';
+ v_schema VARCHAR2(100) := '{"type": "object", "properties": {"a": {"type": "number"}}}';
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: {"valid":true,"errors":[]}');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+END;
+/
+
+-- Test 2: Элементарный тест (Невалидный JSON по схеме)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(100) := '{"a": "str"}';
+ v_schema VARCHAR2(100) := '{"type": "object", "properties": {"a": {"type": "number"}}}';
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: {"valid":false,"errors":[{"schemaPath":"$","instancePath":"$","code":"JZN-00501","error":"JSON schema validation
+failed"},{"schemaPath":"$.properties","instancePath":"$","code":"JZN-00514","error":"invalid properties:
+''a''"},{"schemaPath":"$.properties.a.type","instancePath":"$.a","code":"JZN-00503","error":"invalid type found, actual: string, expected: number"}]}');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+END;
+/
+
+-- Test 3: Граничные условия (Пустые JSON объекты)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(100) := '{}';
+ v_schema VARCHAR2(100) := '{}';
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: {"valid":true,"errors":[]}');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+END;
+/
+
+-- Test 4: Граничные условия (Передача NULL)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(100) := NULL;
+ v_schema VARCHAR2(100) := NULL;
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: NULL');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+
+ IF v_result IS NULL THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: NULL');
+ ELSE
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+ END IF;
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- Test 5: Тест посложнее (Массивы, вложенные узлы, enum, required)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(4000) := '{"user":{"id":10,"roles":["admin","user"]},"active":true}';
+ v_schema VARCHAR2(4000) := '{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"integer"},"roles":{"type":"array","items":{"type":"string","enum":["admin","user","guest"]}}},"required":["id","roles"]},"active":{"type":"boolean"}},"required":["user","active"]}';
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: {"valid":true,"errors":[]}');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+END;
+/
+
+-- Test 6: Проверка перегрузки (Тип данных JSON вместо VARCHAR2)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data JSON := JSON('{"name":"Test"}');
+ v_schema JSON := JSON('{"type":"object","required":["name"]}');
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: {"valid":true,"errors":[]}');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+END;
+/
+
+-- Test 7: Исключение (Синтаксическая ошибка в данных JSON)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(100) := '{invalid_json}';
+ v_schema VARCHAR2(100) := '{"type":"object"}';
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- Test 8: Исключение (Синтаксическая ошибка в схеме JSON)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data VARCHAR2(100) := '{"a":1}';
+ v_schema VARCHAR2(100) := '{"type": "object", "properties": { invalid } }';
+ v_result VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ v_result := JSON_SERIALIZE(DBMS_JSON_SCHEMA.VALIDATE_REPORT(v_data, v_schema));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_result);
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.cpp b/src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.cpp
new file mode 100644
index 0000000..3203543
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.cpp
@@ -0,0 +1,115 @@
+#include "json-patch.hpp"
+
+#include <nlohmann/json-schema.hpp>
+
+namespace
+{
+
+// originally from http://jsonpatch.com/, http://json.schemastore.org/json-patch
+// with fixes
+const nlohmann::json patch_schema = R"patch({
+ "title": "JSON schema for JSONPatch files",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "array",
+
+ "items": {
+ "oneOf": [
+ {
+ "additionalProperties": false,
+ "required": [ "value", "op", "path"],
+ "properties": {
+ "path" : { "$ref": "#/definitions/path" },
+ "op": {
+ "description": "The operation to perform.",
+ "type": "string",
+ "enum": [ "add", "replace", "test" ]
+ },
+ "value": {
+ "description": "The value to add, replace or test."
+ }
+ }
+ },
+ {
+ "additionalProperties": false,
+ "required": [ "op", "path"],
+ "properties": {
+ "path" : { "$ref": "#/definitions/path" },
+ "op": {
+ "description": "The operation to perform.",
+ "type": "string",
+ "enum": [ "remove" ]
+ }
+ }
+ },
+ {
+ "additionalProperties": false,
+ "required": [ "from", "op", "path" ],
+ "properties": {
+ "path" : { "$ref": "#/definitions/path" },
+ "op": {
+ "description": "The operation to perform.",
+ "type": "string",
+ "enum": [ "move", "copy" ]
+ },
+ "from": {
+ "$ref": "#/definitions/path",
+ "description": "A JSON Pointer path pointing to the location to move/copy from."
+ }
+ }
+ }
+ ]
+ },
+ "definitions": {
+ "path": {
+ "description": "A JSON Pointer path.",
+ "type": "string"
+ }
+ }
+})patch"_json;
+} // namespace
+
+namespace nlohmann
+{
+
+json_patch::json_patch(json &&patch)
+ : j_(std::move(patch))
+{
+ validateJsonPatch(j_);
+}
+
+json_patch::json_patch(const json &patch)
+ : j_(std::move(patch))
+{
+ validateJsonPatch(j_);
+}
+
+json_patch &json_patch::add(const json::json_pointer &ptr, json value)
+{
+ j_.push_back(json{{"op", "add"}, {"path", ptr.to_string()}, {"value", std::move(value)}});
+ return *this;
+}
+
+json_patch &json_patch::replace(const json::json_pointer &ptr, json value)
+{
+ j_.push_back(json{{"op", "replace"}, {"path", ptr.to_string()}, {"value", std::move(value)}});
+ return *this;
+}
+
+json_patch &json_patch::remove(const json::json_pointer &ptr)
+{
+ j_.push_back(json{{"op", "remove"}, {"path", ptr.to_string()}});
+ return *this;
+}
+
+void json_patch::validateJsonPatch(json const &patch)
+{
+ // static put here to have it created at the first usage of validateJsonPatch
+ static nlohmann::json_schema::json_validator patch_validator(patch_schema);
+
+ patch_validator.validate(patch);
+
+ for (auto const &op : patch)
+ json::json_pointer(op["path"].get<std::string>());
+}
+
+} // namespace nlohmann
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.hpp b/src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.hpp
new file mode 100644
index 0000000..39a579b
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/json-patch.hpp
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <nlohmann/json.hpp>
+#include <string>
+
+namespace nlohmann
+{
+class JsonPatchFormatException : public std::exception
+{
+public:
+ explicit JsonPatchFormatException(std::string msg)
+ : ex_{std::move(msg)} {}
+
+ inline const char *what() const noexcept override final { return ex_.c_str(); }
+
+private:
+ std::string ex_;
+};
+
+class json_patch
+{
+public:
+ json_patch() = default;
+ json_patch(json &&patch);
+ json_patch(const json &patch);
+
+ json_patch &add(const json::json_pointer &, json value);
+ json_patch &replace(const json::json_pointer &, json value);
+ json_patch &remove(const json::json_pointer &);
+
+ json &get_json() { return j_; }
+ const json &get_json() const { return j_; }
+
+ operator json() const { return j_; }
+
+private:
+ json j_ = nlohmann::json::array();
+
+ static void validateJsonPatch(json const &patch);
+};
+} // namespace nlohmann
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/json-schema-draft7.json.cpp b/src/backend/utils/dbms/dbms_json_schema/vendor/json-schema-draft7.json.cpp
new file mode 100644
index 0000000..b680e2c
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/json-schema-draft7.json.cpp
@@ -0,0 +1,185 @@
+/*
+ * JSON schema validator for JSON for modern C++
+ *
+ * Copyright (c) 2016-2019 Patrick Boettcher <p@yai.se>.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ */
+#include <nlohmann/json.hpp>
+
+namespace nlohmann
+{
+namespace json_schema
+{
+
+json draft7_schema_builtin = R"( {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$id": "http://json-schema.org/draft-07/schema#",
+ "title": "Core schema meta-schema",
+ "definitions": {
+ "schemaArray": {
+ "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "#" }
+ },
+ "nonNegativeInteger": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "nonNegativeIntegerDefault0": {
+ "allOf": [
+ { "$ref": "#/definitions/nonNegativeInteger" },
+ { "default": 0 }
+ ]
+ },
+ "simpleTypes": {
+ "enum": [
+ "array",
+ "boolean",
+ "integer",
+ "null",
+ "number",
+ "object",
+ "string"
+ ]
+ },
+ "stringArray": {
+ "type": "array",
+ "items": { "type": "string" },
+ "uniqueItems": true,
+ "default": []
+ }
+ },
+ "type": ["object", "boolean"],
+ "properties": {
+ "$id": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "$schema": {
+ "type": "string",
+ "format": "uri"
+ },
+ "$ref": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "$comment": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "default": true,
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "examples": {
+ "type": "array",
+ "items": true
+ },
+ "multipleOf": {
+ "type": "number",
+ "exclusiveMinimum": 0
+ },
+ "maximum": {
+ "type": "number"
+ },
+ "exclusiveMaximum": {
+ "type": "number"
+ },
+ "minimum": {
+ "type": "number"
+ },
+ "exclusiveMinimum": {
+ "type": "number"
+ },
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
+ "pattern": {
+ "type": "string",
+ "format": "regex"
+ },
+ "additionalItems": { "$ref": "#" },
+ "items": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/schemaArray" }
+ ],
+ "default": true
+ },
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
+ "uniqueItems": {
+ "type": "boolean",
+ "default": false
+ },
+ "contains": { "$ref": "#" },
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
+ "required": { "$ref": "#/definitions/stringArray" },
+ "additionalProperties": { "$ref": "#" },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "patternProperties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "propertyNames": { "format": "regex" },
+ "default": {}
+ },
+ "dependencies": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/stringArray" }
+ ]
+ }
+ },
+ "propertyNames": { "$ref": "#" },
+ "const": true,
+ "enum": {
+ "type": "array",
+ "items": true,
+ "minItems": 1,
+ "uniqueItems": true
+ },
+ "type": {
+ "anyOf": [
+ { "$ref": "#/definitions/simpleTypes" },
+ {
+ "type": "array",
+ "items": { "$ref": "#/definitions/simpleTypes" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ ]
+ },
+ "format": { "type": "string" },
+ "contentMediaType": { "type": "string" },
+ "contentEncoding": { "type": "string" },
+ "if": { "$ref": "#" },
+ "then": { "$ref": "#" },
+ "else": { "$ref": "#" },
+ "allOf": { "$ref": "#/definitions/schemaArray" },
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
+ "not": { "$ref": "#" }
+ },
+ "default": true
+} )"_json;
+}
+} // namespace nlohmann
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/json-uri.cpp b/src/backend/utils/dbms/dbms_json_schema/vendor/json-uri.cpp
new file mode 100644
index 0000000..2602556
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/json-uri.cpp
@@ -0,0 +1,159 @@
+/*
+ * JSON schema validator for JSON for modern C++
+ *
+ * Copyright (c) 2016-2019 Patrick Boettcher <p@yai.se>.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ */
+#include <nlohmann/json-schema.hpp>
+
+#include <sstream>
+
+namespace nlohmann
+{
+
+void json_uri::update(const std::string &uri)
+{
+ std::string pointer = ""; // default pointer is document-root
+
+ // first split the URI into location and pointer
+ auto pointer_separator = uri.find('#');
+ if (pointer_separator != std::string::npos) { // and extract the pointer-string if found
+ pointer = uri.substr(pointer_separator + 1); // remove #
+
+ // unescape %-values IOW, decode JSON-URI-formatted JSON-pointer
+ std::size_t pos = pointer.size() - 1;
+ do {
+ pos = pointer.rfind('%', pos);
+ if (pos == std::string::npos)
+ break;
+
+ if (pos >= pointer.size() - 2) {
+ pos--;
+ continue;
+ }
+
+ std::string hex = pointer.substr(pos + 1, 2);
+ char ascii = static_cast<char>(std::strtoul(hex.c_str(), nullptr, 16));
+ pointer.replace(pos, 3, 1, ascii);
+
+ pos--;
+ } while (1);
+ }
+
+ auto location = uri.substr(0, pointer_separator);
+
+ if (location.size()) { // a location part has been found
+
+ // if it is an URN take it as it is
+ if (location.find("urn:") == 0) {
+ urn_ = location;
+
+ // and clear URL members
+ scheme_ = "";
+ authority_ = "";
+ path_ = "";
+
+ } else { // it is an URL
+
+ // split URL in protocol, hostname and path
+ std::size_t pos = 0;
+ auto proto = location.find("://", pos);
+ if (proto != std::string::npos) { // extract the protocol
+
+ urn_ = ""; // clear URN-member if URL is parsed
+
+ scheme_ = location.substr(pos, proto - pos);
+ pos = 3 + proto; // 3 == "://"
+
+ auto authority = location.find("/", pos);
+ if (authority != std::string::npos) { // and the hostname (no proto without hostname)
+ authority_ = location.substr(pos, authority - pos);
+ pos = authority;
+ }
+ }
+
+ auto path = location.substr(pos);
+
+ // URNs cannot of have paths
+ if (urn_.size() && path.size())
+ throw std::invalid_argument("Cannot add a path (" + path + ") to an URN URI (" + urn_ + ")");
+
+ if (path[0] == '/') // if it starts with a / it is root-path
+ path_ = path;
+ else if (pos == 0) { // the URL contained only a path and the current path has no / at the end, strip last element until / and append
+ auto last_slash = path_.rfind('/');
+ path_ = path_.substr(0, last_slash) + '/' + path;
+ } else // otherwise it is a subfolder
+ path_.append(path);
+ }
+ }
+
+ pointer_ = ""_json_pointer;
+ identifier_ = "";
+
+ if (pointer[0] == '/')
+ pointer_ = json::json_pointer(pointer);
+ else
+ identifier_ = pointer;
+}
+
+std::string json_uri::location() const
+{
+ if (urn_.size())
+ return urn_;
+
+ std::stringstream s;
+
+ if (scheme_.size() > 0)
+ s << scheme_ << "://";
+
+ s << authority_
+ << path_;
+
+ return s.str();
+}
+
+std::string json_uri::to_string() const
+{
+ std::stringstream s;
+
+ s << location() << " # ";
+
+ if (identifier_ == "")
+ s << pointer_.to_string();
+ else
+ s << identifier_;
+
+ return s.str();
+}
+
+std::ostream &operator<<(std::ostream &os, const json_uri &u)
+{
+ return os << u.to_string();
+}
+
+std::string json_uri::escape(const std::string &src)
+{
+ std::vector<std::pair<std::string, std::string>> chars = {
+ {"~", "~0"},
+ {"/", "~1"}};
+
+ std::string l = src;
+
+ for (const auto &c : chars) {
+ std::size_t pos = 0;
+ do {
+ pos = l.find(c.first, pos);
+ if (pos == std::string::npos)
+ break;
+ l.replace(pos, 1, c.second);
+ pos += c.second.size();
+ } while (1);
+ }
+
+ return l;
+}
+
+} // namespace nlohmann
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/json-validator.cpp b/src/backend/utils/dbms/dbms_json_schema/vendor/json-validator.cpp
new file mode 100644
index 0000000..1fd0de1
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/json-validator.cpp
@@ -0,0 +1,1472 @@
+/*
+ * JSON schema validator for JSON for modern C++
+ *
+ * Copyright (c) 2016-2019 Patrick Boettcher <p@yai.se>.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ */
+#include <nlohmann/json-schema.hpp>
+
+#include "json-patch.hpp"
+
+#include <deque>
+#include <memory>
+#include <set>
+#include <sstream>
+#include <string>
+
+using nlohmann::json;
+using nlohmann::json_patch;
+using nlohmann::json_uri;
+using nlohmann::json_schema::root_schema;
+using namespace nlohmann::json_schema;
+
+#ifdef JSON_SCHEMA_BOOST_REGEX
+# include <boost/regex.hpp>
+# define REGEX_NAMESPACE boost
+#elif defined(JSON_SCHEMA_NO_REGEX)
+# define NO_STD_REGEX
+#else
+# include <regex>
+# define REGEX_NAMESPACE std
+#endif
+
+namespace
+{
+
+class schema
+{
+protected:
+ root_schema *root_;
+ json default_value_ = nullptr;
+
+protected:
+ virtual std::shared_ptr<schema> make_for_default_(
+ std::shared_ptr<::schema> & /* sch */,
+ root_schema * /* root */,
+ std::vector<nlohmann::json_uri> & /* uris */,
+ nlohmann::json & /* default_value */) const
+ {
+ return nullptr;
+ };
+
+public:
+ virtual ~schema() = default;
+
+ schema(root_schema *root)
+ : root_(root) {}
+
+ virtual void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const = 0;
+
+ virtual const json &default_value(const json::json_pointer &, const json &, error_handler &) const
+ {
+ return default_value_;
+ }
+
+ void set_default_value(const json &v) { default_value_ = v; }
+
+ static std::shared_ptr<schema> make(json &schema,
+ root_schema *root,
+ const std::vector<std::string> &key,
+ std::vector<nlohmann::json_uri> uris);
+};
+
+class schema_ref : public schema
+{
+ const std::string id_;
+ std::weak_ptr<schema> target_;
+ std::shared_ptr<schema> target_strong_; // for references to references keep also the shared_ptr because
+ // no one else might use it after resolving
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const final
+ {
+ auto target = target_.lock();
+
+ if (target)
+ target->validate(ptr, instance, patch, e);
+ else
+ e.error(ptr, instance, "unresolved or freed schema-reference " + id_);
+ }
+
+ const json &default_value(const json::json_pointer &ptr, const json &instance, error_handler &e) const override final
+ {
+ if (!default_value_.is_null())
+ return default_value_;
+
+ auto target = target_.lock();
+ if (target)
+ return target->default_value(ptr, instance, e);
+
+ e.error(ptr, instance, "unresolved or freed schema-reference " + id_);
+
+ return default_value_;
+ }
+
+protected:
+ virtual std::shared_ptr<schema> make_for_default_(
+ std::shared_ptr<::schema> &sch,
+ root_schema *root,
+ std::vector<nlohmann::json_uri> &uris,
+ nlohmann::json &default_value) const override
+ {
+ // create a new reference schema using the original reference (which will be resolved later)
+ // to store this overloaded default value #209
+ auto result = std::make_shared<schema_ref>(uris[0].to_string(), root);
+ result->set_target(sch, true);
+ result->set_default_value(default_value);
+ return result;
+ };
+
+public:
+ schema_ref(const std::string &id, root_schema *root)
+ : schema(root), id_(id) {}
+
+ const std::string &id() const { return id_; }
+
+ void set_target(const std::shared_ptr<schema> &target, bool strong = false)
+ {
+ target_ = target;
+ if (strong)
+ target_strong_ = target;
+ }
+};
+
+} // namespace
+
+namespace nlohmann
+{
+namespace json_schema
+{
+
+class root_schema
+{
+ schema_loader loader_;
+ format_checker format_check_;
+ content_checker content_check_;
+
+ std::shared_ptr<schema> root_;
+
+ struct schema_file {
+ std::map<std::string, std::shared_ptr<schema>> schemas;
+ std::map<std::string, std::shared_ptr<schema_ref>> unresolved; // contains all unresolved references from any other file seen during parsing
+ json unknown_keywords;
+ };
+
+ // location as key
+ std::map<std::string, schema_file> files_;
+
+ schema_file &get_or_create_file(const std::string &loc)
+ {
+ auto file = files_.lower_bound(loc);
+ if (file != files_.end() && !(files_.key_comp()(loc, file->first)))
+ return file->second;
+ else
+ return files_.insert(file, {loc, {}})->second;
+ }
+
+public:
+ root_schema(schema_loader &&loader,
+ format_checker &&format,
+ content_checker &&content)
+
+ : loader_(std::move(loader)),
+ format_check_(std::move(format)),
+ content_check_(std::move(content))
+ {
+ }
+
+ format_checker &format_check() { return format_check_; }
+ content_checker &content_check() { return content_check_; }
+
+ void insert(const json_uri &uri, const std::shared_ptr<schema> &s)
+ {
+ auto &file = get_or_create_file(uri.location());
+ auto sch = file.schemas.lower_bound(uri.fragment());
+ if (sch != file.schemas.end() && !(file.schemas.key_comp()(uri.fragment(), sch->first))) {
+ throw std::invalid_argument("schema with " + uri.to_string() + " already inserted");
+ return;
+ }
+
+ file.schemas.insert({uri.fragment(), s});
+
+ // was someone referencing this newly inserted schema?
+ auto unresolved = file.unresolved.find(uri.fragment());
+ if (unresolved != file.unresolved.end()) {
+ unresolved->second->set_target(s);
+ file.unresolved.erase(unresolved);
+ }
+ }
+
+ void insert_unknown_keyword(const json_uri &uri, const std::string &key, json &value)
+ {
+ auto &file = get_or_create_file(uri.location());
+ auto new_uri = uri.append(key);
+ auto fragment = new_uri.pointer();
+
+ // is there a reference looking for this unknown-keyword, which is thus no longer a unknown keyword but a schema
+ auto unresolved = file.unresolved.find(fragment.to_string());
+ if (unresolved != file.unresolved.end())
+ schema::make(value, this, {}, {{new_uri}});
+ else { // no, nothing ref'd it, keep for later
+
+ // need to create an object for each reference-token in the
+ // JSON-Pointer When not existing, a stringified integer reference
+ // token (e.g. "123") in the middle of the pointer will be
+ // interpreted a an array-index and an array will be created.
+
+ // json_pointer's reference_tokens is private - get them
+ std::deque<std::string> ref_tokens;
+ auto uri_pointer = uri.pointer();
+ while (!uri_pointer.empty()) {
+ ref_tokens.push_front(uri_pointer.back());
+ uri_pointer.pop_back();
+ }
+
+ // for each token create an object, if not already existing
+ auto unk_kw = &file.unknown_keywords;
+ for (auto &rt : ref_tokens) {
+ auto existing_object = unk_kw->find(rt);
+ if (existing_object == unk_kw->end())
+ (*unk_kw)[rt] = json::object();
+ unk_kw = &(*unk_kw)[rt];
+ }
+ (*unk_kw)[key] = value;
+ }
+
+ // recursively add possible subschemas of unknown keywords
+ if (value.type() == json::value_t::object)
+ for (auto &subsch : value.items())
+ insert_unknown_keyword(new_uri, subsch.key(), subsch.value());
+ }
+
+ std::shared_ptr<schema> get_or_create_ref(const json_uri &uri)
+ {
+ auto &file = get_or_create_file(uri.location());
+
+ // existing schema
+ auto sch = file.schemas.find(uri.fragment());
+ if (sch != file.schemas.end())
+ return sch->second;
+
+ // referencing an unknown keyword, turn it into schema
+ //
+ // an unknown keyword can only be referenced by a json-pointer,
+ // not by a plain name fragment
+ if (uri.pointer().to_string() != "") {
+ try {
+ auto &subschema = file.unknown_keywords.at(uri.pointer()); // null is returned if not existing
+ auto s = schema::make(subschema, this, {}, {{uri}}); // A JSON Schema MUST be an object or a boolean.
+ if (s) { // nullptr if invalid schema, e.g. null
+ file.unknown_keywords.erase(uri.fragment());
+ return s;
+ }
+ } catch (nlohmann::detail::out_of_range &) { // at() did not find it
+ }
+ }
+
+ // get or create a schema_ref
+ auto r = file.unresolved.lower_bound(uri.fragment());
+ if (r != file.unresolved.end() && !(file.unresolved.key_comp()(uri.fragment(), r->first))) {
+ return r->second; // unresolved, already seen previously - use existing reference
+ } else {
+ return file.unresolved.insert(r,
+ {uri.fragment(), std::make_shared<schema_ref>(uri.to_string(), this)})
+ ->second; // unresolved, create reference
+ }
+ }
+
+ void set_root_schema(json sch)
+ {
+ files_.clear();
+ root_ = schema::make(sch, this, {}, {{"#"}});
+
+ // load all files which have not yet been loaded
+ do {
+ bool new_schema_loaded = false;
+
+ // files_ is modified during parsing, iterators are invalidated
+ std::vector<std::string> locations;
+ for (auto &file : files_)
+ locations.push_back(file.first);
+
+ for (auto &loc : locations) {
+ if (files_[loc].schemas.size() == 0) { // nothing has been loaded for this file
+ if (loader_) {
+ json loaded_schema;
+
+ loader_(loc, loaded_schema);
+
+ schema::make(loaded_schema, this, {}, {{loc}});
+ new_schema_loaded = true;
+ } else {
+ throw std::invalid_argument("external schema reference '" + loc + "' needs loading, but no loader callback given");
+ }
+ }
+ }
+
+ if (!new_schema_loaded) // if no new schema loaded, no need to try again
+ break;
+ } while (1);
+
+ for (const auto &file : files_) {
+ if (file.second.unresolved.size() != 0) {
+ // Build a representation of the undefined
+ // references as a list of comma-separated strings.
+ auto n_urefs = file.second.unresolved.size();
+ std::string urefs = "[";
+
+ decltype(n_urefs) counter = 0;
+ for (const auto &p : file.second.unresolved) {
+ urefs += p.first;
+
+ if (counter != n_urefs - 1u) {
+ urefs += ", ";
+ }
+
+ ++counter;
+ }
+
+ urefs += "]";
+
+ throw std::invalid_argument("after all files have been parsed, '" +
+ (file.first == "" ? "<root>" : file.first) +
+ "' has still the following undefined references: " + urefs);
+ }
+ }
+ }
+
+ void validate(const json::json_pointer &ptr,
+ const json &instance,
+ json_patch &patch,
+ error_handler &e,
+ const json_uri &initial) const
+ {
+ if (!root_) {
+ e.error(ptr, "", "no root schema has yet been set for validating an instance");
+ return;
+ }
+
+ auto file_entry = files_.find(initial.location());
+ if (file_entry == files_.end()) {
+ e.error(ptr, "", "no file found serving requested root-URI. " + initial.location());
+ return;
+ }
+
+ auto &file = file_entry->second;
+ auto sch = file.schemas.find(initial.fragment());
+ if (sch == file.schemas.end()) {
+ e.error(ptr, "", "no schema find for request initial URI: " + initial.to_string());
+ return;
+ }
+
+ sch->second->validate(ptr, instance, patch, e);
+ }
+};
+
+} // namespace json_schema
+} // namespace nlohmann
+
+namespace
+{
+
+class first_error_handler : public error_handler
+{
+public:
+ bool error_{false};
+ json::json_pointer ptr_;
+ json instance_;
+ std::string message_;
+
+ void error(const json::json_pointer &ptr, const json &instance, const std::string &message) override
+ {
+ if (*this)
+ return;
+ error_ = true;
+ ptr_ = ptr;
+ instance_ = instance;
+ message_ = message;
+ }
+
+ operator bool() const { return error_; }
+};
+
+class logical_not : public schema
+{
+ std::shared_ptr<schema> subschema_;
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const final
+ {
+ first_error_handler esub;
+ subschema_->validate(ptr, instance, patch, esub);
+
+ if (!esub)
+ e.error(ptr, instance, "the subschema has succeeded, but it is required to not validate");
+ }
+
+ const json &default_value(const json::json_pointer &ptr, const json &instance, error_handler &e) const override
+ {
+ return subschema_->default_value(ptr, instance, e);
+ }
+
+public:
+ logical_not(json &sch,
+ root_schema *root,
+ const std::vector<nlohmann::json_uri> &uris)
+ : schema(root)
+ {
+ subschema_ = schema::make(sch, root, {"not"}, uris);
+ }
+};
+
+enum logical_combination_types {
+ allOf,
+ anyOf,
+ oneOf
+};
+
+template <enum logical_combination_types combine_logic>
+class logical_combination : public schema
+{
+ std::vector<std::shared_ptr<schema>> subschemata_;
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const final
+ {
+ size_t count = 0;
+
+ for (auto &s : subschemata_) {
+ first_error_handler esub;
+ auto oldPatchSize = patch.get_json().size();
+ s->validate(ptr, instance, patch, esub);
+ if (!esub)
+ count++;
+ else
+ patch.get_json().get_ref<nlohmann::json::array_t &>().resize(oldPatchSize);
+
+ if (is_validate_complete(instance, ptr, e, esub, count))
+ return;
+ }
+
+ // could accumulate esub details for anyOf and oneOf, but not clear how to select which subschema failure to report
+ // or how to report multiple such failures
+ if (count == 0)
+ e.error(ptr, instance, "no subschema has succeeded, but one of them is required to validate");
+ }
+
+ // specialized for each of the logical_combination_types
+ static const std::string key;
+ static bool is_validate_complete(const json &, const json::json_pointer &, error_handler &, const first_error_handler &, size_t);
+
+public:
+ logical_combination(json &sch,
+ root_schema *root,
+ const std::vector<nlohmann::json_uri> &uris)
+ : schema(root)
+ {
+ size_t c = 0;
+ for (auto &subschema : sch)
+ subschemata_.push_back(schema::make(subschema, root, {key, std::to_string(c++)}, uris));
+
+ // value of allOf, anyOf, and oneOf "MUST be a non-empty array"
+ // TODO error/throw? when subschemata_.empty()
+ }
+};
+
+template <>
+const std::string logical_combination<allOf>::key = "allOf";
+template <>
+const std::string logical_combination<anyOf>::key = "anyOf";
+template <>
+const std::string logical_combination<oneOf>::key = "oneOf";
+
+template <>
+bool logical_combination<allOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &e, const first_error_handler &esub, size_t)
+{
+ if (esub)
+ e.error(esub.ptr_, esub.instance_, "at least one subschema has failed, but all of them are required to validate - " + esub.message_);
+ return esub;
+}
+
+template <>
+bool logical_combination<anyOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &, const first_error_handler &, size_t count)
+{
+ return count == 1;
+}
+
+template <>
+bool logical_combination<oneOf>::is_validate_complete(const json &instance, const json::json_pointer &ptr, error_handler &e, const first_error_handler &, size_t count)
+{
+ if (count > 1)
+ e.error(ptr, instance, "more than one subschema has succeeded, but exactly one of them is required to validate");
+ return count > 1;
+}
+
+class type_schema : public schema
+{
+ std::vector<std::shared_ptr<schema>> type_;
+ std::pair<bool, json> enum_, const_;
+ std::vector<std::shared_ptr<schema>> logic_;
+
+ static std::shared_ptr<schema> make(json &schema,
+ json::value_t type,
+ root_schema *,
+ const std::vector<nlohmann::json_uri> &,
+ std::set<std::string> &);
+
+ std::shared_ptr<schema> if_, then_, else_;
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const override final
+ {
+ // depending on the type of instance run the type specific validator - if present
+ auto type = type_[static_cast<uint8_t>(instance.type())];
+
+ if (type)
+ type->validate(ptr, instance, patch, e);
+ else
+ e.error(ptr, instance, "unexpected instance type");
+
+ if (enum_.first) {
+ bool seen_in_enum = false;
+ for (auto &v : enum_.second)
+ if (instance == v) {
+ seen_in_enum = true;
+ break;
+ }
+
+ if (!seen_in_enum)
+ e.error(ptr, instance, "instance not found in required enum");
+ }
+
+ if (const_.first &&
+ const_.second != instance)
+ e.error(ptr, instance, "instance not const");
+
+ for (auto l : logic_)
+ l->validate(ptr, instance, patch, e);
+
+ if (if_) {
+ first_error_handler err;
+
+ if_->validate(ptr, instance, patch, err);
+ if (!err) {
+ if (then_)
+ then_->validate(ptr, instance, patch, e);
+ } else {
+ if (else_)
+ else_->validate(ptr, instance, patch, e);
+ }
+ }
+ if (instance.is_null()) {
+ patch.add(nlohmann::json::json_pointer{}, default_value_);
+ }
+ }
+
+protected:
+ virtual std::shared_ptr<schema> make_for_default_(
+ std::shared_ptr<::schema> & /* sch */,
+ root_schema * /* root */,
+ std::vector<nlohmann::json_uri> & /* uris */,
+ nlohmann::json &default_value) const override
+ {
+ auto result = std::make_shared<type_schema>(*this);
+ result->set_default_value(default_value);
+ return result;
+ };
+
+public:
+ type_schema(json &sch,
+ root_schema *root,
+ const std::vector<nlohmann::json_uri> &uris)
+ : schema(root), type_(static_cast<uint8_t>(json::value_t::discarded) + 1)
+ {
+ // association between JSON-schema-type and NLohmann-types
+ static const std::vector<std::pair<std::string, json::value_t>> schema_types = {
+ {"null", json::value_t::null},
+ {"object", json::value_t::object},
+ {"array", json::value_t::array},
+ {"string", json::value_t::string},
+ {"boolean", json::value_t::boolean},
+ {"integer", json::value_t::number_integer},
+ {"number", json::value_t::number_float},
+ };
+
+ std::set<std::string> known_keywords;
+
+ auto attr = sch.find("type");
+ if (attr == sch.end()) // no type field means all sub-types possible
+ for (auto &t : schema_types)
+ type_[static_cast<uint8_t>(t.second)] = type_schema::make(sch, t.second, root, uris, known_keywords);
+ else {
+ switch (attr.value().type()) { // "type": "type"
+
+ case json::value_t::string: {
+ auto schema_type = attr.value().get<std::string>();
+ for (auto &t : schema_types)
+ if (t.first == schema_type)
+ type_[static_cast<uint8_t>(t.second)] = type_schema::make(sch, t.second, root, uris, known_keywords);
+ } break;
+
+ case json::value_t::array: // "type": ["type1", "type2"]
+ for (auto &array_value : attr.value()) {
+ auto schema_type = array_value.get<std::string>();
+ for (auto &t : schema_types)
+ if (t.first == schema_type)
+ type_[static_cast<uint8_t>(t.second)] = type_schema::make(sch, t.second, root, uris, known_keywords);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ sch.erase(attr);
+ }
+
+ attr = sch.find("default");
+ if (attr != sch.end()) {
+ set_default_value(attr.value());
+ sch.erase(attr);
+ }
+
+ for (auto &key : known_keywords)
+ sch.erase(key);
+
+ // with nlohmann::json float instance (but number in schema-definition) can be seen as unsigned or integer -
+ // reuse the number-validator for integer values as well, if they have not been specified explicitly
+ if (type_[static_cast<uint8_t>(json::value_t::number_float)] && !type_[static_cast<uint8_t>(json::value_t::number_integer)])
+ type_[static_cast<uint8_t>(json::value_t::number_integer)] = type_[static_cast<uint8_t>(json::value_t::number_float)];
+
+ // #54: JSON-schema does not differentiate between unsigned and signed integer - nlohmann::json does
+ // we stick with JSON-schema: use the integer-validator if instance-value is unsigned
+ type_[static_cast<uint8_t>(json::value_t::number_unsigned)] = type_[static_cast<uint8_t>(json::value_t::number_integer)];
+
+ // special for binary types
+ if (type_[static_cast<uint8_t>(json::value_t::string)]) {
+ type_[static_cast<uint8_t>(json::value_t::binary)] = type_[static_cast<uint8_t>(json::value_t::string)];
+ }
+
+ attr = sch.find("enum");
+ if (attr != sch.end()) {
+ enum_ = {true, attr.value()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("const");
+ if (attr != sch.end()) {
+ const_ = {true, attr.value()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("not");
+ if (attr != sch.end()) {
+ logic_.push_back(std::make_shared<logical_not>(attr.value(), root, uris));
+ sch.erase(attr);
+ }
+
+ attr = sch.find("allOf");
+ if (attr != sch.end()) {
+ logic_.push_back(std::make_shared<logical_combination<allOf>>(attr.value(), root, uris));
+ sch.erase(attr);
+ }
+
+ attr = sch.find("anyOf");
+ if (attr != sch.end()) {
+ logic_.push_back(std::make_shared<logical_combination<anyOf>>(attr.value(), root, uris));
+ sch.erase(attr);
+ }
+
+ attr = sch.find("oneOf");
+ if (attr != sch.end()) {
+ logic_.push_back(std::make_shared<logical_combination<oneOf>>(attr.value(), root, uris));
+ sch.erase(attr);
+ }
+
+ attr = sch.find("if");
+ if (attr != sch.end()) {
+ auto attr_then = sch.find("then");
+ auto attr_else = sch.find("else");
+
+ if (attr_then != sch.end() || attr_else != sch.end()) {
+ if_ = schema::make(attr.value(), root, {"if"}, uris);
+
+ if (attr_then != sch.end()) {
+ then_ = schema::make(attr_then.value(), root, {"then"}, uris);
+ sch.erase(attr_then);
+ }
+
+ if (attr_else != sch.end()) {
+ else_ = schema::make(attr_else.value(), root, {"else"}, uris);
+ sch.erase(attr_else);
+ }
+ }
+ sch.erase(attr);
+ }
+ }
+};
+
+class string : public schema
+{
+ std::pair<bool, size_t> maxLength_{false, 0};
+ std::pair<bool, size_t> minLength_{false, 0};
+
+#ifndef NO_STD_REGEX
+ std::pair<bool, REGEX_NAMESPACE::regex> pattern_{false, REGEX_NAMESPACE::regex()};
+ std::string patternString_;
+#endif
+
+ std::pair<bool, std::string> format_;
+ std::tuple<bool, std::string, std::string> content_{false, "", ""};
+
+ std::size_t utf8_length(const std::string &s) const
+ {
+ size_t len = 0;
+ for (auto c : s)
+ if ((c & 0xc0) != 0x80)
+ len++;
+ return len;
+ }
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override
+ {
+ if (minLength_.first) {
+ if (utf8_length(instance.get<std::string>()) < minLength_.second) {
+ std::ostringstream s;
+ s << "instance is too short as per minLength:" << minLength_.second;
+ e.error(ptr, instance, s.str());
+ }
+ }
+
+ if (maxLength_.first) {
+ if (utf8_length(instance.get<std::string>()) > maxLength_.second) {
+ std::ostringstream s;
+ s << "instance is too long as per maxLength: " << maxLength_.second;
+ e.error(ptr, instance, s.str());
+ }
+ }
+
+ if (std::get<0>(content_)) {
+ if (root_->content_check() == nullptr)
+ e.error(ptr, instance, std::string("a content checker was not provided but a contentEncoding or contentMediaType for this string have been present: '") + std::get<1>(content_) + "' '" + std::get<2>(content_) + "'");
+ else {
+ try {
+ root_->content_check()(std::get<1>(content_), std::get<2>(content_), instance);
+ } catch (const std::exception &ex) {
+ e.error(ptr, instance, std::string("content-checking failed: ") + ex.what());
+ }
+ }
+ } else if (instance.type() == json::value_t::binary) {
+ e.error(ptr, instance, "expected string, but get binary data");
+ }
+
+ if (instance.type() != json::value_t::string) {
+ return; // next checks only for strings
+ }
+
+#ifndef NO_STD_REGEX
+ if (pattern_.first &&
+ !REGEX_NAMESPACE::regex_search(instance.get<std::string>(), pattern_.second))
+ e.error(ptr, instance, "instance does not match regex pattern: " + patternString_);
+#endif
+
+ if (format_.first) {
+ if (root_->format_check() == nullptr)
+ e.error(ptr, instance, std::string("a format checker was not provided but a format keyword for this string is present: ") + format_.second);
+ else {
+ try {
+ root_->format_check()(format_.second, instance.get<std::string>());
+ } catch (const std::exception &ex) {
+ e.error(ptr, instance, std::string("format-checking failed: ") + ex.what());
+ }
+ }
+ }
+ }
+
+public:
+ string(json &sch, root_schema *root)
+ : schema(root)
+ {
+ auto attr = sch.find("maxLength");
+ if (attr != sch.end()) {
+ maxLength_ = {true, attr.value().get<size_t>()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("minLength");
+ if (attr != sch.end()) {
+ minLength_ = {true, attr.value().get<size_t>()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("contentEncoding");
+ if (attr != sch.end()) {
+ std::get<0>(content_) = true;
+ std::get<1>(content_) = attr.value().get<std::string>();
+
+ // special case for nlohmann::json-binary-types
+ //
+ // https://github.com/pboettch/json-schema-validator/pull/114
+ //
+ // We cannot use explicitly in a schema: {"type": "binary"} or
+ // "type": ["binary", "number"] we have to be implicit. For a
+ // schema where "contentEncoding" is set to "binary", an instance
+ // of type json::value_t::binary is accepted. If a
+ // contentEncoding-callback has to be provided and is called
+ // accordingly. For encoding=binary, no other type validations are done
+
+ sch.erase(attr);
+ }
+
+ attr = sch.find("contentMediaType");
+ if (attr != sch.end()) {
+ std::get<0>(content_) = true;
+ std::get<2>(content_) = attr.value().get<std::string>();
+
+ sch.erase(attr);
+ }
+
+ if (std::get<0>(content_) == true && root_->content_check() == nullptr) {
+ throw std::invalid_argument{"schema contains contentEncoding/contentMediaType but content checker was not set"};
+ }
+
+#ifndef NO_STD_REGEX
+ attr = sch.find("pattern");
+ if (attr != sch.end()) {
+ patternString_ = attr.value().get<std::string>();
+ pattern_ = {true, REGEX_NAMESPACE::regex(attr.value().get<std::string>(),
+ REGEX_NAMESPACE::regex::ECMAScript)};
+ sch.erase(attr);
+ }
+#endif
+
+ attr = sch.find("format");
+ if (attr != sch.end()) {
+ if (root_->format_check() == nullptr)
+ throw std::invalid_argument{"a format checker was not provided but a format keyword for this string is present: " + format_.second};
+
+ format_ = {true, attr.value().get<std::string>()};
+ sch.erase(attr);
+ }
+ }
+};
+
+template <typename T>
+class numeric : public schema
+{
+ std::pair<bool, T> maximum_{false, 0};
+ std::pair<bool, T> minimum_{false, 0};
+
+ bool exclusiveMaximum_ = false;
+ bool exclusiveMinimum_ = false;
+
+ std::pair<bool, json::number_float_t> multipleOf_{false, 0};
+
+ // multipleOf - if the remainder of the division is 0 -> OK
+ bool violates_multiple_of(T x) const
+ {
+ double res = std::remainder(x, multipleOf_.second);
+ double multiple = std::fabs(x / multipleOf_.second);
+ if (multiple > 1) {
+ res = res / multiple;
+ }
+ double eps = std::nextafter(x, 0) - static_cast<double>(x);
+
+ return std::fabs(res) > std::fabs(eps);
+ }
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override
+ {
+ T value = instance; // conversion of json to value_type
+
+ if (multipleOf_.first && value != 0) // zero is multiple of everything
+ if (violates_multiple_of(value))
+ e.error(ptr, instance, "instance is not a multiple of " + std::to_string(multipleOf_.second));
+
+ if (maximum_.first) {
+ if (exclusiveMaximum_ && value >= maximum_.second)
+ e.error(ptr, instance, "instance exceeds or equals maximum of " + std::to_string(maximum_.second));
+ else if (value > maximum_.second)
+ e.error(ptr, instance, "instance exceeds maximum of " + std::to_string(maximum_.second));
+ }
+
+ if (minimum_.first) {
+ if (exclusiveMinimum_ && value <= minimum_.second)
+ e.error(ptr, instance, "instance is below or equals minimum of " + std::to_string(minimum_.second));
+ else if (value < minimum_.second)
+ e.error(ptr, instance, "instance is below minimum of " + std::to_string(minimum_.second));
+ }
+ }
+
+public:
+ numeric(const json &sch, root_schema *root, std::set<std::string> &kw)
+ : schema(root)
+ {
+ auto attr = sch.find("maximum");
+ if (attr != sch.end()) {
+ maximum_ = {true, attr.value().get<T>()};
+ kw.insert("maximum");
+ }
+
+ attr = sch.find("minimum");
+ if (attr != sch.end()) {
+ minimum_ = {true, attr.value().get<T>()};
+ kw.insert("minimum");
+ }
+
+ attr = sch.find("exclusiveMaximum");
+ if (attr != sch.end()) {
+ exclusiveMaximum_ = true;
+ maximum_ = {true, attr.value().get<T>()};
+ kw.insert("exclusiveMaximum");
+ }
+
+ attr = sch.find("exclusiveMinimum");
+ if (attr != sch.end()) {
+ exclusiveMinimum_ = true;
+ minimum_ = {true, attr.value().get<T>()};
+ kw.insert("exclusiveMinimum");
+ }
+
+ attr = sch.find("multipleOf");
+ if (attr != sch.end()) {
+ multipleOf_ = {true, attr.value().get<json::number_float_t>()};
+ kw.insert("multipleOf");
+ }
+ }
+};
+
+class null : public schema
+{
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override
+ {
+ if (!instance.is_null())
+ e.error(ptr, instance, "expected to be null");
+ }
+
+public:
+ null(json &, root_schema *root)
+ : schema(root) {}
+};
+
+class boolean_type : public schema
+{
+ void validate(const json::json_pointer &, const json &, json_patch &, error_handler &) const override {}
+
+public:
+ boolean_type(json &, root_schema *root)
+ : schema(root) {}
+};
+
+class boolean : public schema
+{
+ bool true_;
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override
+ {
+ if (!true_) { // false schema
+ // empty array
+ // switch (instance.type()) {
+ // case json::value_t::array:
+ // if (instance.size() != 0) // valid false-schema
+ // e.error(ptr, instance, "false-schema required empty array");
+ // return;
+ //}
+
+ e.error(ptr, instance, "instance invalid as per false-schema");
+ }
+ }
+
+public:
+ boolean(json &sch, root_schema *root)
+ : schema(root), true_(sch) {}
+};
+
+class required : public schema
+{
+ const std::vector<std::string> required_;
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override final
+ {
+ for (auto &r : required_)
+ if (instance.find(r) == instance.end())
+ e.error(ptr, instance, "required property '" + r + "' not found in object as a dependency");
+ }
+
+public:
+ required(const std::vector<std::string> &r, root_schema *root)
+ : schema(root), required_(r) {}
+};
+
+class object : public schema
+{
+ std::pair<bool, size_t> maxProperties_{false, 0};
+ std::pair<bool, size_t> minProperties_{false, 0};
+ std::vector<std::string> required_;
+
+ std::map<std::string, std::shared_ptr<schema>> properties_;
+#ifndef NO_STD_REGEX
+ std::vector<std::pair<REGEX_NAMESPACE::regex, std::shared_ptr<schema>>> patternProperties_;
+#endif
+ std::shared_ptr<schema> additionalProperties_;
+
+ std::map<std::string, std::shared_ptr<schema>> dependencies_;
+
+ std::shared_ptr<schema> propertyNames_;
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const override
+ {
+ if (maxProperties_.first && instance.size() > maxProperties_.second)
+ e.error(ptr, instance, "too many properties");
+
+ if (minProperties_.first && instance.size() < minProperties_.second)
+ e.error(ptr, instance, "too few properties");
+
+ for (auto &r : required_)
+ if (instance.find(r) == instance.end())
+ e.error(ptr, instance, "required property '" + r + "' not found in object");
+
+ // for each property in instance
+ for (auto &p : instance.items()) {
+ if (propertyNames_)
+ propertyNames_->validate(ptr, p.key(), patch, e);
+
+ bool a_prop_or_pattern_matched = false;
+ auto schema_p = properties_.find(p.key());
+ // check if it is in "properties"
+ if (schema_p != properties_.end()) {
+ a_prop_or_pattern_matched = true;
+ schema_p->second->validate(ptr / p.key(), p.value(), patch, e);
+ }
+
+#ifndef NO_STD_REGEX
+ // check all matching patternProperties
+ for (auto &schema_pp : patternProperties_)
+ if (REGEX_NAMESPACE::regex_search(p.key(), schema_pp.first)) {
+ a_prop_or_pattern_matched = true;
+ schema_pp.second->validate(ptr / p.key(), p.value(), patch, e);
+ }
+#endif
+
+ // check additionalProperties as a last resort
+ if (!a_prop_or_pattern_matched && additionalProperties_) {
+ first_error_handler additional_prop_err;
+ additionalProperties_->validate(ptr / p.key(), p.value(), patch, additional_prop_err);
+ if (additional_prop_err)
+ e.error(ptr, instance, "validation failed for additional property '" + p.key() + "': " + additional_prop_err.message_);
+ }
+ }
+
+ // reverse search
+ for (auto const &prop : properties_) {
+ const auto finding = instance.find(prop.first);
+ if (instance.end() == finding) { // if the prop is not in the instance
+ const auto &default_value = prop.second->default_value(ptr, instance, e);
+ if (!default_value.is_null()) { // if default value is available
+ patch.add((ptr / prop.first), default_value);
+ }
+ }
+ }
+
+ for (auto &dep : dependencies_) {
+ auto prop = instance.find(dep.first);
+ if (prop != instance.end()) // if dependency-property is present in instance
+ dep.second->validate(ptr / dep.first, instance, patch, e); // validate
+ }
+ }
+
+public:
+ object(json &sch,
+ root_schema *root,
+ const std::vector<nlohmann::json_uri> &uris)
+ : schema(root)
+ {
+ auto attr = sch.find("maxProperties");
+ if (attr != sch.end()) {
+ maxProperties_ = {true, attr.value().get<size_t>()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("minProperties");
+ if (attr != sch.end()) {
+ minProperties_ = {true, attr.value().get<size_t>()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("required");
+ if (attr != sch.end()) {
+ required_ = attr.value().get<std::vector<std::string>>();
+ sch.erase(attr);
+ }
+
+ attr = sch.find("properties");
+ if (attr != sch.end()) {
+ for (auto prop : attr.value().items())
+ properties_.insert(
+ std::make_pair(
+ prop.key(),
+ schema::make(prop.value(), root, {"properties", prop.key()}, uris)));
+ sch.erase(attr);
+ }
+
+#ifndef NO_STD_REGEX
+ attr = sch.find("patternProperties");
+ if (attr != sch.end()) {
+ for (auto prop : attr.value().items())
+ patternProperties_.push_back(
+ std::make_pair(
+ REGEX_NAMESPACE::regex(prop.key(), REGEX_NAMESPACE::regex::ECMAScript),
+ schema::make(prop.value(), root, {prop.key()}, uris)));
+ sch.erase(attr);
+ }
+#endif
+
+ attr = sch.find("additionalProperties");
+ if (attr != sch.end()) {
+ additionalProperties_ = schema::make(attr.value(), root, {"additionalProperties"}, uris);
+ sch.erase(attr);
+ }
+
+ attr = sch.find("dependencies");
+ if (attr != sch.end()) {
+ for (auto &dep : attr.value().items())
+ switch (dep.value().type()) {
+ case json::value_t::array:
+ dependencies_.emplace(dep.key(),
+ std::make_shared<required>(
+ dep.value().get<std::vector<std::string>>(), root));
+ break;
+
+ default:
+ dependencies_.emplace(dep.key(),
+ schema::make(dep.value(), root, {"dependencies", dep.key()}, uris));
+ break;
+ }
+ sch.erase(attr);
+ }
+
+ attr = sch.find("propertyNames");
+ if (attr != sch.end()) {
+ propertyNames_ = schema::make(attr.value(), root, {"propertyNames"}, uris);
+ sch.erase(attr);
+ }
+
+ attr = sch.find("default");
+ if (attr != sch.end()) {
+ set_default_value(*attr);
+ }
+ }
+};
+
+class array : public schema
+{
+ std::pair<bool, size_t> maxItems_{false, 0};
+ std::pair<bool, size_t> minItems_{false, 0};
+ bool uniqueItems_ = false;
+
+ std::shared_ptr<schema> items_schema_;
+
+ std::vector<std::shared_ptr<schema>> items_;
+ std::shared_ptr<schema> additionalItems_;
+
+ std::shared_ptr<schema> contains_;
+
+ void validate(const json::json_pointer &ptr, const json &instance, json_patch &patch, error_handler &e) const override
+ {
+ if (maxItems_.first && instance.size() > maxItems_.second)
+ e.error(ptr, instance, "array has too many items");
+
+ if (minItems_.first && instance.size() < minItems_.second)
+ e.error(ptr, instance, "array has too few items");
+
+ if (uniqueItems_) {
+ for (auto it = instance.cbegin(); it != instance.cend(); ++it) {
+ auto v = std::find(it + 1, instance.end(), *it);
+ if (v != instance.end())
+ e.error(ptr, instance, "items have to be unique for this array");
+ }
+ }
+
+ size_t index = 0;
+ if (items_schema_)
+ for (auto &i : instance) {
+ items_schema_->validate(ptr / index, i, patch, e);
+ index++;
+ }
+ else {
+ auto item = items_.cbegin();
+ for (auto &i : instance) {
+ std::shared_ptr<schema> item_validator;
+ if (item == items_.cend())
+ item_validator = additionalItems_;
+ else {
+ item_validator = *item;
+ item++;
+ }
+
+ if (!item_validator)
+ break;
+
+ item_validator->validate(ptr / index, i, patch, e);
+ }
+ }
+
+ if (contains_) {
+ bool contained = false;
+ for (auto &item : instance) {
+ first_error_handler local_e;
+ contains_->validate(ptr, item, patch, local_e);
+ if (!local_e) {
+ contained = true;
+ break;
+ }
+ }
+ if (!contained)
+ e.error(ptr, instance, "array does not contain required element as per 'contains'");
+ }
+ }
+
+public:
+ array(json &sch, root_schema *root, const std::vector<nlohmann::json_uri> &uris)
+ : schema(root)
+ {
+ auto attr = sch.find("maxItems");
+ if (attr != sch.end()) {
+ maxItems_ = {true, attr.value().get<size_t>()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("minItems");
+ if (attr != sch.end()) {
+ minItems_ = {true, attr.value().get<size_t>()};
+ sch.erase(attr);
+ }
+
+ attr = sch.find("uniqueItems");
+ if (attr != sch.end()) {
+ uniqueItems_ = attr.value().get<bool>();
+ sch.erase(attr);
+ }
+
+ attr = sch.find("items");
+ if (attr != sch.end()) {
+
+ if (attr.value().type() == json::value_t::array) {
+ size_t c = 0;
+ for (auto &subsch : attr.value())
+ items_.push_back(schema::make(subsch, root, {"items", std::to_string(c++)}, uris));
+
+ auto attr_add = sch.find("additionalItems");
+ if (attr_add != sch.end()) {
+ additionalItems_ = schema::make(attr_add.value(), root, {"additionalItems"}, uris);
+ sch.erase(attr_add);
+ }
+
+ } else if (attr.value().type() == json::value_t::object ||
+ attr.value().type() == json::value_t::boolean)
+ items_schema_ = schema::make(attr.value(), root, {"items"}, uris);
+
+ sch.erase(attr);
+ }
+
+ attr = sch.find("contains");
+ if (attr != sch.end()) {
+ contains_ = schema::make(attr.value(), root, {"contains"}, uris);
+ sch.erase(attr);
+ }
+ }
+};
+
+std::shared_ptr<schema> type_schema::make(json &schema,
+ json::value_t type,
+ root_schema *root,
+ const std::vector<nlohmann::json_uri> &uris,
+ std::set<std::string> &kw)
+{
+ switch (type) {
+ case json::value_t::null:
+ return std::make_shared<null>(schema, root);
+
+ case json::value_t::number_unsigned:
+ case json::value_t::number_integer:
+ return std::make_shared<numeric<json::number_integer_t>>(schema, root, kw);
+ case json::value_t::number_float:
+ return std::make_shared<numeric<json::number_float_t>>(schema, root, kw);
+ case json::value_t::string:
+ return std::make_shared<string>(schema, root);
+ case json::value_t::boolean:
+ return std::make_shared<boolean_type>(schema, root);
+ case json::value_t::object:
+ return std::make_shared<object>(schema, root, uris);
+ case json::value_t::array:
+ return std::make_shared<array>(schema, root, uris);
+
+ case json::value_t::discarded: // not a real type - silence please
+ break;
+
+ case json::value_t::binary:
+ break;
+ }
+ return nullptr;
+}
+} // namespace
+
+namespace
+{
+
+std::shared_ptr<schema> schema::make(json &schema,
+ root_schema *root,
+ const std::vector<std::string> &keys,
+ std::vector<nlohmann::json_uri> uris)
+{
+ // remove URIs which contain plain name identifiers, as sub-schemas cannot be referenced
+ for (auto uri = uris.begin(); uri != uris.end();)
+ if (uri->identifier() != "")
+ uri = uris.erase(uri);
+ else
+ uri++;
+
+ // append to all URIs the keys for this sub-schema
+ for (auto &key : keys)
+ for (auto &uri : uris)
+ uri = uri.append(key);
+
+ std::shared_ptr<::schema> sch;
+
+ // boolean schema
+ if (schema.type() == json::value_t::boolean)
+ sch = std::make_shared<boolean>(schema, root);
+ else if (schema.type() == json::value_t::object) {
+
+ auto attr = schema.find("$id"); // if $id is present, this schema can be referenced by this ID
+ // as an additional URI
+ if (attr != schema.end()) {
+ if (std::find(uris.begin(),
+ uris.end(),
+ attr.value().get<std::string>()) == uris.end())
+ uris.push_back(uris.back().derive(attr.value().get<std::string>())); // so add it to the list if it is not there already
+ schema.erase(attr);
+ }
+
+ attr = schema.find("definitions");
+ if (attr != schema.end()) {
+ for (auto &def : attr.value().items())
+ schema::make(def.value(), root, {"definitions", def.key()}, uris);
+ schema.erase(attr);
+ }
+
+ attr = schema.find("$ref");
+ if (attr != schema.end()) { // this schema is a reference
+ // the last one on the uri-stack is the last id seen before coming here,
+ // so this is the origial URI for this reference, the $ref-value has thus be resolved from it
+ auto id = uris.back().derive(attr.value().get<std::string>());
+ sch = root->get_or_create_ref(id);
+
+ schema.erase(attr);
+
+ // special case where we break draft-7 and allow overriding of properties when a $ref is used
+ attr = schema.find("default");
+ if (attr != schema.end()) {
+ // copy the referenced schema depending on the underlying type and modify the default value
+ if (auto new_sch = sch->make_for_default_(sch, root, uris, attr.value())) {
+ sch = new_sch;
+ }
+ schema.erase(attr);
+ }
+ } else {
+ sch = std::make_shared<type_schema>(schema, root, uris);
+ }
+
+ schema.erase("$schema");
+ schema.erase("title");
+ schema.erase("description");
+ } else {
+ throw std::invalid_argument("invalid JSON-type for a schema for " + uris[0].to_string() + ", expected: boolean or object");
+ }
+
+ for (auto &uri : uris) { // for all URIs this schema is referenced by
+ root->insert(uri, sch);
+
+ if (schema.type() == json::value_t::object)
+ for (auto &u : schema.items())
+ root->insert_unknown_keyword(uri, u.key(), u.value()); // insert unknown keywords for later reference
+ }
+ return sch;
+}
+
+class throwing_error_handler : public error_handler
+{
+ void error(const json::json_pointer &ptr, const json &instance, const std::string &message) override
+ {
+ throw std::invalid_argument(std::string("At ") + ptr.to_string() + " of " + instance.dump() + " - " + message + "\n");
+ }
+};
+
+} // namespace
+
+namespace nlohmann
+{
+namespace json_schema
+{
+
+json_validator::json_validator(schema_loader loader,
+ format_checker format,
+ content_checker content)
+ : root_(std::unique_ptr<root_schema>(new root_schema(std::move(loader),
+ std::move(format),
+ std::move(content))))
+{
+}
+
+json_validator::json_validator(const json &schema,
+ schema_loader loader,
+ format_checker format,
+ content_checker content)
+ : json_validator(std::move(loader),
+ std::move(format),
+ std::move(content))
+{
+ set_root_schema(schema);
+}
+
+json_validator::json_validator(json &&schema,
+ schema_loader loader,
+ format_checker format,
+ content_checker content)
+
+ : json_validator(std::move(loader),
+ std::move(format),
+ std::move(content))
+{
+ set_root_schema(std::move(schema));
+}
+
+// move constructor, destructor and move assignment operator can be defaulted here
+// where root_schema is a complete type
+json_validator::json_validator(json_validator &&) = default;
+json_validator::~json_validator() = default;
+json_validator &json_validator::operator=(json_validator &&) = default;
+
+void json_validator::set_root_schema(const json &schema)
+{
+ root_->set_root_schema(schema);
+}
+
+void json_validator::set_root_schema(json &&schema)
+{
+ root_->set_root_schema(std::move(schema));
+}
+
+json json_validator::validate(const json &instance) const
+{
+ throwing_error_handler err;
+ return validate(instance, err);
+}
+
+json json_validator::validate(const json &instance, error_handler &err, const json_uri &initial_uri) const
+{
+ json::json_pointer ptr;
+ json_patch patch;
+ root_->validate(ptr, instance, patch, err, initial_uri);
+ return patch;
+}
+
+} // namespace json_schema
+} // namespace nlohmann
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.cpp b/src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.cpp
new file mode 100644
index 0000000..5ddd811
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.cpp
@@ -0,0 +1,792 @@
+/*
+
+Snarfed from <https://github.com/gene-hightower/smtp-address-validator>
+
+<http://opensource.org/licenses/MIT>:
+
+Copyright (c) 2021 Gene Hightower
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+*/
+
+#include "smtp-address-validator.hpp"
+
+static const signed char _address_actions[] = {
+ 0, 1, 0, 1, 1, 0};
+
+static const short _address_key_offsets[] = {
+ 0, 0, 24, 26, 50, 52, 54, 56,
+ 58, 60, 62, 86, 103, 105, 107, 109,
+ 111, 113, 115, 117, 134, 150, 161, 168,
+ 176, 180, 181, 190, 195, 196, 201, 202,
+ 207, 210, 213, 219, 222, 225, 228, 234,
+ 237, 240, 243, 249, 252, 261, 270, 282,
+ 293, 302, 311, 320, 328, 345, 353, 360,
+ 367, 368, 375, 382, 389, 396, 397, 404,
+ 411, 418, 425, 426, 433, 440, 447, 454,
+ 455, 462, 469, 476, 483, 484, 491, 498,
+ 505, 512, 513, 523, 531, 538, 545, 546,
+ 552, 559, 566, 573, 581, 589, 597, 608,
+ 618, 626, 634, 641, 649, 657, 665, 667,
+ 673, 681, 689, 697, 699, 705, 713, 721,
+ 729, 731, 737, 745, 753, 761, 763, 769,
+ 777, 785, 793, 795, 802, 812, 821, 829,
+ 837, 839, 848, 857, 865, 873, 875, 884,
+ 893, 901, 909, 911, 920, 929, 937, 945,
+ 947, 956, 965, 974, 983, 992, 1004, 1015,
+ 1024, 1033, 1042, 1051, 1060, 1072, 1083, 1092,
+ 1101, 1109, 1118, 1127, 1136, 1148, 1159, 1168,
+ 1177, 1185, 1194, 1203, 1212, 1224, 1235, 1244,
+ 1253, 1261, 1270, 1279, 1288, 1300, 1311, 1320,
+ 1329, 1337, 1339, 1353, 1355, 1357, 1359, 1361,
+ 1363, 1365, 1367, 1368, 1370, 1388, 0};
+
+static const signed char _address_trans_keys[] = {
+ -32, -19, -16, -12, 34, 45, 61, 63,
+ -62, -33, -31, -17, -15, -13, 33, 39,
+ 42, 43, 47, 57, 65, 90, 94, 126,
+ -128, -65, -32, -19, -16, -12, 33, 46,
+ 61, 64, -62, -33, -31, -17, -15, -13,
+ 35, 39, 42, 43, 45, 57, 63, 90,
+ 94, 126, -96, -65, -128, -65, -128, -97,
+ -112, -65, -128, -65, -128, -113, -32, -19,
+ -16, -12, 33, 45, 61, 63, -62, -33,
+ -31, -17, -15, -13, 35, 39, 42, 43,
+ 47, 57, 65, 90, 94, 126, -32, -19,
+ -16, -12, 91, -62, -33, -31, -17, -15,
+ -13, 48, 57, 65, 90, 97, 122, -128,
+ -65, -96, -65, -128, -65, -128, -97, -112,
+ -65, -128, -65, -128, -113, -32, -19, -16,
+ -12, 45, -62, -33, -31, -17, -15, -13,
+ 48, 57, 65, 90, 97, 122, -32, -19,
+ -16, -12, -62, -33, -31, -17, -15, -13,
+ 48, 57, 65, 90, 97, 122, 45, 48,
+ 49, 50, 73, 51, 57, 65, 90, 97,
+ 122, 45, 48, 57, 65, 90, 97, 122,
+ 45, 58, 48, 57, 65, 90, 97, 122,
+ 33, 90, 94, 126, 93, 45, 46, 58,
+ 48, 57, 65, 90, 97, 122, 48, 49,
+ 50, 51, 57, 46, 48, 49, 50, 51,
+ 57, 46, 48, 49, 50, 51, 57, 93,
+ 48, 57, 93, 48, 57, 53, 93, 48,
+ 52, 54, 57, 93, 48, 53, 46, 48,
+ 57, 46, 48, 57, 46, 53, 48, 52,
+ 54, 57, 46, 48, 53, 46, 48, 57,
+ 46, 48, 57, 46, 53, 48, 52, 54,
+ 57, 46, 48, 53, 45, 46, 58, 48,
+ 57, 65, 90, 97, 122, 45, 46, 58,
+ 48, 57, 65, 90, 97, 122, 45, 46,
+ 53, 58, 48, 52, 54, 57, 65, 90,
+ 97, 122, 45, 46, 58, 48, 53, 54,
+ 57, 65, 90, 97, 122, 45, 58, 80,
+ 48, 57, 65, 90, 97, 122, 45, 58,
+ 118, 48, 57, 65, 90, 97, 122, 45,
+ 54, 58, 48, 57, 65, 90, 97, 122,
+ 45, 58, 48, 57, 65, 90, 97, 122,
+ 58, 33, 47, 48, 57, 59, 64, 65,
+ 70, 71, 90, 94, 96, 97, 102, 103,
+ 126, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 48, 57, 65, 70, 97, 102,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 48, 57, 65, 70, 97, 102, 58, 48,
+ 57, 65, 70, 97, 102, 58, 48, 57,
+ 65, 70, 97, 102, 58, 58, 48, 57,
+ 65, 70, 97, 102, 58, 48, 57, 65,
+ 70, 97, 102, 58, 48, 57, 65, 70,
+ 97, 102, 58, 48, 57, 65, 70, 97,
+ 102, 58, 58, 48, 57, 65, 70, 97,
+ 102, 58, 48, 57, 65, 70, 97, 102,
+ 58, 48, 57, 65, 70, 97, 102, 58,
+ 48, 57, 65, 70, 97, 102, 58, 58,
+ 48, 57, 65, 70, 97, 102, 58, 48,
+ 57, 65, 70, 97, 102, 58, 48, 57,
+ 65, 70, 97, 102, 58, 48, 57, 65,
+ 70, 97, 102, 58, 58, 48, 57, 65,
+ 70, 97, 102, 58, 48, 57, 65, 70,
+ 97, 102, 58, 48, 57, 65, 70, 97,
+ 102, 58, 48, 57, 65, 70, 97, 102,
+ 58, 48, 49, 50, 58, 51, 57, 65,
+ 70, 97, 102, 46, 58, 48, 57, 65,
+ 70, 97, 102, 58, 48, 57, 65, 70,
+ 97, 102, 58, 48, 57, 65, 70, 97,
+ 102, 58, 48, 57, 65, 70, 97, 102,
+ 93, 48, 57, 65, 70, 97, 102, 93,
+ 48, 57, 65, 70, 97, 102, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 48,
+ 57, 65, 70, 97, 102, 46, 58, 48,
+ 57, 65, 70, 97, 102, 46, 58, 48,
+ 57, 65, 70, 97, 102, 46, 53, 58,
+ 48, 52, 54, 57, 65, 70, 97, 102,
+ 46, 58, 48, 53, 54, 57, 65, 70,
+ 97, 102, 46, 58, 48, 57, 65, 70,
+ 97, 102, 46, 58, 48, 57, 65, 70,
+ 97, 102, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 58, 48, 57, 65, 70,
+ 97, 102, 48, 49, 50, 93, 51, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 49, 50, 51, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 49, 50, 51, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 49, 50, 51, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 49, 50, 51, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 53, 58, 93, 48, 52, 54, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 53, 54, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 53, 58, 93,
+ 48, 52, 54, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 53, 54, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 53, 58, 93, 48, 52, 54, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 53, 54, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 46, 58, 93, 48, 57, 65, 70,
+ 97, 102, 46, 58, 93, 48, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 53, 58, 93,
+ 48, 52, 54, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 53, 54, 57, 65,
+ 70, 97, 102, 46, 58, 93, 48, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 57, 65, 70, 97, 102, 58, 93, 48,
+ 57, 65, 70, 97, 102, 46, 58, 93,
+ 48, 57, 65, 70, 97, 102, 46, 58,
+ 93, 48, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 53, 58, 93, 48, 52, 54, 57,
+ 65, 70, 97, 102, 46, 58, 93, 48,
+ 53, 54, 57, 65, 70, 97, 102, 46,
+ 58, 93, 48, 57, 65, 70, 97, 102,
+ 46, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, 48, 57, 65, 70, 97,
+ 102, 58, 93, -32, -19, -16, -12, 34,
+ 92, -62, -33, -31, -17, -15, -13, 32,
+ 126, -128, -65, -96, -65, -128, -65, -128,
+ -97, -112, -65, -128, -65, -128, -113, 64,
+ 32, 126, -32, -19, -16, -12, 45, 46,
+ -62, -33, -31, -17, -15, -13, 48, 57,
+ 65, 90, 97, 122, 0};
+
+static const signed char _address_single_lengths[] = {
+ 0, 8, 0, 8, 0, 0, 0, 0,
+ 0, 0, 8, 5, 0, 0, 0, 0,
+ 0, 0, 0, 5, 4, 5, 1, 2,
+ 0, 1, 3, 3, 1, 3, 1, 3,
+ 1, 1, 2, 1, 1, 1, 2, 1,
+ 1, 1, 2, 1, 3, 3, 4, 3,
+ 3, 3, 3, 2, 1, 2, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 4, 2, 1, 1, 1, 0,
+ 1, 1, 1, 2, 2, 2, 3, 2,
+ 2, 2, 1, 2, 2, 2, 2, 0,
+ 2, 2, 2, 2, 0, 2, 2, 2,
+ 2, 0, 2, 2, 2, 2, 0, 2,
+ 2, 2, 2, 1, 4, 3, 2, 2,
+ 2, 3, 3, 2, 2, 2, 3, 3,
+ 2, 2, 2, 3, 3, 2, 2, 2,
+ 3, 3, 3, 3, 3, 4, 3, 3,
+ 3, 3, 3, 3, 4, 3, 3, 3,
+ 2, 3, 3, 3, 4, 3, 3, 3,
+ 2, 3, 3, 3, 4, 3, 3, 3,
+ 2, 3, 3, 3, 4, 3, 3, 3,
+ 2, 2, 6, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 6, 0, 0};
+
+static const signed char _address_range_lengths[] = {
+ 0, 8, 1, 8, 1, 1, 1, 1,
+ 1, 1, 8, 6, 1, 1, 1, 1,
+ 1, 1, 1, 6, 6, 3, 3, 3,
+ 2, 0, 3, 1, 0, 1, 0, 1,
+ 1, 1, 2, 1, 1, 1, 2, 1,
+ 1, 1, 2, 1, 3, 3, 4, 4,
+ 3, 3, 3, 3, 8, 3, 3, 3,
+ 0, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 0,
+ 3, 3, 3, 3, 0, 3, 3, 3,
+ 3, 0, 3, 3, 3, 3, 0, 3,
+ 3, 3, 3, 3, 3, 3, 4, 4,
+ 3, 3, 3, 3, 3, 3, 0, 3,
+ 3, 3, 3, 0, 3, 3, 3, 3,
+ 0, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 3,
+ 0, 3, 3, 3, 3, 0, 3, 3,
+ 3, 3, 0, 3, 3, 3, 3, 0,
+ 3, 3, 3, 3, 3, 4, 4, 3,
+ 3, 3, 3, 3, 4, 4, 3, 3,
+ 3, 3, 3, 3, 4, 4, 3, 3,
+ 3, 3, 3, 3, 4, 4, 3, 3,
+ 3, 3, 3, 3, 4, 4, 3, 3,
+ 3, 0, 4, 1, 1, 1, 1, 1,
+ 1, 1, 0, 1, 6, 0, 0};
+
+static const short _address_index_offsets[] = {
+ 0, 0, 17, 19, 36, 38, 40, 42,
+ 44, 46, 48, 65, 77, 79, 81, 83,
+ 85, 87, 89, 91, 103, 114, 123, 128,
+ 134, 137, 139, 146, 151, 153, 158, 160,
+ 165, 168, 171, 176, 179, 182, 185, 190,
+ 193, 196, 199, 204, 207, 214, 221, 230,
+ 238, 245, 252, 259, 265, 275, 281, 286,
+ 291, 293, 298, 303, 308, 313, 315, 320,
+ 325, 330, 335, 337, 342, 347, 352, 357,
+ 359, 364, 369, 374, 379, 381, 386, 391,
+ 396, 401, 403, 411, 417, 422, 427, 429,
+ 433, 438, 443, 448, 454, 460, 466, 474,
+ 481, 487, 493, 498, 504, 510, 516, 519,
+ 523, 529, 535, 541, 544, 548, 554, 560,
+ 566, 569, 573, 579, 585, 591, 594, 598,
+ 604, 610, 616, 619, 624, 632, 639, 645,
+ 651, 654, 661, 668, 674, 680, 683, 690,
+ 697, 703, 709, 712, 719, 726, 732, 738,
+ 741, 748, 755, 762, 769, 776, 785, 793,
+ 800, 807, 814, 821, 828, 837, 845, 852,
+ 859, 865, 872, 879, 886, 895, 903, 910,
+ 917, 923, 930, 937, 944, 953, 961, 968,
+ 975, 981, 988, 995, 1002, 1011, 1019, 1026,
+ 1033, 1039, 1042, 1053, 1055, 1057, 1059, 1061,
+ 1063, 1065, 1067, 1069, 1071, 1084, 0};
+
+static const short _address_cond_targs[] = {
+ 4, 6, 7, 9, 186, 3, 3, 3,
+ 2, 5, 8, 3, 3, 3, 3, 3,
+ 0, 3, 0, 4, 6, 7, 9, 3,
+ 10, 3, 11, 2, 5, 8, 3, 3,
+ 3, 3, 3, 0, 2, 0, 2, 0,
+ 2, 0, 5, 0, 5, 0, 5, 0,
+ 4, 6, 7, 9, 3, 3, 3, 3,
+ 2, 5, 8, 3, 3, 3, 3, 3,
+ 0, 13, 15, 16, 18, 21, 12, 14,
+ 17, 196, 196, 196, 0, 196, 0, 12,
+ 0, 12, 0, 12, 0, 14, 0, 14,
+ 0, 14, 0, 13, 15, 16, 18, 19,
+ 12, 14, 17, 196, 196, 196, 0, 13,
+ 15, 16, 18, 12, 14, 17, 196, 196,
+ 196, 0, 22, 26, 44, 46, 48, 45,
+ 23, 23, 0, 22, 23, 23, 23, 0,
+ 22, 24, 23, 23, 23, 0, 25, 25,
+ 0, 197, 0, 22, 27, 24, 23, 23,
+ 23, 0, 28, 40, 42, 41, 0, 29,
+ 0, 30, 36, 38, 37, 0, 31, 0,
+ 25, 32, 34, 33, 0, 197, 33, 0,
+ 197, 25, 0, 35, 197, 33, 25, 0,
+ 197, 25, 0, 31, 37, 0, 31, 30,
+ 0, 31, 39, 37, 30, 0, 31, 30,
+ 0, 29, 41, 0, 29, 28, 0, 29,
+ 43, 41, 28, 0, 29, 28, 0, 22,
+ 27, 24, 45, 23, 23, 0, 22, 27,
+ 24, 26, 23, 23, 0, 22, 27, 47,
+ 24, 45, 26, 23, 23, 0, 22, 27,
+ 24, 26, 23, 23, 23, 0, 22, 24,
+ 49, 23, 23, 23, 0, 22, 24, 50,
+ 23, 23, 23, 0, 22, 51, 24, 23,
+ 23, 23, 0, 22, 52, 23, 23, 23,
+ 0, 185, 25, 53, 25, 53, 25, 25,
+ 53, 25, 0, 57, 197, 54, 54, 54,
+ 0, 57, 55, 55, 55, 0, 57, 56,
+ 56, 56, 0, 57, 0, 124, 58, 58,
+ 58, 0, 62, 59, 59, 59, 0, 62,
+ 60, 60, 60, 0, 62, 61, 61, 61,
+ 0, 62, 0, 124, 63, 63, 63, 0,
+ 67, 64, 64, 64, 0, 67, 65, 65,
+ 65, 0, 67, 66, 66, 66, 0, 67,
+ 0, 124, 68, 68, 68, 0, 72, 69,
+ 69, 69, 0, 72, 70, 70, 70, 0,
+ 72, 71, 71, 71, 0, 72, 0, 124,
+ 73, 73, 73, 0, 77, 74, 74, 74,
+ 0, 77, 75, 75, 75, 0, 77, 76,
+ 76, 76, 0, 77, 0, 98, 78, 78,
+ 78, 0, 82, 79, 79, 79, 0, 82,
+ 80, 80, 80, 0, 82, 81, 81, 81,
+ 0, 82, 0, 83, 91, 94, 98, 97,
+ 123, 123, 0, 27, 87, 84, 84, 84,
+ 0, 87, 85, 85, 85, 0, 87, 86,
+ 86, 86, 0, 87, 0, 88, 88, 88,
+ 0, 197, 89, 89, 89, 0, 197, 90,
+ 90, 90, 0, 197, 25, 25, 25, 0,
+ 27, 87, 92, 84, 84, 0, 27, 87,
+ 93, 85, 85, 0, 27, 87, 86, 86,
+ 86, 0, 27, 95, 87, 92, 96, 84,
+ 84, 0, 27, 87, 93, 85, 85, 85,
+ 0, 27, 87, 85, 85, 85, 0, 27,
+ 87, 96, 84, 84, 0, 197, 99, 99,
+ 99, 0, 103, 197, 100, 100, 100, 0,
+ 103, 197, 101, 101, 101, 0, 103, 197,
+ 102, 102, 102, 0, 103, 197, 0, 104,
+ 104, 104, 0, 108, 197, 105, 105, 105,
+ 0, 108, 197, 106, 106, 106, 0, 108,
+ 197, 107, 107, 107, 0, 108, 197, 0,
+ 109, 109, 109, 0, 113, 197, 110, 110,
+ 110, 0, 113, 197, 111, 111, 111, 0,
+ 113, 197, 112, 112, 112, 0, 113, 197,
+ 0, 114, 114, 114, 0, 118, 197, 115,
+ 115, 115, 0, 118, 197, 116, 116, 116,
+ 0, 118, 197, 117, 117, 117, 0, 118,
+ 197, 0, 119, 119, 119, 0, 87, 197,
+ 120, 120, 120, 0, 87, 197, 121, 121,
+ 121, 0, 87, 197, 122, 122, 122, 0,
+ 87, 197, 0, 87, 84, 84, 84, 0,
+ 125, 177, 180, 197, 183, 184, 184, 0,
+ 27, 129, 197, 126, 126, 126, 0, 129,
+ 197, 127, 127, 127, 0, 129, 197, 128,
+ 128, 128, 0, 129, 197, 0, 130, 169,
+ 172, 175, 176, 176, 0, 27, 134, 197,
+ 131, 131, 131, 0, 134, 197, 132, 132,
+ 132, 0, 134, 197, 133, 133, 133, 0,
+ 134, 197, 0, 135, 161, 164, 167, 168,
+ 168, 0, 27, 139, 197, 136, 136, 136,
+ 0, 139, 197, 137, 137, 137, 0, 139,
+ 197, 138, 138, 138, 0, 139, 197, 0,
+ 140, 153, 156, 159, 160, 160, 0, 27,
+ 144, 197, 141, 141, 141, 0, 144, 197,
+ 142, 142, 142, 0, 144, 197, 143, 143,
+ 143, 0, 144, 197, 0, 145, 146, 149,
+ 152, 119, 119, 0, 27, 87, 197, 120,
+ 120, 120, 0, 27, 87, 197, 147, 120,
+ 120, 0, 27, 87, 197, 148, 121, 121,
+ 0, 27, 87, 197, 122, 122, 122, 0,
+ 27, 150, 87, 197, 147, 151, 120, 120,
+ 0, 27, 87, 197, 148, 121, 121, 121,
+ 0, 27, 87, 197, 121, 121, 121, 0,
+ 27, 87, 197, 151, 120, 120, 0, 27,
+ 144, 197, 154, 141, 141, 0, 27, 144,
+ 197, 155, 142, 142, 0, 27, 144, 197,
+ 143, 143, 143, 0, 27, 157, 144, 197,
+ 154, 158, 141, 141, 0, 27, 144, 197,
+ 155, 142, 142, 142, 0, 27, 144, 197,
+ 142, 142, 142, 0, 27, 144, 197, 158,
+ 141, 141, 0, 144, 197, 141, 141, 141,
+ 0, 27, 139, 197, 162, 136, 136, 0,
+ 27, 139, 197, 163, 137, 137, 0, 27,
+ 139, 197, 138, 138, 138, 0, 27, 165,
+ 139, 197, 162, 166, 136, 136, 0, 27,
+ 139, 197, 163, 137, 137, 137, 0, 27,
+ 139, 197, 137, 137, 137, 0, 27, 139,
+ 197, 166, 136, 136, 0, 139, 197, 136,
+ 136, 136, 0, 27, 134, 197, 170, 131,
+ 131, 0, 27, 134, 197, 171, 132, 132,
+ 0, 27, 134, 197, 133, 133, 133, 0,
+ 27, 173, 134, 197, 170, 174, 131, 131,
+ 0, 27, 134, 197, 171, 132, 132, 132,
+ 0, 27, 134, 197, 132, 132, 132, 0,
+ 27, 134, 197, 174, 131, 131, 0, 134,
+ 197, 131, 131, 131, 0, 27, 129, 197,
+ 178, 126, 126, 0, 27, 129, 197, 179,
+ 127, 127, 0, 27, 129, 197, 128, 128,
+ 128, 0, 27, 181, 129, 197, 178, 182,
+ 126, 126, 0, 27, 129, 197, 179, 127,
+ 127, 127, 0, 27, 129, 197, 127, 127,
+ 127, 0, 27, 129, 197, 182, 126, 126,
+ 0, 129, 197, 126, 126, 126, 0, 124,
+ 197, 0, 188, 190, 191, 193, 194, 195,
+ 187, 189, 192, 186, 0, 186, 0, 187,
+ 0, 187, 0, 187, 0, 189, 0, 189,
+ 0, 189, 0, 11, 0, 186, 0, 13,
+ 15, 16, 18, 19, 20, 12, 14, 17,
+ 196, 196, 196, 0, 0, 0, 1, 2,
+ 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 126, 127, 128, 129, 130,
+ 131, 132, 133, 134, 135, 136, 137, 138,
+ 139, 140, 141, 142, 143, 144, 145, 146,
+ 147, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 157, 158, 159, 160, 161, 162,
+ 163, 164, 165, 166, 167, 168, 169, 170,
+ 171, 172, 173, 174, 175, 176, 177, 178,
+ 179, 180, 181, 182, 183, 184, 185, 186,
+ 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196, 197, 0};
+
+static const signed char _address_cond_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 3, 0, 3, 0, 3,
+ 0, 3, 0, 3, 0, 3, 0, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 3, 1, 3, 0,
+ 3, 0, 3, 0, 3, 0, 3, 0,
+ 3, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 3, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 3,
+ 0, 0, 0, 0, 0, 3, 0, 0,
+ 3, 1, 3, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 0, 3, 0,
+ 3, 0, 0, 0, 0, 3, 0, 3,
+ 0, 0, 0, 0, 3, 1, 0, 3,
+ 1, 0, 3, 0, 1, 0, 0, 3,
+ 1, 0, 3, 0, 0, 3, 0, 0,
+ 3, 0, 0, 0, 0, 3, 0, 0,
+ 3, 0, 0, 3, 0, 0, 3, 0,
+ 0, 0, 0, 3, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 1, 0, 0, 0,
+ 3, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 3, 0, 3, 0, 0, 0,
+ 0, 3, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 3, 0, 0, 0, 0,
+ 3, 0, 3, 0, 0, 0, 0, 3,
+ 0, 0, 0, 0, 3, 0, 0, 0,
+ 0, 3, 0, 0, 0, 0, 3, 0,
+ 3, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 3,
+ 0, 0, 0, 0, 3, 0, 3, 0,
+ 0, 0, 0, 3, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 3, 0, 3, 0, 0, 0,
+ 0, 3, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 3, 0, 0, 0, 0,
+ 3, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 3, 0, 3, 0, 0, 0,
+ 3, 1, 0, 0, 0, 3, 1, 0,
+ 0, 0, 3, 1, 0, 0, 0, 3,
+ 0, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 3, 1, 0, 0,
+ 0, 3, 0, 1, 0, 0, 0, 3,
+ 0, 1, 0, 0, 0, 3, 0, 1,
+ 0, 0, 0, 3, 0, 1, 3, 0,
+ 0, 0, 3, 0, 1, 0, 0, 0,
+ 3, 0, 1, 0, 0, 0, 3, 0,
+ 1, 0, 0, 0, 3, 0, 1, 3,
+ 0, 0, 0, 3, 0, 1, 0, 0,
+ 0, 3, 0, 1, 0, 0, 0, 3,
+ 0, 1, 0, 0, 0, 3, 0, 1,
+ 3, 0, 0, 0, 3, 0, 1, 0,
+ 0, 0, 3, 0, 1, 0, 0, 0,
+ 3, 0, 1, 0, 0, 0, 3, 0,
+ 1, 3, 0, 0, 0, 3, 0, 1,
+ 0, 0, 0, 3, 0, 1, 0, 0,
+ 0, 3, 0, 1, 0, 0, 0, 3,
+ 0, 1, 3, 0, 0, 0, 0, 3,
+ 0, 0, 0, 1, 0, 0, 0, 3,
+ 0, 0, 1, 0, 0, 0, 3, 0,
+ 1, 0, 0, 0, 3, 0, 1, 0,
+ 0, 0, 3, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 3, 0, 0, 1,
+ 0, 0, 0, 3, 0, 1, 0, 0,
+ 0, 3, 0, 1, 0, 0, 0, 3,
+ 0, 1, 3, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 1, 0, 0, 0,
+ 3, 0, 1, 0, 0, 0, 3, 0,
+ 1, 0, 0, 0, 3, 0, 1, 3,
+ 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 1, 0, 0, 0, 3, 0, 1,
+ 0, 0, 0, 3, 0, 1, 0, 0,
+ 0, 3, 0, 1, 3, 0, 0, 0,
+ 0, 0, 0, 3, 0, 0, 1, 0,
+ 0, 0, 3, 0, 0, 1, 0, 0,
+ 0, 3, 0, 0, 1, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 3,
+ 0, 0, 0, 1, 0, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 3,
+ 0, 0, 1, 0, 0, 0, 3, 0,
+ 0, 1, 0, 0, 0, 3, 0, 0,
+ 1, 0, 0, 0, 3, 0, 0, 1,
+ 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 0, 3, 0, 0, 1,
+ 0, 0, 0, 0, 3, 0, 0, 1,
+ 0, 0, 0, 3, 0, 0, 1, 0,
+ 0, 0, 3, 0, 1, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 3,
+ 0, 0, 1, 0, 0, 0, 3, 0,
+ 0, 1, 0, 0, 0, 3, 0, 0,
+ 0, 1, 0, 0, 0, 0, 3, 0,
+ 0, 1, 0, 0, 0, 0, 3, 0,
+ 0, 1, 0, 0, 0, 3, 0, 0,
+ 1, 0, 0, 0, 3, 0, 1, 0,
+ 0, 0, 3, 0, 0, 1, 0, 0,
+ 0, 3, 0, 0, 1, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 3,
+ 0, 0, 0, 1, 0, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 0,
+ 3, 0, 0, 1, 0, 0, 0, 3,
+ 0, 0, 1, 0, 0, 0, 3, 0,
+ 1, 0, 0, 0, 3, 0, 0, 1,
+ 0, 0, 0, 3, 0, 0, 1, 0,
+ 0, 0, 3, 0, 0, 1, 0, 0,
+ 0, 3, 0, 0, 0, 1, 0, 0,
+ 0, 0, 3, 0, 0, 1, 0, 0,
+ 0, 0, 3, 0, 0, 1, 0, 0,
+ 0, 3, 0, 0, 1, 0, 0, 0,
+ 3, 0, 1, 0, 0, 0, 3, 0,
+ 1, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0, 3, 0,
+ 3, 0, 3, 0, 3, 0, 3, 0,
+ 3, 0, 3, 0, 3, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 3, 3, 0, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 0, 0, 0};
+
+static const short _address_eof_trans[] = {
+ 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093,
+ 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101,
+ 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109,
+ 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117,
+ 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125,
+ 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133,
+ 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141,
+ 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,
+ 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157,
+ 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165,
+ 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173,
+ 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181,
+ 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189,
+ 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197,
+ 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205,
+ 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213,
+ 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221,
+ 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229,
+ 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237,
+ 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245,
+ 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253,
+ 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261,
+ 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269,
+ 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277,
+ 1278, 1279, 1280, 1281, 1282, 1283, 0};
+
+static const int address_start = 1;
+
+bool is_address(const char *p, const char *pe)
+{
+ int cs = 0;
+
+ const char *eof = pe;
+
+ bool result = false;
+
+ {
+ cs = (int) address_start;
+ }
+ {
+ int _klen;
+ unsigned int _trans = 0;
+ const signed char *_keys;
+ const signed char *_acts;
+ unsigned int _nacts;
+ _resume : {
+ }
+ if (p == pe && p != eof)
+ goto _out;
+ if (p == eof) {
+ if (_address_eof_trans[cs] > 0) {
+ _trans = (unsigned int) _address_eof_trans[cs] - 1;
+ }
+ } else {
+ _keys = (_address_trans_keys + (_address_key_offsets[cs]));
+ _trans = (unsigned int) _address_index_offsets[cs];
+
+ _klen = (int) _address_single_lengths[cs];
+ if (_klen > 0) {
+ const signed char *_lower = _keys;
+ const signed char *_upper = _keys + _klen - 1;
+ const signed char *_mid;
+ while (1) {
+ if (_upper < _lower) {
+ _keys += _klen;
+ _trans += (unsigned int) _klen;
+ break;
+ }
+
+ _mid = _lower + ((_upper - _lower) >> 1);
+ if (((*(p))) < (*(_mid)))
+ _upper = _mid - 1;
+ else if (((*(p))) > (*(_mid)))
+ _lower = _mid + 1;
+ else {
+ _trans += (unsigned int) (_mid - _keys);
+ goto _match;
+ }
+ }
+ }
+
+ _klen = (int) _address_range_lengths[cs];
+ if (_klen > 0) {
+ const signed char *_lower = _keys;
+ const signed char *_upper = _keys + (_klen << 1) - 2;
+ const signed char *_mid;
+ while (1) {
+ if (_upper < _lower) {
+ _trans += (unsigned int) _klen;
+ break;
+ }
+
+ _mid = _lower + (((_upper - _lower) >> 1) & ~1);
+ if (((*(p))) < (*(_mid)))
+ _upper = _mid - 2;
+ else if (((*(p))) > (*(_mid + 1)))
+ _lower = _mid + 2;
+ else {
+ _trans += (unsigned int) ((_mid - _keys) >> 1);
+ break;
+ }
+ }
+ }
+
+ _match : {
+ }
+ }
+ cs = (int) _address_cond_targs[_trans];
+
+ if (_address_cond_actions[_trans] != 0) {
+
+ _acts = (_address_actions + (_address_cond_actions[_trans]));
+ _nacts = (unsigned int) (*(_acts));
+ _acts += 1;
+ while (_nacts > 0) {
+ switch ((*(_acts))) {
+ case 0: {
+ {
+ result = true;
+ }
+ break;
+ }
+ case 1: {
+ {
+ result = false;
+ }
+ break;
+ }
+ }
+ _nacts -= 1;
+ _acts += 1;
+ }
+ }
+
+ if (p == eof) {
+ if (cs >= 196)
+ goto _out;
+ } else {
+ if (cs != 0) {
+ p += 1;
+ goto _resume;
+ }
+ }
+ _out : {
+ }
+ }
+ return result;
+}
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.hpp b/src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.hpp
new file mode 100644
index 0000000..8d3c12b
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/smtp-address-validator.hpp
@@ -0,0 +1,34 @@
+#ifndef SMTP_ADDRESS_PARSER_HPP_INCLUDED
+#define SMTP_ADDRESS_PARSER_HPP_INCLUDED
+
+/*
+
+Snarfed from <https://github.com/gene-hightower/smtp-address-validator>
+
+<http://opensource.org/licenses/MIT>:
+
+Copyright (c) 2021 Gene Hightower
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+*/
+
+bool is_address(const char *p, const char *pe);
+
+#endif // SMTP_ADDRESS_PARSER_HPP_INCLUDED
diff --git a/src/backend/utils/dbms/dbms_json_schema/vendor/string-format-check.cpp b/src/backend/utils/dbms/dbms_json_schema/vendor/string-format-check.cpp
new file mode 100644
index 0000000..ecc428f
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_json_schema/vendor/string-format-check.cpp
@@ -0,0 +1,414 @@
+#include <nlohmann/json-schema.hpp>
+
+#include "smtp-address-validator.hpp"
+
+#include <algorithm>
+#include <exception>
+#include <iostream>
+#include <regex>
+#include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
+
+#ifdef JSON_SCHEMA_BOOST_REGEX
+# include <boost/regex.hpp>
+# define REGEX_NAMESPACE boost
+#elif defined(JSON_SCHEMA_NO_REGEX)
+# define NO_STD_REGEX
+#else
+# include <regex>
+# define REGEX_NAMESPACE std
+#endif
+
+/**
+ * Many of the RegExes are from @see http://jmrware.com/articles/2009/uri_regexp/URI_regex.html
+ */
+
+namespace
+{
+template <typename T>
+void range_check(const T value, const T min, const T max)
+{
+ if (!((value >= min) && (value <= max))) {
+ std::stringstream out;
+ out << "Value " << value << " should be in interval [" << min << "," << max << "] but is not!";
+ throw std::invalid_argument(out.str());
+ }
+}
+
+/** @see date_time_check */
+void rfc3339_date_check(const std::string &value)
+{
+ const static REGEX_NAMESPACE::regex dateRegex{R"(^([0-9]{4})\-([0-9]{2})\-([0-9]{2})$)"};
+
+ REGEX_NAMESPACE::smatch matches;
+ if (!REGEX_NAMESPACE::regex_match(value, matches, dateRegex)) {
+ throw std::invalid_argument(value + " is not a date string according to RFC 3339.");
+ }
+
+ const auto year = std::stoi(matches[1].str());
+ const auto month = std::stoi(matches[2].str());
+ const auto mday = std::stoi(matches[3].str());
+
+ const auto isLeapYear = (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
+
+ range_check(month, 1, 12);
+ if (month == 2) {
+ range_check(mday, 1, isLeapYear ? 29 : 28);
+ } else if (month <= 7) {
+ range_check(mday, 1, month % 2 == 0 ? 30 : 31);
+ } else {
+ range_check(mday, 1, month % 2 == 0 ? 31 : 30);
+ }
+}
+
+/** @see date_time_check */
+void rfc3339_time_check(const std::string &value)
+{
+ const static REGEX_NAMESPACE::regex timeRegex{R"(^([0-9]{2})\:([0-9]{2})\:([0-9]{2})(\.[0-9]+)?(?:[Zz]|((?:\+|\-)[0-9]{2})\:([0-9]{2}))$)"};
+
+ REGEX_NAMESPACE::smatch matches;
+ if (!REGEX_NAMESPACE::regex_match(value, matches, timeRegex)) {
+ throw std::invalid_argument(value + " is not a time string according to RFC 3339.");
+ }
+
+ auto hour = std::stoi(matches[1].str());
+ auto minute = std::stoi(matches[2].str());
+ auto second = std::stoi(matches[3].str());
+ // const auto secfrac = std::stof( matches[4].str() );
+
+ range_check(hour, 0, 23);
+ range_check(minute, 0, 59);
+
+ int offsetHour = 0,
+ offsetMinute = 0;
+
+ /* don't check the numerical offset if time zone is specified as 'Z' */
+ if (!matches[5].str().empty()) {
+ offsetHour = std::stoi(matches[5].str());
+ offsetMinute = std::stoi(matches[6].str());
+
+ range_check(offsetHour, -23, 23);
+ range_check(offsetMinute, 0, 59);
+ if (offsetHour < 0)
+ offsetMinute *= -1;
+ }
+
+ /**
+ * @todo Could be made more exact by querying a leap second database and choosing the
+ * correct maximum in {58,59,60}. This current solution might match some invalid dates
+ * but it won't lead to false negatives. This only works if we know the full date, however
+ */
+
+ auto day_minutes = hour * 60 + minute - (offsetHour * 60 + offsetMinute);
+ if (day_minutes < 0)
+ day_minutes += 60 * 24;
+ hour = day_minutes % 24;
+ minute = day_minutes / 24;
+
+ if (hour == 23 && minute == 59)
+ range_check(second, 0, 60); // possible leap-second
+ else
+ range_check(second, 0, 59);
+}
+
+/**
+ * @see https://tools.ietf.org/html/rfc3339#section-5.6
+ *
+ * @verbatim
+ * date-fullyear = 4DIGIT
+ * date-month = 2DIGIT ; 01-12
+ * date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
+ * ; month/year
+ * time-hour = 2DIGIT ; 00-23
+ * time-minute = 2DIGIT ; 00-59
+ * time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
+ * ; rules
+ * time-secfrac = "." 1*DIGIT
+ * time-numoffset = ("+" / "-") time-hour ":" time-minute
+ * time-offset = "Z" / time-numoffset
+ *
+ * partial-time = time-hour ":" time-minute ":" time-second
+ * [time-secfrac]
+ * full-date = date-fullyear "-" date-month "-" date-mday
+ * full-time = partial-time time-offset
+ *
+ * date-time = full-date "T" full-time
+ * @endverbatim
+ * NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
+ * syntax may alternatively be lower case "t" or "z" respectively.
+ */
+void rfc3339_date_time_check(const std::string &value)
+{
+ const static REGEX_NAMESPACE::regex dateTimeRegex{R"(^([0-9]{4}\-[0-9]{2}\-[0-9]{2})[Tt]([0-9]{2}\:[0-9]{2}\:[0-9]{2}(?:\.[0-9]+)?(?:[Zz]|(?:\+|\-)[0-9]{2}\:[0-9]{2}))$)"};
+
+ REGEX_NAMESPACE::smatch matches;
+ if (!REGEX_NAMESPACE::regex_match(value, matches, dateTimeRegex)) {
+ throw std::invalid_argument(value + " is not a date-time string according to RFC 3339.");
+ }
+
+ rfc3339_date_check(matches[1].str());
+ rfc3339_time_check(matches[2].str());
+}
+
+const std::string decOctet{R"((?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]))"}; // matches numbers 0-255
+const std::string ipv4Address{"(?:" + decOctet + R"(\.){3})" + decOctet};
+const std::string h16{R"([0-9A-Fa-f]{1,4})"};
+const std::string h16Left{"(?:" + h16 + ":)"};
+const std::string ipv6Address{
+ "(?:"
+ "(?:" +
+ h16Left + "{6}"
+ "|::" +
+ h16Left + "{5}"
+ "|(?:" +
+ h16 + ")?::" + h16Left + "{4}"
+ "|(?:" +
+ h16Left + "{0,1}" + h16 + ")?::" + h16Left + "{3}"
+ "|(?:" +
+ h16Left + "{0,2}" + h16 + ")?::" + h16Left + "{2}"
+ "|(?:" +
+ h16Left + "{0,3}" + h16 + ")?::" + h16Left +
+ "|(?:" + h16Left + "{0,4}" + h16 + ")?::"
+ ")(?:" +
+ h16Left + h16 + "|" + ipv4Address + ")"
+ "|(?:" +
+ h16Left + "{0,5}" + h16 + ")?::" + h16 +
+ "|(?:" + h16Left + "{0,6}" + h16 + ")?::"
+ ")"};
+const std::string ipvFuture{R"([Vv][0-9A-Fa-f]+\.[A-Za-z0-9\-._~!$&'()*+,;=:]+)"};
+const std::string regName{R"((?:[A-Za-z0-9\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*)"};
+const std::string host{
+ "(?:"
+ R"(\[(?:)" +
+ ipv6Address + "|" + ipvFuture + R"()\])" +
+ "|" + ipv4Address +
+ "|" + regName +
+ ")"};
+
+const std::string uuid{R"([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})"};
+
+// from http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
+const std::string hostname{R"(^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$)"};
+
+bool is_ascii(std::string const &value)
+{
+ for (auto ch : value) {
+ if (ch & 0x80) {
+ return false;
+ }
+ }
+ return true;
+}
+
+/**
+ * @see
+ *
+ * @verbatim
+ * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
+ *
+ * hier-part = "//" authority path-abempty
+ * / path-absolute
+ * / path-rootless
+ * / path-empty
+ *
+ * URI-reference = URI / relative-ref
+ *
+ * absolute-URI = scheme ":" hier-part [ "?" query ]
+ *
+ * relative-ref = relative-part [ "?" query ] [ "#" fragment ]
+ *
+ * relative-part = "//" authority path-abempty
+ * / path-absolute
+ * / path-noscheme
+ * / path-empty
+ *
+ * scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
+ *
+ * authority = [ userinfo "@" ] host [ ":" port ]
+ * userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
+ * host = IP-literal / IPv4address / reg-name
+ * port = *DIGIT
+ *
+ * IP-literal = "[" ( IPv6address / IPvFuture ) "]"
+ *
+ * IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
+ *
+ * IPv6address = 6( h16 ":" ) ls32
+ * / "::" 5( h16 ":" ) ls32
+ * / [ h16 ] "::" 4( h16 ":" ) ls32
+ * / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
+ * / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
+ * / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
+ * / [ *4( h16 ":" ) h16 ] "::" ls32
+ * / [ *5( h16 ":" ) h16 ] "::" h16
+ * / [ *6( h16 ":" ) h16 ] "::"
+ *
+ * h16 = 1*4HEXDIG
+ * ls32 = ( h16 ":" h16 ) / IPv4address
+ * IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
+ * dec-octet = DIGIT ; 0-9
+ * / %x31-39 DIGIT ; 10-99
+ * / "1" 2DIGIT ; 100-199
+ * / "2" %x30-34 DIGIT ; 200-249
+ * / "25" %x30-35 ; 250-255
+ *
+ * reg-name = *( unreserved / pct-encoded / sub-delims )
+ *
+ * path = path-abempty ; begins with "/" or is empty
+ * / path-absolute ; begins with "/" but not "//"
+ * / path-noscheme ; begins with a non-colon segment
+ * / path-rootless ; begins with a segment
+ * / path-empty ; zero characters
+ *
+ * path-abempty = *( "/" segment )
+ * path-absolute = "/" [ segment-nz *( "/" segment ) ]
+ * path-noscheme = segment-nz-nc *( "/" segment )
+ * path-rootless = segment-nz *( "/" segment )
+ * path-empty = 0<pchar>
+ *
+ * segment = *pchar
+ * segment-nz = 1*pchar
+ * segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
+ * ; non-zero-length segment without any colon ":"
+ *
+ * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
+ *
+ * query = *( pchar / "/" / "?" )
+ *
+ * fragment = *( pchar / "/" / "?" )
+ *
+ * pct-encoded = "%" HEXDIG HEXDIG
+ *
+ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
+ * reserved = gen-delims / sub-delims
+ * gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
+ * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
+ * / "*" / "+" / "," / ";" / "="
+ *
+ * @endverbatim
+ * @see adapted from: https://github.com/jhermsmeier/uri.regex/blob/master/uri.regex
+ *
+ */
+void rfc3986_uri_check(const std::string &value)
+{
+ const static std::string scheme{R"(([A-Za-z][A-Za-z0-9+\-.]*):)"};
+ const static std::string hierPart{
+ R"((?:(\/\/)(?:((?:[A-Za-z0-9\-._~!$&'()*+,;=:]|)"
+ R"(%[0-9A-Fa-f]{2})*)@)?((?:\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|)"
+ R"(::(?:[0-9A-Fa-f]{1,4}:){5}|)"
+ R"((?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|)"
+ R"((?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|)"
+ R"((?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|)"
+ R"((?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|)"
+ R"((?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|)"
+ R"((?:(?:25[0-5]|2[0-4][0-9]|)"
+ R"([01]?[0-9][0-9]?)\.){3}(?:25[0-5]|)"
+ R"(2[0-4][0-9]|)"
+ R"([01]?[0-9][0-9]?))|)"
+ R"((?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|)"
+ R"((?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|)"
+ R"([Vv][0-9A-Fa-f]+\.[A-Za-z0-9\-._~!$&'()*+,;=:]+)\]|)"
+ R"((?:(?:25[0-5]|)"
+ R"(2[0-4][0-9]|)"
+ R"([01]?[0-9][0-9]?)\.){3}(?:25[0-5]|)"
+ R"(2[0-4][0-9]|)"
+ R"([01]?[0-9][0-9]?)|)"
+ R"((?:[A-Za-z0-9\-._~!$&'()*+,;=]|)"
+ R"(%[0-9A-Fa-f]{2})*))(?::([0-9]*))?((?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|)"
+ R"(%[0-9A-Fa-f]{2})*)*)|)"
+ R"(\/((?:(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|)"
+ R"(%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|)"
+ R"(%[0-9A-Fa-f]{2})*)*)?)|)"
+ R"(((?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|)"
+ R"(%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|)"
+ R"(%[0-9A-Fa-f]{2})*)*)|))"};
+
+ const static std::string query{R"((?:\?((?:[A-Za-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9A-Fa-f]{2})*))?)"};
+ const static std::string fragment{
+ R"((?:\#((?:[A-Za-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9A-Fa-f]{2})*))?)"};
+ const static std::string uriFormat{scheme + hierPart + query + fragment};
+
+ const static REGEX_NAMESPACE::regex uriRegex{uriFormat};
+
+ if (!REGEX_NAMESPACE::regex_match(value, uriRegex)) {
+ throw std::invalid_argument(value + " is not a URI string according to RFC 3986.");
+ }
+}
+
+} // namespace
+
+namespace nlohmann
+{
+namespace json_schema
+{
+/**
+ * Checks validity for built-ins by converting the definitions given as ABNF in the linked RFC from
+ * @see https://json-schema.org/understanding-json-schema/reference/string.html#built-in-formats
+ * into regular expressions using @see https://www.msweet.org/abnf/ and some manual editing.
+ *
+ * @see https://json-schema.org/latest/json-schema-validation.html
+ */
+void default_string_format_check(const std::string &format, const std::string &value)
+{
+ if (format == "date-time") {
+ rfc3339_date_time_check(value);
+ } else if (format == "date") {
+ rfc3339_date_check(value);
+ } else if (format == "time") {
+ rfc3339_time_check(value);
+ } else if (format == "uri") {
+ rfc3986_uri_check(value);
+ } else if (format == "email") {
+ if (!is_ascii(value)) {
+ throw std::invalid_argument(value + " contains non-ASCII values, not RFC 5321 compliant.");
+ }
+ if (!is_address(&*value.begin(), &*value.end())) {
+ throw std::invalid_argument(value + " is not a valid email according to RFC 5321.");
+ }
+ } else if (format == "idn-email") {
+ if (!is_address(&*value.begin(), &*value.end())) {
+ throw std::invalid_argument(value + " is not a valid idn-email according to RFC 6531.");
+ }
+ } else if (format == "hostname") {
+ static const REGEX_NAMESPACE::regex hostRegex{hostname};
+ if (!REGEX_NAMESPACE::regex_match(value, hostRegex)) {
+ throw std::invalid_argument(value + " is not a valid hostname according to RFC 3986 Appendix A.");
+ }
+ } else if (format == "ipv4") {
+ const static REGEX_NAMESPACE::regex ipv4Regex{"^" + ipv4Address + "$"};
+ if (!REGEX_NAMESPACE::regex_match(value, ipv4Regex)) {
+ throw std::invalid_argument(value + " is not an IPv4 string according to RFC 2673.");
+ }
+ } else if (format == "ipv6") {
+ static const REGEX_NAMESPACE::regex ipv6Regex{ipv6Address};
+ if (!REGEX_NAMESPACE::regex_match(value, ipv6Regex)) {
+ throw std::invalid_argument(value + " is not an IPv6 string according to RFC 5954.");
+ }
+ } else if (format == "uuid") {
+ static const REGEX_NAMESPACE::regex uuidRegex{uuid};
+ if (!REGEX_NAMESPACE::regex_match(value, uuidRegex)) {
+ throw std::invalid_argument(value + " is not an uuid string according to RFC 4122.");
+ }
+ } else if (format == "regex") {
+ try {
+ REGEX_NAMESPACE::regex re(value, std::regex::ECMAScript);
+ } catch (std::exception &exception) {
+ throw exception;
+ }
+ } else {
+ /* yet unsupported JSON schema draft 7 built-ins */
+ static const std::vector<std::string> jsonSchemaStringFormatBuiltIns{
+ "date-time", "time", "date", "email", "idn-email", "hostname", "idn-hostname", "ipv4", "ipv6", "uri",
+ "uri-reference", "iri", "iri-reference", "uri-template", "json-pointer", "relative-json-pointer", "regex"};
+ if (std::find(jsonSchemaStringFormatBuiltIns.begin(), jsonSchemaStringFormatBuiltIns.end(), format) != jsonSchemaStringFormatBuiltIns.end()) {
+ throw std::logic_error("JSON schema string format built-in " + format + " not yet supported. " +
+ "Please open an issue or use a custom format checker.");
+ }
+
+ throw std::logic_error("Don't know how to validate " + format);
+ }
+}
+} // namespace json_schema
+} // namespace nlohmann
diff --git a/src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.cpp b/src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.cpp
new file mode 100644
index 0000000..02c9303
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.cpp
@@ -0,0 +1,1376 @@
+#include "dbms_sqlset.hpp"
+
+extern "C"
+{
+#include "access/htup_details.h"
+#include "access/tupdesc.h"
+#include "catalog/pg_type_d.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/lsyscache.h"
+#include "utils/memutils.h"
+#include "utils/numeric.h"
+#include "utils/typcache.h"
+#include "miscadmin.h"
+} // extern "C"
+
+#include <algorithm>
+#include <cmath>
+#include <cctype>
+#include <cerrno>
+#include <cstdlib>
+#include <iterator>
+#include <limits>
+#include <optional>
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+namespace
+{
+constexpr int32 kDbmsSqlsetModeReplaceOldStats = 1;
+constexpr int32 kDbmsSqlsetModeAccumulateStats = 2;
+constexpr char kDbmsSqlsetHasRecursiveSql[] = "Y";
+constexpr char kDbmsSqlsetNoRecursiveSql[] = "N";
+constexpr int32 kDbmsSqlsetSingleExecution = 1;
+constexpr int32 kDbmsSqlsetAllExecutions = 2;
+constexpr int32 kDbmsSqlsetLimitedCommandType = 1;
+constexpr int32 kDbmsSqlsetAllCommandType = 2;
+constexpr int32 kDbmsSqlsetStsStgtab102Version = 1;
+constexpr int32 kDbmsSqlsetStsStgtab111Version = 2;
+constexpr int32 kDbmsSqlsetStsStgtab112Version = 3;
+constexpr int32 kDbmsSqlsetStsStgtab121Version = 5;
+constexpr int32 kDbmsSqlsetStsStgtab122Version = 6;
+
+enum class SqlsetFieldKind
+{
+ Text,
+ Numeric,
+ Raw
+};
+
+struct SqlsetFieldDef
+{
+ const char* name;
+ SqlsetFieldKind kind;
+ bool updateable;
+ bool accumulable;
+ bool basic_visible;
+ Oid type_oid;
+};
+
+struct SqlsetRow
+{
+ std::string sql_id;
+ int64 plan_hash_value = -1;
+ std::unordered_map<std::string, std::optional<std::string>> scalar_fields;
+};
+
+struct Sqlset
+{
+ std::string owner;
+ std::optional<std::string> description;
+ std::vector<SqlsetRow> rows;
+ std::unordered_map<std::string, size_t> row_index;
+};
+
+enum class SqlsetLoadOption
+{
+ Insert,
+ Update,
+ Merge
+};
+
+enum class SqlsetUpdateOption
+{
+ Replace,
+ Accumulate
+};
+
+enum class SqlsetAttributeList
+{
+ Basic,
+ Typical,
+ All
+};
+
+std::unordered_map<std::string, Sqlset>& sqlset_store();
+std::string build_sqlset_key(const std::string& owner, const std::string& name);
+
+constexpr SqlsetFieldDef kSqlsetFieldDefs[] = {
+ {"sql_id", SqlsetFieldKind::Text, false, false, true, TEXTOID},
+ {"force_matching_signature", SqlsetFieldKind::Numeric, true, false, true, NUMERICOID},
+ {"sql_text", SqlsetFieldKind::Text, false, false, true, TEXTOID},
+ {"parsing_schema_name", SqlsetFieldKind::Text, false, false, true, TEXTOID},
+ {"module", SqlsetFieldKind::Text, false, false, true, TEXTOID},
+ {"action", SqlsetFieldKind::Text, false, false, true, TEXTOID},
+ {"elapsed_time", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"cpu_time", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"buffer_gets", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"disk_reads", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"direct_writes", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"rows_processed", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"fetches", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"executions", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"end_of_fetch_count", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"optimizer_cost", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"optimizer_env", SqlsetFieldKind::Raw, true, false, false, BYTEAOID},
+ {"priority", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"command_type", SqlsetFieldKind::Numeric, true, false, true, NUMERICOID},
+ {"first_load_time", SqlsetFieldKind::Text, true, false, false, TEXTOID},
+ {"stat_period", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"active_stat_period", SqlsetFieldKind::Numeric, true, true, false, NUMERICOID},
+ {"other", SqlsetFieldKind::Text, true, false, false, TEXTOID},
+ {"plan_hash_value", SqlsetFieldKind::Numeric, false, false, true, NUMERICOID},
+ {"con_dbid", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"last_exec_start_time", SqlsetFieldKind::Text, true, false, false, TEXTOID},
+ {"sharable_mem", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"exact_matching_signature", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"result_cache_executions", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"sql_profile", SqlsetFieldKind::Text, true, false, false, TEXTOID},
+ {"sql_plan_baseline", SqlsetFieldKind::Text, true, false, false, TEXTOID},
+ {"sql_patch", SqlsetFieldKind::Text, true, false, false, TEXTOID},
+ {"avg_hard_parse_time", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"user_io_wait_time", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"io_interconnect_bytes", SqlsetFieldKind::Numeric, true, false, false, NUMERICOID},
+ {"parsing_user_name", SqlsetFieldKind::Text, false, false, false, TEXTOID},
+};
+
+constexpr size_t kSqlsetFieldCount = sizeof(kSqlsetFieldDefs) / sizeof(kSqlsetFieldDefs[0]);
+} // namespace
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_sqlset_mode_replace_old_stats);
+PG_FUNCTION_INFO_V1(dbms_sqlset_mode_accumulate_stats);
+PG_FUNCTION_INFO_V1(dbms_sqlset_has_recursive_sql);
+PG_FUNCTION_INFO_V1(dbms_sqlset_no_recursive_sql);
+PG_FUNCTION_INFO_V1(dbms_sqlset_single_execution);
+PG_FUNCTION_INFO_V1(dbms_sqlset_all_executions);
+PG_FUNCTION_INFO_V1(dbms_sqlset_limited_command_type);
+PG_FUNCTION_INFO_V1(dbms_sqlset_all_command_type);
+PG_FUNCTION_INFO_V1(dbms_sqlset_sts_stgtab_10_2_version);
+PG_FUNCTION_INFO_V1(dbms_sqlset_sts_stgtab_11_1_version);
+PG_FUNCTION_INFO_V1(dbms_sqlset_sts_stgtab_11_2_version);
+PG_FUNCTION_INFO_V1(dbms_sqlset_sts_stgtab_12_1_version);
+PG_FUNCTION_INFO_V1(dbms_sqlset_sts_stgtab_12_2_version);
+PG_FUNCTION_INFO_V1(dbms_sqlset_get_version);
+PG_FUNCTION_INFO_V1(dbms_sqlset_add_reference);
+PG_FUNCTION_INFO_V1(dbms_sqlset_create_sqlset);
+PG_FUNCTION_INFO_V1(dbms_sqlset_select_cursor_cache);
+PG_FUNCTION_INFO_V1(dbms_sqlset_select_sqlpa_task);
+PG_FUNCTION_INFO_V1(dbms_sqlset_select_sqlset);
+PG_FUNCTION_INFO_V1(dbms_sqlset_normalize_attribute_list);
+PG_FUNCTION_INFO_V1(dbms_sqlset_select_sql_trace);
+PG_FUNCTION_INFO_V1(dbms_sqlset_select_workload_repository_0);
+PG_FUNCTION_INFO_V1(dbms_sqlset_select_workload_repository_1);
+PG_FUNCTION_INFO_V1(dbms_sqlset_capture_cursor_cache);
+PG_FUNCTION_INFO_V1(dbms_sqlset_create_sqlset_proc);
+PG_FUNCTION_INFO_V1(dbms_sqlset_create_stgtab);
+PG_FUNCTION_INFO_V1(dbms_sqlset_delete_sqlset);
+PG_FUNCTION_INFO_V1(dbms_sqlset_drop_sqlset);
+PG_FUNCTION_INFO_V1(dbms_sqlset_drop_sqlset_by_prefix);
+PG_FUNCTION_INFO_V1(dbms_sqlset_load_sqlset);
+PG_FUNCTION_INFO_V1(dbms_sqlset_pack_stgtab);
+PG_FUNCTION_INFO_V1(dbms_sqlset_remap_stgtab);
+PG_FUNCTION_INFO_V1(dbms_sqlset_remove_reference);
+PG_FUNCTION_INFO_V1(dbms_sqlset_unpack_stgtab);
+PG_FUNCTION_INFO_V1(dbms_sqlset_update_sqlset_0);
+PG_FUNCTION_INFO_V1(dbms_sqlset_update_sqlset_1);
+PG_FUNCTION_INFO_V1(dbms_sqlset_update_sqlset_2);
+
+/// @brief Версия RUDB пакета DBMS_SQLSET (Oracle DBMS_SQLSET пакет)
+#define RUDB_DBMS_SQLSET_VERSION "1.0.0"
+} // extern "C"
+
+namespace
+{
+const SqlsetFieldDef*
+find_field_def(const char* name)
+{
+ for (const SqlsetFieldDef& field : kSqlsetFieldDefs)
+ {
+ if (pg_strcasecmp(field.name, name) == 0)
+ return &field;
+ }
+
+ return nullptr;
+}
+
+std::string
+text_to_std_string(const text* value)
+{
+ char* cstring_value = text_to_cstring(value);
+ std::string result(cstring_value);
+ pfree(cstring_value);
+ return result;
+}
+
+std::optional<std::string>
+pg_arg_text_optional(FunctionCallInfo fcinfo, int argno)
+{
+ if (argno >= fcinfo->nargs || PG_ARGISNULL(argno))
+ return std::nullopt;
+
+ std::string value = text_to_std_string(PG_GETARG_TEXT_PP(argno));
+ if (value.empty())
+ return std::nullopt;
+
+ return value;
+}
+
+std::optional<Numeric>
+pg_arg_numeric_optional(FunctionCallInfo fcinfo, int argno)
+{
+ if (argno >= fcinfo->nargs || PG_ARGISNULL(argno))
+ return std::nullopt;
+
+ return PG_GETARG_NUMERIC(argno);
+}
+
+std::string
+current_user_name()
+{
+ const char* user_name = GetUserNameFromId(GetUserId(), false);
+ return user_name != nullptr ? user_name : "";
+}
+
+std::optional<std::string>
+normalize_owner_argument(const std::optional<std::string>& owner_argument)
+{
+ if (!owner_argument.has_value() || owner_argument->empty())
+ return current_user_name();
+
+ if (pg_strcasecmp(owner_argument->c_str(), current_user_name().c_str()) != 0)
+ return std::nullopt;
+
+ return current_user_name();
+}
+
+std::string
+require_sqlset_name(const std::optional<std::string>& name, bool allow_generate, bool& generated,
+ const std::string& owner)
+{
+ generated = false;
+
+ if (name.has_value() && !name->empty())
+ return *name;
+
+ if (!allow_generate)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_NAME),
+ errmsg("ORA-13755: invalid \"SQL Tuning Set\" name")));
+
+ generated = true;
+
+ int64& next_generated_id = []() -> int64& {
+ static int64 next_id = 1;
+ return next_id;
+ }();
+
+ std::string generated_name;
+ do
+ {
+ generated_name = "STS_" + std::to_string(next_generated_id++);
+ } while (sqlset_store().find(build_sqlset_key(owner, generated_name)) != sqlset_store().end());
+
+ return generated_name;
+}
+
+std::unordered_map<std::string, Sqlset>&
+sqlset_store()
+{
+ static std::unordered_map<std::string, Sqlset> sqlsets;
+ return sqlsets;
+}
+
+std::string
+build_sqlset_key(const std::string& owner, const std::string& name)
+{
+ return owner + '\x1f' + name;
+}
+
+std::optional<std::string>
+canonicalize_numeric_text(const std::optional<std::string>& value)
+{
+ if (!value.has_value())
+ return std::nullopt;
+
+ Datum numeric_value = DirectFunctionCall3(numeric_in,
+ CStringGetDatum(value->c_str()),
+ ObjectIdGetDatum(0),
+ Int32GetDatum(-1));
+ char* canonical = DatumGetCString(DirectFunctionCall1(numeric_out, numeric_value));
+ std::string result(canonical);
+ pfree(canonical);
+ return result;
+}
+
+std::string
+numeric_to_std_string(Numeric value)
+{
+ char* numeric_value = DatumGetCString(DirectFunctionCall1(numeric_out, NumericGetDatum(value)));
+ std::string result(numeric_value);
+ pfree(numeric_value);
+ return result;
+}
+
+Numeric
+int32_to_numeric(int32 value)
+{
+ return DatumGetNumeric(DirectFunctionCall1(int4_numeric, Int32GetDatum(value)));
+}
+
+Numeric
+int64_to_numeric(int64 value)
+{
+ return DatumGetNumeric(DirectFunctionCall1(int8_numeric, Int64GetDatum(value)));
+}
+
+bool
+numeric_eq_value(Numeric lhs, Numeric rhs)
+{
+ return DatumGetBool(DirectFunctionCall2(numeric_eq, NumericGetDatum(lhs), NumericGetDatum(rhs)));
+}
+
+bool
+numeric_lt_value(Numeric lhs, Numeric rhs)
+{
+ return DatumGetBool(DirectFunctionCall2(numeric_lt, NumericGetDatum(lhs), NumericGetDatum(rhs)));
+}
+
+bool
+numeric_gt_value(Numeric lhs, Numeric rhs)
+{
+ return DatumGetBool(DirectFunctionCall2(numeric_gt, NumericGetDatum(lhs), NumericGetDatum(rhs)));
+}
+
+bool
+numeric_is_integer_value(Numeric value)
+{
+ Numeric truncated = DatumGetNumeric(DirectFunctionCall2(
+ numeric_trunc, NumericGetDatum(value), Int32GetDatum(0)));
+ return numeric_eq_value(value, truncated);
+}
+
+Datum
+string_to_datum(const std::string& value, SqlsetFieldKind kind)
+{
+ switch (kind)
+ {
+ case SqlsetFieldKind::Text:
+ return CStringGetTextDatum(value.c_str());
+ case SqlsetFieldKind::Numeric:
+ return DirectFunctionCall3(numeric_in,
+ CStringGetDatum(value.c_str()),
+ ObjectIdGetDatum(0),
+ Int32GetDatum(-1));
+ case SqlsetFieldKind::Raw:
+ return DirectFunctionCall1(byteain, CStringGetDatum(value.c_str()));
+ }
+
+ return PointerGetDatum(nullptr);
+}
+
+std::optional<std::string>
+datum_to_string(Datum value, Oid type_oid)
+{
+ Oid output_function = InvalidOid;
+ bool type_is_varlena = false;
+ getTypeOutputInfo(type_oid, &output_function, &type_is_varlena);
+
+ char* text_value = OidOutputFunctionCall(output_function, value);
+ std::string result(text_value);
+ pfree(text_value);
+ return result;
+}
+
+int64
+parse_int64_text(const std::string& text_value, const char* field_name)
+{
+ errno = 0;
+ char* end = nullptr;
+ const long long parsed = std::strtoll(text_value.c_str(), &end, 10);
+ if (errno != 0 || end == text_value.c_str() || *end != '\0')
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("неверное числовое значение для %s: %s", field_name, text_value.c_str())));
+
+ return static_cast<int64>(parsed);
+}
+
+SqlsetRow
+parse_sqlset_row_tuple(HeapTuple tuple, TupleDesc tuple_desc);
+
+SqlsetRow
+parse_sqlset_row_composite(Datum value, Oid type_oid, int32 typmod)
+{
+ TupleDesc nested_desc = lookup_rowtype_tupdesc_copy(type_oid, typmod);
+ HeapTupleHeader header = DatumGetHeapTupleHeader(value);
+ HeapTupleData nested_tuple;
+ MemSet(&nested_tuple, 0, sizeof(nested_tuple));
+ nested_tuple.t_len = HeapTupleHeaderGetDatumLength(header);
+ nested_tuple.t_data = header;
+ nested_tuple.t_tableOid = InvalidOid;
+
+ PG_TRY();
+ {
+ SqlsetRow row = parse_sqlset_row_tuple(&nested_tuple, nested_desc);
+ FreeTupleDesc(nested_desc);
+ return row;
+ }
+ PG_CATCH();
+ {
+ FreeTupleDesc(nested_desc);
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+}
+
+SqlsetRow
+parse_sqlset_row_tuple(HeapTuple tuple, TupleDesc tuple_desc)
+{
+ SqlsetRow row;
+
+ if (tuple_desc->natts == 1)
+ {
+ Form_pg_attribute attr = TupleDescAttr(tuple_desc, 0);
+ if (type_is_rowtype(attr->atttypid))
+ {
+ bool is_null = false;
+ Datum composite_value = heap_getattr(tuple, 1, tuple_desc, &is_null);
+ if (is_null)
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET получил пустую строку SQLSET_ROW")));
+
+ return parse_sqlset_row_composite(composite_value, attr->atttypid, attr->atttypmod);
+ }
+ }
+
+ for (int attno = 0; attno < tuple_desc->natts; ++attno)
+ {
+ Form_pg_attribute attr = TupleDescAttr(tuple_desc, attno);
+ if (attr->attisdropped)
+ continue;
+
+ bool is_null = false;
+ Datum value = heap_getattr(tuple, attno + 1, tuple_desc, &is_null);
+ const char* field_name = NameStr(attr->attname);
+ const SqlsetFieldDef* field = find_field_def(field_name);
+
+ if (pg_strcasecmp(field_name, "sql_id") == 0)
+ {
+ if (!is_null)
+ row.sql_id = datum_to_string(value, attr->atttypid).value();
+ continue;
+ }
+
+ if (pg_strcasecmp(field_name, "plan_hash_value") == 0)
+ {
+ if (is_null)
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET требует plan_hash_value")));
+
+ row.plan_hash_value =
+ parse_int64_text(datum_to_string(value, attr->atttypid).value(), "plan_hash_value");
+ continue;
+ }
+
+ if (pg_strcasecmp(field_name, "object_list") == 0 || pg_strcasecmp(field_name, "bind_data") == 0 ||
+ pg_strcasecmp(field_name, "sql_plan") == 0 || pg_strcasecmp(field_name, "bind_list") == 0)
+ {
+ if (!is_null)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET не поддерживает столбец \"%s\"", field_name)));
+
+ continue;
+ }
+
+ if (field == nullptr)
+ {
+ if (!is_null)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET не поддерживает столбец \"%s\"", field_name)));
+ continue;
+ }
+
+ if (is_null)
+ {
+ row.scalar_fields[field->name] = std::nullopt;
+ continue;
+ }
+
+ std::optional<std::string> field_value = datum_to_string(value, attr->atttypid);
+ if (field->kind == SqlsetFieldKind::Numeric)
+ field_value = canonicalize_numeric_text(field_value);
+
+ row.scalar_fields[field->name] = field_value;
+ }
+
+ if (row.sql_id.empty())
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET требует sql_id")));
+
+ if (row.plan_hash_value < 0)
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET требует plan_hash_value")));
+
+ return row;
+}
+
+const std::optional<std::string>*
+find_scalar_field(const SqlsetRow& row, const char* field_name)
+{
+ auto it = row.scalar_fields.find(field_name);
+ if (it == row.scalar_fields.end())
+ return nullptr;
+
+ return &it->second;
+}
+
+std::optional<std::string>*
+mutable_scalar_field(SqlsetRow& row, const char* field_name)
+{
+ auto it = row.scalar_fields.find(field_name);
+ if (it == row.scalar_fields.end())
+ return nullptr;
+
+ return &it->second;
+}
+
+void
+apply_scalar_update(SqlsetRow& existing, const SqlsetRow& incoming, const SqlsetFieldDef& field,
+ SqlsetUpdateOption update_option, bool ignore_null)
+{
+ if (!field.updateable)
+ return;
+
+ const std::optional<std::string>* source = find_scalar_field(incoming, field.name);
+ if (source == nullptr)
+ return;
+
+ std::optional<std::string>* target = mutable_scalar_field(existing, field.name);
+ if (target == nullptr)
+ target = &existing.scalar_fields[field.name];
+
+ if (!source->has_value())
+ {
+ if (!ignore_null)
+ target->reset();
+ return;
+ }
+
+ if (update_option == SqlsetUpdateOption::Accumulate && field.accumulable)
+ {
+ if (target->has_value())
+ {
+ const std::string lhs = canonicalize_numeric_text(*target).value();
+ const std::string rhs = canonicalize_numeric_text(*source).value();
+ Datum lhs_numeric = DirectFunctionCall3(numeric_in,
+ CStringGetDatum(lhs.c_str()),
+ ObjectIdGetDatum(0),
+ Int32GetDatum(-1));
+ Datum rhs_numeric = DirectFunctionCall3(numeric_in,
+ CStringGetDatum(rhs.c_str()),
+ ObjectIdGetDatum(0),
+ Int32GetDatum(-1));
+ char* accumulated = DatumGetCString(DirectFunctionCall1(
+ numeric_out, DirectFunctionCall2(numeric_add, lhs_numeric, rhs_numeric)));
+ *target = std::string(accumulated);
+ pfree(accumulated);
+ }
+ else
+ {
+ *target = canonicalize_numeric_text(*source);
+ }
+ return;
+ }
+
+ *target = *source;
+}
+
+void
+apply_sqlset_row_update(SqlsetRow& existing, const SqlsetRow& incoming, SqlsetUpdateOption update_option,
+ bool ignore_null)
+{
+ for (const SqlsetFieldDef& field : kSqlsetFieldDefs)
+ apply_scalar_update(existing, incoming, field, update_option, ignore_null);
+}
+
+bool
+attribute_list_includes_field(SqlsetAttributeList attribute_mode, const SqlsetFieldDef& field)
+{
+ if (attribute_mode == SqlsetAttributeList::Typical)
+ return true;
+
+ return field.basic_visible;
+}
+
+void
+fill_sqlset_tuple_values(const SqlsetRow& row,
+ SqlsetAttributeList attribute_mode,
+ Datum* values,
+ bool* nulls)
+{
+ for (size_t idx = 0; idx < kSqlsetFieldCount; ++idx)
+ {
+ const SqlsetFieldDef& field = kSqlsetFieldDefs[idx];
+ nulls[idx] = false;
+
+ if (!attribute_list_includes_field(attribute_mode, field))
+ {
+ nulls[idx] = true;
+ continue;
+ }
+
+ if (pg_strcasecmp(field.name, "sql_id") == 0)
+ {
+ values[idx] = CStringGetTextDatum(row.sql_id.c_str());
+ continue;
+ }
+
+ if (pg_strcasecmp(field.name, "plan_hash_value") == 0)
+ {
+ values[idx] = DirectFunctionCall3(numeric_in,
+ CStringGetDatum(std::to_string(row.plan_hash_value).c_str()),
+ ObjectIdGetDatum(0),
+ Int32GetDatum(-1));
+ continue;
+ }
+
+ if (pg_strcasecmp(field.name, "object_list") == 0 || pg_strcasecmp(field.name, "bind_data") == 0 ||
+ pg_strcasecmp(field.name, "sql_plan") == 0 || pg_strcasecmp(field.name, "bind_list") == 0)
+ {
+ nulls[idx] = true;
+ continue;
+ }
+
+ const std::optional<std::string>* source = find_scalar_field(row, field.name);
+ if (source == nullptr || !source->has_value())
+ {
+ nulls[idx] = true;
+ continue;
+ }
+
+ values[idx] = string_to_datum(source->value(), field.kind);
+ }
+}
+
+std::string
+build_row_key(const SqlsetRow& row)
+{
+ return row.sql_id + '\x1f' + std::to_string(row.plan_hash_value);
+}
+
+Sqlset*
+find_sqlset(const std::string& owner, const std::string& name)
+{
+ auto& store = sqlset_store();
+ auto it = store.find(build_sqlset_key(owner, name));
+ if (it == store.end())
+ return nullptr;
+
+ return &it->second;
+}
+
+Sqlset&
+require_sqlset(const std::string& owner, const std::string& name)
+{
+ Sqlset* sqlset = find_sqlset(owner, name);
+ if (sqlset == nullptr)
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_OBJECT),
+ errmsg("ORA-13754: \"SQL Tuning Set\" \"%s\" does not exist.",
+ name.c_str())));
+
+ return *sqlset;
+}
+
+std::string
+normalize_load_option(const std::string& value)
+{
+ if (pg_strcasecmp(value.c_str(), "INSERT") == 0)
+ return "INSERT";
+ if (pg_strcasecmp(value.c_str(), "UPDATE") == 0)
+ return "UPDATE";
+ if (pg_strcasecmp(value.c_str(), "MERGE") == 0)
+ return "MERGE";
+
+ ereport(ERROR, (errmsg("ORA-13779: invalid load option")));
+ return "";
+}
+
+std::string
+normalize_update_option(const std::string& value)
+{
+ if (pg_strcasecmp(value.c_str(), "REPLACE") == 0)
+ return "REPLACE";
+ if (pg_strcasecmp(value.c_str(), "ACCUMULATE") == 0)
+ return "ACCUMULATE";
+
+ ereport(ERROR, (errmsg("ORA-19371: invalid update option")));
+ return "";
+}
+
+SqlsetLoadOption
+parse_load_option(const std::optional<std::string>& option)
+{
+ const std::string normalized = option.has_value() ? normalize_load_option(*option) : "INSERT";
+ if (normalized == "INSERT")
+ return SqlsetLoadOption::Insert;
+ if (normalized == "UPDATE")
+ return SqlsetLoadOption::Update;
+ return SqlsetLoadOption::Merge;
+}
+
+SqlsetUpdateOption
+parse_update_option(const std::optional<std::string>& option)
+{
+ const std::string normalized = option.has_value() ? normalize_update_option(*option) : "REPLACE";
+ if (normalized == "REPLACE")
+ return SqlsetUpdateOption::Replace;
+ return SqlsetUpdateOption::Accumulate;
+}
+
+SqlsetAttributeList
+parse_attribute_list(const std::optional<std::string>& option)
+{
+ if (!option.has_value() || option->empty() || pg_strcasecmp(option->c_str(), "TYPICAL") == 0)
+ return SqlsetAttributeList::Typical;
+
+ if (pg_strcasecmp(option->c_str(), "BASIC") == 0)
+ return SqlsetAttributeList::Basic;
+
+ if (pg_strcasecmp(option->c_str(), "ALL") == 0)
+ return SqlsetAttributeList::All;
+
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает attribute_list=\"%s\"",
+ option->c_str())));
+ return SqlsetAttributeList::Typical;
+}
+
+const char*
+attribute_list_name(const SqlsetAttributeList value)
+{
+ switch (value)
+ {
+ case SqlsetAttributeList::Basic:
+ return "BASIC";
+ case SqlsetAttributeList::Typical:
+ return "TYPICAL";
+ case SqlsetAttributeList::All:
+ return "ALL";
+ }
+
+ return "TYPICAL";
+}
+
+void
+parse_result_percentage(const std::optional<Numeric>& option)
+{
+ if (!option.has_value())
+ return;
+
+ const Numeric one = int32_to_numeric(1);
+ if (!numeric_eq_value(*option, one))
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает result_percentage")));
+}
+
+std::optional<int64>
+parse_result_limit(const std::optional<Numeric>& option)
+{
+ if (!option.has_value())
+ return std::nullopt;
+
+ const Numeric zero = int32_to_numeric(0);
+ const Numeric max_value = int64_to_numeric(std::numeric_limits<int64>::max());
+ const std::string value_text = numeric_to_std_string(*option);
+
+ if (numeric_is_nan(*option) || numeric_lt_value(*option, zero) || numeric_gt_value(*option, max_value) ||
+ !numeric_is_integer_value(*option))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-13765: Value \"%s\" is illegal for a result limit.", value_text.c_str())));
+ }
+
+ return DatumGetInt64(DirectFunctionCall1(numeric_int8, NumericGetDatum(*option)));
+}
+
+void
+validate_select_filters(const std::optional<std::string>& basic_filter,
+ const std::optional<std::string>& ranking_measure1,
+ const std::optional<std::string>& ranking_measure2,
+ const std::optional<std::string>& ranking_measure3,
+ const std::optional<std::string>& plan_filter)
+{
+ if (basic_filter.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает basic_filter")));
+ if (ranking_measure1.has_value() || ranking_measure2.has_value() || ranking_measure3.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает ranking_measure")));
+ if (plan_filter.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает plan_filter")));
+}
+
+void
+validate_select_sqlset_unsupported_options(const std::optional<std::string>& object_filter,
+ const std::optional<std::string>& recursive_sql)
+{
+ if (object_filter.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает object_filter")));
+
+ if (!recursive_sql.has_value() || pg_strcasecmp(recursive_sql->c_str(), "HAS_RECURSIVE_SQL") == 0 ||
+ pg_strcasecmp(recursive_sql->c_str(), kDbmsSqlsetHasRecursiveSql) == 0 ||
+ pg_strcasecmp(recursive_sql->c_str(), "Y") == 0)
+ return;
+
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает recursive_sql")));
+}
+
+void
+validate_load_extras(const std::optional<std::string>& update_condition,
+ const std::optional<std::string>& update_attributes,
+ bool has_commit_rows)
+{
+ if (update_condition.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET не поддерживает update_condition")));
+ if (update_attributes.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET не поддерживает update_attributes")));
+ if (has_commit_rows)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET не поддерживает commit_rows")));
+}
+
+std::string
+create_sqlset_impl(const std::optional<std::string>& sqlset_name,
+ const std::optional<std::string>& description,
+ const std::optional<std::string>& sqlset_owner,
+ bool allow_generate)
+{
+ bool generated = false;
+ const std::optional<std::string> resolved_owner = normalize_owner_argument(sqlset_owner);
+ if (!resolved_owner.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.CREATE_SQLSET не поддерживает sqlset_owner вне текущего пользователя")));
+
+ const std::string resolved_name = require_sqlset_name(sqlset_name, allow_generate, generated, *resolved_owner);
+ (void) generated;
+
+ auto& store = sqlset_store();
+ const std::string key = build_sqlset_key(*resolved_owner, resolved_name);
+ if (store.find(key) != store.end())
+ ereport(ERROR,
+ (errcode(ERRCODE_DUPLICATE_OBJECT),
+ errmsg("ORA-13753: \"SQL Tuning Set\" \"%s\" already exists.",
+ resolved_name.c_str())));
+
+ Sqlset set;
+ set.owner = *resolved_owner;
+ set.description = description;
+ store.emplace(key, std::move(set));
+
+ return resolved_name;
+}
+
+void
+store_sqlset_row(Sqlset& sqlset, SqlsetRow row, SqlsetLoadOption load_option,
+ SqlsetUpdateOption update_option, bool ignore_null)
+{
+ const std::string key = build_row_key(row);
+ auto index_it = sqlset.row_index.find(key);
+ if (index_it == sqlset.row_index.end())
+ {
+ if (load_option == SqlsetLoadOption::Update)
+ return;
+
+ sqlset.row_index.emplace(key, sqlset.rows.size());
+ sqlset.rows.push_back(std::move(row));
+ return;
+ }
+
+ if (load_option == SqlsetLoadOption::Insert)
+ return;
+
+ apply_sqlset_row_update(sqlset.rows[index_it->second], row, update_option, ignore_null);
+}
+
+void
+load_sqlset_impl(const std::optional<std::string>& sqlset_name,
+ const std::optional<std::string>& populate_cursor,
+ const std::optional<std::string>& load_option,
+ const std::optional<std::string>& update_option,
+ const std::optional<std::string>& update_condition,
+ const std::optional<std::string>& update_attributes,
+ bool ignore_null,
+ bool has_commit_rows,
+ const std::optional<std::string>& sqlset_owner)
+{
+ if (!sqlset_name.has_value() || sqlset_name->empty())
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_NAME),
+ errmsg("ORA-13755: invalid \"SQL Tuning Set\" name")));
+
+ const std::optional<std::string> resolved_owner = normalize_owner_argument(sqlset_owner);
+ if (!resolved_owner.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET не поддерживает sqlset_owner вне текущего пользователя")));
+
+ validate_load_extras(update_condition, update_attributes, has_commit_rows);
+
+ const SqlsetLoadOption parsed_load_option = parse_load_option(load_option);
+ const SqlsetUpdateOption parsed_update_option = parse_update_option(update_option);
+
+ if (!populate_cursor.has_value() || populate_cursor->empty())
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_CURSOR_NAME),
+ errmsg("DBMS_SQLSET.LOAD_SQLSET получил пустой cursor")));
+
+ Sqlset& sqlset = require_sqlset(*resolved_owner, *sqlset_name);
+
+ if (SPI_connect() != SPI_OK_CONNECT)
+ ereport(ERROR, (errmsg("SPI_connect failed")));
+
+ Portal portal = SPI_cursor_find(populate_cursor->c_str());
+ if (portal == nullptr)
+ {
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_CURSOR),
+ errmsg("cursor \"%s\" does not exist", populate_cursor->c_str())));
+ }
+
+ PG_TRY();
+ {
+ const long fetch_size = 1000;
+ for (;;)
+ {
+ SPI_cursor_fetch(portal, true, fetch_size);
+ if (SPI_processed == 0)
+ break;
+
+ if (SPI_tuptable == nullptr)
+ ereport(ERROR, (errmsg("SPI_cursor_fetch returned no tuple table")));
+
+ TupleDesc tuple_desc = SPI_tuptable->tupdesc;
+ for (uint64 idx = 0; idx < SPI_processed; ++idx)
+ {
+ HeapTuple tuple = SPI_tuptable->vals[idx];
+ SqlsetRow row = parse_sqlset_row_tuple(tuple, tuple_desc);
+ store_sqlset_row(sqlset, std::move(row), parsed_load_option, parsed_update_option, ignore_null);
+ }
+ }
+
+ SPI_finish();
+ }
+ PG_CATCH();
+ {
+ SPI_finish();
+ PG_RE_THROW();
+ }
+ PG_END_TRY();
+}
+
+} // namespace
+
+Datum dbms_sqlset_mode_replace_old_stats(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetModeReplaceOldStats);
+}
+
+Datum dbms_sqlset_mode_accumulate_stats(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetModeAccumulateStats);
+}
+
+Datum dbms_sqlset_has_recursive_sql(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(kDbmsSqlsetHasRecursiveSql));
+}
+
+Datum dbms_sqlset_no_recursive_sql(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(kDbmsSqlsetNoRecursiveSql));
+}
+
+Datum dbms_sqlset_single_execution(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetSingleExecution);
+}
+
+Datum dbms_sqlset_all_executions(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetAllExecutions);
+}
+
+Datum dbms_sqlset_limited_command_type(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetLimitedCommandType);
+}
+
+Datum dbms_sqlset_all_command_type(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetAllCommandType);
+}
+
+Datum dbms_sqlset_sts_stgtab_10_2_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetStsStgtab102Version);
+}
+
+Datum dbms_sqlset_sts_stgtab_11_1_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetStsStgtab111Version);
+}
+
+Datum dbms_sqlset_sts_stgtab_11_2_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetStsStgtab112Version);
+}
+
+Datum dbms_sqlset_sts_stgtab_12_1_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetStsStgtab121Version);
+}
+
+Datum dbms_sqlset_sts_stgtab_12_2_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT32(kDbmsSqlsetStsStgtab122Version);
+}
+
+Datum dbms_sqlset_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_SQLSET_VERSION));
+}
+
+Datum dbms_sqlset_add_reference(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.ADD_REFERENCE")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_create_sqlset(PG_FUNCTION_ARGS)
+{
+ const std::optional<std::string> sqlset_name = pg_arg_text_optional(fcinfo, 0);
+ const std::optional<std::string> description = pg_arg_text_optional(fcinfo, 1);
+ const std::optional<std::string> sqlset_owner = pg_arg_text_optional(fcinfo, 2);
+
+ const std::string resolved_name = create_sqlset_impl(sqlset_name, description, sqlset_owner, true);
+ PG_RETURN_TEXT_P(cstring_to_text(resolved_name.c_str()));
+}
+
+Datum dbms_sqlset_select_cursor_cache(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_CURSOR_CACHE")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_select_sqlpa_task(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_SQLPA_TASK")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_select_sqlset(PG_FUNCTION_ARGS)
+{
+ const std::optional<std::string> sqlset_name = pg_arg_text_optional(fcinfo, 0);
+ const std::optional<std::string> basic_filter = pg_arg_text_optional(fcinfo, 1);
+ const std::optional<std::string> object_filter = pg_arg_text_optional(fcinfo, 2);
+ const std::optional<std::string> ranking_measure1 = pg_arg_text_optional(fcinfo, 3);
+ const std::optional<std::string> ranking_measure2 = pg_arg_text_optional(fcinfo, 4);
+ const std::optional<std::string> ranking_measure3 = pg_arg_text_optional(fcinfo, 5);
+ const std::optional<Numeric> result_percentage = pg_arg_numeric_optional(fcinfo, 6);
+ const std::optional<Numeric> result_limit_arg = pg_arg_numeric_optional(fcinfo, 7);
+ const std::optional<std::string> attribute_list = pg_arg_text_optional(fcinfo, 8);
+ const std::optional<std::string> plan_filter = pg_arg_text_optional(fcinfo, 9);
+ const std::optional<std::string> sqlset_owner = pg_arg_text_optional(fcinfo, 10);
+ const std::optional<std::string> recursive_sql = pg_arg_text_optional(fcinfo, 11);
+
+ if (!sqlset_name.has_value() || sqlset_name->empty())
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_NAME),
+ errmsg("ORA-13755: invalid \"SQL Tuning Set\" name")));
+
+ const std::optional<std::string> resolved_owner = normalize_owner_argument(sqlset_owner);
+ if (!resolved_owner.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает sqlset_owner вне текущего пользователя")));
+
+ validate_select_filters(basic_filter, ranking_measure1, ranking_measure2, ranking_measure3, plan_filter);
+ validate_select_sqlset_unsupported_options(object_filter, recursive_sql);
+
+ LOCAL_FCINFO(normalize_fcinfo, 1);
+ InitFunctionCallInfoData(*normalize_fcinfo, NULL, 1, InvalidOid, NULL, NULL);
+
+ if (attribute_list.has_value())
+ {
+ normalize_fcinfo->args[0].value = CStringGetTextDatum(attribute_list->c_str());
+ normalize_fcinfo->args[0].isnull = false;
+ }
+ else
+ {
+ normalize_fcinfo->args[0].value = static_cast<Datum>(0);
+ normalize_fcinfo->args[0].isnull = true;
+ }
+
+ Datum normalized_datum = dbms_sqlset_normalize_attribute_list(normalize_fcinfo);
+ if (normalize_fcinfo->isnull)
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("DBMS_SQLSET attribute_list normalization returned NULL")));
+
+ const std::string normalized_attribute_list =
+ text_to_cstring(DatumGetTextPP(normalized_datum));
+ const SqlsetAttributeList attribute_mode =
+ parse_attribute_list(std::make_optional(normalized_attribute_list));
+
+ parse_result_percentage(result_percentage);
+ const std::optional<int64> result_limit = parse_result_limit(result_limit_arg);
+
+ Sqlset& sqlset = require_sqlset(*resolved_owner, *sqlset_name);
+
+ ReturnSetInfo* rsinfo = reinterpret_cast<ReturnSetInfo*>(fcinfo->resultinfo);
+ if (rsinfo == nullptr || !IsA(rsinfo, ReturnSetInfo))
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("set-valued function called in context that cannot accept a set")));
+
+ InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS);
+
+ const size_t row_count = sqlset.rows.size();
+ const size_t limit = result_limit.has_value()
+ ? std::min(static_cast<size_t>(*result_limit), row_count)
+ : row_count;
+
+ for (size_t idx = 0; idx < limit; ++idx)
+ {
+ Datum values[kSqlsetFieldCount];
+ bool nulls[kSqlsetFieldCount];
+ fill_sqlset_tuple_values(sqlset.rows[idx], attribute_mode, values, nulls);
+ tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
+ }
+
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_normalize_attribute_list(PG_FUNCTION_ARGS)
+{
+ const std::optional<std::string> attribute_list = pg_arg_text_optional(fcinfo, 0);
+ const SqlsetAttributeList value = parse_attribute_list(attribute_list);
+
+ if (value == SqlsetAttributeList::All)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.SELECT_SQLSET не поддерживает attribute_list => ALL")));
+
+ PG_RETURN_TEXT_P(cstring_to_text(attribute_list_name(value)));
+}
+
+Datum dbms_sqlset_select_sql_trace(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_SQL_TRACE")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_select_workload_repository_0(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_WORKLOAD_REPOSITORY")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_select_workload_repository_1(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_WORKLOAD_REPOSITORY")));
+ PG_RETURN_NULL();
+}
+
+Datum dbms_sqlset_capture_cursor_cache(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.CAPTURE_CURSOR_CACHE")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_create_sqlset_proc(PG_FUNCTION_ARGS)
+{
+ const std::optional<std::string> sqlset_name = pg_arg_text_optional(fcinfo, 0);
+ const std::optional<std::string> description = pg_arg_text_optional(fcinfo, 1);
+ const std::optional<std::string> sqlset_owner = pg_arg_text_optional(fcinfo, 2);
+
+ (void) create_sqlset_impl(sqlset_name, description, sqlset_owner, false);
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_create_stgtab(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.CREATE_STGTAB")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_delete_sqlset(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.DELETE_SQLSET")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_drop_sqlset(PG_FUNCTION_ARGS)
+{
+ const std::optional<std::string> sqlset_name = pg_arg_text_optional(fcinfo, 0);
+ const std::optional<std::string> sqlset_owner = pg_arg_text_optional(fcinfo, 1);
+ const std::optional<std::string> resolved_owner = normalize_owner_argument(sqlset_owner);
+
+ if (!sqlset_name.has_value() || sqlset_name->empty())
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_NAME),
+ errmsg("ORA-13755: invalid \"SQL Tuning Set\" name")));
+
+ if (!resolved_owner.has_value())
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("DBMS_SQLSET.DROP_SQLSET не поддерживает sqlset_owner вне текущего пользователя")));
+
+ auto& store = sqlset_store();
+ auto it = store.find(build_sqlset_key(*resolved_owner, *sqlset_name));
+ if (it == store.end())
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_OBJECT),
+ errmsg("ORA-13754: \"SQL Tuning Set\" \"%s\" does not exist.",
+ sqlset_name->c_str())));
+
+ store.erase(it);
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_drop_sqlset_by_prefix(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.DROP_SQLSET_BY_PREFIX")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_load_sqlset(PG_FUNCTION_ARGS)
+{
+ const std::optional<std::string> sqlset_name = pg_arg_text_optional(fcinfo, 0);
+ const std::optional<std::string> populate_cursor = pg_arg_text_optional(fcinfo, 1);
+ const std::optional<std::string> load_option = pg_arg_text_optional(fcinfo, 2);
+ const std::optional<std::string> update_option = pg_arg_text_optional(fcinfo, 3);
+ const std::optional<std::string> update_condition = pg_arg_text_optional(fcinfo, 4);
+ const std::optional<std::string> update_attributes = pg_arg_text_optional(fcinfo, 5);
+ const bool ignore_null = PG_ARGISNULL(6) ? true : PG_GETARG_BOOL(6);
+ const bool has_commit_rows = !PG_ARGISNULL(7);
+ const std::optional<std::string> sqlset_owner = pg_arg_text_optional(fcinfo, 8);
+
+ load_sqlset_impl(sqlset_name,
+ populate_cursor,
+ load_option,
+ update_option,
+ update_condition,
+ update_attributes,
+ ignore_null,
+ has_commit_rows,
+ sqlset_owner);
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_pack_stgtab(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.PACK_STGTAB")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_remap_stgtab(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.REMAP_STGTAB")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_remove_reference(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.REMOVE_REFERENCE")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_unpack_stgtab(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.UNPACK_STGTAB")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_update_sqlset_0(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.UPDATE_SQLSET")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_update_sqlset_1(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.UPDATE_SQLSET")));
+ PG_RETURN_VOID();
+}
+
+Datum dbms_sqlset_update_sqlset_2(PG_FUNCTION_ARGS)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Неподдерживаемая compatibility-функция DBMS_SQLSET.UPDATE_SQLSET")));
+ PG_RETURN_VOID();
+}
diff --git a/src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.hpp b/src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.hpp
new file mode 100644
index 0000000..5def646
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_sqlset/dbms_sqlset.hpp
@@ -0,0 +1,364 @@
+#ifndef DBMS_SQLSET_INTERNAL_HPP
+#define DBMS_SQLSET_INTERNAL_HPP
+
+/**
+ * @brief DBMS_SQLSET — Oracle-compatible package для работы с SQL tuning set.
+ *
+ * Назначение:
+ * Пакет предоставляет SQL-visible API для создания SQL tuning set,
+ * загрузки в него SQLSET_ROW-compatible строк, чтения сохранённых строк
+ * и удаления набора. SQL tuning set используется при миграции Oracle-кода,
+ * который сохраняет SQL statements и связанную с ними статистику выполнения
+ * для дальнейшего анализа, сравнения или передачи в tuning workflow.
+ *
+ * В rudb пакет поддерживает реализованное подмножество Oracle API:
+ * создание набора, загрузку строк из refcursor, чтение строк через
+ * SELECT_SQLSET, удаление набора и SQL-visible package constants.
+ */
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+} // extern "C"
+
+extern "C"
+{
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.MODE_REPLACE_OLD_STATS.
+Datum dbms_sqlset_mode_replace_old_stats(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.MODE_ACCUMULATE_STATS.
+Datum dbms_sqlset_mode_accumulate_stats(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.HAS_RECURSIVE_SQL.
+Datum dbms_sqlset_has_recursive_sql(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.NO_RECURSIVE_SQL.
+Datum dbms_sqlset_no_recursive_sql(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.SINGLE_EXECUTION.
+Datum dbms_sqlset_single_execution(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.ALL_EXECUTIONS.
+Datum dbms_sqlset_all_executions(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.LIMITED_COMMAND_TYPE.
+Datum dbms_sqlset_limited_command_type(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.ALL_COMMAND_TYPE.
+Datum dbms_sqlset_all_command_type(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.STS_STGTAB_10_2_VERSION.
+Datum dbms_sqlset_sts_stgtab_10_2_version(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.STS_STGTAB_11_1_VERSION.
+Datum dbms_sqlset_sts_stgtab_11_1_version(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.STS_STGTAB_11_2_VERSION.
+Datum dbms_sqlset_sts_stgtab_11_2_version(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.STS_STGTAB_12_1_VERSION.
+Datum dbms_sqlset_sts_stgtab_12_1_version(PG_FUNCTION_ARGS);
+
+/// @brief Возвращает Oracle-совместимую константу DBMS_SQLSET.STS_STGTAB_12_2_VERSION.
+Datum dbms_sqlset_sts_stgtab_12_2_version(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_SQLSET.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_SQLSET.GET_VERSION() FROM dual;
+ * SELECT dbms_sqlset_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_sqlset_get_version(PG_FUNCTION_ARGS);
+
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.ADD_REFERENCE.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_add_reference(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Создаёт session-local SQL tuning set и возвращает его имя.
+ * @details Явное имя используется как есть. Если имя не передано или
+ * передана пустая строка, функция генерирует имя вида `STS_<N>`.
+ * Набор хранится только в памяти текущей backend-сессии и доступен
+ * только текущему пользователю. SQL-visible сигнатура допускает
+ * вызовы без аргументов, только с именем или с именем и описанием;
+ * пропущенные `description` и `sqlset_owner` заполняются как `NULL`.
+ * Примеры:
+ * SELECT dbms_sqlset_create_sqlset_0();
+ *
+ * SELECT dbms_sqlset_create_sqlset_0('sts_demo');
+ *
+ * SELECT dbms_sqlset_create_sqlset_0('sts_demo', 'demo set');
+ * @param sqlset_name Имя SQL tuning set или `NULL` для автогенерации.
+ * @param description Описание SQL tuning set.
+ * @param sqlset_owner Владелец набора; поддержан только текущий пользователь.
+ * @return Имя созданного SQL tuning set.
+ */
+Datum dbms_sqlset_create_sqlset(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.SELECT_CURSOR_CACHE.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_select_cursor_cache(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.SELECT_SQLPA_TASK.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_select_sqlpa_task(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает строки SQL tuning set.
+ * @details Функция возвращает именованный record, поэтому вызывается через
+ * `SELECT * FROM ...` без ручного column definition list.
+ * `attribute_list => BASIC` возвращает базовые поля и зануляет
+ * остальные поддерживаемые атрибуты. `attribute_list => TYPICAL`
+ * возвращает весь поддерживаемый scalar/simple subset SQLSET_ROW.
+ *
+ * `result_limit` поддерживает `NULL`, `0` и положительные целые
+ * значения. Отрицательные, нецелые и слишком большие значения
+ * отклоняются Oracle-style ошибкой `ORA-13765`.
+ *
+ * `basic_filter`, `object_filter`, `ranking_measure1/2/3`,
+ * `plan_filter`, `attribute_list => ALL`, non-default
+ * `result_percentage` и фильтрация `recursive_sql` не
+ * поддерживаются и возвращают явную ошибку.
+ *
+ * Примеры:
+ * SELECT *
+ * FROM dbms_sqlset_select_sqlset('sts_demo');
+*
+ * SELECT sql_id, sql_text, executions
+ * FROM dbms_sqlset_select_sqlset('sts_demo',
+ * attribute_list => 'TYPICAL');
+ *
+ * SELECT sql_id, sql_text
+ * FROM dbms_sqlset_select_sqlset('sts_demo',
+ * attribute_list => 'BASIC',
+ * result_limit => 10);
+ * @param sqlset_name Имя SQL tuning set.
+ * @param basic_filter SQLSET_ROW predicate; не поддерживается, кроме `NULL`/пустой строки.
+ * @param object_filter Object-list filter; не поддерживается, кроме `NULL`/пустой строки.
+ * @param ranking_measure1 Ranking expression; не поддерживается, кроме `NULL`/пустой строки.
+ * @param ranking_measure2 Ranking expression; не поддерживается, кроме `NULL`/пустой строки.
+ * @param ranking_measure3 Ranking expression; не поддерживается, кроме `NULL`/пустой строки.
+ * @param result_percentage Поддержан только `NULL` или `1`.
+ * @param result_limit Максимальное количество строк: `NULL`, `0` или положительное целое.
+ * @param attribute_list Поддержаны `NULL`, `BASIC`, `TYPICAL`; `ALL` не поддерживается.
+ * @param plan_filter Plan filter; не поддерживается, кроме `NULL`/пустой строки.
+ * @param sqlset_owner Владелец набора; поддержан только текущий пользователь.
+ * @param recursive_sql Поддержаны `NULL`, пустая строка, `HAS_RECURSIVE_SQL` и `Y`.
+ * @return Набор строк именованного record с поддерживаемым подмножеством SQLSET_ROW.
+ */
+Datum dbms_sqlset_select_sqlset(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Нормализует список атрибутов SQLSET для выборки строк SQL tuning set.
+ * @details Возвращает каноническое имя режима атрибутов, используемое
+ * DBMS_SQLSET.SELECT_SQLSET.
+ * Примеры:
+ * SELECT dbms_sqlset_normalize_attribute_list(NULL);
+ * SELECT dbms_sqlset_normalize_attribute_list('basic');
+ * SELECT dbms_sqlset_normalize_attribute_list('TYPICAL');
+ * @param attribute_list Имя режима атрибутов.
+ * @return Нормализованное имя режима атрибутов.
+ */
+Datum dbms_sqlset_normalize_attribute_list(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.SELECT_SQL_TRACE.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_select_sql_trace(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.SELECT_WORKLOAD_REPOSITORY.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_select_workload_repository_0(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.SELECT_WORKLOAD_REPOSITORY.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_select_workload_repository_1(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.CAPTURE_CURSOR_CACHE.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_capture_cursor_cache(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Создаёт session-local SQL tuning set без возвращаемого значения.
+ * @details Имя набора обязательно: `NULL` и пустая строка отклоняются.
+ * Набор хранится только в памяти текущей backend-сессии и доступен
+ * только текущему пользователю. SQL-visible сигнатура допускает
+ * сокращённые вызовы без `description` и `sqlset_owner`.
+ * Примеры:
+ * CALL dbms_sqlset_create_sqlset_1('sts_demo');
+ *
+ * CALL dbms_sqlset_create_sqlset_1('sts_demo', 'demo set');
+ * @param sqlset_name Имя SQL tuning set.
+ * @param description Описание SQL tuning set.
+ * @param sqlset_owner Владелец набора; поддержан только текущий пользователь.
+ */
+Datum dbms_sqlset_create_sqlset_proc(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.CREATE_STGTAB.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_create_stgtab(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.DELETE_SQLSET.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_delete_sqlset(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Удаляет session-local SQL tuning set.
+ * @details Удаляет metadata и строки набора из памяти текущей backend-сессии.
+ * Несуществующий набор, `NULL` или пустое имя возвращают ошибку.
+ * Работа с владельцем, отличным от текущего пользователя, не
+ * поддерживается. SQL-visible сигнатура допускает вызов только с
+ * именем набора; пропущенный `sqlset_owner` трактуется как `NULL`.
+ * Примеры:
+ * CALL dbms_sqlset_drop_sqlset('sts_demo');
+ *
+ * CALL dbms_sqlset_drop_sqlset('sts_demo', current_user);
+ * @param sqlset_name Имя SQL tuning set.
+ * @param sqlset_owner Владелец набора; поддержан только текущий пользователь.
+ */
+Datum dbms_sqlset_drop_sqlset(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.DROP_SQLSET_BY_PREFIX.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_drop_sqlset_by_prefix(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Загружает строки SQLSET_ROW из refcursor в session-local SQL tuning set.
+ * @details Строки идентифицируются парой `(sql_id, plan_hash_value)`.
+ * Поддержаны `INSERT`, `UPDATE`, `MERGE`, `REPLACE`,
+ * `ACCUMULATE` и `ignore_null`. `ACCUMULATE` суммирует
+ * поддерживаемые статистические поля. `REPLACE` обновляет
+ * поддерживаемые статистические поля, но не затирает execution
+ * context вроде `sql_text`, `module` и `action`.
+ *
+ * SQL-visible сигнатура допускает вызовы только с
+ * `sqlset_name/populate_cursor`, а также с частичным указанием
+ * параметров до `ignore_null`; пропущенные аргументы получают
+ * значения `INSERT`, `REPLACE`, `NULL`, `NULL`, `true`, `NULL`,
+ * `NULL`.
+ *
+ * Complex attributes (`OBJECT_LIST`, `BIND_DATA`, `SQL_PLAN`,
+ * `BIND_LIST`), `update_condition`, `update_attributes` и любой
+ * `commit_rows IS NOT NULL` отклоняются явной ошибкой. Внутренние
+ * Oracle-style commits не реализованы.
+ *
+ * Примеры:
+ * CALL dbms_sqlset_load_sqlset('sts_demo', 'cur_demo');
+ *
+ * CALL dbms_sqlset_load_sqlset('sts_demo', 'cur_demo', 'MERGE');
+ *
+ * CALL dbms_sqlset_load_sqlset('sts_demo', 'cur_demo', 'UPDATE',
+ * 'REPLACE', NULL, NULL, false);
+ * @param sqlset_name Имя SQL tuning set.
+ * @param populate_cursor Имя открытого `refcursor` с SQLSET_ROW-compatible данными.
+ * @param load_option Режим загрузки: `INSERT`, `UPDATE` или `MERGE`.
+ * @param update_option Режим обновления: `REPLACE` или `ACCUMULATE`.
+ * @param update_condition Условие обновления; не поддерживается, кроме `NULL`/пустой строки.
+ * @param update_attributes Список обновляемых атрибутов; не поддерживается, кроме `NULL`/пустой строки.
+ * @param ignore_null Если `true`, входящий `NULL` не затирает существующее значение.
+ * @param commit_rows Oracle-style параметр внутренних commit; поддержан только `NULL`.
+ * @param sqlset_owner Владелец набора; поддержан только текущий пользователь.
+ */
+Datum dbms_sqlset_load_sqlset(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.PACK_STGTAB.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_pack_stgtab(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.REMAP_STGTAB.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_remap_stgtab(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.REMOVE_REFERENCE.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_remove_reference(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.UNPACK_STGTAB.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_unpack_stgtab(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.UPDATE_SQLSET.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_update_sqlset_0(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.UPDATE_SQLSET.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_update_sqlset_1(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Неподдерживаемая SQL-visible compatibility-функция DBMS_SQLSET.UPDATE_SQLSET.
+ * @details Сигнатура сохранена для совместимости SQL-поверхности. Текущая
+ * реализация всегда возвращает ошибку неподдержанной операции и не
+ * читает аргументы.
+ */
+Datum dbms_sqlset_update_sqlset_2(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_SQLSET_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.cpp b/src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.cpp
new file mode 100644
index 0000000..85e037a
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.cpp
@@ -0,0 +1,1675 @@
+#include "dbms_stat_funcs.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "access/htup_details.h"
+#include "catalog/pg_type_d.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "utils/elog.h"
+#include "utils/lsyscache.h"
+#include "utils/numeric.h"
+#include "executor/spi.h"
+} // extern "C"
+
+#include <cctype>
+#include <cerrno>
+#include <algorithm>
+#include <functional>
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <limits>
+#include <map>
+#include <optional>
+#include <numeric>
+#include <string>
+#include <string_view>
+#include <vector>
+
+/*
+ * Реализация DBMS_STAT_FUNCS.
+ *
+ * Функции пакета читают числовую выборку из указанной таблицы и колонки,
+ * применяют статистические критерии согласия или формируют сводную статистику.
+ * Результаты SQL-visible функций возвращаются как именованные record-значения,
+ * описанные в pg_proc.dat. Общие helpers ниже отвечают за разбор аргументов,
+ * загрузку выборки, математические критерии и формирование tuple-результата.
+ */
+namespace
+{
+struct DistFitArgs
+{
+ std::string ownername;
+ std::string tablename;
+ std::string columnname;
+ std::string test_type;
+ bool test_type_is_null = false;
+ bool lambda_is_null = false;
+ bool mu_is_null = false;
+ double lambda = 0.0;
+ double mu = 0.0;
+};
+
+struct DistFitResult
+{
+ bool has_sig = false;
+ double sig = 0.0;
+ bool lambda_is_null = false;
+ double lambda = 0.0;
+ bool mu_is_null = false;
+ double mu = 0.0;
+};
+
+struct WeibullFitArgs
+{
+ std::string ownername;
+ std::string tablename;
+ std::string columnname;
+ std::string test_type;
+ bool test_type_is_null = false;
+ bool alpha_is_null = false;
+ bool mu_is_null = false;
+ bool beta_is_null = false;
+ double alpha = 0.0;
+ double mu = 0.0;
+ double beta = 0.0;
+};
+
+struct WeibullFitResult
+{
+ bool has_sig = false;
+ double sig = 0.0;
+ bool alpha_is_null = false;
+ double alpha = 0.0;
+ bool mu_is_null = false;
+ double mu = 0.0;
+ bool beta_is_null = false;
+ double beta = 0.0;
+};
+
+struct SummaryArgs
+{
+ std::string ownername;
+ std::string tablename;
+ std::string columnname;
+ bool sigma_is_null = false;
+ double sigma = 3.0;
+};
+
+enum class TestType
+{
+ KolmogorovSmirnov,
+ AndersonDarling,
+ ChiSquared,
+ Invalid
+};
+
+enum class NormalTestType
+{
+ ShapiroWilks,
+ KolmogorovSmirnov,
+ AndersonDarling,
+ ChiSquared,
+ Invalid
+};
+
+enum class PoissonTestType
+{
+ KolmogorovSmirnov,
+ AndersonDarling,
+ Invalid
+};
+
+enum class UniformVarType
+{
+ Continuous,
+ Discrete,
+ Invalid
+};
+
+inline std::string
+trim_copy(const std::string_view input)
+{
+ size_t begin = 0;
+ size_t end = input.size();
+
+ while (begin < end && std::isspace(static_cast<unsigned char>(input[begin])) != 0)
+ ++begin;
+
+ while (end > begin && std::isspace(static_cast<unsigned char>(input[end - 1])) != 0)
+ --end;
+
+ return std::string(input.substr(begin, end - begin));
+}
+
+inline std::string
+upper_copy(const std::string_view input)
+{
+ std::string output;
+ output.reserve(input.size());
+
+ for (const unsigned char ch : input)
+ output.push_back(static_cast<char>(std::toupper(ch)));
+
+ return output;
+}
+
+inline bool
+parse_double_text(const std::string& text, double& value)
+{
+ if (text.empty())
+ return false;
+
+ char* end = nullptr;
+ errno = 0;
+ const double parsed = std::strtod(text.c_str(), &end);
+
+ if (end == text.c_str() || *end != '\0' || errno == ERANGE || !std::isfinite(parsed))
+ return false;
+
+ value = parsed;
+ return true;
+}
+
+static double
+read_numeric_arg(FunctionCallInfo fcinfo, const int arg_index, const char* parameter_name)
+{
+ (void)parameter_name;
+ const double value = DatumGetFloat8(DirectFunctionCall1(numeric_float8, PG_GETARG_DATUM(arg_index)));
+
+ if (std::isnan(value))
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-06502: PL/SQL: value or conversion error")));
+ if (!std::isfinite(value))
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-01426: numeric overflow")));
+
+ return value;
+}
+
+inline TestType
+parse_exponential_test_type(const DistFitArgs& args)
+{
+ /*
+ * EXPONENTIAL_DIST_FIT использует KOLMOGOROV_SMIRNOV по умолчанию.
+ * В фиксированной SQL-сигнатуре NULL test_type трактуется как запрос
+ * default-поведения. Пустая строка и значения в другом регистре
+ * остаются невалидными.
+ */
+ if (args.test_type_is_null)
+ return TestType::KolmogorovSmirnov;
+
+ if (args.test_type == "KOLMOGOROV_SMIRNOV")
+ return TestType::KolmogorovSmirnov;
+ if (args.test_type == "ANDERSON_DARLING")
+ return TestType::AndersonDarling;
+ if (args.test_type == "CHI_SQUARED")
+ return TestType::ChiSquared;
+
+ return TestType::Invalid;
+}
+
+inline NormalTestType
+parse_normal_test_type(const DistFitArgs& args)
+{
+ if (args.test_type_is_null)
+ return NormalTestType::Invalid;
+
+ if (args.test_type == "SHAPIRO_WILKS")
+ return NormalTestType::ShapiroWilks;
+ if (args.test_type == "KOLMOGOROV_SMIRNOV")
+ return NormalTestType::KolmogorovSmirnov;
+ if (args.test_type == "ANDERSON_DARLING")
+ return NormalTestType::AndersonDarling;
+ if (args.test_type == "CHI_SQUARED")
+ return NormalTestType::ChiSquared;
+
+ return NormalTestType::Invalid;
+}
+
+inline PoissonTestType
+parse_poisson_test_type(const DistFitArgs& args)
+{
+ /*
+ * В фиксированной SQL-сигнатуре default-поведение проверяется явным
+ * KOLMOGOROV_SMIRNOV. Явный NULL, пустая строка, другой регистр и
+ * CHI_SQUARED дают NULL sig.
+ */
+ if (args.test_type_is_null)
+ return PoissonTestType::Invalid;
+
+ if (args.test_type == "KOLMOGOROV_SMIRNOV")
+ return PoissonTestType::KolmogorovSmirnov;
+ if (args.test_type == "ANDERSON_DARLING")
+ return PoissonTestType::AndersonDarling;
+
+ return PoissonTestType::Invalid;
+}
+
+inline UniformVarType
+parse_uniform_var_type(const bool var_type_is_null, const std::string& var_type)
+{
+ /*
+ * В фиксированной SQL-сигнатуре default-поведение проверяется явным
+ * CONTINUOUS. Явный NULL, пустая строка и значения в другом регистре
+ * дают NULL sig без обращения к таблице.
+ */
+ if (var_type_is_null)
+ return UniformVarType::Invalid;
+
+ if (var_type == "CONTINUOUS")
+ return UniformVarType::Continuous;
+ if (var_type == "DISCRETE")
+ return UniformVarType::Discrete;
+
+ return UniformVarType::Invalid;
+}
+
+inline TestType
+parse_uniform_test_type(const DistFitArgs& args)
+{
+ /*
+ * В фиксированной SQL-сигнатуре default-поведение проверяется явным
+ * KOLMOGOROV_SMIRNOV. Явный NULL, пустая строка и значения в другом
+ * регистре дают NULL sig без обращения к таблице.
+ */
+ if (args.test_type_is_null)
+ return TestType::Invalid;
+
+ if (args.test_type == "KOLMOGOROV_SMIRNOV")
+ return TestType::KolmogorovSmirnov;
+ if (args.test_type == "ANDERSON_DARLING")
+ return TestType::AndersonDarling;
+ if (args.test_type == "CHI_SQUARED")
+ return TestType::ChiSquared;
+
+ return TestType::Invalid;
+}
+
+inline TestType
+parse_weibull_test_type(const WeibullFitArgs& args)
+{
+ /*
+ * В фиксированной SQL-сигнатуре default-поведение проверяется явным
+ * KOLMOGOROV_SMIRNOV. Явный NULL, пустая строка и значения в другом
+ * регистре дают NULL sig без обращения к таблице.
+ */
+ if (args.test_type_is_null)
+ return TestType::Invalid;
+
+ if (args.test_type == "KOLMOGOROV_SMIRNOV")
+ return TestType::KolmogorovSmirnov;
+ if (args.test_type == "ANDERSON_DARLING")
+ return TestType::AndersonDarling;
+ if (args.test_type == "CHI_SQUARED")
+ return TestType::ChiSquared;
+
+ return TestType::Invalid;
+}
+
+inline bool
+is_exponential_test_type_supported(const TestType test_type)
+{
+ return test_type == TestType::KolmogorovSmirnov;
+}
+
+inline bool
+is_normal_test_type_supported(const NormalTestType test_type)
+{
+ return test_type == NormalTestType::KolmogorovSmirnov;
+}
+
+inline bool
+is_poisson_test_type_supported(const PoissonTestType test_type)
+{
+ return test_type == PoissonTestType::KolmogorovSmirnov;
+}
+
+inline bool
+is_uniform_combination_supported(const UniformVarType var_type, const TestType test_type)
+{
+ return var_type == UniformVarType::Continuous &&
+ test_type == TestType::KolmogorovSmirnov;
+}
+
+inline bool
+is_weibull_test_type_supported(const TestType test_type)
+{
+ return test_type == TestType::KolmogorovSmirnov;
+}
+
+inline void
+set_default_mu(DistFitResult& result, const DistFitArgs& args)
+{
+ result.mu_is_null = false;
+ result.mu = args.mu_is_null ? 0.0 : args.mu;
+}
+
+inline DistFitResult
+make_exponential_null_sig_result(const DistFitArgs& args)
+{
+ DistFitResult result;
+ result.has_sig = false;
+ result.lambda_is_null = args.lambda_is_null;
+ result.lambda = args.lambda;
+ set_default_mu(result, args);
+ return result;
+}
+
+inline DistFitResult
+make_normal_null_sig_result(const DistFitArgs& args)
+{
+ DistFitResult result;
+ result.has_sig = false;
+ result.lambda_is_null = args.lambda_is_null;
+ result.lambda = args.lambda;
+ result.mu_is_null = args.mu_is_null;
+ result.mu = args.mu;
+ return result;
+}
+
+inline DistFitResult
+make_dist_fit_result_with_sig(const DistFitArgs& args, const double sig_value)
+{
+ DistFitResult result;
+ result.has_sig = true;
+ result.sig = sig_value;
+ result.lambda_is_null = args.lambda_is_null;
+ result.lambda = args.lambda;
+ set_default_mu(result, args);
+ return result;
+}
+
+struct NumericSample
+{
+ std::vector<double> values;
+ int64 row_count = 0;
+ int64 null_count = 0;
+};
+
+struct SummaryLoadResult
+{
+ NumericSample sample;
+};
+
+struct SummaryPayload
+{
+ bool count_is_null = true;
+ double count = 0.0;
+ bool has_scalar_values = false;
+ double min = 0.0;
+ double max = 0.0;
+ double range = 0.0;
+ double mean = 0.0;
+ bool cmode_is_null = false;
+ bool cmode_contains_single_null = false;
+ std::vector<double> cmode;
+ double variance = 0.0;
+ double stddev = 0.0;
+ double quantile_5 = 0.0;
+ double quantile_25 = 0.0;
+ double median = 0.0;
+ double quantile_75 = 0.0;
+ double quantile_95 = 0.0;
+ bool has_plus_x_sigma = false;
+ bool has_minus_x_sigma = false;
+ double plus_x_sigma = 0.0;
+ double minus_x_sigma = 0.0;
+ bool extreme_values_is_null = false;
+ std::vector<double> extreme_values;
+ bool top_5_values_is_null = false;
+ std::vector<double> top_5_values;
+ bool bottom_5_values_is_null = false;
+ std::vector<double> bottom_5_values;
+};
+
+static std::string
+quote_name_or_throw(const std::string& name, const char* what)
+{
+ if (name.empty())
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("%s cannot be empty", what)));
+
+ return std::string(quote_identifier(name.c_str()));
+}
+
+template <typename Args>
+static std::string
+qualified_relation_name(const Args& args)
+{
+ const std::string schema = quote_name_or_throw(args.ownername, "ownername");
+ const std::string table = quote_name_or_throw(args.tablename, "tablename");
+ return schema + "." + table;
+}
+
+template <typename Args>
+static NumericSample
+load_numeric_sample(const Args& args, const char* context_name, const bool ignore_invalid_text = false)
+{
+ NumericSample sample;
+ const std::string relation = qualified_relation_name(args);
+ const std::string column = quote_name_or_throw(args.columnname, "columnname");
+
+ if (SPI_connect() != SPI_OK_CONNECT)
+ ereport(ERROR, (errmsg("SPI_connect failed")));
+
+ StringInfoData query;
+ initStringInfo(&query);
+ appendStringInfo(&query, "SELECT %s FROM %s", column.c_str(), relation.c_str());
+
+ const int rc = SPI_execute(query.data, true, 0);
+ if (rc != SPI_OK_SELECT)
+ {
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("failed to query %s", context_name)));
+ }
+
+ sample.row_count = SPI_processed;
+ for (uint64 i = 0; i < SPI_processed; ++i)
+ {
+ HeapTuple tuple = SPI_tuptable->vals[i];
+ TupleDesc tupdesc = SPI_tuptable->tupdesc;
+ char* raw = SPI_getvalue(tuple, tupdesc, 1);
+
+ if (raw == nullptr || *raw == '\0')
+ {
+ sample.null_count += 1;
+ if (raw != nullptr)
+ pfree(raw);
+ continue;
+ }
+
+ char* end = nullptr;
+ errno = 0;
+ const double parsed = std::strtod(raw, &end);
+ if (end == raw || *end != '\0' || errno == ERANGE)
+ {
+ if (ignore_invalid_text)
+ {
+ pfree(raw);
+ continue;
+ }
+
+ const char first_char = raw[0];
+ pfree(raw);
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
+ errmsg("ORA-01722: unable to convert string value containing '%c' to a number: %s",
+ first_char, args.columnname.c_str())));
+ }
+ if (!std::isfinite(parsed))
+ {
+ pfree(raw);
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-01426: numeric overflow")));
+ }
+ pfree(raw);
+ sample.values.push_back(parsed);
+ }
+
+ pfree(query.data);
+ SPI_finish();
+ return sample;
+}
+
+static bool
+summary_type_is_numeric(const Oid type_oid)
+{
+ switch (type_oid)
+ {
+ case NUMERICOID:
+ case INT2OID:
+ case INT4OID:
+ case INT8OID:
+ case FLOAT4OID:
+ case FLOAT8OID:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static SummaryLoadResult
+load_summary_sample(const SummaryArgs& args)
+{
+ SummaryLoadResult result;
+ const std::string relation = qualified_relation_name(args);
+ const std::string column = quote_name_or_throw(args.columnname, "columnname");
+
+ if (SPI_connect() != SPI_OK_CONNECT)
+ ereport(ERROR, (errmsg("SPI_connect failed")));
+
+ StringInfoData query;
+ initStringInfo(&query);
+ appendStringInfo(&query, "SELECT %s FROM %s", column.c_str(), relation.c_str());
+
+ const int rc = SPI_execute(query.data, true, 0);
+ if (rc != SPI_OK_SELECT)
+ {
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("failed to query DBMS_STAT_FUNCS.SUMMARY")));
+ }
+
+ const Oid value_type = SPI_gettypeid(SPI_tuptable->tupdesc, 1);
+ if (!summary_type_is_numeric(value_type))
+ {
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-30495: The argument should be of numeric or datetime type.")));
+ }
+
+ result.sample.row_count = SPI_processed;
+ for (uint64 i = 0; i < SPI_processed; ++i)
+ {
+ HeapTuple tuple = SPI_tuptable->vals[i];
+ TupleDesc tupdesc = SPI_tuptable->tupdesc;
+ char* raw = SPI_getvalue(tuple, tupdesc, 1);
+
+ if (raw == nullptr || *raw == '\0')
+ {
+ result.sample.null_count += 1;
+ if (raw != nullptr)
+ pfree(raw);
+ continue;
+ }
+
+ char* end = nullptr;
+ errno = 0;
+ const double parsed = std::strtod(raw, &end);
+ if (end == raw || *end != '\0' || errno == ERANGE)
+ {
+ pfree(raw);
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-30495: The argument should be of numeric or datetime type.")));
+ }
+ if (!std::isfinite(parsed))
+ {
+ pfree(raw);
+ pfree(query.data);
+ SPI_finish();
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-01426: numeric overflow")));
+ }
+
+ pfree(raw);
+ result.sample.values.push_back(parsed);
+ }
+
+ pfree(query.data);
+ SPI_finish();
+ return result;
+}
+
+static double
+sample_mean(const std::vector<double>& values)
+{
+ if (values.empty())
+ return 0.0;
+ return std::accumulate(values.begin(), values.end(), 0.0) / static_cast<double>(values.size());
+}
+
+static double
+sample_variance(const std::vector<double>& values, const double mean)
+{
+ if (values.size() < 2)
+ return 0.0;
+
+ double acc = 0.0;
+ for (const double v : values)
+ {
+ const double d = v - mean;
+ acc += d * d;
+ }
+ return acc / static_cast<double>(values.size() - 1);
+}
+
+static double
+sample_quantile(std::vector<double> values, const double q)
+{
+ if (values.empty())
+ return 0.0;
+
+ std::sort(values.begin(), values.end());
+ if (q <= 0.0)
+ return values.front();
+ if (q >= 1.0)
+ return values.back();
+
+ const double pos = q * (static_cast<double>(values.size()) - 1.0);
+ const size_t lo = static_cast<size_t>(std::floor(pos));
+ const size_t hi = static_cast<size_t>(std::ceil(pos));
+ if (lo == hi)
+ return values[lo];
+
+ const double frac = pos - static_cast<double>(lo);
+ return values[lo] * (1.0 - frac) + values[hi] * frac;
+}
+
+static std::vector<double>
+sorted_copy(const std::vector<double>& values)
+{
+ std::vector<double> out = values;
+ std::sort(out.begin(), out.end());
+ return out;
+}
+
+static std::vector<double>
+top_k_desc(const std::vector<double>& values, const size_t k)
+{
+ std::vector<double> out = values;
+ std::sort(out.begin(), out.end(), std::greater<double>());
+ if (out.size() > k)
+ out.resize(k);
+ return out;
+}
+
+static std::vector<double>
+bottom_k_desc(const std::vector<double>& values, const size_t k)
+{
+ std::vector<double> out = values;
+ std::sort(out.begin(), out.end(), std::less<double>());
+ if (out.size() > k)
+ out.resize(k);
+ std::sort(out.begin(), out.end(), std::greater<double>());
+ return out;
+}
+
+static std::vector<double>
+mode_values(const std::vector<double>& values)
+{
+ std::map<double, size_t> counts;
+ for (const double v : values)
+ ++counts[v];
+
+ size_t best = 0;
+ for (const auto& [value, count] : counts)
+ best = std::max(best, count);
+
+ std::vector<double> out;
+ for (const auto& [value, count] : counts)
+ {
+ if (count == best)
+ out.push_back(value);
+ }
+ return out;
+}
+
+static std::vector<double>
+extreme_values(const std::vector<double>& values, const double lower, const double upper)
+{
+ std::vector<double> out;
+ for (const double v : values)
+ {
+ if (v < lower || v > upper)
+ out.push_back(v);
+ }
+ std::sort(out.begin(), out.end());
+ return out;
+}
+
+static double
+normal_cdf(const double x, const double mean, const double stdev)
+{
+ if (stdev == 0.0)
+ return std::numeric_limits<double>::quiet_NaN();
+ return 0.5 * std::erfc(-(x - mean) / (stdev * std::sqrt(2.0)));
+}
+
+static double
+exponential_cdf(const double x, const double lambda, const double mu)
+{
+ if (x < mu)
+ return 0.0;
+ if (lambda <= 0.0)
+ return 0.0;
+ return 1.0 - std::exp(-lambda * (x - mu));
+}
+static double
+uniform_continuous_cdf_oracle(const double x, const double a, const double b)
+{
+ /*
+ * При нормальном порядке границ CDF зажимается в [0, 1]. Если paramA >
+ * paramB, Oracle сохраняет исходный порядок и использует линейную формулу
+ * без перестановки границ.
+ */
+ if (a < b)
+ {
+ if (x < a)
+ return 0.0;
+ if (x >= b)
+ return 1.0;
+ return (x - a) / (b - a);
+ }
+
+ return (x - a) / (b - a);
+}
+
+static double
+weibull_cdf(const double x, const double alpha, const double mu, const double beta)
+{
+ if (x < mu)
+ return 0.0;
+ if (alpha <= 0.0)
+ return std::numeric_limits<double>::quiet_NaN();
+ const double t = (x - mu) / alpha;
+ if (t < 0.0)
+ return 0.0;
+ return 1.0 - std::exp(-std::pow(t, beta));
+}
+static double
+regularized_gamma_q(double a, double x)
+{
+ const int ITMAX = 100;
+ const double EPS = 3.0e-7;
+ const double FPMIN = 1.0e-30;
+
+ if (x < 0.0 || a <= 0.0)
+ return std::numeric_limits<double>::quiet_NaN();
+ if (x == 0.0)
+ return 1.0;
+ if (x < a + 1.0)
+ {
+ double ap = a;
+ double sum = 1.0 / a;
+ double del = sum;
+ for (int n = 1; n <= ITMAX; ++n)
+ {
+ ++ap;
+ del *= x / ap;
+ sum += del;
+ if (std::fabs(del) < std::fabs(sum) * EPS)
+ break;
+ }
+ return 1.0 - sum * std::exp(-x + a * std::log(x) - std::lgamma(a));
+ }
+
+ double b = x + 1.0 - a;
+ double c = 1.0 / FPMIN;
+ double d = 1.0 / b;
+ double h = d;
+ for (int i = 1; i <= ITMAX; ++i)
+ {
+ const double an = -static_cast<double>(i) * (static_cast<double>(i) - a);
+ b += 2.0;
+ d = an * d + b;
+ if (std::fabs(d) < FPMIN)
+ d = FPMIN;
+ c = b + an / c;
+ if (std::fabs(c) < FPMIN)
+ c = FPMIN;
+ d = 1.0 / d;
+ const double del = d * c;
+ h *= del;
+ if (std::fabs(del - 1.0) < EPS)
+ break;
+ }
+ return std::exp(-x + a * std::log(x) - std::lgamma(a)) * h;
+}
+
+static double
+poisson_cdf_oracle(const double x, const double lambda)
+{
+ /*
+ * Для совместимого поведения CDF вычисляется через Q(x + 1, lambda)
+ * без принудительного округления x. Это сохраняет наблюдаемую семантику
+ * для дробных значений в проверяемой колонке.
+ */
+ if (x < 0.0)
+ return 0.0;
+ if (lambda < 0.0)
+ return 0.0;
+ if (lambda == 0.0)
+ return 1.0;
+
+ return std::clamp(regularized_gamma_q(x + 1.0, lambda), 0.0, 1.0);
+}
+
+static double
+compute_ks_pvalue(const double d, const size_t n)
+{
+ if (n == 0)
+ return 0.0;
+
+ const double en = std::sqrt(static_cast<double>(n));
+ const double x = (en + 0.12 + 0.11 / en) * d;
+ double sum = 0.0;
+ for (int k = 1; k < 100; ++k)
+ {
+ const double term = 2.0 * std::pow(-1.0, k - 1) * std::exp(-2.0 * k * k * x * x);
+ sum += term;
+ if (std::fabs(term) < 1e-12)
+ break;
+ }
+ return std::clamp(sum, 0.0, 1.0);
+}
+
+static std::optional<double>
+ks_pvalue_checked(const double d, const int32 sample_count)
+{
+ if (!std::isfinite(d) || d < 0.0 || sample_count <= 0)
+ return std::nullopt;
+
+ return compute_ks_pvalue(d, static_cast<size_t>(sample_count));
+}
+
+static double
+call_ks_pvalue_service(const double stat, const size_t sample_count)
+{
+ if (sample_count > static_cast<size_t>(PG_INT32_MAX))
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("sample count is too large")));
+
+ const Datum result = DirectFunctionCall2(dbms_stat_funcs_ks_pvalue,
+ Float8GetDatum(stat),
+ Int32GetDatum(static_cast<int32>(sample_count)));
+
+ return DatumGetFloat8(result);
+}
+
+static double
+compute_ks_statistic(const std::vector<double>& values, const std::function<double(double)>& cdf)
+{
+ const std::vector<double> sorted = sorted_copy(values);
+ const size_t n = sorted.size();
+ double d = 0.0;
+ for (size_t i = 0; i < n; ++i)
+ {
+ const double fi = cdf(sorted[i]);
+ const double fn = static_cast<double>(i + 1) / static_cast<double>(n);
+ const double fn1 = static_cast<double>(i) / static_cast<double>(n);
+ d = std::max(d, std::fabs(fn - fi));
+ d = std::max(d, std::fabs(fi - fn1));
+ }
+ return d;
+}
+
+static double
+compute_fit_ks_statistic(const std::vector<double>& values, const std::function<double(double)>& cdf)
+{
+ /*
+ * Критерий Колмогорова-Смирнова для distribution-fit путей пакета
+ * сравнивает теоретическую CDF с накопленной долей после текущего
+ * значения отсортированной выборки:
+ *
+ * D = max |(i + 1) / n - F(x_i)|
+ *
+ * Общий two-sided вариант compute_ks_statistic оставлен для функций,
+ * где уже используется прежняя формула.
+ */
+ const std::vector<double> sorted = sorted_copy(values);
+ const size_t n = sorted.size();
+ double d = 0.0;
+
+ for (size_t i = 0; i < n; ++i)
+ {
+ const double empirical = static_cast<double>(i + 1) / static_cast<double>(n);
+ const double theoretical = cdf(sorted[i]);
+ d = std::max(d, std::fabs(empirical - theoretical));
+ }
+
+ return d;
+}
+
+static SummaryPayload
+compute_summary_payload(const NumericSample& sample, const double sigma_value, const bool sigma_is_null)
+{
+ SummaryPayload payload;
+ if (sample.row_count == 0)
+ {
+ payload.count_is_null = true;
+ payload.has_scalar_values = false;
+ return payload;
+ }
+
+ payload.count_is_null = false;
+ payload.count = static_cast<double>(sample.values.size());
+ if (sample.values.empty())
+ {
+ payload.has_scalar_values = false;
+ /* Oracle SUMMARY возвращает cmode-коллекцию с одним NULL для all-NULL колонок. */
+ payload.cmode_contains_single_null = true;
+ return payload;
+ }
+
+ const std::vector<double> sorted = sorted_copy(sample.values);
+ payload.has_scalar_values = true;
+ payload.min = sorted.front();
+ payload.max = sorted.back();
+ payload.range = payload.max - payload.min;
+ payload.mean = sample_mean(sample.values);
+ payload.variance = sample_variance(sample.values, payload.mean);
+ payload.stddev = std::sqrt(payload.variance);
+ payload.quantile_5 = sample_quantile(sample.values, 0.05);
+ payload.quantile_25 = sample_quantile(sample.values, 0.25);
+ payload.median = sample_quantile(sample.values, 0.5);
+ payload.quantile_75 = sample_quantile(sample.values, 0.75);
+ payload.quantile_95 = sample_quantile(sample.values, 0.95);
+ payload.has_plus_x_sigma = !sigma_is_null;
+ payload.has_minus_x_sigma = !sigma_is_null;
+ if (!sigma_is_null)
+ {
+ payload.plus_x_sigma = payload.mean + sigma_value * payload.stddev;
+ payload.minus_x_sigma = payload.mean - sigma_value * payload.stddev;
+ payload.extreme_values = extreme_values(sample.values, payload.minus_x_sigma, payload.plus_x_sigma);
+ }
+ payload.cmode = mode_values(sample.values);
+ payload.top_5_values = top_k_desc(sample.values, 5);
+ payload.bottom_5_values = bottom_k_desc(sample.values, 5);
+ return payload;
+}
+
+static Datum
+numeric_datum(const double value)
+{
+ return DirectFunctionCall1(float8_numeric, Float8GetDatum(value));
+}
+
+static Datum
+numeric_array_datum(const std::vector<double>& values)
+{
+ if (values.empty())
+ return PointerGetDatum(construct_empty_array(NUMERICOID));
+
+ std::vector<Datum> elems(values.size());
+ bool* null_flags = static_cast<bool*>(palloc0(sizeof(bool) * values.size()));
+ for (size_t i = 0; i < values.size(); ++i)
+ elems[i] = numeric_datum(values[i]);
+
+ int dims[1] = {static_cast<int>(values.size())};
+ int lbs[1] = {1};
+ ArrayType* array = construct_md_array(elems.data(), null_flags, 1, dims, lbs,
+ NUMERICOID, -1, false, 'i');
+ pfree(null_flags);
+ return PointerGetDatum(array);
+}
+
+static Datum
+single_null_numeric_array_datum()
+{
+ Datum elem = static_cast<Datum>(0);
+ bool is_null = true;
+ int dims[1] = {1};
+ int lbs[1] = {1};
+ ArrayType* array = construct_md_array(&elem, &is_null, 1, dims, lbs,
+ NUMERICOID, -1, false, 'i');
+ return PointerGetDatum(array);
+}
+
+static TupleDesc
+result_tuple_desc(FunctionCallInfo fcinfo, const char* function_name, const int expected_field_count)
+{
+ TupleDesc tupdesc;
+ if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("function returning record called in context that cannot accept type record")));
+
+ tupdesc = BlessTupleDesc(tupdesc);
+ if (tupdesc->natts != expected_field_count)
+ ereport(ERROR,
+ (errcode(ERRCODE_DATATYPE_MISMATCH),
+ errmsg("%s result descriptor has %d fields, expected %d",
+ function_name, tupdesc->natts, expected_field_count)));
+
+ return tupdesc;
+}
+
+inline void
+set_numeric_tuple_field(Datum* values, bool* nulls, const int index,
+ const bool is_null, const double value)
+{
+ nulls[index] = is_null;
+ if (!is_null)
+ values[index] = numeric_datum(value);
+}
+
+inline void
+set_numeric_array_tuple_field(Datum* values, bool* nulls, const int index,
+ const bool is_null, const std::vector<double>& value)
+{
+ nulls[index] = is_null;
+ if (!is_null)
+ values[index] = numeric_array_datum(value);
+}
+
+inline void
+set_single_null_numeric_array_tuple_field(Datum* values, bool* nulls, const int index)
+{
+ nulls[index] = false;
+ values[index] = single_null_numeric_array_datum();
+}
+
+inline Datum
+heap_tuple_datum(TupleDesc tupdesc, Datum* values, bool* nulls)
+{
+ HeapTuple tuple = heap_form_tuple(tupdesc, values, nulls);
+ return HeapTupleGetDatum(tuple);
+}
+
+static Datum
+form_summary_tuple(FunctionCallInfo fcinfo, const SummaryPayload& payload)
+{
+ constexpr int field_count = 18;
+ TupleDesc tupdesc = result_tuple_desc(fcinfo, "DBMS_STAT_FUNCS.SUMMARY", field_count);
+ Datum values[field_count] = {};
+ bool nulls[field_count] = {};
+
+ set_numeric_tuple_field(values, nulls, 0, payload.count_is_null, payload.count);
+
+ const bool scalar_null = !payload.has_scalar_values;
+ set_numeric_tuple_field(values, nulls, 1, scalar_null, payload.min);
+ set_numeric_tuple_field(values, nulls, 2, scalar_null, payload.max);
+ set_numeric_tuple_field(values, nulls, 3, scalar_null, payload.range);
+ set_numeric_tuple_field(values, nulls, 4, scalar_null, payload.mean);
+
+ if (payload.cmode_contains_single_null)
+ set_single_null_numeric_array_tuple_field(values, nulls, 5);
+ else
+ set_numeric_array_tuple_field(values, nulls, 5, payload.cmode_is_null, payload.cmode);
+
+ set_numeric_tuple_field(values, nulls, 6, scalar_null, payload.variance);
+ set_numeric_tuple_field(values, nulls, 7, scalar_null, payload.stddev);
+ set_numeric_tuple_field(values, nulls, 8, scalar_null, payload.quantile_5);
+ set_numeric_tuple_field(values, nulls, 9, scalar_null, payload.quantile_25);
+ set_numeric_tuple_field(values, nulls, 10, scalar_null, payload.median);
+ set_numeric_tuple_field(values, nulls, 11, scalar_null, payload.quantile_75);
+ set_numeric_tuple_field(values, nulls, 12, scalar_null, payload.quantile_95);
+
+ set_numeric_tuple_field(values, nulls, 13, !payload.has_plus_x_sigma, payload.plus_x_sigma);
+ set_numeric_tuple_field(values, nulls, 14, !payload.has_minus_x_sigma, payload.minus_x_sigma);
+ set_numeric_array_tuple_field(values, nulls, 15, payload.extreme_values_is_null, payload.extreme_values);
+ set_numeric_array_tuple_field(values, nulls, 16, payload.top_5_values_is_null, payload.top_5_values);
+ set_numeric_array_tuple_field(values, nulls, 17, payload.bottom_5_values_is_null, payload.bottom_5_values);
+
+ return heap_tuple_datum(tupdesc, values, nulls);
+}
+
+static Datum
+form_dist_fit_tuple(FunctionCallInfo fcinfo, const DistFitResult& result)
+{
+ constexpr int field_count = 3;
+ TupleDesc tupdesc = result_tuple_desc(fcinfo, "DBMS_STAT_FUNCS distribution fit", field_count);
+ Datum values[field_count] = {};
+ bool nulls[field_count] = {};
+
+ set_numeric_tuple_field(values, nulls, 0, result.lambda_is_null, result.lambda);
+ set_numeric_tuple_field(values, nulls, 1, result.mu_is_null, result.mu);
+ set_numeric_tuple_field(values, nulls, 2, !result.has_sig, result.sig);
+
+ return heap_tuple_datum(tupdesc, values, nulls);
+}
+
+static Datum
+form_poisson_tuple(FunctionCallInfo fcinfo, const DistFitResult& result)
+{
+ constexpr int field_count = 2;
+ TupleDesc tupdesc = result_tuple_desc(fcinfo, "DBMS_STAT_FUNCS.POISSON_DIST_FIT", field_count);
+ Datum values[field_count] = {};
+ bool nulls[field_count] = {};
+
+ set_numeric_tuple_field(values, nulls, 0, result.lambda_is_null, result.lambda);
+ set_numeric_tuple_field(values, nulls, 1, !result.has_sig, result.sig);
+
+ return heap_tuple_datum(tupdesc, values, nulls);
+}
+
+static Datum
+form_weibull_tuple(FunctionCallInfo fcinfo, const WeibullFitResult& result)
+{
+ constexpr int field_count = 4;
+ TupleDesc tupdesc = result_tuple_desc(fcinfo, "DBMS_STAT_FUNCS.WEIBULL_DIST_FIT", field_count);
+ Datum values[field_count] = {};
+ bool nulls[field_count] = {};
+
+ set_numeric_tuple_field(values, nulls, 0, result.alpha_is_null, result.alpha);
+ set_numeric_tuple_field(values, nulls, 1, result.mu_is_null, result.mu);
+ set_numeric_tuple_field(values, nulls, 2, result.beta_is_null, result.beta);
+ set_numeric_tuple_field(values, nulls, 3, !result.has_sig, result.sig);
+
+ return heap_tuple_datum(tupdesc, values, nulls);
+}
+
+
+inline void
+raise_compat_error(const char* message, const char* detail = nullptr);
+
+static DistFitResult
+compute_exponential_fit_result(const DistFitArgs& args, const NumericSample& sample)
+{
+ /*
+ * EXPONENTIAL_DIST_FIT использует KS-критерий для заданных lambda и mu.
+ * NULL mu трактуется как 0. Другие критерии возвращают NULL sig до чтения таблицы.
+ */
+ if (sample.values.empty())
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+
+ const double lambda = args.lambda;
+ const double mu = args.mu_is_null ? 0.0 : args.mu;
+
+ if (lambda < 0.0)
+ {
+ DistFitResult result = make_dist_fit_result_with_sig(args, 0.0);
+ result.lambda_is_null = false;
+ result.lambda = lambda;
+ result.mu_is_null = false;
+ result.mu = mu;
+ return result;
+ }
+
+ const auto cdf = [lambda, mu](double x) {
+ return exponential_cdf(x, lambda, mu);
+ };
+
+ const double stat = compute_fit_ks_statistic(sample.values, cdf);
+ const double sig = call_ks_pvalue_service(stat, sample.values.size());
+
+ DistFitResult result = make_dist_fit_result_with_sig(args, sig);
+ result.lambda_is_null = false;
+ result.lambda = lambda;
+ result.mu_is_null = false;
+ result.mu = mu;
+ return result;
+}
+
+static DistFitResult
+compute_normal_fit_result(const DistFitArgs& args, const NumericSample& sample, const NormalTestType test_type)
+{
+ /*
+ * NORMAL_DIST_FIT использует KS-критерий. NULL mean или stdev
+ * подставляет оценку по выборке.
+ */
+ if (sample.values.empty())
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+
+ const double sample_mean_value = sample_mean(sample.values);
+ const double sample_stdev_value = std::sqrt(std::max(0.0, sample_variance(sample.values, sample_mean_value)));
+ Assert(test_type == NormalTestType::KolmogorovSmirnov);
+ const double mean = args.lambda_is_null ? sample_mean_value : args.lambda;
+ const double stdev = args.mu_is_null ? sample_stdev_value : args.mu;
+
+ if (stdev == 0.0)
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+
+ const auto cdf = [mean, stdev](double x) {
+ return normal_cdf(x, mean, stdev);
+ };
+ const double stat = compute_ks_statistic(sample.values, cdf);
+ const double sig = call_ks_pvalue_service(stat, sample.values.size());
+
+ DistFitResult result = make_dist_fit_result_with_sig(args, sig);
+ result.lambda_is_null = false;
+ result.lambda = mean;
+ result.mu_is_null = false;
+ result.mu = stdev;
+ return result;
+}
+
+static DistFitResult
+make_poisson_null_sig_result(const DistFitArgs& args)
+{
+ DistFitResult result;
+ result.has_sig = false;
+ result.lambda_is_null = args.lambda_is_null;
+ result.lambda = args.lambda;
+ result.mu_is_null = true;
+ result.mu = 0.0;
+ return result;
+}
+
+static DistFitResult
+compute_poisson_fit_result(const DistFitArgs& args, const NumericSample& sample)
+{
+ /*
+ * POISSON_DIST_FIT проверяет целочисленные или близкие к ним счётчики
+ * событий относительно заданной интенсивности lambda. Невалидный
+ * test_type и NULL lambda обрабатываются до чтения таблицы. Пустая
+ * non-NULL выборка и наличие NULL в колонке остаются ошибкой.
+ */
+ if (args.lambda_is_null)
+ return make_poisson_null_sig_result(args);
+ if (sample.values.empty())
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+ if (sample.null_count > 0)
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+ const double lambda = args.lambda;
+ const auto cdf = [lambda](double x) {
+ return poisson_cdf_oracle(x, lambda);
+ };
+
+ const double stat = compute_fit_ks_statistic(sample.values, cdf);
+ const double sig = call_ks_pvalue_service(stat, sample.values.size());
+
+ DistFitResult result = make_poisson_null_sig_result(args);
+ result.has_sig = true;
+ result.sig = sig;
+ result.lambda_is_null = false;
+ result.lambda = lambda;
+ return result;
+}
+static DistFitResult
+make_uniform_null_sig_result(const DistFitArgs& args)
+{
+ DistFitResult result;
+ result.has_sig = false;
+ result.lambda_is_null = args.lambda_is_null;
+ result.lambda = args.lambda;
+ result.mu_is_null = args.mu_is_null;
+ result.mu = args.mu;
+ return result;
+}
+
+static DistFitResult
+compute_uniform_fit_result(const DistFitArgs& args, const NumericSample& sample)
+{
+ if (sample.values.empty())
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+
+ const double param_a = args.lambda;
+ const double param_b = args.mu;
+
+ DistFitResult result = make_uniform_null_sig_result(args);
+ result.lambda_is_null = false;
+ result.lambda = param_a;
+ result.mu_is_null = false;
+ result.mu = param_b;
+
+ const auto cdf = [param_a, param_b](double x) {
+ return uniform_continuous_cdf_oracle(x, param_a, param_b);
+ };
+
+ const double stat = compute_fit_ks_statistic(sample.values, cdf);
+ result.has_sig = true;
+ result.sig = call_ks_pvalue_service(stat, sample.values.size());
+ return result;
+}
+
+static WeibullFitResult
+make_weibull_null_sig_result(const WeibullFitArgs& args)
+{
+ WeibullFitResult result;
+ result.has_sig = false;
+ result.alpha_is_null = args.alpha_is_null;
+ result.alpha = args.alpha;
+ result.mu_is_null = false;
+ result.mu = args.mu_is_null ? 0.0 : args.mu;
+ result.beta_is_null = args.beta_is_null;
+ result.beta = args.beta;
+ return result;
+}
+
+static WeibullFitResult
+compute_weibull_fit_result(const WeibullFitArgs& args, const NumericSample& sample)
+{
+ /*
+ * WEIBULL_DIST_FIT использует KS-критерий для распределения Вейбулла
+ * с параметрами alpha, mu и beta. NULL mu трактуется как 0.
+ */
+ if (sample.values.empty())
+ raise_compat_error("ORA-01405: The fetched column returned a NULL value.");
+
+ const double alpha = args.alpha;
+ const double mu = args.mu_is_null ? 0.0 : args.mu;
+ const double beta = args.beta;
+
+ if (alpha == 0.0)
+ ereport(ERROR,
+ (errcode(ERRCODE_DIVISION_BY_ZERO),
+ errmsg("ORA-01476: divisor is equal to zero")));
+ if (alpha < 0.0)
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-06502: PL/SQL: value or conversion error")));
+ for (const double value : sample.values)
+ {
+ if (value < mu)
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-06502: PL/SQL: value or conversion error")));
+ }
+
+ const auto cdf = [alpha, mu, beta](double x) {
+ return weibull_cdf(x, alpha, mu, beta);
+ };
+
+ const double stat = compute_fit_ks_statistic(sample.values, cdf);
+ const double sig = call_ks_pvalue_service(stat, sample.values.size());
+
+ WeibullFitResult result = make_weibull_null_sig_result(args);
+ result.has_sig = true;
+ result.sig = sig;
+ result.alpha_is_null = false;
+ result.alpha = alpha;
+ result.mu_is_null = false;
+ result.mu = mu;
+ result.beta_is_null = false;
+ result.beta = beta;
+ return result;
+}
+
+inline void
+raise_compat_error(const char* message, const char* detail)
+{
+ if (detail != nullptr)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
+ errmsg("%s: %s", message, detail)));
+
+ ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("%s", message)));
+}
+
+inline SummaryArgs
+read_summary_args(FunctionCallInfo fcinfo)
+{
+ SummaryArgs args;
+ if (!PG_ARGISNULL(0))
+ args.ownername = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ if (!PG_ARGISNULL(1))
+ args.tablename = text_to_cstring(PG_GETARG_TEXT_PP(1));
+ if (!PG_ARGISNULL(2))
+ args.columnname = text_to_cstring(PG_GETARG_TEXT_PP(2));
+
+ args.sigma_is_null = PG_ARGISNULL(3);
+ if (!args.sigma_is_null)
+ args.sigma = read_numeric_arg(fcinfo, 3, "sigma_value");
+
+ return args;
+}
+
+inline DistFitArgs
+read_dist_fit_args(FunctionCallInfo fcinfo)
+{
+ DistFitArgs args;
+ if (!PG_ARGISNULL(0))
+ args.ownername = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ if (!PG_ARGISNULL(1))
+ args.tablename = text_to_cstring(PG_GETARG_TEXT_PP(1));
+ if (!PG_ARGISNULL(2))
+ args.columnname = text_to_cstring(PG_GETARG_TEXT_PP(2));
+
+ args.test_type_is_null = PG_ARGISNULL(3);
+ if (!args.test_type_is_null)
+ args.test_type = trim_copy(text_to_cstring(PG_GETARG_TEXT_PP(3)));
+
+ args.lambda_is_null = PG_ARGISNULL(4);
+ if (!args.lambda_is_null)
+ args.lambda = read_numeric_arg(fcinfo, 4, "lambda");
+
+ args.mu_is_null = PG_ARGISNULL(5);
+ if (!args.mu_is_null)
+ args.mu = read_numeric_arg(fcinfo, 5, "mu");
+
+ return args;
+}
+
+inline DistFitArgs
+read_poisson_dist_fit_args(FunctionCallInfo fcinfo)
+{
+ DistFitArgs args;
+ if (!PG_ARGISNULL(0))
+ args.ownername = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ if (!PG_ARGISNULL(1))
+ args.tablename = text_to_cstring(PG_GETARG_TEXT_PP(1));
+ if (!PG_ARGISNULL(2))
+ args.columnname = text_to_cstring(PG_GETARG_TEXT_PP(2));
+
+ args.test_type_is_null = PG_ARGISNULL(3);
+ if (!args.test_type_is_null)
+ args.test_type = trim_copy(text_to_cstring(PG_GETARG_TEXT_PP(3)));
+
+ args.lambda_is_null = PG_ARGISNULL(4);
+ if (!args.lambda_is_null)
+ args.lambda = read_numeric_arg(fcinfo, 4, "lambda");
+
+ args.mu_is_null = true;
+ args.mu = 0.0;
+ return args;
+}
+
+inline DistFitArgs
+read_uniform_dist_fit_args(FunctionCallInfo fcinfo, std::string& var_type, bool& var_type_is_null)
+{
+ DistFitArgs args;
+ if (!PG_ARGISNULL(0))
+ args.ownername = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ if (!PG_ARGISNULL(1))
+ args.tablename = text_to_cstring(PG_GETARG_TEXT_PP(1));
+ if (!PG_ARGISNULL(2))
+ args.columnname = text_to_cstring(PG_GETARG_TEXT_PP(2));
+
+ var_type_is_null = PG_ARGISNULL(3);
+ if (!var_type_is_null)
+ var_type = trim_copy(text_to_cstring(PG_GETARG_TEXT_PP(3)));
+
+ args.test_type_is_null = PG_ARGISNULL(4);
+ if (!args.test_type_is_null)
+ args.test_type = trim_copy(text_to_cstring(PG_GETARG_TEXT_PP(4)));
+
+ args.lambda_is_null = PG_ARGISNULL(5);
+ if (!args.lambda_is_null)
+ args.lambda = read_numeric_arg(fcinfo, 5, "paramA");
+
+ args.mu_is_null = PG_ARGISNULL(6);
+ if (!args.mu_is_null)
+ args.mu = read_numeric_arg(fcinfo, 6, "paramB");
+
+ return args;
+}
+
+inline WeibullFitArgs
+read_weibull_dist_fit_args(FunctionCallInfo fcinfo)
+{
+ WeibullFitArgs args;
+ if (!PG_ARGISNULL(0))
+ args.ownername = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ if (!PG_ARGISNULL(1))
+ args.tablename = text_to_cstring(PG_GETARG_TEXT_PP(1));
+ if (!PG_ARGISNULL(2))
+ args.columnname = text_to_cstring(PG_GETARG_TEXT_PP(2));
+
+ args.test_type_is_null = PG_ARGISNULL(3);
+ if (!args.test_type_is_null)
+ args.test_type = trim_copy(text_to_cstring(PG_GETARG_TEXT_PP(3)));
+
+ args.alpha_is_null = PG_ARGISNULL(4);
+ if (!args.alpha_is_null)
+ args.alpha = read_numeric_arg(fcinfo, 4, "alpha");
+
+ args.mu_is_null = PG_ARGISNULL(5);
+ if (!args.mu_is_null)
+ args.mu = read_numeric_arg(fcinfo, 5, "mu");
+
+ args.beta_is_null = PG_ARGISNULL(6);
+ if (!args.beta_is_null)
+ args.beta = read_numeric_arg(fcinfo, 6, "beta");
+
+ return args;
+}
+
+} // namespace
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_exponential_dist_fit);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_get_version);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_ks_pvalue);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_normal_dist_fit);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_poisson_dist_fit);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_summary);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_uniform_dist_fit);
+PG_FUNCTION_INFO_V1(dbms_stat_funcs_weibull_dist_fit);
+
+/// @brief Версия RUDB пакета DBMS_STAT_FUNCS (Oracle DBMS_STAT_FUNCS пакет)
+#define RUDB_DBMS_STAT_FUNCS_VERSION "1.0.0"
+} // extern "C"
+
+Datum
+dbms_stat_funcs_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_STAT_FUNCS_VERSION));
+}
+
+Datum
+dbms_stat_funcs_ks_pvalue(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1))
+ PG_RETURN_NULL();
+
+ const double statistic = PG_GETARG_FLOAT8(0);
+ const int32 sample_count = PG_GETARG_INT32(1);
+ const std::optional<double> result = ks_pvalue_checked(statistic, sample_count);
+
+ if (!result.has_value())
+ PG_RETURN_NULL();
+
+ PG_RETURN_FLOAT8(*result);
+}
+
+Datum
+dbms_stat_funcs_exponential_dist_fit(PG_FUNCTION_ARGS)
+{
+ const DistFitArgs args = read_dist_fit_args(fcinfo);
+ const TestType test_type = parse_exponential_test_type(args);
+
+ /*
+ * Мягкие ошибки аргументов обрабатываются до чтения таблицы:
+ * невалидный test_type и NULL lambda дают NULL sig.
+ */
+ if (test_type == TestType::Invalid || !is_exponential_test_type_supported(test_type) || args.lambda_is_null)
+ {
+ const DistFitResult result = make_exponential_null_sig_result(args);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+ }
+
+ const NumericSample sample = load_numeric_sample(args, "DBMS_STAT_FUNCS.EXPONENTIAL_DIST_FIT");
+ const DistFitResult result = compute_exponential_fit_result(args, sample);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+}
+
+Datum
+dbms_stat_funcs_normal_dist_fit(PG_FUNCTION_ARGS)
+{
+ const DistFitArgs args = read_dist_fit_args(fcinfo);
+ const NormalTestType test_type = parse_normal_test_type(args);
+
+ /* Невалидный test_type даёт NULL sig без обращения к таблице. */
+ if (test_type == NormalTestType::Invalid || !is_normal_test_type_supported(test_type))
+ {
+ const DistFitResult result = make_normal_null_sig_result(args);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+ }
+
+ const NumericSample sample = load_numeric_sample(args, "DBMS_STAT_FUNCS.NORMAL_DIST_FIT", true);
+ const DistFitResult result = compute_normal_fit_result(args, sample, test_type);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+}
+
+Datum
+dbms_stat_funcs_poisson_dist_fit(PG_FUNCTION_ARGS)
+{
+ const DistFitArgs args = read_poisson_dist_fit_args(fcinfo);
+ const PoissonTestType test_type = parse_poisson_test_type(args);
+
+ /* Невалидный test_type и NULL lambda дают NULL sig без обращения к таблице. */
+ if (test_type == PoissonTestType::Invalid || !is_poisson_test_type_supported(test_type) || args.lambda_is_null)
+ {
+ const DistFitResult result = make_poisson_null_sig_result(args);
+ PG_RETURN_DATUM(form_poisson_tuple(fcinfo, result));
+ }
+
+ const NumericSample sample = load_numeric_sample(args, "DBMS_STAT_FUNCS.POISSON_DIST_FIT");
+ const DistFitResult result = compute_poisson_fit_result(args, sample);
+ PG_RETURN_DATUM(form_poisson_tuple(fcinfo, result));
+}
+
+Datum
+dbms_stat_funcs_summary(PG_FUNCTION_ARGS)
+{
+ const SummaryArgs args = read_summary_args(fcinfo);
+ const SummaryLoadResult loaded = load_summary_sample(args);
+ const SummaryPayload payload = compute_summary_payload(loaded.sample, args.sigma, args.sigma_is_null);
+ PG_RETURN_DATUM(form_summary_tuple(fcinfo, payload));
+}
+
+Datum
+dbms_stat_funcs_uniform_dist_fit(PG_FUNCTION_ARGS)
+{
+ std::string var_type_raw;
+ bool var_type_is_null = false;
+ const DistFitArgs args = read_uniform_dist_fit_args(fcinfo, var_type_raw, var_type_is_null);
+ const UniformVarType var_type = parse_uniform_var_type(var_type_is_null, var_type_raw);
+ const TestType test_type = parse_uniform_test_type(args);
+
+ if (var_type == UniformVarType::Invalid || test_type == TestType::Invalid ||
+ !is_uniform_combination_supported(var_type, test_type))
+ {
+ const DistFitResult result = make_uniform_null_sig_result(args);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+ }
+
+ if (args.lambda_is_null || args.mu_is_null)
+ {
+ const DistFitResult result = make_uniform_null_sig_result(args);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+ }
+
+ if (args.lambda == args.mu)
+ ereport(ERROR,
+ (errcode(ERRCODE_DIVISION_BY_ZERO),
+ errmsg("ORA-01476: divisor is equal to zero")));
+
+
+ const NumericSample sample = load_numeric_sample(args, "DBMS_STAT_FUNCS.UNIFORM_DIST_FIT");
+ const DistFitResult result = compute_uniform_fit_result(args, sample);
+ PG_RETURN_DATUM(form_dist_fit_tuple(fcinfo, result));
+}
+
+Datum
+dbms_stat_funcs_weibull_dist_fit(PG_FUNCTION_ARGS)
+{
+ const WeibullFitArgs args = read_weibull_dist_fit_args(fcinfo);
+ const TestType test_type = parse_weibull_test_type(args);
+
+ /* Невалидный test_type и NULL alpha/beta дают NULL sig без обращения к таблице. */
+ if (test_type == TestType::Invalid || !is_weibull_test_type_supported(test_type) ||
+ args.alpha_is_null || args.beta_is_null)
+ {
+ const WeibullFitResult result = make_weibull_null_sig_result(args);
+ PG_RETURN_DATUM(form_weibull_tuple(fcinfo, result));
+ }
+
+ if (args.alpha == 0.0)
+ ereport(ERROR,
+ (errcode(ERRCODE_DIVISION_BY_ZERO),
+ errmsg("ORA-01476: divisor is equal to zero")));
+ if (args.alpha < 0.0)
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("ORA-06502: PL/SQL: value or conversion error")));
+
+ const NumericSample sample = load_numeric_sample(args, "DBMS_STAT_FUNCS.WEIBULL_DIST_FIT");
+ const WeibullFitResult result = compute_weibull_fit_result(args, sample);
+ PG_RETURN_DATUM(form_weibull_tuple(fcinfo, result));
+}
diff --git a/src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.hpp b/src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.hpp
new file mode 100644
index 0000000..0e1e48d
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_stat_funcs/dbms_stat_funcs.hpp
@@ -0,0 +1,243 @@
+#ifndef DBMS_STAT_FUNCS_INTERNAL_HPP
+#define DBMS_STAT_FUNCS_INTERNAL_HPP
+
+/*
+ * DBMS_STAT_FUNCS
+ *
+ * Назначение:
+ * Пакет предоставляет SQL-функции для подбора распределений и
+ * расчёта сводной статистики по числовым колонкам.
+ *
+ * Сделано:
+ * Реализованы EXPONENTIAL_DIST_FIT, NORMAL_DIST_FIT, POISSON_DIST_FIT,
+ * UNIFORM_DIST_FIT, WEIBULL_DIST_FIT и SUMMARY. Для проверок соответствия
+ * распределения используется критерий KOLMOGOROV_SMIRNOV; остальные
+ * значения test_type сохраняются в SQL-поверхности вызова и возвращают
+ * sig = NULL без расчёта критерия.
+ *
+ * Не сделано:
+ * Поддержка date/datetime-колонок в SUMMARY — не реализована, потому что
+ * текущая реализация пакета работает только с числовыми колонками.
+ */
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+} // extern "C"
+
+extern "C"
+{
+/**
+ * @brief Возвращает версию пакета DBMS_STAT_FUNCS.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_STAT_FUNCS.GET_VERSION() FROM dual;
+ * SELECT dbms_stat_funcs_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_stat_funcs_get_version(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Подбирает экспоненциальное распределение для числовой колонки.
+ * @details Возвращает record с полями `lambda`, `mu`, `sig`. Поддерживает
+ * `KOLMOGOROV_SMIRNOV`; `ANDERSON_DARLING`,
+ * `CHI_SQUARED`, NULL `lambda` и остальные значения `test_type` дают
+ * `sig = NULL`. NULL `mu` трактуется как `0`.
+ * Примеры:
+ * SELECT *
+ * FROM dbms_stat_funcs_exponential_dist_fit(
+ * 'monitoring', 'web_requests_hourly', 'wait_seconds',
+ * 'KOLMOGOROV_SMIRNOV', 0.25, 0);
+ *
+ * SELECT sig, lambda, mu
+ * FROM dbms_stat_funcs_exponential_dist_fit(
+ * 'monitoring', 'api_latency', 'processing_delay_sec',
+ * 'ANDERSON_DARLING', 0.4166666667, 0);
+ *
+ * SELECT sig
+ * FROM dbms_stat_funcs_exponential_dist_fit(
+ * 'monitoring', 'api_latency', 'processing_delay_sec',
+ * 'CHI_SQUARED', 0.4166666667, 0);
+ * @param ownername Имя владельца таблицы.
+ * @param tablename Имя таблицы.
+ * @param columnname Имя числовой колонки.
+ * @param test_type Тип проверки: `KOLMOGOROV_SMIRNOV`, `ANDERSON_DARLING`, `CHI_SQUARED`.
+ * @param lambda Параметр интенсивности распределения.
+ * @param mu Параметр сдвига распределения.
+ * @return Именованный record с полями `lambda`, `mu`, `sig`.
+ */
+Datum dbms_stat_funcs_exponential_dist_fit(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Вычисляет значимость статистики Колмогорова-Смирнова.
+ * @details Функция использует ту же аппроксимацию, что и пути
+ * distribution fit внутри пакета.
+ * Примеры:
+ * SELECT dbms_stat_funcs_ks_pvalue(0.1::float8, 20);
+ * SELECT round(dbms_stat_funcs_ks_pvalue(0.1::float8, 20)::numeric, 12);
+ * SELECT dbms_stat_funcs_ks_pvalue(0.0::float8, 10);
+ * @param statistic Значение статистики критерия.
+ * @param sample_count Объём выборки.
+ * @return Значимость критерия либо SQL `NULL` для неподдержанного ввода.
+ */
+Datum dbms_stat_funcs_ks_pvalue(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Подбирает нормальное распределение для числовой колонки.
+ * @details Возвращает record с полями `mean`, `stdev`, `sig`.
+ * Поддерживает `KOLMOGOROV_SMIRNOV`. NULL `mean` или `stdev`
+ * подставляет оценку по выборке. `SHAPIRO_WILKS`,
+ * `ANDERSON_DARLING`, `CHI_SQUARED` и остальные значения
+ * `test_type` возвращают `sig = NULL`.
+ * Примеры:
+ * SELECT *
+ * FROM dbms_stat_funcs_normal_dist_fit(
+ * 'monitoring', 'api_requests', 'response_time_ms',
+ * 'KOLMOGOROV_SMIRNOV', NULL, NULL);
+ *
+ * SELECT sig, mean, stdev
+ * FROM dbms_stat_funcs_normal_dist_fit(
+ * 'monitoring', 'temperature_readings', 'temperature_value',
+ * 'KOLMOGOROV_SMIRNOV', 0, 1);
+ *
+ * SELECT sig
+ * FROM dbms_stat_funcs_normal_dist_fit(
+ * 'monitoring', 'temperature_readings', 'temperature_value',
+ * 'CHI_SQUARED', 0, 1);
+ * @param ownername Имя владельца таблицы.
+ * @param tablename Имя таблицы.
+ * @param columnname Имя числовой колонки.
+ * @param test_type Тип проверки: `SHAPIRO_WILKS`, `KOLMOGOROV_SMIRNOV`, `ANDERSON_DARLING`, `CHI_SQUARED`.
+ * @param mean Параметр среднего значения.
+ * @param stdev Параметр стандартного отклонения.
+ * @return Именованный record с полями `mean`, `stdev`, `sig`.
+ */
+Datum dbms_stat_funcs_normal_dist_fit(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Подбирает распределение Пуассона для числовой колонки.
+ * @details Возвращает record с полями `lambda`, `sig`. Поддерживает
+ * `KOLMOGOROV_SMIRNOV`; `ANDERSON_DARLING`, `CHI_SQUARED`, NULL,
+ * пустая строка, другой регистр и остальные значения `test_type`
+ * дают `sig = NULL`.
+ * Примеры:
+ * SELECT *
+ * FROM dbms_stat_funcs_poisson_dist_fit(
+ * 'monitoring', 'web_requests_hourly', 'error_count',
+ * 'KOLMOGOROV_SMIRNOV', 2);
+ *
+ * SELECT sig, lambda
+ * FROM dbms_stat_funcs_poisson_dist_fit(
+ * 'monitoring', 'api_5xx_per_min', 'cnt',
+ * 'KOLMOGOROV_SMIRNOV', 2.4);
+ *
+ * SELECT sig
+ * FROM dbms_stat_funcs_poisson_dist_fit(
+ * 'monitoring', 'api_5xx_per_min', 'cnt',
+ * 'CHI_SQUARED', 2.4);
+ * @param ownername Имя владельца таблицы.
+ * @param tablename Имя таблицы.
+ * @param columnname Имя числовой колонки.
+ * @param test_type Тип проверки: `KOLMOGOROV_SMIRNOV`, `ANDERSON_DARLING`, `CHI_SQUARED`.
+ * @param lambda Интенсивность распределения Пуассона.
+ * @return Именованный record с полями `lambda`, `sig`.
+ */
+Datum dbms_stat_funcs_poisson_dist_fit(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает сводную статистику по числовой колонке.
+ * @details Формирует именованный record с полями `count`, `min`, `max`,
+ * `range`, `mean`, `cmode`, `variance`, `stddev`, `quantile_5`,
+ * `quantile_25`, `median`, `quantile_75`, `quantile_95`,
+ * `plus_x_sigma`, `minus_x_sigma`, `extreme_values`,
+ * `top_5_values` и `bottom_5_values`. Коллекционные поля
+ * возвращаются как массивы `numeric[]`. NULL `sigma_value` сохраняет
+ * обычную статистику, но возвращает NULL для `plus_x_sigma` и
+ * `minus_x_sigma`, а `extreme_values` — пустым массивом.
+ * Примеры:
+ * SELECT *
+ * FROM dbms_stat_funcs_summary('public', 'sales_fact', 'sales_amount', 3);
+ *
+ * SELECT count, min, max, mean, stddev, median
+ * FROM dbms_stat_funcs_summary('monitoring', 'api_latency', 'latency_ms', 2);
+ *
+ * SELECT extreme_values, top_5_values, bottom_5_values
+ * FROM dbms_stat_funcs_summary('monitoring', 'api_latency', 'latency_ms', NULL);
+ * @param ownername Имя владельца таблицы.
+ * @param tablename Имя таблицы.
+ * @param columnname Имя числовой колонки.
+ * @param sigma_value Числовое количество сигм для границ и экстремальных значений.
+ * @return Именованный record со сводной статистикой.
+ */
+Datum dbms_stat_funcs_summary(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Подбирает равномерное распределение для числовой колонки.
+ * @details Возвращает record с полями `parama`, `paramb`, `sig`. Поддерживает `CONTINUOUS` +
+ * `KOLMOGOROV_SMIRNOV`. `DISCRETE`, `ANDERSON_DARLING`,
+ * `CHI_SQUARED`, явные NULL, пустые строки, другой регистр и
+ * остальные значения `var_type` или `test_type` дают
+ * `sig = NULL`. При `parama > paramb` границы не переставляются.
+ * Примеры:
+ * SELECT *
+ * FROM dbms_stat_funcs_uniform_dist_fit(
+ * 'analytics', 'sample_distribution', 'sample_ratio',
+ * 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', 0, 1);
+ *
+ * SELECT sig, parama, paramb
+ * FROM dbms_stat_funcs_uniform_dist_fit(
+ * 'analytics', 'bucket_traffic', 'bucket_id',
+ * 'DISCRETE', 'CHI_SQUARED', 1, 5);
+ *
+ * SELECT sig
+ * FROM dbms_stat_funcs_uniform_dist_fit(
+ * 'analytics', 'sample_distribution', 'sample_ratio',
+ * 'CONTINUOUS', 'ANDERSON_DARLING', 0, 1);
+ * @param ownername Имя владельца таблицы.
+ * @param tablename Имя таблицы.
+ * @param columnname Имя числовой колонки.
+ * @param var_type Тип распределения: `CONTINUOUS`, `DISCRETE`.
+ * @param test_type Тип проверки: `KOLMOGOROV_SMIRNOV`, `ANDERSON_DARLING`, `CHI_SQUARED`.
+ * @param parama Нижняя граница распределения.
+ * @param paramb Верхняя граница распределения.
+ * @return Именованный record с полями `parama`, `paramb`, `sig`.
+ */
+Datum dbms_stat_funcs_uniform_dist_fit(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Подбирает распределение Вейбулла для числовой колонки.
+ * @details Возвращает record с полями `alpha`, `mu`, `beta`, `sig`. Поддерживает `KOLMOGOROV_SMIRNOV`; `ANDERSON_DARLING`,
+ * `CHI_SQUARED`, NULL, пустая строка, другой регистр или
+ * остальные значения `test_type` дают `sig = NULL`. NULL
+ * `alpha` и `beta` также дают `sig = NULL`. NULL `mu` трактуется
+ * как `0`. `alpha = 0` даёт ошибку деления на ноль; отрицательный
+ * `alpha` и значения выборки ниже `mu` дают ошибку преобразования.
+ * Примеры:
+ * SELECT *
+ * FROM dbms_stat_funcs_weibull_dist_fit(
+ * 'maintenance', 'component_life', 'lifetime_hours',
+ * 'KOLMOGOROV_SMIRNOV', 2, 0, 1.5);
+ *
+ * SELECT sig, alpha, mu, beta
+ * FROM dbms_stat_funcs_weibull_dist_fit(
+ * 'maintenance', 'failure_history', 'failure_time_hours',
+ * 'ANDERSON_DARLING', 2, 0, 1.5);
+ *
+ * SELECT sig
+ * FROM dbms_stat_funcs_weibull_dist_fit(
+ * 'maintenance', 'failure_history', 'failure_time_hours',
+ * 'CHI_SQUARED', 2, 0, 1.5);
+ * @param ownername Имя владельца таблицы.
+ * @param tablename Имя таблицы.
+ * @param columnname Имя числовой колонки.
+ * @param test_type Тип проверки: `KOLMOGOROV_SMIRNOV`, `ANDERSON_DARLING`, `CHI_SQUARED`.
+ * @param alpha Параметр масштаба распределения.
+ * @param mu Параметр сдвига распределения.
+ * @param beta Параметр формы распределения.
+ * @return Именованный record с полями `alpha`, `mu`, `beta`, `sig`.
+ */
+Datum dbms_stat_funcs_weibull_dist_fit(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_STAT_FUNCS_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_system/dbms_system.cpp b/src/backend/utils/dbms/dbms_system/dbms_system.cpp
new file mode 100644
index 0000000..d48ab0a
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_system/dbms_system.cpp
@@ -0,0 +1,776 @@
+#include "dbms_system.hpp"
+
+#include <array>
+#include <cerrno>
+#include <cstddef>
+#include <cstdio>
+
+extern "C" {
+#include "postgres.h"
+#include "executor/executor.h"
+#include "fmgr.h"
+#include "miscadmin.h"
+#include "port.h"
+#include "storage/ipc.h"
+#include "tcop/utility.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/guc.h"
+#include "utils/memutils.h"
+#include "utils/timestamp.h"
+
+PG_FUNCTION_INFO_V1(dbms_system_ksdwrt);
+PG_FUNCTION_INFO_V1(dbms_system_is_valid_session);
+PG_FUNCTION_INFO_V1(dbms_system_set_ev);
+PG_FUNCTION_INFO_V1(dbms_system_read_ev);
+PG_FUNCTION_INFO_V1(dbms_system_set_sql_trace_in_session);
+PG_FUNCTION_INFO_V1(dbms_system_get_version);
+
+/// @brief Версия RUDB пакета DBMS_SYSTEM (Oracle DBMS_SYSTEM пакет)
+#define RUDB_DBMS_SYSTEM_VERSION "1.0.0"
+}
+
+namespace {
+
+constexpr int32 kSqlTraceEvent = 10046;
+constexpr int32 kKsdwrtDestTraceFile = 1;
+constexpr int32 kKsdwrtDestServerLog = 2;
+constexpr int32 kKsdwrtDestTraceFileAndServerLog = 3;
+constexpr std::size_t kTraceStackMax = 64;
+
+int32 event10046Level = 0;
+FILE* ksdwrtTraceFile = nullptr;
+char ksdwrtTraceFilePath[MAXPGPATH] = {0};
+char ksdwrtTraceDirectoryPath[MAXPGPATH] = {0};
+TimestampTz ksdwrtTraceFileStamp = 0;
+bool ksdwrtTraceFileProcExitRegistered = false;
+
+bool traceHooksInstalled = false;
+ExecutorStart_hook_type prevExecutorStartHook = nullptr;
+ExecutorRun_hook_type prevExecutorRunHook = nullptr;
+ExecutorFinish_hook_type prevExecutorFinishHook = nullptr;
+ExecutorEnd_hook_type prevExecutorEndHook = nullptr;
+ProcessUtility_hook_type prevProcessUtilityHook = nullptr;
+
+struct TraceFrame {
+ QueryDesc* queryDesc = nullptr;
+ TimestampTz startTime = 0;
+ int32 level = 0;
+};
+
+std::array<TraceFrame, kTraceStackMax> traceStack;
+std::size_t traceStackDepth = 0;
+
+void closeKsdwrtTraceFile(int code, Datum arg);
+void executorStartHook(QueryDesc* queryDesc, int eflags);
+void executorRunHook(QueryDesc* queryDesc, ScanDirection direction, uint64 count);
+void executorFinishHook(QueryDesc* queryDesc);
+void executorEndHook(QueryDesc* queryDesc);
+void processUtilityHook(PlannedStmt* pstmt, const char* queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment* queryEnv, DestReceiver* dest, QueryCompletion* qc);
+
+inline const char*
+destName(const int32 dest)
+{
+ switch (dest) {
+ case kKsdwrtDestTraceFile:
+ return "trace_file";
+ case kKsdwrtDestServerLog:
+ return "server_log";
+ case kKsdwrtDestTraceFileAndServerLog:
+ return "trace_file+server_log";
+ default:
+ return "unknown";
+ }
+}
+
+inline bool
+isKsdwrtDestValid(const int32 dest)
+{
+ return dest == kKsdwrtDestTraceFile || dest == kKsdwrtDestServerLog || dest == kKsdwrtDestTraceFileAndServerLog;
+}
+
+inline bool
+ksdwrtDestIncludesTraceFile(const int32 dest)
+{
+ return dest == kKsdwrtDestTraceFile || dest == kKsdwrtDestTraceFileAndServerLog;
+}
+
+inline bool
+ksdwrtDestIncludesServerLog(const int32 dest)
+{
+ return dest == kKsdwrtDestServerLog || dest == kKsdwrtDestTraceFileAndServerLog;
+}
+
+inline bool
+isAbsoluteFilePath(const char* const path)
+{
+ return path != nullptr && path[0] == '/';
+}
+
+inline const char*
+configuredLogDirectoryOrDefault(const char* const logDirectory)
+{
+ if (logDirectory == nullptr || logDirectory[0] == '\0') {
+ return "log";
+ }
+
+ return logDirectory;
+}
+
+inline const char*
+dataDirectoryOrCurrent()
+{
+ if (DataDir == nullptr || DataDir[0] == '\0') {
+ return ".";
+ }
+
+ return DataDir;
+}
+
+inline bool
+appendFormattedPath(char* const target, const std::size_t targetSize, const char* const format, const char* const logDirectory, const char* const fileName)
+{
+ const int written = std::snprintf(target, targetSize, format, logDirectory, fileName);
+
+ return written >= 0 && static_cast<std::size_t>(written) < targetSize;
+}
+
+inline const char*
+commandName(const CmdType commandType)
+{
+ switch (commandType) {
+ case CMD_SELECT:
+ return "SELECT";
+ case CMD_UPDATE:
+ return "UPDATE";
+ case CMD_INSERT:
+ return "INSERT";
+ case CMD_DELETE:
+ return "DELETE";
+ case CMD_MERGE:
+ return "MERGE";
+ case CMD_UTILITY:
+ return "UTILITY";
+ case CMD_NOTHING:
+ return "NOTHING";
+ case CMD_UNKNOWN:
+ default:
+ return "UNKNOWN";
+ }
+}
+
+inline bool
+isValidSession(const int32 sid, const int32 serialNum)
+{
+ (void) serialNum;
+
+ return sid == static_cast<int32>(MyProcPid);
+}
+
+inline bool
+traceEnabled()
+{
+ return event10046Level > 0;
+}
+
+inline const char*
+strOrEmpty(const char* const value)
+{
+ return value != nullptr ? value : "";
+}
+
+inline const char*
+queryStringOrUnknown(const char* const queryString)
+{
+ if (queryString == nullptr || queryString[0] == '\0') {
+ return "<unknown>";
+ }
+
+ return queryString;
+}
+
+inline long
+durationMs(const TimestampTz startTime, const TimestampTz endTime)
+{
+ return TimestampDifferenceMilliseconds(startTime, endTime);
+}
+
+inline const char*
+utilityCommandName(const PlannedStmt* const pstmt)
+{
+ if (pstmt != nullptr && pstmt->utilityStmt != nullptr) {
+ return CreateCommandName(pstmt->utilityStmt);
+ }
+
+ return "UTILITY";
+}
+
+bool
+buildKsdwrtTraceFilePath()
+{
+ if (ksdwrtTraceFileStamp == 0) {
+ ksdwrtTraceFileStamp = GetCurrentTimestamp();
+ }
+
+ char fileName[MAXPGPATH];
+ const int fileNameLength = std::snprintf(fileName, sizeof(fileName), "dbms_system_trace_%d_%lld.log", static_cast<int>(MyProcPid), static_cast<long long>(ksdwrtTraceFileStamp));
+
+ if (fileNameLength < 0 || static_cast<std::size_t>(fileNameLength) >= sizeof(fileName)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: trace file name is too long, noop")));
+ return false;
+ }
+
+ char* const logDirectoryConfig = GetConfigOptionByName("log_directory", nullptr, true);
+ const char* const logDirectory = configuredLogDirectoryOrDefault(logDirectoryConfig);
+ const int directoryLength = isAbsoluteFilePath(logDirectory)
+ ? std::snprintf(ksdwrtTraceDirectoryPath, sizeof(ksdwrtTraceDirectoryPath), "%s", logDirectory)
+ : std::snprintf(ksdwrtTraceDirectoryPath, sizeof(ksdwrtTraceDirectoryPath), "%s/%s", dataDirectoryOrCurrent(), logDirectory);
+
+ if (logDirectoryConfig != nullptr) {
+ pfree(logDirectoryConfig);
+ }
+
+ if (directoryLength < 0 || static_cast<std::size_t>(directoryLength) >= sizeof(ksdwrtTraceDirectoryPath)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: trace directory path is too long, noop")));
+ ksdwrtTraceDirectoryPath[0] = '\0';
+ ksdwrtTraceFilePath[0] = '\0';
+ return false;
+ }
+
+ if (!appendFormattedPath(ksdwrtTraceFilePath, sizeof(ksdwrtTraceFilePath), "%s/%s", ksdwrtTraceDirectoryPath, fileName)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: trace file path is too long, noop")));
+ ksdwrtTraceDirectoryPath[0] = '\0';
+ ksdwrtTraceFilePath[0] = '\0';
+ return false;
+ }
+
+ return true;
+}
+
+bool
+openKsdwrtTraceFile()
+{
+ if (ksdwrtTraceFile != nullptr) {
+ return true;
+ }
+
+ if (!buildKsdwrtTraceFilePath()) {
+ return false;
+ }
+
+ errno = 0;
+ if (pg_mkdir_p(ksdwrtTraceDirectoryPath, 0700) != 0) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: could not create trace directory \"%s\": %m", ksdwrtTraceDirectoryPath)));
+ ksdwrtTraceDirectoryPath[0] = '\0';
+ ksdwrtTraceFilePath[0] = '\0';
+ return false;
+ }
+
+ errno = 0;
+ ksdwrtTraceFile = std::fopen(ksdwrtTraceFilePath, "a");
+
+ if (ksdwrtTraceFile == nullptr) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: could not open trace file \"%s\": %m", ksdwrtTraceFilePath)));
+ ksdwrtTraceDirectoryPath[0] = '\0';
+ ksdwrtTraceFilePath[0] = '\0';
+ return false;
+ }
+
+ if (!ksdwrtTraceFileProcExitRegistered) {
+ on_proc_exit(closeKsdwrtTraceFile, static_cast<Datum>(0));
+ ksdwrtTraceFileProcExitRegistered = true;
+ }
+
+ return true;
+}
+
+void
+closeKsdwrtTraceFile(const int code, const Datum arg)
+{
+ (void) code;
+ (void) arg;
+
+ if (ksdwrtTraceFile == nullptr) {
+ return;
+ }
+
+ std::fclose(ksdwrtTraceFile);
+ ksdwrtTraceFile = nullptr;
+}
+
+void
+writeKsdwrtServerLog(const int32 dest, const char* const message)
+{
+ ereport(LOG,
+ (errmsg("[DBMS_SYSTEM.KSDWRT][dest=%d:%s][pid=%d] %s",
+ dest, destName(dest), static_cast<int>(MyProcPid), message)));
+}
+
+void
+writeKsdwrtTraceFile(const int32 dest, const char* const message)
+{
+ if (!openKsdwrtTraceFile()) {
+ return;
+ }
+
+ errno = 0;
+ if (std::fprintf(ksdwrtTraceFile, "[DBMS_SYSTEM.KSDWRT][dest=%d:%s][pid=%d] %s\n", dest, destName(dest), static_cast<int>(MyProcPid), message) < 0 || std::fflush(ksdwrtTraceFile) != 0) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: could not write trace file \"%s\": %m", ksdwrtTraceFilePath)));
+ std::clearerr(ksdwrtTraceFile);
+ }
+}
+
+void
+logTraceMessage(const char* const source, const char* const command, const int32 level, const long durationMsValue, const char* const queryString)
+{
+ ereport(LOG,
+ (errmsg("[DBMS_SYSTEM.TRACE][event=10046][level=%d][source=%s][command=%s][sid=%d][pid=%d][duration_ms=%ld] %s",
+ level, source, command, static_cast<int>(MyProcPid), static_cast<int>(MyProcPid), durationMsValue, queryStringOrUnknown(queryString))));
+}
+
+void
+logTraceErrorMessage(const char* const source, const char* const command, const int32 level, const long durationMsValue, const char* const queryString, const ErrorData* const edata)
+{
+ ereport(LOG,
+ (errmsg("[DBMS_SYSTEM.TRACE][event=10046][level=%d][source=%s][command=%s][sid=%d][pid=%d][duration_ms=%ld][error=%s] %s",
+ level, source, command, static_cast<int>(MyProcPid), static_cast<int>(MyProcPid), durationMsValue, strOrEmpty(edata->message), queryStringOrUnknown(queryString))),
+ errdetail_internal("detail=%s detail_log=%s hint=%s context=%s schema=%s table=%s column=%s datatype=%s constraint=%s cursorpos=%d internalpos=%d internalquery=%s",
+ strOrEmpty(edata->detail),
+ strOrEmpty(edata->detail_log),
+ strOrEmpty(edata->hint),
+ strOrEmpty(edata->context),
+ strOrEmpty(edata->schema_name),
+ strOrEmpty(edata->table_name),
+ strOrEmpty(edata->column_name),
+ strOrEmpty(edata->datatype_name),
+ strOrEmpty(edata->constraint_name),
+ edata->cursorpos,
+ edata->internalpos,
+ strOrEmpty(edata->internalquery)));
+}
+
+bool
+pushTraceFrame(QueryDesc* const queryDesc, const int32 level)
+{
+ if (traceStackDepth >= traceStack.size()) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.TRACE: trace stack is full, statement will not be traced"),
+ errdetail("maximum trace nesting depth is %zu", traceStack.size())));
+ return false;
+ }
+
+ traceStack[traceStackDepth].queryDesc = queryDesc;
+ traceStack[traceStackDepth].startTime = GetCurrentTimestamp();
+ traceStack[traceStackDepth].level = level;
+ ++traceStackDepth;
+
+ return true;
+}
+
+bool
+popTraceFrame(QueryDesc* const queryDesc, TraceFrame* const result)
+{
+ for (std::size_t idx = traceStackDepth; idx > 0; --idx) {
+ const std::size_t pos = idx - 1;
+
+ if (traceStack[pos].queryDesc == queryDesc) {
+ if (result != nullptr) {
+ *result = traceStack[pos];
+ }
+
+ for (std::size_t movePos = pos; movePos + 1 < traceStackDepth; ++movePos) {
+ traceStack[movePos] = traceStack[movePos + 1];
+ }
+
+ --traceStackDepth;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+[[noreturn]] void
+logExecutorErrorAndRethrow(QueryDesc* const queryDesc, MemoryContext const errorContext)
+{
+ MemoryContext const oldContext = MemoryContextSwitchTo(errorContext);
+ ErrorData* const edata = CopyErrorData();
+ MemoryContextSwitchTo(oldContext);
+
+ TraceFrame traceFrame;
+ const bool traceStarted = popTraceFrame(queryDesc, &traceFrame);
+ const TimestampTz endTime = GetCurrentTimestamp();
+ const int32 level = traceStarted ? traceFrame.level : event10046Level;
+ const long duration = traceStarted ? durationMs(traceFrame.startTime, endTime) : 0;
+ const char* const sourceText = queryDesc != nullptr ? queryDesc->sourceText : nullptr;
+ const char* const command = queryDesc != nullptr ? commandName(queryDesc->operation) : "UNKNOWN";
+
+ /* PG_RE_THROW() сохраняет исходное состояние ошибки. */
+ if (traceStarted || traceEnabled()) {
+ logTraceErrorMessage("executor", command, level, duration, sourceText, edata);
+ }
+
+ FreeErrorData(edata);
+ PG_RE_THROW();
+ pg_unreachable();
+}
+
+[[noreturn]] void
+logUtilityErrorAndRethrow(const PlannedStmt* const pstmt, const char* const queryString, const bool shouldTrace, const int32 level, const TimestampTz startTime, MemoryContext const errorContext)
+{
+ MemoryContext const oldContext = MemoryContextSwitchTo(errorContext);
+ ErrorData* const edata = CopyErrorData();
+ MemoryContextSwitchTo(oldContext);
+
+ if (shouldTrace) {
+ const TimestampTz endTime = GetCurrentTimestamp();
+ const long duration = durationMs(startTime, endTime);
+ const char* const command = utilityCommandName(pstmt);
+
+ logTraceErrorMessage("utility", command, level, duration, queryString, edata);
+ }
+
+ FreeErrorData(edata);
+ PG_RE_THROW();
+ pg_unreachable();
+}
+
+void
+installTraceHooks()
+{
+ if (traceHooksInstalled) {
+ return;
+ }
+
+ prevExecutorStartHook = ExecutorStart_hook;
+ ExecutorStart_hook = executorStartHook;
+
+ prevExecutorRunHook = ExecutorRun_hook;
+ ExecutorRun_hook = executorRunHook;
+
+ prevExecutorFinishHook = ExecutorFinish_hook;
+ ExecutorFinish_hook = executorFinishHook;
+
+ prevExecutorEndHook = ExecutorEnd_hook;
+ ExecutorEnd_hook = executorEndHook;
+
+ prevProcessUtilityHook = ProcessUtility_hook;
+ ProcessUtility_hook = processUtilityHook;
+
+ traceHooksInstalled = true;
+
+ ereport(LOG,
+ (errmsg("DBMS_SYSTEM.TRACE: local SQL trace hooks were installed for current session"),
+ errdetail("sid=%d pid=%d", static_cast<int>(MyProcPid), static_cast<int>(MyProcPid))));
+}
+
+void
+executorStartHook(QueryDesc* const queryDesc, const int eflags)
+{
+ const bool shouldTrace = traceEnabled();
+ const int32 traceLevel = event10046Level;
+
+ if (prevExecutorStartHook != nullptr) {
+ prevExecutorStartHook(queryDesc, eflags);
+ } else {
+ standard_ExecutorStart(queryDesc, eflags);
+ }
+
+ if (shouldTrace) {
+ pushTraceFrame(queryDesc, traceLevel);
+ }
+}
+
+void
+executorRunHook(QueryDesc* const queryDesc, const ScanDirection direction, const uint64 count)
+{
+ MemoryContext const errorContext = CurrentMemoryContext;
+
+ PG_TRY();
+ {
+ if (prevExecutorRunHook != nullptr) {
+ prevExecutorRunHook(queryDesc, direction, count);
+ } else {
+ standard_ExecutorRun(queryDesc, direction, count);
+ }
+ }
+ PG_CATCH();
+ {
+ logExecutorErrorAndRethrow(queryDesc, errorContext);
+ }
+ PG_END_TRY();
+}
+
+void
+executorFinishHook(QueryDesc* const queryDesc)
+{
+ MemoryContext const errorContext = CurrentMemoryContext;
+
+ PG_TRY();
+ {
+ if (prevExecutorFinishHook != nullptr) {
+ prevExecutorFinishHook(queryDesc);
+ } else {
+ standard_ExecutorFinish(queryDesc);
+ }
+ }
+ PG_CATCH();
+ {
+ logExecutorErrorAndRethrow(queryDesc, errorContext);
+ }
+ PG_END_TRY();
+}
+
+void
+executorEndHook(QueryDesc* const queryDesc)
+{
+ const char* const sourceText = queryDesc != nullptr ? queryDesc->sourceText : nullptr;
+ const char* const command = queryDesc != nullptr ? commandName(queryDesc->operation) : "UNKNOWN";
+
+ MemoryContext const errorContext = CurrentMemoryContext;
+
+ PG_TRY();
+ {
+ if (prevExecutorEndHook != nullptr) {
+ prevExecutorEndHook(queryDesc);
+ } else {
+ standard_ExecutorEnd(queryDesc);
+ }
+ }
+ PG_CATCH();
+ {
+ logExecutorErrorAndRethrow(queryDesc, errorContext);
+ }
+ PG_END_TRY();
+
+ TraceFrame traceFrame;
+ if (popTraceFrame(queryDesc, &traceFrame)) {
+ const TimestampTz endTime = GetCurrentTimestamp();
+ const long duration = durationMs(traceFrame.startTime, endTime);
+
+ logTraceMessage("executor", command, traceFrame.level, duration, sourceText);
+ }
+}
+
+void
+processUtilityHook(PlannedStmt* const pstmt,
+ const char* const queryString,
+ const bool readOnlyTree,
+ const ProcessUtilityContext context,
+ ParamListInfo const params,
+ QueryEnvironment* const queryEnv,
+ DestReceiver* const dest,
+ QueryCompletion* const qc)
+{
+ const bool shouldTrace = traceEnabled();
+ const int32 traceLevel = event10046Level;
+ const TimestampTz startTime = shouldTrace ? GetCurrentTimestamp() : 0;
+ MemoryContext const errorContext = CurrentMemoryContext;
+
+ PG_TRY();
+ {
+ if (prevProcessUtilityHook != nullptr) {
+ prevProcessUtilityHook(pstmt, queryString, readOnlyTree, context, params, queryEnv, dest, qc);
+ } else {
+ standard_ProcessUtility(pstmt, queryString, readOnlyTree, context, params, queryEnv, dest, qc);
+ }
+ }
+ PG_CATCH();
+ {
+ logUtilityErrorAndRethrow(pstmt, queryString, shouldTrace, traceLevel, startTime, errorContext);
+ }
+ PG_END_TRY();
+
+ if (shouldTrace) {
+ const TimestampTz endTime = GetCurrentTimestamp();
+ const long duration = durationMs(startTime, endTime);
+ const char* const command = utilityCommandName(pstmt);
+
+ logTraceMessage("utility", command, traceLevel, duration, queryString);
+ }
+}
+
+void
+setEventInternal(const int32 sid, const int32 serialNum, const int32 eventNum, const int32 level, const char* const name)
+{
+ if (!isValidSession(sid, serialNum)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_EV: cross-session events are not implemented yet, noop"),
+ errdetail("target sid=%d serial=%d, current backend pid=%d", sid, serialNum, static_cast<int>(MyProcPid))));
+ return;
+ }
+
+ if (eventNum != kSqlTraceEvent) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_EV: event %d is not supported, noop", eventNum),
+ errdetail("only event 10046 is supported")));
+ return;
+ }
+
+ if (level < 0) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_EV: negative level %d for event 10046 is not supported, noop", level)));
+ return;
+ }
+
+ if (level > 0) {
+ installTraceHooks();
+ }
+
+ event10046Level = level;
+
+ ereport(LOG,
+ (errmsg("DBMS_SYSTEM.SET_EV: event 10046 level is set to %d for current session", level),
+ errdetail("sid=%d serial=%d name=%s", sid, serialNum, (name != nullptr ? name : ""))));
+}
+
+} // namespace
+
+/*
+ * @qdb_func: dbms_system_ksdwrt(int4, text)
+ * @ora_func: DBMS_SYSTEM.KSDWRT(BINARY_INTEGER, VARCHAR2)
+ */
+extern "C" Datum
+dbms_system_ksdwrt(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1)) {
+ PG_RETURN_VOID();
+ }
+
+ const int32 dest = PG_GETARG_INT32(0);
+ const char* const message = TextDatumGetCString(PG_GETARG_DATUM(1));
+
+ if (!isKsdwrtDestValid(dest)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.KSDWRT: unsupported destination %d, noop", dest)));
+ PG_RETURN_VOID();
+ }
+
+ if (ksdwrtDestIncludesTraceFile(dest)) {
+ writeKsdwrtTraceFile(dest, message);
+ }
+
+ if (ksdwrtDestIncludesServerLog(dest)) {
+ writeKsdwrtServerLog(dest, message);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/*
+ * @qdb_func: dbms_system_is_valid_session(int4, int4) returns bool
+ */
+extern "C" Datum
+dbms_system_is_valid_session(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1)) {
+ PG_RETURN_BOOL(false);
+ }
+
+ const int32 sid = PG_GETARG_INT32(0);
+ const int32 serial_num = PG_GETARG_INT32(1);
+ PG_RETURN_BOOL(isValidSession(sid, serial_num));
+}
+
+/*
+ * @qdb_func: dbms_system_set_ev(int4, int4, int4, int4, text)
+ * @ora_func: DBMS_SYSTEM.SET_EV(BINARY_INTEGER, BINARY_INTEGER,
+ * BINARY_INTEGER, BINARY_INTEGER, VARCHAR2)
+ */
+extern "C" Datum
+dbms_system_set_ev(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1) || PG_ARGISNULL(2) || PG_ARGISNULL(3)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_EV: required argument is NULL, noop")));
+ PG_RETURN_VOID();
+ }
+
+ const int32 sid = PG_GETARG_INT32(0);
+ const int32 serial_num = PG_GETARG_INT32(1);
+ const int32 event_num = PG_GETARG_INT32(2);
+ const int32 level = PG_GETARG_INT32(3);
+ const char* const name = PG_ARGISNULL(4) ? "" : TextDatumGetCString(PG_GETARG_DATUM(4));
+ const bool valid_session = DatumGetBool(
+ DirectFunctionCall2(dbms_system_is_valid_session,
+ Int32GetDatum(sid),
+ Int32GetDatum(serial_num)));
+
+ if (!valid_session) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_EV: cross-session events are not implemented yet, noop"),
+ errdetail("target sid=%d serial=%d, current backend pid=%d",
+ sid, serial_num, static_cast<int>(MyProcPid))));
+ PG_RETURN_VOID();
+ }
+
+ setEventInternal(sid, serial_num, event_num, level, name);
+
+ PG_RETURN_VOID();
+}
+
+/*
+ * @qdb_func: dbms_system_read_ev(int4) returns int4
+ * @ora_func: DBMS_SYSTEM.READ_EV(BINARY_INTEGER, OUT BINARY_INTEGER)
+ */
+extern "C" Datum
+dbms_system_read_ev(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0)) {
+ PG_RETURN_INT32(0);
+ }
+
+ const int32 event_num = PG_GETARG_INT32(0);
+
+ if (event_num == kSqlTraceEvent) {
+ PG_RETURN_INT32(event10046Level);
+ }
+
+ PG_RETURN_INT32(0);
+}
+
+/*
+ * @qdb_func: dbms_system_set_sql_trace_in_session(int4, int4, bool)
+ * @ora_func: DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(NUMBER, NUMBER, BOOLEAN)
+ */
+extern "C" Datum
+dbms_system_set_sql_trace_in_session(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0) || PG_ARGISNULL(1) || PG_ARGISNULL(2)) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION: required argument is NULL, noop")));
+ PG_RETURN_VOID();
+ }
+
+ const int32 sid = PG_GETARG_INT32(0);
+ const int32 serial_num = PG_GETARG_INT32(1);
+ const bool sql_trace = PG_GETARG_BOOL(2);
+ const bool valid_session = DatumGetBool(
+ DirectFunctionCall2(dbms_system_is_valid_session,
+ Int32GetDatum(sid),
+ Int32GetDatum(serial_num)));
+
+ if (!valid_session) {
+ ereport(WARNING,
+ (errmsg("DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION: cross-session events are not implemented yet, noop"),
+ errdetail("target sid=%d serial=%d, current backend pid=%d",
+ sid, serial_num, static_cast<int>(MyProcPid))));
+ PG_RETURN_VOID();
+ }
+
+ setEventInternal(sid, serial_num, kSqlTraceEvent, sql_trace ? 1 : 0, "");
+
+ PG_RETURN_VOID();
+}
+
+extern "C" Datum
+dbms_system_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_SYSTEM_VERSION));
+}
diff --git a/src/backend/utils/dbms/dbms_system/dbms_system.hpp b/src/backend/utils/dbms/dbms_system/dbms_system.hpp
new file mode 100644
index 0000000..5f176e3
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_system/dbms_system.hpp
@@ -0,0 +1,101 @@
+#ifndef DBMS_SYSTEM_HPP
+#define DBMS_SYSTEM_HPP
+
+extern "C" {
+#include "postgres.h"
+#include "fmgr.h"
+}
+
+/*
+ * DBMS_SYSTEM
+ *
+ * Назначение:
+ * Пакет предоставляет диагностические функции для текущего
+ * backend-процесса PostgreSQL: запись сообщений через KSDWRT и
+ * управление SQL trace event 10046.
+ */
+
+extern "C" {
+/**
+ * @brief Записывает диагностическое сообщение DBMS_SYSTEM.KSDWRT.
+ * @details Аргумент `dest` определяет назначение записи:
+ * `1` - trace-файл рядом с PostgreSQL server log,
+ * `2` - PostgreSQL server log,
+ * `3` - оба назначения.
+ * Примеры:
+ * SELECT DBMS_SYSTEM.KSDWRT(1, 'trace only') FROM dual;
+ * SELECT DBMS_SYSTEM.KSDWRT(2, 'server log only') FROM dual;
+ * SELECT DBMS_SYSTEM.KSDWRT(3, 'trace and server log') FROM dual;
+ * @param dest Назначение записи.
+ * @param message Текст диагностического сообщения.
+ * @return `void`.
+ */
+Datum dbms_system_ksdwrt(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Проверяет существование указанной сессии.
+ * @details В текущей реализации проверяется только текущая backend-сессия.
+ * Примеры:
+ * SELECT DBMS_SYSTEM.IS_VALID_SESSION(pg_backend_pid(), 1) FROM dual;
+ * SELECT DBMS_SYSTEM.IS_VALID_SESSION(-1, -1) FROM dual;
+ * @param sid Идентификатор backend-сессии.
+ * @param serial_num Совместимый аргумент SERIAL#.
+ * @return `true`, если сессия доступна для DBMS_SYSTEM.
+ */
+Datum dbms_system_is_valid_session(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Устанавливает диагностический event DBMS_SYSTEM.SET_EV.
+ * @details Поддерживается только event `10046` для текущей backend-сессии.
+ * `level = 0` выключает SQL trace, `level > 0` включает trace.
+ * Примеры:
+ * SELECT DBMS_SYSTEM.SET_EV(pg_backend_pid(), 1, 10046, 1, '') FROM dual;
+ * SELECT DBMS_SYSTEM.SET_EV(pg_backend_pid(), 1, 10046, 8, NULL) FROM dual;
+ * SELECT DBMS_SYSTEM.SET_EV(pg_backend_pid(), 1, 10046, 0, 'disable') FROM dual;
+ * @param sid Идентификатор backend-сессии.
+ * @param serial_num Совместимый аргумент SERIAL#.
+ * @param event_num Номер диагностического event.
+ * @param level Уровень trace.
+ * @param name Диагностическое имя операции.
+ * @return `void`.
+ */
+Datum dbms_system_set_ev(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает уровень диагностического event для DBMS_SYSTEM.READ_EV.
+ * @details Для event `10046` возвращает локальный уровень SQL trace текущего
+ * backend-а. Для остальных events возвращает `0`.
+ * Примеры:
+ * SELECT DBMS_SYSTEM.READ_EV(10046) FROM dual;
+ * SELECT DBMS_SYSTEM.READ_EV(99999) FROM dual;
+ * @param event_num Номер диагностического event.
+ * @return Текущий уровень event.
+ */
+Datum dbms_system_read_ev(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Включает или выключает SQL trace через DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION.
+ * @details Реализовано как совместимая обёртка над `SET_EV` для event `10046`:
+ * `true` выставляет level `1`, `false` выставляет level `0`.
+ * Примеры:
+ * SELECT DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(pg_backend_pid(), 1, true) FROM dual;
+ * SELECT DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(pg_backend_pid(), 1, false) FROM dual;
+ * @param sid Идентификатор backend-сессии.
+ * @param serial_num Совместимый аргумент SERIAL#.
+ * @param sql_trace Признак включения SQL trace.
+ * @return `void`.
+ */
+Datum dbms_system_set_sql_trace_in_session(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_SYSTEM.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_SYSTEM.GET_VERSION() FROM dual;
+ * SELECT dbms_system_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_system_get_version(PG_FUNCTION_ARGS);
+}
+
+#endif // DBMS_SYSTEM_HPP
diff --git a/src/backend/utils/dbms/dbms_tns/dbms_tns.cpp b/src/backend/utils/dbms/dbms_tns/dbms_tns.cpp
new file mode 100644
index 0000000..add9d5d
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_tns/dbms_tns.cpp
@@ -0,0 +1,894 @@
+#include "dbms_tns.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/guc.h"
+#include "miscadmin.h"
+#include "utils/varlena.h"
+#include "varatt.h"
+} // extern "C"
+
+#include <cctype>
+#include <algorithm>
+#include <fstream>
+#include <iterator>
+#include <unordered_map>
+#include <string>
+#include <string_view>
+#include <vector>
+#include <unistd.h>
+
+namespace
+{
+enum class SqlnetSource
+{
+ Tnsnames,
+ Ezconnect
+};
+
+enum class SqlnetParseStatus
+{
+ MissingConfig,
+ ParsedOk,
+ Malformed
+};
+
+struct SqlnetParseResult
+{
+ SqlnetParseStatus status;
+ std::vector<SqlnetSource> sources;
+};
+
+enum class TnsnamesParseStatus
+{
+ MissingConfig,
+ ParsedOk,
+ Malformed
+};
+
+struct TnsnamesParseResult
+{
+ TnsnamesParseStatus status;
+ std::unordered_map<std::string, std::string> aliases;
+};
+
+constexpr std::string_view kSqlnetDirectoryPathParam = "NAMES.DIRECTORY_PATH";
+constexpr std::string_view kSqlnetConfigFile = "sqlnet.ora";
+constexpr std::string_view kTnsnamesConfigFile = "tnsnames.ora";
+constexpr std::string_view kTnsnamesToken = "TNSNAMES";
+constexpr std::string_view kEzconnectToken = "EZCONNECT";
+constexpr std::string_view kCidProgram = "rudb";
+
+static std::string lower_copy(std::string_view input);
+static bool case_insensitive_equals(std::string_view lhs, std::string_view rhs);
+static size_t skip_spaces(const std::string& input, size_t pos);
+static bool match_param_name(const std::string& input, size_t pos, std::string_view needle);
+static std::string tnsnames_config_path();
+
+/*
+ * Внутренняя схема разбора Oracle Net configuration для DBMS_TNS.
+ *
+ * Здесь держим private parser/resolver для `dbms_tns_resolve_tnsname(text)`.
+ * Он читает только `sqlnet.ora` и `tnsnames.ora` из каталога
+ * `dbms_tns.tns_admin`, не делает сетевых проверок и не эмулирует полный
+ * Oracle Net stack.
+ *
+ * 1. `sqlnet.ora`
+ * Parser ищет только `NAMES.DIRECTORY_PATH`. Из списка sources
+ * используются только `TNSNAMES` и `EZCONNECT`, остальные значения
+ * игнорируются. Если синтаксис `NAMES.DIRECTORY_PATH` повреждён, resolver
+ * возвращает SQL NULL.
+ *
+ * 2. `tnsnames.ora`
+ * Parser читает top-level записи вида
+ *
+ * ALIAS[, ALIAS2] = (DESCRIPTION=...)
+ *
+ * Alias сравниваются без учёта регистра. Если один alias встречается
+ * несколько раз, используется последняя запись. Descriptor собирается как
+ * сбалансированный блок скобок и сохраняется как pass-through text:
+ * сетевые параметры и порядок `ADDRESS` / `DESCRIPTION` не
+ * интерпретируются.
+ *
+ * 3. Scanner descriptor-а
+ * Сканер считает баланс круглых скобок, учитывает quoted text и
+ * нормализует whitespace вне quoted values. Символ `#` внутри quoted value
+ * не считается началом комментария. Незакрытые quotes или
+ * несбалансированные скобки считаются malformed input и приводят к SQL
+ * NULL.
+ *
+ * 4. Easy Connect
+ * Поддерживаются только простые формы
+ *
+ * //host/service
+ * //host:port/service
+ * host/service
+ * host:port/service
+ *
+ * Parser не выполняет DNS lookup, не открывает TCP-соединение, не
+ * проверяет listener/service availability, не нормализует localhost и не
+ * добавляет CID / descriptor decoration вне текущего локального правила.
+ */
+
+static inline bool is_space(unsigned char ch)
+{
+ return std::isspace(static_cast<int>(ch)) != 0;
+}
+
+static inline bool is_token_boundary(char ch)
+{
+ return ch == '\0' ||
+ (!std::isalnum(static_cast<unsigned char>(ch)) && ch != '_' && ch != '.');
+}
+
+static inline bool is_quote_char(char ch)
+{
+ return ch == '\'' || ch == '"';
+}
+
+// Удаляет # line comments, но сохраняет # внутри quoted values.
+static std::string strip_line_comments(const std::string& input)
+{
+ std::string output;
+ output.reserve(input.size());
+ bool in_comment = false;
+ bool in_quote = false;
+ char quote_char = '\0';
+
+ for (char ch : input)
+ {
+ if (in_comment)
+ {
+ if (ch == '\n' || ch == '\r')
+ {
+ in_comment = false;
+ output.push_back(ch);
+ }
+ continue;
+ }
+
+ if (in_quote)
+ {
+ output.push_back(ch);
+ if (ch == quote_char)
+ {
+ in_quote = false;
+ quote_char = '\0';
+ }
+ continue;
+ }
+
+ if (is_quote_char(ch))
+ {
+ in_quote = true;
+ quote_char = ch;
+ output.push_back(ch);
+ continue;
+ }
+
+ if (ch == '#')
+ {
+ in_comment = true;
+ continue;
+ }
+
+ output.push_back(ch);
+ }
+
+ return output;
+}
+
+static std::string lower_copy(std::string_view input)
+{
+ std::string output;
+ output.reserve(input.size());
+
+ for (char ch : input)
+ output.push_back(static_cast<char>(std::tolower(static_cast<unsigned char>(ch))));
+
+ return output;
+}
+
+static bool cid_decoration_enabled()
+{
+ // CID включаем только по явному session marker в selfcheck, чтобы HOST/USER
+ // не меняли обычный regression output.
+ const char* appname = GetConfigOptionByName("application_name", NULL, false);
+ return appname != nullptr && case_insensitive_equals(appname, "dbms_tns_cid");
+}
+
+static std::string cid_host_name()
+{
+ char buffer[256] = {0};
+ if (gethostname(buffer, sizeof(buffer)) != 0 || buffer[0] == '\0')
+ return "unknown";
+
+ buffer[sizeof(buffer) - 1] = '\0';
+ return buffer;
+}
+
+static std::string cid_user_name()
+{
+ const char* user = GetUserNameFromId(GetUserId(), false);
+ if (user == nullptr || user[0] == '\0')
+ return "unknown";
+
+ return user;
+}
+
+static std::string build_cid_block()
+{
+ std::string cid;
+ cid.reserve(64);
+ cid.append("(CID=(PROGRAM=");
+ cid.append(kCidProgram.data(), kCidProgram.size());
+ cid.append(")(HOST=");
+ cid.append(cid_host_name());
+ cid.append(")(USER=");
+ cid.append(cid_user_name());
+ cid.append("))");
+ return cid;
+}
+
+static bool find_matching_paren(const std::string& input, size_t open_pos, size_t& close_pos)
+{
+ if (open_pos >= input.size() || input[open_pos] != '(')
+ return false;
+
+ int depth = 0;
+ bool in_quote = false;
+ char quote_char = '\0';
+
+ for (size_t pos = open_pos; pos < input.size(); ++pos)
+ {
+ const char ch = input[pos];
+
+ if (in_quote)
+ {
+ if (ch == quote_char)
+ {
+ in_quote = false;
+ quote_char = '\0';
+ }
+ continue;
+ }
+
+ if (is_quote_char(ch))
+ {
+ in_quote = true;
+ quote_char = ch;
+ continue;
+ }
+
+ if (ch == '(')
+ {
+ ++depth;
+ }
+ else if (ch == ')')
+ {
+ --depth;
+ if (depth < 0)
+ return false;
+
+ if (depth == 0)
+ {
+ close_pos = pos;
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+static bool descriptor_has_top_level_cid(const std::string& input, size_t open_pos, size_t close_pos)
+{
+ (void) close_pos;
+ bool in_quote = false;
+ char quote_char = '\0';
+
+ for (size_t pos = open_pos + 1; pos < input.size(); ++pos)
+ {
+ const char ch = input[pos];
+
+ if (in_quote)
+ {
+ if (ch == quote_char)
+ {
+ in_quote = false;
+ quote_char = '\0';
+ }
+ continue;
+ }
+
+ if (is_quote_char(ch))
+ {
+ in_quote = true;
+ quote_char = ch;
+ continue;
+ }
+
+ if (ch == '(' && pos + 5 <= input.size() &&
+ case_insensitive_equals(std::string_view(input).substr(pos + 1, 4), "CID="))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static bool find_connect_data_group(const std::string& descriptor, size_t& open_pos, size_t& close_pos)
+{
+ bool in_quote = false;
+ char quote_char = '\0';
+
+ for (size_t pos = 0; pos < descriptor.size(); ++pos)
+ {
+ const char ch = descriptor[pos];
+
+ if (in_quote)
+ {
+ if (ch == quote_char)
+ {
+ in_quote = false;
+ quote_char = '\0';
+ }
+ continue;
+ }
+
+ if (is_quote_char(ch))
+ {
+ in_quote = true;
+ quote_char = ch;
+ continue;
+ }
+
+ if (!match_param_name(descriptor, pos, "CONNECT_DATA"))
+ continue;
+
+ size_t after = pos + std::string_view("CONNECT_DATA").size();
+ after = skip_spaces(descriptor, after);
+ if (after >= descriptor.size() || descriptor[after] != '=')
+ continue;
+
+ ++after;
+ after = skip_spaces(descriptor, after);
+ if (after >= descriptor.size() || descriptor[after] != '(')
+ continue;
+
+ open_pos = after;
+ return find_matching_paren(descriptor, open_pos, close_pos);
+ }
+
+ return false;
+}
+
+static std::string decorate_descriptor_with_cid(const std::string& descriptor)
+{
+ if (!cid_decoration_enabled())
+ return descriptor;
+
+ size_t open_pos = 0;
+ size_t close_pos = 0;
+ if (!find_connect_data_group(descriptor, open_pos, close_pos))
+ return descriptor;
+
+ if (descriptor_has_top_level_cid(descriptor, open_pos, close_pos))
+ return descriptor;
+
+ const std::string cid = build_cid_block();
+ std::string decorated;
+ decorated.reserve(descriptor.size() + cid.size());
+ decorated.append(descriptor, 0, close_pos);
+ decorated.append(cid);
+ decorated.append(descriptor, close_pos, std::string::npos);
+ return decorated;
+}
+
+static bool case_insensitive_equals(std::string_view lhs, std::string_view rhs)
+{
+ if (lhs.size() != rhs.size())
+ return false;
+
+ for (size_t i = 0; i < lhs.size(); ++i)
+ {
+ const unsigned char left = static_cast<unsigned char>(lhs[i]);
+ const unsigned char right = static_cast<unsigned char>(rhs[i]);
+ if (std::tolower(left) != std::tolower(right))
+ return false;
+ }
+
+ return true;
+}
+
+// Формирует descriptor для поддержанных простых Easy Connect строк.
+static bool try_parse_easy_connect_descriptor(std::string_view input,
+ std::string& descriptor)
+{
+ descriptor.clear();
+
+ if (input.empty())
+ return false;
+
+ for (char ch : input)
+ {
+ if (is_space(static_cast<unsigned char>(ch)))
+ return false;
+ }
+
+ if (input.size() >= 2 && input[0] == '/' && input[1] == '/')
+ input.remove_prefix(2);
+
+ if (input.empty())
+ return false;
+
+ const size_t slash_pos = input.find('/');
+ if (slash_pos == std::string_view::npos)
+ return false;
+
+ const std::string_view host_port = input.substr(0, slash_pos);
+ const std::string_view service = input.substr(slash_pos + 1);
+ if (host_port.empty() || service.find('/') != std::string_view::npos)
+ return false;
+
+ std::string_view host = host_port;
+ std::string_view port = "1521";
+ const size_t colon_pos = host_port.find(':');
+ if (colon_pos != std::string_view::npos)
+ {
+ if (host_port.find(':', colon_pos + 1) != std::string_view::npos)
+ return false;
+
+ host = host_port.substr(0, colon_pos);
+ port = host_port.substr(colon_pos + 1);
+ if (host.empty() || port.empty())
+ return false;
+ }
+
+ if (host.empty())
+ return false;
+
+ descriptor.reserve(host.size() + port.size() + service.size() + 64);
+ descriptor.append("(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=");
+ descriptor.append(host.data(), host.size());
+ descriptor.append(")(PORT=");
+ descriptor.append(port.data(), port.size());
+ descriptor.append("))(CONNECT_DATA=(SERVICE_NAME=");
+ descriptor.append(service.data(), service.size());
+ descriptor.append(")))");
+ return true;
+}
+
+static size_t skip_spaces(const std::string& input, size_t pos)
+{
+ while (pos < input.size() && is_space(static_cast<unsigned char>(input[pos])))
+ ++pos;
+
+ return pos;
+}
+
+static bool match_param_name(const std::string& input, size_t pos, std::string_view needle)
+{
+ if (pos > input.size() || input.size() - pos < needle.size())
+ return false;
+
+ if (pos > 0 && !is_token_boundary(input[pos - 1]))
+ return false;
+
+ if (pos + needle.size() < input.size() && !is_token_boundary(input[pos + needle.size()]))
+ return false;
+
+ return case_insensitive_equals(std::string_view(input).substr(pos, needle.size()), needle);
+}
+
+// Разбирает значение NAMES.DIRECTORY_PATH=(...).
+static bool collect_directory_path(const std::string& input, size_t name_pos,
+ SqlnetParseResult& result)
+{
+ size_t pos = name_pos + kSqlnetDirectoryPathParam.size();
+ pos = skip_spaces(input, pos);
+
+ if (pos >= input.size() || input[pos] != '=')
+ return false;
+
+ ++pos;
+ pos = skip_spaces(input, pos);
+ if (pos >= input.size() || input[pos] != '(')
+ return false;
+
+ ++pos;
+ bool saw_closing_paren = false;
+
+ while (pos < input.size())
+ {
+ pos = skip_spaces(input, pos);
+ if (pos >= input.size())
+ return false;
+
+ if (input[pos] == ')')
+ {
+ saw_closing_paren = true;
+ ++pos;
+ break;
+ }
+
+ if (input[pos] == ',')
+ {
+ ++pos;
+ continue;
+ }
+
+ const size_t token_start = pos;
+ while (pos < input.size())
+ {
+ const char ch = input[pos];
+ if (is_space(static_cast<unsigned char>(ch)) || ch == ',' || ch == ')')
+ break;
+ ++pos;
+ }
+
+ if (pos == token_start)
+ return false;
+
+ const std::string_view token(input.data() + token_start, pos - token_start);
+ if (case_insensitive_equals(token, kTnsnamesToken))
+ result.sources.push_back(SqlnetSource::Tnsnames);
+ else if (case_insensitive_equals(token, kEzconnectToken))
+ result.sources.push_back(SqlnetSource::Ezconnect);
+
+ pos = skip_spaces(input, pos);
+ if (pos < input.size() && input[pos] == ',')
+ {
+ ++pos;
+ continue;
+ }
+
+ if (pos < input.size() && input[pos] == ')')
+ {
+ saw_closing_paren = true;
+ ++pos;
+ break;
+ }
+
+ if (pos < input.size())
+ {
+ const char next = input[pos];
+ if (!std::isalpha(static_cast<unsigned char>(next)))
+ return false;
+ }
+ }
+
+ if (!saw_closing_paren)
+ return false;
+
+ result.status = SqlnetParseStatus::ParsedOk;
+ return true;
+}
+
+// Разбирает левую часть tnsnames.ora entry: ALIAS[, ALIAS2].
+static bool parse_tnsnames_aliases(std::string_view aliases_text,
+ std::vector<std::string>& aliases)
+{
+ aliases.clear();
+
+ size_t pos = 0;
+ while (pos < aliases_text.size())
+ {
+ size_t begin = pos;
+ while (begin < aliases_text.size() && is_space(static_cast<unsigned char>(aliases_text[begin])))
+ ++begin;
+
+ size_t end = begin;
+ while (end < aliases_text.size() && aliases_text[end] != ',')
+ ++end;
+
+ while (end > begin && is_space(static_cast<unsigned char>(aliases_text[end - 1])))
+ --end;
+
+ if (end == begin)
+ return false;
+
+ aliases.push_back(lower_copy(aliases_text.substr(begin, end - begin)));
+
+ if (end >= aliases_text.size())
+ break;
+
+ pos = end + 1;
+ }
+
+ return !aliases.empty();
+}
+
+// Собирает descriptor как balanced parentheses block.
+static bool collect_tnsnames_descriptor(const std::string& input, size_t pos,
+ std::string& descriptor, size_t& next_pos)
+{
+ descriptor.clear();
+
+ if (pos >= input.size() || input[pos] != '(')
+ return false;
+
+ int depth = 0;
+ bool in_quote = false;
+ char quote_char = '\0';
+ while (pos < input.size())
+ {
+ const char ch = input[pos];
+ ++pos;
+
+ if (!in_quote && is_space(static_cast<unsigned char>(ch)))
+ continue;
+
+ descriptor.push_back(ch);
+ if (in_quote)
+ {
+ if (ch == quote_char)
+ {
+ in_quote = false;
+ quote_char = '\0';
+ }
+ continue;
+ }
+
+ if (is_quote_char(ch))
+ {
+ in_quote = true;
+ quote_char = ch;
+ continue;
+ }
+
+ if (ch == '(')
+ {
+ ++depth;
+ }
+ else if (ch == ')')
+ {
+ --depth;
+ if (depth < 0)
+ return false;
+
+ if (depth == 0)
+ {
+ if (in_quote)
+ return false;
+
+ next_pos = pos;
+ return true;
+ }
+ }
+ }
+
+ return !in_quote && depth == 0;
+}
+
+// Разбирает одну top-level запись tnsnames.ora.
+static bool parse_tnsnames_entry(const std::string& input, size_t entry_start,
+ TnsnamesParseResult& result, size_t& next_pos)
+{
+ const size_t eq_pos = input.find('=', entry_start);
+ if (eq_pos == std::string::npos)
+ return false;
+
+ size_t aliases_end = eq_pos;
+ while (aliases_end > entry_start &&
+ is_space(static_cast<unsigned char>(input[aliases_end - 1])))
+ --aliases_end;
+
+ const std::string_view aliases_text(input.data() + entry_start, aliases_end - entry_start);
+ std::vector<std::string> aliases;
+ if (!parse_tnsnames_aliases(aliases_text, aliases))
+ return false;
+
+ size_t pos = skip_spaces(input, eq_pos + 1);
+ std::string descriptor;
+ if (!collect_tnsnames_descriptor(input, pos, descriptor, next_pos))
+ return false;
+
+ for (const std::string& alias : aliases)
+ result.aliases[alias] = descriptor;
+
+ result.status = TnsnamesParseStatus::ParsedOk;
+ return true;
+}
+
+// Возвращает порядок поддержанных naming sources из sqlnet.ora.
+static SqlnetParseResult parse_sqlnet_ora(const std::string& input)
+{
+ SqlnetParseResult result{SqlnetParseStatus::ParsedOk, {}};
+ const std::string cleaned = strip_line_comments(input);
+ const std::string_view needle = kSqlnetDirectoryPathParam;
+
+ for (size_t pos = 0; pos < cleaned.size(); ++pos)
+ {
+ if (!match_param_name(cleaned, pos, needle))
+ continue;
+
+ if (!collect_directory_path(cleaned, pos, result))
+ {
+ result.status = SqlnetParseStatus::Malformed;
+ result.sources.clear();
+ }
+
+ return result;
+ }
+
+ return result;
+}
+
+// Возвращает map нормализованных aliases к descriptor text.
+static TnsnamesParseResult parse_tnsnames_ora(const std::string& input)
+{
+ TnsnamesParseResult result{TnsnamesParseStatus::ParsedOk, {}};
+ const std::string cleaned = strip_line_comments(input);
+
+ for (size_t pos = 0; pos < cleaned.size(); )
+ {
+ pos = skip_spaces(cleaned, pos);
+ if (pos >= cleaned.size())
+ break;
+
+ size_t next_pos = pos;
+ if (!parse_tnsnames_entry(cleaned, pos, result, next_pos))
+ {
+ result.status = TnsnamesParseStatus::Malformed;
+ result.aliases.clear();
+ return result;
+ }
+
+ pos = next_pos;
+ }
+
+ return result;
+}
+
+static SqlnetParseResult read_sqlnet_config()
+{
+ const char* tns_admin = GetConfigOptionByName("dbms_tns.tns_admin", NULL, false);
+ if (tns_admin == NULL || tns_admin[0] == '\0')
+ return {SqlnetParseStatus::MissingConfig, {}};
+
+ std::string config_path(tns_admin);
+ if (!config_path.empty() && config_path.back() != '/' && config_path.back() != '\\')
+ config_path.push_back('/');
+ config_path.append(kSqlnetConfigFile);
+
+ std::ifstream file(config_path);
+ if (!file.is_open())
+ return {SqlnetParseStatus::MissingConfig, {}};
+
+ std::string contents((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
+ return parse_sqlnet_ora(contents);
+}
+
+static TnsnamesParseResult read_tnsnames_config()
+{
+ const std::string config_path = tnsnames_config_path();
+ if (config_path.empty())
+ return {TnsnamesParseStatus::MissingConfig, {}};
+
+ std::ifstream file(config_path);
+ if (!file.is_open())
+ return {TnsnamesParseStatus::MissingConfig, {}};
+
+ std::string contents((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
+ return parse_tnsnames_ora(contents);
+}
+
+static std::string tnsnames_config_path()
+{
+ const char* tns_admin = GetConfigOptionByName("dbms_tns.tns_admin", NULL, false);
+ if (tns_admin == NULL || tns_admin[0] == '\0')
+ return {};
+
+ std::string config_path(tns_admin);
+ if (!config_path.empty() && config_path.back() != '/' && config_path.back() != '\\')
+ config_path.push_back('/');
+ config_path.append(kTnsnamesConfigFile);
+ return config_path;
+}
+} // namespace
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(dbms_tns_resolve_tnsname);
+PG_FUNCTION_INFO_V1(dbms_tns_has_tnsnames_config);
+PG_FUNCTION_INFO_V1(dbms_tns_get_version);
+
+/// @brief Версия RUDB пакета DBMS_TNS (Oracle DBMS_TNS пакет)
+#define RUDB_DBMS_TNS_VERSION "1.0.0"
+
+/*
+ * @qdb_func: dbms_tns_resolve_tnsname(text)
+ */
+Datum dbms_tns_resolve_tnsname(PG_FUNCTION_ARGS)
+{
+ if (!superuser())
+ ereport(ERROR,
+ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+ errmsg("must be superuser to call %s()",
+ "dbms_tns_resolve_tnsname")));
+
+ if (PG_ARGISNULL(0))
+ PG_RETURN_NULL();
+
+ const text *tns_name = PG_GETARG_TEXT_PP(0);
+ if (VARSIZE_ANY_EXHDR(tns_name) == 0)
+ PG_RETURN_NULL();
+
+ const SqlnetParseResult sqlnet = read_sqlnet_config();
+ if (sqlnet.status != SqlnetParseStatus::ParsedOk)
+ PG_RETURN_NULL();
+
+ const std::string_view input_text(VARDATA_ANY(tns_name), VARSIZE_ANY_EXHDR(tns_name));
+ bool tnsnames_loaded = false;
+ TnsnamesParseResult tnsnames;
+
+ for (const SqlnetSource source : sqlnet.sources)
+ {
+ switch (source)
+ {
+ case SqlnetSource::Ezconnect:
+ {
+ std::string descriptor;
+ if (try_parse_easy_connect_descriptor(input_text, descriptor))
+ {
+ descriptor = decorate_descriptor_with_cid(descriptor);
+ PG_RETURN_TEXT_P(cstring_to_text(descriptor.c_str()));
+ }
+ break;
+ }
+
+ case SqlnetSource::Tnsnames:
+ {
+ if (!tnsnames_loaded)
+ {
+ const bool has_tnsnames = DatumGetBool(
+ DirectFunctionCall0(dbms_tns_has_tnsnames_config));
+ if (!has_tnsnames)
+ break;
+
+ tnsnames = read_tnsnames_config();
+ if (tnsnames.status != TnsnamesParseStatus::ParsedOk)
+ break;
+
+ tnsnames_loaded = true;
+ }
+
+ const std::string alias = lower_copy(input_text);
+ const auto found = tnsnames.aliases.find(alias);
+ if (found != tnsnames.aliases.end())
+ {
+ std::string descriptor = decorate_descriptor_with_cid(found->second);
+ PG_RETURN_TEXT_P(cstring_to_text(descriptor.c_str()));
+ }
+ break;
+ }
+ }
+ }
+
+ PG_RETURN_NULL();
+}
+
+/*
+ * @qdb_func: dbms_tns_has_tnsnames_config()
+ */
+Datum dbms_tns_has_tnsnames_config(PG_FUNCTION_ARGS)
+{
+ const std::string config_path = tnsnames_config_path();
+ if (config_path.empty())
+ PG_RETURN_BOOL(false);
+
+ std::ifstream file(config_path);
+ PG_RETURN_BOOL(file.is_open());
+}
+
+Datum dbms_tns_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_TNS_VERSION));
+}
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_tns/dbms_tns.hpp b/src/backend/utils/dbms/dbms_tns/dbms_tns.hpp
new file mode 100644
index 0000000..ec2ac6d
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_tns/dbms_tns.hpp
@@ -0,0 +1,57 @@
+#ifndef DBMS_TNS_INTERNAL_HPP
+#define DBMS_TNS_INTERNAL_HPP
+
+/*
+ * DBMS_TNS
+ *
+ * Назначение:
+ * Пакет разрешает Oracle Net имя подключения в connect descriptor через
+ * конфигурацию из `dbms_tns.tns_admin`.
+ *
+ * Важно:
+ * Функция зависит от внешних файлов и параметров конфигурации, поэтому
+ * SQL-объявление должно оставаться volatile.
+ */
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+} // extern "C"
+
+
+extern "C"
+{
+/*
+ * Разрешает Oracle Net имя подключения в connect descriptor.
+ *
+ * Принимает TNS alias или простую Easy Connect строку. Возвращает resolved
+ * connect descriptor либо SQL NULL, если имя не может быть разрешено
+ * поддержанными источниками.
+ */
+Datum dbms_tns_resolve_tnsname(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Проверяет доступность конфигурации `tnsnames.ora` для разрешения TNS-имён.
+ * @details Возвращает `true`, если путь к `tnsnames.ora` построен из
+ * `dbms_tns.tns_admin` и файл доступен для чтения.
+ * Примеры:
+ * SELECT dbms_tns_has_tnsnames_config();
+ * SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns';
+ * SELECT dbms_tns_has_tnsnames_config();
+ * @return `true`, если конфигурация `tnsnames.ora` доступна.
+ */
+Datum dbms_tns_has_tnsnames_config(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_TNS.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_TNS.GET_VERSION() FROM dual;
+ * SELECT dbms_tns_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_tns_get_version(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_TNS_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_trace/dbms_trace.cpp b/src/backend/utils/dbms/dbms_trace/dbms_trace.cpp
new file mode 100644
index 0000000..7e30efd
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_trace/dbms_trace.cpp
@@ -0,0 +1,724 @@
+#include "dbms_trace.hpp"
+
+#include <cstdio>
+#include <cstdint>
+#include <cstring>
+#include <limits>
+#include <string>
+#include <utility>
+
+extern "C"
+{
+#include "access/htup_details.h"
+#include "catalog/pg_type_d.h"
+#include "funcapi.h"
+#include "plpgsql.h"
+#include "utils/builtins.h"
+}
+
+namespace
+{
+constexpr int32 kTracePause = 4096;
+constexpr int32 kTraceResume = 8192;
+constexpr int32 kTraceStop = 16384;
+
+constexpr int32 kControlMask = kTracePause | kTraceResume | kTraceStop;
+
+PLpgSQL_plugin g_dbms_trace_plpgsql_plugin;
+bool g_dbms_trace_plpgsql_plugin_installed = false;
+
+const char* trace_event_type_label(const char* event_type);
+
+bool is_trace_enabled(const DbmsTraceSessionState& state)
+{
+ return state.enabled;
+}
+
+/* Сравнивает имя SQL-атрибута без учёта регистра. */
+bool
+dbms_trace_attr_name_is(Form_pg_attribute attr, const char* expected)
+{
+ return pg_strcasecmp(NameStr(attr->attname), expected) == 0;
+}
+
+/* Выдаёт ошибку о неподдерживаемой выходной колонке DBMS_TRACE. */
+void
+dbms_trace_unsupported_column_error(const char* function_name, const char* colname)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("unsupported DBMS_TRACE %s output column \"%s\"",
+ function_name,
+ colname)));
+}
+
+/* Выдаёт ошибку о неподдерживаемом типе выходной колонки DBMS_TRACE. */
+void
+dbms_trace_unsupported_type_error(const char* function_name, const char* colname, Oid typid)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_DATATYPE_MISMATCH),
+ errmsg("unsupported type %s for DBMS_TRACE %s output column \"%s\"",
+ format_type_be(typid),
+ function_name,
+ colname)));
+}
+
+/* Проверяет, что int64 помещается в int32 для SQL-колонки. */
+int32
+dbms_trace_checked_int64_to_int32(int64 value, const char* function_name, const char* colname)
+{
+ if (value < std::numeric_limits<int32>::min() ||
+ value > std::numeric_limits<int32>::max())
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
+ errmsg("value out of range for DBMS_TRACE %s output column \"%s\"",
+ function_name,
+ colname)));
+ }
+
+ return static_cast<int32>(value);
+}
+
+/* Формирует текстовый Datum для согласованной SQL-колонки. */
+Datum
+dbms_trace_text_datum_or_null(const char* value, Oid typid, bool* isnull, const char* function_name, const char* colname)
+{
+ if (value == nullptr || value[0] == '\0')
+ {
+ *isnull = true;
+ return static_cast<Datum>(0);
+ }
+
+ if (typid != TEXTOID)
+ dbms_trace_unsupported_type_error(function_name, colname, typid);
+
+ *isnull = false;
+ return CStringGetTextDatum(value);
+}
+
+/* Формирует текстовый Datum из std::string для согласованной SQL-колонки. */
+Datum
+dbms_trace_text_datum_or_null(const std::string& value,
+ Oid typid,
+ bool* isnull,
+ const char* function_name,
+ const char* colname)
+{
+ return dbms_trace_text_datum_or_null(value.empty() ? nullptr : value.c_str(),
+ typid,
+ isnull,
+ function_name,
+ colname);
+}
+
+/* Формирует целочисленный Datum для int32 SQL-колонки. */
+Datum
+dbms_trace_int32_datum(int32 value, Oid typid, const char* function_name, const char* colname)
+{
+ if (typid != INT4OID)
+ dbms_trace_unsupported_type_error(function_name, colname, typid);
+
+ return Int32GetDatum(value);
+}
+
+/* Формирует целочисленный Datum для int64/int32 SQL-колонки. */
+Datum
+dbms_trace_int64_datum(int64 value, Oid typid, const char* function_name, const char* colname)
+{
+ if (typid == INT8OID)
+ return Int64GetDatum(value);
+ if (typid == INT4OID)
+ return Int32GetDatum(dbms_trace_checked_int64_to_int32(value, function_name, colname));
+
+ dbms_trace_unsupported_type_error(function_name, colname, typid);
+ return static_cast<Datum>(0);
+}
+
+/* Формирует timestamptz Datum для SQL-колонки времени. */
+Datum
+dbms_trace_timestamptz_datum(TimestampTz value, Oid typid, const char* function_name, const char* colname)
+{
+ if (typid != TIMESTAMPTZOID)
+ dbms_trace_unsupported_type_error(function_name, colname, typid);
+
+ return TimestampTzGetDatum(value);
+}
+
+/* Формирует bool Datum для булевой SQL-колонки. */
+Datum
+dbms_trace_bool_datum(bool value, Oid typid, const char* function_name, const char* colname)
+{
+ if (typid != BOOLOID)
+ dbms_trace_unsupported_type_error(function_name, colname, typid);
+
+ return BoolGetDatum(value);
+}
+
+/* Проверяет, завершён ли run. */
+bool
+dbms_trace_run_is_closed(const DbmsTraceRun& run)
+{
+ return !run.is_active && run.ended_at != 0;
+}
+
+/* Заполняет одну строку SQL-результата trace runs по фактическому descriptor. */
+void
+dbms_trace_fill_run_row(const DbmsTraceRun& run, TupleDesc tupdesc, Datum* values, bool* nulls)
+{
+ const char* function_name = "run";
+
+ for (int attno = 0; attno < tupdesc->natts; ++attno)
+ {
+ Form_pg_attribute attr = TupleDescAttr(tupdesc, attno);
+ const char* colname = NameStr(attr->attname);
+ const Oid typid = attr->atttypid;
+
+ nulls[attno] = true;
+ values[attno] = static_cast<Datum>(0);
+
+ if (attr->attisdropped)
+ continue;
+
+ if (dbms_trace_attr_name_is(attr, "run_id"))
+ {
+ values[attno] = dbms_trace_int64_datum(run.run_id, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "trace_mask") ||
+ dbms_trace_attr_name_is(attr, "trace_level"))
+ {
+ values[attno] = dbms_trace_int32_datum(run.trace_mask, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "started_at"))
+ {
+ values[attno] = dbms_trace_timestamptz_datum(run.started_at, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "ended_at"))
+ {
+ if (dbms_trace_run_is_closed(run))
+ {
+ values[attno] = dbms_trace_timestamptz_datum(run.ended_at, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ }
+ else if (dbms_trace_attr_name_is(attr, "event_count"))
+ {
+ values[attno] = dbms_trace_int32_datum(run.event_count, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "is_active"))
+ {
+ values[attno] = dbms_trace_bool_datum(run.is_active, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else
+ dbms_trace_unsupported_column_error(function_name, colname);
+ }
+}
+
+/* Заполняет одну строку SQL-результата trace events по фактическому descriptor. */
+void
+dbms_trace_fill_event_row(const DbmsTraceEvent& event, TupleDesc tupdesc, Datum* values, bool* nulls)
+{
+ const char* function_name = "event";
+
+ for (int attno = 0; attno < tupdesc->natts; ++attno)
+ {
+ Form_pg_attribute attr = TupleDescAttr(tupdesc, attno);
+ const char* colname = NameStr(attr->attname);
+ const Oid typid = attr->atttypid;
+
+ nulls[attno] = true;
+ values[attno] = static_cast<Datum>(0);
+
+ if (attr->attisdropped)
+ continue;
+
+ if (dbms_trace_attr_name_is(attr, "event_type"))
+ {
+ values[attno] = dbms_trace_text_datum_or_null(trace_event_type_label(event.event_type.c_str()),
+ typid,
+ &nulls[attno],
+ function_name,
+ colname);
+ }
+ else if (dbms_trace_attr_name_is(attr, "run_id"))
+ {
+ values[attno] = dbms_trace_int64_datum(event.run_id, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "event_seq"))
+ {
+ values[attno] = dbms_trace_int64_datum(event.event_seq, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "event_time") ||
+ dbms_trace_attr_name_is(attr, "event_timestamp") ||
+ dbms_trace_attr_name_is(attr, "timestamp"))
+ {
+ values[attno] = dbms_trace_timestamptz_datum(event.timestamp, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "unit_name"))
+ {
+ values[attno] = dbms_trace_text_datum_or_null(event.unit_name,
+ typid,
+ &nulls[attno],
+ function_name,
+ colname);
+ }
+ else if (dbms_trace_attr_name_is(attr, "subprogram_name"))
+ {
+ values[attno] = dbms_trace_text_datum_or_null(event.subprogram_name,
+ typid,
+ &nulls[attno],
+ function_name,
+ colname);
+ }
+ else if (dbms_trace_attr_name_is(attr, "nesting_depth"))
+ {
+ values[attno] = dbms_trace_int32_datum(event.nesting_depth, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ else if (dbms_trace_attr_name_is(attr, "line_no"))
+ {
+ if (event.line_no != 0)
+ {
+ values[attno] = dbms_trace_int32_datum(event.line_no, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ }
+ else if (dbms_trace_attr_name_is(attr, "sql_text"))
+ {
+ values[attno] = dbms_trace_text_datum_or_null(event.sql_text,
+ typid,
+ &nulls[attno],
+ function_name,
+ colname);
+ }
+ else if (dbms_trace_attr_name_is(attr, "error_code"))
+ {
+ if (event.error_code != 0)
+ {
+ values[attno] = dbms_trace_int32_datum(event.error_code, typid, function_name, colname);
+ nulls[attno] = false;
+ }
+ }
+ else if (dbms_trace_attr_name_is(attr, "comment"))
+ {
+ values[attno] = dbms_trace_text_datum_or_null(event.comment,
+ typid,
+ &nulls[attno],
+ function_name,
+ colname);
+ }
+ else
+ dbms_trace_unsupported_column_error(function_name, colname);
+ }
+}
+
+/* Нормализует внутренние коды событий для SQL-вывода. */
+const char*
+trace_event_type_label(const char* event_type)
+{
+ if (event_type == nullptr)
+ return "";
+
+ if (std::strcmp(event_type, "SET") == 0)
+ return "SET_TRACE";
+ if (std::strcmp(event_type, "CLEAR") == 0)
+ return "CLEAR_TRACE";
+ return event_type;
+}
+
+/* Проверяет, что маска содержит только управляющие флаги. */
+bool is_control_only(int32 trace_mask)
+{
+ return (trace_mask & kControlMask) != 0 && (trace_mask & ~kControlMask) == 0;
+}
+
+/* Собирает базовую структуру trace event с общими полями. */
+DbmsTraceEvent
+make_trace_event(DbmsTraceSessionState& state, const char* event_type, TimestampTz timestamp)
+{
+ DbmsTraceEvent event{};
+ event.event_type = event_type != nullptr ? event_type : "";
+ event.run_id = state.active_run_id;
+ event.event_seq = state.next_event_seq++;
+ event.timestamp = timestamp;
+ return event;
+}
+
+/* Возвращает активный run для текущего состояния сессии. */
+DbmsTraceRun*
+current_trace_run(DbmsTraceSessionState& state)
+{
+ if (!state.enabled || state.active_run_id == 0 || state.trace_runs.empty())
+ return nullptr;
+
+ DbmsTraceRun& run = state.trace_runs.back();
+ if (run.run_id != state.active_run_id)
+ return nullptr;
+
+ return &run;
+}
+
+/* Добавляет обычное trace-событие в историю сессии. */
+void append_trace_event(DbmsTraceSessionState& state,
+ const char* event_type,
+ const std::string& comment,
+ TimestampTz timestamp)
+{
+ DbmsTraceEvent event = make_trace_event(state, event_type, timestamp);
+ event.comment = comment;
+ state.trace_rows.emplace_back(std::move(event));
+ if (DbmsTraceRun* run = current_trace_run(state))
+ run->event_count++;
+}
+
+/* Извлекает имя unit из signature функции. */
+std::string
+derive_unit_name(const char* fn_signature)
+{
+ if (fn_signature == nullptr || fn_signature[0] == '\0')
+ return std::string();
+
+ const std::string signature(fn_signature);
+ const std::string::size_type open_paren = signature.find('(');
+ if (open_paren == std::string::npos)
+ return signature;
+
+ return signature.substr(0, open_paren);
+}
+
+/* Извлекает имя subprogram из signature функции. */
+std::string
+derive_subprogram_name(const char* fn_signature)
+{
+ if (fn_signature == nullptr || fn_signature[0] == '\0')
+ return std::string();
+
+ const std::string signature(fn_signature);
+ const std::string::size_type open_paren = signature.find('(');
+ const std::string::size_type name_end = open_paren == std::string::npos ? signature.size() : open_paren;
+ const std::string::size_type dot = signature.rfind('.', name_end);
+ const std::string::size_type name_begin = dot == std::string::npos ? 0 : dot + 1;
+
+ return signature.substr(name_begin, name_end - name_begin);
+}
+
+/* Создаёт запись о новом run. */
+void
+open_trace_run(DbmsTraceSessionState& state, int32 trace_level, TimestampTz timestamp)
+{
+ DbmsTraceRun run{};
+ run.run_id = state.active_run_id;
+ run.trace_mask = trace_level;
+ run.started_at = timestamp;
+ run.ended_at = 0;
+ run.event_count = 0;
+ run.is_active = true;
+ state.trace_runs.emplace_back(run);
+}
+
+/* Закрывает текущий run по timestamp завершения. */
+void
+close_trace_run(DbmsTraceSessionState& state, TimestampTz timestamp)
+{
+ DbmsTraceRun* run = current_trace_run(state);
+ if (run == nullptr)
+ return;
+
+ run->ended_at = timestamp;
+ run->is_active = false;
+}
+
+/* Добавляет PL/pgSQL CALL или RETURN событие. */
+void
+append_plpgsql_trace_event(DbmsTraceSessionState& state,
+ const char* event_type,
+ PLpgSQL_function* func,
+ const char* comment_prefix)
+{
+ if (!state.enabled || state.active_run_id == 0 || func == nullptr)
+ return;
+
+ TimestampTz timestamp = GetCurrentTimestamp();
+ DbmsTraceEvent event = make_trace_event(state, event_type, timestamp);
+ event.unit_name = derive_unit_name(func->fn_signature);
+ event.subprogram_name = derive_subprogram_name(func->fn_signature);
+ event.comment = comment_prefix != nullptr ? comment_prefix : "";
+ if (func->fn_signature != nullptr && func->fn_signature[0] != '\0')
+ {
+ if (!event.comment.empty())
+ event.comment.push_back(' ');
+ event.comment += func->fn_signature;
+ }
+ state.trace_rows.emplace_back(std::move(event));
+ if (DbmsTraceRun* run = current_trace_run(state))
+ run->event_count++;
+}
+
+/* Хук начала PL/pgSQL-функции. */
+void
+dbms_trace_plpgsql_func_beg(PLpgSQL_execstate* estate, PLpgSQL_function* func)
+{
+ (void) estate;
+ auto& state = dbms_trace_session_state();
+ append_plpgsql_trace_event(state,
+ "CALL",
+ func,
+ "PL/pgSQL function entered");
+}
+
+/* Хук завершения PL/pgSQL-функции. */
+void
+dbms_trace_plpgsql_func_end(PLpgSQL_execstate* estate, PLpgSQL_function* func)
+{
+ (void) estate;
+ auto& state = dbms_trace_session_state();
+ append_plpgsql_trace_event(state,
+ "RETURN",
+ func,
+ "PL/pgSQL function exited");
+}
+
+/* Устанавливает обработчики PL/pgSQL один раз на backend. */
+void
+dbms_trace_install_plpgsql_plugin()
+{
+ if (g_dbms_trace_plpgsql_plugin_installed)
+ return;
+
+ void** rendezvous = find_rendezvous_variable("PLpgSQL_plugin");
+ if (rendezvous == nullptr)
+ return;
+
+ g_dbms_trace_plpgsql_plugin.func_setup = nullptr;
+ g_dbms_trace_plpgsql_plugin.func_beg = dbms_trace_plpgsql_func_beg;
+ g_dbms_trace_plpgsql_plugin.func_end = dbms_trace_plpgsql_func_end;
+ g_dbms_trace_plpgsql_plugin.stmt_beg = nullptr;
+ g_dbms_trace_plpgsql_plugin.stmt_end = nullptr;
+
+ *reinterpret_cast<PLpgSQL_plugin**>(rendezvous) = &g_dbms_trace_plpgsql_plugin;
+ g_dbms_trace_plpgsql_plugin_installed = true;
+}
+} // namespace
+
+/*
+ * Семантика выполнения DBMS_TRACE.
+ *
+ * Пакет хранит локальное состояние сессии и историю строк трассировки для
+ * `SET_PLSQL_TRACE` / `CLEAR_PLSQL_TRACE`.
+ *
+ * Остальные public entrypoints остаются явными заглушками, чтобы SQL-клиенты
+ * получали предсказуемую ошибку "not implemented" вместо отсутствующей
+ * поверхности.
+ */
+
+static DbmsTraceSessionState g_dbms_trace_session_state{false, 0};
+
+/* Возвращает backend-local состояние DBMS_TRACE. */
+DbmsTraceSessionState&
+dbms_trace_session_state()
+{
+ return g_dbms_trace_session_state;
+}
+
+PG_FUNCTION_INFO_V1(dbms_trace_set_plsql_trace);
+PG_FUNCTION_INFO_V1(dbms_trace_clear_plsql_trace);
+PG_FUNCTION_INFO_V1(dbms_trace_is_enabled);
+PG_FUNCTION_INFO_V1(dbms_trace_get_plsql_trace_level);
+PG_FUNCTION_INFO_V1(dbms_trace_plsql_trace_version);
+PG_FUNCTION_INFO_V1(dbms_trace_get_version);
+PG_FUNCTION_INFO_V1(dbms_trace_plsql_trace_runs);
+PG_FUNCTION_INFO_V1(dbms_trace_plsql_trace_events);
+
+/// @brief Версия RUDB пакета DBMS_TRACE (Oracle DBMS_TRACE пакет)
+#define RUDB_DBMS_TRACE_VERSION "1.0.0"
+
+Datum dbms_trace_set_plsql_trace(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("SET_PLSQL_TRACE requires a trace level")));
+ }
+
+ int32 trace_level = PG_GETARG_INT32(0);
+ const bool enabled = DatumGetBool(
+ DirectFunctionCall0(dbms_trace_is_enabled));
+
+ if (is_control_only(trace_level))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("control trace flags cannot be combined with regular trace flags")));
+ }
+
+ auto& state = dbms_trace_session_state();
+ if (!enabled)
+ {
+ dbms_trace_install_plpgsql_plugin();
+ TimestampTz timestamp = GetCurrentTimestamp();
+ state.enabled = true;
+ state.active_run_id = state.next_run_id++;
+ state.next_event_seq = 1;
+ open_trace_run(state, trace_level, timestamp);
+
+ append_trace_event(state,
+ "SET",
+ std::string("SET_PLSQL_TRACE trace_level=") + std::to_string(trace_level),
+ timestamp);
+ }
+ else if (!state.trace_runs.empty())
+ {
+ state.trace_runs.back().trace_mask = trace_level;
+ }
+
+ state.trace_mask = trace_level;
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_trace_clear_plsql_trace(PG_FUNCTION_ARGS)
+{
+ auto& state = dbms_trace_session_state();
+ const bool enabled = DatumGetBool(
+ DirectFunctionCall0(dbms_trace_is_enabled));
+ if (enabled)
+ {
+ TimestampTz timestamp = GetCurrentTimestamp();
+ append_trace_event(state,
+ "CLEAR",
+ "CLEAR_PLSQL_TRACE",
+ timestamp);
+ close_trace_run(state, timestamp);
+ }
+ state.enabled = false;
+ state.trace_mask = 0;
+ state.active_run_id = 0;
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_trace_is_enabled(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(is_trace_enabled(dbms_trace_session_state()));
+}
+
+/* Генерирует ошибку для не реализованных entrypoints. */
+static void
+dbms_trace_not_implemented(const char* function_name)
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("%s is not implemented yet", function_name)));
+}
+
+Datum dbms_trace_get_plsql_trace_level(PG_FUNCTION_ARGS)
+{
+ dbms_trace_not_implemented("DBMS_TRACE.GET_PLSQL_TRACE_LEVEL");
+ PG_RETURN_INT32(0);
+}
+
+Datum dbms_trace_plsql_trace_version(PG_FUNCTION_ARGS)
+{
+ dbms_trace_not_implemented("DBMS_TRACE.PLSQL_TRACE_VERSION");
+ PG_RETURN_VOID();
+}
+
+Datum dbms_trace_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_TRACE_VERSION));
+}
+
+/*
+ * SQL-доступ к строкам запуска трассировки поверх локальной истории сессии.
+ */
+Datum dbms_trace_plsql_trace_runs(PG_FUNCTION_ARGS)
+{
+ ReturnSetInfo* rsinfo = reinterpret_cast<ReturnSetInfo*>(fcinfo->resultinfo);
+ if (rsinfo == nullptr || !IsA(rsinfo, ReturnSetInfo))
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("set-valued function called in context that cannot accept a set")));
+
+ InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS);
+ TupleDesc tupdesc = rsinfo->setDesc;
+
+ for (const DbmsTraceRun& run : dbms_trace_session_state().trace_runs)
+ {
+ Datum* values = reinterpret_cast<Datum*>(palloc0(sizeof(Datum) * tupdesc->natts));
+ bool* nulls = reinterpret_cast<bool*>(palloc(sizeof(bool) * tupdesc->natts));
+
+ dbms_trace_fill_run_row(run, tupdesc, values, nulls);
+ tuplestore_putvalues(rsinfo->setResult, tupdesc, values, nulls);
+
+ pfree(values);
+ pfree(nulls);
+ }
+
+ PG_RETURN_NULL();
+}
+
+/*
+ * SQL-доступ к событиям трассировки поверх локальной истории сессии.
+ */
+Datum dbms_trace_plsql_trace_events(PG_FUNCTION_ARGS)
+{
+ ReturnSetInfo* rsinfo = reinterpret_cast<ReturnSetInfo*>(fcinfo->resultinfo);
+ if (rsinfo == nullptr || !IsA(rsinfo, ReturnSetInfo))
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("set-valued function called in context that cannot accept a set")));
+
+ InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS);
+ TupleDesc tupdesc = rsinfo->setDesc;
+
+ for (const DbmsTraceEvent& event : dbms_trace_session_state().trace_rows)
+ {
+ Datum* values = reinterpret_cast<Datum*>(palloc0(sizeof(Datum) * tupdesc->natts));
+ bool* nulls = reinterpret_cast<bool*>(palloc(sizeof(bool) * tupdesc->natts));
+
+ dbms_trace_fill_event_row(event, tupdesc, values, nulls);
+ tuplestore_putvalues(rsinfo->setResult, tupdesc, values, nulls);
+
+ pfree(values);
+ pfree(nulls);
+ }
+
+ PG_RETURN_NULL();
+}
+
+/* Снимает debug snapshot для регрессионных проверок. */
+extern "C" void
+dbms_trace_get_debug_snapshot(DbmsTraceDebugSnapshot* out)
+{
+ if (out == nullptr)
+ {
+ return;
+ }
+
+ auto& state = dbms_trace_session_state();
+ *out = DbmsTraceDebugSnapshot{};
+ out->enabled = state.enabled;
+ out->trace_mask = state.trace_mask;
+ out->active_run_id = state.active_run_id;
+ out->next_run_id = state.next_run_id;
+ out->next_event_seq = state.next_event_seq;
+ out->trace_rows_count = static_cast<int32>(state.trace_rows.size());
+ if (!state.trace_rows.empty())
+ {
+ const std::string& last_event = state.trace_rows.back().event_type;
+ std::snprintf(out->last_event_type,
+ sizeof(out->last_event_type),
+ "%s",
+ last_event.c_str());
+ }
+}
diff --git a/src/backend/utils/dbms/dbms_trace/dbms_trace.hpp b/src/backend/utils/dbms/dbms_trace/dbms_trace.hpp
new file mode 100644
index 0000000..5f5c45a
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_trace/dbms_trace.hpp
@@ -0,0 +1,184 @@
+#ifndef DBMS_TRACE_HPP
+#define DBMS_TRACE_HPP
+
+/*
+ * DBMS_TRACE
+ *
+ * Назначение:
+ * Пакет хранит сессионную историю trace-операций и даёт SQL-доступ к
+ * trace runs и trace events.
+ */
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/elog.h"
+#include "utils/timestamp.h"
+} // extern "C"
+
+#include <string>
+#include <vector>
+
+struct DbmsTraceEvent
+{
+ std::string event_type;
+ int64 run_id = 0;
+ int64 event_seq = 0;
+ TimestampTz timestamp = 0;
+ std::string unit_name;
+ std::string subprogram_name;
+ int32 nesting_depth = 0;
+ int32 line_no = 0;
+ std::string sql_text;
+ int32 error_code = 0;
+ std::string comment;
+};
+
+struct DbmsTraceRun
+{
+ int64 run_id = 0;
+ int32 trace_mask = 0;
+ TimestampTz started_at = 0;
+ TimestampTz ended_at = 0;
+ int32 event_count = 0;
+ bool is_active = false;
+};
+
+struct DbmsTraceDebugSnapshot
+{
+ bool enabled = false;
+ int32 trace_mask = 0;
+ int64 active_run_id = 0;
+ int64 next_run_id = 0;
+ int64 next_event_seq = 0;
+ int32 trace_rows_count = 0;
+ char last_event_type[16] = {0};
+};
+
+extern "C"
+{
+/**
+ * @brief Запускает трассировку в указанном режиме.
+ * @details Включает session-local trace, создаёт новый run и начинает
+ * собирать PL/pgSQL CALL/RETURN события в памяти текущего backend-а.
+ * Если трассировка уже включена, функция обновляет текущую маску
+ * trace без создания нового run.
+ * Примеры:
+ * SELECT DBMS_TRACE.SET_PLSQL_TRACE(1) FROM dual;
+ * SELECT DBMS_TRACE.SET_PLSQL_TRACE(7) FROM dual;
+ * SELECT DBMS_TRACE.SET_PLSQL_TRACE(1 + 2) FROM dual;
+ * SELECT DBMS_TRACE.SET_PLSQL_TRACE(1048576) FROM dual;
+ * @param trace_level Уровень или маска трассировки.
+ * @return `void`.
+ */
+Datum dbms_trace_set_plsql_trace(PG_FUNCTION_ARGS);
+/**
+ * @brief Завершает активную трассировку в текущей сессии.
+ * @details Записывает событие CLEAR, закрывает текущий run и выключает
+ * session-local tracing для текущего backend-а.
+ * Повторный вызов без активной трассировки остаётся идемпотентным.
+ * Примеры:
+ * SELECT DBMS_TRACE.CLEAR_PLSQL_TRACE() FROM dual;
+ * SELECT DBMS_TRACE.CLEAR_PLSQL_TRACE() FROM dual;
+ * @return `void`.
+ */
+Datum dbms_trace_clear_plsql_trace(PG_FUNCTION_ARGS);
+/**
+ * @brief Возвращает текущее состояние трассировки.
+ * @details Отражает session-local состояние пакета DBMS_TRACE для текущего backend-а.
+ * Примеры:
+ * SELECT DBMS_TRACE.IS_ENABLED() FROM dual;
+ * SELECT DBMS_TRACE.SET_PLSQL_TRACE(1) FROM dual;
+ * SELECT DBMS_TRACE.IS_ENABLED() FROM dual;
+ * @return `true`, если трассировка включена.
+ */
+Datum dbms_trace_is_enabled(PG_FUNCTION_ARGS);
+/**
+ * @brief Возвращает уровень трассировки.
+ * @details В текущей области это заглушка совместимости пакета.
+ * Функция объявлена в SQL-поверхности, но пока всегда возвращает
+ * ошибку feature-not-supported.
+ * Примеры:
+ * SELECT DBMS_TRACE.GET_PLSQL_TRACE_LEVEL() FROM dual;
+ * @return Текущий уровень трассировки.
+ */
+Datum dbms_trace_get_plsql_trace_level(PG_FUNCTION_ARGS);
+/**
+ * @brief Возвращает версию пакета DBMS_TRACE.
+ * @details В текущей области это заглушка совместимости пакета.
+ * Объявление сохранено для compatibility surface, но реализация
+ * пока специально завершает выполнение ошибкой.
+ * Примеры:
+ * SELECT DBMS_TRACE.PLSQL_TRACE_VERSION() FROM dual;
+ * @return `record` с версией пакета.
+ */
+Datum dbms_trace_plsql_trace_version(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_TRACE.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_TRACE.GET_VERSION() FROM dual;
+ * SELECT dbms_trace_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_trace_get_version(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает строки запуска трассировки в виде SQL-результата.
+ * @details Отдаёт историю trace runs текущего backend-а как materialized
+ * set-returning function. Используется SQL-views `plsql_trace_runs`
+ * для удобного чтения результата.
+ * Примеры:
+ * SELECT * FROM DBMS_TRACE.PLSQL_TRACE_RUNS();
+ * SELECT * FROM plsql_trace_runs;
+ * SELECT run_id, trace_mask, is_active FROM plsql_trace_runs;
+ * @return Набор строк trace runs.
+ */
+Datum dbms_trace_plsql_trace_runs(PG_FUNCTION_ARGS);
+/**
+ * @brief Возвращает события трассировки в виде SQL-результата.
+ * @details Отдаёт накопленные trace events текущего backend-а как
+ * materialized set-returning function. Используется SQL-view
+ * `plsql_trace_events` для чтения результата.
+ * Примеры:
+ * SELECT * FROM DBMS_TRACE.PLSQL_TRACE_EVENTS();
+ * SELECT * FROM plsql_trace_events;
+ * SELECT event_type, run_id, event_seq FROM plsql_trace_events;
+ * @return Набор строк trace events.
+ */
+Datum dbms_trace_plsql_trace_events(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает внутренний debug snapshot состояния пакета.
+ * @details Используется только для регрессионных тестов и внутренней
+ * диагностики, чтобы проверять состояние package без SQL-обхода.
+ * Примеры:
+ * -- вызывается из C-хелпера regress_dbms_trace_snapshot()
+ * -- для проверки enabled, trace_mask и счётчиков событий
+ * @param out Указатель на структуру snapshot, которую нужно заполнить.
+ */
+PGDLLEXPORT void dbms_trace_get_debug_snapshot(DbmsTraceDebugSnapshot* out);
+} // extern "C"
+
+struct DbmsTraceSessionState
+{
+ bool enabled = false;
+ int32 trace_mask = 0;
+ int64 active_run_id = 0;
+ int64 next_run_id = 1;
+ int64 next_event_seq = 1;
+ std::vector<DbmsTraceRun> trace_runs;
+ std::vector<DbmsTraceEvent> trace_rows;
+};
+
+/**
+ * @brief Возвращает локальное состояние DBMS_TRACE для backend.
+ * @details Хранит session-local состояние трассировки и историю событий
+ * только в памяти текущего backend-а. Состояние не разделяется
+ * между сессиями и сбрасывается вместе с процессом backend-а.
+ */
+DbmsTraceSessionState& dbms_trace_session_state();
+
+#endif // DBMS_TRACE_HPP
diff --git a/src/backend/utils/dbms/dbms_transaction/dbms_transaction.cpp b/src/backend/utils/dbms/dbms_transaction/dbms_transaction.cpp
new file mode 100644
index 0000000..2db0794
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_transaction/dbms_transaction.cpp
@@ -0,0 +1,300 @@
+#include "dbms_transaction.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+}
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(dbms_transaction_advise_commit);
+PG_FUNCTION_INFO_V1(dbms_transaction_advise_nothing);
+PG_FUNCTION_INFO_V1(dbms_transaction_advise_rollback);
+PG_FUNCTION_INFO_V1(dbms_transaction_commit);
+PG_FUNCTION_INFO_V1(dbms_transaction_commit_comment);
+PG_FUNCTION_INFO_V1(dbms_transaction_commit_force);
+PG_FUNCTION_INFO_V1(dbms_transaction_get_transaction_id);
+PG_FUNCTION_INFO_V1(dbms_transaction_get_transaction_timeout);
+PG_FUNCTION_INFO_V1(dbms_transaction_get_transaction_type);
+PG_FUNCTION_INFO_V1(dbms_transaction_local_transaction_id_full);
+PG_FUNCTION_INFO_V1(dbms_transaction_purge_lost_db_entry);
+PG_FUNCTION_INFO_V1(dbms_transaction_purge_mixed);
+PG_FUNCTION_INFO_V1(dbms_transaction_read_only);
+PG_FUNCTION_INFO_V1(dbms_transaction_read_write);
+PG_FUNCTION_INFO_V1(dbms_transaction_rollback);
+PG_FUNCTION_INFO_V1(dbms_transaction_rollback_force);
+PG_FUNCTION_INFO_V1(dbms_transaction_rollback_savepoint);
+PG_FUNCTION_INFO_V1(dbms_transaction_savepoint);
+PG_FUNCTION_INFO_V1(dbms_transaction_start_transaction_full);
+PG_FUNCTION_INFO_V1(dbms_transaction_step_id);
+PG_FUNCTION_INFO_V1(dbms_transaction_suspend_transaction);
+PG_FUNCTION_INFO_V1(dbms_transaction_use_rollback_segment);
+
+Datum dbms_transaction_advise_commit(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.advise_commit еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_advise_nothing(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.advise_nothing еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_advise_rollback(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.advise_rollback еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_commit(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.commit еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief эквивалент SQL-оператору COMMIT COMMENT <текст>
+ * @details Эта процедура эквивалентна SQL-оператору COMMIT COMMENT <текст>
+ * * Parameters:
+ * * @param CMNT (in) VARCHAR2: Комментарий для ассоциации с этим коммитом
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_commit_comment(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.commit_comment еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief эквивалент SQL-оператору COMMIT FORCE <текст>, <число>
+ * @details Эта процедура эквивалентна SQL-оператору COMMIT FORCE <текст>, <число>
+ * * Parameters:
+ * * @param XID (in) VARCHAR2: Локальный или глобальный идентификатор транзакции
+ * * @param SCN (in) VARCHAR2: Номер системного изменения (SCN)
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_commit_force(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.commit_force еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Возвращает идентификатор транзакции без сессии или XA-транзакции в сессии
+ * @details Возвращает идентификатор транзакции для транзакции без сессии или XA-транзакции в текущей сессии
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_get_transaction_id(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.get_transaction_id еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Возвращает таймаут (в секундах) ветки XA-транзакции или транзакции без сессии
+ * @details Возвращает таймаут (в секундах) ветки XA-транзакции или транзакции без сессии в текущей сессии
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_get_transaction_timeout(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.get_transaction_timeout еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Возвращает тип активной транзакции в сессии
+ * @details Возвращает тип активной транзакции в текущей сессии
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_get_transaction_type(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.get_transaction_type еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief возвращает локальный (для экземпляра) уникальный идентификатор текущей транзакции
+ * @details Эта функция возвращает локальный (для экземпляра) уникальный идентификатор текущей транзакции. Возвращает NULL, если нет активной транзакции.
+ * * Parameters:
+ * * @param CREATE_TRANSACTION (in) BOOLEAN: Если TRUE, начинает транзакцию, если она не активна
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_local_transaction_id_full(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.local_transaction_id еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Удаляет записи, управляющие восстановлением базы данных с локального сайта
+ * @details Процедура PURGE_LOST_DB_ENTRY удаляет записи, управляющие восстановлением базы данных с локального сайта.
+При сбое во время обработки COMMIT автоматическое восстановление согласованно разрешает результаты на всех сайтах, участвующих в транзакции. Однако если удаленная БД уничтожена или пересоздана до завершения восстановления, записи в DBA_2PC_PENDING и связанных таблицах не удаляются, и восстановление будет периодически повторяться. Эта процедура позволяет удалить такие транзакции с локального сайта.
+ * * Parameters:
+ * * @param XID (in) VARCHAR2: Должен быть равен значению столбца LOCAL_TRAN_ID в таблице DBA_2PC_PENDING
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_purge_lost_db_entry(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.purge_lost_db_entry еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief удаляет информацию о транзакции со смешанным результатом
+ * @details Эта процедура удаляет информацию о транзакции со смешанным результатом
+Когда транзакции в состоянии "in-doubt" принудительно фиксируются или откатываются (вместо автоматического восстановления), может возникнуть ситуация, когда транзакция имеет смешанный результат: некоторые сайты зафиксировали изменения, а другие откатили. Oracle помечает такие записи в DBA_2PC_PENDING, устанавливая столбец MIXED в значение 'yes'.
+ * * Parameters:
+ * * @param XID (in) VARCHAR2: Должен быть равен значению столбца LOCAL_TRAN_ID в таблице DBA_2PC_PENDING
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_purge_mixed(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.purge_mixed еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_read_only(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.read_only еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_read_write(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.read_write еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_rollback(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.rollback еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief эквивалент SQL-оператору ROLLBACK FORCE <текст>
+ * @details Эта процедура эквивалентна SQL-оператору ROLLBACK FORCE <текст>
+ * * Parameters:
+ * * @param XID (in) VARCHAR2: Локальный или глобальный идентификатор транзакции
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_rollback_force(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.rollback_force еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief эквивалент SQL-оператору ROLLBACK TO SAVEPOINT <имя_точки_сохранения>
+ * @details Эта процедура эквивалентна SQL-оператору ROLLBACK TO SAVEPOINT <имя_точки_сохранения>. Включена для полноты, так как функциональность уже реализована в PL/SQL.
+ * * Parameters:
+ * * @param SAVEPT (in) VARCHAR2: Идентификатор точки сохранения
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_rollback_savepoint(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.rollback_savepoint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief эквивалент SQL-оператору SAVEPOINT <имя_точки_сохранения>
+ * @details Эта процедура эквивалентна SQL-оператору SAVEPOINT <имя_точки_сохранения>. Включена для полноты, так как функциональность уже реализована в PL/SQL.
+ * * Parameters:
+ * * @param SAVEPT (in) VARCHAR2: Идентификатор точки сохранения
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_savepoint(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.savepoint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Начинает локальную транзакцию или транзакцию без сессии
+ * @details Начинает локальную (обычную) транзакцию или транзакцию без сессии (Sessionless)
+ * * Parameters:
+ * * @param XID (in) VARCHAR2: Идентификатор транзакции
+ * * @param TRANSACTION_TYPE (in) BINARY_INTEGER: Тип транзакции
+ * * @param TIMEOUT (in) BINARY_INTEGER: Таймаут транзакции в секундах
+ * * @param FLAG (in) BINARY_INTEGER: Флаги транзакции
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_start_transaction_full(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.start_transaction еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief возвращает локальный уникальный положительный целочисленный идентификатор, упорядочивающий DML-операции транзакции
+ * @details Эта функция возвращает локальный (для транзакции) уникальный положительный целочисленный идентификатор, который упорядочивает DML-операции в транзакции.
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_step_id(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.step_id еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+Datum dbms_transaction_suspend_transaction(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.suspend_transaction еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief эквивалент SQL-оператору SET TRANSACTION USE ROLLBACK SEGMENT <имя_сегмента_отката>
+ * @details Эта процедура эквивалентна SQL-оператору SET TRANSACTION USE ROLLBACK SEGMENT <имя_сегмента_отката>
+ * * Parameters:
+ * * @param RB_NAME (in) VARCHAR2: Имя сегмента отката для использования
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_TRANSACTION.html
+ */
+Datum dbms_transaction_use_rollback_segment(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_transaction.use_rollback_segment еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_transaction/dbms_transaction.hpp b/src/backend/utils/dbms/dbms_transaction/dbms_transaction.hpp
new file mode 100644
index 0000000..2ee9d33
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_transaction/dbms_transaction.hpp
@@ -0,0 +1,44 @@
+#ifndef DBMS_TRANSACTION_INTERNAL_HPP
+#define DBMS_TRANSACTION_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+} // extern "C"
+
+extern "C"
+{
+Datum dbms_transaction_advise_commit(PG_FUNCTION_ARGS);
+Datum dbms_transaction_advise_nothing(PG_FUNCTION_ARGS);
+Datum dbms_transaction_advise_rollback(PG_FUNCTION_ARGS);
+Datum dbms_transaction_commit(PG_FUNCTION_ARGS);
+Datum dbms_transaction_commit_comment(PG_FUNCTION_ARGS);
+Datum dbms_transaction_commit_force(PG_FUNCTION_ARGS);
+Datum dbms_transaction_get_transaction_id(PG_FUNCTION_ARGS);
+Datum dbms_transaction_get_transaction_timeout(PG_FUNCTION_ARGS);
+Datum dbms_transaction_get_transaction_type(PG_FUNCTION_ARGS);
+Datum dbms_transaction_local_transaction_id_full(PG_FUNCTION_ARGS);
+Datum dbms_transaction_purge_lost_db_entry(PG_FUNCTION_ARGS);
+Datum dbms_transaction_purge_mixed(PG_FUNCTION_ARGS);
+Datum dbms_transaction_read_only(PG_FUNCTION_ARGS);
+Datum dbms_transaction_read_write(PG_FUNCTION_ARGS);
+Datum dbms_transaction_rollback(PG_FUNCTION_ARGS);
+Datum dbms_transaction_rollback_force(PG_FUNCTION_ARGS);
+Datum dbms_transaction_rollback_savepoint(PG_FUNCTION_ARGS);
+Datum dbms_transaction_savepoint(PG_FUNCTION_ARGS);
+Datum dbms_transaction_start_transaction_full(PG_FUNCTION_ARGS);
+Datum dbms_transaction_step_id(PG_FUNCTION_ARGS);
+Datum dbms_transaction_suspend_transaction(PG_FUNCTION_ARGS);
+Datum dbms_transaction_use_rollback_segment(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_TRANSACTION_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/dbms_warning/dbms_warning.cpp b/src/backend/utils/dbms/dbms_warning/dbms_warning.cpp
new file mode 100644
index 0000000..2812590
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_warning/dbms_warning.cpp
@@ -0,0 +1,581 @@
+#include "utils/dbms_warning.h"
+#include "dbms_warning.hpp"
+#include "dbms_warning_errors.hpp"
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(dbms_warning_add_warning_setting_cat);
+PG_FUNCTION_INFO_V1(dbms_warning_add_warning_setting_num);
+PG_FUNCTION_INFO_V1(dbms_warning_get_category);
+PG_FUNCTION_INFO_V1(dbms_warning_get_warning_setting_cat);
+PG_FUNCTION_INFO_V1(dbms_warning_get_warning_setting_num);
+PG_FUNCTION_INFO_V1(dbms_warning_get_warning_setting_string);
+PG_FUNCTION_INFO_V1(dbms_warning_normalize_setting);
+PG_FUNCTION_INFO_V1(dbms_warning_set_warning_setting_string);
+PG_FUNCTION_INFO_V1(dbms_warning_get_version);
+
+/// @brief Версия RUDB пакета DBMS_WARNING (Oracle DBMS_WARNING пакет)
+#define RUDB_DBMS_WARNING_VERSION "1.0.0"
+} // extern "C"
+
+#include <cctype>
+#include <limits>
+#include <string>
+#include <string_view>
+#include <utility>
+#include <vector>
+
+extern "C"
+{
+#include "utils/builtins.h"
+}
+
+namespace
+{
+/*
+ * Локальная модель состояния предупреждений для пакета DBMS_WARNING.
+ *
+ * Здесь храним только ordered clauses текущей строки PLSQL_WARNINGS.
+ * Публичные точки входа остаются частью поверхности пакета, а хук
+ * компилятора читает только сессионное строковое состояние.
+ */
+enum class WarningAction
+{
+ Enable,
+ Disable,
+ Error
+};
+
+enum class WarningSelectorKind
+{
+ All,
+ Category,
+ Number,
+ NumberList
+};
+
+struct WarningClause
+{
+ WarningAction action;
+ WarningSelectorKind selector_kind;
+ std::string selector_canonical;
+};
+
+struct WarningState
+{
+ std::vector<WarningClause> clauses;
+};
+
+// Проверяет, является ли символ пробелом.
+inline bool is_space(const unsigned char ch)
+{
+ return std::isspace(static_cast<int>(ch)) != 0;
+}
+
+// Убирает пробелы по краям строки без копирования.
+inline std::string_view trim_view(const std::string_view input)
+{
+ size_t begin = 0;
+ size_t end = input.size();
+
+ while (begin < end && is_space(static_cast<unsigned char>(input[begin])))
+ ++begin;
+
+ while (end > begin && is_space(static_cast<unsigned char>(input[end - 1])))
+ --end;
+
+ return input.substr(begin, end - begin);
+}
+
+// Возвращает копию строки в нижнем регистре.
+inline std::string lower_copy(const std::string_view input)
+{
+ std::string output;
+ output.reserve(input.size());
+
+ for (const char ch : input)
+ output.push_back(static_cast<char>(std::tolower(static_cast<unsigned char>(ch))));
+
+ return output;
+}
+
+// Сравнивает строки без учета регистра и внешних пробелов.
+inline bool iequals(const std::string_view lhs, const std::string_view rhs)
+{
+ return lower_copy(trim_view(lhs)) == lower_copy(trim_view(rhs));
+}
+
+// Проверяет токен действия на одно из допустимых значений.
+inline bool is_action_token(const std::string_view token, const WarningAction action)
+{
+ switch (action)
+ {
+ case WarningAction::Enable:
+ return iequals(token, "ENABLE");
+ case WarningAction::Disable:
+ return iequals(token, "DISABLE");
+ case WarningAction::Error:
+ return iequals(token, "ERROR");
+ }
+
+ return false;
+}
+
+// Возвращает имя действия.
+inline const char* action_name(const WarningAction action)
+{
+ switch (action)
+ {
+ case WarningAction::Enable:
+ return "ENABLE";
+ case WarningAction::Disable:
+ return "DISABLE";
+ case WarningAction::Error:
+ return "ERROR";
+ }
+
+ return "DISABLE";
+}
+
+// Проверяет, что токен содержит положительное десятичное число.
+inline bool parse_positive_integer(const std::string_view token, int& value)
+{
+ const std::string_view trimmed = trim_view(token);
+
+ if (trimmed.empty())
+ return false;
+
+ long long parsed = 0;
+
+ for (const char ch : trimmed)
+ {
+ if (!std::isdigit(static_cast<unsigned char>(ch)))
+ return false;
+
+ parsed = parsed * 10 + (ch - '0');
+ if (parsed > std::numeric_limits<int>::max())
+ return false;
+ }
+
+ if (parsed <= 0)
+ return false;
+
+ value = static_cast<int>(parsed);
+ return true;
+}
+
+// Формирует канонический десятичный текст числа без ведущих нулей.
+inline std::string format_positive_integer(const int value)
+{
+ return std::to_string(value);
+}
+
+// Собирает канонический вид числового списка.
+inline std::string format_numeric_list(const std::vector<int>& values)
+{
+ std::string output = "(";
+
+ for (size_t index = 0; index < values.size(); ++index)
+ {
+ if (index > 0)
+ output.push_back(',');
+
+ output += format_positive_integer(values[index]);
+ }
+
+ output.push_back(')');
+ return output;
+}
+
+// Парсит селектор предупреждения и заполняет его канонический вид.
+inline bool parse_warning_selector(const std::string_view selector_token,
+ WarningClause& clause)
+{
+ if (iequals(selector_token, "ALL"))
+ {
+ clause.selector_kind = WarningSelectorKind::All;
+ clause.selector_canonical = "ALL";
+ return true;
+ }
+
+ if (iequals(selector_token, "SEVERE"))
+ {
+ clause.selector_kind = WarningSelectorKind::Category;
+ clause.selector_canonical = "SEVERE";
+ return true;
+ }
+
+ if (iequals(selector_token, "INFORMATIONAL"))
+ {
+ clause.selector_kind = WarningSelectorKind::Category;
+ clause.selector_canonical = "INFORMATIONAL";
+ return true;
+ }
+
+ if (iequals(selector_token, "PERFORMANCE"))
+ {
+ clause.selector_kind = WarningSelectorKind::Category;
+ clause.selector_canonical = "PERFORMANCE";
+ return true;
+ }
+
+ if (!selector_token.empty() && selector_token.front() == '(' && selector_token.back() == ')')
+ {
+ const std::string_view body = trim_view(selector_token.substr(1, selector_token.size() - 2));
+
+ if (body.empty())
+ return false;
+
+ std::vector<int> numbers;
+ size_t item_begin = 0;
+
+ for (size_t pos = 0; pos <= body.size(); ++pos)
+ {
+ const bool at_end = (pos == body.size());
+
+ if (!at_end && body[pos] != ',')
+ continue;
+
+ const std::string_view item = trim_view(body.substr(item_begin, pos - item_begin));
+ int parsed_number = 0;
+
+ if (!parse_positive_integer(item, parsed_number))
+ return false;
+
+ numbers.push_back(parsed_number);
+ item_begin = pos + 1;
+ }
+
+ if (numbers.empty())
+ return false;
+
+ clause.selector_kind = WarningSelectorKind::NumberList;
+ clause.selector_canonical = format_numeric_list(numbers);
+ return true;
+ }
+
+ int parsed_number = 0;
+ if (!parse_positive_integer(selector_token, parsed_number))
+ return false;
+
+ clause.selector_kind = WarningSelectorKind::Number;
+ clause.selector_canonical = format_positive_integer(parsed_number);
+ return true;
+}
+
+// Формирует каноническую строку для одного клауза.
+inline std::string format_warning_clause(const WarningClause& clause)
+{
+ return std::string(action_name(clause.action)) + ':' + clause.selector_canonical;
+}
+
+// Проверяет, есть ли в строке хотя бы один ALL-клауз.
+constexpr int kCompilerShadowWarningNumber = 6002;
+constexpr const char* kCompilerShadowWarningCategory = "INFORMATIONAL";
+
+// Проверяет, что селектор затрагивает warning компилятора PL/pgSQL.
+inline bool warning_selector_matches_compiler_warning(const WarningClause& clause)
+{
+ switch (clause.selector_kind)
+ {
+ case WarningSelectorKind::All:
+ return true;
+ case WarningSelectorKind::Category:
+ return clause.selector_canonical == kCompilerShadowWarningCategory;
+ case WarningSelectorKind::Number:
+ return clause.selector_canonical == std::to_string(kCompilerShadowWarningNumber);
+ case WarningSelectorKind::NumberList:
+ {
+ const std::string needle = std::to_string(kCompilerShadowWarningNumber);
+ const std::string_view list = clause.selector_canonical;
+ size_t pos = list.find(needle);
+
+ while (pos != std::string::npos)
+ {
+ const bool left_boundary = (pos == 1) || list[pos - 1] == '(' || list[pos - 1] == ',';
+ const size_t right_pos = pos + needle.size();
+ const bool right_boundary =
+ (right_pos + 1 == list.size() && list[right_pos] == ')') ||
+ (right_pos < list.size() && list[right_pos] == ',');
+
+ if (left_boundary && right_boundary)
+ return true;
+
+ pos = list.find(needle, pos + 1);
+ }
+
+ return false;
+ }
+ }
+
+ return false;
+}
+
+// Возвращает режим компилятора для shadow-variable warning.
+inline WarningAction warning_state_compiler_action(const WarningState& state, bool& is_explicit)
+{
+ WarningAction action = WarningAction::Disable;
+ is_explicit = false;
+
+ for (const WarningClause& clause : state.clauses)
+ {
+ if (!warning_selector_matches_compiler_warning(clause))
+ continue;
+
+ is_explicit = true;
+ action = clause.action;
+ }
+
+ return action;
+}
+
+// Парсит строковое значение настройки предупреждений в локальное состояние.
+inline bool parse_warning_setting_string(const std::string_view input,
+ WarningState& state)
+{
+ const std::string_view normalized = trim_view(input);
+
+ if (normalized.empty())
+ return false;
+
+ WarningState parsed_state;
+ size_t clause_begin = 0;
+ int parentheses_depth = 0;
+
+ for (size_t pos = 0; pos < normalized.size(); ++pos)
+ {
+ const char ch = normalized[pos];
+
+ if (ch == '(')
+ {
+ ++parentheses_depth;
+ continue;
+ }
+
+ if (ch == ')')
+ {
+ if (parentheses_depth == 0)
+ return false;
+
+ --parentheses_depth;
+ continue;
+ }
+
+ if (ch != ',' || parentheses_depth != 0)
+ continue;
+
+ const std::string_view clause_token = trim_view(normalized.substr(clause_begin, pos - clause_begin));
+
+ if (clause_token.empty())
+ return false;
+
+ const size_t colon_pos = clause_token.find(':');
+ if (colon_pos == std::string_view::npos)
+ return false;
+
+ if (clause_token.find(':', colon_pos + 1) != std::string_view::npos)
+ return false;
+
+ const std::string_view action_token = trim_view(clause_token.substr(0, colon_pos));
+ const std::string_view selector_token = trim_view(clause_token.substr(colon_pos + 1));
+
+ if (action_token.empty() || selector_token.empty())
+ return false;
+
+ WarningClause clause;
+ if (is_action_token(action_token, WarningAction::Enable))
+ clause.action = WarningAction::Enable;
+ else if (is_action_token(action_token, WarningAction::Disable))
+ clause.action = WarningAction::Disable;
+ else if (is_action_token(action_token, WarningAction::Error))
+ clause.action = WarningAction::Error;
+ else
+ return false;
+
+ if (!parse_warning_selector(selector_token, clause))
+ return false;
+
+ parsed_state.clauses.push_back(std::move(clause));
+ clause_begin = pos + 1;
+ }
+
+ if (parentheses_depth != 0)
+ return false;
+
+ const std::string_view clause_token = trim_view(normalized.substr(clause_begin));
+
+ if (clause_token.empty())
+ return false;
+
+ const size_t colon_pos = clause_token.find(':');
+ if (colon_pos == std::string_view::npos)
+ return false;
+
+ if (clause_token.find(':', colon_pos + 1) != std::string_view::npos)
+ return false;
+
+ const std::string_view action_token = trim_view(clause_token.substr(0, colon_pos));
+ const std::string_view selector_token = trim_view(clause_token.substr(colon_pos + 1));
+
+ if (action_token.empty() || selector_token.empty())
+ return false;
+
+ WarningClause clause;
+ if (is_action_token(action_token, WarningAction::Enable))
+ clause.action = WarningAction::Enable;
+ else if (is_action_token(action_token, WarningAction::Disable))
+ clause.action = WarningAction::Disable;
+ else if (is_action_token(action_token, WarningAction::Error))
+ clause.action = WarningAction::Error;
+ else
+ return false;
+
+ if (!parse_warning_selector(selector_token, clause))
+ return false;
+
+ parsed_state.clauses.push_back(std::move(clause));
+ state = std::move(parsed_state);
+ return true;
+}
+
+// Формирует каноническое строковое представление текущего состояния.
+inline std::string format_warning_setting_string(const WarningState& state)
+{
+ if (state.clauses.empty())
+ return "DISABLE:ALL";
+
+ std::string output;
+
+ for (size_t index = 0; index < state.clauses.size(); ++index)
+ {
+ if (index > 0)
+ output.push_back(',');
+
+ output += format_warning_clause(state.clauses[index]);
+ }
+
+ return output;
+}
+
+inline std::string normalize_warning_setting(const std::string_view input)
+{
+ WarningState parsed_state;
+ if (!parse_warning_setting_string(input, parsed_state))
+ dbms_warning_errors::raise_ora_39950();
+
+ return format_warning_setting_string(parsed_state);
+}
+
+// Сессионный источник истины для PLSQL_WARNINGS.
+static WarningState s_warning_setting_state = WarningState{};
+} // namespace
+
+/*
+ * Строковая реализация DBMS_WARNING.
+ *
+ * Здесь держим сессионный источник истины для PLSQL_WARNINGS и
+ * предоставляем helper для хука компилятора.
+ */
+
+extern "C"
+{
+// Добавляет настройку предупреждений в сессионное состояние.
+Datum dbms_warning_add_warning_setting_cat(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_VOID();
+}
+
+// Добавляет настройку предупреждений по числу.
+Datum dbms_warning_add_warning_setting_num(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_VOID();
+}
+
+// Возвращает категорию предупреждения.
+Datum dbms_warning_get_category(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_NULL();
+}
+
+// Возвращает настройку предупреждений по категории.
+Datum dbms_warning_get_warning_setting_cat(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_NULL();
+}
+
+// Возвращает настройку предупреждений по числу.
+Datum dbms_warning_get_warning_setting_num(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_NULL();
+}
+
+// Возвращает текущее сессионное строковое значение PLSQL_WARNINGS.
+Datum dbms_warning_get_warning_setting_string(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(format_warning_setting_string(s_warning_setting_state).c_str()));
+}
+
+Datum dbms_warning_normalize_setting(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0))
+ PG_RETURN_NULL();
+
+ const std::string value = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ PG_RETURN_TEXT_P(cstring_to_text(normalize_warning_setting(value).c_str()));
+}
+
+// Записывает текущее сессионное строковое значение PLSQL_WARNINGS.
+Datum dbms_warning_set_warning_setting_string(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0))
+ dbms_warning_errors::raise_ora_01405();
+
+ if (PG_ARGISNULL(1))
+ dbms_warning_errors::raise_ora_01405();
+
+ const std::string value = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ const std::string scope = text_to_cstring(PG_GETARG_TEXT_PP(1));
+
+ if (iequals(scope, "SYSTEM"))
+ dbms_warning_errors::raise_ora_01031();
+
+ if (!iequals(scope, "SESSION"))
+ dbms_warning_errors::raise_ora_39960();
+
+ WarningState parsed_state = s_warning_setting_state;
+ const Datum normalized_datum =
+ DirectFunctionCall1(dbms_warning_normalize_setting,
+ PG_GETARG_DATUM(0));
+ const std::string normalized =
+ text_to_cstring(DatumGetTextPP(normalized_datum));
+ parse_warning_setting_string(normalized, parsed_state);
+ s_warning_setting_state = std::move(parsed_state);
+ PG_RETURN_VOID();
+}
+
+DBMSWarningCompilerMode dbms_warning_get_compiler_warning_mode(bool* is_explicit)
+{
+ bool local_is_explicit = false;
+ const WarningAction action = warning_state_compiler_action(s_warning_setting_state, local_is_explicit);
+
+ if (is_explicit != nullptr)
+ *is_explicit = local_is_explicit;
+
+ switch (action)
+ {
+ case WarningAction::Enable:
+ return DBMS_WARNING_COMPILER_MODE_ENABLE;
+ case WarningAction::Disable:
+ return DBMS_WARNING_COMPILER_MODE_DISABLE;
+ case WarningAction::Error:
+ return DBMS_WARNING_COMPILER_MODE_ERROR;
+ }
+
+ return DBMS_WARNING_COMPILER_MODE_DISABLE;
+}
+
+Datum dbms_warning_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_DBMS_WARNING_VERSION));
+}
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_warning/dbms_warning.hpp b/src/backend/utils/dbms/dbms_warning/dbms_warning.hpp
new file mode 100644
index 0000000..11d66a5
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_warning/dbms_warning.hpp
@@ -0,0 +1,155 @@
+#ifndef DBMS_WARNING_INTERNAL_HPP
+#define DBMS_WARNING_INTERNAL_HPP
+
+/*
+ * DBMS_WARNING
+ *
+ * Назначение:
+ * Пакет хранит сессионную настройку PLSQL_WARNINGS и даёт компилятору
+ * доступ к вычисленному действию для warning-ов, управляемых DBMS_WARNING.
+ *
+ * Важно:
+ * SQL-visible объявления должны оставаться согласованы с pg_proc.dat и
+ * system_functions.sql.
+ */
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+} // extern "C"
+
+extern "C"
+{
+/**
+ * @brief Добавляет настройку предупреждения по категории.
+ * @details Устанавливает настройку предупреждений для указанной категории
+ * в пределах session scope.
+ * Примеры:
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_CAT('PERFORMANCE', 'ENABLE', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_CAT('SEVERE', 'ERROR', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_CAT('INFORMATIONAL', 'DISABLE', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_CAT('PERFORMANCE', 'ENABLE', 'SESSION'),
+ * DBMS_WARNING.GET_WARNING_SETTING_CAT('PERFORMANCE') FROM dual;
+ * @param warning_category Категория предупреждения.
+ * @param warning_value Значение настройки, например `ENABLE`, `DISABLE` или `ERROR`.
+ * @param scope Область применения настройки.
+ * @return `void`.
+ */
+Datum dbms_warning_add_warning_setting_cat(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Добавляет настройку предупреждения по номеру.
+ * @details Устанавливает настройку предупреждений для указанного номера
+ * warning-а в пределах session scope.
+ * Примеры:
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_NUM(1001, 'ERROR', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_NUM(6002, 'ENABLE', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_NUM(6003, 'DISABLE', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.ADD_WARNING_SETTING_NUM(6002, 'ENABLE', 'SESSION'),
+ * DBMS_WARNING.GET_WARNING_SETTING_NUM(6002) FROM dual;
+ * @param warning_number Номер предупреждения.
+ * @param warning_value Значение настройки, например `ENABLE`, `DISABLE` или `ERROR`.
+ * @param scope Область применения настройки.
+ * @return `void`.
+ */
+Datum dbms_warning_add_warning_setting_num(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает категорию по номеру предупреждения.
+ * @details Возвращает Oracle-совместимую категорию для указанного номера
+ * warning-а.
+ * Примеры:
+ * SELECT DBMS_WARNING.GET_CATEGORY(1001) FROM dual;
+ * SELECT DBMS_WARNING.GET_CATEGORY(6002) FROM dual;
+ * SELECT DBMS_WARNING.GET_CATEGORY(6003) FROM dual;
+ * SELECT DBMS_WARNING.GET_CATEGORY(1001),
+ * DBMS_WARNING.GET_WARNING_SETTING_NUM(1001) FROM dual;
+ * @param warning_number Номер предупреждения.
+ * @return Строковое значение категории.
+ */
+Datum dbms_warning_get_category(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает настройку предупреждения по категории.
+ * @details Возвращает строковое представление настройки для указанной
+ * категории warning-а.
+ * Примеры:
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_CAT('PERFORMANCE') FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_CAT('SEVERE') FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_CAT('INFORMATIONAL') FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_CAT('PERFORMANCE'),
+ * DBMS_WARNING.GET_WARNING_SETTING_STRING() FROM dual;
+ * @param warning_category Категория предупреждения.
+ * @return Строковое значение настройки предупреждений.
+ */
+Datum dbms_warning_get_warning_setting_cat(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает настройку предупреждения по номеру.
+ * @details Возвращает строковое представление настройки для указанного
+ * номера warning-а.
+ * Примеры:
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_NUM(1001) FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_NUM(6002) FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_NUM(6003) FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_NUM(1001),
+ * DBMS_WARNING.GET_CATEGORY(1001) FROM dual;
+ * @param warning_number Номер предупреждения.
+ * @return Строковое значение настройки предупреждений.
+ */
+Datum dbms_warning_get_warning_setting_num(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает строковое представление текущей настройки предупреждений.
+ * @details Возвращает каноническую строку текущего session state.
+ * Примеры:
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_STRING() FROM dual;
+ * SELECT DBMS_WARNING.SET_WARNING_SETTING_STRING('ENABLE:ALL', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_STRING() FROM dual;
+ * SELECT DBMS_WARNING.GET_WARNING_SETTING_STRING(),
+ * DBMS_WARNING.GET_WARNING_SETTING_CAT('PERFORMANCE') FROM dual;
+ * @return Каноническая строка `PLSQL_WARNINGS`.
+ */
+Datum dbms_warning_get_warning_setting_string(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Нормализует строковое представление настройки предупреждений.
+ * @details Возвращает канонический вид строки `PLSQL_WARNINGS`, который
+ * используется пакетом в session scope.
+ * Примеры:
+ * SELECT DBMS_WARNING.NORMALIZE_SETTING('enable:all') FROM dual;
+ * SELECT DBMS_WARNING.NORMALIZE_SETTING(' Enable : ( 06002 , 06003 ) ') FROM dual;
+ * SELECT DBMS_WARNING.NORMALIZE_SETTING('DISABLE:PERFORMANCE') FROM dual;
+ * @param setting Строковое представление настройки предупреждений.
+ * @return Каноническая строка настройки.
+ */
+Datum dbms_warning_normalize_setting(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Устанавливает строковое представление текущей настройки предупреждений.
+ * @details Разбирает строку `PLSQL_WARNINGS` и сохраняет её в session state.
+ * Примеры:
+ * SELECT DBMS_WARNING.SET_WARNING_SETTING_STRING('ENABLE:ALL', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.SET_WARNING_SETTING_STRING('DISABLE:ALL', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.SET_WARNING_SETTING_STRING('ENABLE:ALL,DISABLE:PERFORMANCE', 'SESSION') FROM dual;
+ * SELECT DBMS_WARNING.SET_WARNING_SETTING_STRING('ENABLE:ALL', 'SESSION'),
+ * DBMS_WARNING.GET_WARNING_SETTING_STRING() FROM dual;
+ * @param value Oracle-like строка настройки предупреждений.
+ * @param scope Область применения настройки.
+ * @return `void`.
+ */
+Datum dbms_warning_set_warning_setting_string(PG_FUNCTION_ARGS);
+
+/**
+ * @brief Возвращает версию пакета DBMS_WARNING.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT DBMS_WARNING.GET_VERSION() FROM dual;
+ * SELECT dbms_warning_get_version();
+ * @return Текст версии пакета.
+ */
+Datum dbms_warning_get_version(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_WARNING_INTERNAL_HPP
diff --git a/src/backend/utils/dbms/dbms_warning/dbms_warning_errors.cpp b/src/backend/utils/dbms/dbms_warning/dbms_warning_errors.cpp
new file mode 100644
index 0000000..2b6dc9a
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_warning/dbms_warning_errors.cpp
@@ -0,0 +1,38 @@
+#include "dbms_warning.hpp"
+#include "dbms_warning_errors.hpp"
+
+extern "C"
+{
+#include "utils/elog.h"
+} // extern "C"
+
+namespace dbms_warning_errors
+{
+void raise_ora_01031()
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+ errmsg("ORA-01031: insufficient privileges")));
+}
+
+void raise_ora_01405()
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-01405: the fetched column returned a NULL value")));
+}
+
+void raise_ora_39950()
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-39950: invalid parameter for PLSQL warnings flag")));
+}
+
+void raise_ora_39960()
+{
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-39960: scope can only be SYSTEM or SESSION")));
+}
+} // namespace dbms_warning_errors
diff --git a/src/backend/utils/dbms/dbms_warning/dbms_warning_errors.hpp b/src/backend/utils/dbms/dbms_warning/dbms_warning_errors.hpp
new file mode 100644
index 0000000..de92a87
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_warning/dbms_warning_errors.hpp
@@ -0,0 +1,20 @@
+#ifndef DBMS_WARNING_ERRORS_HPP
+#define DBMS_WARNING_ERRORS_HPP
+
+/*
+ * Локальные Oracle-ошибки для текущей реализации DBMS_WARNING.
+ *
+ * Здесь объявлены только ошибки, которые используются string API и
+ * compiler integration. Новые ошибки добавлять вместе с конкретным API,
+ * который их использует.
+ */
+
+namespace dbms_warning_errors
+{
+void raise_ora_01031();
+void raise_ora_01405();
+void raise_ora_39950();
+void raise_ora_39960();
+} // namespace dbms_warning_errors
+
+#endif // DBMS_WARNING_ERRORS_HPP
diff --git a/src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.cpp b/src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.cpp
new file mode 100644
index 0000000..78d01f6
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.cpp
@@ -0,0 +1,1176 @@
+#include "dbms_xmlsave.hpp"
+
+#include <algorithm>
+#include <cctype>
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include <libxml/parser.h>
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/lsyscache.h"
+}
+
+static void uppercase(std::string &str) noexcept
+{
+ std::transform(str.begin(), str.end(), str.begin(),
+ [](unsigned char c) { return std::toupper(c); });
+}
+
+static xmlNodePtr find_node_by_name(xmlNodePtr node, const std::string &name) noexcept
+{
+ for (xmlNodePtr c = node->children; c != nullptr; c = c->next)
+ {
+ if (xmlStrcasecmp(c->name,
+ reinterpret_cast<const xmlChar*>(name.c_str())) == 0)
+ {
+ return c;
+ }
+ }
+ return nullptr;
+}
+
+static Datum string_to_value(char *str, Oid oid) noexcept
+{
+ Oid target_func;
+ Oid typ_io_param;
+ getTypeInputInfo(oid, &target_func, &typ_io_param);
+ return OidInputFunctionCall(target_func, str, typ_io_param, -1);
+}
+
+struct xmlsave_context
+{
+ std::string target_table;
+ std::unordered_map<std::string, Oid> all_columns;
+ std::vector<std::string> key_columns;
+ std::vector<std::string> update_columns;
+ std::string row_tag;
+
+ xmlsave_context(std::string table) noexcept: target_table(table), row_tag("ROW") {
+ SPI_connect();
+
+ std::string columns_query = "SELECT * FROM ";
+ columns_query.append(this->target_table);
+ columns_query.push_back(';');
+
+ // if we put zero, it would fetch all the rows
+ SPI_execute(columns_query.c_str(), false, 1);
+
+ for (int i = 0; i < SPI_tuptable->tupdesc->natts; i++)
+ {
+ auto attr = TupleDescAttr(SPI_tuptable->tupdesc, i);
+ std::string col_name = attr->attname.data;
+ Oid col_oid = attr->atttypid;
+
+ uppercase(col_name);
+
+ this->all_columns[col_name] = col_oid;
+ }
+
+ SPI_finish();
+ }
+
+ ~xmlsave_context() = default;
+
+ ssize_t update_xml(std::string &xml) noexcept;
+ ssize_t insert_xml(std::string &xml) noexcept;
+ ssize_t delete_xml(std::string &xml) noexcept;
+};
+
+ssize_t xmlsave_context::update_xml(std::string &xml) noexcept
+{
+ SPI_connect();
+
+ /* 1. Parse the xml */
+ xmlDocPtr document = xmlParseDoc(
+ reinterpret_cast<const xmlChar*>(xml.c_str()));
+ xmlNodePtr root;
+
+ if (document == nullptr)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to parse xml")));
+ SPI_finish();
+ return -1;
+ }
+
+ root = xmlDocGetRootElement(document);
+
+ ssize_t total_rows = 0;
+
+ /* 2. For each ROW, make an update query */
+ for (xmlNodePtr row = root->children; row != nullptr; row = row->next)
+ {
+ if (xmlStrcasecmp(
+ row->name,
+ reinterpret_cast<const xmlChar*>(this->row_tag.c_str())
+ ) != 0)
+ {
+ continue;
+ }
+
+ std::string query = "UPDATE ";
+ std::vector<Datum> values;
+ std::vector<Oid> oids;
+ std::vector<char> nulls;
+
+ query.append(this->target_table);
+ query.append(" SET ");
+
+ int i = 1;
+
+ if (this->update_columns.empty())
+ {
+ /* Send all the columns */
+ for (xmlNodePtr entry = row->children; entry != nullptr;
+ entry = entry->next)
+ {
+ std::string name = reinterpret_cast<const char*>(entry->name);
+
+ query.append(name);
+ query.append("=$");
+ query.append(std::to_string(i));
+ query.append(", ");
+
+ Oid oid;
+ auto col_it = this->all_columns.find(name);
+ if (col_it == this->all_columns.end())
+ {
+ oid = InvalidOid;
+ }
+ else
+ {
+ oid = col_it->second;
+ }
+
+ xmlAttrPtr attr = entry->properties;
+ if (xmlStrcmp(attr->name,
+ reinterpret_cast<const xmlChar*>("NULL")) == 0
+ || xmlStrcmp(xmlNodeGetContent(
+ reinterpret_cast<xmlNodePtr>(attr)
+ ), reinterpret_cast<const xmlChar*>("Y")) == 0)
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(oid);
+ nulls.push_back('n');
+ }
+ else
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value;
+ if (oid == InvalidOid)
+ {
+ value = static_cast<Datum>(0);
+ }
+ else
+ {
+ value = string_to_value(str, oid);
+ }
+ values.push_back(value);
+ oids.push_back(oid);
+ nulls.push_back(' ');
+ }
+ i++;
+ }
+ }
+ else
+ {
+ for (std::string &column_name: this->update_columns)
+ {
+ query.append(reinterpret_cast<const char*>(column_name.c_str()));
+ query.append("=$");
+ query.append(std::to_string(i));
+ query.append(", ");
+ i++;
+
+ Oid oid;
+ auto col_it = this->all_columns.find(column_name);
+ if (col_it == this->all_columns.end())
+ {
+ oid = InvalidOid;
+ }
+ else
+ {
+ oid = col_it->second;
+ }
+
+ xmlNodePtr entry = find_node_by_name(row, column_name);
+ if (entry == nullptr)
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(oid);
+ nulls.push_back('n');
+ continue;
+ }
+
+ xmlAttrPtr attr = entry->properties;
+ if (attr != nullptr && xmlStrcmp(attr->name,
+ reinterpret_cast<const xmlChar*>("NULL")) == 0
+ && xmlStrcmp(xmlNodeGetContent(
+ reinterpret_cast<xmlNodePtr>(attr)
+ ), reinterpret_cast<const xmlChar*>("Y")) == 0)
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(oid);
+ nulls.push_back('n');
+ }
+ else
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value;
+ if (oid == InvalidOid)
+ {
+ value = static_cast<Datum>(0);
+ }
+ else
+ {
+ value = string_to_value(str, oid);
+ }
+ values.push_back(value);
+ oids.push_back(oid);
+ nulls.push_back(' ');
+ }
+ }
+ }
+
+ /* One extra comma */
+ query.pop_back();
+ query.pop_back();
+ bool first = true;
+ bool missing_keys = false;
+
+ /* Add row qualifiers */
+ query.append(" WHERE ");
+ for (std::string &column_name: this->key_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, column_name);
+ if (entry == nullptr)
+ {
+ missing_keys = true;
+ break;
+ }
+
+ Oid oid = this->all_columns[column_name];
+
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ query.append(" AND ");
+ }
+
+ query.append(column_name);
+ query.append("=$");
+ query.append(std::to_string(i));
+ i++;
+
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, oid);
+ values.push_back(value);
+ oids.push_back(oid);
+ nulls.push_back(' ');
+ }
+ if (missing_keys)
+ {
+ continue;
+ }
+ query.append(" RETURNING *;");
+
+ /* Query is ready */
+ ereport(
+ DEBUG1,
+ errmsg_internal("dbms_xmlsave_updatexml: query: %s",
+ query.c_str())
+ );
+
+ int ret = SPI_execute_with_args(query.c_str(), values.size(), oids.data(),
+ values.data(), nulls.data(), false, 0);
+
+ if (ret < 0)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI query failed")));
+ xmlFree(document);
+ SPI_finish();
+ return -1;
+ }
+
+ total_rows += SPI_processed;
+ }
+
+ xmlFree(document);
+ SPI_finish();
+ return total_rows;
+}
+
+ssize_t xmlsave_context::insert_xml(std::string &xml) noexcept
+{
+ SPI_connect();
+
+ /* 1. Parse the xml */
+ xmlDocPtr document = xmlParseDoc(
+ reinterpret_cast<const xmlChar*>(xml.c_str()));
+ xmlNodePtr root;
+
+ if (document == nullptr)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to parse xml")));
+ SPI_finish();
+ return -1;
+ }
+
+ root = xmlDocGetRootElement(document);
+
+ ssize_t total_rows = 0;
+
+ for (xmlNodePtr row = root->children; row != nullptr; row = row->next) {
+ if (xmlStrcasecmp(
+ row->name,
+ reinterpret_cast<const xmlChar *>(this->row_tag.c_str())
+ ) != 0)
+ {
+ continue;
+ }
+
+ std::string query_columns_part = "INSERT INTO ";
+ query_columns_part.append(this->target_table);
+ query_columns_part.append(" (");
+
+ std::string query_values_part = " VALUES (";
+
+ std::vector<Datum> values;
+ std::vector<Oid> oids;
+ std::vector<char> nulls;
+
+ int i = 1;
+ if (this->update_columns.empty())
+ {
+ for (auto &col_name: this->all_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, col_name.first);
+ if (entry != nullptr)
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, col_name.second);
+
+ query_columns_part.append(col_name.first);
+ query_columns_part.append(", ");
+
+ query_values_part.push_back('$');
+ query_values_part.append(std::to_string(i));
+ query_values_part.append(", ");
+
+ values.push_back(value);
+ oids.push_back(col_name.second);
+ nulls.push_back(' ');
+ i++;
+ }
+ }
+ if (i == 1)
+ {
+ /* We are not inserting any columns, hence XML is malformed */
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("XML document is malformed")));
+ }
+ }
+ else
+ {
+ for (std::string &col_name: this->update_columns)
+ {
+ query_columns_part.append(col_name);
+ query_columns_part.append(", ");
+
+ query_values_part.push_back('$');
+ query_values_part.append(std::to_string(i));
+ query_values_part.append(", ");
+
+ i++;
+
+ xmlNodePtr entry = find_node_by_name(row, col_name);
+ if (entry != nullptr)
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, this->all_columns[col_name]);
+
+ values.push_back(value);
+ oids.push_back(this->all_columns[col_name]);
+ nulls.push_back(' ');
+ }
+ else
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(this->all_columns[col_name]);
+ nulls.push_back('n');
+ }
+ }
+ }
+
+ /* We've got extra commas */
+ query_columns_part.pop_back();
+ query_columns_part.pop_back();
+ query_columns_part.push_back(')');
+
+ query_values_part.pop_back();
+ query_values_part.pop_back();
+ query_values_part.append(");");
+
+ std::string query = query_columns_part + query_values_part;
+
+ SPI_execute_with_args(query.c_str(), values.size(), oids.data(),
+ values.data(), nulls.data(), false, 0);
+
+ total_rows += SPI_processed;
+ }
+
+ xmlFree(document);
+ SPI_finish();
+ return total_rows;
+}
+
+ssize_t xmlsave_context::delete_xml(std::string &xml) noexcept
+{
+ SPI_connect();
+
+ /* 1. Parse the xml */
+ xmlDocPtr document = xmlParseDoc(
+ reinterpret_cast<const xmlChar*>(xml.c_str()));
+ xmlNodePtr root;
+
+ if (document == nullptr)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to parse xml")));
+ SPI_finish();
+ return -1;
+ }
+
+ root = xmlDocGetRootElement(document);
+
+ ssize_t total_rows = 0;
+
+ for (xmlNodePtr row = root->children; row != nullptr; row = row->next) {
+ if (xmlStrcasecmp(
+ row->name,
+ reinterpret_cast<const xmlChar *>(this->row_tag.c_str())
+ ) != 0)
+ {
+ continue;
+ }
+
+ std::string query = "DELETE FROM ";
+ query.append(this->target_table);
+ query.append(" WHERE ");
+
+ std::vector<Datum> values;
+ std::vector<Oid> oids;
+
+ bool first = true;
+
+ int i = 1;
+ if (this->key_columns.empty())
+ {
+ for (auto &col_name: this->all_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, col_name.first);
+ if (entry != nullptr)
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, col_name.second);
+
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ query.append(" AND ");
+ }
+
+ query.append(col_name.first);
+ query.append("=$");
+ query.append(std::to_string(i));
+
+ values.push_back(value);
+ oids.push_back(col_name.second);
+ i++;
+ }
+ }
+ if (i == 1)
+ {
+ /* We are not inserting any columns, hence XML is malformed */
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("XML document is malformed")));
+ }
+ }
+ else
+ {
+ for (std::string &col_name: this->key_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, col_name);
+ if (entry == nullptr)
+ {
+ continue;
+ }
+
+ query.append(col_name);
+ query.append("=$");
+ query.append(std::to_string(i));
+
+ i++;
+
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, this->all_columns[col_name]);
+
+ values.push_back(value);
+ oids.push_back(this->all_columns[col_name]);
+ }
+ }
+
+ query.append(";");
+
+ SPI_execute_with_args(query.c_str(), values.size(), oids.data(),
+ values.data(), nullptr, false, 0);
+
+ total_rows += SPI_processed;
+ }
+
+ xmlFree(document);
+ SPI_finish();
+ return total_rows;
+}
+
+static int32_t next_handle = 0;
+static std::unordered_map<int32_t, xmlsave_context> contexts;
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(dbms_xmlsave_clearkeycolumnlist);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_clearupdatecolumnlist);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_closecontext);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_closecontext2);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_deletexml_ovr1);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_deletexml_ovr2);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_getexceptioncontent);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_insertxml);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_newcontext);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_propagateoriginalexception);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_p_propagateoriginalexception);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_p_setpreservewhitespace);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_p_setsqltoxmlnameesc);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_p_setxslt_ovr1);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_p_setxslt_ovr2);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_p_usedbdates);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_removexsltparam);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setbatchsize);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setcommitbatch);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setdateformat);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setignorecase);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setkeycolumn);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setpreservewhitespace);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setrowtag);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setsqltoxmlnameescaping);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setupdatecolumn);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setxslt_ovr1);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setxslt_ovr2);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_setxsltparam);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_updatexml);
+PG_FUNCTION_INFO_V1(dbms_xmlsave_usedbdates);
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_clearkeycolumnlist(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.clearkeycolumnlist еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_clearupdatecolumnlist(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.clearupdatecolumnlist еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_closecontext(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it != contexts.end())
+ {
+ contexts.erase(ctx_it);
+ }
+ PG_RETURN_VOID();
+}
+
+Datum dbms_xmlsave_closecontext2(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_ARGISNULL(0) ? 0 : PG_GETARG_INT32(0);
+ int32_t serviceArg = PG_ARGISNULL(1) ? 0 : PG_GETARG_INT32(1);
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 1);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 1, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = Int32GetDatum(handle);
+ fcinfo2->args[0].isnull = PG_ARGISNULL(0);
+
+ (void) dbms_xmlsave_closecontext(fcinfo2);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param XDOC (in) VARCHAR2: TODO: Описание параметра XDOC
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_deletexml_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.deletexml еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param XDOC (in) CLOB: TODO: Описание параметра XDOC
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_deletexml_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.deletexml еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * * @param ERRNO (out) NUMBER: TODO: Описание параметра ERRNO (Возвращается через результат)
+ * * @param ERRMSG (out) VARCHAR2: TODO: Описание параметра ERRMSG (Возвращается через результат)
+ * * * * @return record: Композитный тип (number varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_getexceptioncontent(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.getexceptioncontent еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param XDOC (in) VARCHAR2: TODO: Описание параметра XDOC
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_insertxml(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *xml_packed = PG_GETARG_TEXT_P(1);
+ text *xml_txt = pg_detoast_datum_packed(xml_packed);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.insert_xml(xml);
+
+ if (xml_txt != xml_packed)
+ {
+ pfree(xml_txt);
+ }
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param TARGETTABLE (in) VARCHAR2: TODO: Описание параметра TARGETTABLE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_newcontext(PG_FUNCTION_ARGS)
+{
+ text *target_table_packed = PG_GETARG_TEXT_P(0);
+ text *target_table_txt = pg_detoast_datum_packed(target_table_packed);
+ std::string target_table;
+ target_table.resize(VARSIZE_ANY_EXHDR(target_table_txt));
+ memcpy(target_table.data(), VARDATA_ANY(target_table_txt),
+ target_table.size());
+
+ if (target_table_txt != target_table_packed)
+ {
+ pfree(target_table_txt);
+ }
+
+ contexts.emplace(next_handle, target_table);
+ PG_RETURN_INT32(next_handle++);
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) BOOLEAN: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_propagateoriginalexception(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.propagateoriginalexception еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) NUMBER: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_p_propagateoriginalexception(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.p_propagateoriginalexception еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) NUMBER: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_p_setpreservewhitespace(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.p_setpreservewhitespace еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) NUMBER: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_p_setsqltoxmlnameesc(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.p_setsqltoxmlnameesc еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param URI (in) VARCHAR2: TODO: Описание параметра URI
+ * * @param REF (in) VARCHAR2: TODO: Описание параметра REF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_p_setxslt_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.p_setxslt еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param STYLESHEET (in) CLOB: TODO: Описание параметра STYLESHEET
+ * * @param REF (in) VARCHAR2: TODO: Описание параметра REF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_p_setxslt_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.p_setxslt еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) NUMBER: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_p_usedbdates(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.p_usedbdates еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param NAME (in) VARCHAR2: TODO: Описание параметра NAME
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_removexsltparam(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.removexsltparam еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param BATCHSIZE (in) NUMBER: TODO: Описание параметра BATCHSIZE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setbatchsize(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setbatchsize еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param BATCHSIZE (in) NUMBER: TODO: Описание параметра BATCHSIZE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setcommitbatch(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setcommitbatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param MASK (in) VARCHAR2: TODO: Описание параметра MASK
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setdateformat(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setdateformat еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) NUMBER: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setignorecase(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setignorecase еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param COLNAME (in) VARCHAR2: TODO: Описание параметра COLNAME
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setkeycolumn(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setkeycolumn еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) BOOLEAN: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setpreservewhitespace(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setpreservewhitespace еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param TAG (in) VARCHAR2: TODO: Описание параметра TAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setrowtag(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setrowtag еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) BOOLEAN: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setsqltoxmlnameescaping(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setsqltoxmlnameescaping еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param COLNAME (in) VARCHAR2: TODO: Описание параметра COLNAME
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setupdatecolumn(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setupdatecolumn еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param URI (in) VARCHAR2: TODO: Описание параметра URI
+ * * @param REF (in) VARCHAR2: TODO: Описание параметра REF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setxslt_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setxslt еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param STYLESHEET (in) CLOB: TODO: Описание параметра STYLESHEET
+ * * @param REF (in) VARCHAR2: TODO: Описание параметра REF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setxslt_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setxslt еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param NAME (in) VARCHAR2: TODO: Описание параметра NAME
+ * * @param VALUE (in) VARCHAR2: TODO: Описание параметра VALUE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_setxsltparam(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.setxsltparam еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param XDOC (in) VARCHAR2: TODO: Описание параметра XDOC
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_updatexml(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *xml_packed = PG_GETARG_TEXT_P(1);
+ text *xml_txt = pg_detoast_datum_packed(xml_packed);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.update_xml(xml);
+
+ if (xml_txt != xml_packed)
+ {
+ pfree(xml_txt);
+ }
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: TODO: Описание параметра CTXHDL
+ * * @param FLAG (in) BOOLEAN: TODO: Описание параметра FLAG
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSAVE.html
+ */
+Datum dbms_xmlsave_usedbdates(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlsave.usedbdates еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.hpp b/src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.hpp
new file mode 100644
index 0000000..368bc43
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_xmlsave/dbms_xmlsave.hpp
@@ -0,0 +1,53 @@
+#ifndef DBMS_XMLSAVE_INTERNAL_HPP
+#define DBMS_XMLSAVE_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+} // extern "C"
+
+extern "C"
+{
+Datum dbms_xmlsave_clearkeycolumnlist(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_clearupdatecolumnlist(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_closecontext(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_closecontext2(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_deletexml_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_deletexml_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_getexceptioncontent(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_insertxml(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_newcontext(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_propagateoriginalexception(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_p_propagateoriginalexception(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_p_setpreservewhitespace(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_p_setsqltoxmlnameesc(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_p_setxslt_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_p_setxslt_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_p_usedbdates(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_removexsltparam(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setbatchsize(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setcommitbatch(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setdateformat(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setignorecase(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setkeycolumn(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setpreservewhitespace(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setrowtag(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setsqltoxmlnameescaping(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setupdatecolumn(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setxslt_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setxslt_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_setxsltparam(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_updatexml(PG_FUNCTION_ARGS);
+Datum dbms_xmlsave_usedbdates(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_XMLSAVE_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.cpp b/src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.cpp
new file mode 100644
index 0000000..f0bc186
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.cpp
@@ -0,0 +1,1088 @@
+#include "dbms_xmlstore.hpp"
+
+#include <algorithm>
+#include <cctype>
+#include <stdexcept>
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include <libxml/parser.h>
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/lsyscache.h"
+#include "utils/xml.h"
+}
+
+static void uppercase(std::string &str) noexcept
+{
+ std::transform(str.begin(), str.end(), str.begin(),
+ [](unsigned char c) { return std::toupper(c); });
+}
+
+static xmlNodePtr find_node_by_name(xmlNodePtr node, const std::string &name) noexcept
+{
+ for (xmlNodePtr c = node->children; c != nullptr; c = c->next)
+ {
+ if (xmlStrcasecmp(c->name,
+ reinterpret_cast<const xmlChar*>(name.c_str())) == 0)
+ {
+ return c;
+ }
+ }
+ return nullptr;
+}
+
+static Datum string_to_value(char *str, Oid oid) noexcept
+{
+ Oid target_func;
+ Oid typ_io_param;
+ getTypeInputInfo(oid, &target_func, &typ_io_param);
+ return OidInputFunctionCall(target_func, str, typ_io_param, -1);
+}
+
+struct xmlstore_context
+{
+ std::string target_table;
+ std::unordered_map<std::string, Oid> all_columns;
+ std::vector<std::string> key_columns;
+ std::vector<std::string> update_columns;
+ std::string row_tag;
+
+ xmlstore_context(std::string table) noexcept: target_table(table), row_tag("ROW") {
+ SPI_connect();
+
+ std::string columns_query = "SELECT * FROM ";
+ columns_query.append(this->target_table);
+ columns_query.push_back(';');
+
+ // if we put zero, it would fetch all the rows
+ SPI_execute(columns_query.c_str(), false, 1);
+
+ for (int i = 0; i < SPI_tuptable->tupdesc->natts; i++)
+ {
+ auto attr = TupleDescAttr(SPI_tuptable->tupdesc, i);
+ std::string col_name = attr->attname.data;
+ Oid col_oid = attr->atttypid;
+
+ uppercase(col_name);
+
+ this->all_columns[col_name] = col_oid;
+ }
+
+ SPI_finish();
+ }
+
+ ~xmlstore_context() = default;
+
+ ssize_t update_xml(std::string &xml) noexcept;
+ ssize_t insert_xml(std::string &xml) noexcept;
+ ssize_t delete_xml(std::string &xml) noexcept;
+};
+
+ssize_t xmlstore_context::update_xml(std::string &xml) noexcept
+{
+ SPI_connect();
+
+ /* 1. Parse the xml */
+ xmlDocPtr document = xmlParseDoc(
+ reinterpret_cast<const xmlChar*>(xml.c_str()));
+ xmlNodePtr root;
+
+ if (document == nullptr)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to parse xml")));
+ SPI_finish();
+ return -1;
+ }
+
+ root = xmlDocGetRootElement(document);
+
+ ssize_t total_rows = 0;
+
+ /* 2. For each ROW, make an update query */
+ for (xmlNodePtr row = root->children; row != nullptr; row = row->next)
+ {
+ if (xmlStrcasecmp(
+ row->name,
+ reinterpret_cast<const xmlChar*>(this->row_tag.c_str())
+ ) != 0)
+ {
+ continue;
+ }
+
+ std::string query = "UPDATE ";
+ std::vector<Datum> values;
+ std::vector<Oid> oids;
+ std::vector<char> nulls;
+
+ query.append(this->target_table);
+ query.append(" SET ");
+
+ int i = 1;
+
+ if (this->update_columns.empty())
+ {
+ /* Send all the columns */
+ for (xmlNodePtr entry = row->children; entry != nullptr;
+ entry = entry->next)
+ {
+ std::string name = reinterpret_cast<const char*>(entry->name);
+
+ query.append(name);
+ query.append("=$");
+ query.append(std::to_string(i));
+ query.append(", ");
+
+ Oid oid;
+ auto col_it = this->all_columns.find(name);
+ if (col_it == this->all_columns.end())
+ {
+ oid = InvalidOid;
+ }
+ else
+ {
+ oid = col_it->second;
+ }
+
+ xmlAttrPtr attr = entry->properties;
+ if (xmlStrcmp(attr->name,
+ reinterpret_cast<const xmlChar*>("NULL")) == 0
+ || xmlStrcmp(xmlNodeGetContent(
+ reinterpret_cast<xmlNodePtr>(attr)
+ ), reinterpret_cast<const xmlChar*>("Y")) == 0)
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(oid);
+ nulls.push_back('n');
+ }
+ else
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value;
+ if (oid == InvalidOid)
+ {
+ value = static_cast<Datum>(0);
+ }
+ else
+ {
+ value = string_to_value(str, oid);
+ }
+ values.push_back(value);
+ oids.push_back(oid);
+ nulls.push_back(' ');
+ }
+ i++;
+ }
+ }
+ else
+ {
+ for (std::string &column_name: this->update_columns)
+ {
+ query.append(reinterpret_cast<const char*>(column_name.c_str()));
+ query.append("=$");
+ query.append(std::to_string(i));
+ query.append(", ");
+ i++;
+
+ Oid oid;
+ auto col_it = this->all_columns.find(column_name);
+ if (col_it == this->all_columns.end())
+ {
+ oid = InvalidOid;
+ }
+ else
+ {
+ oid = col_it->second;
+ }
+
+ xmlNodePtr entry = find_node_by_name(row, column_name);
+ if (entry == nullptr)
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(oid);
+ nulls.push_back('n');
+ continue;
+ }
+
+ xmlAttrPtr attr = entry->properties;
+ if (attr != nullptr && xmlStrcmp(attr->name,
+ reinterpret_cast<const xmlChar*>("NULL")) == 0
+ && xmlStrcmp(xmlNodeGetContent(
+ reinterpret_cast<xmlNodePtr>(attr)
+ ), reinterpret_cast<const xmlChar*>("Y")) == 0)
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(oid);
+ nulls.push_back('n');
+ }
+ else
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value;
+ if (oid == InvalidOid)
+ {
+ value = static_cast<Datum>(0);
+ }
+ else
+ {
+ value = string_to_value(str, oid);
+ }
+ values.push_back(value);
+ oids.push_back(oid);
+ nulls.push_back(' ');
+ }
+ }
+ }
+
+ /* One extra comma */
+ query.pop_back();
+ query.pop_back();
+ bool first = true;
+ bool missing_keys = false;
+
+ /* Add row qualifiers */
+ query.append(" WHERE ");
+ for (std::string &column_name: this->key_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, column_name);
+ if (entry == nullptr)
+ {
+ missing_keys = true;
+ break;
+ }
+
+ Oid oid = this->all_columns[column_name];
+
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ query.append(" AND ");
+ }
+
+ query.append(column_name);
+ query.append("=$");
+ query.append(std::to_string(i));
+ i++;
+
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, oid);
+ values.push_back(value);
+ oids.push_back(oid);
+ nulls.push_back(' ');
+ }
+ if (missing_keys)
+ {
+ continue;
+ }
+ query.append(" RETURNING *;");
+
+ /* Query is ready */
+ ereport(
+ DEBUG1,
+ errmsg_internal("dbms_xmlstore_updatexml: query: %s",
+ query.c_str())
+ );
+
+ int ret = SPI_execute_with_args(query.c_str(), values.size(), oids.data(),
+ values.data(), nulls.data(), false, 0);
+
+ if (ret < 0)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("SPI query failed")));
+ xmlFree(document);
+ SPI_finish();
+ return -1;
+ }
+
+ total_rows += SPI_processed;
+ }
+
+ xmlFree(document);
+ SPI_finish();
+ return total_rows;
+}
+
+ssize_t xmlstore_context::insert_xml(std::string &xml) noexcept
+{
+ SPI_connect();
+
+ /* 1. Parse the xml */
+ xmlDocPtr document = xmlParseDoc(
+ reinterpret_cast<const xmlChar*>(xml.c_str()));
+ xmlNodePtr root;
+
+ if (document == nullptr)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to parse xml")));
+ SPI_finish();
+ return -1;
+ }
+
+ root = xmlDocGetRootElement(document);
+
+ ssize_t total_rows = 0;
+
+ for (xmlNodePtr row = root->children; row != nullptr; row = row->next) {
+ if (xmlStrcasecmp(
+ row->name,
+ reinterpret_cast<const xmlChar *>(this->row_tag.c_str())
+ ) != 0)
+ {
+ continue;
+ }
+
+ std::string query_columns_part = "INSERT INTO ";
+ query_columns_part.append(this->target_table);
+ query_columns_part.append(" (");
+
+ std::string query_values_part = " VALUES (";
+
+ std::vector<Datum> values;
+ std::vector<Oid> oids;
+ std::vector<char> nulls;
+
+ int i = 1;
+ if (this->update_columns.empty())
+ {
+ for (auto &col_name: this->all_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, col_name.first);
+ if (entry != nullptr)
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, col_name.second);
+
+ query_columns_part.append(col_name.first);
+ query_columns_part.append(", ");
+
+ query_values_part.push_back('$');
+ query_values_part.append(std::to_string(i));
+ query_values_part.append(", ");
+
+ values.push_back(value);
+ oids.push_back(col_name.second);
+ nulls.push_back(' ');
+ i++;
+ }
+ }
+ if (i == 1)
+ {
+ /* We are not inserting any columns, hence XML is malformed */
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("XML document is malformed")));
+ }
+ }
+ else
+ {
+ for (std::string &col_name: this->update_columns)
+ {
+ query_columns_part.append(col_name);
+ query_columns_part.append(", ");
+
+ query_values_part.push_back('$');
+ query_values_part.append(std::to_string(i));
+ query_values_part.append(", ");
+
+ i++;
+
+ xmlNodePtr entry = find_node_by_name(row, col_name);
+ if (entry != nullptr)
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, this->all_columns[col_name]);
+
+ values.push_back(value);
+ oids.push_back(this->all_columns[col_name]);
+ nulls.push_back(' ');
+ }
+ else
+ {
+ values.push_back(static_cast<Datum>(0));
+ oids.push_back(this->all_columns[col_name]);
+ nulls.push_back('n');
+ }
+ }
+ }
+
+ /* We've got extra commas */
+ query_columns_part.pop_back();
+ query_columns_part.pop_back();
+ query_columns_part.push_back(')');
+
+ query_values_part.pop_back();
+ query_values_part.pop_back();
+ query_values_part.append(");");
+
+ std::string query = query_columns_part + query_values_part;
+
+ SPI_execute_with_args(query.c_str(), values.size(), oids.data(),
+ values.data(), nulls.data(), false, 0);
+
+ total_rows += SPI_processed;
+ }
+
+ xmlFree(document);
+ SPI_finish();
+ return total_rows;
+}
+
+ssize_t xmlstore_context::delete_xml(std::string &xml) noexcept
+{
+ SPI_connect();
+
+ /* 1. Parse the xml */
+ xmlDocPtr document = xmlParseDoc(
+ reinterpret_cast<const xmlChar*>(xml.c_str()));
+ xmlNodePtr root;
+
+ if (document == nullptr)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Failed to parse xml")));
+ SPI_finish();
+ return -1;
+ }
+
+ root = xmlDocGetRootElement(document);
+
+ ssize_t total_rows = 0;
+
+ for (xmlNodePtr row = root->children; row != nullptr; row = row->next) {
+ if (xmlStrcasecmp(
+ row->name,
+ reinterpret_cast<const xmlChar *>(this->row_tag.c_str())
+ ) != 0)
+ {
+ continue;
+ }
+
+ std::string query = "DELETE FROM ";
+ query.append(this->target_table);
+ query.append(" WHERE ");
+
+ std::vector<Datum> values;
+ std::vector<Oid> oids;
+
+ bool first = true;
+
+ int i = 1;
+ if (this->key_columns.empty())
+ {
+ for (auto &col_name: this->all_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, col_name.first);
+ if (entry != nullptr)
+ {
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, col_name.second);
+
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ query.append(" AND ");
+ }
+
+ query.append(col_name.first);
+ query.append("=$");
+ query.append(std::to_string(i));
+
+ values.push_back(value);
+ oids.push_back(col_name.second);
+ i++;
+ }
+ }
+ if (i == 1)
+ {
+ /* We are not inserting any columns, hence XML is malformed */
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("XML document is malformed")));
+ }
+ }
+ else
+ {
+ for (std::string &col_name: this->key_columns)
+ {
+ xmlNodePtr entry = find_node_by_name(row, col_name);
+ if (entry == nullptr)
+ {
+ continue;
+ }
+
+ query.append(col_name);
+ query.append("=$");
+ query.append(std::to_string(i));
+
+ i++;
+
+ char *str = reinterpret_cast<char*>(
+ xmlNodeGetContent(entry)
+ );
+ Datum value = string_to_value(str, this->all_columns[col_name]);
+
+ values.push_back(value);
+ oids.push_back(this->all_columns[col_name]);
+ }
+ }
+
+ query.append(";");
+
+ SPI_execute_with_args(query.c_str(), values.size(), oids.data(),
+ values.data(), nullptr, false, 0);
+
+ total_rows += SPI_processed;
+ }
+
+ xmlFree(document);
+ SPI_finish();
+ return total_rows;
+}
+
+static int32_t next_handle = 0;
+static std::unordered_map<int32_t, xmlstore_context> contexts;
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(dbms_xmlstore_clearkeycolumnlist);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_clearupdatecolumnlist);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_closecontext);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_closecontext_tmp);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_deletexml_ovr1);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_deletexml_ovr2);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_insertxml_ovr1);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_insertxml_ovr2);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_newcontext);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_setkeycolumn);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_setpreservewhitespace);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_setrowtag);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_setupdatecolumn);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_updatexml_ovr1);
+PG_FUNCTION_INFO_V1(dbms_xmlstore_updatexml_ovr2);
+
+/**
+ * @brief Очищает список ключевых столбцов.
+ * @details Эта процедура очищает список ключевых столбцов, используемых для формирования условий WHERE при операциях обновления и удаления.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_clearkeycolumnlist(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ ctx_it->second.key_columns.clear();
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Очищает список обновляемых столбцов.
+ * @details Процедура удаляет указанные столбцы из списка обновляемых столбцов, который применяется при операциях обновления.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_clearupdatecolumnlist(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ ctx_it->second.update_columns.clear();
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Закрывает и освобождает конкретный контекст сохранения.
+ * @details Процедура закрывает и освобождает выделенные ресурсы, относящиеся к данному контексту сохранения.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_closecontext(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it != contexts.end())
+ {
+ contexts.erase(ctx_it);
+ }
+ PG_RETURN_VOID();
+}
+
+Datum dbms_xmlstore_closecontext_tmp(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_ARGISNULL(0) ? 0 : PG_GETARG_INT32(0);
+ int32_t serviceArg = PG_ARGISNULL(1) ? 0 : PG_GETARG_INT32(1);
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 1);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 1, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = Int32GetDatum(handle);
+ fcinfo2->args[0].isnull = PG_ARGISNULL(0);
+
+ (void) dbms_xmlstore_closecontext(fcinfo2);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Удаляет записи, соответствующие данным из XML-документа, из таблицы, указанной во время создания контекста.
+ * @details Функция удаляет записи, определённые данными из XML-документа, из таблицы, указанной при создании контекста.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param XDOC (in) VARCHAR2: Строка, содержащая XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_deletexml_ovr1(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *xml_packed = PG_GETARG_TEXT_P(1);
+ text *xml_txt = pg_detoast_datum_packed(xml_packed);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.delete_xml(xml);
+
+ if (xml_txt != xml_packed)
+ {
+ pfree(xml_txt);
+ }
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+}
+
+/**
+ * @brief Удаляет записи, соответствующие данным из XML-документа, из таблицы, указанной во время создания контекста.
+ * @details Функция удаляет записи, определённые данными из XML-документа, из таблицы, указанной при создании контекста.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param XDOC (in) OPAQUE/XMLTYPE: Строка, содержащая XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_deletexml_ovr2(PG_FUNCTION_ARGS)
+{
+ /* xmltype is basically text, but PG_GETARG_XML_P detoasts it for us */
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ xmltype *xml_txt = PG_GETARG_XML_P(1);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.delete_xml(xml);
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+}
+
+/**
+ * @brief Вставляет XML-документ в таблицу, указанную при создании контекста.
+ * @details Функция вставляет XML-документ в таблицу, указанную при создании контекста.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param XDOC (in) VARCHAR2: Строка, содержащая XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_insertxml_ovr1(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *xml_packed = PG_GETARG_TEXT_P(1);
+ text *xml_txt = pg_detoast_datum_packed(xml_packed);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.insert_xml(xml);
+
+ if (xml_txt != xml_packed)
+ {
+ pfree(xml_txt);
+ }
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+}
+
+/**
+ * @brief Вставляет XML-документ в таблицу, указанную при создании контекста.
+ * @details Функция вставляет XML-документ в таблицу, указанную при создании контекста.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param XDOC (in) OPAQUE/XMLTYPE: Строка, содержащая XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_insertxml_ovr2(PG_FUNCTION_ARGS)
+{
+ /* xmltype is basically text, but PG_GETARG_XML_P detoasts it for us */
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ xmltype *xml_txt = PG_GETARG_XML_P(1);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.insert_xml(xml);
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief CREATE CONTEXT создает контекст сохранения и возвращает дескриптор контекста.
+ * @details Функция создаёт новый контекст сохранения и возвращает соответствующий дескриптор контекста.
+ * * Parameters:
+ * * @param TARGETTABLE (in) VARCHAR2: Таблица назначения, куда загружается XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_newcontext(PG_FUNCTION_ARGS)
+{
+ text *target_table_packed = PG_GETARG_TEXT_P(0);
+ text *target_table_txt = pg_detoast_datum_packed(target_table_packed);
+ std::string target_table;
+ target_table.resize(VARSIZE_ANY_EXHDR(target_table_txt));
+ memcpy(target_table.data(), VARDATA_ANY(target_table_txt),
+ target_table.size());
+
+ if (target_table_txt != target_table_packed)
+ {
+ pfree(target_table_txt);
+ }
+
+ try
+ {
+ contexts.emplace(next_handle, target_table);
+ }
+ catch (std::invalid_argument &err)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("UPDATEXML failed: %s", err.what())));
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_INT32(next_handle++);
+}
+
+/**
+ * @brief Метод добавляет столбец в список ключевых столбцов.
+ * @details Добавляет столбец в список ключевых столбцов, используемый для построения WHERE-предложения при операциях обновления и удаления.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param COLNAME (in) VARCHAR2: Столбец, добавляемый в список ключевых столбцов; не может быть пустым.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_setkeycolumn(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *column_packed = PG_GETARG_TEXT_P(1);
+ text *column_txt = pg_detoast_datum_packed(column_packed);
+ std::string column_name;
+ column_name.resize(VARSIZE_ANY_EXHDR(column_txt));
+ memcpy(column_name.data(), VARDATA_ANY(column_txt),
+ column_name.size());
+
+ ctx_it->second.key_columns.push_back(column_name);
+
+ if (column_txt != column_packed)
+ {
+ pfree(column_txt);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Устанавливает флаг, определяющий сохранение символов пробела при обработке XML-документа.
+ * @details Эта процедура устанавливает флаг, который определяет, сохранять ли символы пробела при загрузке документа XML.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param FLAG (in) BOOLEAN: Логическое значение флага.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_setpreservewhitespace(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция dbms_xmlstore.setpreservewhitespace еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Назначает тег, используемый для группировки элементов XML, соответствующих записям базы данных.
+ * @details Эта процедура назначает тег, используемый для окружения элементов XML, соответствующих записям базы данных.
+ * * Parameters:
+ * * @param CTX (in) NUMBER: Контекстный дескриптор.
+ * * @param ROWTAGNAME (in) VARCHAR2: Имя тега, используемого для группировки элементов XML, соответствующих записям базы данных.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_setrowtag(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *row_tag_packed = PG_GETARG_TEXT_P(1);
+ text *row_tag_txt = pg_detoast_datum_packed(row_tag_packed);
+ std::string row_tag;
+ row_tag.resize(VARSIZE_ANY_EXHDR(row_tag_txt));
+ memcpy(row_tag.data(), VARDATA_ANY(row_tag_txt), row_tag.size());
+
+ ctx_it->second.row_tag = row_tag;
+
+ if (row_tag_txt != row_tag_packed)
+ {
+ pfree(row_tag_txt);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Метод добавляет столбец в список обновляемых столбцов.
+ * @details Добавляет столбец в список обновляемых столбцов, применяемых при операциях обновления.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param COLNAME (in) VARCHAR2: Столбец, добавляемый в список обновляемых столбцов.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_setupdatecolumn(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *column_packed = PG_GETARG_TEXT_P(1);
+ text *column_txt = pg_detoast_datum_packed(column_packed);
+ std::string column_name;
+ column_name.resize(VARSIZE_ANY_EXHDR(column_txt));
+ memcpy(column_name.data(), VARDATA_ANY(column_txt),
+ column_name.size());
+
+ ctx_it->second.update_columns.push_back(column_name);
+
+ if (column_txt != column_packed)
+ {
+ pfree(column_txt);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Обновляет таблицу на основании данных из XML-документа.
+ * @details Функция обновляет таблицу на основании данных из XML-документа.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param XDOC (in) VARCHAR2: Строка, содержащая XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_updatexml_ovr1(PG_FUNCTION_ARGS)
+{
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ text *xml_packed = PG_GETARG_TEXT_P(1);
+ text *xml_txt = pg_detoast_datum_packed(xml_packed);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.update_xml(xml);
+
+ if (xml_txt != xml_packed)
+ {
+ pfree(xml_txt);
+ }
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+}
+
+/**
+ * @brief Обновляет таблицу на основании данных из XML-документа.
+ * @details Функция обновляет таблицу на основании данных из XML-документа.
+ * * Parameters:
+ * * @param CTXHDL (in) NUMBER: Контекстный дескриптор.
+ * * @param XDOC (in) OPAQUE/XMLTYPE: Строка, содержащая XML-документ.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_XMLSTORE.html
+ */
+Datum dbms_xmlstore_updatexml_ovr2(PG_FUNCTION_ARGS)
+{
+ /* xmltype is basically text, but PG_GETARG_XML_P detoasts it for us */
+ int32_t handle = PG_GETARG_INT32(0);
+ auto ctx_it = contexts.find(handle);
+
+ if (ctx_it == contexts.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid context handle: %d", handle)));
+ }
+
+ xmltype *xml_txt = PG_GETARG_XML_P(1);
+ std::string xml;
+ xml.resize(VARSIZE_ANY_EXHDR(xml_txt));
+ memcpy(xml.data(), VARDATA_ANY(xml_txt), xml.size());
+
+ ssize_t result = ctx_it->second.update_xml(xml);
+
+ if (result < 0)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_DATUM(
+ DirectFunctionCall1(int8_numeric,
+ Int64GetDatum(static_cast<int64_t>(result)))
+ );
+ PG_RETURN_NULL();
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.hpp b/src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.hpp
new file mode 100644
index 0000000..37b3502
--- /dev/null
+++ b/src/backend/utils/dbms/dbms_xmlstore/dbms_xmlstore.hpp
@@ -0,0 +1,37 @@
+#ifndef DBMS_XMLSTORE_INTERNAL_HPP
+#define DBMS_XMLSTORE_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+} // extern "C"
+
+extern "C"
+{
+Datum dbms_xmlstore_clearkeycolumnlist(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_clearupdatecolumnlist(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_closecontext(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_closecontext_tmp(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_deletexml_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_deletexml_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_insertxml_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_insertxml_ovr2(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_newcontext(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_setkeycolumn(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_setpreservewhitespace(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_setrowtag(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_setupdatecolumn(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_updatexml_ovr1(PG_FUNCTION_ARGS);
+Datum dbms_xmlstore_updatexml_ovr2(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // DBMS_XMLSTORE_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/htf/htf.cpp b/src/backend/utils/dbms/htf/htf.cpp
new file mode 100644
index 0000000..67474c6
--- /dev/null
+++ b/src/backend/utils/dbms/htf/htf.cpp
@@ -0,0 +1,2062 @@
+#include "htf.hpp"
+#include "htf_common.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+}
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(htf_address);
+PG_FUNCTION_INFO_V1(htf_anchor);
+PG_FUNCTION_INFO_V1(htf_anchor2);
+PG_FUNCTION_INFO_V1(htf_appletopen);
+PG_FUNCTION_INFO_V1(htf_area);
+PG_FUNCTION_INFO_V1(htf_base);
+PG_FUNCTION_INFO_V1(htf_basefont);
+PG_FUNCTION_INFO_V1(htf_bgsound);
+PG_FUNCTION_INFO_V1(htf_big);
+PG_FUNCTION_INFO_V1(htf_blockquoteopen);
+PG_FUNCTION_INFO_V1(htf_bodyopen);
+PG_FUNCTION_INFO_V1(htf_bold);
+PG_FUNCTION_INFO_V1(htf_br);
+PG_FUNCTION_INFO_V1(htf_center);
+PG_FUNCTION_INFO_V1(htf_cite);
+PG_FUNCTION_INFO_V1(htf_code);
+PG_FUNCTION_INFO_V1(htf_codepoint);
+PG_FUNCTION_INFO_V1(htf_comment);
+PG_FUNCTION_INFO_V1(htf_dfn);
+PG_FUNCTION_INFO_V1(htf_div);
+PG_FUNCTION_INFO_V1(htf_dlistdef);
+PG_FUNCTION_INFO_V1(htf_dlistopen);
+PG_FUNCTION_INFO_V1(htf_dlistterm);
+PG_FUNCTION_INFO_V1(htf_em);
+PG_FUNCTION_INFO_V1(htf_emphasis);
+PG_FUNCTION_INFO_V1(htf_escape_oracle_full);
+PG_FUNCTION_INFO_V1(htf_escape_sc);
+PG_FUNCTION_INFO_V1(htf_escape_url);
+PG_FUNCTION_INFO_V1(htf_fontopen);
+PG_FUNCTION_INFO_V1(htf_format_cell);
+PG_FUNCTION_INFO_V1(htf_formcheckbox);
+PG_FUNCTION_INFO_V1(htf_formfile);
+PG_FUNCTION_INFO_V1(htf_formhidden);
+PG_FUNCTION_INFO_V1(htf_formimage);
+PG_FUNCTION_INFO_V1(htf_formopen);
+PG_FUNCTION_INFO_V1(htf_formpassword);
+PG_FUNCTION_INFO_V1(htf_formradio);
+PG_FUNCTION_INFO_V1(htf_formreset);
+PG_FUNCTION_INFO_V1(htf_formselectopen);
+PG_FUNCTION_INFO_V1(htf_formselectoption);
+PG_FUNCTION_INFO_V1(htf_formsubmit);
+PG_FUNCTION_INFO_V1(htf_formtext);
+PG_FUNCTION_INFO_V1(htf_formtextarea);
+PG_FUNCTION_INFO_V1(htf_formtextarea2);
+PG_FUNCTION_INFO_V1(htf_formtextareaopen);
+PG_FUNCTION_INFO_V1(htf_formtextareaopen2);
+PG_FUNCTION_INFO_V1(htf_frame);
+PG_FUNCTION_INFO_V1(htf_framesetopen);
+PG_FUNCTION_INFO_V1(htf_header);
+PG_FUNCTION_INFO_V1(htf_hr);
+PG_FUNCTION_INFO_V1(htf_htitle);
+PG_FUNCTION_INFO_V1(htf_img);
+PG_FUNCTION_INFO_V1(htf_img2);
+PG_FUNCTION_INFO_V1(htf_isindex);
+PG_FUNCTION_INFO_V1(htf_italic);
+PG_FUNCTION_INFO_V1(htf_kbd);
+PG_FUNCTION_INFO_V1(htf_keyboard);
+PG_FUNCTION_INFO_V1(htf_line);
+PG_FUNCTION_INFO_V1(htf_linkrel);
+PG_FUNCTION_INFO_V1(htf_linkrev);
+PG_FUNCTION_INFO_V1(htf_listheader);
+PG_FUNCTION_INFO_V1(htf_listitem);
+PG_FUNCTION_INFO_V1(htf_mailto);
+PG_FUNCTION_INFO_V1(htf_mapopen);
+PG_FUNCTION_INFO_V1(htf_meta);
+PG_FUNCTION_INFO_V1(htf_nextid);
+PG_FUNCTION_INFO_V1(htf_nl);
+PG_FUNCTION_INFO_V1(htf_nobr);
+PG_FUNCTION_INFO_V1(htf_olistopen);
+PG_FUNCTION_INFO_V1(htf_paragraph);
+PG_FUNCTION_INFO_V1(htf_param);
+PG_FUNCTION_INFO_V1(htf_plaintext);
+PG_FUNCTION_INFO_V1(htf_preopen);
+PG_FUNCTION_INFO_V1(htf_s);
+PG_FUNCTION_INFO_V1(htf_sample);
+PG_FUNCTION_INFO_V1(htf_script);
+PG_FUNCTION_INFO_V1(htf_set_html_escaping_mode);
+PG_FUNCTION_INFO_V1(htf_small);
+PG_FUNCTION_INFO_V1(htf_strike);
+PG_FUNCTION_INFO_V1(htf_strong);
+PG_FUNCTION_INFO_V1(htf_style);
+PG_FUNCTION_INFO_V1(htf_sub);
+PG_FUNCTION_INFO_V1(htf_sup);
+PG_FUNCTION_INFO_V1(htf_tablecaption);
+PG_FUNCTION_INFO_V1(htf_tabledata);
+PG_FUNCTION_INFO_V1(htf_tableheader);
+PG_FUNCTION_INFO_V1(htf_tableopen);
+PG_FUNCTION_INFO_V1(htf_tablerowopen);
+PG_FUNCTION_INFO_V1(htf_teletype);
+PG_FUNCTION_INFO_V1(htf_title);
+PG_FUNCTION_INFO_V1(htf_ulistopen);
+PG_FUNCTION_INFO_V1(htf_underline);
+PG_FUNCTION_INFO_V1(htf_variable);
+
+/**
+ * @brief генерирует теги <ADDRESS> и </ADDRESS>, которые задают адрес, автора и подпись документа.
+ * @details Функция генерирует теги <ADDRESS> и </ADDRESS>, которые определяют адрес, автора и подпись документа.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: Строка, которая помещается между тегами <ADDRESS> и </ADDRESS>.
+ * * @param CNOWRAP (in) VARCHAR2: Если значение этого параметра не NULL, в тег добавляется атрибут NOWRAP.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_address(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cnowrap = htf::get_string_argument(fcinfo, 1);
+ char *cclear = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_address_tag(cvalue, cnowrap, cclear, cattributes);
+ htf::pfree_all(cvalue, cnowrap, cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief как и функция ANCHOR2, генерирует HTML-теги <A> и </A>, задающие источник или назначение гиперссылки.
+ * @details Функция генерирует теги <A> и </A> для создания гиперссылок.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: Значение для атрибута HREF.
+ * * @param CTEXT (in) VARCHAR2: Строка, которая помещается между тегами <A> и </A>.
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_anchor(PG_FUNCTION_ARGS)
+{
+ char *curl = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ char *ctext = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracleFull);
+ char *cname = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_anchor_tag(curl, ctext, cname, cattributes);
+ htf::pfree_all(curl, ctext, cname, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief как и функция ANCHOR, генерирует HTML-теги <A> и </A>, задающие источник или назначение гиперссылки.
+ * @details Функция генерирует теги <A> и </A> для создания гиперссылок с поддержкой целевого окна.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: Значение для атрибута HREF.
+ * * @param CTEXT (in) VARCHAR2: Строка, которая помещается между тегами <A> и </A>.
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CTARGET (in) VARCHAR2: Значение для атрибута TARGET.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_anchor2(PG_FUNCTION_ARGS)
+{
+ char *curl = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ char *ctext = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracleFull);
+ char *cname = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *ctarget = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_anchor_tag(curl, ctext, cname, cattributes, ctarget);
+ htf::pfree_all(curl, ctext, cname, ctarget, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <APPLET>, который начинает выполнение Java-апплета.
+ * @details Функция генерирует открывающий тег <APPLET> для встраивания Java-апплета. Параметры апплета задаются функцией PARAM.
+ * * Parameters:
+ * * @param CCODE (in) VARCHAR2: Значение для атрибута CODE, указывающее имя класса апплета.
+ * * @param CWIDTH (in) NUMBER: Значение для атрибута WIDTH (ширина апплета).
+ * * @param CHEIGHT (in) NUMBER: Значение для атрибута HEIGHT (высота апплета).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_appletopen(PG_FUNCTION_ARGS)
+{
+ char *ccode = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ char *cwidth = htf::get_numeric_argument_as_string(fcinfo, 1);
+ char *cheight = htf::get_numeric_argument_as_string(fcinfo, 2);
+ char *cattr = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_applet_tag(ccode, cwidth, cheight, cattr);
+ htf::pfree_all(ccode, cwidth, cheight, cattr);
+
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <AREA>, который определяет активные области на клиентской карте изображения.
+ * @details Функция генерирует тег <AREA> для создания клиентских карт изображений, определяя области и их назначения.
+ * * Parameters:
+ * * @param CCOORDS (in) VARCHAR2: Координаты области на карте изображения.
+ * * @param CSHAPE (in) VARCHAR2: Значение для атрибута SHAPE (форма области).
+ * * @param CHREF (in) VARCHAR2: Значение для атрибута HREF (URL назначения).
+ * * @param CNOHREF (in) VARCHAR2: Если значение этого параметра не NULL, в тег добавляется атрибут NOHREF.
+ * * @param CTARGET (in) VARCHAR2: Значение для атрибута TARGET.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_area(PG_FUNCTION_ARGS)
+{
+ char *ccoords = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cshape = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *chref = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatSpecialChars);
+ char *cnohref = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *ctarget = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 5);
+
+ text *tag = htf::generate_area_tag(ccoords, cshape, chref, cnohref, ctarget, cattributes);
+ htf::pfree_all(ccoords, cshape, chref, cnohref, ctarget, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <BASE>, который записывает базовый URL документа.
+ * @details Функция генерирует тег <BASE> для указания базового URL документа и целевого окна по умолчанию.
+ * * Parameters:
+ * * @param CTARGET (in) VARCHAR2: Значение для атрибута TARGET, задающее имя окна для всех ссылок документа.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_base(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.base еще не реализована.")));
+ // TODO: внутри обращение к OWA_UTIL для определения URL
+ //
+ // QL Error [6502] [65000]: ORA-06502: PL/SQL: value or conversion error
+ // ORA-06512: at "SYS.OWA_UTIL", line 354
+ // ORA-06512: at "SYS.HTF", line 754
+ // ORA-06512: at line 28
+
+ // требует подобного перед вызовом
+ // DECLARE
+ // v_var varchar2(500);
+
+ // v_names OWA.VC_ARR;
+ // v_values OWA.VC_ARR;
+ // BEGIN
+ // v_names(1) := 'REQUEST_PROTOCOL';
+ // v_values(1) := 'HTTP';
+ // OWA.INIT_CGI_ENV( 1, v_names, v_values );
+ // ...
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <BASEFONT>, который задает базовый размер шрифта для веб-страницы.
+ * @details Функция генерирует тег <BASEFONT> для установки базового размера шрифта на странице (устаревший тег).
+ * * Parameters:
+ * * @param NSIZE (in) NUMBER: Значение для атрибута SIZE (размер базового шрифта).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_basefont(PG_FUNCTION_ARGS)
+{
+ char *csize = htf::get_numeric_argument_as_string(fcinfo, 0);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_basefont_tag(csize, cattributes);
+ htf::pfree_all(csize, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <BGSOUND>, который добавляет фоновый звук на веб-страницу.
+ * @details Функция генерирует тег <BGSOUND> для воспроизведения фонового звука (нестандартный тег Internet Explorer).
+ * * Parameters:
+ * * @param CSRC (in) VARCHAR2: Значение для атрибута SRC (URL звукового файла).
+ * * @param CLOOP (in) VARCHAR2: Значение для атрибута LOOP (количество повторений).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_bgsound(PG_FUNCTION_ARGS)
+{
+ char *csrc = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cloop = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_bgsound_tag(csrc, cloop, cattributes);
+ htf::pfree_all(csrc, cloop, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <BIG> и </BIG>, которые указывают браузеру отображать текст увеличенным шрифтом.
+ * @details Функция генерирует теги <BIG> для увеличения размера шрифта текста.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст, который помещается между тегами.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_big(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_big_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <BLOCKQUOTE>, который отмечает начало блока цитируемого текста.
+ * @details Функция генерирует открывающий тег <BLOCKQUOTE> для создания блока цитаты с отступами.
+ * * Parameters:
+ * * @param CNOWRAP (in) VARCHAR2: Если значение этого параметра не NULL, в тег добавляется атрибут NOWRAP.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_blockquoteopen(PG_FUNCTION_ARGS)
+{
+ char *cnowrap = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cclear = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_blockquote_tag(cnowrap, cclear, cattributes);
+ htf::pfree_all(cnowrap, cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <BODY>, который отмечает начало тела HTML-документа.
+ * @details Функция генерирует открывающий тег <BODY> с атрибутами фона и цветов.
+ * * Parameters:
+ * * @param CBACKGROUND (in) VARCHAR2: Значение для атрибута BACKGROUND, задающее фоновое изображение документа.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_bodyopen(PG_FUNCTION_ARGS)
+{
+ char *cbackground = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_body_tag(cbackground, cattributes);
+ htf::pfree_all(cbackground, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <B> и </B>, которые указывают браузеру отображать текст жирным шрифтом.
+ * @details Функция генерирует теги <B> для выделения текста жирным начертанием.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст, который помещается между тегами.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_bold(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_bold_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <BR>, который начинает новую строку текста.
+ * @details Функция генерирует тег <BR> для принудительного перевода строки.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_br(PG_FUNCTION_ARGS)
+{
+ char *cclear = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_br_tag(cclear, cattributes);
+ htf::pfree_all(cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <CENTER> и </CENTER>, которые центрируют секцию текста на веб-странице.
+ * @details Функция генерирует теги <CENTER> для центрирования содержимого (устаревший тег).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст, который помещается между тегами.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_center(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ text *tag = htf::generate_center_tag(ctext);
+ htf::pfree_all(ctext);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <CITE> и </CITE>, которые указывают браузеру отображать текст как цитату.
+ * @details Функция генерирует теги <CITE> для выделения цитат или названий произведений.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения как цитата.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_cite(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_cite_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <CODE> и </CODE>, которые указывают браузеру отображать текст моноширинным шрифтом.
+ * @details Функция генерирует теги <CODE> для отображения фрагментов программного кода.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения как код.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_code(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_code_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief возвращает Unicode кодовую точку для указанного символа.
+ * @details Функция преобразует символ в его Unicode кодовую точку (например, 'A' -> 65).
+ * * Parameters:
+ * * @param P_CHAR (in) VARCHAR2: Символ для преобразования.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_codepoint(PG_FUNCTION_ARGS)
+{
+ char *txtptr = htf::get_string_argument(fcinfo, 0);
+
+ uint32 res = htf::symbol_digit(txtptr);
+ htf::pfree_all(txtptr);
+
+ PG_RETURN_INT32(res);
+}
+
+/**
+ * @brief генерирует HTML-комментарий.
+ * @details Функция генерирует теги комментария <!-- ... --> для включения скрытых заметок в HTML-код.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст комментария.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_comment(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+
+ text *tag = htf::generate_comment_tag(ctext);
+ htf::pfree_all(ctext);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <DFN> и </DFN>, которые указывают браузеру выделять текст как определение.
+ * @details Функция генерирует теги <DFN> для выделения определяемых терминов.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения в курсиве.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_dfn(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_dfn_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <DIV>, который создает разделы документа.
+ * @details Функция генерирует открывающий тег <DIV> для группировки элементов с возможностью стилизации.
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN (выравнивание).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_div(PG_FUNCTION_ARGS)
+{
+ char *calign = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_div_tag(calign, cattributes);
+ htf::pfree_all(calign, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <DD>, который вставляет определение термина в список определений.
+ * @details Функция генерирует тег <DD> для определения термина в списке определений <DL>.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Определение термина.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_dlistdef(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cclear = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_dlistdef_tag(ctext, cclear, cattributes);
+ htf::pfree_all(ctext, cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <DL>, который начинает список определений.
+ * @details Функция генерирует открывающий тег <DL> для создания списка определений. Закрывается функцией DLISTCLOSE.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_dlistopen(PG_FUNCTION_ARGS)
+{
+ char *cclear = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_dlistopen_tag(cclear, cattributes);
+ htf::pfree_all(cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <DT>, который определяет термин в списке определений.
+ * @details Функция генерирует тег <DT> для задания термина в списке определений <DL>.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Термин.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_dlistterm(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cclear = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_dlistterm_tag(ctext, cclear, cattributes);
+ htf::pfree_all(ctext, cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <EM> и </EM>, которые определяют текст для выделения.
+ * @details Функция генерирует теги <EM> для логического выделения текста (обычно курсив).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для выделения.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_em(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_em_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <EM> и </EM>, которые определяют текст для выделения (синоним EM).
+ * @details Функция генерирует теги <EM> для логического выделения текста (синоним функции EM).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для выделения.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_emphasis(PG_FUNCTION_ARGS)
+{
+ char *ctext = NULL;
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+ text *textarg = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+
+ LOCAL_FCINFO(local_fcinfo, 1);
+ InitFunctionCallInfoData(*local_fcinfo, NULL, 1, PG_GET_COLLATION(), fcinfo->context, NULL);
+ local_fcinfo->args[0].value = PointerGetDatum(textarg);
+ local_fcinfo->args[0].isnull = (textarg == NULL ? true : false);
+ Datum esc_text_datum = (*htf_escape_oracle_full) (local_fcinfo);
+ text *esc_text = NULL;
+ if (DatumGetPointer(esc_text_datum) != NULL) {
+ esc_text = DatumGetTextPP(esc_text_datum);
+ }
+
+ if(esc_text)
+ ctext = text_to_cstring(esc_text);
+
+ text *tag = htf::generate_em_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+ if(esc_text)
+ pfree(esc_text);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief заменяет символы, имеющие специальное значение в HTML, их escape-последовательностями.
+ * @details Функция преобразует символы <, >, & и другие в HTML-сущности для безопасного отображения.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Строка для преобразования.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_escape_oracle_full(PG_FUNCTION_ARGS)
+{
+ char *res_str = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ if(res_str){
+ text *result = cstring_to_text(res_str);
+ pfree(res_str);
+ PG_RETURN_TEXT_P(result);
+ }
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief заменяет символы, имеющие специальное значение в HTML, их escape-последовательностями.
+ * @details Функция преобразует символы <, >, & и другие в HTML-сущности для безопасного отображения.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Строка для преобразования.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_escape_sc(PG_FUNCTION_ARGS)
+{
+ char *res_str = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ if(res_str){
+ text *result = cstring_to_text(res_str);
+ pfree(res_str);
+ PG_RETURN_TEXT_P(result);
+ }
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief эта устаревшая функция заменяет символы, имеющие специальное значение в HTML и HTTP, их escape-последовательностями.
+ * @details Функция выполняет URL-кодирование строки, заменяя специальные символы (устаревшая, рекомендуется использовать UTL_URL.ESCAPE).
+ * * Parameters:
+ * * @param P_URL (in) VARCHAR2: Строка URL для преобразования.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_escape_url(PG_FUNCTION_ARGS)
+{
+ char *res_str = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ if(res_str){
+ text *result = cstring_to_text(res_str);
+ pfree(res_str);
+ PG_RETURN_TEXT_P(result);
+ }
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief генерирует тег <FONT>, отмечающий начало секции текста с указанными характеристиками шрифта.
+ * @details Функция генерирует открывающий тег <FONT> для изменения шрифта (устаревший тег, использовать CSS).
+ * * Parameters:
+ * * @param CCOLOR (in) VARCHAR2: Значение для атрибута COLOR (цвет шрифта).
+ * * @param CFACE (in) VARCHAR2: Значение для атрибута FACE (название шрифта).
+ * * @param CSIZE (in) VARCHAR2: Значение для атрибута SIZE (размер шрифта).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_fontopen(PG_FUNCTION_ARGS)
+{
+ char *ccolor = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cface = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *csize = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_font_tag(ccolor, cface, csize, cattributes);
+ htf::pfree_all(ccolor, cface, csize, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief форматирует значения колонок внутри HTML-таблицы, используя функцию TABLEDATA. Позволяет лучше управлять HTML-таблицами.
+ * @details Функция форматирует значения ячеек таблицы, обрабатывая числа специальным образом (выравнивание и округление).
+ * * Parameters:
+ * * @param COLUMNVALUE (in) VARCHAR2: Значение, которое нужно отформатировать в HTML-таблице.
+ * * @param FORMAT_NUMBERS (in) VARCHAR2: Формат отображения числовых данных. Если значение этого параметра не NULL, числовые поля выравниваются по правому краю и округляются до двух десятичных знаков.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_format_cell(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ // Второй параметр (cattributes) игнорируется
+
+ text *tag = htf::generate_tabledata_tag(cvalue, NULL);
+ htf::pfree_all(cvalue);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="checkbox", создающий элемент флажка в форме.
+ * @details Функция создает элемент флажка (checkbox) в HTML-форме.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибута VALUE.
+ * * @param CCHECKED (in) VARCHAR2: Если значение этого параметра не NULL, в тег добавляется атрибут CHECKED.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formcheckbox(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cchecked = htf::get_string_argument(fcinfo, 2);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_formcheckbox_tag(cname, cvalue, cchecked, cattributes);
+ htf::pfree_all(cname, cvalue, cchecked, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="file", создающий элемент для загрузки файлов.
+ * @details Функция создает поле выбора файла для загрузки на сервер.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CACCEPT (in) VARCHAR2: Список MIME-типов для загрузки через запятую.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formfile(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *caccept = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_formfile_tag(cname, caccept, cattributes);
+ htf::pfree_all(cname, caccept, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="hidden", создающий скрытый элемент формы.
+ * @details Функция создает скрытое поле формы, значение которого отправляется на сервер, но не отображается пользователю.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибута VALUE.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formhidden(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_formhidden_tag(cname, cvalue, cattributes);
+ htf::pfree_all(cname, cvalue, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="image", создающий поле-изображение для немедленной отправки формы.
+ * @details Функция создает графическую кнопку отправки формы, при клике на которую отправляются координаты клика.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CSRC (in) VARCHAR2: Значение для атрибута SRC (URL изображения).
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formimage(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *calign = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_formimage_tag(cname, cvalue, calign, cattributes);
+ htf::pfree_all(cname, cvalue, calign, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <FORM>, отмечающий начало секции формы в HTML-документе.
+ * @details Функция создает открывающий тег <FORM> для размещения элементов формы.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: URL скрипта, обрабатывающего данные формы.
+ * * @param CMETHOD (in) VARCHAR2: Значение для атрибута METHOD ("GET" или "POST").
+ * * @param CTARGET (in) VARCHAR2: Значение для атрибута TARGET.
+ * * @param CENCTYPE (in) VARCHAR2: Значение для атрибута ENCTYPE (тип кодирования данных).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formopen(PG_FUNCTION_ARGS)
+{
+ char *curl = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ char *cmethod = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *ctarget = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cenctype = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_formopen_tag(curl, cmethod, ctarget, cenctype, cattributes);
+ htf::pfree_all(curl, cmethod, ctarget, cenctype, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="password", создающий поле для ввода пароля.
+ * @details Функция создает поле ввода пароля, где символы скрываются звездочками.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CSIZE (in) VARCHAR2: Значение для атрибута SIZE (размер поля).
+ * * @param CMAXLENGTH (in) VARCHAR2: Значение для атрибута MAXLENGTH.
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибута VALUE.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formpassword(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *csize = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cmaxlength = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_formpassword_tag(cname, csize, cmaxlength, cvalue, cattributes);
+ htf::pfree_all(cname, csize, cmaxlength, cvalue, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="radio", создающий переключатель в HTML-форме.
+ * @details Функция создает радиокнопку, позволяющую выбрать один вариант из группы.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибута VALUE.
+ * * @param CCHECKED (in) VARCHAR2: Если значение этого параметра не NULL, в тег добавляется атрибут CHECKED.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formradio(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cchecked = htf::get_string_argument(fcinfo, 2);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_formradio_tag(cname, cvalue, cchecked, cattributes);
+ htf::pfree_all(cname, cvalue, cchecked, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="reset", создающий кнопку сброса формы.
+ * @details Функция создает кнопку, которая сбрасывает все поля формы к исходным значениям.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибута VALUE (текст на кнопке).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formreset(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_formreset_tag(cvalue, cattributes);
+ htf::pfree_all(cvalue, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <SELECT>, создающий элемент выбора в форме.
+ * @details Функция создает открывающий тег <SELECT> для выпадающего списка или списка множественного выбора.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CPROMPT (in) VARCHAR2: Строка, предшествующая списку.
+ * * @param NSIZE (in) NUMBER: Значение для атрибута SIZE.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formselectopen(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cprompt = htf::get_string_argument(fcinfo, 1);
+ char *csize = htf::get_numeric_argument_as_string(fcinfo, 2);
+ char *cattributes = htf::get_string_argument(fcinfo, 3);
+
+ text *tag = htf::generate_formselect_tag(cname, cprompt, csize, cattributes);
+ htf::pfree_all(cname, cprompt, csize, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <OPTION>, представляющий один пункт выбора в элементе SELECT.
+ * @details Функция создает пункт <OPTION> для выпадающего списка.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: Текст для пункта списка.
+ * * @param CSELECTED (in) VARCHAR2: Если значение не NULL, добавляет атрибут SELECTED.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formselectoption(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cselected = htf::get_string_argument(fcinfo, 1);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_formselectoption_tag(cvalue, cselected, cattributes);
+ htf::pfree_all(cvalue, cselected, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="submit", создающий кнопку отправки формы.
+ * @details Функция создает кнопку, отправляющую форму на сервер.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибуTA NAME.
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибуTA VALUE (текст на кнопке).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formsubmit(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_formsubmit_tag(cname, cvalue, cattributes);
+ htf::pfree_all(cname, cvalue, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <INPUT> с TYPE="text", создающий поле для ввода одной строки текста.
+ * @details Функция создает однострочное текстовое поле ввода.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибуTA NAME.
+ * * @param CSIZE (in) VARCHAR2: Значение для атрибуTA SIZE.
+ * * @param CMAXLENGTH (in) VARCHAR2: Значение для атрибуTA MAXLENGTH.
+ * * @param CVALUE (in) VARCHAR2: Значение для атрибуTA VALUE.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formtext(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *csize = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cmaxlength = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cvalue = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_formtext_tag(cname, csize, cmaxlength, cvalue, cattributes);
+ htf::pfree_all(cname, csize, cmaxlength, cvalue, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <TEXTAREA>, создающий многострочное текстовое поле.
+ * @details Функция создает многострочную текстовую область для ввода большого объема текста.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param NROWS (in) NUMBER: Значение для атрибута ROWS.
+ * * @param NCOLUMNS (in) NUMBER: Значение для атрибута COLS.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formtextarea(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *crows = htf::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htf::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_formtextarea_tag(cname, crows, ccolumns, calign, cattributes);
+ htf::pfree_all(cname, crows, ccolumns, calign, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <TEXTAREA> с поддержкой атрибута WRAP.
+ * @details Функция создает многострочную текстовую область с управлением переносом строк.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param NROWS (in) NUMBER: Значение для атрибута ROWS.
+ * * @param NCOLUMNS (in) NUMBER: Значение для атрибута COLS.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CWRAP (in) VARCHAR2: Значение для атрибута WRAP.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formtextarea2(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *crows = htf::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htf::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cwrap = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 5);
+
+ text *tag = htf::generate_formtextarea_tag(cname, crows, ccolumns, calign, cattributes, cwrap);
+ htf::pfree_all(cname, crows, ccolumns, calign, cattributes, cwrap);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует открывающий тег <TEXTAREA> для многострочного текстового поля.
+ * @details Функция создает только открывающий тег <TEXTAREA>, позволяя заполнить содержимое отдельно.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param NROWS (in) NUMBER: Значение для атрибута ROWS.
+ * * @param NCOLUMNS (in) NUMBER: Значение для атрибута COLS.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formtextareaopen(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *crows = htf::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htf::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_textarea_tag(cname, crows, ccolumns, calign, cattributes);
+ htf::pfree_all(cname, crows, ccolumns, calign, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует открывающий тег <TEXTAREA> с поддержкой атрибута WRAP.
+ * @details Функция создает только открывающий тег <TEXTAREA> с дополнительной настройкой переноса строк.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param NROWS (in) NUMBER: Значение для атрибута ROWS.
+ * * @param NCOLUMNS (in) NUMBER: Значение для атрибута COLS.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CWRAP (in) VARCHAR2: Значение для атрибута WRAP.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_formtextareaopen2(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *crows = htf::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htf::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cwrap = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 5);
+
+ text *tag = htf::generate_textarea_tag(cname, crows, ccolumns, calign, cattributes, cwrap);
+ htf::pfree_all(cname, crows, ccolumns, calign, cattributes, cwrap);
+
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <FRAME>, определяющий характеристики фрейма в наборе <FRAMESET>.
+ * @details Функция создает тег <FRAME> для определения отдельного фрейма в наборе фреймов.
+ * * Parameters:
+ * * @param CSRC (in) VARCHAR2: URL для отображения во фрейме.
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CMARGINWIDTH (in) VARCHAR2: Значение для атрибута MARGINWIDTH.
+ * * @param CMARGINHEIGHT (in) VARCHAR2: Значение для атрибута MARGINHEIGHT.
+ * * @param CSCROLLING (in) VARCHAR2: Значение для атрибута SCROLLING ("yes", "no", "auto").
+ * * @param CNORESIZE (in) VARCHAR2: Если значение этого параметра не NULL, в тег добавляется атрибут NORESIZE.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_frame(PG_FUNCTION_ARGS)
+{
+ char *csrc = htf::get_string_argument(fcinfo, 0);
+ char *cname = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cmarginwidth = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cmarginheight = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cscrolling = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cnoresize = htf::get_string_argument(fcinfo, 5);
+ char *cattributes = htf::get_string_argument(fcinfo, 6);
+
+ text *tag = htf::generate_frame_tag(csrc, cname, cmarginwidth, cmarginheight, cscrolling, cnoresize, cattributes);
+ htf::pfree_all(csrc, cname, cmarginwidth, cmarginheight, cscrolling, cnoresize, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <FRAMESET>, определяющий набор фреймов.
+ * @details Функция создает открывающий тег <FRAMESET> для разбиения окна на фреймы.
+ * * Parameters:
+ * * @param CROWS (in) VARCHAR2: Значение для атрибута ROWS.
+ * * @param CCOLS (in) VARCHAR2: Значение для атрибута COLS.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_framesetopen(PG_FUNCTION_ARGS)
+{
+ char *crows = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *ccols = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_frameset_tag(crows, ccols, cattributes);
+ htf::pfree_all(crows, ccols, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует парные теги заголовков <H1>-<H6>.
+ * @details Функция создает HTML-заголовок указанного уровня с возможностью выравнивания и дополнительных атрибутов.
+ * * Parameters:
+ * * @param NSIZE (in) NUMBER: Уровень заголовка (1-6).
+ * * @param CHEADER (in) VARCHAR2: Текст заголовка.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CNOWRAP (in) VARCHAR2: Значение для атрибута NOWRAP.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_header(PG_FUNCTION_ARGS)
+{
+ char *clevel = htf::get_numeric_argument_as_string(fcinfo, 0);
+ char *cheader = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracleFull);
+ char *calign = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cnowrap = htf::get_string_argument(fcinfo, 3);
+ char *cclear = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 5);
+
+ text *tag = htf::generate_header_tag(clevel, cheader, calign, cnowrap, cclear, cattributes);
+ htf::pfree_all(clevel, cheader, calign, cnowrap, cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <HR>, создающий горизонтальную линию в HTML-документе.
+ * @details Функция вставляет горизонтальную разделительную линию с возможностью пользовательского изображения.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CSRC (in) VARCHAR2: Значение для атрибута SRC (пользовательское изображение).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_hr(PG_FUNCTION_ARGS)
+{
+ char *cclear = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *csrc = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatSpecialChars);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_hr_tag(cclear, csrc, cattributes);
+ htf::pfree_all(cclear, csrc, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief устаревшая функция для создания заголовков (используйте HEADER).
+ * @details Функция создает заголовок с настраиваемыми атрибутами (устаревшая, рекомендуется HEADER).
+ * * Parameters:
+ * * @param CTITLE (in) VARCHAR2: Текст заголовка.
+ * * @param NSIZE (in) NUMBER: Уровень заголовка.
+ * * @param CALIGN (in) VARCHAR2: Выравнивание.
+ * * @param CNOWRAP (in) VARCHAR2: Запрет переноса.
+ * * @param CCLEAR (in) VARCHAR2: Прерывание обтекания.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_htitle(PG_FUNCTION_ARGS)
+{
+ char *ctitle = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *csize = htf::get_numeric_argument_as_string(fcinfo, 1);
+ char *calign = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cnowrap = htf::get_string_argument(fcinfo, 3);
+ char *cclear = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 5);
+
+ text *tag = htf::generate_htitle_tag(ctitle, csize, calign, cnowrap, cclear, cattributes);
+ htf::pfree_all(ctitle, csize, calign, cnowrap, cclear, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <IMG>, встраивающий изображение в HTML-страницу.
+ * @details Функция создает тег изображения с поддержкой карт встраивания.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: Значение для атрибута SRC (URL изображения).
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CALT (in) VARCHAR2: Значение для атрибута ALT (альтернативный текст).
+ * * @param CISMAP (in) VARCHAR2: Если значение не NULL, добавляет атрибут ISMAP.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты, которые будут включены в тег как есть.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_img(PG_FUNCTION_ARGS)
+{
+ char *csrc = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ char *calign = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *calt = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cismap = htf::get_string_argument(fcinfo, 3);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_img_tag(csrc, calign, calt, cismap, cattributes);
+ htf::pfree_all(csrc, calign, calt, cismap, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <IMG> с поддержкой клиентских карт.
+ * @details Функция создает тег изображения с поддержкой клиентских карт изображения.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: Значение для атрибута SRC (URL изображения).
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CALT (in) VARCHAR2: Значение для атрибута ALT.
+ * * @param CISMAP (in) VARCHAR2: Если значение не NULL, добавляет атрибут ISMAP.
+ * * @param CUSEMAP (in) VARCHAR2: Значение для атрибута USEMAP (клиентская карта).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_img2(PG_FUNCTION_ARGS)
+{
+ char *csrc = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatSpecialChars);
+ char *calign = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *calt = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *cismap = htf::get_string_argument(fcinfo, 3);
+ char *cusemap = htf::get_string_argument(fcinfo, 4, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 5);
+
+ text *tag = htf::generate_img_tag(csrc, calign, calt, cismap, cattributes, cusemap);
+ htf::pfree_all(csrc, calign, calt, cismap, cattributes, cusemap);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief создает однострочное поле ввода с подсказкой для поиска.
+ * @details Функция создает простое поле поиска (устаревший тег <ISINDEX>).
+ * * Parameters:
+ * * @param CPROMPT (in) VARCHAR2: Значение для атрибута PROMPT.
+ * * @param CURL (in) VARCHAR2: Значение для атрибута HREF.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_isindex(PG_FUNCTION_ARGS)
+{
+ char *cprompt = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *chref = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatSpecialChars);
+
+ text *tag = htf::generate_isindex_tag(cprompt, chref);
+ htf::pfree_all(cprompt, chref);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <I> и </I> для отображения текста курсивом.
+ * @details Функция создает теги курсивного выделения текста.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения курсивом.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_italic(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_italic_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <KBD> и </KBD> для отображения клавиатурного ввода.
+ * @details Функция форматирует текст как клавиатурный ввод моноширинным шрифтом.
+ * * Parameters:
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения моноширинным шрифтом.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_kbd(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_kbd_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief синоним функции KBD.
+ * @details Функция форматирует текст как клавиатурный ввод (синоним KBD).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения моноширинным шрифтом.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_keyboard(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_kbd_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief синоним функции HR (горизонтальная линия).
+ * @details Функция создает горизонтальную линию (синоним HR).
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CSRC (in) VARCHAR2: Значение для атрибута SRC.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_line(PG_FUNCTION_ARGS)
+{
+ char *cclear = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *csrc = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatSpecialChars);
+ char *cattributes = htf::get_string_argument(fcinfo, 2);
+
+ text *tag = htf::generate_hr_tag(cclear, csrc, cattributes);
+ htf::pfree_all(cclear, csrc, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <LINK> с атрибутом REL.
+ * @details Функция создает тег <LINK> для определения связи между документами (например, для CSS).
+ * * Parameters:
+ * * @param CREL (in) VARCHAR2: Значение для атрибута REL (отношение от текущего к целевому).
+ * * @param CURL (in) VARCHAR2: Значение для атрибута HREF.
+ * * @param CTITLE (in) VARCHAR2: Значение для атрибута TITLE.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_linkrel(PG_FUNCTION_ARGS)
+{
+ char *crel = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *curl = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatSpecialChars);
+ char *ctitle = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+
+ text *tag = htf::generate_linkrel_tag(crel, curl, ctitle);
+ htf::pfree_all(crel, curl, ctitle);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <LINK> с атрибутом REV.
+ * @details Функция создает тег <LINK> с обратным отношением между документами.
+ * * Parameters:
+ * * @param CREV (in) VARCHAR2: Значение для атрибута REV (отношение от целевого к текущему).
+ * * @param CURL (in) VARCHAR2: Значение для атрибута HREF.
+ * * @param CTITLE (in) VARCHAR2: Значение для атрибута TITLE.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_linkrev(PG_FUNCTION_ARGS)
+{
+ char *crel = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *curl = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatSpecialChars);
+ char *ctitle = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+
+ // включаем флаг rel_is_rev
+ text *tag = htf::generate_linkrel_tag(crel, curl, ctitle, true);
+ htf::pfree_all(crel, curl, ctitle);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует теги <LH> и </LH> для заголовка списка.
+ * @details Функция создает заголовок списка (списки определений).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст заголовка списка.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_listheader(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_listheader_tag(ctext, cattributes);
+ htf::pfree_all(ctext, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <LI> для элемента списка.
+ * @details Функция создает элемент маркированного, нумерованного или определительного списка.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст элемента списка.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CDINGBAT (in) VARCHAR2: Значение для атрибута DINGBAT.
+ * * @param CSRC (in) VARCHAR2: Значение для атрибута SRC.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_listitem(PG_FUNCTION_ARGS)
+{
+ char *ctext = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracleFull);
+ char *cclear = htf::get_string_argument(fcinfo, 1, htf::StringEscapeFormatOracle);
+ char *cdingbat = htf::get_string_argument(fcinfo, 2, htf::StringEscapeFormatOracle);
+ char *csrc = htf::get_string_argument(fcinfo, 3, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 4);
+
+ text *tag = htf::generate_listitem_tag(ctext, cclear, cdingbat, csrc, cattributes);
+ htf::pfree_all(ctext, cclear, cdingbat, csrc, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует mailto-ссылку на email-адрес.
+ * @details Функция создает гиперссылку для отправки email.
+ * * Parameters:
+ * * @param CADDRESS (in) VARCHAR2: Email-адрес получателя.
+ * * @param CTEXT (in) VARCHAR2: Текст ссылки.
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_mailto(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.mailto еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <MAP> для начала определения карты изображения.
+ * @details Функция создает открывающий тег <MAP> для определения областей клиентской карты.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME (имя карты).
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_mapopen(PG_FUNCTION_ARGS)
+{
+ char *cname = htf::get_string_argument(fcinfo, 0, htf::StringEscapeFormatOracle);
+ char *cattributes = htf::get_string_argument(fcinfo, 1);
+
+ text *tag = htf::generate_map_tag(cname, cattributes);
+ htf::pfree_all(cname, cattributes);
+
+ PG_RETURN_TEXT_P(tag);
+}
+
+/**
+ * @brief генерирует тег <META> для мета-информации документа.
+ * @details Функция создает мета-теги для SEO, автоперезагрузки, кодировки и т.д.
+ * * Parameters:
+ * * @param CHTTP_EQUIV (in) VARCHAR2: Значение для атрибута HTTP-EQUIV.
+ * * @param CNAME (in) VARCHAR2: Значение для атрибута NAME.
+ * * @param CCONTENT (in) VARCHAR2: Значение для атрибута CONTENT.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_meta(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.meta еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief устаревшая функция для указания следующего идентификатора.
+ * @details Функция NEXTID устарела и не рекомендуется к использованию в современном HTML.
+ * * Parameters:
+ * * @param CIDENTIFIER (in) VARCHAR2: Следующий доступный идентификатор.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_nextid(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.nextid еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief синоним функции BR (новая строка).
+ * @details Функция создает перевод строки (синоним BR).
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_nl(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.nl еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <NOBR> и </NOBR> для отключения переноса строк.
+ * @details Функция запрещает браузеру переносить указанный текст на новую строку.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст без переносов.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_nobr(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.nobr еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <OL> для начала нумерованного списка.
+ * @details Функция создает открывающий тег упорядоченного (нумерованного) списка.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CWRAP (in) VARCHAR2: Значение для атрибута WRAP.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_olistopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.olistopen еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует открывающий тег <P> с атрибутами.
+ * @details Функция создает тег параграфа с настраиваемыми атрибутами (без закрывающего тега).
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CNOWRAP (in) VARCHAR2: Если значение не NULL, добавляется атрибут NOWRAP.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты для тега <P>.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_paragraph(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.paragraph еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <PARAM> для задания параметров Java-апплета.
+ * @details Функция создает параметры для настройки Java-апплетов в теге <APPLET>.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: Имя параметра.
+ * * @param CVALUE (in) VARCHAR2: Значение параметра.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_param(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.param еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <PLAINTEXT> для отображения текста фиксированным шрифтом.
+ * @details Функция выводит текст фиксированным шрифтом (устаревший тег).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения фиксированным шрифтом.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_plaintext(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.plaintext еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <PRE> для предварительно форматированного текста.
+ * @details Функция создает открывающий тег <PRE>, сохраняющий пробелы и переносы строк.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CWIDTH (in) VARCHAR2: Значение для атрибута WIDTH.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты для тега <PRE>.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_preopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.preopen еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <S> и </S> для перечеркнутого текста.
+ * @details Функция создает перечеркнутый текст (устаревший тег).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения перечеркнутым.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_s(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.s еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <SAMP> для отображения образцов вывода.
+ * @details Функция создает образец вывода программы моноширинным шрифтом.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения в образце.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_sample(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.sample еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <SCRIPT> для встраивания скриптов.
+ * @details Функция создает клиентский скрипт (обычно JavaScript) в HTML-странице.
+ * * Parameters:
+ * * @param CSCRIPT (in) VARCHAR2: Текст скрипта.
+ * * @param CLANGUAGE (in) VARCHAR2: Язык скрипта.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_script(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.script еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief устанавливает режим экранирования HTML-символов.
+ * @details Процедура изменяет режим обработки спецсимволов HTML функциями экранирования.
+ * * Parameters:
+ * * @param P_MODE (in) VARCHAR2: Режим экранирования HTML.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_set_html_escaping_mode(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.set_html_escaping_mode еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <SMALL> и </SMALL> для мелкого текста.
+ * @details Функция создает текст мелким шрифтом (примечания, сноски).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для отображения мелким шрифтом.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_small(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.small еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <STRIKE> и </STRIKE> для зачеркнутого текста.
+ * @details Функция создает перечеркнутый текст (устаревший тег).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для зачеркивания.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_strike(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.strike еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <STRONG> и </STRONG> для выделения жирным шрифтом.
+ * @details Функция создает текст с сильным семантическим выделением (обычно жирный).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для сильного выделения.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_strong(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.strong еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <STYLE> и </STYLE> для встраивания CSS.
+ * @details Функция создает встроенные CSS-стили в HTML-странице.
+ * * Parameters:
+ * * @param CSTYLE (in) VARCHAR2: CSS-стили.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_style(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.style еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <SUB> и </SUB> для нижнего индекса.
+ * @details Функция создает текст как подстрочный индекс (например, в формулах H₂O).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для нижнего индекса.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_sub(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.sub еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <SUP> и </SUP> для верхнего индекса.
+ * @details Функция создает текст как надстрочный индекс (например, 10²).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для верхнего индекса.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_sup(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.sup еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <CAPTION> и </CAPTION> для заголовка таблицы.
+ * @details Функция добавляет заголовок к HTML-таблице.
+ * * Parameters:
+ * * @param CCAPTION (in) VARCHAR2: Текст заголовка таблицы.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_tablecaption(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.tablecaption еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <TD> и </TD> для ячейки данных таблицы.
+ * @details Функция создает ячейку с данными в строке HTML-таблицы.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: Данные для ячейки таблицы.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CDP (in) VARCHAR2: Значение для атрибута DP.
+ * * @param CNOWRAP (in) VARCHAR2: Если значение не NULL, добавляется атрибут NOWRAP.
+ * * @param CROWSPAN (in) VARCHAR2: Значение для атрибута ROWSPAN.
+ * * @param CCOLSPAN (in) VARCHAR2: Значение для атрибута COLSPAN.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_tabledata(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.tabledata еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <TH> и </TH> для ячейки-заголовка таблицы.
+ * @details Функция создает ячейку заголовка в HTML-таблице (обычно жирный шрифт).
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: Данные для ячейки-заголовка.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CDP (in) VARCHAR2: Значение для атрибута DP.
+ * * @param CNOWRAP (in) VARCHAR2: Если значение не NULL, добавляется атрибут NOWRAP.
+ * * @param CROWSPAN (in) VARCHAR2: Количество строк для объединения.
+ * * @param CCOLSPAN (in) VARCHAR2: Количество столбцов для объединения.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_tableheader(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.tableheader еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <TABLE> для начала HTML-таблицы.
+ * @details Функция создает открывающий тег таблицы с настраиваемыми параметрами.
+ * * Parameters:
+ * * @param CBORDER (in) VARCHAR2: Значение для атрибута BORDER.
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CNOWRAP (in) VARCHAR2: Если значение не NULL, добавляется атрибут NOWRAP.
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_tableopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.tableopen еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <TR> для начала строки таблицы.
+ * @details Функция создает открывающий тег строки в HTML-таблице.
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: Значение для атрибута ALIGN.
+ * * @param CVALIGN (in) VARCHAR2: Значение для атрибута VALIGN.
+ * * @param CDP (in) VARCHAR2: Значение для атрибута DP.
+ * * @param CNOWRAP (in) VARCHAR2: Если значение не NULL, добавляется атрибут NOWRAP.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_tablerowopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.tablerowopen еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <TT> и </TT> для текста фиксированной ширины.
+ * @details Функция создает текст шрифтом телетайпа (моноширинный, устаревший тег).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для телетайпа.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_teletype(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.teletype еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <TITLE> и </TITLE> для заголовка окна браузера.
+ * @details Функция устанавливает заголовок HTML-страницы, отображаемый на вкладке браузера.
+ * * Parameters:
+ * * @param CTITLE (in) VARCHAR2: Текст заголовка окна.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_title(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.title еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует тег <UL> для начала ненумерованного списка.
+ * @details Функция создает открывающий тег маркированного (ненумерованного) списка.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: Значение для атрибута CLEAR.
+ * * @param CWRAP (in) VARCHAR2: Значение для атрибута WRAP.
+ * * @param CDINGBAT (in) VARCHAR2: Значение для атрибута DINGBAT.
+ * * @param CSRC (in) VARCHAR2: Значение для атрибута SRC.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты для тега <UL>.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_ulistopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.ulistopen еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <U> и </U> для подчеркнутого текста.
+ * @details Функция создает подчеркнутый текст (устаревший тег, использовать CSS).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст для подчеркивания.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_underline(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.underline еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief генерирует теги <VAR> и </VAR> для обозначения переменной.
+ * @details Функция создает имя переменной (обычно курсивом).
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Текст переменной.
+ * * @param CATTRIBUTES (in) VARCHAR2: Дополнительные атрибуты.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htf_variable(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htf.variable еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/htf/htf.hpp b/src/backend/utils/dbms/htf/htf.hpp
new file mode 100644
index 0000000..5ab2439
--- /dev/null
+++ b/src/backend/utils/dbms/htf/htf.hpp
@@ -0,0 +1,115 @@
+#ifndef HTF_INTERNAL_HPP
+#define HTF_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+} // extern "C"
+
+extern "C"
+{
+Datum htf_address(PG_FUNCTION_ARGS);
+Datum htf_anchor(PG_FUNCTION_ARGS);
+Datum htf_anchor2(PG_FUNCTION_ARGS);
+Datum htf_appletopen(PG_FUNCTION_ARGS);
+Datum htf_area(PG_FUNCTION_ARGS);
+Datum htf_base(PG_FUNCTION_ARGS);
+Datum htf_basefont(PG_FUNCTION_ARGS);
+Datum htf_bgsound(PG_FUNCTION_ARGS);
+Datum htf_big(PG_FUNCTION_ARGS);
+Datum htf_blockquoteopen(PG_FUNCTION_ARGS);
+Datum htf_bodyopen(PG_FUNCTION_ARGS);
+Datum htf_bold(PG_FUNCTION_ARGS);
+Datum htf_br(PG_FUNCTION_ARGS);
+Datum htf_center(PG_FUNCTION_ARGS);
+Datum htf_cite(PG_FUNCTION_ARGS);
+Datum htf_code(PG_FUNCTION_ARGS);
+Datum htf_codepoint(PG_FUNCTION_ARGS);
+Datum htf_comment(PG_FUNCTION_ARGS);
+Datum htf_dfn(PG_FUNCTION_ARGS);
+Datum htf_div(PG_FUNCTION_ARGS);
+Datum htf_dlistdef(PG_FUNCTION_ARGS);
+Datum htf_dlistopen(PG_FUNCTION_ARGS);
+Datum htf_dlistterm(PG_FUNCTION_ARGS);
+Datum htf_em(PG_FUNCTION_ARGS);
+Datum htf_emphasis(PG_FUNCTION_ARGS);
+Datum htf_escape_oracle_full(PG_FUNCTION_ARGS);
+Datum htf_escape_sc(PG_FUNCTION_ARGS);
+Datum htf_escape_url(PG_FUNCTION_ARGS);
+Datum htf_fontopen(PG_FUNCTION_ARGS);
+Datum htf_format_cell(PG_FUNCTION_ARGS);
+Datum htf_formcheckbox(PG_FUNCTION_ARGS);
+Datum htf_formfile(PG_FUNCTION_ARGS);
+Datum htf_formhidden(PG_FUNCTION_ARGS);
+Datum htf_formimage(PG_FUNCTION_ARGS);
+Datum htf_formopen(PG_FUNCTION_ARGS);
+Datum htf_formpassword(PG_FUNCTION_ARGS);
+Datum htf_formradio(PG_FUNCTION_ARGS);
+Datum htf_formreset(PG_FUNCTION_ARGS);
+Datum htf_formselectopen(PG_FUNCTION_ARGS);
+Datum htf_formselectoption(PG_FUNCTION_ARGS);
+Datum htf_formsubmit(PG_FUNCTION_ARGS);
+Datum htf_formtext(PG_FUNCTION_ARGS);
+Datum htf_formtextarea(PG_FUNCTION_ARGS);
+Datum htf_formtextarea2(PG_FUNCTION_ARGS);
+Datum htf_formtextareaopen(PG_FUNCTION_ARGS);
+Datum htf_formtextareaopen2(PG_FUNCTION_ARGS);
+Datum htf_frame(PG_FUNCTION_ARGS);
+Datum htf_framesetopen(PG_FUNCTION_ARGS);
+Datum htf_header(PG_FUNCTION_ARGS);
+Datum htf_hr(PG_FUNCTION_ARGS);
+Datum htf_htitle(PG_FUNCTION_ARGS);
+Datum htf_img(PG_FUNCTION_ARGS);
+Datum htf_img2(PG_FUNCTION_ARGS);
+Datum htf_isindex(PG_FUNCTION_ARGS);
+Datum htf_italic(PG_FUNCTION_ARGS);
+Datum htf_kbd(PG_FUNCTION_ARGS);
+Datum htf_keyboard(PG_FUNCTION_ARGS);
+Datum htf_line(PG_FUNCTION_ARGS);
+Datum htf_linkrel(PG_FUNCTION_ARGS);
+Datum htf_linkrev(PG_FUNCTION_ARGS);
+Datum htf_listheader(PG_FUNCTION_ARGS);
+Datum htf_listitem(PG_FUNCTION_ARGS);
+Datum htf_mailto(PG_FUNCTION_ARGS);
+Datum htf_mapopen(PG_FUNCTION_ARGS);
+Datum htf_meta(PG_FUNCTION_ARGS);
+Datum htf_nextid(PG_FUNCTION_ARGS);
+Datum htf_nl(PG_FUNCTION_ARGS);
+Datum htf_nobr(PG_FUNCTION_ARGS);
+Datum htf_olistopen(PG_FUNCTION_ARGS);
+Datum htf_paragraph(PG_FUNCTION_ARGS);
+Datum htf_param(PG_FUNCTION_ARGS);
+Datum htf_plaintext(PG_FUNCTION_ARGS);
+Datum htf_preopen(PG_FUNCTION_ARGS);
+Datum htf_s(PG_FUNCTION_ARGS);
+Datum htf_sample(PG_FUNCTION_ARGS);
+Datum htf_script(PG_FUNCTION_ARGS);
+Datum htf_set_html_escaping_mode(PG_FUNCTION_ARGS);
+Datum htf_small(PG_FUNCTION_ARGS);
+Datum htf_strike(PG_FUNCTION_ARGS);
+Datum htf_strong(PG_FUNCTION_ARGS);
+Datum htf_style(PG_FUNCTION_ARGS);
+Datum htf_sub(PG_FUNCTION_ARGS);
+Datum htf_sup(PG_FUNCTION_ARGS);
+Datum htf_tablecaption(PG_FUNCTION_ARGS);
+Datum htf_tabledata(PG_FUNCTION_ARGS);
+Datum htf_tableheader(PG_FUNCTION_ARGS);
+Datum htf_tableopen(PG_FUNCTION_ARGS);
+Datum htf_tablerowopen(PG_FUNCTION_ARGS);
+Datum htf_teletype(PG_FUNCTION_ARGS);
+Datum htf_title(PG_FUNCTION_ARGS);
+Datum htf_ulistopen(PG_FUNCTION_ARGS);
+Datum htf_underline(PG_FUNCTION_ARGS);
+Datum htf_variable(PG_FUNCTION_ARGS);
+} // extern "C"
+
+#endif // HTF_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/htf/htf_common.cpp b/src/backend/utils/dbms/htf/htf_common.cpp
new file mode 100644
index 0000000..9321061
--- /dev/null
+++ b/src/backend/utils/dbms/htf/htf_common.cpp
@@ -0,0 +1,997 @@
+#include "htf_common.hpp"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+}
+
+namespace htf{
+unsigned int symbol_digit(char *txtptr){
+ if(txtptr){
+ int encoding = GetDatabaseEncoding();
+ int char_len = pg_encoding_mblen(encoding, txtptr);
+ if(char_len == 1)
+ return (unsigned char)txtptr[0];
+ else{
+ pg_wchar wc_buf[2];
+ int conv = pg_mb2wchar_with_len(txtptr, wc_buf, char_len);
+ if (conv > 0){
+ return (unsigned int)wc_buf[0];
+ }
+ }
+ }
+ return 0;
+}
+char *
+escape_to_numeric_entity(text *input, bool full)
+{
+ const char *data = VARDATA_ANY(input);
+ int len = VARSIZE_ANY_EXHDR(input);
+ StringInfoData result;
+
+ /* Инициализация буфера для результата */
+ initStringInfo(&result);
+ if (len == 0)
+ return result.data;
+
+ int encoding = GetDatabaseEncoding();
+ int byte_pos = 0;
+
+ while (byte_pos < len)
+ {
+ int char_len = pg_encoding_mblen(encoding, data + byte_pos);
+ if (char_len <= 0 || byte_pos + char_len > len)
+ break;
+
+ if (char_len == 1)
+ {
+ unsigned char c = data[byte_pos];
+ if(full) {
+ if(c == '"'){
+ appendStringInfo(&result, """);
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '<'){
+ appendStringInfo(&result, "<");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '>'){
+ appendStringInfo(&result, ">");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '&'){
+ appendStringInfo(&result, "&");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c<='~'){
+ appendStringInfoChar(&result, c);
+ byte_pos += char_len;
+ continue;
+ }
+ }
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
+ (c >= '0' && c <= '9') || c == '_' || c == '-' || c == '.' ||
+ c == ',')
+ {
+ appendStringInfoChar(&result, c);
+ byte_pos += char_len;
+ continue;
+ }
+ }
+
+ /* Для однобайтовых небезопасных и многобайтовых — декодируем */
+ pg_wchar wc_buf[2];
+ int conv = pg_mb2wchar_with_len(data + byte_pos, wc_buf, char_len);
+ if (conv > 0){
+ int digits = 1;
+ unsigned int temp = wc_buf[0];
+ while (temp > 15) {
+ temp >>= 4;
+ digits++;
+ }
+ // Если цифр нечётное - увеличиваем на 1 (добавим один ведущий ноль)
+ if (digits % 2 != 0) {
+ digits++;
+ }
+ appendStringInfo(&result, "&#x%0*X;", digits, (unsigned int) wc_buf[0]);
+ }
+ else
+ appendStringInfoChar(&result, '?');
+
+ byte_pos += char_len;
+ }
+
+ return result.data;
+}
+char *
+escape_to_ltgt(text *input)
+{
+ const char *data = VARDATA_ANY(input);
+ int len = VARSIZE_ANY_EXHDR(input);
+ StringInfoData result;
+
+ /* Инициализация буфера для результата */
+ initStringInfo(&result);
+ if (len == 0)
+ return result.data;
+
+ int encoding = GetDatabaseEncoding();
+ int byte_pos = 0;
+
+ while (byte_pos < len)
+ {
+ int char_len = pg_encoding_mblen(encoding, data + byte_pos);
+ if (char_len <= 0 || byte_pos + char_len > len)
+ break;
+
+ if (char_len == 1)
+ {
+ unsigned char c = data[byte_pos];
+
+ if(c == '<'){
+ appendStringInfo(&result, "<");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '>'){
+ appendStringInfo(&result, ">");
+ byte_pos += char_len;
+ continue;
+ }
+
+ // просто добавление любого однобайтового символа
+ appendStringInfoChar(&result, c);
+ byte_pos += char_len;
+ continue;
+
+ }
+
+ const char *sym = data + byte_pos;
+ for(int i = 0; i<char_len; i++){
+ appendStringInfoChar(&result, sym[i]);
+ }
+ byte_pos += char_len;
+ }
+
+ return result.data;
+}
+char *escape_special_chars(text *input){
+ if(input == NULL)
+ return NULL;
+ char *str = text_to_cstring(input);
+ xmlBufferPtr buf = xmlBufferCreate();
+ if (!buf) return NULL;
+ xmlOutputBufferPtr out = xmlOutputBufferCreateBuffer(buf, NULL);
+ if (!out) {
+ xmlBufferFree(buf);
+ return NULL;
+ }
+
+ xmlChar *escaped_code = xmlEncodeSpecialChars(NULL, (xmlChar*)str);
+ xmlOutputBufferWriteString(out, (char*)escaped_code);
+ xmlFree(escaped_code);
+ pfree(str);
+
+
+ xmlOutputBufferFlush(out);
+ const xmlChar *content = xmlBufferContent(buf);
+ size_t len = xmlBufferLength(buf);
+
+ char *result = (char*)palloc(len + 1);
+ if (result) {
+ memcpy(result, content, len);
+ result[len] = '\0';
+ }
+
+ xmlOutputBufferClose(out); // также освобождает buf
+ return result; // освобождать через pfree()
+}
+char *
+get_string_argument(FunctionCallInfo fcinfo, int argnum, StringEscapeFormat type)
+{
+ if (PG_ARGISNULL(argnum))
+ return NULL;
+ text *arg_txt = PG_GETARG_TEXT_PP(argnum);
+ char *result = NULL;
+ if (VARSIZE_ANY_EXHDR(arg_txt) == 0)
+ return NULL;
+ switch(type){
+ case StringEscapeFormatSpecialChars:
+ result = escape_special_chars(arg_txt);
+ break;
+ case StringEscapeFormatOracle:
+ result = escape_to_numeric_entity(arg_txt);
+ break;
+ case StringEscapeFormatOracleFull:
+ result = escape_to_numeric_entity(arg_txt, true);
+ break;
+ case StringEscapeFormatNone:
+ result = text_to_cstring(arg_txt);
+ default:
+ result = escape_to_ltgt(arg_txt);
+ break;
+ }
+ return result;
+}
+char *
+get_numeric_argument_as_string(FunctionCallInfo fcinfo, int argnum)
+{
+ /* Проверяем, не NULL ли аргумент */
+ if (PG_ARGISNULL(argnum))
+ return NULL;
+
+ /* Получаем Datum с аргументом типа NUMERIC */
+ Datum numeric_datum = PG_GETARG_DATUM(argnum);
+
+ /* Преобразуем NUMERIC в C-строку через выходную функцию типа */
+ Datum str_datum = DirectFunctionCall1(numeric_out, numeric_datum);
+
+ /* Возвращаем строку (char* уже в памяти palloc) */
+ return DatumGetCString(str_datum);
+}
+void append_attribute_string(StringInfo res, const char *value){
+ if(value)
+ appendStringInfo(res, " %s", value);
+}
+void append_attribute_quot(StringInfo res, const char *name, const char *value, bool nullvalok){
+ if(name){
+ if(value)
+ appendStringInfo(res, " %s=\"%s\"", name, value);
+ else{
+ if(nullvalok)
+ appendStringInfo(res, " %s=\"\"", name);
+ }
+ }
+}
+void append_attribute(StringInfo res, const char *name, const char *value, bool nullvalok){
+ if(name){
+ if(value)
+ appendStringInfo(res, " %s=%s", name, value);
+ else{
+ if(nullvalok)
+ appendStringInfo(res, " %s=", name);
+ }
+ }
+}
+
+text *generate_applet_tag(const char *ccode, const char *cwidth, const char *cheight, const char *cattr){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<applet");
+
+ append_attribute(result, "code", ccode);
+ append_attribute(result, "width", cwidth);
+ append_attribute(result, "height", cheight);
+ append_attribute_string(result, cattr);
+
+
+ appendStringInfo(result, ">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_address_tag(const char *cvalue, const char *cnowrap, const char *cclear, const char *cattr)
+{
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<address");
+
+ append_attribute_quot(result, "clear", cclear);
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ append_attribute_string(result, cattr);
+
+
+ appendStringInfo(result, ">%s</address>", cvalue ? cvalue : "");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_body_tag(const char *cbackground, const char *cattr)
+{
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<body");
+
+ append_attribute_quot(result, "background", cbackground);
+ append_attribute_string(result, cattr);
+
+ appendStringInfo(result, ">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_formselect_tag(const char *cname, const char *cprompt, const char *csize, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ if(cprompt){
+ appendStringInfo(result, "%s", cprompt);
+ }
+ appendStringInfo(result, "<select");
+
+ append_attribute_quot(result, "name", cname);
+ append_attribute_quot(result, "size", csize);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_map_tag(const char *cname, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<map");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_formtext_tag(const char *cname, const char *csize, const char *cmaxlength, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"text\"");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "size", csize);
+ append_attribute_quot(result, "maxlength", cmaxlength);
+ append_attribute_quot(result, "value", cvalue);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_textarea_tag(const char *cname, const char *crows, const char *ccols, const char * calign, const char *cattributes,
+ const char *cwrap){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<textarea");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "rows", crows, true);
+ append_attribute_quot(result, "cols", ccols, true);
+ append_attribute_quot(result, "align", calign);
+ append_attribute_quot(result, "wrap", cwrap);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_formtextarea_tag(const char *cname, const char *crows, const char *ccolumns, const char *calign, const char *cattributes,
+ const char *cwrap){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<textarea");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "rows", crows, true);
+ append_attribute_quot(result, "cols", ccolumns, true);
+ append_attribute_quot(result, "align", calign);
+ append_attribute_quot(result, "wrap", cwrap);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, "></textarea>");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_anchor_tag(const char *curl, const char *ctext, const char *cname, const char *cattributes,
+ const char *ctarget){
+ StringInfo result = makeStringInfo();
+ if(curl == NULL || cname == NULL){
+ appendStringInfo(result, "<!-- ERROR in anchor2 usage, curl and cname cannot be NULL --><a name=\" \">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+ }
+ appendStringInfo(result, "<a");
+
+ append_attribute_quot(result, "href", curl);
+ append_attribute_quot(result, "name", cname);
+ append_attribute_quot(result, "target", ctarget);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">%s</a>", ctext ? ctext : "");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_area_tag(const char *ccoord, const char *cshape, const char *chref, const char *cnohref, const char *ctarget, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<area");
+
+ append_attribute_quot(result, "shape", cshape);
+ append_attribute_quot(result, "coords", ccoord, true);
+ append_attribute_quot(result, "href", chref);
+ if(cnohref){
+ appendStringInfo(result, " nohref=\"nohref\"");
+ }
+ append_attribute_quot(result, "target", ctarget);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_basefont_tag(const char *csize, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<basefont");
+
+ append_attribute_quot(result, "size", csize, true);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_bgsound_tag(const char *csrc, const char *cloop, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<bgsound");
+
+ append_attribute_quot(result, "src", csrc, true);
+ append_attribute_quot(result, "loop", cloop);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">");
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text* generate_big_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<big");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">");
+ appendStringInfo(result, "%s</big>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_blockquote_tag(bool cnowrap, const char *cclear, const char * cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<blockquote");
+
+ append_attribute_quot(result, "clear", cclear);
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_bold_tag(const char *ctext, const char *cattr){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<b");
+
+ append_attribute_string(result, cattr);
+ appendStringInfo(result, ">%s</b>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_br_tag(const char *cclear, const char * cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<br");
+
+ append_attribute_quot(result, "clear", cclear);
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_center_tag(const char *ctext){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<center>");
+
+ appendStringInfo(result, "%s</center>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_cite_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<cite");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</cite>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_code_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<code");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</code>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_comment_tag(const char *ctext){
+ StringInfo result = makeStringInfo();
+
+ appendStringInfo(result, "<!-- ''%s -->", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_dfn_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<dfn");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</dfn>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_div_tag(const char *calign, const char * cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<div");
+
+ append_attribute_quot(result, "align", calign);
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_dlistdef_tag(const char *ctext, const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<dd");
+
+ append_attribute_quot(result, "clear", cclear);
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_dlistopen_tag(const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<dl");
+
+ append_attribute_quot(result, "clear", cclear);
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_dlistterm_tag(const char *ctext, const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<dt");
+
+ append_attribute_quot(result, "clear", cclear);
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_em_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<em");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</em>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_font_tag(const char *ccolor, const char *cface, const char *csize, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<font");
+
+ append_attribute_quot(result, "color", ccolor);
+ append_attribute_quot(result, "face", cface);
+ append_attribute_quot(result, "size", csize);
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_tabledata_tag(const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<td");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">");
+
+ if (cvalue) {
+ appendStringInfo(result, "%s", cvalue);
+ }
+
+ appendStringInfo(result, "</td>");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_formcheckbox_tag(const char *cname, const char *cvalue, const char *cchecked, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"checkbox\"");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "value", cvalue);
+
+ if(cchecked){
+ appendStringInfo(result, " checked=\"checked\"");
+ }
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formfile_tag(const char *cname, const char *caccept, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"file\"");
+
+ append_attribute_quot(result, "name", cname);
+ append_attribute_quot(result, "accept", caccept);
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formhidden_tag(const char *cname, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"hidden\"");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "value", cvalue, true);
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formimage_tag(const char *cname, const char *cvalue, const char *calign, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"image\"");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "src", cvalue, true);
+ append_attribute_quot(result, "align", calign);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formopen_tag(const char *curl, const char *cmethod, const char *ctarget, const char *cenctype, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<form");
+
+ append_attribute_quot(result, "action", curl, true);
+ append_attribute_quot(result, "method", cmethod, true);
+ append_attribute_quot(result, "target", ctarget);
+ append_attribute_quot(result, "enctype", cenctype);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formpassword_tag(const char *cname, const char *csize, const char *cmaxlength, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"password\"");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "size", csize);
+ append_attribute_quot(result, "maxlength", cmaxlength);
+ append_attribute_quot(result, "value", cvalue);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formradio_tag(const char *cname, const char *cvalue, const char *cchecked, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"radio\"");
+
+ append_attribute_quot(result, "name", cname, true);
+ append_attribute_quot(result, "value", cvalue, true);
+
+ if(cchecked){
+ appendStringInfo(result, " checked=\"checked\"");
+ }
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formreset_tag(const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"reset\"");
+
+ append_attribute_quot(result, "VALUE", cvalue, true);
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formselectoption_tag(const char *cvalue, const char *cselected, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<option");
+
+ if(cselected){
+ appendStringInfo(result, " selected=\"selected\"");
+ }
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</option>", cvalue ? cvalue : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_formsubmit_tag(const char *cname, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"submit\"");
+
+ append_attribute_quot(result, "name", cname);
+ append_attribute_quot(result, "value", cvalue);
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_frame_tag(const char *csrc, const char *cname, const char *cmarginwidth, const char *cmarginheight, const char *cscrolling, const char *cnoresize, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<frame");
+
+ append_attribute_quot(result, "src", csrc, true);
+ append_attribute_quot(result, "name", cname);
+ append_attribute_quot(result, "marginwidth", cmarginwidth);
+ append_attribute_quot(result, "marginheight", cmarginheight);
+ append_attribute_quot(result, "scrolling", cscrolling);
+ if(cnoresize){
+ appendStringInfo(result, " noresize=\"noresize\"");
+ }
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_frameset_tag(const char *crows, const char *ccols, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<frameset");
+
+ append_attribute_quot(result, "rows", crows);
+ append_attribute_quot(result, "cols", ccols);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_header_tag(const char *clevel, const char *cheader, const char *calign, const char *cnowrap, const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<h%s", clevel ? clevel : "");
+
+ append_attribute_quot(result, "align", calign);
+ append_attribute_quot(result, "clear", cclear);
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">%s</h%s>", cheader ? cheader : "", clevel ? clevel : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_hr_tag(const char *cclear, const char *csrc, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<hr");
+
+ append_attribute_quot(result, "clear", cclear, false);
+ append_attribute_quot(result, "src", csrc, false);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_htitle_tag(const char *ctitle, const char *csize, const char *calign, const char *cnowrap, const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+
+ // Генерируем тег <title>
+ appendStringInfo(result, "<title>%s</title>", ctitle ? ctitle : "");
+
+ // Генерируем тег <h>
+ appendStringInfo(result, "<h%s", csize ? csize : "");
+
+ append_attribute_quot(result, "align", calign);
+ append_attribute_quot(result, "clear", cclear);
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">%s</h%s>", ctitle ? ctitle : "", csize ? csize : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_img_tag(const char *csrc, const char *calign, const char *calt, const char *cismap, const char *cattributes, const char *cusemap){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<img");
+
+ append_attribute_quot(result, "src", csrc, true);
+ append_attribute_quot(result, "align", calign);
+ append_attribute_quot(result, "alt", calt);
+ if(cismap){
+ appendStringInfo(result, " ismap=\"ismap\"");
+ }
+ append_attribute_quot(result, "usemap", cusemap);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_isindex_tag(const char *cprompt, const char *chref){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<isindex");
+
+ append_attribute_quot(result, "prompt", cprompt);
+ append_attribute_quot(result, "href", chref);
+
+ appendStringInfo(result, ">");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_italic_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<i");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</i>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_kbd_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<kbd");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</kbd>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_linkrel_tag(const char *crel, const char *curl, const char *ctitle,
+ bool rel_is_rev){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<link");
+
+ append_attribute_quot(result, rel_is_rev ? "rev":"rel", crel, true);
+ append_attribute_quot(result, "href", curl, true);
+ append_attribute_quot(result, "title", ctitle);
+ appendStringInfo(result, " />");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+text *generate_listheader_tag(const char *ctext, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<lh");
+
+ append_attribute_string(result, cattributes);
+ appendStringInfo(result, ">%s</lh>", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+text *generate_listitem_tag(const char *ctext, const char *cclear, const char *cdingbat, const char *csrc, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<li");
+
+
+ append_attribute_quot(result, "clear", cclear);
+ append_attribute_quot(result, "dingbat", cdingbat);
+ append_attribute_quot(result, "src", csrc);
+ append_attribute_string(result, cattributes);
+
+ appendStringInfo(result, ">%s", ctext ? ctext : "");
+
+ text *ret = cstring_to_text(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+
+} // namespace htf
+extern "C"
+{
+} // extern "C"
diff --git a/src/backend/utils/dbms/htf/htf_common.hpp b/src/backend/utils/dbms/htf/htf_common.hpp
new file mode 100644
index 0000000..11a64ac
--- /dev/null
+++ b/src/backend/utils/dbms/htf/htf_common.hpp
@@ -0,0 +1,121 @@
+#ifndef HTF_COMMON_INTERNAL_HPP
+#define HTF_COMMON_INTERNAL_HPP
+
+#include <string>
+#include <libxml/HTMLparser.h>
+#include <libxml/HTMLtree.h>
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+#include "mb/pg_wchar.h"
+#include "lib/stringinfo.h"
+} // extern "C"
+
+namespace htf{
+typedef enum StringEscapeFormat{
+ StringEscapeFormatNone,
+ StringEscapeFormatSpecialChars, // xmlEncodeSpecialChars из libxml2
+ StringEscapeFormatOracle, // oracle-style from htp
+ StringEscapeFormatOracleFull, // oracle-style + for symbol "<>& - ", &qt; ... etc.
+ StringEscapeFormatLtGtChars
+} StringEscapeFormat;
+
+// Вспомогательная функция для одиночного указателя
+template<typename T>
+static inline void pfree_if_not_null(T*& ptr) {
+ if (ptr != NULL) {
+ pfree(ptr);
+ ptr = NULL; // предотвращает случайное повторное освобождение
+ }
+}
+
+// Вариативный шаблон для произвольного числа аргументов (по ссылке)
+template<typename... Args>
+static void pfree_all(Args&... args) {
+ (pfree_if_not_null(args), ...);
+}
+
+unsigned int symbol_digit(char *txtptr);
+// латинские буквы, _,-, цифры - оставляем как есть, остальное экранируем
+// full - смешанный стиль (дополняется тем, что для односимвольного текста стандартное xml экранирование)
+char *
+escape_to_numeric_entity(text *input, bool full = false);
+char *escape_special_chars(text *input);
+char *
+get_string_argument(FunctionCallInfo fcinfo, int argnum, StringEscapeFormat type = StringEscapeFormatNone);
+char *
+get_numeric_argument_as_string(FunctionCallInfo fcinfo, int argnum);
+
+void append_attribute_string(StringInfo res, const char *value);
+void append_attribute_quot(StringInfo res, const char *name, const char *value, bool nullvalok = false);
+void append_attribute(StringInfo res, const char *name, const char *value, bool nullvalok = true);
+
+
+
+text *generate_applet_tag(const char *ccode, const char *cwidth, const char *cheight, const char *cattr);
+text *generate_address_tag(const char *cvalue, const char *cnowrap, const char *cclear, const char *cattr);
+text *generate_body_tag(const char *cbackground, const char *cattr);
+text* generate_formselect_tag(const char *cname, const char *cprompt, const char *csize, const char *cattributes);
+text* generate_map_tag(const char *cname, const char *cattributes);
+text* generate_formtext_tag(const char *cname, const char *csize, const char *cmaxlength, const char *cvalue, const char *cattributes);
+text* generate_textarea_tag(const char *cname, const char *crows, const char *ccols, const char * calign, const char *cattributes,
+ const char *cwrap = NULL);
+text* generate_formtextarea_tag(const char *cname, const char *crows, const char *ccolumns, const char *calign, const char *cattributes,
+ const char *cwrap = NULL);
+text* generate_anchor_tag(const char *curl, const char *ctext, const char *cname, const char *cattributes,
+ const char *ctarget = NULL);
+text* generate_area_tag(const char *ccoord, const char *cshape, const char *chref, const char *cnohref, const char *ctarget, const char *cattributes);
+text* generate_basefont_tag(const char *csize, const char *cattributes);
+text* generate_bgsound_tag(const char *csrc, const char *cloop, const char *cattributes);
+text* generate_big_tag(const char *ctext, const char *cattributes);
+text *generate_blockquote_tag(bool cnowrap, const char *cclear, const char * cattributes);
+text *generate_bold_tag(const char *ctext, const char *cattr);
+text *generate_br_tag(const char *cclear, const char * cattributes);
+text *generate_center_tag(const char *ctext);
+text *generate_cite_tag(const char *ctext, const char *cattributes);
+text *generate_code_tag(const char *ctext, const char *cattributes);
+text *generate_comment_tag(const char *ctext);
+text *generate_dfn_tag(const char *ctext, const char *cattributes);
+text *generate_div_tag(const char *calign, const char * cattributes);
+text *generate_dlistdef_tag(const char *ctext, const char *cclear, const char *cattributes);
+text *generate_dlistopen_tag(const char *cclear, const char *cattributes);
+text *generate_dlistterm_tag(const char *ctext, const char *cclear, const char *cattributes);
+text *generate_em_tag(const char *ctext, const char *cattributes);
+text *generate_font_tag(const char *ccolor, const char *cface, const char *csize, const char *cattributes);
+text *generate_tabledata_tag(const char *cvalue, const char *cattributes);
+text *generate_formcheckbox_tag(const char *cname, const char *cvalue, const char *cchecked, const char *cattributes);
+text *generate_formfile_tag(const char *cname, const char *caccept, const char *cattributes);
+text *generate_formhidden_tag(const char *cname, const char *cvalue, const char *cattributes);
+text *generate_formimage_tag(const char *cname, const char *cvalue, const char *calign, const char *cattributes);
+text *generate_formopen_tag(const char *curl, const char *cmethod, const char *ctarget, const char *cenctype, const char *cattributes);
+text *generate_formpassword_tag(const char *cname, const char *csize, const char *cmaxlength, const char *cvalue, const char *cattributes);
+text *generate_formradio_tag(const char *cname, const char *cvalue, const char *cchecked, const char *cattributes);
+text *generate_formreset_tag(const char *cvalue, const char *cattributes);
+text *generate_formselectoption_tag(const char *cvalue, const char *cselected, const char *cattributes);
+text *generate_formsubmit_tag(const char *cname, const char *cvalue, const char *cattributes);
+text *generate_frame_tag(const char *csrc, const char *cname, const char *cmarginwidth, const char *cmarginheight, const char *cscrolling, const char *cnoresize, const char *cattributes);
+text *generate_frameset_tag(const char *crows, const char *ccols, const char *cattributes);
+text *generate_header_tag(const char *clevel, const char *cheader, const char *calign, const char *cnowrap, const char *cclear, const char *cattributes);
+text *generate_hr_tag(const char *cclear, const char *csrc, const char *cattributes);
+text *generate_htitle_tag(const char *ctitle, const char *csize, const char *calign, const char *cnowrap, const char *cclear, const char *cattributes);
+text *generate_img_tag(const char *csrc, const char *calign, const char *calt, const char *cismap, const char *cattributes, const char *cusemap = NULL);
+text *generate_isindex_tag(const char *cprompt, const char *chref);
+text *generate_italic_tag(const char *ctext, const char *cattributes);
+text *generate_kbd_tag(const char *ctext, const char *cattributes);
+text *generate_linkrel_tag(const char *crel, const char *curl, const char *ctitle, bool rel_is_rev = false);
+text *generate_listheader_tag(const char *ctext, const char *cattributes);
+text *generate_listitem_tag(const char *ctext, const char *cclear, const char *cdingbat, const char *csrc, const char *cattributes);
+
+}// namespace htf
+
+#endif // HTF_COMMON_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/htp/htp.cpp b/src/backend/utils/dbms/htp/htp.cpp
new file mode 100644
index 0000000..eda35d4
--- /dev/null
+++ b/src/backend/utils/dbms/htp/htp.cpp
@@ -0,0 +1,3703 @@
+#include <string>
+
+#include "dbms/htp.h"
+#include <libxml/HTMLparser.h>
+#include <libxml/HTMLtree.h>
+#include "dbms/owa.h"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "mb/pg_wchar.h"
+#include "lib/stringinfo.h"
+}
+
+static std::string html_buffer{};
+bool test_mode = false;
+
+namespace htp{
+typedef enum StringEscapeFormat{
+ StringEscapeFormatNone,
+ StringEscapeFormatSpecialChars, // xmlEncodeSpecialChars из libxml2
+ StringEscapeFormatOracle, // oracle-style from htp
+ StringEscapeFormatOracleFull, // oracle-style + for symbol "<>& - ", &qt; ... etc.
+ StringEscapeLtGtChars // escape only <> symbols (used for tag attributes)
+} StringEscapeFormat;
+void html_buffer_add(const char *str){
+ if (test_mode)
+ {
+ html_buffer.clear();
+ }
+ html_buffer.append(str);
+ html_buffer.push_back('\n');
+ ereport(NOTICE, (errmsg("HTML: \n%s", html_buffer.c_str())));
+}
+
+// Вспомогательная функция для одиночного указателя
+template<typename T>
+static inline void pfree_if_not_null(T*& ptr) {
+ if (ptr != NULL) {
+ pfree(ptr);
+ ptr = NULL; // предотвращает случайное повторное освобождение
+ }
+}
+
+// Вариативный шаблон для произвольного числа аргументов (по ссылке)
+template<typename... Args>
+static void pfree_all(Args&... args) {
+ (pfree_if_not_null(args), ...);
+}
+
+// латинские буквы, _,-, цифры - оставляем как есть, остальное экранируем
+// full - смешанный стиль (дополняется тем, что для односимвольного текста стандартное xml экранирование)
+char *
+escape_to_numeric_entity(text *input, bool full = false)
+{
+ const char *data = VARDATA_ANY(input);
+ int len = VARSIZE_ANY_EXHDR(input);
+ StringInfoData result;
+
+ /* Инициализация буфера для результата */
+ initStringInfo(&result);
+ if (len == 0)
+ return result.data;
+
+ int encoding = GetDatabaseEncoding();
+ int byte_pos = 0;
+
+ while (byte_pos < len)
+ {
+ int char_len = pg_encoding_mblen(encoding, data + byte_pos);
+ if (char_len <= 0 || byte_pos + char_len > len)
+ break;
+
+ if (char_len == 1)
+ {
+ unsigned char c = data[byte_pos];
+ if(full) {
+ if(c == '"'){
+ appendStringInfo(&result, """);
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '<'){
+ appendStringInfo(&result, "<");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '>'){
+ appendStringInfo(&result, ">");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c == '&'){
+ appendStringInfo(&result, "&");
+ byte_pos += char_len;
+ continue;
+ }
+ if(c<='~'){
+ appendStringInfoChar(&result, c);
+ byte_pos += char_len;
+ continue;
+ }
+ }
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
+ (c >= '0' && c <= '9') || c == '_' || c == '-' || c == '.' ||
+ c == ',')
+ {
+ appendStringInfoChar(&result, c);
+ byte_pos += char_len;
+ continue;
+ }
+ }
+
+ /* Для однобайтовых небезопасных и многобайтовых — декодируем */
+ pg_wchar wc_buf[2];
+ int conv = pg_mb2wchar_with_len(data + byte_pos, wc_buf, char_len);
+ if (conv > 0){
+ int digits = 1;
+ unsigned int temp = wc_buf[0];
+ while (temp > 15) {
+ temp >>= 4;
+ digits++;
+ }
+ // Если цифр нечётное - увеличиваем на 1 (добавим один ведущий ноль)
+ if (digits % 2 != 0) {
+ digits++;
+ }
+ appendStringInfo(&result, "&#x%0*X;", digits, (unsigned int) wc_buf[0]);
+ }
+ else
+ appendStringInfoChar(&result, '?');
+
+ byte_pos += char_len;
+ }
+
+ return result.data;
+}
+char *escape_special_chars(text *input){
+ if(input == NULL)
+ return NULL;
+ char *str = text_to_cstring(input);
+ xmlBufferPtr buf = xmlBufferCreate();
+ if (!buf) return NULL;
+ xmlOutputBufferPtr out = xmlOutputBufferCreateBuffer(buf, NULL);
+ if (!out) {
+ xmlBufferFree(buf);
+ return NULL;
+ }
+
+ xmlChar *escaped_code = xmlEncodeSpecialChars(NULL, (xmlChar*)str);
+ xmlOutputBufferWriteString(out, (char*)escaped_code);
+ xmlFree(escaped_code);
+ pfree(str);
+
+
+ xmlOutputBufferFlush(out);
+ const xmlChar *content = xmlBufferContent(buf);
+ size_t len = xmlBufferLength(buf);
+
+ char *result = (char*)palloc(len + 1);
+ if (result) {
+ memcpy(result, content, len);
+ result[len] = '\0';
+ }
+
+ xmlOutputBufferClose(out); // также освобождает buf
+ return result; // освобождать через pfree()
+}
+char *escape_ltgt_chars(text *input){
+ if (input == nullptr)
+ {
+ return nullptr;
+ }
+ const char *data = VARDATA_ANY(input);
+ int len = VARSIZE_ANY_EXHDR(input);
+ int byte_pos = 0;
+ StringInfoData result;
+
+ initStringInfo(&result);
+ if (len == 0)
+ {
+ return result.data;
+ }
+
+ // processing as ASCII as it is considered to be ASCII (observation from tests)
+ while (byte_pos < len)
+ {
+ if (data[byte_pos] == '<')
+ {
+ appendStringInfo(&result, "<");
+ }
+ else if (data[byte_pos] == '>')
+ {
+ appendStringInfo(&result, ">");
+ }
+ else
+ {
+ appendStringInfoChar(&result, data[byte_pos]);
+ }
+ byte_pos++;
+ }
+
+ return result.data;
+}
+char *
+get_string_argument(FunctionCallInfo fcinfo, int argnum, StringEscapeFormat type = StringEscapeFormatNone)
+{
+ if (PG_ARGISNULL(argnum))
+ return NULL;
+ text *arg_txt = PG_GETARG_TEXT_PP(argnum);
+ char *result = NULL;
+ if (VARSIZE_ANY_EXHDR(arg_txt) == 0)
+ return NULL;
+ switch(type){
+ case StringEscapeFormatSpecialChars:
+ result = escape_special_chars(arg_txt);
+ break;
+ case StringEscapeFormatOracle:
+ result = escape_to_numeric_entity(arg_txt);
+ break;
+ case StringEscapeFormatOracleFull:
+ result = escape_to_numeric_entity(arg_txt, true);
+ break;
+ case StringEscapeLtGtChars:
+ result = escape_ltgt_chars(arg_txt);
+ break;
+ default:
+ result = text_to_cstring(arg_txt);
+ break;
+ }
+ return result;
+}
+static char *
+get_numeric_argument_as_string(FunctionCallInfo fcinfo, int argnum)
+{
+ /* Проверяем, не NULL ли аргумент */
+ if (PG_ARGISNULL(argnum))
+ return NULL;
+
+ /* Получаем Datum с аргументом типа NUMERIC */
+ Datum numeric_datum = PG_GETARG_DATUM(argnum);
+
+ /* Преобразуем NUMERIC в C-строку через выходную функцию типа */
+ Datum str_datum = DirectFunctionCall1(numeric_out, numeric_datum);
+
+ /* Возвращаем строку (char* уже в памяти palloc) */
+ return DatumGetCString(str_datum);
+}
+char* generate_applet_tag(const char *code, int width, bool width_is_set, int height, bool height_is_set, const char *other_attrs) {
+ xmlBufferPtr buf = xmlBufferCreate();
+ if (!buf) return NULL;
+
+ xmlOutputBufferPtr out = xmlOutputBufferCreateBuffer(buf, NULL);
+ if (!out) {
+ xmlBufferFree(buf);
+ return NULL;
+ }
+
+ // <applet code=...>
+ xmlOutputBufferWriteString(out, "<applet code=");
+ if(code){
+ xmlChar *escaped_code = xmlEncodeSpecialChars(NULL, (xmlChar*)code);
+ xmlOutputBufferWriteString(out, (char*)escaped_code);
+ xmlFree(escaped_code);
+ }
+
+ // width без кавычек
+ xmlOutputBufferWriteString(out, " width=");
+ if(width_is_set){
+ char wbuf[32];
+ snprintf(wbuf, sizeof(wbuf), "%d", width);
+ xmlOutputBufferWriteString(out, wbuf);
+ }
+
+ // height без кавычек
+ xmlOutputBufferWriteString(out, " height=");
+ if(height_is_set){
+ char hbuf[32];
+ snprintf(hbuf, sizeof(hbuf), "%d", height);
+ xmlOutputBufferWriteString(out, hbuf);
+ }
+
+
+ // other_attrs
+ if(other_attrs){
+ // если атрибуты заданы - добавляем без анализа
+ xmlOutputBufferWriteString(out, " "); // разделитель
+ xmlOutputBufferWriteString(out, other_attrs);
+ }
+
+ // Закрываем тег (не самозакрывающийся)
+ xmlOutputBufferWriteString(out, ">");
+
+ xmlOutputBufferFlush(out);
+
+ const xmlChar *content = xmlBufferContent(buf);
+ size_t len = xmlBufferLength(buf);
+
+ char *result = (char*)palloc(len + 1);
+ if (result) {
+ memcpy(result, content, len);
+ result[len] = '\0';
+ }
+
+ xmlOutputBufferClose(out); // также освобождает buf
+ return result; // освобождать через pfree()
+}
+
+char *generate_blockquote_tag(bool cnowrap, const char *cclear, const char * cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<blockquote");
+
+ if(cclear){
+ appendStringInfo(result, " clear=\"%s\"", cclear);
+ }
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_body_tag(const char *cbackground, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<body");
+
+ if(cbackground){
+ appendStringInfo(result, " background=\"%s\"", cbackground);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_dlist_tag(const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<dl");
+
+ if(cclear){
+ appendStringInfo(result, " clear=\"%s\"", cclear);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_form_tag(const char *curl, const char *cmethod, const char *ctarget, const char *cenctype, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<form");
+
+ if(curl){
+ appendStringInfo(result, " action=\"%s\"", curl);
+ }
+ if(cmethod){
+ appendStringInfo(result, " method=\"%s\"", cmethod);
+ }
+ if(ctarget){
+ appendStringInfo(result, " target=\"%s\"", ctarget);
+ }
+ if(cenctype){
+ appendStringInfo(result, " enctype=\"%s\"", cenctype);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_font_tag(const char *ccolor, const char *cface, const char *csize, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<font");
+
+ if(ccolor){
+ appendStringInfo(result, " color=\"%s\"", ccolor);
+ }
+ if(cface){
+ appendStringInfo(result, " face=\"%s\"", cface);
+ }
+ if(csize){
+ appendStringInfo(result, " size=\"%s\"", csize);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_formselect_tag(const char *cname, const char *cprompt, const char *csize, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ if(cprompt){
+ appendStringInfo(result, " %s", cprompt);
+ }
+ appendStringInfo(result, "<select");
+
+ if(cname){
+ appendStringInfo(result, " name=\"%s\"", cname);
+ }
+ if(csize){
+ appendStringInfo(result, " size=\"%s\"", csize);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_textarea_tag(const char *cname, const char *crows, const char *ccols, const char * calign, const char *cattributes,
+ const char *cwrap = NULL){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<textarea");
+
+ if(cname){
+ appendStringInfo(result, " name=\"%s\"", cname);
+ }
+ else
+ appendStringInfo(result, " name=\"\"");
+ if(crows){
+ appendStringInfo(result, " rows=\"%s\"", crows);
+ }
+ else
+ appendStringInfo(result, " rows=\"\"");
+ if(ccols){
+ appendStringInfo(result, " cols=\"%s\"", ccols);
+ }
+ else
+ appendStringInfo(result, " cols=\"\"");
+ if(calign){
+ appendStringInfo(result, " align=\"%s\"", calign);
+ }
+ if(cwrap){
+ appendStringInfo(result, " wrap=\"%s\"", cwrap);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_frameset_tag(const char *crows, const char *ccols, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<frameset");
+
+ if(crows){
+ appendStringInfo(result, " rows=\"%s\"", crows);
+ }
+ if(ccols){
+ appendStringInfo(result, " cols=\"%s\"", ccols);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_map_tag(const char *cname, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<map");
+
+ if(cname){
+ appendStringInfo(result, " name=\"%s\"", cname);
+ }
+ else
+ appendStringInfo(result, " name=\"\"");
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_olist_tag(const char *cclear, const char* cwrap, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<ol");
+
+ if(cclear){
+ appendStringInfo(result, " clear=\"%s\"", cclear);
+ }
+ if(cwrap){
+ appendStringInfo(result, " wrap=\"%s\"", cwrap);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_pre_tag(const char *cclear, const char* cwidth, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<pre");
+
+ if(cclear){
+ appendStringInfo(result, " clear=\"%s\"", cclear);
+ }
+ if(cwidth){
+ appendStringInfo(result, " width=\"%s\"", cwidth);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_table_tag(const char *cborder, const char* calign, const char *cnowrap, const char* cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<table ");
+
+ if(cborder){
+ appendStringInfo(result, " %s", cborder);
+ }
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ if(calign){
+ appendStringInfo(result, " align=\"%s\"", calign);
+ }
+ if(cclear){
+ appendStringInfo(result, " clear=\"%s\"", cclear);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_tablerow_tag(const char *calign, const char* cvalign, const char *cdp, const char* cnowrap, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<tr");
+
+ if(calign){
+ appendStringInfo(result, " align=\"%s\"", calign);
+ }
+ if(cvalign){
+ appendStringInfo(result, " valign=\"%s\"", cvalign);
+ }
+ if(cdp){
+ appendStringInfo(result, " dp=\"%s\"", cdp);
+ }
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_ulist_tag(const char *cclear, const char* cwrap, const char *cdingbat, const char* csrc, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<ul");
+
+ if(cclear){
+ appendStringInfo(result, " clear=\"%s\"", cclear);
+ }
+ if(cwrap){
+ appendStringInfo(result, " wrap=\"%s\"", cwrap);
+ }
+ if(cdingbat){
+ appendStringInfo(result, " dingbat=\"%s\"", cdingbat);
+ }
+ if(csrc){
+ appendStringInfo(result, " src=\"%s\"", csrc);
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_checkbox_tag(const char *cname, const char *cvalue, const char* cchecked, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"checkbox\"");
+
+ if(cname){
+ appendStringInfo(result, " name=\"%s\"", cname);
+ }
+ if(cvalue){
+ appendStringInfo(result, " value=\"%s\"", cvalue);
+ }
+ if(cchecked){
+ appendStringInfo(result, " checked=\"checked\"");
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+void append_attribute(StringInfo res, const char *name, const char *value){
+ if(name){
+ if(value)
+ appendStringInfo(res, " %s=\"%s\"", name, value);
+ }
+}
+void append_attribute_chk_len(StringInfo res, const char *tag_name,
+ const char *tag_value) noexcept {
+ if(tag_name != nullptr)
+ {
+ if(tag_value != nullptr && strlen(tag_value))
+ {
+ appendStringInfo(res, " %s=\"%s\"", tag_name, tag_value);
+ }
+ }
+}
+char* generate_file_tag(const char *cname, const char *caccept, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"file\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "accept", caccept);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_hidden_tag(const char *cname, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"hidden\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "value", cvalue);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_image_tag(const char *cname, const char *csrc, const char *calign, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"image\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "src", csrc);
+ append_attribute(result, "align", calign);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_password_tag(const char *cname, const char *csize, const char *cmaxlength, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"password\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "size", csize);
+ append_attribute(result, "maxlength", cmaxlength);
+ append_attribute(result, "value", cvalue);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_radio_tag(const char *cname, const char *cvalue, const char *cchecked, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"radio\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "value", cvalue);
+ if(cchecked){
+ appendStringInfo(result, " checked=\"checked\"");
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_reset_tag(const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"reset\"");
+
+ append_attribute(result, "VALUE", cvalue);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_selectoption_tag(const char *cvalue, const char *cselected, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<option");
+
+ if(cselected){
+ appendStringInfo(result, " selected=\"selected\"");
+ }
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">%s</option>", cvalue ? cvalue : "");
+
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_submit_tag(const char *cname, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"submit\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "value", cvalue);
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_formtext_tag(const char *cname, const char *csize, const char *cmaxlength, const char *cvalue, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<input type=\"text\"");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "size", csize);
+ append_attribute(result, "maxlength", cmaxlength);
+ append_attribute(result, "value", cvalue);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_formtextarea_tag(const char *cname, const char *crows, const char *ccolumns, const char *calign, const char *cattributes,
+ const char *cwrap = NULL){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<textarea");
+
+ append_attribute(result, "name", cname);
+ append_attribute(result, "rows", crows);
+ append_attribute(result, "cols", ccolumns);
+ append_attribute(result, "align", calign);
+ append_attribute(result, "wrap", cwrap);
+
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, "></textarea>");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_address_tag(const char *cvalue, const char *cnowrap, const char *cclear, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<address");
+
+ append_attribute(result, "clear", cclear);
+ if(cnowrap){
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">%s</address>", cvalue ? cvalue : "");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_anchor_tag(const char *curl, const char *ctext, const char *cname, const char *cattributes,
+ const char *ctarget = NULL){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<a");
+
+ append_attribute(result, "href", curl);
+ append_attribute(result, "name", cname);
+ append_attribute(result, "target", ctarget);
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">%s</a>", ctext ? ctext : "");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_area_tag(const char *ccoord, const char *cshape, const char *chref, const char *cnohref, const char *ctarget, const char *cattributes){
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<area");
+
+ append_attribute(result, "shape", cshape);
+ append_attribute(result, "coord", ccoord);
+ append_attribute(result, "href", chref);
+ if(cnohref){
+ appendStringInfo(result, " nohref=\"nohref\"");
+ }
+ append_attribute(result, "target", ctarget);
+ if(cattributes){
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, " />");
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+ return ret;
+}
+char* generate_em_tag(const char *ctext, const char *cattributes) noexcept {
+ char *result = nullptr;
+ constexpr int em_tag_len = 10; // <em ></em> is 10 symbols
+ int ctext_len = 0;
+ int cattr_len = 0;
+ bool inc_space = false;
+
+ if (ctext != nullptr)
+ {
+ ctext_len = strlen(ctext);
+ }
+ if (cattributes != nullptr)
+ {
+ cattr_len = strlen(cattributes);
+ if (cattr_len)
+ {
+ inc_space = true;
+ }
+ }
+
+ result = (char*)palloc0(ctext_len + cattr_len + em_tag_len + 1);
+
+ sprintf(result, "<em%s%s>%s</em>", inc_space ? " " : "",
+ cattributes ? cattributes : "",
+ ctext ? ctext : "");
+
+ return result;
+}
+char* generate_frame_tag(const char *csrc, const char *cname, const char *cmarginwidth,
+ const char *cmarginheight, const char *cscrolling,
+ const char *cnoresize, const char *cattributes) noexcept {
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<frame src=\"");
+
+ appendStringInfo(result, "%s\"", csrc);
+
+ append_attribute_chk_len(result, "name", cname);
+ append_attribute_chk_len(result, "marginwidth", cmarginwidth);
+ append_attribute_chk_len(result, "marginheight", cmarginheight);
+ append_attribute_chk_len(result, "scrolling", cscrolling);
+
+ if(cnoresize != nullptr && strlen(cnoresize))
+ {
+ appendStringInfo(result, " noresize=\"noresize\"");
+ }
+
+ if (cattributes != nullptr && strlen(cattributes))
+ {
+ appendStringInfo(result, " %s", cattributes);
+ }
+
+ appendStringInfo(result, " />");
+
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+
+ return ret;
+}
+char* generate_header_tag(int32 clevel, bool clevel_is_set, const char *cheader, const char *calign,
+ const char *cnowrap, const char *cclear, const char *cattributes) noexcept {
+ StringInfo result = makeStringInfo();
+ char clevel_str[1 + 1] = {0};
+
+ if (clevel_is_set)
+ {
+ if (clevel < 0)
+ {
+ clevel *= -1;
+ }
+ if (clevel > 6)
+ {
+ clevel = 6;
+ }
+ sprintf(clevel_str, "%d", clevel);
+ }
+ appendStringInfo(result, "<h%s", clevel_str);
+
+ append_attribute_chk_len(result, "align", calign);
+ if(cnowrap != nullptr && strlen(cnowrap))
+ {
+ appendStringInfo(result, " nowrap=\"nowrap\"");
+ }
+ append_attribute_chk_len(result, "clear", cclear);
+ if (cattributes != nullptr && strlen(cattributes))
+ {
+ appendStringInfo(result, " %s", cattributes);
+ }
+
+ appendStringInfo(result, ">%s</h%s>", cheader ? cheader : "", clevel_str);
+
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+
+ return ret;
+}
+char* generate_dlistterm_tag(const char *ctext, const char *cclear, const char *cattributes) noexcept {
+ StringInfo result = makeStringInfo();
+ appendStringInfo(result, "<dt");
+
+ append_attribute_chk_len(result, "clear", cclear);
+ if (cattributes != nullptr && strlen(cattributes))
+ {
+ appendStringInfo(result, " %s", cattributes);
+ }
+ appendStringInfo(result, ">%s", ctext ? ctext : "");
+
+ char *ret = pstrdup(result->data);
+ destroyStringInfo(result);
+
+ return ret;
+}
+}// end namespace htp
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(htp_enable_test_mode);
+PG_FUNCTION_INFO_V1(htp_adddefaulthtmlhdr);
+PG_FUNCTION_INFO_V1(htp_address);
+PG_FUNCTION_INFO_V1(htp_anchor);
+PG_FUNCTION_INFO_V1(htp_anchor2);
+PG_FUNCTION_INFO_V1(htp_appletopen);
+PG_FUNCTION_INFO_V1(htp_area);
+PG_FUNCTION_INFO_V1(htp_base);
+PG_FUNCTION_INFO_V1(htp_basefont);
+PG_FUNCTION_INFO_V1(htp_bgsound);
+PG_FUNCTION_INFO_V1(htp_big);
+PG_FUNCTION_INFO_V1(htp_blockquoteopen);
+PG_FUNCTION_INFO_V1(htp_bodyopen);
+PG_FUNCTION_INFO_V1(htp_bold);
+PG_FUNCTION_INFO_V1(htp_br);
+PG_FUNCTION_INFO_V1(htp_center);
+PG_FUNCTION_INFO_V1(htp_cite);
+PG_FUNCTION_INFO_V1(htp_code);
+PG_FUNCTION_INFO_V1(htp_comment);
+PG_FUNCTION_INFO_V1(htp_dfn);
+PG_FUNCTION_INFO_V1(htp_div);
+PG_FUNCTION_INFO_V1(htp_dlistdef);
+PG_FUNCTION_INFO_V1(htp_dlistopen);
+PG_FUNCTION_INFO_V1(htp_dlistterm);
+PG_FUNCTION_INFO_V1(htp_download_file);
+PG_FUNCTION_INFO_V1(htp_em);
+PG_FUNCTION_INFO_V1(htp_emphasis);
+PG_FUNCTION_INFO_V1(htp_escape_oracle_full);
+PG_FUNCTION_INFO_V1(htp_escape_sc);
+PG_FUNCTION_INFO_V1(htp_flush_charset_convert);
+PG_FUNCTION_INFO_V1(htp_fontopen);
+PG_FUNCTION_INFO_V1(htp_formcheckbox);
+PG_FUNCTION_INFO_V1(htp_formfile);
+PG_FUNCTION_INFO_V1(htp_formhidden);
+PG_FUNCTION_INFO_V1(htp_formimage);
+PG_FUNCTION_INFO_V1(htp_formopen);
+PG_FUNCTION_INFO_V1(htp_formpassword);
+PG_FUNCTION_INFO_V1(htp_formradio);
+PG_FUNCTION_INFO_V1(htp_formreset);
+PG_FUNCTION_INFO_V1(htp_formselectopen);
+PG_FUNCTION_INFO_V1(htp_formselectoption);
+PG_FUNCTION_INFO_V1(htp_formsubmit);
+PG_FUNCTION_INFO_V1(htp_formtext);
+PG_FUNCTION_INFO_V1(htp_formtextarea);
+PG_FUNCTION_INFO_V1(htp_formtextarea2);
+PG_FUNCTION_INFO_V1(htp_formtextareaopen);
+PG_FUNCTION_INFO_V1(htp_formtextareaopen2);
+PG_FUNCTION_INFO_V1(htp_frame);
+PG_FUNCTION_INFO_V1(htp_framesetopen);
+PG_FUNCTION_INFO_V1(htp_get_download_files_list);
+PG_FUNCTION_INFO_V1(htp_get_line);
+PG_FUNCTION_INFO_V1(htp_get_page);
+PG_FUNCTION_INFO_V1(htp_get_page_charset_convert);
+PG_FUNCTION_INFO_V1(htp_get_page_raw);
+PG_FUNCTION_INFO_V1(htp_header);
+PG_FUNCTION_INFO_V1(htp_hr);
+PG_FUNCTION_INFO_V1(htp_htitle);
+PG_FUNCTION_INFO_V1(htp_img);
+PG_FUNCTION_INFO_V1(htp_img2);
+PG_FUNCTION_INFO_V1(htp_isindex);
+PG_FUNCTION_INFO_V1(htp_italic);
+PG_FUNCTION_INFO_V1(htp_kbd);
+PG_FUNCTION_INFO_V1(htp_keyboard);
+PG_FUNCTION_INFO_V1(htp_line);
+PG_FUNCTION_INFO_V1(htp_linkrel);
+PG_FUNCTION_INFO_V1(htp_linkrev);
+PG_FUNCTION_INFO_V1(htp_listheader);
+PG_FUNCTION_INFO_V1(htp_listitem);
+PG_FUNCTION_INFO_V1(htp_mailto);
+PG_FUNCTION_INFO_V1(htp_mapopen);
+PG_FUNCTION_INFO_V1(htp_meta);
+PG_FUNCTION_INFO_V1(htp_nextid);
+PG_FUNCTION_INFO_V1(htp_nl);
+PG_FUNCTION_INFO_V1(htp_nobr);
+PG_FUNCTION_INFO_V1(htp_olistopen);
+PG_FUNCTION_INFO_V1(htp_p_ovr1);
+PG_FUNCTION_INFO_V1(htp_p_ovr2);
+PG_FUNCTION_INFO_V1(htp_p_ovr3);
+PG_FUNCTION_INFO_V1(htp_paragraph);
+PG_FUNCTION_INFO_V1(htp_param);
+PG_FUNCTION_INFO_V1(htp_plaintext);
+PG_FUNCTION_INFO_V1(htp_preopen);
+PG_FUNCTION_INFO_V1(htp_print_ovr1);
+PG_FUNCTION_INFO_V1(htp_print_ovr2);
+PG_FUNCTION_INFO_V1(htp_print_ovr3);
+PG_FUNCTION_INFO_V1(htp_prints);
+PG_FUNCTION_INFO_V1(htp_print_header);
+PG_FUNCTION_INFO_V1(htp_prn_ovr1);
+PG_FUNCTION_INFO_V1(htp_prn_ovr2);
+PG_FUNCTION_INFO_V1(htp_prn_ovr3);
+PG_FUNCTION_INFO_V1(htp_ps);
+PG_FUNCTION_INFO_V1(htp_putraw);
+PG_FUNCTION_INFO_V1(htp_s);
+PG_FUNCTION_INFO_V1(htp_sample);
+PG_FUNCTION_INFO_V1(htp_script);
+PG_FUNCTION_INFO_V1(htp_sethttpcharset);
+PG_FUNCTION_INFO_V1(htp_set_transfer_mode);
+PG_FUNCTION_INFO_V1(htp_small);
+PG_FUNCTION_INFO_V1(htp_strike);
+PG_FUNCTION_INFO_V1(htp_strong);
+PG_FUNCTION_INFO_V1(htp_style);
+PG_FUNCTION_INFO_V1(htp_sub);
+PG_FUNCTION_INFO_V1(htp_sup);
+PG_FUNCTION_INFO_V1(htp_tablecaption);
+PG_FUNCTION_INFO_V1(htp_tabledata);
+PG_FUNCTION_INFO_V1(htp_tableheader);
+PG_FUNCTION_INFO_V1(htp_tableopen);
+PG_FUNCTION_INFO_V1(htp_tablerowopen);
+PG_FUNCTION_INFO_V1(htp_teletype);
+PG_FUNCTION_INFO_V1(htp_title);
+PG_FUNCTION_INFO_V1(htp_ulistopen);
+PG_FUNCTION_INFO_V1(htp_underline);
+PG_FUNCTION_INFO_V1(htp_variable);
+
+PG_FUNCTION_INFO_V1(htp_appletclose);
+PG_FUNCTION_INFO_V1(htp_blockquoteclose);
+PG_FUNCTION_INFO_V1(htp_bodyclose);
+PG_FUNCTION_INFO_V1(htp_centerclose);
+PG_FUNCTION_INFO_V1(htp_centeropen);
+PG_FUNCTION_INFO_V1(htp_dirlistclose);
+PG_FUNCTION_INFO_V1(htp_dirlistopen);
+PG_FUNCTION_INFO_V1(htp_dlistclose);
+PG_FUNCTION_INFO_V1(htp_flush);
+PG_FUNCTION_INFO_V1(htp_fontclose);
+PG_FUNCTION_INFO_V1(htp_formclose);
+PG_FUNCTION_INFO_V1(htp_formselectclose);
+PG_FUNCTION_INFO_V1(htp_formtextareaclose);
+PG_FUNCTION_INFO_V1(htp_framesetclose);
+PG_FUNCTION_INFO_V1(htp_headclose);
+PG_FUNCTION_INFO_V1(htp_headopen);
+PG_FUNCTION_INFO_V1(htp_htmlclose);
+PG_FUNCTION_INFO_V1(htp_htmlopen);
+PG_FUNCTION_INFO_V1(htp_init);
+PG_FUNCTION_INFO_V1(htp_listingclose);
+PG_FUNCTION_INFO_V1(htp_listingopen);
+PG_FUNCTION_INFO_V1(htp_mapclose);
+PG_FUNCTION_INFO_V1(htp_menulistclose);
+PG_FUNCTION_INFO_V1(htp_menulistopen);
+PG_FUNCTION_INFO_V1(htp_noframesclose);
+PG_FUNCTION_INFO_V1(htp_noframesopen);
+PG_FUNCTION_INFO_V1(htp_olistclose);
+PG_FUNCTION_INFO_V1(htp_para);
+PG_FUNCTION_INFO_V1(htp_preclose);
+PG_FUNCTION_INFO_V1(htp_reset_get_page);
+PG_FUNCTION_INFO_V1(htp_showpage);
+PG_FUNCTION_INFO_V1(htp_tableclose);
+PG_FUNCTION_INFO_V1(htp_tablerowclose);
+PG_FUNCTION_INFO_V1(htp_ulistclose);
+PG_FUNCTION_INFO_V1(htp_wbr);
+
+
+/**
+ * @brief TODO: Enable test mode for HTP
+ * @details TODO: Sets test_mode variable to TRUE thus enabling buffer cleaning before any tag adding
+ * * Parameters:
+ * * @param TEST_MODE (in) INT32: turns test mode on/off
+ * * * * *
+ */
+Datum htp_enable_test_mode(PG_FUNCTION_ARGS)
+{
+ int32 mode = PG_GETARG_INT32(0);
+ char msg[13 + 1] = {0}; // "test mode off"
+
+ if (mode)
+ {
+ test_mode = true;
+ sprintf(msg, "test mode on");
+ }
+ else
+ {
+ test_mode = false;
+ sprintf(msg, "test mode off");
+ }
+
+ htp::html_buffer_add(msg);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param BADDHTMLHDR (in) BOOLEAN: TODO: Описание параметра BADDHTMLHDR
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_adddefaulthtmlhdr(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.adddefaulthtmlhdr еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<ADDRESS>and</ADDRESS>tags which specify the address, author and signature of a document.
+ * @details This procedure generates the<ADDRESS>and</ADDRESS>tags which specify the address, author and signature of a document.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: The string that goes between the<ADDRESS>and</ADDRESS>tags.
+ * * @param CNOWRAP (in) VARCHAR2: If the value for this parameter is notNULL, theNOWRAPattribute is included in the tag
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_address(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracleFull);
+ char *cnowrap = htp::get_string_argument(fcinfo, 1);
+ char *cclear = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 3);
+
+ char *tag = htp::generate_address_tag(cvalue, cnowrap, cclear, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cvalue, cnowrap, cclear, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Like the ANCHOR2 procedure, this procedure generates the<A>and</A>HTML tags which specify the source or destination of a hypertext link.
+ * @details Like the ANCHOR2 procedure, this procedure generates the<A>and</A>HTML tags which specify the source or destination of a hypertext link.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: The value for theHREFattribute.
+ * * @param CTEXT (in) VARCHAR2: The string that goes between the<A>and</A>tags.
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_anchor(PG_FUNCTION_ARGS)
+{
+ char *curl = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatSpecialChars);
+ char *ctext = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracleFull);
+ char *cname = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 3);
+
+ char *tag = htp::generate_anchor_tag(curl, ctext, cname, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(curl, ctext, cname, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief Like the ANCHOR procedure, this procedure generates the<A>and</A>HTML tags which specify the source or destination of a hypertext link.
+ * @details Like the ANCHOR procedure, this procedure generates the<A>and</A>HTML tags which specify the source or destination of a hypertext link.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: The value for theHREFattribute.
+ * * @param CTEXT (in) VARCHAR2: The string that goes between the<A>and</A>tags.
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute
+ * * @param CTARGET (in) VARCHAR2: The value for theTARGETattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_anchor2(PG_FUNCTION_ARGS)
+{
+ char *curl = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatSpecialChars);
+ char *ctext = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracleFull);
+ char *cname = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *ctarget = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_anchor_tag(curl, ctext, cname, cattributes, ctarget);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(curl, ctext, cname, ctarget, cattributes, tag);
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<APPLET>tag which begins the invocation of a Java applet.
+ * @details This procedure generates the<APPLET>tag which begins the invocation of a Java applet.
+
+Specify parameters to the Java applet using thePARAM Procedure.
+Use thecattributesparameter to specify theCODEBASEattribute since the PL/SQL cartridge does not know where to find the class files. TheCODEBASEattribute specifies the virtual path containing the class files.
+ * * Parameters:
+ * * @param CCODE (in) VARCHAR2: The the value for theCODEattribute which specifies the name of the applet class.
+ * * @param CWIDTH (in) NUMBER: The value for theWIDTHattribute.
+ * * @param CHEIGHT (in) NUMBER: The value for theHEIGHTattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_appletopen(PG_FUNCTION_ARGS)
+{
+ text *ccode_text = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+ text *cattributes_text = PG_ARGISNULL(3) ? NULL : PG_GETARG_TEXT_PP(3);
+ Numeric cwidth_num = PG_ARGISNULL(1) ? NULL : PG_GETARG_NUMERIC(1);
+ Numeric cheight_num = PG_ARGISNULL(2) ? NULL : PG_GETARG_NUMERIC(2);
+ char *ccode = NULL;
+ char *cattributes = NULL;
+
+ int32 cwidth = 0;
+ int32 cheight = 0;
+ bool cwidth_is_set = false;
+ bool cheight_is_set = false;
+
+ if(cwidth_num){
+ cwidth = DatumGetInt32(DirectFunctionCall1(numeric_int4, NumericGetDatum(cwidth_num)));
+ cwidth_is_set = true;
+ }
+ if(cheight_num){
+ cheight = DatumGetInt32(DirectFunctionCall1(numeric_int4, NumericGetDatum(cheight_num)));
+ cheight_is_set = true;
+ }
+
+ if(ccode_text && VARSIZE_ANY_EXHDR(ccode_text)!=0) {
+ ccode = text_to_cstring(ccode_text);
+ }
+ if(cattributes_text && VARSIZE_ANY_EXHDR(cattributes_text)!=0){
+ cattributes = text_to_cstring(cattributes_text);
+ }
+
+ char *tag = htp::generate_applet_tag(ccode, cwidth, cwidth_is_set, cheight, cheight_is_set, cattributes);
+ htp::html_buffer_add(tag);
+ pfree(tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<AREA>tag, which defines a client-side image map. The<AREA>tag defines areas within the image and destinations for the areas.
+ * @details This procedure generates the<AREA>tag, which defines a client-side image map. The<AREA>tag defines areas within the image and destinations for the areas.
+ * * Parameters:
+ * * @param CCOORDS (in) VARCHAR2: TODO: Описание параметра CCOORDS
+ * * @param CSHAPE (in) VARCHAR2: The value for theSHAPEattribute.
+ * * @param CHREF (in) VARCHAR2: The value for theHREFattribute.
+ * * @param CNOHREF (in) VARCHAR2: If the value for this parameter is notNULL, theNOHREFattribute is added to the tag.
+ * * @param CTARGET (in) VARCHAR2: The value for theTARGETattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_area(PG_FUNCTION_ARGS)
+{
+ char *ccoords = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cshape = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *chref = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatSpecialChars);
+ char *cnohref = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *ctarget = htp::get_string_argument(fcinfo, 4, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 5);
+
+ char *tag = htp::generate_area_tag(ccoords, cshape, chref, cnohref, ctarget, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(ccoords, cshape, chref, cnohref, ctarget, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BASE>tag which records the URL of the document.
+ * @details This procedure generates the<BASE>tag which records the URL of the document.
+ * * Parameters:
+ * * @param CTARGET (in) VARCHAR2: The value for theTARGETattribute which establishes a window name to which all links in this document are targeted.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_base(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.base еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BASEFONT>tag which specifies the base font size for a Web page.
+ * @details This procedure generates the<BASEFONT>tag which specifies the base font size for a Web page.
+ * * Parameters:
+ * * @param NSIZE (in) NUMBER: The value for theSIZEattribute.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_basefont(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.basefont еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BGSOUND>tag which includes audio for a Web page.
+ * @details This procedure generates the<BGSOUND>tag which includes audio for a Web page.
+ * * Parameters:
+ * * @param CSRC (in) VARCHAR2: The value for theSRCattribute.
+ * * @param CLOOP (in) VARCHAR2: The value for theLOOPattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_bgsound(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.bgsound еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BIG>and</BIG>tags which direct the browser to render the text in a bigger font.
+ * @details This procedure generates the<BIG>and</BIG>tags which direct the browser to render the text in a bigger font.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The the text that goes between the tags.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_big(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.big еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BLOCKQUOTE>tag, which marks the beginning of a section of quoted text.
+ * @details This procedure generates the<BLOCKQUOTE>tag, which marks the beginning of a section of quoted text.
+ * * Parameters:
+ * * @param CNOWRAP (in) VARCHAR2: If the value for this parameter is notNULL, theNOWRAPattribute is added to the tag.
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_blockquoteopen(PG_FUNCTION_ARGS)
+{
+ text *cnowrap_txt = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+ text *cclear_txt = PG_ARGISNULL(1) ? NULL : PG_GETARG_TEXT_PP(1);
+ text *cattributes_txt = PG_ARGISNULL(2) ? NULL : PG_GETARG_TEXT_PP(2);
+ bool nowrap = false;
+ char *cclear = NULL;
+ char *cattributes = NULL;
+
+ if(cnowrap_txt && VARSIZE_ANY_EXHDR(cnowrap_txt)!=0) {
+ nowrap = true;
+ }
+ if(cclear_txt && VARSIZE_ANY_EXHDR(cclear_txt)!=0) {
+ cclear = htp::escape_to_numeric_entity(cclear_txt);
+ }
+ if(cattributes_txt && VARSIZE_ANY_EXHDR(cattributes_txt)!=0) {
+ cattributes = text_to_cstring(cattributes_txt);
+ }
+
+ char *tag = htp::generate_blockquote_tag(nowrap, cclear, cattributes);
+ htp::html_buffer_add(tag);
+
+ pfree(tag);
+ if(cclear)
+ pfree(cclear);
+ if(cattributes)
+ pfree(cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BODY>tag which marks the beginning of the body section of an HTML document.
+ * @details This procedure generates the<BODY>tag which marks the beginning of the body section of an HTML document.
+ * * Parameters:
+ * * @param CBACKGROUND (in) VARCHAR2: The value for theBACKGROUNDattribute which specifies a graphic file to use for the background of the document.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_bodyopen(PG_FUNCTION_ARGS)
+{
+ text *cbackground_txt = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+ text *cattributes_txt = PG_ARGISNULL(1) ? NULL : PG_GETARG_TEXT_PP(1);
+ char *cbackground = NULL;
+ char *cattributes = NULL;
+
+ if(cbackground_txt && VARSIZE_ANY_EXHDR(cbackground_txt)!=0) {
+ cbackground = htp::escape_to_numeric_entity(cbackground_txt);
+ }
+ if(cattributes_txt && VARSIZE_ANY_EXHDR(cattributes_txt)!=0) {
+ cattributes = text_to_cstring(cattributes_txt);
+ }
+
+ char *tag = htp::generate_body_tag(cbackground, cattributes);
+ htp::html_buffer_add(tag);
+
+ pfree(tag);
+
+ if(cbackground)
+ pfree(cbackground);
+ if(cattributes)
+ pfree(cattributes);
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<B>and</B>tags which direct the browser to display the text in boldface.
+ * @details This procedure generates the<B>and</B>tags which direct the browser to display the text in boldface.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text that goes between the tags.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_bold(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.bold еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BR>tag which begins a new line of text.
+ * @details This procedure generates the<BR>tag which begins a new line of text.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_br(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.br еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<CENTER>and</CENTER>tags which center a section of text within a Web page.
+ * @details This procedure generates the<CENTER>and</CENTER>tags which center a section of text within a Web page.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text that goes between the tags.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_center(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.center еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<CITE>and</CITE>tags which direct the browser to render the text as a citation.
+ * @details This procedure generates the<CITE>and</CITE>tags which direct the browser to render the text as a citation.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render as citation.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_cite(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.cite еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<CODE>and</CODE>tags which direct the browser to render the text in monospace font or however "code" is defined stylistically.
+ * @details This procedure generates the<CODE>and</CODE>tags which direct the browser to render the text in monospace font or however "code" is defined stylistically.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render as code.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_code(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.code еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the comment tags.
+ * @details This procedure generates the comment tags.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The comment.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_comment(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.comment еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<DFN>and</DFN>tags which direct the browser to mark the text in italics or however "definition" is described stylistically.
+ * @details This procedure generates the<DFN>and</DFN>tags which direct the browser to mark the text in italics or however "definition" is described stylistically.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render in italics.
+ * * @param CATTRIBUTES (in) VARCHAR2: TODO: Описание параметра CATTRIBUTES
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_dfn(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.dfn еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<DIV>tag which creates document divisions.
+ * @details This procedure generates the<DIV>tag which creates document divisions.
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_div(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.div еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<DD>tag, which inserts definitions of terms. Use this tag for a definition list<DL>. Terms are tagged<DT>and definitions are tagged<DD>.
+ * @details This procedure generates the<DD>tag, which inserts definitions of terms. Use this tag for a definition list<DL>. Terms are tagged<DT>and definitions are tagged<DD>.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The definition of the term.
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_dlistdef(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.dlistdef еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<DL>tag which starts a definition list. You end a definition list by means of the DLISTCLOSE Procedure.
+ * @details This procedure generates the<DL>tag which starts a definition list. You end a definition list by means of the DLISTCLOSE Procedure.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_dlistopen(PG_FUNCTION_ARGS)
+{
+ text *cclear_txt = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+ text *cattributes_txt = PG_ARGISNULL(1) ? NULL : PG_GETARG_TEXT_PP(1);
+ char *cclear = NULL;
+ char *cattributes = NULL;
+
+ if(cclear_txt && VARSIZE_ANY_EXHDR(cclear_txt)!=0) {
+ cclear = htp::escape_to_numeric_entity(cclear_txt);
+ }
+ if(cattributes_txt && VARSIZE_ANY_EXHDR(cattributes_txt)!=0) {
+ cattributes = text_to_cstring(cattributes_txt);
+ }
+
+ char *tag = htp::generate_dlist_tag(cclear, cattributes);
+ htp::html_buffer_add(tag);
+
+ pfree(tag);
+ if(cclear)
+ pfree(cclear);
+ if(cattributes)
+ pfree(cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<DT>tag which defines a term in a definition list<DL>.
+ * @details This procedure generates the<DT>tag which defines a term in a definition list<DL>.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The term.
+ * * @param CCLEAR (in) VARCHAR2: The value for the CLEAR attribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_dlistterm(PG_FUNCTION_ARGS)
+{
+ char *ctext = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracleFull);
+ char *cclear = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2, htp::StringEscapeLtGtChars);
+
+ char *tag = htp::generate_dlistterm_tag(ctext, cclear, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(ctext, cclear, cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param SFILENAME (in) VARCHAR2: TODO: Описание параметра SFILENAME
+ * * @param BCOMPRESS (in) BOOLEAN: TODO: Описание параметра BCOMPRESS
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_download_file(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.download_file еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<EM>and</EM>tags, which define text to be emphasized.
+ * @details Generates the<EM>and</EM>tags by including preprocessed cattributes parameter as tag
+ * attribute and preprocessed ctext parameter as the tag body.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to emphasize.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_em(PG_FUNCTION_ARGS)
+{
+ char *ctext = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracleFull);
+ char *cattributes = htp::get_string_argument(fcinfo, 1, htp::StringEscapeLtGtChars);
+
+ char *tag = htp::generate_em_tag(ctext, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(tag, ctext, cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<EM>and</EM>tags, which define text to be emphasized.
+ * @details Generates the<EM>and</EM>tags by including preprocessed cattributes parameter as the tag
+ * attribute and preprocessed ctext parameter as the tag body.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to emphasize.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_emphasis(PG_FUNCTION_ARGS)
+{
+ char *ctext = NULL;
+ char *cattributes = htp::get_string_argument(fcinfo, 1, htp::StringEscapeLtGtChars);
+ text *textarg = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+
+ LOCAL_FCINFO(local_fcinfo, 1);
+ InitFunctionCallInfoData(*local_fcinfo, NULL, 1, PG_GET_COLLATION(), fcinfo->context, NULL);
+ local_fcinfo->args[0].value = PointerGetDatum(textarg);
+ local_fcinfo->args[0].isnull = (textarg == NULL ? true : false);
+ Datum esc_text_datum = (*htf_escape_oracle_full) (local_fcinfo);
+ text *esc_text = NULL;
+ if (DatumGetPointer(esc_text_datum) != NULL) {
+ esc_text = DatumGetTextPP(esc_text_datum);
+ }
+
+ if(esc_text)
+ ctext = text_to_cstring(esc_text);
+
+ char *tag = htp::generate_em_tag(ctext, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(tag, ctext, cattributes);
+ if(esc_text)
+ pfree(esc_text);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief заменяет символы, имеющие специальное значение в HTML, их escape-последовательностями.
+ * @details Функция преобразует символы <, >, & и другие в HTML-сущности для безопасного отображения.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: Строка для преобразования.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTF.html
+ */
+Datum htp_escape_oracle_full(PG_FUNCTION_ARGS)
+{
+ char *res_str = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracleFull);
+ if(res_str){
+ text *result = cstring_to_text(res_str);
+ pfree(res_str);
+ PG_RETURN_TEXT_P(result);
+ }
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure replaces characters that have special meaning in HTML with their escape sequences.
+ * @details This procedure replaces characters that have special meaning in HTML with their escape sequences.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text string to convert.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_escape_sc(PG_FUNCTION_ARGS)
+{
+ char *ctext = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatSpecialChars);
+ htp::html_buffer_add(ctext);
+ htp::pfree_all(ctext);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CHARSET (in) VARCHAR2: TODO: Описание параметра CHARSET
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_flush_charset_convert(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.flush_charset_convert еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<FONT>which marks the beginning of section of text with the specified font characteristics.
+ * @details This procedure generates the<FONT>which marks the beginning of section of text with the specified font characteristics.
+ * * Parameters:
+ * * @param CCOLOR (in) VARCHAR2: The value for theCOLORattribute.
+ * * @param CFACE (in) VARCHAR2: The value for theFACEattribute
+ * * @param CSIZE (in) VARCHAR2: The value for theSIZEattribute
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_fontopen(PG_FUNCTION_ARGS)
+{
+ text *ccolor_txt = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+ text *cface_txt = PG_ARGISNULL(1) ? NULL : PG_GETARG_TEXT_PP(1);
+ text *csize_txt = PG_ARGISNULL(2) ? NULL : PG_GETARG_TEXT_PP(2);
+ text *cattributes_txt = PG_ARGISNULL(3) ? NULL : PG_GETARG_TEXT_PP(3);
+ char *ccolor = NULL;
+ char *cface = NULL;
+ char *csize = NULL;
+ char *cattributes = NULL;
+
+ if(ccolor_txt && VARSIZE_ANY_EXHDR(ccolor_txt)!=0) {
+ ccolor = htp::escape_to_numeric_entity(ccolor_txt);
+ }
+ if(cface_txt && VARSIZE_ANY_EXHDR(cface_txt)!=0) {
+ cface = htp::escape_to_numeric_entity(cface_txt);
+ }
+ if(csize_txt && VARSIZE_ANY_EXHDR(csize_txt)!=0) {
+ csize = htp::escape_to_numeric_entity(csize_txt);
+ }
+ if(cattributes_txt && VARSIZE_ANY_EXHDR(cattributes_txt)!=0) {
+ cattributes = text_to_cstring(cattributes_txt);
+ }
+
+ char *tag = htp::generate_font_tag(ccolor, cface, csize, cattributes);
+ htp::html_buffer_add(tag);
+
+ pfree(tag);
+ if(ccolor)
+ pfree(ccolor);
+ if(cface)
+ pfree(cface);
+ if(csize)
+ pfree(csize);
+ if(cattributes)
+ pfree(cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="checkbox"which inserts a checkbox element in a form.
+ * @details This procedure generates the<INPUT>tag withTYPE="checkbox"which inserts a checkbox element in a form.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CCHECKED (in) VARCHAR2: If the value for this parameter is notNULL, theCHECKEDattribute is added to the tag.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formcheckbox(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cvalue = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cchecked = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 3);
+ char *tag = htp::generate_checkbox_tag(cname, cvalue, cchecked, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, cvalue, cchecked, cattributes, tag);
+
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="file"which inserts a file form element. This is used for file uploading for a given page.
+ * @details This procedure generates the<INPUT>tag withTYPE="file"which inserts a file form element. This is used for file uploading for a given page.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CACCEPT (in) VARCHAR2: A comma-delimited list of MIME types for upload.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formfile(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *caccept = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+ char *tag = htp::generate_file_tag(cname, caccept, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, caccept, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag with TYPE="hidden", which inserts a hidden form element.
+ * @details This procedure generates the<INPUT>tag with TYPE="hidden", which inserts a hidden form element.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formhidden(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *value = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+ char *tag = htp::generate_hidden_tag(cname, value, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, value, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="image"which creates an image field that the user clicks to submit the form immediately.
+ * @details This procedure generates the<INPUT>tag withTYPE="image"which creates an image field that the user clicks to submit the form immediately.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CSRC (in) VARCHAR2: The value for theSRCattribute that specifies the image file.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formimage(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *csrc = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *calign = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 3);
+
+ char *tag = htp::generate_image_tag(cname, csrc, calign, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, csrc, calign, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<FORM>tag which marks the beginning of a form section in an HTML document.
+ * @details This procedure generates the<FORM>tag which marks the beginning of a form section in an HTML document.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: The URL of the WRB or CGI script where the contents of the form is sent. This parameter is required.
+ * * @param CMETHOD (in) VARCHAR2: The value for theMETHODattribute. The value can be "GET" or "POST".
+ * * @param CTARGET (in) VARCHAR2: The value for theTARGETattribute.
+ * * @param CENCTYPE (in) VARCHAR2: The value for theENCTYPEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formopen(PG_FUNCTION_ARGS)
+{
+ text *curl_txt = PG_ARGISNULL(0) ? NULL : PG_GETARG_TEXT_PP(0);
+ text *cmethod_txt = PG_ARGISNULL(1) ? NULL : PG_GETARG_TEXT_PP(1);
+ text *ctarget_txt = PG_ARGISNULL(2) ? NULL : PG_GETARG_TEXT_PP(2);
+ text *cenctype_txt = PG_ARGISNULL(3) ? NULL : PG_GETARG_TEXT_PP(3);
+ text *cattributes_txt = PG_ARGISNULL(4) ? NULL : PG_GETARG_TEXT_PP(4);
+ char *curl = NULL;
+ char *cmethod = NULL;
+ char *ctarget = NULL;
+ char *cenctype = NULL;
+ char *cattributes = NULL;
+
+ if(curl_txt && VARSIZE_ANY_EXHDR(curl_txt)!=0) {
+ curl = htp::escape_special_chars(curl_txt);
+ }
+ if(cmethod_txt && VARSIZE_ANY_EXHDR(cmethod_txt)!=0) {
+ cmethod = htp::escape_to_numeric_entity(cmethod_txt);
+ }
+ if(ctarget_txt && VARSIZE_ANY_EXHDR(ctarget_txt)!=0) {
+ ctarget = htp::escape_to_numeric_entity(ctarget_txt);
+ }
+ if(cenctype_txt && VARSIZE_ANY_EXHDR(cenctype_txt)!=0) {
+ cenctype = htp::escape_to_numeric_entity(cenctype_txt);
+ }
+ if(cattributes_txt && VARSIZE_ANY_EXHDR(cattributes_txt)!=0) {
+ cattributes = text_to_cstring(cattributes_txt);
+ }
+
+ char *tag = htp::generate_form_tag(curl, cmethod, ctarget, cenctype, cattributes);
+ htp::html_buffer_add(tag);
+
+ pfree(tag);
+ if(curl)
+ pfree(curl);
+ if(cmethod)
+ pfree(cmethod);
+ if(ctarget)
+ pfree(ctarget);
+ if(cenctype)
+ pfree(cenctype);
+ if(cattributes)
+ pfree(cattributes);
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="password"which creates a single-line text entry field. When the user enters text in the field, each character is represented by one asterisk. This is used for entering passwords.
+ * @details This procedure generates the<INPUT>tag withTYPE="password"which creates a single-line text entry field. When the user enters text in the field, each character is represented by one asterisk. This is used for entering passwords.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CSIZE (in) VARCHAR2: The value for theSIZEattribute.
+ * * @param CMAXLENGTH (in) VARCHAR2: The value for theMAXLENGTHattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formpassword(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *csize = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cmaxlength = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cvalue = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_password_tag(cname, csize, cmaxlength, cvalue, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, csize, cmaxlength, cvalue, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="radio", which creates a radio button on the HTML form. Within a set of radio buttons, the user selects only one. Each radio button in the same set has the same name, but different values. The selected radio button generates a name/value pair.
+ * @details This procedure generates the<INPUT>tag withTYPE="radio", which creates a radio button on the HTML form. Within a set of radio buttons, the user selects only one. Each radio button in the same set has the same name, but different values. The selected radio button generates a name/value pair.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CCHECKED (in) VARCHAR2: If the value for this parameter is notNULL, theCHECKEDattribute is added to the tag.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formradio(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cvalue = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cchecked = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 3);
+
+ char *tag = htp::generate_radio_tag(cname, cvalue, cchecked, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, cvalue, cchecked, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="reset"which creates a button that, when selected, resets the form fields to their initial values.
+ * @details This procedure generates the<INPUT>tag withTYPE="reset"which creates a button that, when selected, resets the form fields to their initial values.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formreset(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 1);
+
+ char *tag = htp::generate_reset_tag(cvalue, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cvalue, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<SELECT>tags which creates a Select form element.
+ * @details This procedure generates the<SELECT>tags which creates a Select form element.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CPROMPT (in) VARCHAR2: The string preceding the list box.
+ * * @param NSIZE (in) NUMBER: The value for theSIZEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formselectopen(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cprompt = htp::get_string_argument(fcinfo, 1);
+ char *csize = htp::get_numeric_argument_as_string(fcinfo, 2);
+ char *cattributes = htp::get_string_argument(fcinfo, 3);
+
+ char *tag = htp::generate_formselect_tag(cname, cprompt, csize, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, cprompt, csize, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<OPTION>tag which represents one choice in a Select element.
+ * @details This procedure generates the<OPTION>tag which represents one choice in a Select element.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: The text for the option.
+ * * @param CSELECTED (in) VARCHAR2: TODO: Описание параметра CSELECTED
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formselectoption(PG_FUNCTION_ARGS)
+{
+ char *cvalue = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatSpecialChars);
+ char *cselected = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+
+ char *tag = htp::generate_selectoption_tag(cvalue, cselected, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cvalue, cselected, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="submit"which creates a button that, when clicked, submits the form. If the button has aNAMEattribute, the button contributes a name/value pair to the submitted data.
+ * @details This procedure generates the<INPUT>tag withTYPE="submit"which creates a button that, when clicked, submits the form. If the button has aNAMEattribute, the button contributes a name/value pair to the submitted data.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formsubmit(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cvalue = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+
+ char *tag = htp::generate_submit_tag(cname, cvalue, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, cvalue, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<INPUT>tag withTYPE="text", which creates a field for a single line of text.
+ * @details This procedure generates the<INPUT>tag withTYPE="text", which creates a field for a single line of text.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CSIZE (in) VARCHAR2: The value for theSIZEattribute.
+ * * @param CMAXLENGTH (in) VARCHAR2: The value for theMAXLENGTHattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formtext(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *csize = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cmaxlength = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cvalue = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_formtext_tag(cname, csize, cmaxlength, cvalue, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, csize, cmaxlength, cvalue, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TEXTAREA>tag, which creates a text field that has no predefined text in the text area. This field enables entering several lines of text.
+ * @details This procedure generates the<TEXTAREA>tag, which creates a text field that has no predefined text in the text area. This field enables entering several lines of text.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param NROWS (in) NUMBER: The value for theROWSattribute.This is an integer.
+ * * @param NCOLUMNS (in) NUMBER: The value for theCOLSattribute.This is an integer.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formtextarea(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *crows = htp::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htp::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_formtextarea_tag(cname, crows, ccolumns, calign, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, crows, ccolumns, calign, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TEXTAREA>tag, which creates a text field that has no predefined text in the text area. This field enables entering several lines of text.
+ * @details This procedure generates the<TEXTAREA>tag, which creates a text field that has no predefined text in the text area. This field enables entering several lines of text.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param NROWS (in) NUMBER: The value for theROWSattribute.This is an integer.
+ * * @param NCOLUMNS (in) NUMBER: The value for theCOLSattribute.This is an integer.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CWRAP (in) VARCHAR2: The value for theWRAPattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formtextarea2(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *crows = htp::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htp::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cwrap = htp::get_string_argument(fcinfo, 4, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 5);
+
+ char *tag = htp::generate_formtextarea_tag(cname, crows, ccolumns, calign, cattributes, cwrap);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, crows, ccolumns, calign, cattributes, cwrap, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TEXTAREA>which marks the beginning of a text area form element.
+ * @details This procedure generates the<TEXTAREA>which marks the beginning of a text area form element.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param NROWS (in) NUMBER: The value for theROWSattribute.This is an integer.
+ * * @param NCOLUMNS (in) NUMBER: The value for theCOLSattribute.This is an integer.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formtextareaopen(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *crows = htp::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htp::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_textarea_tag(cname, crows, ccolumns, calign, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, crows, ccolumns, calign, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TEXTAREA>which marks the beginning of a text area form element.
+ * @details This procedure generates the<TEXTAREA>which marks the beginning of a text area form element.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param NROWS (in) NUMBER: The value for theROWSattribute.This is an integer.
+ * * @param NCOLUMNS (in) NUMBER: The value for theCOLSattribute.This is an integer.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CWRAP (in) VARCHAR2: The value for theWRAPattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_formtextareaopen2(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *crows = htp::get_numeric_argument_as_string(fcinfo, 1);
+ char *ccolumns = htp::get_numeric_argument_as_string(fcinfo, 2);
+ char *calign = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cwrap = htp::get_string_argument(fcinfo, 4, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 5);
+
+ char *tag = htp::generate_textarea_tag(cname, crows, ccolumns, calign, cattributes, cwrap);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, crows, ccolumns, calign, cwrap, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<FRAME>tag which begins the characteristics of a frame created by a<FRAMESET>tag.
+ * @details This procedure generates the<FRAME>tag which begins the characteristics of a frame created by a<FRAMESET>tag.
+ * * Parameters:
+ * * @param CSRC (in) VARCHAR2: The URL to display in the frame.
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CMARGINWIDTH (in) VARCHAR2: The value for theMARGINWIDTHattribute.
+ * * @param CMARGINHEIGHT (in) VARCHAR2: TODO: Описание параметра CMARGINHEIGHT
+ * * @param CSCROLLING (in) VARCHAR2: The value for theSCROLLINGattribute.
+ * * @param CNORESIZE (in) VARCHAR2: If the value for this parameter is notNULL, theNORESIZEattribute is added to the tag.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_frame(PG_FUNCTION_ARGS)
+{
+ char *csrc = htp::get_string_argument(fcinfo, 0);
+ char *cname = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cmarginwidth = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cmarginheight = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cscrolling = htp::get_string_argument(fcinfo, 4, htp::StringEscapeFormatOracle);
+ char *cnoresize = htp::get_string_argument(fcinfo, 5);
+ char *cattributes = htp::get_string_argument(fcinfo, 6, htp::StringEscapeLtGtChars);
+
+ char *tag = htp::generate_frame_tag(csrc, cname, cmarginwidth, cmarginheight, cscrolling,
+ cnoresize, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(csrc, cname, cmarginwidth, cmarginheight, cscrolling, cnoresize, cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<FRAMESET>tag which define a frameset section.
+ * @details This procedure generates the<FRAMESET>tag which define a frameset section.
+ * * Parameters:
+ * * @param CROWS (in) VARCHAR2: The value for theROWSattribute.
+ * * @param CCOLS (in) VARCHAR2: The value for theCOLSattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_framesetopen(PG_FUNCTION_ARGS)
+{
+ char *crows = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *ccols = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+
+ char *tag = htp::generate_frameset_tag(crows, ccols, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(crows, ccols, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * * @param SFILESLIST (out) VARCHAR2: TODO: Описание параметра SFILESLIST (Возвращается через результат)
+ * * @param NCOMPRESS (out) BINARY_INTEGER: TODO: Описание параметра NCOMPRESS (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2 binary_integer), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_get_download_files_list(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.get_download_files_list еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * * @param IROWS (out) NUMBER: TODO: Описание параметра IROWS (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_get_line(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.get_line еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param IROWS (in/out) NUMBER: TODO: Описание параметра IROWS
+ * * * @param THEPAGE (out) PL/SQL TABLE: TODO: Описание параметра THEPAGE (Возвращается через результат)
+ * * @param IROWS (in/out) NUMBER: TODO: Описание параметра IROWS (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_get_page(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.get_page еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param IROWS (in/out) NUMBER: TODO: Описание параметра IROWS
+ * * @param CHARSET (in) VARCHAR2: TODO: Описание параметра CHARSET
+ * * * @param THEPAGE (out) PL/SQL TABLE: TODO: Описание параметра THEPAGE (Возвращается через результат)
+ * * @param IROWS (in/out) NUMBER: TODO: Описание параметра IROWS (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_get_page_charset_convert(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.get_page_charset_convert еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param IROWS (in/out) NUMBER: TODO: Описание параметра IROWS
+ * * * @param THEPAGE (out) PL/SQL TABLE: TODO: Описание параметра THEPAGE (Возвращается через результат)
+ * * @param IROWS (in/out) NUMBER: TODO: Описание параметра IROWS (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_get_page_raw(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.get_page_raw еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates opening heading tags(<H1>to<H6>)and their corresponding closing tags (</H1>to</H6>).
+ * @details This procedure generates opening heading tags(<H1>to<H6>)and their corresponding closing tags (</H1>to</H6>).
+ * * Parameters:
+ * * @param NSIZE (in) NUMBER: The the heading level. This is an integer between 1 and 6.
+ * * @param CHEADER (in) VARCHAR2: The text to display in the heading.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CNOWRAP (in) VARCHAR2: The value for theNOWRAPattribute.
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_header(PG_FUNCTION_ARGS)
+{
+ int32 clevel = 0;
+ bool clevel_is_set = false;
+ char *cheader = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracleFull);
+ char *calign = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cnowrap = htp::get_string_argument(fcinfo, 3);
+ char *cclear = htp::get_string_argument(fcinfo, 4, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 5, htp::StringEscapeLtGtChars);
+
+ Numeric clevel_num = PG_ARGISNULL(0) ? NULL : PG_GETARG_NUMERIC(0);
+ if(clevel_num){
+ clevel = DatumGetInt32(DirectFunctionCall1(numeric_int4, NumericGetDatum(clevel_num)));
+ clevel_is_set = true;
+ }
+
+ char *tag = htp::generate_header_tag(clevel, clevel_is_set, cheader, calign, cnowrap,
+ cclear, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cheader, calign, cnowrap, cclear, cattributes);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<HR>tag, which generates a line in the HTML document.
+ * @details This procedure generates the<HR>tag, which generates a line in the HTML document.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CSRC (in) VARCHAR2: The value for theSRCattribute which specifies a custom image as the source of the line.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_hr(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.hr еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTITLE (in) VARCHAR2: TODO: Описание параметра CTITLE
+ * * @param NSIZE (in) NUMBER: TODO: Описание параметра NSIZE
+ * * @param CALIGN (in) VARCHAR2: TODO: Описание параметра CALIGN
+ * * @param CNOWRAP (in) VARCHAR2: TODO: Описание параметра CNOWRAP
+ * * @param CCLEAR (in) VARCHAR2: TODO: Описание параметра CCLEAR
+ * * @param CATTRIBUTES (in) VARCHAR2: TODO: Описание параметра CATTRIBUTES
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_htitle(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.htitle еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<IMG>tag which directs the browser to load an image onto the HTML page.
+ * @details This procedure generates the<IMG>tag which directs the browser to load an image onto the HTML page.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: The value for the SRC attribute.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CALT (in) VARCHAR2: The value for theALTattribute which specifies alternative text to display if the browser does not support images.
+ * * @param CISMAP (in) VARCHAR2: If the value for this parameter is notNULL, theISMAPattribute is added to the tag. The attribute indicates that the image is an imagemap.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_img(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.img еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the <IMG> tag, which directs the browser to load an image onto the HTML page.
+ * @details This procedure generates the <IMG> tag, which directs the browser to load an image onto the HTML page.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: The value for the SRC attribute.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CALT (in) VARCHAR2: The value for theALTattribute which specifies alternative text to display if the browser does not support images.
+ * * @param CISMAP (in) VARCHAR2: If the value for this parameter is notNULL, theISMAPattribute is added to the tag. The attribute indicates that the image is an imagemap.
+ * * @param CUSEMAP (in) VARCHAR2: The value for theUSEMAPattribute which specifies a client-side image map.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_img2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.img2 еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure creates a single entry field with a prompting text, such as "enter value," then sends that value to the URL of the page or program.
+ * @details This procedure creates a single entry field with a prompting text, such as "enter value," then sends that value to the URL of the page or program.
+ * * Parameters:
+ * * @param CPROMPT (in) VARCHAR2: The value for thePROMPTattribute.
+ * * @param CURL (in) VARCHAR2: The value for theHREFattribute.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_isindex(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.isindex еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<I>and</I>tags which direct the browser to render the text in italics.
+ * @details This procedure generates the<I>and</I>tags which direct the browser to render the text in italics.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in italics.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_italic(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.italic еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<KBD>and</KBD>tags which direct the browser to render the text in monospace font.
+ * @details This procedure generates the<KBD>and</KBD>tags which direct the browser to render the text in monospace font.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in monospace.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_kbd(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.kbd еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the <KBD> and </KBD> tags, which direct the browser to render the text in monospace font.
+ * @details This procedure generates the <KBD> and </KBD> tags, which direct the browser to render the text in monospace font.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in monospace.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_keyboard(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.keyboard еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<HR>tag, which generates a line in the HTML document.
+ * @details This procedure generates the<HR>tag, which generates a line in the HTML document.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CSRC (in) VARCHAR2: The value for theSRCattribute which specifies a custom image as the source of the line.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_line(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.line еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<LINK>tag with theRELattribute which delineates the relationship described by the hypertext link from the anchor to the target. This is only used when theHREFattribute is present.
+ * @details This procedure generates the<LINK>tag with theRELattribute which delineates the relationship described by the hypertext link from the anchor to the target. This is only used when theHREFattribute is present.
+ * * Parameters:
+ * * @param CREL (in) VARCHAR2: The value for theRELattribute.
+ * * @param CURL (in) VARCHAR2: The value for theURLattribute.
+ * * @param CTITLE (in) VARCHAR2: The value for theTITLEattribute.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_linkrel(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.linkrel еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<LINK>tag with theREVattribute which delineates the relationship described by the hypertext link from the target to the anchor.
+ * @details This procedure generates the<LINK>tag with theREVattribute which delineates the relationship described by the hypertext link from the target to the anchor.
+ * * Parameters:
+ * * @param CREV (in) VARCHAR2: TODO: Описание параметра CREV
+ * * @param CURL (in) VARCHAR2: The value for theURLattribute.
+ * * @param CTITLE (in) VARCHAR2: The value for theTITLEattribute.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_linkrev(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.linkrev еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<LH>and</LH>tags which print an HTML tag at the beginning of the list.
+ * @details This procedure generates the<LH>and</LH>tags which print an HTML tag at the beginning of the list.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to place between<LH>and</LH>.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_listheader(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.listheader еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<LI>tag, which indicates a list item.
+ * @details This procedure generates the<LI>tag, which indicates a list item.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text for the list item.
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CDINGBAT (in) VARCHAR2: The value for theDINGBATattribute.
+ * * @param CSRC (in) VARCHAR2: The value for theSRCattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_listitem(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.listitem еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<A>tag with theHREFset to 'mailto' prepended to the mail address argument.
+ * @details This procedure generates the<A>tag with theHREFset to 'mailto' prepended to the mail address argument.
+ * * Parameters:
+ * * @param CADDRESS (in) VARCHAR2: The email address of the recipient.
+ * * @param CTEXT (in) VARCHAR2: The clickable portion of the link.
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_mailto(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.mailto еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<MAP>tag which mark the beginning of a set of regions in a client-side image map.
+ * @details This procedure generates the<MAP>tag which mark the beginning of a set of regions in a client-side image map.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_mapopen(PG_FUNCTION_ARGS)
+{
+ char *cname = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 1);
+
+ char *tag = htp::generate_map_tag(cname, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cname, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<META>tag, which embeds meta-information about the document and also specifies values for HTTP headers. For example, you can specify the expiration date, keywords, and author name.
+ * @details This procedure generates the<META>tag, which embeds meta-information about the document and also specifies values for HTTP headers. For example, you can specify the expiration date, keywords, and author name.
+ * * Parameters:
+ * * @param CHTTP_EQUIV (in) VARCHAR2: The value for theCHTTP_EQUIVattribute.
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CCONTENT (in) VARCHAR2: The value for theCONTENTattribute.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_meta(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.meta еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CIDENTIFIER (in) VARCHAR2: TODO: Описание параметра CIDENTIFIER
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_nextid(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.nextid еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<BR>tag which begins a new line of text.
+ * @details This procedure generates the<BR>tag which begins a new line of text.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_nl(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.nl еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<NOBR>and</NOBR>tags which turn off line-breaking in a section of text.
+ * @details This procedure generates the<NOBR>and</NOBR>tags which turn off line-breaking in a section of text.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text that is to be rendered on one line.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_nobr(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.nobr еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<OL>tag which marks the beginning of an ordered list. An ordered list presents a list of numbered items.
+ * @details This procedure generates the<OL>tag which marks the beginning of an ordered list. An ordered list presents a list of numbered items.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CWRAP (in) VARCHAR2: The value for theWRAPattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_olistopen(PG_FUNCTION_ARGS)
+{
+ char *cclear = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cwrap = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+
+ char *tag = htp::generate_olist_tag(cclear, cwrap, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cclear, cwrap, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CBUF (in) VARCHAR2: TODO: Описание параметра CBUF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_p_ovr1(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0))
+ {
+ Owa::appendHtpText("", true);
+ PG_RETURN_VOID();
+ }
+
+ text *str_t = PG_GETARG_TEXT_P(0);
+ char *str = text_to_cstring(str_t);
+
+ Owa::appendHtpText(str, true);
+ pfree(str);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param DBUF (in) DATE: TODO: Описание параметра DBUF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_p_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.p еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param NBUF (in) NUMBER: TODO: Описание параметра NBUF
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_p_ovr3(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.p еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief You can use this procedure to add attributes to the<P>tag created by the PARA Procedure.
+ * @details You can use this procedure to add attributes to the<P>tag created by the PARA Procedure.
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CNOWRAP (in) VARCHAR2: If the value for this parameter is notNULL, theNOWRAPattribute is added to the tag.
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_paragraph(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.paragraph еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<PARAM>tag which specifies parameter values for Java applets.
+ * @details This procedure generates the<PARAM>tag which specifies parameter values for Java applets.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The value for theNAMEattribute.
+ * * @param CVALUE (in) VARCHAR2: The value for theVALUEattribute.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_param(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.param еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<PLAINTEXT>and</PLAINTEXT>tags which direct the browser to render the text they surround in fixed-width type.
+ * @details This procedure generates the<PLAINTEXT>and</PLAINTEXT>tags which direct the browser to render the text they surround in fixed-width type.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in fixed-width font.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_plaintext(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.plaintext еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<PRE>tag which marks the beginning of a section of preformatted text in the body of the HTML page.
+ * @details This procedure generates the<PRE>tag which marks the beginning of a section of preformatted text in the body of the HTML page.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CWIDTH (in) VARCHAR2: The value for theWIDTHattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_preopen(PG_FUNCTION_ARGS)
+{
+ char *cclear = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cwidth = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 2);
+
+ char *tag = htp::generate_pre_tag(cclear, cwidth, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cclear, cwidth, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures generate the specified parameter as a string terminated with the\nnewline character.
+ * @details These procedures generate the specified parameter as a string terminated with the\nnewline character.
+ * * Parameters:
+ * * @param CBUF (in) VARCHAR2: The string to generate terminated by a newline.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_print_ovr1(PG_FUNCTION_ARGS)
+{
+ text *str_t = PG_GETARG_TEXT_P(0);
+ char *str = text_to_cstring(str_t);
+ html_buffer.append(str);
+ html_buffer.push_back('\n');
+
+ pfree(str);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures generate the specified parameter as a string terminated with the\nnewline character.
+ * @details These procedures generate the specified parameter as a string terminated with the\nnewline character.
+ * * Parameters:
+ * * @param DBUF (in) DATE: The string to generate terminated by a newline.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_print_ovr2(PG_FUNCTION_ARGS)
+{
+ Datum date = PG_GETARG_DATUM(0);
+ char *date_str = DatumGetCString(DirectFunctionCall1(date_out, date));
+
+ html_buffer.append(date_str);
+ html_buffer.push_back('\n');
+
+ pfree(date_str);
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures generate the specified parameter as a string terminated with the\nnewline character.
+ * @details These procedures generate the specified parameter as a string terminated with the\nnewline character.
+ * * Parameters:
+ * * @param NBUF (in) NUMBER: The string to generate terminated by a newline.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_print_ovr3(PG_FUNCTION_ARGS)
+{
+ Datum num = PG_GETARG_DATUM(0);
+ char *num_str = DatumGetCString(DirectFunctionCall1(numeric_out, num));
+
+ html_buffer.append(num_str);
+ html_buffer.push_back('\n');
+
+ pfree(num_str);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates a string and replaces certain characters with a corresponding escape sequence.
+ * @details This procedure generates a string and replaces certain characters with a corresponding escape sequence.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The string where to perform character substitution.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_prints(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.prints еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CBUF (in) VARCHAR2: TODO: Описание параметра CBUF
+ * * @param NLINE (in) NUMBER: TODO: Описание параметра NLINE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_print_header(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.print_header еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures generate the specified parameter as a string.
+ * @details These procedures generate the specified parameter as a string.
+ * * Parameters:
+ * * @param CBUF (in) VARCHAR2: The string to generate (not terminated by a newline).
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_prn_ovr1(PG_FUNCTION_ARGS)
+{
+ text *str_t = PG_GETARG_TEXT_P(0);
+ char *str = text_to_cstring(str_t);
+ Owa::appendHtpText(str, false);
+ html_buffer.append(str);
+
+ pfree(str);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures generate the specified parameter as a string.
+ * @details These procedures generate the specified parameter as a string.
+ * * Parameters:
+ * * @param DBUF (in) DATE: The string to generate (not terminated by a newline).
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_prn_ovr2(PG_FUNCTION_ARGS)
+{
+ Datum date = PG_GETARG_DATUM(0);
+ char *date_str = DatumGetCString(DirectFunctionCall1(date_out, date));
+
+ html_buffer.append(date_str);
+
+ pfree(date_str);
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures generate the specified parameter as a string.
+ * @details These procedures generate the specified parameter as a string.
+ * * Parameters:
+ * * @param NBUF (in) NUMBER: The string to generate (not terminated by a newline).
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_prn_ovr3(PG_FUNCTION_ARGS)
+{
+ Datum num = PG_GETARG_DATUM(0);
+ char *num_str = DatumGetCString(DirectFunctionCall1(numeric_out, num));
+
+ html_buffer.append(num_str);
+
+ pfree(num_str);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates a string and replaces certain characters with the corresponding escape sequence.
+ * @details This procedure generates a string and replaces certain characters with the corresponding escape sequence.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The string where to perform character substitution.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_ps(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.ps еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param BBUF (in) RAW: TODO: Описание параметра BBUF
+ * * @param BUFLEN (in) BINARY_INTEGER: TODO: Описание параметра BUFLEN
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_putraw(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.putraw еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<S>and</S>tags which direct the browser to render the text they surround in strikethrough type.
+ * @details This procedure generates the<S>and</S>tags which direct the browser to render the text they surround in strikethrough type.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in strikethrough type.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_s(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.s еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<SAMP>and</SAMP>tags which direct the browser to render the text they surround in monospace font or however "sample" is defined stylistically.
+ * @details This procedure generates the<SAMP>and</SAMP>tags which direct the browser to render the text they surround in monospace font or however "sample" is defined stylistically.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in monospace font.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_sample(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.sample еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<SCRIPT>and</SCRIPT>tags which contain a script written in languages such as JavaScript and VBscript.
+ * @details This procedure generates the<SCRIPT>and</SCRIPT>tags which contain a script written in languages such as JavaScript and VBscript.
+ * * Parameters:
+ * * @param CSCRIPT (in) VARCHAR2: The text of the script. This is the text that makes up the script itself, not the name of a file containing the script.
+ * * @param CLANGUAGE (in) VARCHAR2: The language in which the script is written. If this parameter is omitted, the user's browser determines the scripting language.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_script(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.script еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param IANA_CHARSET (in) VARCHAR2: TODO: Описание параметра IANA_CHARSET
+ * * @param ORA_CHARSET (in) VARCHAR2: TODO: Описание параметра ORA_CHARSET
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_sethttpcharset(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.sethttpcharset еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param TMODE (in) VARCHAR2: TODO: Описание параметра TMODE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_set_transfer_mode(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.set_transfer_mode еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<SMALL>and</SMALL>tags, which direct the browser to render the text they surround using a small font.
+ * @details This procedure generates the<SMALL>and</SMALL>tags, which direct the browser to render the text they surround using a small font.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in small font.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_small(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.small еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<STRIKE>and</STRIKE>tags which direct the browser to render the text they surround in strikethrough type.
+ * @details This procedure generates the<STRIKE>and</STRIKE>tags which direct the browser to render the text they surround in strikethrough type.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be rendered in strikethrough type.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_strike(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.strike еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<STRONG>and</STRONG>tags which direct the browser to render the text they surround in bold, or however "strong" is defined.
+ * @details This procedure generates the<STRONG>and</STRONG>tags which direct the browser to render the text they surround in bold, or however "strong" is defined.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to be emphasized.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_strong(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.strong еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<STYLE>and</STYLE>tags which include a style sheet in a Web page.
+ * @details This procedure generates the<STYLE>and</STYLE>tags which include a style sheet in a Web page.
+ * * Parameters:
+ * * @param CSTYLE (in) VARCHAR2: The the style information to include.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_style(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.style еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<SUB>and</SUB>tags which direct the browser to render the text they surround as subscript.
+ * @details This procedure generates the<SUB>and</SUB>tags which direct the browser to render the text they surround as subscript.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render in subscript.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_sub(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.sub еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<SUP>and</SUP>tags which direct the browser to render the text they surround as superscript.
+ * @details This procedure generates the<SUP>and</SUP>tags which direct the browser to render the text they surround as superscript.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render in superscript.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_sup(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.sup еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<CAPTION>and</CAPTION>tags which place a caption in an HTML table.
+ * @details This procedure generates the<CAPTION>and</CAPTION>tags which place a caption in an HTML table.
+ * * Parameters:
+ * * @param CCAPTION (in) VARCHAR2: TODO: Описание параметра CCAPTION
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_tablecaption(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.tablecaption еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TD>and</TD>tags which insert data into a cell of an HTML table.
+ * @details This procedure generates the<TD>and</TD>tags which insert data into a cell of an HTML table.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: The data for the cell in the table.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CDP (in) VARCHAR2: The value for theDPattribute.
+ * * @param CNOWRAP (in) VARCHAR2: If the value of this parameter is notNULL, theNOWRAPattribute is added to the tag.
+ * * @param CROWSPAN (in) VARCHAR2: TODO: Описание параметра CROWSPAN
+ * * @param CCOLSPAN (in) VARCHAR2: The value for theCOLSPANattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_tabledata(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.tabledata еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TH>and</TH>tags which insert a header cell in an HTML table.
+ * @details This procedure generates the<TH>and</TH>tags which insert a header cell in an HTML table.
+ * * Parameters:
+ * * @param CVALUE (in) VARCHAR2: The data for the cell in the table.
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CDP (in) VARCHAR2: The value for theDPattribute.
+ * * @param CNOWRAP (in) VARCHAR2: If the value of this parameter is notNULL, theNOWRAPattribute is added to the tag.
+ * * @param CROWSPAN (in) VARCHAR2: TODO: Описание параметра CROWSPAN
+ * * @param CCOLSPAN (in) VARCHAR2: The value for theCOLSPANattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_tableheader(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.tableheader еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the <TABLE> tag which marks the beginning of an HTML table.
+ * @details This procedure generates the <TABLE> tag which marks the beginning of an HTML table.
+ * * Parameters:
+ * * @param CBORDER (in) VARCHAR2: TODO: Описание параметра CBORDER
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CNOWRAP (in) VARCHAR2: If the value of this parameter is notNULL, theNOWRAPattribute is added to the tag.
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_tableopen(PG_FUNCTION_ARGS)
+{
+ char *cborder = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *calign = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cnowrap = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cclear = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_table_tag(cborder, calign, cnowrap, cclear, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cborder, calign, cnowrap, cclear, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TR>tag which marks the beginning of a new row in an HTML table.
+ * @details This procedure generates the<TR>tag which marks the beginning of a new row in an HTML table.
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: The value for theALIGNattribute.
+ * * @param CVALIGN (in) VARCHAR2: The value for theVALIGNattribute.
+ * * @param CDP (in) VARCHAR2: The value for theDPattribute.
+ * * @param CNOWRAP (in) VARCHAR2: If the value of this parameter is notNULL, theNOWRAPattribute is added to the tag.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_tablerowopen(PG_FUNCTION_ARGS)
+{
+ char *calign = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cvalign = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cdp = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *cnowrap = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_tablerow_tag(calign, cvalign, cdp, cnowrap, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(calign, cvalign, cdp, cnowrap, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TT>and</TT>tags which direct the browser to render the text they surround in a fixed width typewriter font, for example, the courier font.
+ * @details This procedure generates the<TT>and</TT>tags which direct the browser to render the text they surround in a fixed width typewriter font, for example, the courier font.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render in a fixed width typewriter font.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_teletype(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.teletype еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<TITLE>and</TITLE>tags which specify the text to display in the titlebar of the browser window.
+ * @details This procedure generates the<TITLE>and</TITLE>tags which specify the text to display in the titlebar of the browser window.
+ * * Parameters:
+ * * @param CTITLE (in) VARCHAR2: The text to display in the titlebar of the browser window.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_title(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.title еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<UL>tag which marks the beginning of an unordered list. An unordered list presents items with bullets.
+ * @details This procedure generates the<UL>tag which marks the beginning of an unordered list. An unordered list presents items with bullets.
+ * * Parameters:
+ * * @param CCLEAR (in) VARCHAR2: The value for theCLEARattribute.
+ * * @param CWRAP (in) VARCHAR2: The value for theWRAPattribute.
+ * * @param CDINGBAT (in) VARCHAR2: The value for theDINGBATattribute.
+ * * @param CSRC (in) VARCHAR2: The value for theSRCattribute.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_ulistopen(PG_FUNCTION_ARGS)
+{
+ char *cclear = htp::get_string_argument(fcinfo, 0, htp::StringEscapeFormatOracle);
+ char *cwrap = htp::get_string_argument(fcinfo, 1, htp::StringEscapeFormatOracle);
+ char *cdingbat = htp::get_string_argument(fcinfo, 2, htp::StringEscapeFormatOracle);
+ char *csrc = htp::get_string_argument(fcinfo, 3, htp::StringEscapeFormatOracle);
+ char *cattributes = htp::get_string_argument(fcinfo, 4);
+
+ char *tag = htp::generate_ulist_tag(cclear, cwrap, cdingbat, csrc, cattributes);
+ htp::html_buffer_add(tag);
+ htp::pfree_all(cclear, cwrap, cdingbat, csrc, cattributes, tag);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<U>and</U>tags, which direct the browser to render the text they surround with an underline.
+ * @details This procedure generates the<U>and</U>tags, which direct the browser to render the text they surround with an underline.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render with an underline.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_underline(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.underline еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates the<VAR>and</VAR>tags which direct the browser to render the text they surround in italics or however "variable" is defined stylistically.
+ * @details This procedure generates the<VAR>and</VAR>tags which direct the browser to render the text they surround in italics or however "variable" is defined stylistically.
+ * * Parameters:
+ * * @param CTEXT (in) VARCHAR2: The text to render in italics.
+ * * @param CATTRIBUTES (in) VARCHAR2: The other attributes to be included as-is in the tag.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/HTP.html
+ */
+Datum htp_variable(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.variable еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+// NO ARGUMENTS
+Datum htp_appletclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</applet>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_blockquoteclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</blockquote>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_bodyclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</body>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_centerclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</center>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_centeropen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<center>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_dirlistclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</dir>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_dirlistopen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<dir>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_dlistclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</dl>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_flush(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.flush еще не реализована.")));
+ PG_RETURN_VOID();
+}
+
+Datum htp_fontclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</font>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_formclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</form>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_formselectclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</select>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_formtextareaclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</textarea>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_framesetclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</frameset>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_headclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</head>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_headopen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<head>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_htmlclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</html>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_htmlopen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<html>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_init(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.init еще не реализована.")));
+ PG_RETURN_VOID();
+}
+
+Datum htp_listingclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</listing>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_listingopen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<listing>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_mapclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</map>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_menulistclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</menu>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_menulistopen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<menu>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_noframesclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</noframes>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_noframesopen(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("<noframes>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_olistclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</ol>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_para(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.para еще не реализована.")));
+ PG_RETURN_VOID();
+}
+
+Datum htp_preclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</pre>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_reset_get_page(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.reset_get_page еще не реализована.")));
+ PG_RETURN_VOID();
+}
+
+Datum htp_showpage(PG_FUNCTION_ARGS)
+{
+ DirectFunctionCall1(owa_util_showpage_utils, Int32GetDatum(0));
+ PG_RETURN_VOID();
+}
+
+Datum htp_tableclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</table>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_tablerowclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</tr>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_ulistclose(PG_FUNCTION_ARGS)
+{
+ htp::html_buffer_add("</ul>");
+ PG_RETURN_VOID();
+}
+
+Datum htp_wbr(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция htp.wbr еще не реализована.")));
+ PG_RETURN_VOID();
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/nlohmann/json-schema.hpp b/src/backend/utils/dbms/nlohmann/json-schema.hpp
new file mode 100644
index 0000000..07befd3
--- /dev/null
+++ b/src/backend/utils/dbms/nlohmann/json-schema.hpp
@@ -0,0 +1,198 @@
+/*
+ * JSON schema validator for JSON for modern C++
+ *
+ * Copyright (c) 2016-2019 Patrick Boettcher <p@yai.se>.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ */
+#ifndef NLOHMANN_JSON_SCHEMA_HPP__
+#define NLOHMANN_JSON_SCHEMA_HPP__
+
+#ifdef _WIN32
+# if defined(JSON_SCHEMA_VALIDATOR_EXPORTS)
+# define JSON_SCHEMA_VALIDATOR_API __declspec(dllexport)
+# elif defined(JSON_SCHEMA_VALIDATOR_IMPORTS)
+# define JSON_SCHEMA_VALIDATOR_API __declspec(dllimport)
+# else
+# define JSON_SCHEMA_VALIDATOR_API
+# endif
+#else
+# define JSON_SCHEMA_VALIDATOR_API
+#endif
+
+#include <nlohmann/json.hpp>
+
+#ifdef NLOHMANN_JSON_VERSION_MAJOR
+# if (NLOHMANN_JSON_VERSION_MAJOR * 10000 + NLOHMANN_JSON_VERSION_MINOR * 100 + NLOHMANN_JSON_VERSION_PATCH) < 30800
+# error "Please use this library with NLohmann's JSON version 3.8.0 or higher"
+# endif
+#else
+# error "expected existing NLOHMANN_JSON_VERSION_MAJOR preproc variable, please update to NLohmann's JSON 3.8.0"
+#endif
+
+// make yourself a home - welcome to nlohmann's namespace
+namespace nlohmann
+{
+
+// A class representing a JSON-URI for schemas derived from
+// section 8 of JSON Schema: A Media Type for Describing JSON Documents
+// draft-wright-json-schema-00
+//
+// New URIs can be derived from it using the derive()-method.
+// This is useful for resolving refs or subschema-IDs in json-schemas.
+//
+// This is done implement the requirements described in section 8.2.
+//
+class JSON_SCHEMA_VALIDATOR_API json_uri
+{
+ std::string urn_;
+
+ std::string scheme_;
+ std::string authority_;
+ std::string path_;
+
+ json::json_pointer pointer_; // fragment part if JSON-Pointer
+ std::string identifier_; // fragment part if Locatation Independent ID
+
+protected:
+ // decodes a JSON uri and replaces all or part of the currently stored values
+ void update(const std::string &uri);
+
+ std::tuple<std::string, std::string, std::string, std::string, std::string> as_tuple() const
+ {
+ return std::make_tuple(urn_, scheme_, authority_, path_, identifier_ != "" ? identifier_ : pointer_.to_string());
+ }
+
+public:
+ json_uri(const std::string &uri)
+ {
+ update(uri);
+ }
+
+ const std::string &scheme() const { return scheme_; }
+ const std::string &authority() const { return authority_; }
+ const std::string &path() const { return path_; }
+
+ const json::json_pointer &pointer() const { return pointer_; }
+ const std::string &identifier() const { return identifier_; }
+
+ std::string fragment() const
+ {
+ if (identifier_ == "")
+ return pointer_.to_string();
+ else
+ return identifier_;
+ }
+
+ std::string url() const { return location(); }
+ std::string location() const;
+
+ static std::string escape(const std::string &);
+
+ // create a new json_uri based in this one and the given uri
+ // resolves relative changes (pathes or pointers) and resets part if proto or hostname changes
+ json_uri derive(const std::string &uri) const
+ {
+ json_uri u = *this;
+ u.update(uri);
+ return u;
+ }
+
+ // append a pointer-field to the pointer-part of this uri
+ json_uri append(const std::string &field) const
+ {
+ if (identifier_ != "")
+ return *this;
+
+ json_uri u = *this;
+ u.pointer_ /= field;
+ return u;
+ }
+
+ std::string to_string() const;
+
+ friend bool operator<(const json_uri &l, const json_uri &r)
+ {
+ return l.as_tuple() < r.as_tuple();
+ }
+
+ friend bool operator==(const json_uri &l, const json_uri &r)
+ {
+ return l.as_tuple() == r.as_tuple();
+ }
+
+ friend std::ostream &operator<<(std::ostream &os, const json_uri &u);
+};
+
+namespace json_schema
+{
+
+extern json draft7_schema_builtin;
+
+typedef std::function<void(const json_uri & /*id*/, json & /*value*/)> schema_loader;
+typedef std::function<void(const std::string & /*format*/, const std::string & /*value*/)> format_checker;
+typedef std::function<void(const std::string & /*contentEncoding*/, const std::string & /*contentMediaType*/, const json & /*instance*/)> content_checker;
+
+// Interface for validation error handlers
+class JSON_SCHEMA_VALIDATOR_API error_handler
+{
+public:
+ virtual ~error_handler() {}
+ virtual void error(const json::json_pointer & /*ptr*/, const json & /*instance*/, const std::string & /*message*/) = 0;
+};
+
+class JSON_SCHEMA_VALIDATOR_API basic_error_handler : public error_handler
+{
+ bool error_{false};
+
+public:
+ void error(const json::json_pointer & /*ptr*/, const json & /*instance*/, const std::string & /*message*/) override
+ {
+ error_ = true;
+ }
+
+ virtual void reset() { error_ = false; }
+ operator bool() const { return error_; }
+};
+
+/**
+ * Checks validity of JSON schema built-in string format specifiers like 'date-time', 'ipv4', ...
+ */
+void JSON_SCHEMA_VALIDATOR_API default_string_format_check(const std::string &format, const std::string &value);
+
+class root_schema;
+
+class JSON_SCHEMA_VALIDATOR_API json_validator
+{
+ std::unique_ptr<root_schema> root_;
+
+public:
+ json_validator(schema_loader = nullptr, format_checker = nullptr, content_checker = nullptr);
+
+ json_validator(const json &, schema_loader = nullptr, format_checker = nullptr, content_checker = nullptr);
+ json_validator(json &&, schema_loader = nullptr, format_checker = nullptr, content_checker = nullptr);
+
+ json_validator(json_validator &&);
+ json_validator &operator=(json_validator &&);
+
+ json_validator(json_validator const &) = delete;
+ json_validator &operator=(json_validator const &) = delete;
+
+ ~json_validator();
+
+ // insert and set the root-schema
+ void set_root_schema(const json &);
+ void set_root_schema(json &&);
+
+ // validate a json-document based on the root-schema
+ json validate(const json &) const;
+
+ // validate a json-document based on the root-schema with a custom error-handler
+ json validate(const json &, error_handler &, const json_uri &initial_uri = json_uri("#")) const;
+};
+
+} // namespace json_schema
+} // namespace nlohmann
+
+#endif /* NLOHMANN_JSON_SCHEMA_HPP__ */
diff --git a/src/backend/utils/dbms/nlohmann/json.hpp b/src/backend/utils/dbms/nlohmann/json.hpp
new file mode 100644
index 0000000..5040d0e
--- /dev/null
+++ b/src/backend/utils/dbms/nlohmann/json.hpp
@@ -0,0 +1,6 @@
+#ifndef RUDB_DBMS_NLOHMANN_JSON_WRAPPER_HPP
+#define RUDB_DBMS_NLOHMANN_JSON_WRAPPER_HPP
+
+#include "../../../../../pg_dgrid/libs/include/json.hpp"
+
+#endif // RUDB_DBMS_NLOHMANN_JSON_WRAPPER_HPP
diff --git a/src/backend/utils/dbms/owa/owa_cache.cpp b/src/backend/utils/dbms/owa/owa_cache.cpp
new file mode 100644
index 0000000..43a8509
--- /dev/null
+++ b/src/backend/utils/dbms/owa/owa_cache.cpp
@@ -0,0 +1,770 @@
+#include "dbms/owa.h"
+
+#include <string>
+
+extern "C"
+{
+#include "access/xact.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/numeric.h"
+#include "utils/timestamp.h"
+}
+
+namespace Owa
+{
+static std::string
+normalizeCacheLevel(const std::string &cache_level)
+{
+ std::string normalizedLevel;
+
+ normalizedLevel.reserve(cache_level.size());
+ for (unsigned char ch : cache_level)
+ {
+ normalizedLevel.push_back(pg_toupper(ch));
+ }
+
+ return normalizedLevel;
+}
+
+void
+validateCacheEtag(const std::string &etag_value)
+{
+ validateHeaderValue(etag_value, "p_etag");
+
+ if (etag_value.length() > 55)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_CACHE parameter p_etag is longer than 55 characters.")));
+ }
+}
+
+std::string
+validateAndNormalizeCacheLevel(const std::string &level_value)
+{
+ std::string normalizedLevel;
+
+ validateHeaderValue(level_value, "p_level");
+ normalizedLevel = normalizeCacheLevel(level_value);
+
+ if (normalizedLevel != "USER" && normalizedLevel != "SYSTEM")
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_CACHE parameter p_level must be USER or SYSTEM.")));
+ }
+
+ return normalizedLevel;
+}
+
+std::string
+renderCacheHeaders(const std::string &etag_value, const std::string &level_value)
+{
+ std::string out;
+ const char *cacheScope = (level_value == "USER") ? "private" : "public";
+
+ out.reserve(etag_value.size() + level_value.size() + 96);
+ out += "ETag: \"";
+ out += etag_value;
+ out += "\"\n";
+ out += "Cache-Control: no-cache, ";
+ out += cacheScope;
+ out += "\n";
+
+ return out;
+}
+
+void
+validateCacheExpires(int32 expires_value)
+{
+ if (expires_value <= 0 || expires_value > 525600)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_EXPIRES parameter p_expires must be between 1 and 525600.")));
+ }
+}
+
+void
+validateSurrogateControlValue(const std::string &value)
+{
+ validateHeaderValue(value, "p_value");
+
+ if (value.length() > 55)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_SURROGATE_CONTROL parameter p_value is longer than 55 characters.")));
+ }
+}
+
+std::string
+renderExpiresHeaders(int32 expires_value, const std::string &level_value)
+{
+ TimestampTz expiresTimestamp;
+ text *expiresText = nullptr;
+ char *expiresCString = nullptr;
+ std::string out;
+ const char *cacheScope = (level_value == "USER") ? "private" : "public";
+
+ expiresTimestamp = DatumGetTimestampTz(DirectFunctionCall2(timestamp_pl_interval,
+ TimestampTzGetDatum(GetCurrentTimestamp()),
+ DirectFunctionCall7(make_interval,
+ Int32GetDatum(0),
+ Int32GetDatum(0),
+ Int32GetDatum(0),
+ Int32GetDatum(0),
+ Int32GetDatum(0),
+ Int32GetDatum(expires_value),
+ Float8GetDatum(0.0))));
+ expiresText = DatumGetTextPP(DirectFunctionCall2(timestamptz_to_char,
+ TimestampTzGetDatum(expiresTimestamp),
+ CStringGetTextDatum("Dy, DD Mon YYYY HH24:MI:SS \"GMT\"")));
+ expiresCString = text_to_cstring(expiresText);
+
+ out.reserve(strlen(expiresCString) + level_value.size() + 96);
+ out += "Cache-Control: max-age=";
+ out += std::to_string(expires_value * 60);
+ out += ", ";
+ out += cacheScope;
+ out += "\n";
+ out += "Expires: ";
+ out += expiresCString;
+ out += "\n";
+
+ pfree(expiresCString);
+ return out;
+}
+} /* namespace Owa */
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(owa_cache_set_cache);
+PG_FUNCTION_INFO_V1(owa_cache_set_expires);
+PG_FUNCTION_INFO_V1(owa_cache_set_not_modified);
+PG_FUNCTION_INFO_V1(owa_cache_disable);
+PG_FUNCTION_INFO_V1(owa_cache_set_surrogate_control);
+PG_FUNCTION_INFO_V1(owa_cache_set_request_etag);
+PG_FUNCTION_INFO_V1(owa_cache_set_request_level);
+PG_FUNCTION_INFO_V1(owa_cache_get_etag);
+PG_FUNCTION_INFO_V1(owa_cache_get_etag2);
+PG_FUNCTION_INFO_V1(owa_cache_get_level);
+
+Datum
+owa_cache_disable(PG_FUNCTION_ARGS)
+{
+ Owa::EventEntry ev;
+ Owa::PageContext *ctx = Owa::current_page_context_;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.DISABLE request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.DISABLE initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (ctx->state != Owa::PageState::HeadersOpen)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.DISABLE called after body started"),
+ errdetail("page_state=%s", "BodyStarted")));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.DISABLE must be called in HTTP header context")));
+ }
+
+ ev.kind = Owa::EventKind::Cache;
+ ev.subxid = GetCurrentSubTransactionId();
+ ev.cacheDisabled = true;
+ ctx->events.push_back(std::move(ev));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.DISABLE stored disable cache headers"),
+ errdetail("events_count=%zu", ctx->events.size())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_set_cache(PG_FUNCTION_ARGS)
+{
+ Owa::EventEntry ev;
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ std::string etagValue;
+ std::string levelValue;
+ std::string normalizedLevel;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (PG_NARGS() < 2 || PG_ARGISNULL(0) || PG_ARGISNULL(1))
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE invalid NULL parameter"),
+ errdetail("p_etag_is_null=%s, p_level_is_null=%s",
+ (PG_NARGS() < 1 || PG_ARGISNULL(0)) ? "true" : "false",
+ (PG_NARGS() < 2 || PG_ARGISNULL(1)) ? "true" : "false")));
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_CACHE parameters p_etag and p_level must not be NULL.")));
+ }
+
+ if (ctx->state != Owa::PageState::HeadersOpen)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE called after body started"),
+ errdetail("page_state=%s", "BodyStarted")));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.SET_CACHE must be called in HTTP header context")));
+ }
+
+ etagValue = Owa::textToString(PG_GETARG_TEXT_PP(0));
+ levelValue = Owa::textToString(PG_GETARG_TEXT_PP(1));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE parameters"),
+ errdetail("p_etag=\"%s\", p_etag_length=%zu, p_level=\"%s\"",
+ etagValue.c_str(),
+ etagValue.length(),
+ levelValue.c_str())));
+
+ Owa::validateCacheEtag(etagValue);
+ normalizedLevel = Owa::validateAndNormalizeCacheLevel(levelValue);
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE normalized"),
+ errdetail("normalized_level=\"%s\"", normalizedLevel.c_str())));
+
+ ev.kind = Owa::EventKind::Cache;
+ ev.subxid = GetCurrentSubTransactionId();
+ ev.cacheEtag = std::move(etagValue);
+ ev.cacheLevel = std::move(normalizedLevel);
+ ctx->events.push_back(std::move(ev));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_CACHE stored cache headers"),
+ errdetail("events_count=%zu", ctx->events.size())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_set_expires(PG_FUNCTION_ARGS)
+{
+ Owa::EventEntry ev;
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ Numeric expiresNumeric = nullptr;
+ int32 expiresValue;
+ std::string levelValue;
+ std::string normalizedLevel;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (PG_NARGS() < 2 || PG_ARGISNULL(0) || PG_ARGISNULL(1))
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES invalid NULL parameter"),
+ errdetail("p_expires_is_null=%s, p_level_is_null=%s",
+ (PG_NARGS() < 1 || PG_ARGISNULL(0)) ? "true" : "false",
+ (PG_NARGS() < 2 || PG_ARGISNULL(1)) ? "true" : "false")));
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_EXPIRES parameters p_expires and p_level must not be NULL.")));
+ }
+
+ if (ctx->state != Owa::PageState::HeadersOpen)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES called after body started"),
+ errdetail("page_state=%s", "BodyStarted")));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.SET_EXPIRES must be called in HTTP header context")));
+ }
+
+ expiresNumeric = PG_GETARG_NUMERIC(0);
+ expiresValue = DatumGetInt32(DirectFunctionCall1(numeric_int4, NumericGetDatum(expiresNumeric)));
+ levelValue = Owa::textToString(PG_GETARG_TEXT_PP(1));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES parameters"),
+ errdetail("p_expires=%d, p_level=\"%s\"",
+ expiresValue,
+ levelValue.c_str())));
+
+ Owa::validateCacheExpires(expiresValue);
+ normalizedLevel = Owa::validateAndNormalizeCacheLevel(levelValue);
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES normalized"),
+ errdetail("normalized_level=\"%s\", p_expires=%d",
+ normalizedLevel.c_str(),
+ expiresValue)));
+
+ ev.kind = Owa::EventKind::Cache;
+ ev.subxid = GetCurrentSubTransactionId();
+ ev.cacheLevel = std::move(normalizedLevel);
+ ev.cacheExpires = expiresValue;
+ ctx->events.push_back(std::move(ev));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_EXPIRES stored cache headers"),
+ errdetail("events_count=%zu", ctx->events.size())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_set_request_etag(PG_FUNCTION_ARGS)
+{
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ std::string etagValue;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_ETAG request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_ETAG initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (PG_NARGS() < 1 || PG_ARGISNULL(0))
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_ETAG invalid NULL parameter"),
+ errdetail("p_etag_is_null=%s",
+ (PG_NARGS() < 1 || PG_ARGISNULL(0)) ? "true" : "false")));
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_REQUEST_ETAG parameter p_etag must not be NULL.")));
+ }
+
+ etagValue = Owa::textToString(PG_GETARG_TEXT_PP(0));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_ETAG parameters"),
+ errdetail("p_etag=\"%s\", p_etag_length=%zu",
+ etagValue.c_str(),
+ etagValue.length())));
+
+ Owa::validateHeaderValue(etagValue, "p_etag");
+ if (etagValue.length() > 55)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_REQUEST_ETAG parameter p_etag is longer than 55 characters.")));
+ }
+
+ ctx->hasRequestCacheEtag = true;
+ ctx->requestCacheEtag = std::move(etagValue);
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_ETAG stored request cache context"),
+ errdetail("etag_length=%zu", ctx->requestCacheEtag.length())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_set_surrogate_control(PG_FUNCTION_ARGS)
+{
+ Owa::EventEntry ev;
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ std::string value;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_SURROGATE_CONTROL request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_SURROGATE_CONTROL initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (PG_NARGS() < 1 || PG_ARGISNULL(0))
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_SURROGATE_CONTROL invalid NULL parameter"),
+ errdetail("p_value_is_null=%s",
+ (PG_NARGS() < 1 || PG_ARGISNULL(0)) ? "true" : "false")));
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_SURROGATE_CONTROL parameter p_value must not be NULL.")));
+ }
+
+ if (ctx->state != Owa::PageState::HeadersOpen)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_SURROGATE_CONTROL called after body started"),
+ errdetail("page_state=%s", "BodyStarted")));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.SET_SURROGATE_CONTROL must be called in HTTP header context")));
+ }
+
+ value = Owa::textToString(PG_GETARG_TEXT_PP(0));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_SURROGATE_CONTROL parameters"),
+ errdetail("p_value=\"%s\", p_value_length=%zu",
+ value.c_str(),
+ value.length())));
+
+ Owa::validateSurrogateControlValue(value);
+
+ ev.kind = Owa::EventKind::Cache;
+ ev.subxid = GetCurrentSubTransactionId();
+ ev.cacheSurrogateControl = std::move(value);
+ ctx->events.push_back(std::move(ev));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_SURROGATE_CONTROL stored surrogate control"),
+ errdetail("events_count=%zu", ctx->events.size())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_set_not_modified(PG_FUNCTION_ARGS)
+{
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ const Owa::EventEntry *cacheEvent = nullptr;
+ Owa::EventEntry ev;
+ text *requestProtocolText = nullptr;
+ std::string requestProtocol;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (!ctx->hasRequestCacheEtag)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED missing request etag"),
+ errdetail("request_cache_etag=absent")));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_NOT_MODIFIED requires request If-None-Match etag.")));
+ }
+
+ if (ctx->state != Owa::PageState::HeadersOpen)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED called after body started"),
+ errdetail("page_state=%s", "BodyStarted")));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.SET_NOT_MODIFIED must be called in HTTP header context")));
+ }
+
+ for (auto it = ctx->events.rbegin(); it != ctx->events.rend(); ++it)
+ {
+ if (it->kind != Owa::EventKind::Cache)
+ {
+ continue;
+ }
+
+ if (it->cacheEtag.empty())
+ {
+ continue;
+ }
+
+ cacheEvent = &(*it);
+ break;
+ }
+
+ if (cacheEvent == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED missing response cache metadata"),
+ errdetail("request_etag=\"%s\"", ctx->requestCacheEtag.c_str())));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_NOT_MODIFIED requires a prior OWA_CACHE.SET_CACHE call.")));
+ }
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED compare"),
+ errdetail("request_etag=\"%s\", response_etag=\"%s\", response_level=\"%s\"",
+ ctx->requestCacheEtag.c_str(),
+ cacheEvent->cacheEtag.c_str(),
+ cacheEvent->cacheLevel.c_str())));
+
+ if (ctx->requestCacheEtag != cacheEvent->cacheEtag)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED etag mismatch"),
+ errdetail("request_etag=\"%s\", response_etag=\"%s\"",
+ ctx->requestCacheEtag.c_str(),
+ cacheEvent->cacheEtag.c_str())));
+ PG_RETURN_VOID();
+ }
+
+ if (ctx->hasRequestCacheLevel && ctx->requestCacheLevel != cacheEvent->cacheLevel)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED level mismatch"),
+ errdetail("request_level=\"%s\", response_level=\"%s\"",
+ ctx->requestCacheLevel.c_str(),
+ cacheEvent->cacheLevel.c_str())));
+ PG_RETURN_VOID();
+ }
+
+ requestProtocolText = DatumGetTextPP(DirectFunctionCall1(owa_util_get_cgi_env,
+ CStringGetTextDatum("REQUEST_PROTOCOL")));
+ if (requestProtocolText == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED missing request protocol"),
+ errdetail("request_etag=\"%s\", response_etag=\"%s\"",
+ ctx->requestCacheEtag.c_str(),
+ cacheEvent->cacheEtag.c_str())));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.SET_NOT_MODIFIED requires REQUEST_PROTOCOL for 304 response")));
+ }
+
+ requestProtocol = Owa::textToString(requestProtocolText);
+ Owa::validateHeaderValue(requestProtocol, "request_protocol");
+
+ ev.kind = Owa::EventKind::Status;
+ ev.subxid = GetCurrentSubTransactionId();
+ ev.statusCode = 304;
+ ev.statusReason = "Not Modified";
+ ctx->events.push_back(std::move(ev));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_NOT_MODIFIED stored status line"),
+ errdetail("status_code=%d, reason=\"%s\", request_protocol=\"%s\", events_count=%zu",
+ 304,
+ "Not Modified",
+ requestProtocol.c_str(),
+ ctx->events.size())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_set_request_level(PG_FUNCTION_ARGS)
+{
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ std::string levelValue;
+ std::string normalizedLevel;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_LEVEL request"),
+ errdetail("nargs=%d, ctx=%s",
+ PG_NARGS(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_LEVEL initializing request context"),
+ errdetail("reason=no active OWA page context")));
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (PG_NARGS() < 1 || PG_ARGISNULL(0))
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_LEVEL invalid NULL parameter"),
+ errdetail("p_level_is_null=%s",
+ (PG_NARGS() < 1 || PG_ARGISNULL(0)) ? "true" : "false")));
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_REQUEST_LEVEL parameter p_level must not be NULL.")));
+ }
+
+ levelValue = Owa::textToString(PG_GETARG_TEXT_PP(0));
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_LEVEL parameters"),
+ errdetail("p_level=\"%s\"", levelValue.c_str())));
+
+ Owa::validateHeaderValue(levelValue, "p_level");
+ normalizedLevel.reserve(levelValue.size());
+ for (unsigned char ch : levelValue)
+ {
+ normalizedLevel.push_back(pg_toupper(ch));
+ }
+
+ if (normalizedLevel != "USER" && normalizedLevel != "SYSTEM")
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ORA-06502: PL/SQL: numeric or value error"),
+ errdetail("OWA_CACHE.SET_REQUEST_LEVEL parameter p_level must be USER or SYSTEM.")));
+ }
+
+ ctx->hasRequestCacheLevel = true;
+ ctx->requestCacheLevel = std::move(normalizedLevel);
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.SET_REQUEST_LEVEL stored request cache context"),
+ errdetail("normalized_level=\"%s\"", ctx->requestCacheLevel.c_str())));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cache_get_etag(PG_FUNCTION_ARGS)
+{
+ Owa::PageContext *ctx = Owa::current_page_context_;
+
+ (void) fcinfo;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_ETAG request"),
+ errdetail("ctx=%s", ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_ETAG result"),
+ errdetail("etag=null, reason=no active OWA page context")));
+ PG_RETURN_NULL();
+ }
+
+ if (!ctx->hasRequestCacheEtag)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_ETAG result"),
+ errdetail("etag=null, reason=request cache etag is absent")));
+ PG_RETURN_NULL();
+ }
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_ETAG result"),
+ errdetail("etag=\"%s\", etag_length=%zu",
+ ctx->requestCacheEtag.c_str(),
+ ctx->requestCacheEtag.length())));
+ PG_RETURN_TEXT_P(cstring_to_text(ctx->requestCacheEtag.c_str()));
+}
+
+Datum
+owa_cache_get_etag2(PG_FUNCTION_ARGS)
+{
+ int32 serviceArg = 0;
+
+ if (PG_NARGS() != 1)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_CACHE.GET_ETAG2 accepts exactly 1 argument")));
+ }
+
+ if (!PG_ARGISNULL(0))
+ {
+ serviceArg = PG_GETARG_INT32(0);
+ }
+ (void) serviceArg;
+
+ return owa_cache_get_etag(fcinfo);
+}
+
+Datum
+owa_cache_get_level(PG_FUNCTION_ARGS)
+{
+ Owa::PageContext *ctx = Owa::current_page_context_;
+
+ (void) fcinfo;
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_LEVEL request"),
+ errdetail("ctx=%s", ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_LEVEL result"),
+ errdetail("level=null, reason=no active OWA page context")));
+ PG_RETURN_NULL();
+ }
+
+ if (!ctx->hasRequestCacheLevel)
+ {
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_LEVEL result"),
+ errdetail("level=null, reason=request cache level is absent")));
+ PG_RETURN_NULL();
+ }
+
+ ereport(LOG,
+ (errmsg("OWA_CACHE.GET_LEVEL result"),
+ errdetail("level=\"%s\"", ctx->requestCacheLevel.c_str())));
+ PG_RETURN_TEXT_P(cstring_to_text(ctx->requestCacheLevel.c_str()));
+}
+} /* extern "C" */
diff --git a/src/backend/utils/dbms/owa/owa_cookie.cpp b/src/backend/utils/dbms/owa/owa_cookie.cpp
new file mode 100644
index 0000000..6f0896d
--- /dev/null
+++ b/src/backend/utils/dbms/owa/owa_cookie.cpp
@@ -0,0 +1,883 @@
+#include "dbms/owa.h"
+
+#include <utility>
+
+extern "C"
+{
+#include "access/xact.h"
+#include "catalog/pg_type_d.h"
+#include "pgtime.h"
+#include "utils/array.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/timestamp.h"
+}
+
+namespace Owa
+{
+PageContext *current_page_context_ = nullptr;
+bool subxact_callback_registered_ = false;
+bool xact_callback_registered_ = false;
+
+std::string
+textToString(text *value)
+{
+ char *rawText = nullptr;
+ std::string converted;
+
+ rawText = text_to_cstring(value);
+ converted = rawText;
+ pfree(rawText);
+ return converted;
+}
+
+static const char *
+weekday3(int weekday)
+{
+ static const char *names[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+ if (weekday < 0 || weekday > 6)
+ {
+ return "Sun";
+ }
+ return names[weekday];
+}
+
+static const char *
+month3(int month)
+{
+ static const char *names[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ if (month < 0 || month > 11)
+ {
+ return "Jan";
+ }
+ return names[month];
+}
+
+static void
+checkNoCrlf(const std::string &arg_value, const char *arg_name)
+{
+ if (arg_value.find('\r') != std::string::npos ||
+ arg_value.find('\n') != std::string::npos)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid character in %s", arg_name),
+ errdetail("HTTP header values must not contain CR or LF.")));
+ }
+}
+
+static void
+checkAsciiHeader(const std::string &arg_value, const char *arg_name)
+{
+ for (unsigned char ch : arg_value)
+ {
+ if (ch < 0x20 || ch > 0x7E)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid character in %s", arg_name),
+ errdetail("HTTP headers must be ASCII and printable.")));
+ }
+ }
+}
+
+void
+validateHeaderValue(const std::string &arg_value, const char *arg_name)
+{
+ checkNoCrlf(arg_value, arg_name);
+ checkAsciiHeader(arg_value, arg_name);
+}
+
+void
+validateCookieName(const std::string &cookie_name)
+{
+ if (cookie_name.empty())
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("cookie name must not be empty")));
+ }
+
+ validateHeaderValue(cookie_name, "name");
+
+ if (cookie_name.find(' ') != std::string::npos ||
+ cookie_name.find(';') != std::string::npos ||
+ cookie_name.find(',') != std::string::npos ||
+ cookie_name.find('=') != std::string::npos)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid cookie name"),
+ errdetail("Cookie name must not contain spaces, ';', ',' or '='.")));
+ }
+}
+
+std::string
+normalizeCgiName(const std::string &cgi_name)
+{
+ std::string normalizedName;
+
+ normalizedName.reserve(cgi_name.size());
+ for (unsigned char ch : cgi_name)
+ {
+ normalizedName.push_back(pg_toupper(ch));
+ }
+
+ return normalizedName;
+}
+
+static void
+applyCacheCgiValue(PageContext *ctx, const std::string &cgi_name, const std::string &cgi_value)
+{
+ std::string normalizedName;
+
+ normalizedName = normalizeCgiName(cgi_name);
+ ctx->cgiValues[normalizedName] = cgi_value;
+
+ if (normalizedName == "OWA_CACHE_ETAG" ||
+ normalizedName == "HTTP_IF_NONE_MATCH")
+ {
+ validateCacheEtag(cgi_value);
+ ctx->hasRequestCacheEtag = true;
+ ctx->requestCacheEtag = cgi_value;
+ return;
+ }
+
+ if (normalizedName == "OWA_CACHE_LEVEL" ||
+ normalizedName == "HTTP_OWA_CACHE_LEVEL")
+ {
+ ctx->hasRequestCacheLevel = true;
+ ctx->requestCacheLevel = validateAndNormalizeCacheLevel(cgi_value);
+ return;
+ }
+
+ if (normalizedName == "REQUEST_PROTOCOL")
+ {
+ validateHeaderValue(cgi_value, "request_protocol");
+ ctx->hasRequestProtocol = true;
+ ctx->requestProtocol = cgi_value;
+ return;
+ }
+}
+
+static std::string
+renderStatusLine(int32 status_code, const std::string &status_reason)
+{
+ std::string out;
+
+ out.reserve(status_reason.size() + 24);
+ out += "Status: ";
+ out += std::to_string(status_code);
+ if (!status_reason.empty())
+ {
+ out += " ";
+ out += status_reason;
+ }
+ out += "\n";
+ return out;
+}
+
+static std::string
+formatCookieExpires(TimestampTz ts)
+{
+ pg_time_t utcTime;
+ struct pg_tm *tm = nullptr;
+ char outBuffer[128];
+
+ utcTime = timestamptz_to_time_t(ts);
+ tm = pg_gmtime(&utcTime);
+
+ if (tm == nullptr)
+ {
+ return "Thu, 01-Jan-1970 00:00:00 GMT";
+ }
+
+ snprintf(outBuffer,
+ sizeof(outBuffer),
+ "%s, %02d-%s-%04d %02d:%02d:%02d GMT",
+ weekday3(tm->tm_wday),
+ tm->tm_mday,
+ month3(tm->tm_mon),
+ tm->tm_year + 1900,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec);
+
+ return std::string(outBuffer);
+}
+
+static std::string
+renderCookieLine(const CookieData &cookie)
+{
+ std::string out;
+
+ out.reserve(128);
+ out += "Set-Cookie: ";
+ out += cookie.name;
+ out += "=";
+ out += cookie.value;
+ out += ";";
+
+ if (cookie.has_expires)
+ {
+ out += " expires=";
+ out += formatCookieExpires(cookie.expires);
+ out += ";";
+ }
+
+ if (cookie.has_path)
+ {
+ out += " path=";
+ out += cookie.path;
+ out += ";";
+ }
+
+ if (cookie.has_domain)
+ {
+ out += " domain=";
+ out += cookie.domain;
+ out += ";";
+ }
+
+ if (cookie.has_secure)
+ {
+ out += " secure;";
+ }
+
+ return out;
+}
+
+void
+resetPageContext(void)
+{
+ if (current_page_context_ == nullptr)
+ {
+ return;
+ }
+
+ delete current_page_context_;
+ current_page_context_ = nullptr;
+}
+
+static void
+xactCallback(XactEvent event, void *arg)
+{
+ (void) arg;
+
+ if (event == XACT_EVENT_PRE_COMMIT ||
+ event == XACT_EVENT_PARALLEL_PRE_COMMIT ||
+ event == XACT_EVENT_PRE_PREPARE ||
+ event == XACT_EVENT_PREPARE)
+ {
+ return;
+ }
+
+ resetPageContext();
+}
+
+static void
+subxactCallback(SubXactEvent event, SubTransactionId my_subid, SubTransactionId parent_subid, void *arg)
+{
+ PageContext *ctx = current_page_context_;
+ std::vector<EventEntry> newEvents;
+
+ (void) parent_subid;
+ (void) arg;
+
+ if (ctx == nullptr)
+ {
+ return;
+ }
+
+ if (event != SUBXACT_EVENT_ABORT_SUB)
+ {
+ return;
+ }
+
+ newEvents.reserve(ctx->events.size());
+ for (const auto &ev : ctx->events)
+ {
+ if (ev.subxid == my_subid)
+ {
+ continue;
+ }
+ newEvents.push_back(ev);
+ }
+
+ ctx->events.swap(newEvents);
+}
+
+void
+ensureCallbackRegistered(void)
+{
+ if (!xact_callback_registered_)
+ {
+ RegisterXactCallback(xactCallback, nullptr);
+ xact_callback_registered_ = true;
+ }
+
+ if (!subxact_callback_registered_)
+ {
+ RegisterSubXactCallback(subxactCallback, nullptr);
+ subxact_callback_registered_ = true;
+ }
+}
+
+void
+ensurePageContextViaServiceInit(void)
+{
+ if (current_page_context_ != nullptr)
+ {
+ return;
+ }
+
+ {
+ LOCAL_FCINFO(fcinfo2, 4);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 4, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = Int32GetDatum(0);
+ fcinfo2->args[0].isnull = false;
+ fcinfo2->args[1].value = (Datum) 0;
+ fcinfo2->args[1].isnull = true;
+ fcinfo2->args[2].value = (Datum) 0;
+ fcinfo2->args[2].isnull = true;
+ fcinfo2->args[3].value = Int32GetDatum(0);
+ fcinfo2->args[3].isnull = false;
+
+ (void) owa_init_cgi_env2(fcinfo2);
+ }
+}
+
+void
+appendHtpText(const char *text, bool add_new_line)
+{
+ PageContext *ctx = current_page_context_;
+ EventEntry ev;
+
+ if (ctx == nullptr)
+ {
+ return;
+ }
+
+ if (ctx->state == PageState::HeadersOpen)
+ {
+ ctx->state = PageState::BodyStarted;
+ }
+
+ ev.kind = EventKind::BodyText;
+ ev.subxid = GetCurrentSubTransactionId();
+ if (text != nullptr)
+ {
+ ev.bodyText = text;
+ }
+ if (add_new_line)
+ {
+ ev.bodyText.push_back('\n');
+ }
+
+ ctx->events.push_back(ev);
+}
+
+static std::string
+renderShowpageAndReset(void)
+{
+ PageContext *ctx = current_page_context_;
+ std::string out;
+ bool cacheDisabled = false;
+
+ if (ctx == nullptr)
+ {
+ return out;
+ }
+
+ for (const auto &ev : ctx->events)
+ {
+ if (ev.kind == EventKind::Cache && ev.cacheDisabled)
+ {
+ cacheDisabled = true;
+ break;
+ }
+ }
+
+ for (const auto &ev : ctx->events)
+ {
+ if (ev.kind == EventKind::BodyText)
+ {
+ out += ev.bodyText;
+ continue;
+ }
+
+ if (ev.kind == EventKind::Cookie)
+ {
+ out += renderCookieLine(ev.cookieData);
+ out.push_back('\n');
+ continue;
+ }
+
+ if (ev.kind == EventKind::Cache)
+ {
+ if (cacheDisabled)
+ {
+ continue;
+ }
+
+ if (!ev.cacheSurrogateControl.empty())
+ {
+ out += "Surrogate-Control: ";
+ out += ev.cacheSurrogateControl;
+ out += "\n";
+ }
+ else if (!ev.cacheEtag.empty())
+ {
+ out += renderCacheHeaders(ev.cacheEtag, ev.cacheLevel);
+ }
+ else
+ {
+ out += renderExpiresHeaders(ev.cacheExpires, ev.cacheLevel);
+ }
+ continue;
+ }
+
+ if (ev.kind == EventKind::Status)
+ {
+ out += renderStatusLine(ev.statusCode, ev.statusReason);
+ continue;
+ }
+ }
+
+ ctx->events.clear();
+ ctx->state = PageState::HeadersOpen;
+ return out;
+}
+} /* namespace Owa */
+
+extern "C"
+{
+PG_FUNCTION_INFO_V1(owa_init_cgi_env);
+PG_FUNCTION_INFO_V1(owa_init_cgi_env2);
+PG_FUNCTION_INFO_V1(owa_cookie_send);
+PG_FUNCTION_INFO_V1(owa_cookie_send2);
+PG_FUNCTION_INFO_V1(owa_util_get_cgi_env);
+PG_FUNCTION_INFO_V1(owa_util_showpage);
+PG_FUNCTION_INFO_V1(owa_util_showpage_utils);
+
+Datum
+owa_init_cgi_env(PG_FUNCTION_ARGS)
+{
+ int32 cgiCount = 0;
+ ArrayType *_nameArray = nullptr;
+ ArrayType *_valueArray = nullptr;
+ Datum *nameValues = nullptr;
+ Datum *valueValues = nullptr;
+ bool *nameNulls = nullptr;
+ bool *valueNulls = nullptr;
+ int nameCount = 0;
+ int valueCount = 0;
+ int processedCount = 0;
+ int ignoredCount = 0;
+
+ (void) fcinfo;
+
+ Owa::resetPageContext();
+ Owa::current_page_context_ = new Owa::PageContext();
+ Owa::ensureCallbackRegistered();
+
+ if (PG_NARGS() != 0 && PG_NARGS() != 3)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA.INIT_CGI_ENV accepts either 0 or 3 arguments")));
+ }
+
+ if (PG_NARGS() == 3)
+ {
+ if (PG_ARGISNULL(0))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("OWA.INIT_CGI_ENV parameter num_cgi_vars must not be NULL")));
+ }
+
+ cgiCount = PG_GETARG_INT32(0);
+ if (cgiCount < 0)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA.INIT_CGI_ENV parameter num_cgi_vars must be zero or greater")));
+ }
+
+ if (cgiCount > 0 && (PG_ARGISNULL(1) || PG_ARGISNULL(2)))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("OWA.INIT_CGI_ENV parameters param_name and param_val must not be NULL when num_cgi_vars is greater than zero")));
+ }
+
+ if (!PG_ARGISNULL(1))
+ {
+ _nameArray = PG_GETARG_ARRAYTYPE_P(1);
+ if (ARR_NDIM(_nameArray) > 1)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA.INIT_CGI_ENV parameter param_name must be a one-dimensional text array")));
+ }
+
+ if (ARR_NDIM(_nameArray) > 0)
+ {
+ deconstruct_array(_nameArray,
+ TEXTOID,
+ -1,
+ false,
+ 'i',
+ &nameValues,
+ &nameNulls,
+ &nameCount);
+ }
+ }
+
+ if (!PG_ARGISNULL(2))
+ {
+ _valueArray = PG_GETARG_ARRAYTYPE_P(2);
+ if (ARR_NDIM(_valueArray) > 1)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA.INIT_CGI_ENV parameter param_val must be a one-dimensional text array")));
+ }
+
+ if (ARR_NDIM(_valueArray) > 0)
+ {
+ deconstruct_array(_valueArray,
+ TEXTOID,
+ -1,
+ false,
+ 'i',
+ &valueValues,
+ &valueNulls,
+ &valueCount);
+ }
+ }
+
+ if (nameCount < cgiCount || valueCount < cgiCount)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA.INIT_CGI_ENV arrays are shorter than num_cgi_vars"),
+ errdetail("num_cgi_vars=%d, param_name_count=%d, param_val_count=%d",
+ cgiCount,
+ nameCount,
+ valueCount)));
+ }
+
+ for (int itemIndex = 0; itemIndex < cgiCount; ++itemIndex)
+ {
+ std::string nameValue;
+ std::string valueValue;
+ bool etagBefore;
+ bool levelBefore;
+
+ if ((nameNulls != nullptr && nameNulls[itemIndex]) ||
+ (valueNulls != nullptr && valueNulls[itemIndex]))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("OWA.INIT_CGI_ENV CGI name/value items must not be NULL"),
+ errdetail("item_index=%d", itemIndex + 1)));
+ }
+
+ nameValue = Owa::textToString(DatumGetTextPP(nameValues[itemIndex]));
+ valueValue = Owa::textToString(DatumGetTextPP(valueValues[itemIndex]));
+
+ Owa::validateHeaderValue(nameValue, "param_name");
+ Owa::validateHeaderValue(valueValue, "param_val");
+
+ etagBefore = Owa::current_page_context_->hasRequestCacheEtag;
+ levelBefore = Owa::current_page_context_->hasRequestCacheLevel;
+ Owa::applyCacheCgiValue(Owa::current_page_context_, nameValue, valueValue);
+
+ if ((!etagBefore && Owa::current_page_context_->hasRequestCacheEtag) ||
+ (!levelBefore && Owa::current_page_context_->hasRequestCacheLevel) ||
+ (etagBefore && Owa::normalizeCgiName(nameValue) == "OWA_CACHE_ETAG") ||
+ (etagBefore && Owa::normalizeCgiName(nameValue) == "HTTP_IF_NONE_MATCH") ||
+ (levelBefore && Owa::normalizeCgiName(nameValue) == "OWA_CACHE_LEVEL") ||
+ (levelBefore && Owa::normalizeCgiName(nameValue) == "HTTP_OWA_CACHE_LEVEL"))
+ {
+ ++processedCount;
+ }
+ else
+ {
+ ++ignoredCount;
+ }
+ }
+
+ if (nameValues != nullptr)
+ {
+ pfree(nameValues);
+ }
+ if (valueValues != nullptr)
+ {
+ pfree(valueValues);
+ }
+ if (nameNulls != nullptr)
+ {
+ pfree(nameNulls);
+ }
+ if (valueNulls != nullptr)
+ {
+ pfree(valueNulls);
+ }
+ }
+
+ ereport(LOG,
+ (errmsg("OWA.INIT_CGI_ENV initialized request context"),
+ errdetail("nargs=%d, num_cgi_vars=%d, recognized_cache_items=%d, ignored_items=%d, request_cache_etag=%s, request_cache_level=%s, request_protocol=%s",
+ PG_NARGS(),
+ cgiCount,
+ processedCount,
+ ignoredCount,
+ Owa::current_page_context_->hasRequestCacheEtag ? "present" : "absent",
+ Owa::current_page_context_->hasRequestCacheLevel ? "present" : "absent",
+ Owa::current_page_context_->hasRequestProtocol ? Owa::current_page_context_->requestProtocol.c_str() : "absent")));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_init_cgi_env2(PG_FUNCTION_ARGS)
+{
+ int32 serviceArg = 0;
+
+ if (PG_NARGS() != 4)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA.INIT_CGI_ENV2 accepts exactly 4 arguments")));
+ }
+
+ if (!PG_ARGISNULL(3))
+ {
+ serviceArg = PG_GETARG_INT32(3);
+ }
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 3);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 3, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = PG_GETARG_DATUM(0);
+ fcinfo2->args[0].isnull = PG_ARGISNULL(0);
+ fcinfo2->args[1].value = PG_GETARG_DATUM(1);
+ fcinfo2->args[1].isnull = PG_ARGISNULL(1);
+ fcinfo2->args[2].value = PG_GETARG_DATUM(2);
+ fcinfo2->args[2].isnull = PG_ARGISNULL(2);
+
+ (void) owa_init_cgi_env(fcinfo2);
+ }
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cookie_send(PG_FUNCTION_ARGS)
+{
+ Owa::CookieData cookieData;
+ std::string secureValue;
+ Owa::EventEntry ev;
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ bool isNullName = false;
+ bool isNullValue = false;
+
+ if (ctx == nullptr)
+ {
+ Owa::ensurePageContextViaServiceInit();
+ ctx = Owa::current_page_context_;
+ }
+
+ if (ctx->state != Owa::PageState::HeadersOpen)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_COOKIE.SEND must be called in HTTP header context")));
+ }
+
+ isNullName = PG_ARGISNULL(0);
+ isNullValue = PG_ARGISNULL(1);
+ cookieData.name = isNullName ? "" : Owa::textToString(PG_GETARG_TEXT_PP(0));
+ cookieData.value = isNullValue ? "" : Owa::textToString(PG_GETARG_TEXT_PP(1));
+
+ if (!isNullName)
+ {
+ Owa::validateCookieName(cookieData.name);
+ }
+
+ Owa::validateHeaderValue(cookieData.value, "value");
+
+ if (PG_NARGS() > 2 && !PG_ARGISNULL(2))
+ {
+ cookieData.has_expires = true;
+ cookieData.expires = PG_GETARG_TIMESTAMPTZ(2);
+ }
+
+ if (PG_NARGS() > 3 && !PG_ARGISNULL(3))
+ {
+ cookieData.has_path = true;
+ cookieData.path = Owa::textToString(PG_GETARG_TEXT_PP(3));
+ Owa::validateHeaderValue(cookieData.path, "path");
+ }
+
+ if (PG_NARGS() > 4 && !PG_ARGISNULL(4))
+ {
+ cookieData.has_domain = true;
+ cookieData.domain = Owa::textToString(PG_GETARG_TEXT_PP(4));
+ Owa::validateHeaderValue(cookieData.domain, "domain");
+ }
+
+ if (PG_NARGS() > 5 && !PG_ARGISNULL(5))
+ {
+ secureValue = Owa::textToString(PG_GETARG_TEXT_PP(5));
+ Owa::validateHeaderValue(secureValue, "secure");
+ cookieData.has_secure = true;
+ }
+
+ ev.kind = Owa::EventKind::Cookie;
+ ev.subxid = GetCurrentSubTransactionId();
+ ev.cookieData = std::move(cookieData);
+ ctx->events.push_back(std::move(ev));
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_cookie_send2(PG_FUNCTION_ARGS)
+{
+ int32 serviceArg = 0;
+
+ if (PG_NARGS() != 7)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_COOKIE.SEND2 accepts exactly 7 arguments")));
+ }
+
+ if (!PG_ARGISNULL(6))
+ {
+ serviceArg = PG_GETARG_INT32(6);
+ }
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 6);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 6, InvalidOid, nullptr, nullptr);
+ fcinfo2->args[0].value = PG_GETARG_DATUM(0);
+ fcinfo2->args[0].isnull = PG_ARGISNULL(0);
+ fcinfo2->args[1].value = PG_GETARG_DATUM(1);
+ fcinfo2->args[1].isnull = PG_ARGISNULL(1);
+ fcinfo2->args[2].value = PG_GETARG_DATUM(2);
+ fcinfo2->args[2].isnull = PG_ARGISNULL(2);
+ fcinfo2->args[3].value = PG_GETARG_DATUM(3);
+ fcinfo2->args[3].isnull = PG_ARGISNULL(3);
+ fcinfo2->args[4].value = PG_GETARG_DATUM(4);
+ fcinfo2->args[4].isnull = PG_ARGISNULL(4);
+ fcinfo2->args[5].value = PG_GETARG_DATUM(5);
+ fcinfo2->args[5].isnull = PG_ARGISNULL(5);
+
+ (void) owa_cookie_send(fcinfo2);
+ }
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_util_get_cgi_env(PG_FUNCTION_ARGS)
+{
+ Owa::PageContext *ctx = Owa::current_page_context_;
+ std::string paramName;
+ std::string normalizedName;
+ auto cgiIt = ctx == nullptr ? Owa::PageContext().cgiValues.end() : ctx->cgiValues.end();
+
+ if (PG_NARGS() < 1 || PG_ARGISNULL(0))
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("OWA_UTIL.GET_CGI_ENV parameter param_name must not be NULL")));
+ }
+
+ paramName = Owa::textToString(PG_GETARG_TEXT_PP(0));
+ normalizedName = Owa::normalizeCgiName(paramName);
+
+ ereport(LOG,
+ (errmsg("OWA_UTIL.GET_CGI_ENV request"),
+ errdetail("param_name=\"%s\", normalized_name=\"%s\", ctx=%s",
+ paramName.c_str(),
+ normalizedName.c_str(),
+ ctx == nullptr ? "null" : "present")));
+
+ if (ctx == nullptr)
+ {
+ ereport(LOG,
+ (errmsg("OWA_UTIL.GET_CGI_ENV result"),
+ errdetail("value=null, reason=no active OWA page context")));
+ PG_RETURN_NULL();
+ }
+
+ cgiIt = ctx->cgiValues.find(normalizedName);
+ if (cgiIt == ctx->cgiValues.end())
+ {
+ ereport(LOG,
+ (errmsg("OWA_UTIL.GET_CGI_ENV result"),
+ errdetail("value=null, reason=cgi variable not found")));
+ PG_RETURN_NULL();
+ }
+
+ ereport(LOG,
+ (errmsg("OWA_UTIL.GET_CGI_ENV result"),
+ errdetail("value=\"%s\"", cgiIt->second.c_str())));
+ PG_RETURN_TEXT_P(cstring_to_text(cgiIt->second.c_str()));
+}
+
+Datum
+owa_util_showpage(PG_FUNCTION_ARGS)
+{
+ std::string renderedText = Owa::renderShowpageAndReset();
+
+ (void) fcinfo;
+
+ if (!renderedText.empty())
+ {
+ ereport(NOTICE, (errmsg("%s", renderedText.c_str())));
+ }
+
+ PG_RETURN_VOID();
+}
+
+Datum
+owa_util_showpage_utils(PG_FUNCTION_ARGS)
+{
+ int32 serviceArg = 0;
+
+ if (PG_NARGS() != 1)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("OWA_UTIL.SHOWPAGE_UTILS accepts exactly 1 argument")));
+ }
+
+ if (!PG_ARGISNULL(0))
+ {
+ serviceArg = PG_GETARG_INT32(0);
+ }
+ (void) serviceArg;
+
+ {
+ LOCAL_FCINFO(fcinfo2, 0);
+
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 0, InvalidOid, nullptr, nullptr);
+ (void) owa_util_showpage(fcinfo2);
+ }
+
+ PG_RETURN_VOID();
+}
+} /* extern "C" */
diff --git a/src/backend/utils/dbms/owa_match/owa_match.cpp b/src/backend/utils/dbms/owa_match/owa_match.cpp
new file mode 100644
index 0000000..9c65521
--- /dev/null
+++ b/src/backend/utils/dbms/owa_match/owa_match.cpp
@@ -0,0 +1,143 @@
+#include <algorithm>
+#include <cstring>
+#include <string>
+#include <vector>
+
+#include "dbms/owa_text.h"
+#include "dbms/owa_pattern.h"
+
+extern "C" {
+#include "catalog/pg_collation.h"
+#include "mb/pg_wchar.h"
+#include "utils/builtins.h"
+}
+
+static const char *SPECIAL_CHARS = " @*()+-/=\\<>;:\"|&?{}[]'\t\n\r\f";
+
+extern "C" {
+
+Datum owa_match_match(PG_FUNCTION_ARGS);
+Datum owa_match_match2(PG_FUNCTION_ARGS);
+
+PG_FUNCTION_INFO_V1(owa_match_match);
+PG_FUNCTION_INFO_V1(owa_match_match2);
+
+Datum owa_match_match(PG_FUNCTION_ARGS)
+{
+ if (PG_ARGISNULL(0))
+ {
+ PG_RETURN_NULL();
+ }
+
+ text *p_string = PG_GETARG_TEXT_P(0);
+ std::string str;
+ str.resize(VARSIZE_ANY_EXHDR(p_string));
+ memcpy(str.data(), VARDATA_ANY(p_string), str.size());
+
+ bool p_use_special_chars = PG_ARGISNULL(3) ? true : PG_GETARG_BOOL(3);
+
+ if (p_use_special_chars)
+ {
+ auto it = std::find_if(
+ str.begin(),
+ str.end(),
+ [](char c) { return std::strchr(SPECIAL_CHARS, c) != nullptr; });
+
+ if (it != str.end())
+ {
+ PG_RETURN_BOOL(true);
+ }
+ }
+
+ std::vector<Datum> simple_patterns;
+ std::vector<Datum> complex_patterns;
+
+ if (!PG_ARGISNULL(1))
+ {
+ ArrayType *p_simple_patterns = PG_GETARG_ARRAYTYPE_P(1);
+ Datum *simple_patterns_elems;
+ bool *simple_pattern_nulls;
+ int simple_patterns_len;
+
+ deconstruct_array(p_simple_patterns, VARCHAR2OID, -1, false,
+ TYPALIGN_INT, &simple_patterns_elems,
+ &simple_pattern_nulls, &simple_patterns_len);
+ simple_patterns.assign(simple_patterns_elems,
+ simple_patterns_elems + simple_patterns_len);
+ pfree(simple_patterns_elems);
+ pfree(simple_pattern_nulls);
+
+ }
+
+ if (!PG_ARGISNULL(2))
+ {
+ ArrayType *p_complex_patterns = PG_GETARG_ARRAYTYPE_P(2);
+
+ Datum *complex_patterns_elems;
+ bool *complex_patterns_nulls;
+ int complex_patterns_len;
+
+ deconstruct_array(p_complex_patterns, VARCHAR2OID, -1, false,
+ TYPALIGN_INT, &complex_patterns_elems,
+ &complex_patterns_nulls, &complex_patterns_len);
+ complex_patterns.assign(complex_patterns_elems,
+ complex_patterns_elems + complex_patterns_len);
+
+ pfree(complex_patterns_elems);
+ pfree(complex_patterns_nulls);
+ }
+
+ for (Datum &pattern: simple_patterns)
+ {
+ Datum res_datum = DirectFunctionCall2Coll(texticlike,
+ PG_GET_COLLATION(),
+ PointerGetDatum(p_string),
+ pattern);
+ if (DatumGetBool(res_datum))
+ {
+ return true;
+ }
+ }
+
+ text *match_param = cstring_to_text("i");
+ for (Datum &pattern: complex_patterns)
+ {
+ Datum res_datum = DirectFunctionCall3Coll(owa_pattern_match_ovr2,
+ PG_GET_COLLATION(),
+ PointerGetDatum(p_string),
+ pattern,
+ PointerGetDatum(match_param));
+ if (DatumGetBool(res_datum))
+ {
+ pfree(match_param);
+ return true;
+ }
+ }
+ pfree(match_param);
+ return false;
+}
+
+Datum owa_match_match2(PG_FUNCTION_ARGS)
+{
+ Datum string = PG_GETARG_DATUM(0);
+ Datum simple_patterns = PG_GETARG_DATUM(1);
+ Datum complex_patterns = PG_GETARG_DATUM(2);
+ Datum use_special_chars = PG_GETARG_DATUM(3);
+
+ int32_t magic = PG_GETARG_INT32(4);
+
+ if (magic != 0x13371337)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid magic value!")));
+ }
+
+ return DirectFunctionCall4Coll(owa_match_match,
+ PG_GET_COLLATION(),
+ string,
+ simple_patterns,
+ complex_patterns,
+ use_special_chars);
+}
+
+}
\ No newline at end of file
diff --git a/src/backend/utils/dbms/owa_pattern/owa_pattern.cpp b/src/backend/utils/dbms/owa_pattern/owa_pattern.cpp
new file mode 100644
index 0000000..b3edad7
--- /dev/null
+++ b/src/backend/utils/dbms/owa_pattern/owa_pattern.cpp
@@ -0,0 +1,2642 @@
+#include <unordered_map>
+#include <vector>
+#include <string>
+
+#include "pg_config.h"
+
+#ifdef USE_PCRE2
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
+#endif /* USE_PCRE2 */
+
+extern "C"
+{
+#include "postgres.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "funcapi.h"
+}
+
+#include "dbms/owa_pattern.h"
+
+#ifdef USE_PCRE2
+/* RAII wrappers for PCRE2 structures */
+struct pattern
+{
+ pcre2_code *re;
+
+ pattern(pcre2_code *re): re(re) {}
+ ~pattern()
+ {
+ pcre2_code_free(re);
+ }
+};
+
+static int32_t current_handle = 0;
+
+static std::unordered_map<int32_t, pattern> patterns;
+
+static int owa_pattern_amatch_impl(char *line, int from_loc, pcre2_code *re,
+ std::vector<Datum> &backrefs)
+{
+ pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(re, nullptr);
+ int res = pcre2_match(re, reinterpret_cast<PCRE2_SPTR8>(line), strlen(line),
+ from_loc, 0, match_data, nullptr);
+ if (res < 0)
+ {
+ pcre2_match_data_free(match_data);
+ if (res == PCRE2_ERROR_NOMATCH)
+ {
+ return 0;
+ }
+ else
+ {
+ return res;
+ }
+ }
+ PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data);
+ for (int i = 0; i < res; i++)
+ {
+ char *substring_start = line + ovector[2 * i];
+ PCRE2_SIZE substring_length = ovector[2 * i + 1] - ovector[2 * i];
+ text *match_txt = cstring_to_text_with_len(substring_start,
+ (int)substring_length);
+ backrefs.push_back(PointerGetDatum(match_txt));
+ }
+ pcre2_match_data_free(match_data);
+ return res;
+}
+
+static std::string owa_pattern_change_impl(char *from_str, pcre2_code *re, char *to_str, bool global, int &res)
+{
+ std::string result;
+ PCRE2_SIZE output_len;
+ pcre2_substitute(re,
+ reinterpret_cast<PCRE2_SPTR8>(from_str),
+ PCRE2_ZERO_TERMINATED,
+ 0,
+ (global ? PCRE2_SUBSTITUTE_GLOBAL : 0) | PCRE2_SUBSTITUTE_OVERFLOW_LENGTH,
+ nullptr,
+ nullptr,
+ reinterpret_cast<PCRE2_SPTR8>(to_str),
+ PCRE2_ZERO_TERMINATED,
+ reinterpret_cast<PCRE2_UCHAR8*>(result.data()),
+ &output_len);
+
+ result.resize(output_len);
+ res = pcre2_substitute(re,
+ reinterpret_cast<PCRE2_SPTR8>(from_str),
+ PCRE2_ZERO_TERMINATED,
+ 0,
+ (global ? PCRE2_SUBSTITUTE_GLOBAL : 0),
+ nullptr,
+ nullptr,
+ reinterpret_cast<PCRE2_SPTR8>(to_str),
+ PCRE2_ZERO_TERMINATED,
+ reinterpret_cast<PCRE2_UCHAR8*>(result.data()),
+ &output_len);
+ return result;
+}
+
+static bool owa_pattern_match_impl(char *line, pcre2_code *re, std::vector<Datum> &backrefs)
+{
+ pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(re, nullptr);
+ int res = pcre2_match(re, reinterpret_cast<PCRE2_SPTR8>(line), strlen(line),
+ 0, 0, match_data, nullptr);
+ if (res < 0)
+ {
+ pcre2_match_data_free(match_data);
+ return false;
+ }
+ PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data);
+ for (int i = 0; i < res; i++)
+ {
+ char *substring_start = line + ovector[2 * i];
+ PCRE2_SIZE substring_length = ovector[2 * i + 1] - ovector[2 * i];
+ text *match_txt = cstring_to_text_with_len(substring_start,
+ (int)substring_length);
+ backrefs.push_back(PointerGetDatum(match_txt));
+ }
+ pcre2_match_data_free(match_data);
+ return true;
+}
+#endif /* USE_PCRE2 */
+
+static int32_t numeric_get_int32(Numeric num) {
+ Datum res_datum = DirectFunctionCall1(numeric_int4, NumericGetDatum(num));
+ int32_t res = DatumGetInt32(res_datum);
+ return res;
+}
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr1);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr2);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr3);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr4);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr5);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr6);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr7);
+PG_FUNCTION_INFO_V1(owa_pattern_amatch_ovr8);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr1);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr2);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr3);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr4);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr5);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr6);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr7);
+PG_FUNCTION_INFO_V1(owa_pattern_change_ovr8);
+PG_FUNCTION_INFO_V1(owa_pattern_getpat);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr1);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr2);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr3);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr4);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr5);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr6);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr7);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr8);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr9);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr10);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr11);
+PG_FUNCTION_INFO_V1(owa_pattern_match_ovr12);
+PG_FUNCTION_INFO_V1(owa_pattern_match2);
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in) VARCHAR2: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr1(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_NULL();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ text *pattern_txt = PG_GETARG_TEXT_P(2);
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED, 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ PG_RETURN_DATUM(DirectFunctionCall1(int4_numeric, Int32GetDatum(result)));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in) VARCHAR2: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr2(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_NULL();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ text *pattern_txt = PG_GETARG_TEXT_P(2);
+ text *flags_txt;
+ int caseless_match = 0;
+ if (!PG_ARGISNULL(3))
+ {
+ flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ caseless_match = *flags == 'i' ? PCRE2_CASELESS : 0;
+ pfree(flags);
+ }
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED,
+ caseless_match, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ PG_RETURN_DATUM(DirectFunctionCall1(int4_numeric, Int32GetDatum(result)));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr3(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ int pattern_handle = PG_GETARG_INT32(2);
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(result));
+ values[1] = Int32GetDatum(pattern_handle);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr4(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ int pattern_handle = PG_GETARG_INT32(2);
+
+ /* TODO: Since caselessness is fixed in pcre2_code, we have to isgnore flags parameter */
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(result));
+ values[1] = Int32GetDatum(pattern_handle);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in) VARCHAR2: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr5(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ text *pattern_txt = PG_GETARG_TEXT_P(2);
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED, 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(result));
+ values[1] = PointerGetDatum(arr);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in) VARCHAR2: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr6(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ text *pattern_txt = PG_GETARG_TEXT_P(2);
+ text *flags_txt;
+ int caseless_match = 0;
+ if (PG_ARGISNULL(3))
+ {
+ caseless_match = 0;
+ }
+ else
+ {
+ flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ caseless_match = *flags == 'i' ? PCRE2_CASELESS : 0;
+ pfree(flags);
+ }
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED,
+ caseless_match, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(result));
+ values[1] = PointerGetDatum(arr);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr7(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ int pattern_handle = PG_GETARG_INT32(2);
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[3];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(result));
+ values[1] = Int32GetDatum(pattern_handle);
+ values[3] = PointerGetDatum(arr);
+
+ bool isnull[3] = {false, false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function specifies if a pattern occurs in a particular location in a string.
+ * @details This function specifies if a pattern occurs in a particular location in a string.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The text to search in.
+ * * @param FROM_LOC (in) NUMBER: The location (in number of characters) inlinewhere the search is to begin.
+ * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The string to match. It can contain regular expressions. This can be either aVARCHAR2or a pattern. If it is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_amatch_ovr8(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.amatch еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ int result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ Numeric from_loc_num = PG_GETARG_NUMERIC(1);
+ int pattern_handle = PG_GETARG_INT32(2);
+
+ char *line = text_to_cstring(line_txt);
+ int32_t from_loc = numeric_get_int32(from_loc_num);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_amatch_impl(line, from_loc, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[3];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(result));
+ values[1] = Int32GetDatum(pattern_handle);
+ values[2] = PointerGetDatum(arr);
+
+ bool isnull[3] = {false, false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr1(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *line = text_to_cstring(line_txt);
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str), PCRE2_ZERO_TERMINATED, 0, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ int res;
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, false, res);
+
+ pcre2_code_free(re);
+
+ TupleDesc desc;
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(res));
+ values[1] = PointerGetDatum(cstring_to_text(substituted_line.c_str()));
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr2(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *line = text_to_cstring(line_txt);
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ bool global = false;
+ bool caseless = false;
+ if (!PG_ARGISNULL(3))
+ {
+ text *flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ for (char *flag = flags; *flag != '\0'; flag++)
+ {
+ switch(*flag)
+ {
+ case 'i':
+ caseless = true;
+ break;
+ case 'g':
+ global = true;
+ break;
+ default:
+ continue;
+ }
+ }
+ pfree(flags);
+ }
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str),
+ PCRE2_ZERO_TERMINATED,
+ caseless ? PCRE2_CASELESS : 0,
+ &error_number,
+ &error_offset,
+ nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ int res;
+ std::string substituted_line = owa_pattern_change_impl(line, nullptr, to_str, global, res);
+
+ pcre2_code_free(re);
+
+ TupleDesc desc;
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(res));
+ values[1] = PointerGetDatum(cstring_to_text(substituted_line.c_str()));
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr3(PG_FUNCTION_ARGS)
+{
+ // ovr1 but do not return number of substitutions
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *line = text_to_cstring(line_txt);
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str), PCRE2_ZERO_TERMINATED, 0, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ int res;
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, false, res);
+
+ pcre2_code_free(re);
+
+ text *substituted_line_txt = cstring_to_text(substituted_line.c_str());
+ PG_RETURN_TEXT_P(substituted_line_txt);
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param LINE (in/out) VARCHAR2: The text to search in. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr4(PG_FUNCTION_ARGS)
+{
+ // ovr2 but do not return number of substitutions
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *line = text_to_cstring(line_txt);
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ bool global = false;
+ bool caseless = false;
+ if (!PG_ARGISNULL(3))
+ {
+ text *flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ for (char *flag = flags; *flag != '\0'; flag++)
+ {
+ switch(*flag)
+ {
+ case 'i':
+ caseless = true;
+ break;
+ case 'g':
+ global = true;
+ break;
+ default:
+ continue;
+ }
+ }
+ pfree(flags);
+ }
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str),
+ PCRE2_ZERO_TERMINATED,
+ caseless ? PCRE2_CASELESS : 0,
+ &error_number,
+ &error_offset,
+ nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ int res;
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, global, res);
+
+ pcre2_code_free(re);
+
+ text *substituted_line_txt = cstring_to_text(substituted_line.c_str());
+ PG_RETURN_TEXT_P(substituted_line_txt);
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr5(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+ bool isattnull;
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ Datum partial_row_datum = GetAttributeByName(mline, "partial_row", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str), PCRE2_ZERO_TERMINATED, 0, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ std::vector<Datum> lines;
+ int total_res = 0;
+ for (int i = 0; i < rows_len; i++)
+ {
+ int res;
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, false, res);
+ text *substituted_line_txt = cstring_to_text(substituted_line.c_str());
+ lines.push_back(PointerGetDatum(substituted_line_txt));
+ pfree(line);
+
+ total_res += res;
+ }
+ pcre2_code_free(re);
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", VARCHAR2ARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+ TupleDescInitEntry(record_desc, 2, "partial_row", BOOLOID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ Datum record_values[3];
+ bool record_isnull[3];
+
+ ArrayType *new_arr = construct_array(lines.data(), lines.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ record_values[0] = PointerGetDatum(new_arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(lines.size()));
+ record_isnull[1] = false;
+
+ record_values[2] = partial_row_datum;
+ record_isnull[2] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(total_res));
+ values[1] = HeapTupleGetDatum(record_tuple);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr6(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+ bool isattnull;
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ Datum partial_row_datum = GetAttributeByName(mline, "partial_row", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ bool global = false;
+ bool caseless = false;
+ if (!PG_ARGISNULL(3))
+ {
+ text *flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ for (char *flag = flags; *flag != '\0'; flag++)
+ {
+ switch(*flag)
+ {
+ case 'i':
+ caseless = true;
+ break;
+ case 'g':
+ global = true;
+ break;
+ default:
+ continue;
+ }
+ }
+ pfree(flags);
+ }
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str),
+ PCRE2_ZERO_TERMINATED,
+ caseless ? PCRE2_CASELESS : 0,
+ &error_number,
+ &error_offset,
+ nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ std::vector<Datum> lines;
+ int total_res = 0;
+ for (int i = 0; i < rows_len; i++)
+ {
+ int res;
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, global, res);
+ text *substituted_line_txt = cstring_to_text(substituted_line.c_str());
+ lines.push_back(PointerGetDatum(substituted_line_txt));
+ pfree(line);
+
+ total_res += res;
+ }
+ pcre2_code_free(re);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", VARCHAR2ARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+ TupleDescInitEntry(record_desc, 2, "partial_row", BOOLOID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ Datum record_values[3];
+ bool record_isnull[3];
+
+ ArrayType *new_arr = construct_array(lines.data(), lines.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ record_values[0] = PointerGetDatum(new_arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(lines.size()));
+ record_isnull[1] = false;
+
+ record_values[2] = partial_row_datum;
+ record_isnull[2] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = DirectFunctionCall1(int4_numeric, Int32GetDatum(total_res));
+ values[1] = HeapTupleGetDatum(record_tuple);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr7(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+ bool isattnull;
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ Datum partial_row_datum = GetAttributeByName(mline, "partial_row", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str), PCRE2_ZERO_TERMINATED, 0, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ std::vector<Datum> lines;
+ for (int i = 0; i < rows_len; i++)
+ {
+ int res;
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, false, res);
+ text *substituted_line_txt = cstring_to_text(substituted_line.c_str());
+ lines.push_back(PointerGetDatum(substituted_line_txt));
+ pfree(line);
+ }
+ pcre2_code_free(re);
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", VARCHAR2ARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+ TupleDescInitEntry(record_desc, 2, "partial_row", BOOLOID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ Datum record_values[3];
+ bool record_isnull[3];
+
+ ArrayType *new_arr = construct_array(lines.data(), lines.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ record_values[0] = PointerGetDatum(new_arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(lines.size()));
+ record_isnull[1] = false;
+
+ record_values[2] = partial_row_datum;
+ record_isnull[2] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[1] = {HeapTupleGetDatum(record_tuple)};
+
+ bool isnull[1] = {false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * @details This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string.
+ * * @param FROM_STR (in) VARCHAR2: The regular expression to replace.
+ * * @param TO_STR (in) VARCHAR2: The substitution pattern.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive, and whether or not changes are to be made globally. If "i" is specified, the search is case-insensitive. If "g" is specified, changes are made to all matches. Otherwise, the function stops after the first substitution is made.
+ * * * @param MLINE (in/out) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype. The output value of this parameter is the altered string. (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_change_ovr8(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.change еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+ bool isattnull;
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ Datum partial_row_datum = GetAttributeByName(mline, "partial_row", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ text *from_str_txt = PG_GETARG_TEXT_P(1);
+ text *to_str_txt = PG_GETARG_TEXT_P(2);
+
+ char *from_str = text_to_cstring(from_str_txt);
+ char *to_str = text_to_cstring(to_str_txt);
+
+ bool global = false;
+ bool caseless = false;
+ if (!PG_ARGISNULL(3))
+ {
+ text *flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ for (char *flag = flags; *flag != '\0'; flag++)
+ {
+ switch(*flag)
+ {
+ case 'i':
+ caseless = true;
+ break;
+ case 'g':
+ global = true;
+ break;
+ default:
+ continue;
+ }
+ }
+ pfree(flags);
+ }
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ pcre2_code *re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(from_str),
+ PCRE2_ZERO_TERMINATED,
+ caseless ? PCRE2_CASELESS : 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ std::vector<Datum> lines;
+ for (int i = 0; i < rows_len; i++)
+ {
+ int res;
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ std::string substituted_line = owa_pattern_change_impl(line, re, to_str, global, res);
+ text *substituted_line_txt = cstring_to_text(substituted_line.c_str());
+ lines.push_back(PointerGetDatum(substituted_line_txt));
+ pfree(line);
+ }
+ pcre2_code_free(re);
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", VARCHAR2ARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+ TupleDescInitEntry(record_desc, 2, "partial_row", BOOLOID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ Datum record_values[3];
+ bool record_isnull[3];
+
+ ArrayType *new_arr = construct_array(lines.data(), lines.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ record_values[0] = PointerGetDatum(new_arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(lines.size()));
+ record_isnull[1] = false;
+
+ record_values[2] = partial_row_datum;
+ record_isnull[2] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[1] = {HeapTupleGetDatum(record_tuple)};
+
+ bool isnull[1] = {false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This procedure converts a VARCHAR2 string into anOWA_PATTERN.PATTERN DATA TYPE.
+ * @details This procedure converts a VARCHAR2 string into anOWA_PATTERN.PATTERN DATA TYPE.
+ * * Parameters:
+ * * @param ARG (in) VARCHAR2: The string to convert.
+ * * @param PAT (in/out) PL/SQL TABLE: theOWA_PATTERN.PATTERN DATA TYPEinitialized witharg.
+ * * * @param PAT (in/out) PL/SQL TABLE: theOWA_PATTERN.PATTERN DATA TYPEinitialized witharg. (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_getpat(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.getpat еще не реализована.")));
+
+ PG_RETURN_NULL();
+ #else
+ int error_number;
+ PCRE2_SIZE error_offset;
+ char *arg;
+ pcre2_code *re = nullptr;
+ int32_t pat_handle;
+ text *arg_txt = PG_GETARG_TEXT_P(0);
+ if (PG_ARGISNULL(1))
+ {
+ pat_handle = current_handle++;
+ }
+ else
+ {
+ Numeric pat_numeric = PG_GETARG_NUMERIC(1);
+ pat_handle = numeric_get_int32(pat_numeric);
+
+ patterns.erase(pat_handle);
+ }
+
+ arg = text_to_cstring(arg_txt);
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(arg), PCRE2_ZERO_TERMINATED, 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ patterns.emplace(pat_handle, re);
+
+ PG_RETURN_DATUM(DirectFunctionCall1(int4_numeric, Int32GetDatum(pat_handle)));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in) VARCHAR2: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr1(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *pattern_txt = PG_GETARG_TEXT_P(1);
+
+ char *line = text_to_cstring(line_txt);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED, 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ PG_RETURN_BOOL(result);
+
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in) VARCHAR2: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr2(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *pattern_txt = PG_GETARG_TEXT_P(1);
+
+ char *line = text_to_cstring(line_txt);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ int caseless_match = 0;
+ if (!PG_ARGISNULL(3))
+ {
+ text *flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ caseless_match = *flags == 'i' ? PCRE2_CASELESS : 0;
+ pfree(flags);
+ }
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern),
+ PCRE2_ZERO_TERMINATED,
+ caseless_match,
+ &error_number,
+ &error_offset,
+ nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ PG_RETURN_BOOL(result);
+
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr3(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ int pattern_handle = PG_GETARG_INT32(1);
+
+ char *line = text_to_cstring(line_txt);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(result);
+ values[1] = Int32GetDatum(pattern_handle);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr4(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ int pattern_handle = PG_GETARG_INT32(1);
+
+ char *line = text_to_cstring(line_txt);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ /* ignore flags parameter since caselessness is specified in pcre2_code already */
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(result);
+ values[1] = Int32GetDatum(pattern_handle);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in) VARCHAR2: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table.This parameter is a row_listthat holds each string in the target that was matched by a sequence of tokens in the regular expression. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr5(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *pattern_txt = PG_GETARG_TEXT_P(1);
+
+ char *line = text_to_cstring(line_txt);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED, 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(result);
+ values[1] = PointerGetDatum(arr);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in) VARCHAR2: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table.This parameter is a row_listthat holds each string in the target that was matched by a sequence of tokens in the regular expression. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr6(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ int error_number;
+ PCRE2_SIZE error_offset;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ text *pattern_txt = PG_GETARG_TEXT_P(1);
+ text *flags_txt;
+ int caseless_match = 0;
+ if (PG_ARGISNULL(3))
+ {
+ caseless_match = 0;
+ }
+ else
+ {
+ flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ caseless_match = *flags == 'i' ? PCRE2_CASELESS : 0;
+ pfree(flags);
+ }
+
+ char *line = text_to_cstring(line_txt);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED,
+ caseless_match, &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ PG_RETURN_NULL();
+ }
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pcre2_code_free(re);
+ pfree(line);
+ pfree(pattern);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(result);
+ values[1] = PointerGetDatum(arr);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table.This parameter is a row_listthat holds each string in the target that was matched by a sequence of tokens in the regular expression. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr7(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ int pattern_handle = PG_GETARG_INT32(1);
+
+ char *line = text_to_cstring(line_txt);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[3];
+ values[0] = BoolGetDatum(result);
+ values[1] = Int32GetDatum(pattern_handle);
+ values[2] = PointerGetDatum(arr);
+
+ bool isnull[3] = {false, false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param LINE (in) VARCHAR2: The line to search in.
+ * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * @param BACKREFS (out) PL/SQL TABLE: The text that is matched. Each token that is matched is placed in a cell in theOWA_TEXT.VC_ARR DATA TYPEPL/SQL table.This parameter is a row_listthat holds each string in the target that was matched by a sequence of tokens in the regular expression. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr8(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool result;
+ pcre2_code *re;
+ text *line_txt = PG_GETARG_TEXT_P(0);
+ int pattern_handle = PG_GETARG_INT32(1);
+
+ char *line = text_to_cstring(line_txt);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(line);
+ PG_RETURN_NULL();
+ }
+
+ /* ignore flags parameter since caselessness is specified in pcre2_code already */
+
+ re = pattern_it->second.re;
+
+ result = owa_pattern_match_impl(line, re, backrefs);
+
+ pfree(line);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ ArrayType *arr = construct_array(backrefs.data(), backrefs.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ Datum values[3];
+ values[0] = BoolGetDatum(result);
+ values[1] = Int32GetDatum(pattern_handle);
+ values[2] = PointerGetDatum(arr);
+
+ bool isnull[3] = {false, false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif /* USE_PCRE2 */
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype..
+ * * @param PAT (in) VARCHAR2: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param RLIST (out) PL/SQL RECORD: An output parameter containing a list of matches. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr9(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool isattnull;
+ pcre2_code *re;
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ text *pattern_txt = PG_GETARG_TEXT_P(1);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED, 0,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ std::vector<Datum> matches;
+ for (int i = 0; i < rows_len; i++)
+ {
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ int res = owa_pattern_amatch_impl(line, 0, re, backrefs);
+ matches.push_back(DirectFunctionCall1(int4_numeric, Int32GetDatum(res)));
+ pfree(line);
+ }
+
+ pcre2_code_free(re);
+ pfree(pattern);
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", NUMBERARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ ArrayType *arr = construct_array(matches.data(), matches.size(), NUMBERARRAYOID, -1, false, TYPALIGN_INT);
+
+ Datum record_values[2];
+ bool record_isnull[2];
+
+ record_values[0] = PointerGetDatum(arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(matches.size()));
+ record_isnull[1] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(!matches.empty());
+ values[1] = HeapTupleGetDatum(record_tuple);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype..
+ * * @param PAT (in) VARCHAR2: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param RLIST (out) PL/SQL RECORD: An output parameter containing a list of matches. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr10(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool isattnull;
+ pcre2_code *re;
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ text *pattern_txt = PG_GETARG_TEXT_P(1);
+ char *pattern = text_to_cstring(pattern_txt);
+
+ int caseless_match = 0;
+ if (!PG_ARGISNULL(3))
+ {
+ text *flags_txt = PG_GETARG_TEXT_P(3);
+ char *flags = text_to_cstring(flags_txt);
+ caseless_match = *flags == 'i' ? PCRE2_CASELESS : 0;
+ pfree(flags);
+ }
+
+ int error_number;
+ PCRE2_SIZE error_offset;
+ re = pcre2_compile(reinterpret_cast<PCRE2_SPTR8>(pattern), PCRE2_ZERO_TERMINATED, caseless_match,
+ &error_number, &error_offset, nullptr);
+
+ if (re == nullptr)
+ {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(error_number, buffer, sizeof(buffer));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("PCRE2 compilation failed at offset %zu: %s",
+ error_offset, buffer)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ std::vector<Datum> matches;
+ for (int i = 0; i < rows_len; i++)
+ {
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ int res = owa_pattern_amatch_impl(line, 0, re, backrefs);
+ matches.push_back(DirectFunctionCall1(int4_numeric, Int32GetDatum(res)));
+ pfree(line);
+ }
+
+ pcre2_code_free(re);
+ pfree(pattern);
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", NUMBERARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ ArrayType *arr = construct_array(matches.data(), matches.size(), NUMBERARRAYOID, -1, false, TYPALIGN_INT);
+
+ Datum record_values[2];
+ bool record_isnull[2];
+
+ record_values[0] = PointerGetDatum(arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(matches.size()));
+ record_isnull[1] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(!matches.empty());
+ values[1] = HeapTupleGetDatum(record_tuple);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype..
+ * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * @param RLIST (out) PL/SQL RECORD: An output parameter containing a list of matches. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr11(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool isattnull;
+ pcre2_code *re;
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ int32_t pattern_handle = PG_GETARG_INT32(1);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ std::vector<Datum> matches;
+ for (int i = 0; i < rows_len; i++)
+ {
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ int res = owa_pattern_amatch_impl(line, 0, re, backrefs);
+ matches.push_back(DirectFunctionCall1(int4_numeric, Int32GetDatum(res)));
+ pfree(line);
+ }
+
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", NUMBERARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ ArrayType *arr = construct_array(matches.data(), matches.size(), NUMBERARRAYOID, -1, false, TYPALIGN_INT);
+
+ Datum record_values[2];
+ bool record_isnull[2];
+
+ record_values[0] = PointerGetDatum(arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(matches.size()));
+ record_isnull[1] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(!matches.empty());
+ values[1] = HeapTupleGetDatum(record_tuple);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif
+}
+
+/**
+ * @brief This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * @details This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.
+ * * Parameters:
+ * * @param MLINE (in) PL/SQL RECORD: The text to search in. This is aowa_text.multi_line datatype..
+ * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched.
+ * * @param FLAGS (in) VARCHAR2: Whether or not the search is case-sensitive. If the value of this parameter is "i", the search is case-insensitive. Otherwise the search is case-sensitive.
+ * * * @param PAT (in/out) PL/SQL TABLE: The pattern to match. This is either aVARCHAR2or aOWA_PATTERN.PATTERN DATA TYPE. It is a pattern, the output value of this parameter is the pattern matched. (Возвращается через результат)
+ * * @param RLIST (out) PL/SQL RECORD: An output parameter containing a list of matches. (Возвращается через результат)
+ * * * * @return record: Композитный тип (), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_PATTERN.html
+ */
+Datum owa_pattern_match_ovr12(PG_FUNCTION_ARGS)
+{
+ #ifndef USE_PCRE2
+ ereport(NOTICE, (errmsg("Функция owa_pattern.match еще не реализована.")));
+
+ PG_RETURN_VOID();
+ #else
+ std::vector<Datum> backrefs;
+ bool isattnull;
+ pcre2_code *re;
+ HeapTupleHeader mline = PG_GETARG_HEAPTUPLEHEADER(0);
+
+ Datum rows_datum = GetAttributeByName(mline, "rows", &isattnull);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ Datum *rows;
+ bool *row_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows, &row_nulls, &rows_len);
+
+ int32_t pattern_handle = PG_GETARG_INT32(1);
+
+ auto pattern_it = patterns.find(pattern_handle);
+ if (pattern_it == patterns.end())
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid pattern handle: %d", pattern_handle)));
+ pfree(rows);
+ pfree(row_nulls);
+ PG_RETURN_NULL();
+ }
+
+ re = pattern_it->second.re;
+
+ /* ignore flags parameter since caselessness is specified in pcre2_code already */
+
+ std::vector<Datum> matches;
+ for (int i = 0; i < rows_len; i++)
+ {
+ text *line_txt = DatumGetTextP(rows[i]);
+ char *line = text_to_cstring(line_txt);
+ int res = owa_pattern_amatch_impl(line, 0, re, backrefs);
+ matches.push_back(DirectFunctionCall1(int4_numeric, Int32GetDatum(res)));
+ pfree(line);
+ }
+
+ pfree(rows);
+ pfree(row_nulls);
+
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", NUMBERARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+
+ record_desc = BlessTupleDesc(record_desc);
+
+ ArrayType *arr = construct_array(matches.data(), matches.size(), NUMBERARRAYOID, -1, false, TYPALIGN_INT);
+
+ Datum record_values[2];
+ bool record_isnull[2];
+
+ record_values[0] = PointerGetDatum(arr);
+ record_isnull[0] = false;
+
+ record_values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(matches.size()));
+ record_isnull[1] = false;
+
+ HeapTuple record_tuple = heap_form_tuple(record_desc, record_values, record_isnull);
+
+ TupleDesc desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ values[0] = BoolGetDatum(!matches.empty());
+ values[1] = HeapTupleGetDatum(record_tuple);
+
+ bool isnull[2] = {false, false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+ #endif
+}
+
+Datum owa_pattern_match2(PG_FUNCTION_ARGS)
+{
+ Datum line = PG_GETARG_DATUM(0);
+ Datum pat = PG_GETARG_DATUM(1);
+
+ int32_t magic = PG_GETARG_INT32(2);
+
+ if (magic != 0x13371337)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid magic value!")));
+ PG_RETURN_NULL();
+ }
+
+ return DirectFunctionCall2(owa_pattern_match_ovr1, line, pat);
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/owa_text/owa_text.cpp b/src/backend/utils/dbms/owa_text/owa_text.cpp
new file mode 100644
index 0000000..a8eb2ef
--- /dev/null
+++ b/src/backend/utils/dbms/owa_text/owa_text.cpp
@@ -0,0 +1,508 @@
+extern "C" {
+#include "postgres.h"
+#include "executor/executor.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "funcapi.h"
+}
+
+#include <vector>
+#include <string>
+#include <cstring>
+
+#include "dbms/owa_text.h"
+#include "dbms/htp.h"
+
+namespace owa_text {
+
+struct multi_line
+{
+ std::vector<Datum> rows;
+ bool partial_row;
+
+ multi_line(): rows(), partial_row(false) {}
+ multi_line(HeapTupleHeader pg_mline);
+
+ Datum make_pg_record();
+};
+
+multi_line::multi_line(HeapTupleHeader pg_mline)
+{
+ bool isnull_temp;
+ Datum rows_datum = GetAttributeByName(pg_mline, "rows", &isnull_temp);
+ Datum partial_row_datum = GetAttributeByName(pg_mline, "partial_row", &isnull_temp);
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ partial_row = DatumGetBool(partial_row_datum);
+
+ Datum *rows_elems;
+ bool *rows_nulls;
+ int rows_len;
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &rows_elems, &rows_nulls, &rows_len);
+
+ rows.assign(rows_elems, rows_elems + rows_len);
+
+ pfree(rows_elems);
+ pfree(rows_nulls);
+}
+
+Datum multi_line::make_pg_record()
+{
+ TupleDesc desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(desc, 0, "rows", VARCHAR2ARRAYOID, -1, 1);
+ TupleDescInitEntry(desc, 1, "num_rows", NUMBEROID, -1, 0);
+ TupleDescInitEntry(desc, 2, "partial_row", BOOLOID, -1, 0);
+
+ desc = BlessTupleDesc(desc);
+
+ Datum values[3];
+ bool isnull[3];
+
+ ArrayType *new_arr = construct_array(rows.data(), rows.size(), VARCHAR2OID, -1, false, TYPALIGN_INT);
+
+ values[0] = PointerGetDatum(new_arr);
+ isnull[0] = false;
+
+ values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(rows.size()));
+ isnull[1] = false;
+
+ values[2] = BoolGetDatum(partial_row);
+ isnull[2] = false;
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ return HeapTupleGetDatum(tuple);
+}
+} // namespace owa_text
+
+static Datum owa_text_add2multi_impl(const char *stream, owa_text::multi_line &mline, bool cont)
+{
+ bool prev_partial_row = false;
+
+ const char *row_start = stream;
+ const char *row_end = strchr(row_start, '\n');
+ size_t row_len = row_end != nullptr ? row_end - row_start : strlen(stream);
+
+ prev_partial_row = mline.partial_row;
+ mline.partial_row = (row_end == nullptr);
+
+ if (prev_partial_row && cont)
+ {
+ text *last_row_text = DatumGetTextP(mline.rows.back());
+ char *last_row_cstr = text_to_cstring(last_row_text);
+ std::string last_row = last_row_cstr;
+ pfree(last_row_cstr);
+
+ if (last_row.size() + row_len > 32767) {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Cannot create row larger than 32767 bytes")));
+ return static_cast<Datum>(0);
+ }
+
+ last_row.append(row_start, row_len);
+ mline.rows.back() = PointerGetDatum(cstring_to_text(last_row.c_str()));
+
+ if (row_end == nullptr)
+ {
+ row_start = nullptr;
+ row_len = 0;
+ }
+ else
+ {
+ row_start = row_end + 1;
+ row_end = strchr(row_start, '\n');
+ row_len = row_end != nullptr ? row_end - row_start : strlen(row_start);
+ }
+
+ if (row_start != nullptr && *row_start != '\0' && row_end == nullptr) {
+ mline.partial_row = true;
+ }
+ }
+
+ while (row_start != nullptr && *row_start != '\0') {
+ mline.rows.push_back(PointerGetDatum(cstring_to_text_with_len(row_start, row_len)));
+
+ if (row_end == nullptr)
+ {
+ row_start = nullptr;
+ row_len = 0;
+ }
+ else
+ {
+ row_start = row_end + 1;
+ row_start = strchr(row_start, '\n');
+ row_len = row_end != nullptr ? row_end - row_start : strlen(row_start);
+ }
+
+ if (row_start != nullptr && *row_start != '\0' && row_end == nullptr) {
+ mline.partial_row = true;
+ }
+ }
+
+ return mline.make_pg_record();
+}
+
+extern "C" {
+
+PG_FUNCTION_INFO_V1(owa_text_add2multi_ovr1);
+PG_FUNCTION_INFO_V1(owa_text_add2multi_ovr2);
+PG_FUNCTION_INFO_V1(owa_text_new_multi_ovr1);
+PG_FUNCTION_INFO_V1(owa_text_new_multi_ovr2);
+PG_FUNCTION_INFO_V1(owa_text_new_row_list_ovr1);
+PG_FUNCTION_INFO_V1(owa_text_new_row_list_ovr2);
+PG_FUNCTION_INFO_V1(owa_text_print_multi);
+PG_FUNCTION_INFO_V1(owa_text_print_row_list);
+PG_FUNCTION_INFO_V1(owa_text_stream2multi);
+PG_FUNCTION_INFO_V1(owa_text_stream2multi2);
+
+/**
+ * @brief This procedure adds content to an existing Multi_Line Data Type
+ * @details This procedure adds content to an existing Multi_Line Data Type
+ * * Parameters:
+ * * @param STREAM (in) VARCHAR2: The text to add.
+ * * @param MLINE (in/out) PL/SQL RECORD: The OWA_TEXT.MULTI_LINE DATA TYPE. The output of this
+ * parameter contains stream.
+ * * * @param MLINE (in/out) PL/SQL RECORD: The OWA_TEXT.MULTI_LINE DATA TYPE. The output of this
+ * parameter contains stream. (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_add2multi_ovr1(PG_FUNCTION_ARGS)
+{
+ TupleDesc desc;
+ text *stream_txt = PG_GETARG_TEXT_P(0);
+ char *stream = text_to_cstring(stream_txt);
+ HeapTupleHeader t = PG_GETARG_HEAPTUPLEHEADER(1);
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ pfree(stream);
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ owa_text::multi_line mline{t};
+
+ Datum values[1] = {owa_text_add2multi_impl(stream, mline, true)};
+ bool isnull[1] = {false};
+
+ pfree(stream);
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+}
+
+/**
+ * @brief This procedure adds content to an existing Multi_Line Data Type
+ * @details This procedure adds content to an existing Multi_Line Data Type
+ * * Parameters:
+ * * @param STREAM (in) VARCHAR2: The text to add.
+ * * @param MLINE (in/out) PL/SQL RECORD: The OWA_TEXT.MULTI_LINE DATA TYPE. The output of this
+ * parameter contains stream.
+ * * @param CONTINUE (in) BOOLEAN: If TRUE, the procedure appends streamwithin the previous final
+ * row (assuming it is less than 32K). If FALSE, the procedure places streamin a new row.
+ * * * @param MLINE (in/out) PL/SQL RECORD: The OWA_TEXT.MULTI_LINE DATA TYPE. The output of this
+ * parameter contains stream. (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_add2multi_ovr2(PG_FUNCTION_ARGS)
+{
+ TupleDesc desc;
+ text *stream_txt = PG_GETARG_TEXT_P(0);
+ char *stream = text_to_cstring(stream_txt);
+ HeapTupleHeader t = PG_GETARG_HEAPTUPLEHEADER(1);
+ bool cont = PG_GETARG_BOOL(2);
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ pfree(stream);
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ owa_text::multi_line mline{t};
+
+ Datum values[1] = {owa_text_add2multi_impl(stream, mline, cont)};
+ bool isnull[1] = {false};
+
+ pfree(stream);
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_new_multi_ovr1(PG_FUNCTION_ARGS)
+{
+ owa_text::multi_line mline{};
+
+ PG_RETURN_DATUM(mline.make_pg_record());
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * * @param MLINE (out) PL/SQL RECORD: TODO: Описание параметра MLINE (Возвращается через
+ * результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_new_multi_ovr2(PG_FUNCTION_ARGS)
+{
+ owa_text::multi_line mline{};
+ TupleDesc result_desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &result_desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ result_desc = BlessTupleDesc(result_desc);
+
+ Datum result_values[1] = {mline.make_pg_record()};
+ bool result_nulls[1] = {false};
+
+ HeapTuple result_tuple = heap_form_tuple(result_desc, result_values, result_nulls);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(result_tuple));
+}
+
+/**
+ * @brief This function or procedure creates a new OWA_TEX.ROW_LIST DATA TYPE.
+ * @details This function or procedure creates a new OWA_TEX.ROW_LIST DATA TYPE.
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_new_row_list_ovr1(PG_FUNCTION_ARGS)
+{
+ TupleDesc desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(desc, 0, "rows", NUMBERARRAYOID, -1, 1);
+ TupleDescInitEntry(desc, 1, "num_rows", NUMBEROID, -1, 0);
+
+ TupleDesc blessed_desc = BlessTupleDesc(desc);
+
+ Datum values[2];
+ bool isnull[2];
+
+ ArrayType *arr = construct_array(nullptr, 0, NUMBERARRAYOID, -1, false, TYPALIGN_INT);
+
+ values[0] = PointerGetDatum(arr);
+ isnull[0] = false;
+
+ values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(0));
+ isnull[1] = false;
+
+ HeapTuple tuple = heap_form_tuple(blessed_desc, values, isnull);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+}
+
+/**
+ * @brief This function or procedure creates a new OWA_TEX.ROW_LIST DATA TYPE.
+ * @details This function or procedure creates a new OWA_TEX.ROW_LIST DATA TYPE.
+ * * Parameters:
+ * * * @param RLIST (out) PL/SQL RECORD: This is an output parameter containing the new row_list
+ * data type (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_new_row_list_ovr2(PG_FUNCTION_ARGS)
+{
+ TupleDesc record_desc = CreateTemplateTupleDesc(3);
+ TupleDescInitEntry(record_desc, 0, "rows", NUMBERARRAYOID, -1, 1);
+ TupleDescInitEntry(record_desc, 1, "num_rows", NUMBEROID, -1, 0);
+
+ Datum values[2];
+ bool isnull[2];
+
+ ArrayType *arr = construct_array(nullptr, 0, NUMBEROID, -1, false, TYPALIGN_INT);
+
+ values[0] = PointerGetDatum(arr);
+ isnull[0] = false;
+
+ values[1] = DirectFunctionCall1(int4_numeric, Int32GetDatum(0));
+ isnull[1] = false;
+
+ HeapTuple tuple = heap_form_tuple(record_desc, values, isnull);
+
+ TupleDesc result_desc;
+
+ if (get_call_result_type(fcinfo, nullptr, &result_desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ PG_RETURN_VOID();
+ }
+
+ result_desc = BlessTupleDesc(result_desc);
+
+ Datum result_values[1] = {HeapTupleGetDatum(tuple)};
+ bool result_nulls[1] = {false};
+
+ HeapTuple result_tuple = heap_form_tuple(result_desc, result_values, result_nulls);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(result_tuple));
+}
+
+/**
+ * @brief This procedure uses the PRINT Procedures or the PRN Procedures to print the "rows" field
+ * of the OWA_TEXT.MULTI_LINE DATA TYPE.
+ * @details This procedure uses the PRINT Procedures or the PRN Procedures to print the "rows" field
+ * of the OWA_TEXT.MULTI_LINE DATA TYPE.
+ * * Parameters:
+ * * @param MLINE (in) PL/SQL RECORD: The multi_line datatype to print.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_print_multi(PG_FUNCTION_ARGS)
+{
+ Datum *rows;
+ bool *nulls;
+ bool isnull;
+ int nelems;
+ HeapTupleHeader t = PG_GETARG_HEAPTUPLEHEADER(0);
+
+ Datum rows_datum = GetAttributeByName(t, "rows", &isnull);
+
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ deconstruct_array(rows_arr, VARCHAR2OID, -1, false, TYPALIGN_INT, &rows, &nulls, &nelems);
+
+ for (int i = 0; i < nelems; i++)
+ {
+ DirectFunctionCall1(htp_print_ovr1, rows[i]);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure uses the PRINT Procedures or the PRN Procedures to print the "rows" field
+ * of the OWA_TEXT.ROW_LIST DATA TYPE.
+ * @details This procedure uses the PRINT Procedures or the PRN Procedures to print the "rows" field
+ * of the OWA_TEXT.ROW_LIST DATA TYPE.
+ * * Parameters:
+ * * @param RLIST (in) PL/SQL RECORD: The row_list datatype to print.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_print_row_list(PG_FUNCTION_ARGS)
+{
+ Datum *rows;
+ bool *nulls;
+ bool isnull;
+ int nelems;
+ HeapTupleHeader t = PG_GETARG_HEAPTUPLEHEADER(0);
+
+ Datum rows_datum = GetAttributeByName(t, "rows", &isnull);
+
+ ArrayType *rows_arr = DatumGetArrayTypeP(rows_datum);
+ deconstruct_array(rows_arr, NUMBEROID, -1, false, TYPALIGN_INT, &rows, &nulls, &nelems);
+
+ for (int i = 0; i < nelems; i++)
+ {
+ DirectFunctionCall1(htp_print_ovr3, rows[i]);
+ }
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure converts a string to a multi_line data type.
+ * @details This procedure converts a string to a multi_line data type.
+ * * Parameters:
+ * * @param STREAM (in) VARCHAR2: The string to convert.
+ * * * @param MLINE (out) PL/SQL RECORD: The stream in OWA_TEXT.MULTI_LINE DATA TYPE format
+ * (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_stream2multi(PG_FUNCTION_ARGS)
+{
+ TupleDesc desc;
+ text *stream_txt = PG_GETARG_TEXT_P(0);
+ char *stream = text_to_cstring(stream_txt);
+
+ if (get_call_result_type(fcinfo, nullptr, &desc) != TYPEFUNC_COMPOSITE)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("Invalid call context: cannot return record!")));
+ pfree(stream);
+ PG_RETURN_VOID();
+ }
+
+ desc = BlessTupleDesc(desc);
+
+ owa_text::multi_line mline{};
+
+ Datum values[1] = {owa_text_add2multi_impl(stream, mline, true)};
+ bool isnull[1] = {false};
+
+ HeapTuple tuple = heap_form_tuple(desc, values, isnull);
+
+ pfree(stream);
+
+ PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
+}
+
+/**
+ * @brief This procedure converts a string to a multi_line data type.
+ * @details This procedure converts a string to a multi_line data type.
+ * * Parameters:
+ * * @param STREAM (in) VARCHAR2: The string to convert.
+ * * @param MLINE (out) PL/SQL RECORD: The stream in OWA_TEXT.MULTI_LINE DATA TYPE format
+ * * @param LEN (out) INT4: length limit
+ * (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql record), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_TEXT.html
+ */
+Datum owa_text_stream2multi2(PG_FUNCTION_ARGS)
+{
+ text *stream_txt = PG_GETARG_TEXT_P(0);
+ char *stream = text_to_cstring(stream_txt);
+ int limit = PG_GETARG_INT32(1);
+
+
+ owa_text::multi_line mline{};
+
+ if (static_cast<size_t>(limit) < strlen(stream))
+ {
+ stream[limit] = '\0';
+ }
+
+ text *new_stream = cstring_to_text(stream);
+ pfree(stream);
+
+ PG_RETURN_DATUM(DirectFunctionCall1(owa_text_stream2multi,
+ PointerGetDatum(new_stream)));
+}
+
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/owa_util/owa_util.cpp b/src/backend/utils/dbms/owa_util/owa_util.cpp
new file mode 100644
index 0000000..ac5a1f4
--- /dev/null
+++ b/src/backend/utils/dbms/owa_util/owa_util.cpp
@@ -0,0 +1,1504 @@
+#include "owa_util.hpp"
+
+#include <ctime>
+#include <cstring>
+#include <iomanip>
+#include <limits>
+#include <numeric>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include "dbms/htp.h"
+
+extern "C"
+{
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/lsyscache.h"
+#include "executor/executor.h"
+}
+
+#include "dbms/htp.h"
+
+extern "C"
+{
+
+PG_FUNCTION_INFO_V1(owa_util_bind_variables);
+PG_FUNCTION_INFO_V1(owa_util_calendarprint_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_calendarprint_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr3);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr4);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr5);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr6);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr7);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr8);
+PG_FUNCTION_INFO_V1(owa_util_cellsprint_ovr9);
+PG_FUNCTION_INFO_V1(owa_util_choose_date);
+PG_FUNCTION_INFO_V1(owa_util_comma_to_ident_arr_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_comma_to_ident_arr_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_describe_cols);
+// PG_FUNCTION_INFO_V1(owa_util_get_cgi_env);
+PG_FUNCTION_INFO_V1(owa_util_get_owa_service_path);
+PG_FUNCTION_INFO_V1(owa_util_get_procedure);
+PG_FUNCTION_INFO_V1(owa_util_get_version);
+PG_FUNCTION_INFO_V1(owa_util_ite);
+PG_FUNCTION_INFO_V1(owa_util_listprint_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_listprint_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_mime_header);
+PG_FUNCTION_INFO_V1(owa_util_name_resolve);
+PG_FUNCTION_INFO_V1(owa_util_path_to_me);
+PG_FUNCTION_INFO_V1(owa_util_redirect_url);
+PG_FUNCTION_INFO_V1(owa_util_resolve_table);
+PG_FUNCTION_INFO_V1(owa_util_showsource);
+PG_FUNCTION_INFO_V1(owa_util_show_query_columns);
+PG_FUNCTION_INFO_V1(owa_util_signature_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_signature_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_status_line);
+PG_FUNCTION_INFO_V1(owa_util_tablecaption);
+PG_FUNCTION_INFO_V1(owa_util_tableclose_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_tableclose_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_tabledata);
+PG_FUNCTION_INFO_V1(owa_util_tableheader_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_tableheader_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_tableheaderrowclose_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_tableheaderrowclose_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_tableheaderrowopen_ovr1);
+PG_FUNCTION_INFO_V1(owa_util_tableheaderrowopen_ovr2);
+PG_FUNCTION_INFO_V1(owa_util_tablenodata);
+PG_FUNCTION_INFO_V1(owa_util_tableopen);
+PG_FUNCTION_INFO_V1(owa_util_tableprint);
+PG_FUNCTION_INFO_V1(owa_util_tablerowclose);
+PG_FUNCTION_INFO_V1(owa_util_tablerowopen);
+PG_FUNCTION_INFO_V1(owa_util_todate);
+PG_FUNCTION_INFO_V1(owa_util_validate_arg);
+PG_FUNCTION_INFO_V1(owa_util_who_called_me);
+PG_FUNCTION_INFO_V1(owa_util_http_header_close);
+
+/**
+ * @brief This function prepares a SQL query by binding variables to it, and stores the output in an opened cursor. Use this function as a parameter to a procedure sending a dynamically generated query. Specify up to 25 bind variables.
+ * @details This function prepares a SQL query by binding variables to it, and stores the output in an opened cursor. Use this function as a parameter to a procedure sending a dynamically generated query. Specify up to 25 bind variables.
+ * * Parameters:
+ * * @param THEQUERY (in) VARCHAR2: The SQL query statement which must be a SELECT statement
+ * * @param BV1NAME (in) VARCHAR2: The name of the variable
+ * * @param BV1VALUE (in) VARCHAR2: The value of the variable
+ * * @param BV2NAME (in) VARCHAR2: TODO: Описание параметра BV2NAME
+ * * @param BV2VALUE (in) VARCHAR2: TODO: Описание параметра BV2VALUE
+ * * @param BV3NAME (in) VARCHAR2: TODO: Описание параметра BV3NAME
+ * * @param BV3VALUE (in) VARCHAR2: TODO: Описание параметра BV3VALUE
+ * * @param BV4NAME (in) VARCHAR2: TODO: Описание параметра BV4NAME
+ * * @param BV4VALUE (in) VARCHAR2: TODO: Описание параметра BV4VALUE
+ * * @param BV5NAME (in) VARCHAR2: TODO: Описание параметра BV5NAME
+ * * @param BV5VALUE (in) VARCHAR2: TODO: Описание параметра BV5VALUE
+ * * @param BV6NAME (in) VARCHAR2: TODO: Описание параметра BV6NAME
+ * * @param BV6VALUE (in) VARCHAR2: TODO: Описание параметра BV6VALUE
+ * * @param BV7NAME (in) VARCHAR2: TODO: Описание параметра BV7NAME
+ * * @param BV7VALUE (in) VARCHAR2: TODO: Описание параметра BV7VALUE
+ * * @param BV8NAME (in) VARCHAR2: TODO: Описание параметра BV8NAME
+ * * @param BV8VALUE (in) VARCHAR2: TODO: Описание параметра BV8VALUE
+ * * @param BV9NAME (in) VARCHAR2: TODO: Описание параметра BV9NAME
+ * * @param BV9VALUE (in) VARCHAR2: TODO: Описание параметра BV9VALUE
+ * * @param BV10NAME (in) VARCHAR2: TODO: Описание параметра BV10NAME
+ * * @param BV10VALUE (in) VARCHAR2: TODO: Описание параметра BV10VALUE
+ * * @param BV11NAME (in) VARCHAR2: TODO: Описание параметра BV11NAME
+ * * @param BV11VALUE (in) VARCHAR2: TODO: Описание параметра BV11VALUE
+ * * @param BV12NAME (in) VARCHAR2: TODO: Описание параметра BV12NAME
+ * * @param BV12VALUE (in) VARCHAR2: TODO: Описание параметра BV12VALUE
+ * * @param BV13NAME (in) VARCHAR2: TODO: Описание параметра BV13NAME
+ * * @param BV13VALUE (in) VARCHAR2: TODO: Описание параметра BV13VALUE
+ * * @param BV14NAME (in) VARCHAR2: TODO: Описание параметра BV14NAME
+ * * @param BV14VALUE (in) VARCHAR2: TODO: Описание параметра BV14VALUE
+ * * @param BV15NAME (in) VARCHAR2: TODO: Описание параметра BV15NAME
+ * * @param BV15VALUE (in) VARCHAR2: TODO: Описание параметра BV15VALUE
+ * * @param BV16NAME (in) VARCHAR2: TODO: Описание параметра BV16NAME
+ * * @param BV16VALUE (in) VARCHAR2: TODO: Описание параметра BV16VALUE
+ * * @param BV17NAME (in) VARCHAR2: TODO: Описание параметра BV17NAME
+ * * @param BV17VALUE (in) VARCHAR2: TODO: Описание параметра BV17VALUE
+ * * @param BV18NAME (in) VARCHAR2: TODO: Описание параметра BV18NAME
+ * * @param BV18VALUE (in) VARCHAR2: TODO: Описание параметра BV18VALUE
+ * * @param BV19NAME (in) VARCHAR2: TODO: Описание параметра BV19NAME
+ * * @param BV19VALUE (in) VARCHAR2: TODO: Описание параметра BV19VALUE
+ * * @param BV20NAME (in) VARCHAR2: TODO: Описание параметра BV20NAME
+ * * @param BV20VALUE (in) VARCHAR2: TODO: Описание параметра BV20VALUE
+ * * @param BV21NAME (in) VARCHAR2: TODO: Описание параметра BV21NAME
+ * * @param BV21VALUE (in) VARCHAR2: TODO: Описание параметра BV21VALUE
+ * * @param BV22NAME (in) VARCHAR2: TODO: Описание параметра BV22NAME
+ * * @param BV22VALUE (in) VARCHAR2: TODO: Описание параметра BV22VALUE
+ * * @param BV23NAME (in) VARCHAR2: TODO: Описание параметра BV23NAME
+ * * @param BV23VALUE (in) VARCHAR2: TODO: Описание параметра BV23VALUE
+ * * @param BV24NAME (in) VARCHAR2: TODO: Описание параметра BV24NAME
+ * * @param BV24VALUE (in) VARCHAR2: TODO: Описание параметра BV24VALUE
+ * * @param BV25NAME (in) VARCHAR2: TODO: Описание параметра BV25NAME
+ * * @param BV25VALUE (in) VARCHAR2: TODO: Описание параметра BV25VALUE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_bind_variables(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.bind_variables еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures creates a calendar in HTML with a visible border. Each date in the calendar can contain any number of hypertext links.
+ * @details These procedures creates a calendar in HTML with a visible border. Each date in the calendar can contain any number of hypertext links.
+ * * Parameters:
+ * * @param P_QUERY (in) VARCHAR2: A PL/SQL query.
+ * * @param P_MF_ONLY (in) VARCHAR2: If "N" (the default), the generated calendar includes Sunday through Saturday. Otherwise, it includes Monday through Friday only.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_calendarprint_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.calendarprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief These procedures creates a calendar in HTML with a visible border. Each date in the calendar can contain any number of hypertext links.
+ * @details These procedures creates a calendar in HTML with a visible border. Each date in the calendar can contain any number of hypertext links.
+ * * Parameters:
+ * * @param P_CURSOR (in) NUMBER: A PL/SQL cursor containing the same format asp_query.
+ * * @param P_MF_ONLY (in) VARCHAR2: If "N" (the default), the generated calendar includes Sunday through Saturday. Otherwise, it includes Monday through Friday only.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_calendarprint_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.calendarprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_COLCNT (in) NUMBER: The number of columns in the table.
+ * * @param P_RESULTTBL (in) PL/SQL TABLE: The index table which will contain the result of the query. Each entry in the query will correspond to one column value.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THEQUERY (in) VARCHAR2: A SQLSELECTstatement.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THECURSOR (in) NUMBER: A cursor ID. This can be the return value from theBIND_VARIABLES Function.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr3(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THEQUERY (in) VARCHAR2: A SQLSELECTstatement.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * @param P_SKIP_REC (in) NUMBER: The number of rows to exclude from the HTML table.
+ * * * @param P_MORE_DATA (out) BOOLEAN: TRUEif there are more rows in the query or cursor,FALSEotherwise. (Возвращается через результат)
+ * * * * @return record: Композитный тип (boolean), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr4(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THECURSOR (in) NUMBER: A cursor ID. This can be the return value from theBIND_VARIABLES Function.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * @param P_SKIP_REC (in) NUMBER: The number of rows to exclude from the HTML table.
+ * * * @param P_MORE_DATA (out) BOOLEAN: TRUEif there are more rows in the query or cursor,FALSEotherwise. (Возвращается через результат)
+ * * * * @return record: Композитный тип (boolean), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr5(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THEQUERY (in) VARCHAR2: A SQLSELECTstatement.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * * @param P_RECCNT (out) NUMBER: The number of rows that have been returned by the query. This value does not include skipped rows (if any). (Возвращается через результат)
+ * * * * @return record: Композитный тип (number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr6(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THECURSOR (in) NUMBER: A cursor ID. This can be the return value from theBIND_VARIABLES Function.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * * @param P_RECCNT (out) NUMBER: The number of rows that have been returned by the query. This value does not include skipped rows (if any). (Возвращается через результат)
+ * * * * @return record: Композитный тип (number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr7(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THEQUERY (in) VARCHAR2: A SQLSELECTstatement.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * @param P_SKIP_REC (in) NUMBER: The number of rows to exclude from the HTML table.
+ * * * @param P_MORE_DATA (out) BOOLEAN: TRUEif there are more rows in the query or cursor,FALSEotherwise. (Возвращается через результат)
+ * * @param P_RECCNT (out) NUMBER: The number of rows that have been returned by the query. This value does not include skipped rows (if any). (Возвращается через результат)
+ * * * * @return record: Композитный тип (boolean number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr8(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * @details This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.
+ * * Parameters:
+ * * @param P_THECURSOR (in) NUMBER: A cursor ID. This can be the return value from theBIND_VARIABLES Function.
+ * * @param P_MAX_ROWS (in) NUMBER: The maximum number of rows to print.
+ * * @param P_FORMAT_NUMBERS (in) VARCHAR2: If the value of this parameter is notNULL, number fields are right justified and rounded to two decimal places.
+ * * @param P_SKIP_REC (in) NUMBER: The number of rows to exclude from the HTML table.
+ * * * @param P_MORE_DATA (out) BOOLEAN: TRUEif there are more rows in the query or cursor,FALSEotherwise. (Возвращается через результат)
+ * * @param P_RECCNT (out) NUMBER: The number of rows that have been returned by the query. This value does not include skipped rows (if any). (Возвращается через результат)
+ * * * * @return record: Композитный тип (boolean number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_cellsprint_ovr9(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.cellsprint еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure generates three HTML form elements that allow the user to select the day, the month, and the year.
+ * @details This procedure generates three HTML form elements that allow the user to select the day, the month, and the year.
+ * * Parameters:
+ * * @param P_NAME (in) VARCHAR2: The name of the form elements.
+ * * @param P_DATE (in) DATE: The initial date that is selected when the HTML page is displayed.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_choose_date(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.choose_date еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param LIST (in) VARCHAR2: TODO: Описание параметра LIST
+ * * * @param ARR (out) PL/SQL TABLE: TODO: Описание параметра ARR (Возвращается через результат)
+ * * @param LENARR (out) PL/SQL TABLE: TODO: Описание параметра LENARR (Возвращается через результат)
+ * * @param ARRLEN (out) NUMBER: TODO: Описание параметра ARRLEN (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table pl/sql table number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_comma_to_ident_arr_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.comma_to_ident_arr еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param LIST (in) VARCHAR2: TODO: Описание параметра LIST
+ * * * @param ARR (out) PL/SQL TABLE: TODO: Описание параметра ARR (Возвращается через результат)
+ * * @param LENARR (out) PL/SQL TABLE: TODO: Описание параметра LENARR (Возвращается через результат)
+ * * @param ARRLEN (out) NUMBER: TODO: Описание параметра ARRLEN (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table pl/sql table number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_comma_to_ident_arr_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.comma_to_ident_arr еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTABLE (in) VARCHAR2: TODO: Описание параметра CTABLE
+ * * @param CCOLUMNS (in) VARCHAR2: TODO: Описание параметра CCOLUMNS
+ * * * @param COL_NAMES (out) PL/SQL TABLE: TODO: Описание параметра COL_NAMES (Возвращается через результат)
+ * * @param COL_DTYPES (out) PL/SQL TABLE: TODO: Описание параметра COL_DTYPES (Возвращается через результат)
+ * * @param NNUM_COLS (out) NUMBER: TODO: Описание параметра NNUM_COLS (Возвращается через результат)
+ * * * * @return record: Композитный тип (pl/sql table pl/sql table number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_describe_cols(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.describe_cols еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This function returns the value of the specified CGI environment variable.
+ * @details This function returns the value of the specified CGI environment variable.
+ * * Parameters:
+ * * @param PARAM_NAME (in) VARCHAR2: The name of the CGI environment variable. It is case-insensitive.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+/*
+Datum owa_util_get_cgi_env(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.get_cgi_env еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+*/
+
+/**
+ * @brief This function returns the full virtual path of the PL/SQL Gateway that is handling the request.
+ * @details This function returns the full virtual path of the PL/SQL Gateway that is handling the request.
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_get_owa_service_path(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.get_owa_service_path еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This function returns the name of the procedure that is being invoked by the PL/SQL Gateway.
+ * @details This function returns the name of the procedure that is being invoked by the PL/SQL Gateway.
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_get_procedure(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.get_procedure еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_get_version(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.get_version еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param TF (in) BOOLEAN: TODO: Описание параметра TF
+ * * @param YES (in) VARCHAR2: TODO: Описание параметра YES
+ * * @param NO (in) VARCHAR2: TODO: Описание параметра NO
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_ite(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.ite еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates an HTML selection list form element from the output of a SQL query.
+ * @details This procedure generates an HTML selection list form element from the output of a SQL query.
+
+The first column specifies the values that are sent back. These values are for theVALUEattribute of theOPTIONtag.
+The second column specifies the values that the user sees.
+The third column specifies whether or not the row is marked asSELECTEDin theOPTIONtag. If the value is notNULL, the row is selected.
+ * * Parameters:
+ * * @param P_THECURSOR (in) NUMBER: The cursor ID. This can be the return value from theBIND_VARIABLES Function.
+ * * @param P_CNAME (in) VARCHAR2: The name of the HTML form element.
+ * * @param P_NSIZE (in) NUMBER: The size of the form element (this controls how many items the user can see without scrolling).
+ * * @param P_MULTIPLE (in) BOOLEAN: Whether multiple selection is permitted.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_listprint_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.listprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure generates an HTML selection list form element from the output of a SQL query.
+ * @details This procedure generates an HTML selection list form element from the output of a SQL query.
+
+The first column specifies the values that are sent back. These values are for theVALUEattribute of theOPTIONtag.
+The second column specifies the values that the user sees.
+The third column specifies whether or not the row is marked asSELECTEDin theOPTIONtag. If the value is notNULL, the row is selected.
+ * * Parameters:
+ * * @param P_THEQUERY (in) VARCHAR2: The SQL query.
+ * * @param P_CNAME (in) VARCHAR2: The name of the HTML form element.
+ * * @param P_NSIZE (in) NUMBER: The size of the form element (this controls how many items the user can see without scrolling).
+ * * @param P_MULTIPLE (in) BOOLEAN: Whether multiple selection is permitted.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_listprint_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.listprint еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure changes the default MIME header that the script returns. This procedure must come before anyHTP.PRINT or HTP.PRNcalls to direct the script not to use the default MIME header.
+ * @details This procedure changes the default MIME header that the script returns. This procedure must come before anyHTP.PRINT or HTP.PRNcalls to direct the script not to use the default MIME header.
+ * * Parameters:
+ * * @param CCONTENT_TYPE (in) VARCHAR2: The MIME type to generate
+ * * @param BCLOSE_HEADER (in) BOOLEAN: Whether or not to close the HTTP header. IfTRUE, two newlines are sent, which closes the HTTP header. Otherwise, one newline is sent, and the HTTP header remains open.
+ * * @param CCHARSET (in) VARCHAR2: The character set to use.The character set only makes sense if the MIME type is of type 'text'. Therefore, the character set is only tagged on to the Content-Type header only if the MIME type passed in is of type 'text'. Any other MIME type, such as 'image', will not have any character set tagged on.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_mime_header(PG_FUNCTION_ARGS)
+{
+ text *ccontent_type_txt = PG_GETARG_TEXT_P(0);
+ char *ccontent_type = text_to_cstring(ccontent_type_txt);
+ bool bclose_header = PG_GETARG_BOOL(1);
+
+ char *ccharset = nullptr;
+ if (!PG_ARGISNULL(2))
+ {
+ text *ccharset_txt = PG_GETARG_TEXT_P(2);
+ ccharset = text_to_cstring(ccharset_txt);
+
+ char *terminate = strchr(ccharset, '\n');
+ if (terminate != nullptr)
+ {
+ *terminate = '\0';
+ }
+ terminate = strchr(ccharset, '\r');
+ if (terminate != nullptr)
+ {
+ *terminate = '\0';
+ }
+ }
+
+ char *terminate = strchr(ccontent_type, '\n');
+ if (terminate != nullptr)
+ {
+ *terminate = '\0';
+ }
+ terminate = strchr(ccontent_type, '\r');
+ if (terminate != nullptr)
+ {
+ *terminate = '\0';
+ }
+
+ std::string header;
+ header.append("Content-Type: ");
+ header.append(ccontent_type);
+
+ if (ccharset != nullptr)
+ {
+ header.append("; charset=");
+ header.append(ccharset);
+ }
+ header.append("\n");
+
+ text *header_txt = cstring_to_text(header.c_str());
+ DirectFunctionCall1(htp_prn_ovr1, PointerGetDatum(header_txt));
+
+ if (bclose_header)
+ {
+ LOCAL_FCINFO(fcinfo2, 0);
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 0, InvalidOid, nullptr, nullptr);
+ owa_util_http_header_close(fcinfo2);
+ }
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: TODO: Описание параметра CNAME
+ * * * @param O_PROCOWNER (out) VARCHAR2: TODO: Описание параметра O_PROCOWNER (Возвращается через результат)
+ * * @param O_PROCNAME (out) VARCHAR2: TODO: Описание параметра O_PROCNAME (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2 varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_name_resolve(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.name_resolve еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_path_to_me(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.path_to_me еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure specifies that the application server is to visit the specified URL. The URL may specify either a Web page to return or a program to execute.
+ * @details This procedure specifies that the application server is to visit the specified URL. The URL may specify either a Web page to return or a program to execute.
+ * * Parameters:
+ * * @param CURL (in) VARCHAR2: The URL to visit.
+ * * @param BCLOSE_HEADER (in) BOOLEAN: Whether or not to close the HTTP header. IfTRUE, two newlines are sent, which closes the HTTP header. Otherwise, one newline is sent, and the HTTP header remains open.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_redirect_url(PG_FUNCTION_ARGS)
+{
+ text *location_txt = PG_GETARG_TEXT_P(0);
+ bool bclose_header = PG_GETARG_BOOL(1);
+
+ char *location = text_to_cstring(location_txt);
+
+ char *terminate = strchr(location, '\n');
+ if (terminate != nullptr)
+ {
+ *terminate = '\0';
+ }
+ terminate = strchr(location, '\r');
+ if (terminate != nullptr)
+ {
+ *terminate = '\0';
+ }
+
+ std::string result;
+
+ result.append("Location: ");
+ result.append(location);
+ result.append("\n");
+
+ pfree(location);
+
+ text *result_txt = cstring_to_text(result.c_str());
+
+ DirectFunctionCall1(htp_print_ovr1, PointerGetDatum(result_txt));
+
+ if (bclose_header)
+ {
+ LOCAL_FCINFO(fcinfo2, 0);
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 0, InvalidOid, nullptr, nullptr);
+ owa_util_http_header_close(fcinfo2);
+ }
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param COBJECT (in) VARCHAR2: TODO: Описание параметра COBJECT
+ * * @param CSCHEMA (in) VARCHAR2: TODO: Описание параметра CSCHEMA
+ * * * @param RESOLVED_NAME (out) VARCHAR2: TODO: Описание параметра RESOLVED_NAME (Возвращается через результат)
+ * * @param RESOLVED_OWNER (out) VARCHAR2: TODO: Описание параметра RESOLVED_OWNER (Возвращается через результат)
+ * * @param RESOLVED_DB_LINK (out) VARCHAR2: TODO: Описание параметра RESOLVED_DB_LINK (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2 varchar2 varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_resolve_table(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.resolve_table еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This procedure prints the source of the specified procedure, function, or package. If a procedure or function which belongs to a package is specified, then the entire package is displayed.
+ * @details This procedure prints the source of the specified procedure, function, or package. If a procedure or function which belongs to a package is specified, then the entire package is displayed.
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: The function or procedure whose source you want to show.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_showsource(PG_FUNCTION_ARGS)
+{
+ char *cname = text_to_cstring(PG_GETARG_TEXT_P(0));
+
+ char *proc_name, *owner_name;
+
+ char *dot_loc = strchr(cname, '.');
+ if (dot_loc != nullptr)
+ {
+ *dot_loc = '\0';
+ owner_name = cname;
+ proc_name = dot_loc + 1;
+ }
+ else
+ {
+ // TODO
+ }
+
+ int res = SPI_connect();
+
+ std::string query = "SELECT line, text FROM \"SYS\".\"ALL_SOURCE\" WHERE \"NAME\" = upper(";
+ query.append(proc_name);
+ query.append(") AND \"OWNER\" = upper(");
+ query.append(owner_name);
+ query.append(" ORDER BY \"TYPE\", \"LINE\"");
+
+ res = SPI_execute(query.c_str(), true, 0);
+
+ if (res < 0)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("SPI execute failed")));
+ }
+
+ {
+ std::string header = "Source code for ";
+ header.append(cname);
+ text *header_txt = cstring_to_text(header.c_str());
+ Datum header_lvl = DirectFunctionCall1(int4_numeric, Int32GetDatum(1));
+ DirectFunctionCall6(htp_header, header_lvl,
+ PointerGetDatum(header_txt),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+ pfree(header_txt);
+ }
+
+ DirectFunctionCall3(htp_preopen, static_cast<Datum>(0),
+ static_cast<Datum>(0), static_cast<Datum>(0));
+
+ int line1s = 1;
+
+ for (size_t i = 0; i < SPI_tuptable->numvals; i++)
+ {
+ bool isnull;
+ Datum line_datum = GetAttributeByNum(SPI_tuptable->vals[i]->t_data, 0, &isnull);
+ int32_t line = DatumGetInt32(DirectFunctionCall1(numeric_int4, line_datum));
+ if (line == 1)
+ {
+ line1s++;
+ if (line1s == 2)
+ {
+ DirectFunctionCall1(htp_print_ovr1, static_cast<Datum>(0));
+ }
+ }
+
+ Datum text_datum = GetAttributeByNum(SPI_tuptable->vals[i]->t_data, 1, &isnull);
+ char *txt = text_to_cstring(DatumGetTextP(text_datum));
+ for (char *symbol = txt; *symbol != '\0'; symbol++)
+ {
+ if (*symbol == '\n')
+ {
+ *symbol = ' ';
+ }
+ }
+ text *out_line = cstring_to_text(txt);
+ DirectFunctionCall1(htp_print_ovr1, PointerGetDatum(out_line));
+ pfree(out_line);
+ }
+
+ DirectFunctionCall3(htp_preclose, static_cast<Datum>(0),
+ static_cast<Datum>(0), static_cast<Datum>(0));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CTABLE (in) VARCHAR2: TODO: Описание параметра CTABLE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_show_query_columns(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.show_query_columns еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_signature_ovr1(PG_FUNCTION_ARGS)
+{
+ std::time_t timestamp = std::time(nullptr);
+ std::tm *local_tm = std::localtime(×tamp);
+
+ std::ostringstream stream;
+ stream << "This page was produced by the ";
+ stream << "<b>PL/SQL Web Toolkit</b> on";
+ stream << std::put_time(local_tm, "%B %e, %Y %H:%M");
+ stream << ".\n";
+
+ text *result = cstring_to_text(stream.str().c_str());
+ DirectFunctionCall1(htp_p_ovr1, PointerGetDatum(result));
+ pfree(result);
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CNAME (in) VARCHAR2: TODO: Описание параметра CNAME
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_signature_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.signature еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure sends a standard HTTP status code to the client.
+ * @details This procedure sends a standard HTTP status code to the client.
+ * * Parameters:
+ * * @param NSTATUS (in) NUMBER: The status code.
+ * * @param CREASON (in) VARCHAR2: The string for the status code.
+ * * @param BCLOSE_HEADER (in) BOOLEAN: Whether or not to close the HTTP header. IfTRUE, two newlines are sent, which closes the HTTP header. Otherwise, one newline is sent, and the HTTP header remains open.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_status_line(PG_FUNCTION_ARGS)
+{
+ Datum nstatus_num = PG_GETARG_DATUM(0);
+ int32_t nstatus = DatumGetInt32(DirectFunctionCall1(numeric_int4, nstatus_num));
+
+ char *creason;
+ if (!PG_ARGISNULL(1))
+ {
+ text *creason_txt = PG_GETARG_TEXT_P(1);
+ creason = text_to_cstring(creason_txt);
+ }
+ else
+ {
+ creason = pstrdup("");
+ }
+
+ bool bclose_header = PG_GETARG_BOOL(2);
+
+ std::string result = "Status: ";
+ result.append(std::to_string(nstatus));
+ result.append(" ");
+ result.append(creason);
+ result.push_back('\n');
+
+ text *result_txt = cstring_to_text(result.c_str());
+ DirectFunctionCall1(htp_prn_ovr1, PointerGetDatum(result_txt));
+ pfree(result_txt);
+
+ if (bclose_header)
+ {
+ LOCAL_FCINFO(fcinfo2, 0);
+ InitFunctionCallInfoData(*fcinfo2, nullptr, 0, InvalidOid, nullptr, nullptr);
+ owa_util_http_header_close(fcinfo2);
+ }
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CCAPTION (in) VARCHAR2: TODO: Описание параметра CCAPTION
+ * * @param CALIGN (in) VARCHAR2: TODO: Описание параметра CALIGN
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tablecaption(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tablecaption еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableclose_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableclose еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param NTABLE_WIDTH (in) NUMBER: TODO: Описание параметра NTABLE_WIDTH
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableclose_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableclose еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CDATA (in) VARCHAR2: TODO: Описание параметра CDATA
+ * * @param NCOLUMN_SIZE (in) NUMBER: TODO: Описание параметра NCOLUMN_SIZE
+ * * @param CALIGN (in) VARCHAR2: TODO: Описание параметра CALIGN
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tabledata(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tabledata еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CCOLUMN_NAME (in) VARCHAR2: TODO: Описание параметра CCOLUMN_NAME
+ * * @param NCOLUMN_SIZE (in) NUMBER: TODO: Описание параметра NCOLUMN_SIZE
+ * * @param CALIGN (in) VARCHAR2: TODO: Описание параметра CALIGN
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableheader_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableheader еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CCOLUMN_NAME (in) VARCHAR2: TODO: Описание параметра CCOLUMN_NAME
+ * * @param NCOLUMN_SIZE (in) NUMBER: TODO: Описание параметра NCOLUMN_SIZE
+ * * @param CALIGN (in) VARCHAR2: TODO: Описание параметра CALIGN
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_WIDTH (in/out) NUMBER: TODO: Описание параметра NTABLE_WIDTH
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * @param NTABLE_WIDTH (in/out) NUMBER: TODO: Описание параметра NTABLE_WIDTH (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2 number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableheader_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableheader еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableheaderrowclose_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableheaderrowclose еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_WIDTH (in) NUMBER: TODO: Описание параметра NTABLE_WIDTH
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableheaderrowclose_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableheaderrowclose еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableheaderrowopen_ovr1(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableheaderrowopen еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * @param NTABLE_WIDTH (out) NUMBER: TODO: Описание параметра NTABLE_WIDTH (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2 number), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableheaderrowopen_ovr2(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableheaderrowopen еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CALIGN (in) VARCHAR2: TODO: Описание параметра CALIGN
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NNUM_COLS (in) NUMBER: TODO: Описание параметра NNUM_COLS
+ * * @param NTABLE_WIDTH (in) NUMBER: TODO: Описание параметра NTABLE_WIDTH
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tablenodata(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tablenodata еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CATTRIBUTES (in) VARCHAR2: TODO: Описание параметра CATTRIBUTES
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tableopen еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This function generates either preformatted tables or HTML tables (depending on the capabilities of the user's browser) from database tables.
+ * @details This function generates either preformatted tables or HTML tables (depending on the capabilities of the user's browser) from database tables.
+ * * Parameters:
+ * * @param CTABLE (in) VARCHAR2: The database table.
+ * * @param CATTRIBUTES (in) VARCHAR2: Other attributes to be included as-is in the tag.
+ * * @param NTABLE_TYPE (in) NUMBER: How to generate the table. SpecifyHTML_TABLEto generate the table using<TABLE>tags or PRE_TABLEto generate the table using the<PRE>tags. These are constants:HTML_TABLECONSTANT INTEGER:= 1;PRE_TABLECONSTANT INTEGER:= 2;
+ * * @param CCOLUMNS (in) VARCHAR2: A comma-delimited list of columns fromctableto include in the generated table.
+ * * @param CCLAUSES (in) VARCHAR2: WHEREor ORDERBYclauses, which specify which rows to retrieve from the database table, and how to order them.
+ * * @param CCOL_ALIASES (in) VARCHAR2: A comma-delimited list of headings for the generated table.
+ * * @param NROW_MIN (in) NUMBER: The first row, of those retrieved, to display.
+ * * @param NROW_MAX (in) NUMBER: The last row, of those retrieved, to display.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tableprint(PG_FUNCTION_ARGS)
+{
+ char *ctable = text_to_cstring(PG_GETARG_TEXT_P(0));
+
+ Datum cattributes_datum = PG_ARGISNULL(1) ? static_cast<Datum>(0) : PG_GETARG_DATUM(1);
+
+ int32_t table_type = DatumGetInt32(DirectFunctionCall1(numeric_int4, PG_GETARG_DATUM(2)));
+
+ char *ccolumns = text_to_cstring(PG_GETARG_TEXT_P(3));
+
+ char *cclauses;
+ if (!PG_ARGISNULL(4))
+ {
+ cclauses = text_to_cstring(PG_GETARG_TEXT_P(4));
+ }
+ else
+ {
+ cclauses = pstrdup("");
+ }
+
+ std::vector<std::string> headings;
+ if (!PG_ARGISNULL(5))
+ {
+ char *ccol_aliases = text_to_cstring(PG_GETARG_TEXT_P(5));
+ char *alias = strtok(ccol_aliases, ",");
+ while (alias != nullptr)
+ {
+ headings.push_back(alias);
+ alias = strtok(nullptr, ",");
+ }
+ pfree(ccol_aliases);
+ }
+
+ int32_t nrow_min = DatumGetInt32(DirectFunctionCall1(numeric_int4, PG_GETARG_DATUM(6)));
+ int32_t nrow_max;
+ if (!PG_ARGISNULL(6))
+ {
+ nrow_max = DatumGetInt32(DirectFunctionCall1(numeric_int4, PG_GETARG_DATUM(7)));
+ }
+ else
+ {
+ nrow_max = std::numeric_limits<int32_t>::max();
+ }
+
+ SPI_connect();
+
+ std::string query = "SELECT ";
+ query.append(ccolumns);
+ query.append(" FROM ");
+ query.append(ctable);
+ query.append(" ");
+ query.append(cclauses);
+ query.append(";");
+
+ pfree(ccolumns);
+ pfree(ctable);
+ pfree(cclauses);
+
+ int query_res = SPI_execute(query.c_str(), true, 0);
+
+ if (query_res < 0)
+ {
+ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Query failed: %d", query_res)));
+ SPI_finish();
+ PG_RETURN_NULL();
+ }
+
+ if (headings.empty())
+ {
+ for (int i = 0; i < SPI_tuptable->tupdesc->natts; i++)
+ {
+ headings.push_back(TupleDescAttr(SPI_tuptable->tupdesc, i)->attname.data);
+ }
+ }
+ else if (headings.size() != static_cast<size_t>(SPI_tuptable->tupdesc->natts))
+ {
+ ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Invalid number of aliases!")));
+ }
+
+ std::vector<Oid> out_functions(headings.size());
+ for (size_t i = 0; i < headings.size(); i++)
+ {
+ Oid target_type = TupleDescAttr(SPI_tuptable->tupdesc, i)->atttypid;
+ Oid out_func;
+ bool output_is_varlena;
+ getTypeOutputInfo(target_type, &out_func, &output_is_varlena);
+ out_functions.push_back(out_func);
+ }
+
+ std::vector<size_t> column_widths(headings.size());
+ if (table_type == OWA_UTIL_PRE_TABLE)
+ {
+ for (size_t i = 0; i < headings.size(); i++)
+ {
+ column_widths[i] = headings[i].size();
+ }
+ }
+
+ std::vector<std::vector<std::string>> entries(SPI_tuptable->numvals);
+
+ for (size_t i = 0; i < SPI_tuptable->numvals; i++)
+ {
+ for (size_t j = 0; j < headings.size(); i++)
+ {
+ bool isnull;
+ Datum value = GetAttributeByNum(SPI_tuptable->vals[i]->t_data, j, &isnull);
+ if (!isnull)
+ {
+ char *out_value = OidOutputFunctionCall(out_functions[j], value);
+ if (table_type == OWA_UTIL_PRE_TABLE)
+ {
+ column_widths[i] = Max(column_widths[i], strlen(out_value));
+ }
+ entries[i].push_back(out_value);
+ pfree(out_value);
+ }
+ else
+ {
+ entries[i].push_back("");
+ }
+ }
+ }
+
+ bool too_many_rows = SPI_tuptable->numvals > static_cast<uint64_t>(nrow_max - nrow_min + 1);
+
+ char table_border;
+ // print table
+ // start
+ if (table_type == OWA_UTIL_HTML_TABLE)
+ {
+ DirectFunctionCall5(htp_tableopen,
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ cattributes_datum);
+
+ DirectFunctionCall5(htp_tablerowopen,
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+
+ for (auto &heading: headings)
+ {
+ text *heading_txt = cstring_to_text(heading.c_str());
+ DirectFunctionCall6(htp_tabledata,
+ PointerGetDatum(heading_txt),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+ pfree(heading_txt);
+ }
+
+ DirectFunctionCall5(htp_tablerowclose,
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+
+ for (auto &row: entries)
+ {
+ DirectFunctionCall5(htp_tablerowopen,
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+
+ for (auto &cell: row)
+ {
+ text *cell_txt = cstring_to_text(cell.c_str());
+ DirectFunctionCall6(htp_tabledata,
+ PointerGetDatum(cell_txt),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+ pfree(cell_txt);
+ }
+
+ DirectFunctionCall5(htp_tablerowclose,
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0),
+ static_cast<Datum>(0));
+ }
+ }
+ else // table_type == OWA_UTIL_PRE_TABLE
+ {
+ table_border = PG_ARGISNULL(1)? ' ' : '|';
+ std::ostringstream stream;
+ std::string line;
+
+ size_t line_width = std::accumulate(column_widths.begin(),
+ column_widths.end(),
+ static_cast<size_t>(0));
+
+ // For each column we add two spaces and one table_border characters
+ // also we add additional table border character for table line begin
+ line_width += 3 * headings.size() + 1;
+ line.resize(line_width, '-');
+
+ stream << "<pre>\n" << line << "\n" << table_border;
+ for (size_t i = 0; i < headings.size(); i++)
+ {
+ stream << ' ' << std::setw(column_widths[i] + 1) << headings[i]
+ << std::setw(0) << table_border;
+ }
+ stream << "\n";
+
+ for (auto &row: entries)
+ {
+ stream << table_border;
+ for (size_t i = 0; i < row.size(); i++)
+ {
+ stream << ' ' << std::setw(column_widths[i] + 1) << headings[i]
+ << std::setw(0) << table_border;
+ }
+ stream << "\n";
+ }
+
+ stream << "</pre>";
+
+ text *result = cstring_to_text(stream.str().c_str());
+
+ DirectFunctionCall1(htp_print_ovr1, PointerGetDatum(result));
+ pfree(result);
+ }
+
+ SPI_finish();
+ PG_RETURN_BOOL(too_many_rows);
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tablerowclose(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tablerowclose еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING
+ * * @param NTABLE_TYPE (in) NUMBER: TODO: Описание параметра NTABLE_TYPE
+ * * * @param CROWSTRING (in/out) VARCHAR2: TODO: Описание параметра CROWSTRING (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_tablerowopen(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.tablerowopen еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+/**
+ * @brief This function converts the DATETYPE Datatype to the standard OracleDATEtype.
+ * @details This function converts the DATETYPE Datatype to the standard OracleDATEtype.
+ * * Parameters:
+ * * @param P_DATEARRAY (in) PL/SQL TABLE: The value to convert.
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_todate(PG_FUNCTION_ARGS)
+{
+ ArrayType *arr = PG_GETARG_ARRAYTYPE_P(0);
+
+ Datum *elems;
+ bool *nulls;
+ int len;
+
+ deconstruct_array(arr, VARCHAR2OID, -1, false, TYPALIGN_INT,
+ &elems, &nulls, &len);
+
+ Assert(len == 3);
+
+ text *dd_txt = DatumGetTextP(elems[0]);
+ text *mm_txt = DatumGetTextP(elems[1]);
+ text *yyyy_txt = DatumGetTextP(elems[2]);
+
+ char dd[3];
+ char mm[3];
+ char yyyy[5];
+ char date[11];
+
+ text_to_cstring_buffer(dd_txt, dd, 2);
+ text_to_cstring_buffer(mm_txt, mm, 2);
+ text_to_cstring_buffer(yyyy_txt, yyyy, 4);
+
+ sprintf(date, "%s-%s-%s", dd, mm, yyyy);
+
+ text *date_txt = cstring_to_text(date);
+
+ pfree(elems);
+ pfree(nulls);
+
+ PG_RETURN_DATUM(DirectFunctionCall1(date_in, PointerGetDatum(date_txt)));
+}
+
+/**
+ * @brief TODO: Добавить описание
+ * @details TODO: Добавить детальное описание
+ * * Parameters:
+ * * @param PARAM (in) VARCHAR2: TODO: Описание параметра PARAM
+ * * * * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_validate_arg(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.validate_arg еще не реализована.")));
+
+ PG_RETURN_VOID();
+}
+
+/**
+ * @brief This procedure returns information (in the form of output parameters) about the PL/SQL code unit that invoked it.
+ * @details This procedure returns information (in the form of output parameters) about the PL/SQL code unit that invoked it.
+ * * Parameters:
+ * * * @param OWNER (out) VARCHAR2: The owner of the program unit. (Возвращается через результат)
+ * * @param NAME (out) VARCHAR2: The name of the program unit. This is the name of the package, if the calling program unit is wrapped in a package, or the name of the procedure or function if the calling program unit is a standalone procedure or function. If the calling program unit is part of an anonymous block, this isNULL. (Возвращается через результат)
+ * * @param LINENO (out) NUMBER: The line number within the program unit where the call was made. (Возвращается через результат)
+ * * @param CALLER_T (out) VARCHAR2: The type of program unit that made the call. The possibilities are: package body, anonymous block, procedure, and function. Procedure and function are only for standalone procedures and functions. (Возвращается через результат)
+ * * * * @return record: Композитный тип (varchar2 varchar2 number varchar2), содержащий OUT/INOUT параметры.
+ * *
+ * @see https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/OWA_UTIL.html
+ */
+Datum owa_util_who_called_me(PG_FUNCTION_ARGS)
+{
+ ereport(NOTICE, (errmsg("Функция owa_util.who_called_me еще не реализована.")));
+
+ PG_RETURN_NULL();
+}
+
+Datum owa_util_http_header_close(PG_FUNCTION_ARGS)
+{
+ text *nl = cstring_to_text("\n");
+ DirectFunctionCall1(htp_prn_ovr1, PointerGetDatum(nl));
+ PG_RETURN_VOID();
+}
+
+} // extern "C"
diff --git a/src/backend/utils/dbms/owa_util/owa_util.hpp b/src/backend/utils/dbms/owa_util/owa_util.hpp
new file mode 100644
index 0000000..002dbcc
--- /dev/null
+++ b/src/backend/utils/dbms/owa_util/owa_util.hpp
@@ -0,0 +1,79 @@
+#ifndef OWA_UTIL_INTERNAL_HPP
+#define OWA_UTIL_INTERNAL_HPP
+
+extern "C"
+{
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+} // extern "C"
+
+extern "C"
+{
+Datum owa_util_bind_variables(PG_FUNCTION_ARGS);
+Datum owa_util_calendarprint_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_calendarprint_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr3(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr4(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr5(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr6(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr7(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr8(PG_FUNCTION_ARGS);
+Datum owa_util_cellsprint_ovr9(PG_FUNCTION_ARGS);
+Datum owa_util_choose_date(PG_FUNCTION_ARGS);
+Datum owa_util_comma_to_ident_arr_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_comma_to_ident_arr_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_describe_cols(PG_FUNCTION_ARGS);
+// Datum owa_util_get_cgi_env(PG_FUNCTION_ARGS);
+Datum owa_util_get_owa_service_path(PG_FUNCTION_ARGS);
+Datum owa_util_get_procedure(PG_FUNCTION_ARGS);
+Datum owa_util_get_version(PG_FUNCTION_ARGS);
+Datum owa_util_ite(PG_FUNCTION_ARGS);
+Datum owa_util_listprint_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_listprint_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_mime_header(PG_FUNCTION_ARGS);
+Datum owa_util_name_resolve(PG_FUNCTION_ARGS);
+Datum owa_util_path_to_me(PG_FUNCTION_ARGS);
+Datum owa_util_redirect_url(PG_FUNCTION_ARGS);
+Datum owa_util_resolve_table(PG_FUNCTION_ARGS);
+Datum owa_util_showsource(PG_FUNCTION_ARGS);
+Datum owa_util_show_query_columns(PG_FUNCTION_ARGS);
+Datum owa_util_signature_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_signature_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_status_line(PG_FUNCTION_ARGS);
+Datum owa_util_tablecaption(PG_FUNCTION_ARGS);
+Datum owa_util_tableclose_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_tableclose_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_tabledata(PG_FUNCTION_ARGS);
+Datum owa_util_tableheader_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_tableheader_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_tableheaderrowclose_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_tableheaderrowclose_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_tableheaderrowopen_ovr1(PG_FUNCTION_ARGS);
+Datum owa_util_tableheaderrowopen_ovr2(PG_FUNCTION_ARGS);
+Datum owa_util_tablenodata(PG_FUNCTION_ARGS);
+Datum owa_util_tableopen(PG_FUNCTION_ARGS);
+Datum owa_util_tableprint(PG_FUNCTION_ARGS);
+Datum owa_util_tablerowclose(PG_FUNCTION_ARGS);
+Datum owa_util_tablerowopen(PG_FUNCTION_ARGS);
+Datum owa_util_todate(PG_FUNCTION_ARGS);
+Datum owa_util_validate_arg(PG_FUNCTION_ARGS);
+Datum owa_util_who_called_me(PG_FUNCTION_ARGS);
+Datum owa_util_http_header_close(PG_FUNCTION_ARGS);
+} // extern "C"
+
+enum {
+ OWA_UTIL_HTML_TABLE = 1,
+ OWA_UTIL_PRE_TABLE = 2,
+};
+
+#endif // OWA_UTIL_INTERNAL_HPP
+
diff --git a/src/backend/utils/dbms/package_methods_reference.ru.adoc b/src/backend/utils/dbms/package_methods_reference.ru.adoc
new file mode 100644
index 0000000..c99e30c
--- /dev/null
+++ b/src/backend/utils/dbms/package_methods_reference.ru.adoc
@@ -0,0 +1,1204 @@
+= Справочник по реализованным методам пакетов RUDB
+
+Этот файл содержит краткие описания и примеры использования новых методов пакетов `OWA`, `OWA_COOKIE`, `OWA_CACHE`, `OWA_UTIL`, `DBMS_JSON`, `DBMS_JSON_SCHEMA`, `DBMS_XMLSTORE` и `DBMS_XMLSAVE`.
+
+В раздел `DBMS_JSON` включены только актуальные методы. Удалённые методы `BUILD_DATAGUIDE`, `GET_INDEX_DATAGUIDE`, `ADD_VIRTUAL_COLUMNS`, `DROP_VIRTUAL_COLUMNS` и `JSON_TYPE_CONVERTIBLE_CHECK` намеренно исключены.
+
+== OWA
+
+=== OWA.INIT_CGI_ENV
+
+Функция инициализирует CGI-контекст запроса для последующей работы пакетов `OWA_CACHE`, `OWA_COOKIE` и `OWA_UTIL`.
+
+_Входящие параметры:_
+
+* `num_cgi_vars (INTEGER)` - количество CGI-параметров.
+* `param_name (TEXT[])` - массив имён CGI-параметров.
+* `param_val (TEXT[])` - массив значений CGI-параметров.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Подготовка тестового CGI-окружения перед вызовом `OWA_COOKIE.SEND`.
+* Эмуляция HTTP-заголовков перед проверкой поведения `OWA_CACHE`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY['REQUEST_PROTOCOL', 'HTTP_IF_NONE_MATCH'];
+ v_values := ARRAY['HTTP/1.1', 'etag-1'];
+
+ PERFORM owa_init_cgi_env(2, v_names, v_values);
+
+ RAISE NOTICE 'OWA.INIT_CGI_ENV: УСПЕШНО';
+END;
+$$;
+
+=== OWA.INIT_CGI_ENV2
+
+Функция инициализирует CGI-контекст запроса в расширенной форме вызова.
+
+_Входящие параметры:_
+
+* `num_cgi_vars (INTEGER)` - количество CGI-параметров.
+* `param_name (TEXT[])` - массив имён CGI-параметров.
+* `param_val (TEXT[])` - массив значений CGI-параметров.
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Подготовка CGI-окружения в сценариях, где требуется расширенная сигнатура.
+* Сохранение совместимости с вызовами, передающими выбранный режим.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY['REQUEST_PROTOCOL'];
+ v_values := ARRAY['HTTP/1.1'];
+
+ PERFORM owa_init_cgi_env2(1, v_names, v_values, 0);
+
+ RAISE NOTICE 'OWA.INIT_CGI_ENV2: УСПЕШНО';
+END;
+$$;
+
+== OWA_COOKIE
+
+=== OWA_COOKIE.SEND
+
+Функция добавляет cookie в заголовки ответа текущего OWA-контекста.
+
+_Входящие параметры:_
+
+* `name (VARCHAR2)` - имя cookie.
+* `value (VARCHAR2)` - значение cookie.
+* `expires (TIMESTAMPTZ)` - дата истечения cookie.
+* `path (VARCHAR2)` - путь действия cookie.
+* `domain (VARCHAR2)` - домен cookie.
+* `secure (VARCHAR2)` - признак secure-cookie.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Установка cookie сессии перед выводом страницы.
+* Формирование `Set-Cookie` с дополнительными атрибутами `expires`, `path` и `domain`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cookie_send(
+ name => 'session_id',
+ value => 'abc123',
+ path => '/app',
+ domain => 'example.com',
+ secure => 'TRUE'
+ );
+ PERFORM owa_util_showpage();
+
+ RAISE NOTICE 'OWA_COOKIE.SEND: УСПЕШНО';
+END;
+$$;
+
+=== OWA_COOKIE.SEND2
+
+Функция добавляет cookie в заголовки ответа через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `name (VARCHAR2)` - имя cookie.
+* `value (VARCHAR2)` - значение cookie.
+* `expires (TIMESTAMPTZ)` - дата истечения cookie.
+* `path (VARCHAR2)` - путь действия cookie.
+* `domain (VARCHAR2)` - домен cookie.
+* `secure (VARCHAR2)` - признак secure-cookie.
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Формирование cookie в вариантах вызова с расширенной сигнатурой.
+* Проверка совместимости параметров cookie с выбранным режимом.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+BEGIN
+ PERFORM owa_init_cgi_env(0, ARRAY[]::TEXT[], ARRAY[]::TEXT[]);
+ PERFORM owa_cookie_send2(
+ 'session_id',
+ 'abc123',
+ NULL,
+ '/app',
+ 'example.com',
+ 'TRUE',
+ 0
+ );
+
+ RAISE NOTICE 'OWA_COOKIE.SEND2: УСПЕШНО';
+END;
+$$;
+
+== OWA_CACHE
+
+=== OWA_CACHE.SET_CACHE
+
+Функция сохраняет ETag и уровень кеширования в текущем OWA-контексте.
+
+_Входящие параметры:_
+
+* `p_etag (VARCHAR2)` - значение ETag.
+* `p_level (VARCHAR2)` - уровень кеширования, например `USER` или `SYSTEM`.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Подготовка заголовков валидации ответа.
+* Настройка кеширования HTML-страницы перед `OWA_UTIL.SHOWPAGE`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_cache('etag-101', 'USER');
+ PERFORM owa_util_showpage();
+
+ RAISE NOTICE 'OWA_CACHE.SET_CACHE: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.SET_EXPIRES
+
+Функция задаёт заголовки кеширования по времени жизни ответа.
+
+_Входящие параметры:_
+
+* `p_expires (NUMBER)` - срок жизни кеша в минутах.
+* `p_level (VARCHAR2)` - уровень кеширования.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Назначение TTL для ответов, которые можно хранить ограниченное время.
+* Настройка пользовательского или системного уровня кеширования.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_expires(60, 'USER');
+
+ RAISE NOTICE 'OWA_CACHE.SET_EXPIRES: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.SET_NOT_MODIFIED
+
+Функция переводит ответ в состояние `304 Not Modified`, если входные параметры запроса совпадают с текущими данными кеша.
+
+_Входящие параметры:_
+
+* У метода нет входящих параметров.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Возврат условного ответа без тела при совпадении ETag.
+* Обработка запроса с заголовком `If-None-Match`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY['HTTP_IF_NONE_MATCH', 'REQUEST_PROTOCOL'];
+ v_values := ARRAY['etag-101', 'HTTP/1.1'];
+
+ PERFORM owa_init_cgi_env(2, v_names, v_values);
+ PERFORM owa_cache_set_cache('etag-101', 'USER');
+ PERFORM owa_cache_set_not_modified();
+
+ RAISE NOTICE 'OWA_CACHE.SET_NOT_MODIFIED: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.SET_REQUEST_ETAG
+
+Функция принудительно задаёт входной ETag запроса в текущем OWA-контексте.
+
+_Входящие параметры:_
+
+* `p_etag (VARCHAR2)` - входной ETag запроса.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Подмена `If-None-Match` в тестовом контуре.
+* Подготовка сценариев сравнения с `OWA_CACHE.SET_CACHE`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_request_etag('etag-202');
+
+ RAISE NOTICE 'ETag=%', owa_cache_get_etag();
+ RAISE NOTICE 'OWA_CACHE.SET_REQUEST_ETAG: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.SET_REQUEST_LEVEL
+
+Функция принудительно задаёт уровень кеширования входного запроса.
+
+_Входящие параметры:_
+
+* `p_level (VARCHAR2)` - уровень кеширования запроса.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Эмуляция входного `OWA_CACHE_LEVEL`.
+* Подготовка сценариев проверки `OWA_CACHE.GET_LEVEL`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_request_level('SYSTEM');
+
+ RAISE NOTICE 'Level=%', owa_cache_get_level();
+ RAISE NOTICE 'OWA_CACHE.SET_REQUEST_LEVEL: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.GET_ETAG
+
+Функция возвращает текущий входной ETag из OWA-контекста.
+
+_Входящие параметры:_
+
+* У метода нет входящих параметров.
+
+_Выходные параметры:_
+
+* Возвращает `VARCHAR2` со значением ETag.
+
+_Типичные сценарии использования:_
+
+* Проверка того, какой ETag был передан в CGI-контекст.
+* Использование в диагностических и тестовых сценариях.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+ v_etag VARCHAR2;
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_request_etag('etag-303');
+ v_etag := owa_cache_get_etag();
+
+ RAISE NOTICE 'Прочитано: etag="%"', v_etag;
+ RAISE NOTICE 'OWA_CACHE.GET_ETAG: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.GET_ETAG2
+
+Функция возвращает текущий входной ETag из OWA-контекста через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Возвращает `VARCHAR2` со значением ETag.
+
+_Типичные сценарии использования:_
+
+* Чтение ETag в сценариях, где используется расширенная сигнатура.
+* Проверка заполнения CGI-контекста без изменения основного потока обработки.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+ v_etag VARCHAR2;
+BEGIN
+ v_names := ARRAY['HTTP_IF_NONE_MATCH'];
+ v_values := ARRAY['etag-303'];
+
+ PERFORM owa_init_cgi_env(1, v_names, v_values);
+ v_etag := owa_cache_get_etag2(0);
+
+ RAISE NOTICE 'Прочитано: etag="%"', v_etag;
+ RAISE NOTICE 'OWA_CACHE.GET_ETAG2: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.GET_LEVEL
+
+Функция возвращает текущий уровень кеширования из OWA-контекста.
+
+_Входящие параметры:_
+
+* У метода нет входящих параметров.
+
+_Выходные параметры:_
+
+* Возвращает `VARCHAR2` со значением уровня кеширования.
+
+_Типичные сценарии использования:_
+
+* Проверка уровня, установленного через CGI-параметры или `SET_REQUEST_LEVEL`.
+* Отладка логики ветвления по `USER` или `SYSTEM`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+ v_level VARCHAR2;
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_request_level('USER');
+ v_level := owa_cache_get_level();
+
+ RAISE NOTICE 'Прочитано: level="%"', v_level;
+ RAISE NOTICE 'OWA_CACHE.GET_LEVEL: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.SET_SURROGATE_CONTROL
+
+Функция задаёт заголовок `Surrogate-Control` в OWA-контексте.
+
+_Входящие параметры:_
+
+* `p_value (VARCHAR2)` - значение заголовка `Surrogate-Control`.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Управление кешированием на стороне proxy или CDN.
+* Подготовка специализированных HTTP-заголовков для промежуточных узлов.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY['REQUEST_PROTOCOL'];
+ v_values := ARRAY['HTTP/1.1'];
+
+ PERFORM owa_init_cgi_env(1, v_names, v_values);
+ PERFORM owa_cache_set_surrogate_control('content="ORA:20"');
+ PERFORM owa_util_showpage();
+
+ RAISE NOTICE 'OWA_CACHE.SET_SURROGATE_CONTROL: УСПЕШНО';
+END;
+$$;
+
+=== OWA_CACHE.DISABLE
+
+Функция отключает кеширование для текущего OWA-запроса.
+
+_Входящие параметры:_
+
+* У метода нет входящих параметров.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Принудительное отключение кеширования перед выводом динамического ответа.
+* Сброс ранее установленных параметров кеширования.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM owa_cache_set_cache('etag-disable', 'USER');
+ PERFORM owa_cache_disable();
+ PERFORM owa_util_showpage();
+
+ RAISE NOTICE 'OWA_CACHE.DISABLE: УСПЕШНО';
+END;
+$$;
+
+== OWA_UTIL
+
+=== OWA_UTIL.SHOWPAGE
+
+Функция завершает формирование OWA-ответа и выводит накопленные заголовки и тело страницы.
+
+_Входящие параметры:_
+
+* У метода нет входящих параметров.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Финальный вывод страницы после вызовов `HTP.P`, `OWA_COOKIE.SEND` и `OWA_CACHE`.
+* Сброс буфера заголовков и HTML-тела в тестовых сценариях.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM htp_p_ovr1('<html><body>Hello</body></html>');
+ PERFORM owa_util_showpage();
+
+ RAISE NOTICE 'OWA_UTIL.SHOWPAGE: УСПЕШНО';
+END;
+$$;
+
+=== OWA_UTIL.SHOWPAGE_UTILS
+
+Функция завершает формирование OWA-ответа через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Финальный вывод страницы при использовании расширенной сигнатуры.
+* Проверка накопленных заголовков и тела ответа в совместимых сценариях.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+BEGIN
+ v_names := ARRAY[]::TEXT[];
+ v_values := ARRAY[]::TEXT[];
+
+ PERFORM owa_init_cgi_env(0, v_names, v_values);
+ PERFORM htp_p_ovr1('<html><body>Hello</body></html>');
+ PERFORM owa_util_showpage_utils(0);
+
+ RAISE NOTICE 'OWA_UTIL.SHOWPAGE_UTILS: УСПЕШНО';
+END;
+$$;
+
+=== OWA_UTIL.GET_CGI_ENV
+
+Функция возвращает значение CGI-параметра из текущего OWA-контекста.
+
+_Входящие параметры:_
+
+* `param_name (VARCHAR2)` - имя CGI-переменной.
+
+_Выходные параметры:_
+
+* Возвращает `VARCHAR2` со значением найденного CGI-параметра.
+
+_Типичные сценарии использования:_
+
+* Чтение `REQUEST_PROTOCOL`, `HTTP_IF_NONE_MATCH` и других входных параметров.
+* Отладка наполнения CGI-контекста после `OWA.INIT_CGI_ENV`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_names TEXT[];
+ v_values TEXT[];
+ v_protocol VARCHAR2;
+BEGIN
+ v_names := ARRAY['REQUEST_PROTOCOL'];
+ v_values := ARRAY['HTTP/1.1'];
+
+ PERFORM owa_init_cgi_env(1, v_names, v_values);
+ v_protocol := owa_util_get_cgi_env('REQUEST_PROTOCOL');
+
+ RAISE NOTICE 'Прочитано: protocol="%"', v_protocol;
+ RAISE NOTICE 'OWA_UTIL.GET_CGI_ENV: УСПЕШНО';
+END;
+$$;
+
+== DBMS_JSON
+
+=== DBMS_JSON.GET_VIEW_SQL
+
+Функция формирует DDL-текст для `VIEW` или `MATERIALIZED VIEW` на основе переданного `data guide`.
+
+_Входящие параметры:_
+
+* `viewname (VARCHAR2)` - имя представления.
+* `tablename (VARCHAR2)` - имя исходной таблицы.
+* `jcolname (VARCHAR2)` - имя JSON-колонки.
+* `dataguide (JSONB)` - описание полей JSON.
+* `materialize (BOOLEAN)` - режим генерации materialized view.
+* `mvrefreshmode (INTEGER)` - режим refresh materialized view.
+* `path (VARCHAR2)` - корневой JSON path.
+* `resolvenameconflicts (BOOLEAN)` - разрешение конфликтов имён.
+* `colnameprefix (VARCHAR2)` - префикс имён колонок.
+* `mixedcasecolumns (BOOLEAN)` - сохранять ли регистр имён колонок.
+
+_Выходные параметры:_
+
+* Возвращает `CLOB` с текстом DDL либо `SELECT`.
+
+_Типичные сценарии использования:_
+
+* Генерация SQL без немедленного создания представления.
+* Предпросмотр структуры будущего `VIEW` или `MATERIALIZED VIEW`.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_dg JSONB;
+ v_res CLOB;
+BEGIN
+ v_dg := '[{"path":"$.id","type":"number","column":"id"}]'::jsonb;
+
+ v_res := dbms_json_get_view_sql('V_JSON_AUTO', 'T_JSON_AUTO', 'J1', v_dg);
+
+ RAISE NOTICE 'DDL: %', v_res;
+ RAISE NOTICE 'DBMS_JSON.GET_VIEW_SQL: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON.CREATE_VIEW
+
+Функция создаёт `VIEW` или `MATERIALIZED VIEW` по переданному `data guide`.
+
+_Входящие параметры:_
+
+* `viewname (VARCHAR2)` - имя представления.
+* `tablename (VARCHAR2)` - имя исходной таблицы.
+* `jcolname (VARCHAR2)` - имя JSON-колонки.
+* `dataguide (JSONB)` - описание полей JSON.
+* `resourcepath (VARCHAR2)` - служебный параметр совместимости.
+* `materialize (BOOLEAN)` - создавать materialized view.
+* `mvrefreshmode (INTEGER)` - режим refresh.
+* `path (VARCHAR2)` - корневой JSON path.
+* `resolvenameconflicts (BOOLEAN)` - разрешение конфликтов имён.
+* `colnameprefix (VARCHAR2)` - префикс имён колонок.
+* `mixedcasecolumns (BOOLEAN)` - сохранять ли регистр имён колонок.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Автоматическое создание проекционного представления по JSON-документам.
+* Быстрое построение view для выборок по JSON-полям.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_dg JSONB;
+BEGIN
+ v_dg := '[{"path":"$.id","type":"number","column":"id"}]'::jsonb;
+
+ EXECUTE 'DROP TABLE IF EXISTS t_json_auto';
+ EXECUTE 'CREATE TABLE t_json_auto (j1 jsonb)';
+ EXECUTE $$INSERT INTO t_json_auto VALUES ('{"id": 10}'::jsonb)$$;
+
+ PERFORM dbms_json_create_view('v_json_auto', 't_json_auto', 'j1', v_dg);
+
+ RAISE NOTICE 'DBMS_JSON.CREATE_VIEW: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON.CREATE_VIEW2
+
+Функция создаёт `VIEW` или `MATERIALIZED VIEW` по переданному `data guide` через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `viewname (VARCHAR2)` - имя представления.
+* `tablename (VARCHAR2)` - имя исходной таблицы.
+* `jcolname (VARCHAR2)` - имя JSON-колонки.
+* `dataguide (JSONB)` - описание полей JSON.
+* `resourcepath (VARCHAR2)` - параметр совместимости.
+* `materialize (BOOLEAN)` - создавать materialized view.
+* `mvrefreshmode (INTEGER)` - режим refresh.
+* `path (VARCHAR2)` - корневой JSON path.
+* `resolvenameconflicts (BOOLEAN)` - разрешение конфликтов имён.
+* `colnameprefix (VARCHAR2)` - префикс имён колонок.
+* `mixedcasecolumns (BOOLEAN)` - сохранять ли регистр имён колонок.
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Создание проекционного представления в вариантах вызова с расширенной сигнатурой.
+* Проверка совместимости параметров генерации view с выбранным режимом.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_dg JSONB;
+BEGIN
+ v_dg := '[{"path":"$.id","type":"number","column":"id"}]'::jsonb;
+
+ EXECUTE 'DROP TABLE IF EXISTS t_json_auto2';
+ EXECUTE 'CREATE TABLE t_json_auto2 (j1 jsonb)';
+ EXECUTE 'INSERT INTO t_json_auto2 VALUES (''{"id": 10}''::jsonb)';
+
+ PERFORM dbms_json_create_view2(
+ 'v_json_auto2', 't_json_auto2', 'j1', v_dg,
+ NULL, false, 1, '$', true, NULL, false, 0
+ );
+
+ RAISE NOTICE 'DBMS_JSON.CREATE_VIEW2: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON.RENAME_COLUMN
+
+Функция сохраняет предпочтительное имя колонки для указанного JSON path.
+
+_Входящие параметры:_
+
+* `tablename (VARCHAR2)` - имя таблицы.
+* `jcolname (VARCHAR2)` - имя JSON-колонки.
+* `path (VARCHAR2)` - JSON path до поля.
+* `type (INTEGER)` - код JSON-типа.
+* `preferred_name (VARCHAR2)` - новое имя колонки.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Подготовка читаемых имён колонок до генерации view.
+* Разрешение неоднозначных или неудобных имён JSON-полей.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+BEGIN
+ EXECUTE 'DROP TABLE IF EXISTS t_rename';
+ EXECUTE 'CREATE TABLE t_rename (jcol jsonb)';
+
+ PERFORM dbms_json_rename_column('t_rename', 'jcol', '$.id', 3, 'renamed_id');
+
+ RAISE NOTICE 'DBMS_JSON.RENAME_COLUMN: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON.CREATE_VIEW_ON_PATH
+
+Функция создаёт представление только для указанного поддерева JSON path.
+
+_Входящие параметры:_
+
+* `viewname (VARCHAR2)` - имя представления.
+* `tablename (VARCHAR2)` - имя таблицы.
+* `jcolname (VARCHAR2)` - имя JSON-колонки.
+* `path (VARCHAR2)` - JSON path поддерева.
+* `frequency (INTEGER)` - порог частоты поля.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Создание узкоспециализированного представления по вложенному JSON-объекту.
+* Проекция только нужного фрагмента документа без полного разворачивания.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+BEGIN
+ EXECUTE 'DROP TABLE IF EXISTS t_json_path';
+ EXECUTE 'CREATE TABLE t_json_path (j1 jsonb)';
+ EXECUTE $$INSERT INTO t_json_path VALUES ('{"info":{"label":"ok","code":10}}'::jsonb)$$;
+
+ PERFORM dbms_json_create_view_on_path('v_json_path', 't_json_path', 'j1', '$.info');
+
+ RAISE NOTICE 'DBMS_JSON.CREATE_VIEW_ON_PATH: УСПЕШНО';
+END;
+$$;
+
+== DBMS_JSON_SCHEMA
+
+=== DBMS_JSON_SCHEMA.IS_VALID
+
+Функция проверяет JSON-данные на соответствие указанной JSON Schema.
+
+_Входящие параметры:_
+
+* `json_data (JSONB)` - проверяемые JSON-данные.
+* `json_schema (JSONB)` - JSON Schema.
+* `raise_err (BINARY_INTEGER)` - режим выброса ошибки при невалидном результате.
+
+_Выходные параметры:_
+
+* Возвращает `BINARY_INTEGER`: `1`, если данные валидны, иначе `0`.
+
+_Типичные сценарии использования:_
+
+* Валидация входного JSON перед загрузкой в таблицу.
+* Проверка JSON-документов в функциях и процедурах.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_res BINARY_INTEGER;
+BEGIN
+ v_res := dbms_json_schema_is_valid(
+ '{"id": 1}'::jsonb,
+ '{"type":"object","properties":{"id":{"type":"number"}}}'::jsonb
+ );
+
+ RAISE NOTICE 'Прочитано: result=%', v_res;
+ RAISE NOTICE 'DBMS_JSON_SCHEMA.IS_VALID: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON_SCHEMA.IS_SCHEMA_VALID
+
+Функция проверяет, является ли переданный JSON-документ корректной JSON Schema.
+
+_Входящие параметры:_
+
+* `json_data (JSONB)` - JSON Schema для проверки.
+
+_Выходные параметры:_
+
+* Возвращает `BINARY_INTEGER`: `1`, если схема корректна, иначе `0`.
+
+_Типичные сценарии использования:_
+
+* Предварительная проверка схемы перед использованием в `IS_VALID`.
+* Контроль корректности пользовательских JSON Schema.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_res BINARY_INTEGER;
+BEGIN
+ v_res := dbms_json_schema_is_schema_valid('{"type":"string"}'::jsonb);
+
+ RAISE NOTICE 'Прочитано: result=%', v_res;
+ RAISE NOTICE 'DBMS_JSON_SCHEMA.IS_SCHEMA_VALID: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON_SCHEMA.IS_SCHEMA_VALID2
+
+Функция проверяет JSON Schema через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `json_data (JSONB)` - JSON Schema для проверки.
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Возвращает `BINARY_INTEGER`: `1`, если схема корректна, иначе `0`.
+
+_Типичные сценарии использования:_
+
+* Предварительная проверка схемы в сценариях с расширенной сигнатурой.
+* Контроль корректности JSON Schema без изменения основного результата проверки.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_res BINARY_INTEGER;
+BEGIN
+ v_res := dbms_json_schema_is_schema_valid2('{"type":"string"}'::jsonb, 0);
+
+ RAISE NOTICE 'Прочитано: result=%', v_res;
+ RAISE NOTICE 'DBMS_JSON_SCHEMA.IS_SCHEMA_VALID2: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON_SCHEMA.GET_VERSION
+
+Функция возвращает версию реализации пакета `DBMS_JSON_SCHEMA` в RUDB.
+
+_Входящие параметры:_
+
+* У метода нет входящих параметров.
+
+_Выходные параметры:_
+
+* Возвращает `TEXT` с версией реализации.
+
+_Типичные сценарии использования:_
+
+* Диагностика версии пакета на тестовом или целевом стенде.
+* Проверка совместимости между сборками RUDB.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_version TEXT;
+BEGIN
+ v_version := dbms_json_schema_get_version();
+
+ RAISE NOTICE 'Версия: %', v_version;
+ RAISE NOTICE 'DBMS_JSON_SCHEMA.GET_VERSION: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_JSON_SCHEMA.VALIDATE_REPORT
+
+Функция проверяет JSON-данные по схеме и возвращает подробный отчёт о результате.
+
+_Входящие параметры:_
+
+* `json_data (VARCHAR2 или JSONB)` - JSON-данные для проверки.
+* `json_schema (VARCHAR2 или JSONB)` - JSON Schema.
+
+_Выходные параметры:_
+
+* Возвращает `CLOB` с диагностическим отчётом.
+
+_Типичные сценарии использования:_
+
+* Получение детального списка ошибок валидации.
+* Формирование пользовательского диагностического сообщения.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_result CLOB;
+BEGIN
+ v_result := dbms_json_schema_validate_report(
+ '{"age":"bad"}',
+ '{"type":"object","properties":{"age":{"type":"number"}}}'
+ );
+
+ RAISE NOTICE 'Отчёт: %', v_result;
+ RAISE NOTICE 'DBMS_JSON_SCHEMA.VALIDATE_REPORT: УСПЕШНО';
+END;
+$$;
+
+== DBMS_XMLSTORE
+
+=== DBMS_XMLSTORE.CLOSECONTEXT
+
+Функция закрывает контекст `DBMS_XMLSTORE` и освобождает связанные с ним ресурсы.
+
+_Входящие параметры:_
+
+* `ctxhdl (INTEGER)` - дескриптор контекста.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Завершение работы с контекстом после операций с XML-документом.
+* Освобождение ресурсов в конце сценария загрузки данных.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_handle INTEGER;
+BEGIN
+ EXECUTE 'DROP TABLE IF EXISTS t_xmlstore_doc';
+ EXECUTE 'CREATE TABLE t_xmlstore_doc (id INTEGER)';
+
+ v_handle := dbms_xmlstore_newcontext('t_xmlstore_doc');
+ PERFORM dbms_xmlstore_closecontext(v_handle);
+
+ RAISE NOTICE 'DBMS_XMLSTORE.CLOSECONTEXT: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_XMLSTORE.CLOSECONTEXT_TMP
+
+Функция закрывает контекст `DBMS_XMLSTORE` через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `ctxhdl (INTEGER)` - дескриптор контекста.
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Завершение работы с контекстом в вариантах вызова с расширенной сигнатурой.
+* Проверка совместимости освобождения контекста с выбранным режимом.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_handle INTEGER;
+BEGIN
+ EXECUTE 'DROP TABLE IF EXISTS t_xmlstore_doc2';
+ EXECUTE 'CREATE TABLE t_xmlstore_doc2 (id INTEGER)';
+
+ v_handle := dbms_xmlstore_newcontext('t_xmlstore_doc2');
+ PERFORM dbms_xmlstore_closecontext_tmp(v_handle, 0);
+
+ RAISE NOTICE 'DBMS_XMLSTORE.CLOSECONTEXT_TMP: УСПЕШНО';
+END;
+$$;
+
+== DBMS_XMLSAVE
+
+=== DBMS_XMLSAVE.CLOSECONTEXT
+
+Функция закрывает контекст `DBMS_XMLSAVE` и освобождает связанные с ним ресурсы.
+
+_Входящие параметры:_
+
+* `ctxhdl (INTEGER)` - дескриптор контекста.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Завершение работы с контекстом после операций сохранения XML.
+* Освобождение ресурсов в конце сценария обработки данных.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_handle INTEGER;
+BEGIN
+ EXECUTE 'DROP TABLE IF EXISTS t_xmlsave_doc';
+ EXECUTE 'CREATE TABLE t_xmlsave_doc (id INTEGER)';
+
+ v_handle := dbms_xmlsave_newcontext('t_xmlsave_doc');
+ PERFORM dbms_xmlsave_closecontext(v_handle);
+
+ RAISE NOTICE 'DBMS_XMLSAVE.CLOSECONTEXT: УСПЕШНО';
+END;
+$$;
+
+=== DBMS_XMLSAVE.CLOSECONTEXT2
+
+Функция закрывает контекст `DBMS_XMLSAVE` через расширенную форму вызова.
+
+_Входящие параметры:_
+
+* `ctxhdl (INTEGER)` - дескриптор контекста.
+* `service_arg (INTEGER)` - параметр режима вызова.
+
+_Выходные параметры:_
+
+* Функция не возвращает значения.
+
+_Типичные сценарии использования:_
+
+* Завершение работы с контекстом в вариантах вызова с расширенной сигнатурой.
+* Проверка совместимости освобождения контекста с выбранным режимом.
+
+_Примеры запросов:_
+
+[source, sql]
+[%unbreakable]
+DO $$
+DECLARE
+ v_handle INTEGER;
+BEGIN
+ EXECUTE 'DROP TABLE IF EXISTS t_xmlsave_doc2';
+ EXECUTE 'CREATE TABLE t_xmlsave_doc2 (id INTEGER)';
+
+ v_handle := dbms_xmlsave_newcontext('t_xmlsave_doc2');
+ PERFORM dbms_xmlsave_closecontext2(v_handle, 0);
+
+ RAISE NOTICE 'DBMS_XMLSAVE.CLOSECONTEXT2: УСПЕШНО';
+END;
+$$;
diff --git a/src/backend/utils/dbms/utl_gdk/utl_gdk.cpp b/src/backend/utils/dbms/utl_gdk/utl_gdk.cpp
new file mode 100644
index 0000000..347394f
--- /dev/null
+++ b/src/backend/utils/dbms/utl_gdk/utl_gdk.cpp
@@ -0,0 +1,1299 @@
+#include "utl_gdk.hpp"
+
+extern "C" {
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+
+PG_FUNCTION_INFO_V1(utl_gdk_charset_map0);
+PG_FUNCTION_INFO_V1(utl_gdk_charset_map1);
+PG_FUNCTION_INFO_V1(utl_gdk_oracle_charset_to_iana);
+PG_FUNCTION_INFO_V1(utl_gdk_language_map0);
+PG_FUNCTION_INFO_V1(utl_gdk_language_map1);
+PG_FUNCTION_INFO_V1(utl_gdk_territory_map0);
+PG_FUNCTION_INFO_V1(utl_gdk_territory_map1);
+PG_FUNCTION_INFO_V1(utl_gdk_get_version);
+
+/// @brief Версия RUDB пакета UTL_GDK (Oracle UTL_GDK пакет)
+#define RUDB_UTL_GDK_VERSION "1.0.0"
+}
+
+namespace {
+constexpr int32 UTL_GDK_ORACLE_TO_IANA = 1;
+constexpr int32 UTL_GDK_IANA_TO_ORACLE = 2;
+constexpr int32 UTL_GDK_ORACLE_TO_ISO = 3;
+constexpr int32 UTL_GDK_ISO_TO_ORACLE = 4;
+constexpr int32 UTL_GDK_ORACLE_TO_ISO_A3 = 5;
+constexpr int32 UTL_GDK_ISO_A3_TO_ORACLE = 6;
+
+struct NameMapping
+{
+ const char* source_name;
+ const char* mapped_name;
+};
+
+constexpr NameMapping UTL_GDK_CHARSET_ORACLE_TO_IANA_MAPPINGS[] = {
+ {"AL16UTF16", "UTF-16BE"},
+ {"AL32UTF8", "UTF-8"},
+ {"AR8EBCDIC420S", "CP420"},
+ {"AR8EBCDICX", "CP420"},
+ {"AR8ISO8859P6", "ISO-8859-6"},
+ {"AR8MSWIN1256", "WINDOWS-1256"},
+ {"BLT8ISO8859P13", "ISO-8859-13"},
+ {"BLT8MSWIN1257", "WINDOWS-1257"},
+ {"BLT8PC775", "CP775"},
+ {"CDN8PC863", "CP863"},
+ {"CEL8ISO8859P14", "ISO-8859-14"},
+ {"CL8ISO8859P5", "ISO-8859-5"},
+ {"CL8KOI8R", "KOI8-R"},
+ {"CL8KOI8U", "KOI8-U"},
+ {"CL8MSWIN1251", "WINDOWS-1251"},
+ {"D7DEC", "DIN_66003"},
+ {"D7SIEMENS9780X", "DIN_66003"},
+ {"D8EBCDIC1141", "CP01141"},
+ {"D8EBCDIC273", "CP273"},
+ {"DK7SIEMENS9780X", "NS_4551-1"},
+ {"DK8EBCDIC1142", "CP01142"},
+ {"DK8EBCDIC277", "IBM277"},
+ {"E7DEC", "ES"},
+ {"EE8EBCDIC870", "CP870"},
+ {"EE8EBCDIC870C", "CP870"},
+ {"EE8EBCDIC870S", "CP870"},
+ {"EE8ISO8859P2", "ISO-8859-2"},
+ {"EE8MSWIN1250", "WINDOWS-1250"},
+ {"EE8PC852", "CP852"},
+ {"EL8EBCDIC423R", "CP423"},
+ {"EL8ISO8859P7", "ISO-8859-7"},
+ {"EL8MSWIN1253", "WINDOWS-1253"},
+ {"EL8PC851", "CP851"},
+ {"EL8PC869", "CP869"},
+ {"F7DEC", "NF_Z_62-010_(1973)"},
+ {"F8EBCDIC1147", "CP01147"},
+ {"F8EBCDIC297", "CP297"},
+ {"I7DEC", "IT"},
+ {"I7SIEMENS9780X", "IT"},
+ {"I8EBCDIC1144", "CP01144"},
+ {"I8EBCDIC280", "CP280"},
+ {"IS8PC861", "CP861"},
+ {"IW8EBCDIC424", "CP424"},
+ {"IW8EBCDIC424S", "CP424"},
+ {"IW8ISO8859P8", "ISO-8859-8-I"},
+ {"IW8MSWIN1255", "WINDOWS-1255"},
+ {"IW8PC1507", "CP862"},
+ {"JA16EUC", "EUC-JP"},
+ {"JA16EUCTILDE", "EUC-JP"},
+ {"JA16EUCYEN", "EUC-JP"},
+ {"JA16SJIS", "SHIFT_JIS"},
+ {"JA16SJISTILDE", "SHIFT_JIS"},
+ {"JA16SJISYEN", "SHIFT_JIS"},
+ {"JA16VMS", "EUC-JP"},
+ {"KO16KSC5601", "EUC-KR"},
+ {"KO16MSWIN949", "EUC-KR"},
+ {"N7SIEMENS9780X", "NS_4551-1"},
+ {"N8PC865", "CP865"},
+ {"NE8ISO8859P10", "ISO-8859-10"},
+ {"NEE8ISO8859P4", "ISO-8859-4"},
+ {"RU8PC855", "CP855"},
+ {"RU8PC866", "CP866"},
+ {"S7SIEMENS9780X", "SEN_850200_C"},
+ {"S8EBCDIC1143", "CP01143"},
+ {"S8EBCDIC278", "CP278"},
+ {"SE8ISO8859P3", "ISO-8859-3"},
+ {"SF7ASCII", "SEN_850200_B"},
+ {"TH8TISASCII", "TIS-620"},
+ {"TR8EBCDIC1026", "CP1026"},
+ {"TR8EBCDIC1026S", "CP1026"},
+ {"TR8MSWIN1254", "WINDOWS-1254"},
+ {"TR8PC857", "CP857"},
+ {"US7ASCII", "US-ASCII"},
+ {"US8PC437", "CP437"},
+ {"UTF8", "UTF-8"},
+ {"VN8MSWIN1258", "WINDOWS-1258"},
+ {"WE8DEC", "DEC-MCS"},
+ {"WE8EBCDIC1047", "IBM1047"},
+ {"WE8EBCDIC1047E", "IBM1047"},
+ {"WE8EBCDIC1140", "CP01140"},
+ {"WE8EBCDIC1140C", "CP01140"},
+ {"WE8EBCDIC1145", "CP01145"},
+ {"WE8EBCDIC1146", "CP01146"},
+ {"WE8EBCDIC1148", "CP01148"},
+ {"WE8EBCDIC1148C", "CP01148"},
+ {"WE8EBCDIC284", "CP284"},
+ {"WE8EBCDIC285", "CP285"},
+ {"WE8EBCDIC37", "CP037"},
+ {"WE8EBCDIC37C", "CP037"},
+ {"WE8EBCDIC500", "CP500"},
+ {"WE8EBCDIC500C", "CP500"},
+ {"WE8EBCDIC871", "CP871"},
+ {"WE8EBCDIC924", "CP00924"},
+ {"WE8ISO8859P1", "ISO-8859-1"},
+ {"WE8ISO8859P15", "ISO-8859-15"},
+ {"WE8ISO8859P9", "ISO-8859-9"},
+ {"WE8MACROMAN8", "MACINTOSH"},
+ {"WE8MACROMAN8S", "MACINTOSH"},
+ {"WE8MSWIN1252", "WINDOWS-1252"},
+ {"WE8NCR4970", "DEC-MCS"},
+ {"WE8PC850", "CP850"},
+ {"WE8PC858", "CP00858"},
+ {"WE8PC860", "CP860"},
+ {"WE8ROMAN8", "HP-ROMAN8"},
+ {"YUG7ASCII", "JUS_I.B1.002"},
+ {"ZHS16CGB231280", "GBK"},
+ {"ZHS16GBK", "GBK"},
+ {"ZHS32GB18030", "GB18030"},
+ {"ZHT16BIG5", "BIG5"},
+ {"ZHT16HKSCS", "BIG5-HKSCS"},
+ {"ZHT16HKSCS31", "BIG5-HKSCS"},
+ {"ZHT16MSWIN950", "BIG5"},
+};
+
+constexpr NameMapping UTL_GDK_CHARSET_IANA_TO_ORACLE_MAPPINGS[] = {
+ {"BIG5", "ZHT16MSWIN950"},
+ {"BIG5-HKSCS", "ZHT16HKSCS"},
+ {"CP00858", "WE8PC858"},
+ {"CP00924", "WE8EBCDIC924"},
+ {"CP01140", "WE8EBCDIC1140"},
+ {"CP01141", "D8EBCDIC1141"},
+ {"CP01142", "DK8EBCDIC1142"},
+ {"CP01143", "S8EBCDIC1143"},
+ {"CP01144", "I8EBCDIC1144"},
+ {"CP01145", "WE8EBCDIC1145"},
+ {"CP01146", "WE8EBCDIC1146"},
+ {"CP01147", "F8EBCDIC1147"},
+ {"CP01148", "WE8EBCDIC1148"},
+ {"CP037", "WE8EBCDIC37"},
+ {"CP1026", "TR8EBCDIC1026"},
+ {"CP273", "D8EBCDIC273"},
+ {"CP278", "S8EBCDIC278"},
+ {"CP280", "I8EBCDIC280"},
+ {"CP284", "WE8EBCDIC284"},
+ {"CP285", "WE8EBCDIC285"},
+ {"CP297", "F8EBCDIC297"},
+ {"CP420", "AR8EBCDIC420S"},
+ {"CP423", "EL8EBCDIC423R"},
+ {"CP424", "IW8EBCDIC424"},
+ {"CP437", "US8PC437"},
+ {"CP500", "WE8EBCDIC500"},
+ {"CP775", "BLT8PC775"},
+ {"CP850", "WE8PC850"},
+ {"CP851", "EL8PC851"},
+ {"CP852", "EE8PC852"},
+ {"CP855", "RU8PC855"},
+ {"CP857", "TR8PC857"},
+ {"CP860", "WE8PC860"},
+ {"CP861", "IS8PC861"},
+ {"CP862", "IW8PC1507"},
+ {"CP863", "CDN8PC863"},
+ {"CP865", "N8PC865"},
+ {"CP866", "RU8PC866"},
+ {"CP869", "EL8PC869"},
+ {"CP870", "EE8EBCDIC870"},
+ {"CP871", "WE8EBCDIC871"},
+ {"DEC-MCS", "WE8DEC"},
+ {"DIN_66003", "D7DEC"},
+ {"ES", "E7DEC"},
+ {"EUC-JP", "JA16EUC"},
+ {"EUC-KR", "KO16MSWIN949"},
+ {"GB18030", "ZHS32GB18030"},
+ {"GBK", "ZHS16GBK"},
+ {"HP-ROMAN8", "WE8ROMAN8"},
+ {"IBM1047", "WE8EBCDIC1047"},
+ {"IBM277", "DK8EBCDIC277"},
+ {"ISO-8859-1", "WE8ISO8859P1"},
+ {"ISO-8859-10", "NE8ISO8859P10"},
+ {"ISO-8859-13", "BLT8ISO8859P13"},
+ {"ISO-8859-14", "CEL8ISO8859P14"},
+ {"ISO-8859-15", "WE8ISO8859P15"},
+ {"ISO-8859-2", "EE8ISO8859P2"},
+ {"ISO-8859-3", "SE8ISO8859P3"},
+ {"ISO-8859-4", "NEE8ISO8859P4"},
+ {"ISO-8859-5", "CL8ISO8859P5"},
+ {"ISO-8859-6", "AR8ISO8859P6"},
+ {"ISO-8859-7", "EL8ISO8859P7"},
+ {"ISO-8859-8-I", "IW8ISO8859P8"},
+ {"ISO-8859-9", "WE8ISO8859P9"},
+ {"IT", "I7DEC"},
+ {"JUS_I.B1.002", "YUG7ASCII"},
+ {"KOI8-R", "CL8KOI8R"},
+ {"KOI8-U", "CL8KOI8U"},
+ {"MACINTOSH", "WE8MACROMAN8"},
+ {"NF_Z_62-010_(1973)", "F7DEC"},
+ {"NS_4551-1", "N7SIEMENS9780X"},
+ {"SEN_850200_B", "SF7ASCII"},
+ {"SEN_850200_C", "S7SIEMENS9780X"},
+ {"SHIFT_JIS", "JA16SJIS"},
+ {"TIS-620", "TH8TISASCII"},
+ {"US-ASCII", "US7ASCII"},
+ {"UTF-16BE", "AL16UTF16"},
+ {"UTF-8", "AL32UTF8"},
+ {"WINDOWS-1250", "EE8MSWIN1250"},
+ {"WINDOWS-1251", "CL8MSWIN1251"},
+ {"WINDOWS-1252", "WE8MSWIN1252"},
+ {"WINDOWS-1253", "EL8MSWIN1253"},
+ {"WINDOWS-1254", "TR8MSWIN1254"},
+ {"WINDOWS-1255", "IW8MSWIN1255"},
+ {"WINDOWS-1256", "AR8MSWIN1256"},
+ {"WINDOWS-1257", "BLT8MSWIN1257"},
+ {"WINDOWS-1258", "VN8MSWIN1258"},
+};
+
+constexpr NameMapping UTL_GDK_LANGUAGE_ORACLE_TO_ISO_MAPPINGS[] = {
+ {"ALBANIAN", "sq"},
+ {"AMERICAN", "en"},
+ {"AMHARIC", "am"},
+ {"ARABIC", "ar"},
+ {"ARMENIAN", "hy"},
+ {"ASSAMESE", "as"},
+ {"AZERBAIJANI", "az"},
+ {"BANGLA", "bn"},
+ {"BASQUE", "eu"},
+ {"BELARUSIAN", "be"},
+ {"BRAZILIAN PORTUGUESE", "pt"},
+ {"BULGARIAN", "bg"},
+ {"BURMESE", "my"},
+ {"CANADIAN FRENCH", "fr"},
+ {"CATALAN", "ca"},
+ {"CROATIAN", "hr"},
+ {"CYRILLIC KAZAKH", "kk"},
+ {"CYRILLIC SERBIAN", "sr"},
+ {"CYRILLIC UZBEK", "uz"},
+ {"CZECH", "cs"},
+ {"DANISH", "da"},
+ {"DARI", "pr"},
+ {"DIVEHI", "dv"},
+ {"DUTCH", "nl"},
+ {"EGYPTIAN", "ar"},
+ {"ENGLISH", "en"},
+ {"ESTONIAN", "et"},
+ {"FINNISH", "fi"},
+ {"FRENCH", "fr"},
+ {"GEORGIAN", "ka"},
+ {"GERMAN", "de"},
+ {"GERMAN DIN", "de"},
+ {"GREEK", "el"},
+ {"GUJARATI", "gu"},
+ {"HEBREW", "iw"},
+ {"HINDI", "hi"},
+ {"HUNGARIAN", "hu"},
+ {"ICELANDIC", "is"},
+ {"INDONESIAN", "in"},
+ {"IRISH", "ga"},
+ {"ITALIAN", "it"},
+ {"JAPANESE", "ja"},
+ {"KANNADA", "kn"},
+ {"KHMER", "km"},
+ {"KOREAN", "ko"},
+ {"KYRGYZ", "ky"},
+ {"LAO", "lo"},
+ {"LATIN AMERICAN SPANISH", "es"},
+ {"LATIN BOSNIAN", "bs"},
+ {"LATIN SERBIAN", "sh"},
+ {"LATIN UZBEK", "uz"},
+ {"LATVIAN", "lv"},
+ {"LITHUANIAN", "lt"},
+ {"MACEDONIAN", "mk"},
+ {"MALAY", "ms"},
+ {"MALAYALAM", "ml"},
+ {"MALTESE", "mt"},
+ {"MARATHI", "mr"},
+ {"MEXICAN SPANISH", "es"},
+ {"NEPALI", "ne"},
+ {"NORWEGIAN", "no"},
+ {"ORIYA", "or"},
+ {"PERSIAN", "fa"},
+ {"POLISH", "pl"},
+ {"PORTUGUESE", "pt"},
+ {"PUNJABI", "pa"},
+ {"ROMANIAN", "ro"},
+ {"RUSSIAN", "ru"},
+ {"SIMPLIFIED CHINESE", "zh"},
+ {"SINHALA", "si"},
+ {"SLOVAK", "sk"},
+ {"SLOVENIAN", "sl"},
+ {"SPANISH", "es"},
+ {"SWAHILI", "sw"},
+ {"SWEDISH", "sv"},
+ {"TAMIL", "ta"},
+ {"TELUGU", "te"},
+ {"THAI", "th"},
+ {"TRADITIONAL CHINESE", "zh"},
+ {"TURKISH", "tr"},
+ {"TURKMEN", "tk"},
+ {"UKRAINIAN", "uk"},
+ {"URDU", "ur"},
+ {"VIETNAMESE", "vi"},
+ {"BENGALI", "bn"},
+};
+
+constexpr NameMapping UTL_GDK_LANGUAGE_ISO_TO_ORACLE_MAPPINGS[] = {
+ {"am", "AMHARIC"},
+ {"ar", "ARABIC"},
+ {"as", "ASSAMESE"},
+ {"az", "AZERBAIJANI"},
+ {"be", "BELARUSIAN"},
+ {"bg", "BULGARIAN"},
+ {"bn", "BANGLA"},
+ {"bs", "LATIN BOSNIAN"},
+ {"ca", "CATALAN"},
+ {"cs", "CZECH"},
+ {"da", "DANISH"},
+ {"de", "GERMAN"},
+ {"dv", "DIVEHI"},
+ {"el", "GREEK"},
+ {"en", "ENGLISH"},
+ {"es", "SPANISH"},
+ {"et", "ESTONIAN"},
+ {"eu", "BASQUE"},
+ {"fa", "PERSIAN"},
+ {"fi", "FINNISH"},
+ {"fr", "FRENCH"},
+ {"ga", "IRISH"},
+ {"gu", "GUJARATI"},
+ {"hi", "HINDI"},
+ {"hr", "CROATIAN"},
+ {"hu", "HUNGARIAN"},
+ {"hy", "ARMENIAN"},
+ {"in", "INDONESIAN"},
+ {"is", "ICELANDIC"},
+ {"it", "ITALIAN"},
+ {"iw", "HEBREW"},
+ {"ja", "JAPANESE"},
+ {"ka", "GEORGIAN"},
+ {"kk", "CYRILLIC KAZAKH"},
+ {"km", "KHMER"},
+ {"kn", "KANNADA"},
+ {"ko", "KOREAN"},
+ {"ky", "KYRGYZ"},
+ {"lo", "LAO"},
+ {"lt", "LITHUANIAN"},
+ {"lv", "LATVIAN"},
+ {"mk", "MACEDONIAN"},
+ {"ml", "MALAYALAM"},
+ {"mr", "MARATHI"},
+ {"ms", "MALAY"},
+ {"mt", "MALTESE"},
+ {"my", "BURMESE"},
+ {"ne", "NEPALI"},
+ {"nl", "DUTCH"},
+ {"no", "NORWEGIAN"},
+ {"or", "ORIYA"},
+ {"pa", "PUNJABI"},
+ {"pl", "POLISH"},
+ {"pr", "DARI"},
+ {"pt", "PORTUGUESE"},
+ {"ro", "ROMANIAN"},
+ {"ru", "RUSSIAN"},
+ {"sh", "LATIN SERBIAN"},
+ {"si", "SINHALA"},
+ {"sk", "SLOVAK"},
+ {"sl", "SLOVENIAN"},
+ {"sq", "ALBANIAN"},
+ {"sr", "CYRILLIC SERBIAN"},
+ {"sv", "SWEDISH"},
+ {"sw", "SWAHILI"},
+ {"ta", "TAMIL"},
+ {"te", "TELUGU"},
+ {"th", "THAI"},
+ {"tk", "TURKMEN"},
+ {"tr", "TURKISH"},
+ {"uk", "UKRAINIAN"},
+ {"ur", "URDU"},
+ {"uz", "LATIN UZBEK"},
+ {"vi", "VIETNAMESE"},
+ {"zh", "SIMPLIFIED CHINESE"},
+};
+
+constexpr NameMapping UTL_GDK_TERRITORY_ORACLE_TO_ISO_A2_MAPPINGS[] = {
+ {"AFGHANISTAN", "AF"},
+ {"ALBANIA", "AL"},
+ {"ALGERIA", "DZ"},
+ {"AMERICA", "US"},
+ {"ANGOLA", "AO"},
+ {"ANTIGUA AND BARBUDA", "AG"},
+ {"ARGENTINA", "AR"},
+ {"ARMENIA", "AM"},
+ {"ARUBA", "AW"},
+ {"AUSTRALIA", "AU"},
+ {"AUSTRIA", "AT"},
+ {"AZERBAIJAN", "AZ"},
+ {"BAHAMAS", "BS"},
+ {"BAHRAIN", "BH"},
+ {"BANGLADESH", "BD"},
+ {"BARBADOS", "BB"},
+ {"BELARUS", "BY"},
+ {"BELGIUM", "BE"},
+ {"BELIZE", "BZ"},
+ {"BERMUDA", "BM"},
+ {"BOLIVIA", "BO"},
+ {"BOSNIA AND HERZEGOVINA", "BA"},
+ {"BOTSWANA", "BW"},
+ {"BRAZIL", "BR"},
+ {"BULGARIA", "BG"},
+ {"CAMBODIA", "KH"},
+ {"CAMEROON", "CM"},
+ {"CANADA", "CA"},
+ {"CATALONIA", "ES"},
+ {"CAYMAN ISLANDS", "KY"},
+ {"CHILE", "CL"},
+ {"CHINA", "CN"},
+ {"COLOMBIA", "CO"},
+ {"CONGO BRAZZAVILLE", "CG"},
+ {"CONGO KINSHASA", "CD"},
+ {"COSTA RICA", "CR"},
+ {"CROATIA", "HR"},
+ {"CURACAO", "CW"},
+ {"CYPRUS", "CY"},
+ {"CZECH REPUBLIC", "CZ"},
+ {"DENMARK", "DK"},
+ {"DJIBOUTI", "DJ"},
+ {"DOMINICA", "DM"},
+ {"DOMINICAN REPUBLIC", "DO"},
+ {"ECUADOR", "EC"},
+ {"EGYPT", "EG"},
+ {"EL SALVADOR", "SV"},
+ {"ESTONIA", "EE"},
+ {"ETHIOPIA", "ET"},
+ {"FINLAND", "FI"},
+ {"FRANCE", "FR"},
+ {"FYR MACEDONIA", "MK"},
+ {"GABON", "GA"},
+ {"GEORGIA", "GE"},
+ {"GERMANY", "DE"},
+ {"GHANA", "GH"},
+ {"GREECE", "GR"},
+ {"GRENADA", "GD"},
+ {"GUATEMALA", "GT"},
+ {"GUYANA", "GY"},
+ {"HAITI", "HT"},
+ {"HONDURAS", "HN"},
+ {"HONG KONG", "HK"},
+ {"HUNGARY", "HU"},
+ {"ICELAND", "IS"},
+ {"INDIA", "IN"},
+ {"INDONESIA", "ID"},
+ {"IRAN", "IR"},
+ {"IRAQ", "IQ"},
+ {"IRELAND", "IE"},
+ {"ISRAEL", "IL"},
+ {"ITALY", "IT"},
+ {"IVORY COAST", "CI"},
+ {"JAMAICA", "JM"},
+ {"JAPAN", "JP"},
+ {"JORDAN", "JO"},
+ {"KAZAKHSTAN", "KZ"},
+ {"KENYA", "KE"},
+ {"KOREA", "KR"},
+ {"KUWAIT", "KW"},
+ {"KYRGYZSTAN", "KG"},
+ {"LAOS", "LA"},
+ {"LATVIA", "LV"},
+ {"LEBANON", "LB"},
+ {"LIBYA", "LY"},
+ {"LIECHTENSTEIN", "LI"},
+ {"LITHUANIA", "LT"},
+ {"LUXEMBOURG", "LU"},
+ {"MACAO", "MO"},
+ {"MALAWI", "MW"},
+ {"MALAYSIA", "MY"},
+ {"MALDIVES", "MV"},
+ {"MALTA", "MT"},
+ {"MAURITANIA", "MR"},
+ {"MAURITIUS", "MU"},
+ {"MEXICO", "MX"},
+ {"MOLDOVA", "MD"},
+ {"MONTENEGRO", "ME"},
+ {"MOROCCO", "MA"},
+ {"MOZAMBIQUE", "MZ"},
+ {"MYANMAR", "MM"},
+ {"NAMIBIA", "NA"},
+ {"NEPAL", "NP"},
+ {"NEW ZEALAND", "NZ"},
+ {"NICARAGUA", "NI"},
+ {"NIGERIA", "NG"},
+ {"NORWAY", "NO"},
+ {"OMAN", "OM"},
+ {"PAKISTAN", "PK"},
+ {"PANAMA", "PA"},
+ {"PARAGUAY", "PY"},
+ {"PERU", "PE"},
+ {"PHILIPPINES", "PH"},
+ {"POLAND", "PL"},
+ {"PORTUGAL", "PT"},
+ {"PUERTO RICO", "PR"},
+ {"QATAR", "QA"},
+ {"ROMANIA", "RO"},
+ {"RUSSIA", "RU"},
+ {"SAINT KITTS AND NEVIS", "KN"},
+ {"SAINT LUCIA", "LC"},
+ {"SAUDI ARABIA", "SA"},
+ {"SENEGAL", "SN"},
+ {"SERBIA", "RS"},
+ {"SIERRA LEONE", "SL"},
+ {"SINGAPORE", "SG"},
+ {"SLOVAKIA", "SK"},
+ {"SLOVENIA", "SI"},
+ {"SOMALIA", "SO"},
+ {"SOUTH AFRICA", "ZA"},
+ {"SOUTH SUDAN", "SS"},
+ {"SPAIN", "ES"},
+ {"SRI LANKA", "LK"},
+ {"SUDAN", "SD"},
+ {"SURINAME", "SR"},
+ {"SWAZILAND", "SZ"},
+ {"SWEDEN", "SE"},
+ {"SWITZERLAND", "CH"},
+ {"SYRIA", "SY"},
+ {"TAIWAN", "TW"},
+ {"TANZANIA", "TZ"},
+ {"THAILAND", "TH"},
+ {"THE NETHERLANDS", "NL"},
+ {"TRINIDAD AND TOBAGO", "TT"},
+ {"TUNISIA", "TN"},
+ {"TURKEY", "TR"},
+ {"TURKMENISTAN", "TM"},
+ {"UGANDA", "UG"},
+ {"UKRAINE", "UA"},
+ {"UNITED ARAB EMIRATES", "AE"},
+ {"UNITED KINGDOM", "GB"},
+ {"URUGUAY", "UY"},
+ {"UZBEKISTAN", "UZ"},
+ {"VENEZUELA", "VE"},
+ {"VIETNAM", "VN"},
+ {"YEMEN", "YE"},
+ {"ZAMBIA", "ZM"},
+ {"ZIMBABWE", "ZW"},
+ {"CIS", "RU"},
+ {"CZECHOSLOVAKIA", "CZ"},
+ {"MACEDONIA", "MK"},
+ {"SERBIA AND MONTENEGRO", "CS"},
+ {"YUGOSLAVIA", "YU"},
+};
+
+constexpr NameMapping UTL_GDK_TERRITORY_ISO_A2_TO_ORACLE_MAPPINGS[] = {
+ {"AE", "UNITED ARAB EMIRATES"},
+ {"AF", "AFGHANISTAN"},
+ {"AG", "ANTIGUA AND BARBUDA"},
+ {"AL", "ALBANIA"},
+ {"AM", "ARMENIA"},
+ {"AO", "ANGOLA"},
+ {"AR", "ARGENTINA"},
+ {"AT", "AUSTRIA"},
+ {"AU", "AUSTRALIA"},
+ {"AW", "ARUBA"},
+ {"AZ", "AZERBAIJAN"},
+ {"BA", "BOSNIA AND HERZEGOVINA"},
+ {"BB", "BARBADOS"},
+ {"BD", "BANGLADESH"},
+ {"BE", "BELGIUM"},
+ {"BG", "BULGARIA"},
+ {"BH", "BAHRAIN"},
+ {"BM", "BERMUDA"},
+ {"BO", "BOLIVIA"},
+ {"BR", "BRAZIL"},
+ {"BS", "BAHAMAS"},
+ {"BW", "BOTSWANA"},
+ {"BY", "BELARUS"},
+ {"BZ", "BELIZE"},
+ {"CA", "CANADA"},
+ {"CD", "CONGO KINSHASA"},
+ {"CG", "CONGO BRAZZAVILLE"},
+ {"CH", "SWITZERLAND"},
+ {"CI", "IVORY COAST"},
+ {"CL", "CHILE"},
+ {"CM", "CAMEROON"},
+ {"CN", "CHINA"},
+ {"CO", "COLOMBIA"},
+ {"CR", "COSTA RICA"},
+ {"CS", "SERBIA AND MONTENEGRO"},
+ {"CW", "CURACAO"},
+ {"CY", "CYPRUS"},
+ {"CZ", "CZECH REPUBLIC"},
+ {"DE", "GERMANY"},
+ {"DJ", "DJIBOUTI"},
+ {"DK", "DENMARK"},
+ {"DM", "DOMINICA"},
+ {"DO", "DOMINICAN REPUBLIC"},
+ {"DZ", "ALGERIA"},
+ {"EC", "ECUADOR"},
+ {"EE", "ESTONIA"},
+ {"EG", "EGYPT"},
+ {"ES", "SPAIN"},
+ {"ET", "ETHIOPIA"},
+ {"FI", "FINLAND"},
+ {"FR", "FRANCE"},
+ {"GA", "GABON"},
+ {"GB", "UNITED KINGDOM"},
+ {"GD", "GRENADA"},
+ {"GE", "GEORGIA"},
+ {"GH", "GHANA"},
+ {"GR", "GREECE"},
+ {"GT", "GUATEMALA"},
+ {"GY", "GUYANA"},
+ {"HK", "HONG KONG"},
+ {"HN", "HONDURAS"},
+ {"HR", "CROATIA"},
+ {"HT", "HAITI"},
+ {"HU", "HUNGARY"},
+ {"ID", "INDONESIA"},
+ {"IE", "IRELAND"},
+ {"IL", "ISRAEL"},
+ {"IN", "INDIA"},
+ {"IQ", "IRAQ"},
+ {"IR", "IRAN"},
+ {"IS", "ICELAND"},
+ {"IT", "ITALY"},
+ {"JM", "JAMAICA"},
+ {"JO", "JORDAN"},
+ {"JP", "JAPAN"},
+ {"KE", "KENYA"},
+ {"KG", "KYRGYZSTAN"},
+ {"KH", "CAMBODIA"},
+ {"KN", "SAINT KITTS AND NEVIS"},
+ {"KR", "KOREA"},
+ {"KW", "KUWAIT"},
+ {"KY", "CAYMAN ISLANDS"},
+ {"KZ", "KAZAKHSTAN"},
+ {"LA", "LAOS"},
+ {"LB", "LEBANON"},
+ {"LC", "SAINT LUCIA"},
+ {"LI", "LIECHTENSTEIN"},
+ {"LK", "SRI LANKA"},
+ {"LT", "LITHUANIA"},
+ {"LU", "LUXEMBOURG"},
+ {"LV", "LATVIA"},
+ {"LY", "LIBYA"},
+ {"MA", "MOROCCO"},
+ {"MD", "MOLDOVA"},
+ {"ME", "MONTENEGRO"},
+ {"MK", "FYR MACEDONIA"},
+ {"MM", "MYANMAR"},
+ {"MO", "MACAO"},
+ {"MR", "MAURITANIA"},
+ {"MT", "MALTA"},
+ {"MU", "MAURITIUS"},
+ {"MV", "MALDIVES"},
+ {"MW", "MALAWI"},
+ {"MX", "MEXICO"},
+ {"MY", "MALAYSIA"},
+ {"MZ", "MOZAMBIQUE"},
+ {"NA", "NAMIBIA"},
+ {"NG", "NIGERIA"},
+ {"NI", "NICARAGUA"},
+ {"NL", "THE NETHERLANDS"},
+ {"NO", "NORWAY"},
+ {"NP", "NEPAL"},
+ {"NZ", "NEW ZEALAND"},
+ {"OM", "OMAN"},
+ {"PA", "PANAMA"},
+ {"PE", "PERU"},
+ {"PH", "PHILIPPINES"},
+ {"PK", "PAKISTAN"},
+ {"PL", "POLAND"},
+ {"PR", "PUERTO RICO"},
+ {"PT", "PORTUGAL"},
+ {"PY", "PARAGUAY"},
+ {"QA", "QATAR"},
+ {"RO", "ROMANIA"},
+ {"RS", "SERBIA"},
+ {"RU", "RUSSIA"},
+ {"SA", "SAUDI ARABIA"},
+ {"SD", "SUDAN"},
+ {"SE", "SWEDEN"},
+ {"SG", "SINGAPORE"},
+ {"SI", "SLOVENIA"},
+ {"SK", "SLOVAKIA"},
+ {"SL", "SIERRA LEONE"},
+ {"SN", "SENEGAL"},
+ {"SO", "SOMALIA"},
+ {"SR", "SURINAME"},
+ {"SS", "SOUTH SUDAN"},
+ {"SV", "EL SALVADOR"},
+ {"SY", "SYRIA"},
+ {"SZ", "SWAZILAND"},
+ {"TH", "THAILAND"},
+ {"TM", "TURKMENISTAN"},
+ {"TN", "TUNISIA"},
+ {"TR", "TURKEY"},
+ {"TT", "TRINIDAD AND TOBAGO"},
+ {"TW", "TAIWAN"},
+ {"TZ", "TANZANIA"},
+ {"UA", "UKRAINE"},
+ {"UG", "UGANDA"},
+ {"US", "AMERICA"},
+ {"UY", "URUGUAY"},
+ {"UZ", "UZBEKISTAN"},
+ {"VE", "VENEZUELA"},
+ {"VN", "VIETNAM"},
+ {"YE", "YEMEN"},
+ {"YU", "YUGOSLAVIA"},
+ {"ZA", "SOUTH AFRICA"},
+ {"ZM", "ZAMBIA"},
+ {"ZW", "ZIMBABWE"},
+};
+
+constexpr NameMapping UTL_GDK_TERRITORY_ORACLE_TO_ISO_A3_MAPPINGS[] = {
+ {"AFGHANISTAN", "AFG"},
+ {"ALBANIA", "ALB"},
+ {"ALGERIA", "DZA"},
+ {"AMERICA", "USA"},
+ {"ANGOLA", "AGO"},
+ {"ANTIGUA AND BARBUDA", "ATG"},
+ {"ARGENTINA", "ARG"},
+ {"ARMENIA", "ARM"},
+ {"ARUBA", "ABW"},
+ {"AUSTRALIA", "AUS"},
+ {"AUSTRIA", "AUT"},
+ {"BAHAMAS", "BHS"},
+ {"BAHRAIN", "BHR"},
+ {"BANGLADESH", "BGD"},
+ {"BARBADOS", "BRB"},
+ {"BELARUS", "BLR"},
+ {"BELGIUM", "BEL"},
+ {"BELIZE", "BZD"},
+ {"BERMUDA", "BMU"},
+ {"BOLIVIA", "BOB"},
+ {"BOSNIA AND HERZEGOVINA", "BIH"},
+ {"BOTSWANA", "BWA"},
+ {"BRAZIL", "BRA"},
+ {"BULGARIA", "BGR"},
+ {"CAMBODIA", "KHM"},
+ {"CAMEROON", "CMR"},
+ {"CANADA", "CAN"},
+ {"CATALONIA", "ESP"},
+ {"CAYMAN ISLANDS", "CYM"},
+ {"CHILE", "CHL"},
+ {"CHINA", "CHN"},
+ {"COLOMBIA", "COL"},
+ {"CONGO BRAZZAVILLE", "COG"},
+ {"CONGO KINSHASA", "COD"},
+ {"COSTA RICA", "CRI"},
+ {"CROATIA", "HRV"},
+ {"CURACAO", "CUW"},
+ {"CYPRUS", "CYP"},
+ {"CZECH REPUBLIC", "CZE"},
+ {"DENMARK", "DNK"},
+ {"DJIBOUTI", "DJI"},
+ {"DOMINICA", "DMA"},
+ {"DOMINICAN REPUBLIC", "DOM"},
+ {"ECUADOR", "ECU"},
+ {"EGYPT", "EGY"},
+ {"EL SALVADOR", "SLV"},
+ {"ESTONIA", "EST"},
+ {"ETHIOPIA", "ETH"},
+ {"FINLAND", "FIN"},
+ {"FRANCE", "FRA"},
+ {"FYR MACEDONIA", "MKD"},
+ {"GABON", "GAB"},
+ {"GEORGIA", "GEO"},
+ {"GERMANY", "DEU"},
+ {"GHANA", "GHA"},
+ {"GREECE", "GRC"},
+ {"GRENADA", "GRD"},
+ {"GUATEMALA", "GTM"},
+ {"GUYANA", "GUY"},
+ {"HAITI", "HTI"},
+ {"HONDURAS", "HND"},
+ {"HONG KONG", "HKG"},
+ {"HUNGARY", "HUN"},
+ {"ICELAND", "ISL"},
+ {"INDIA", "IND"},
+ {"INDONESIA", "IDN"},
+ {"IRAN", "IRN"},
+ {"IRAQ", "IRQ"},
+ {"IRELAND", "IRL"},
+ {"ISRAEL", "ISR"},
+ {"ITALY", "ITA"},
+ {"IVORY COAST", "CIV"},
+ {"JAMAICA", "JAM"},
+ {"JAPAN", "JPN"},
+ {"JORDAN", "JOR"},
+ {"KAZAKHSTAN", "KAZ"},
+ {"KENYA", "KEN"},
+ {"KOREA", "KOR"},
+ {"KUWAIT", "KWT"},
+ {"KYRGYZSTAN", "KGZ"},
+ {"LAOS", "LAO"},
+ {"LATVIA", "LVA"},
+ {"LEBANON", "LBN"},
+ {"LIBYA", "LBY"},
+ {"LIECHTENSTEIN", "LIE"},
+ {"LITHUANIA", "LTU"},
+ {"LUXEMBOURG", "LUX"},
+ {"MACAO", "MAC"},
+ {"MALAWI", "MWI"},
+ {"MALAYSIA", "MYS"},
+ {"MALDIVES", "MDV"},
+ {"MALTA", "MLT"},
+ {"MAURITANIA", "MRT"},
+ {"MAURITIUS", "MUS"},
+ {"MEXICO", "MEX"},
+ {"MOLDOVA", "MDA"},
+ {"MONTENEGRO", "MNE"},
+ {"MOROCCO", "MAR"},
+ {"MOZAMBIQUE", "MOZ"},
+ {"MYANMAR", "MMR"},
+ {"NAMIBIA", "NAM"},
+ {"NEPAL", "NPL"},
+ {"NEW ZEALAND", "NZL"},
+ {"NICARAGUA", "NIC"},
+ {"NIGERIA", "NGA"},
+ {"NORWAY", "NOR"},
+ {"OMAN", "OMN"},
+ {"PAKISTAN", "PAK"},
+ {"PANAMA", "PAN"},
+ {"PARAGUAY", "PYG"},
+ {"PERU", "PER"},
+ {"PHILIPPINES", "PHL"},
+ {"POLAND", "POL"},
+ {"PORTUGAL", "PRT"},
+ {"PUERTO RICO", "PRI"},
+ {"QATAR", "QAT"},
+ {"ROMANIA", "ROM"},
+ {"RUSSIA", "RUS"},
+ {"SAINT KITTS AND NEVIS", "KNA"},
+ {"SAINT LUCIA", "LCA"},
+ {"SAUDI ARABIA", "SAU"},
+ {"SENEGAL", "SEN"},
+ {"SERBIA", "SRB"},
+ {"SIERRA LEONE", "SLE"},
+ {"SINGAPORE", "SGP"},
+ {"SLOVAKIA", "SVK"},
+ {"SLOVENIA", "SVN"},
+ {"SOMALIA", "SOM"},
+ {"SOUTH AFRICA", "ZAF"},
+ {"SOUTH SUDAN", "SSD"},
+ {"SPAIN", "ESP"},
+ {"SRI LANKA", "LKA"},
+ {"SUDAN", "SDN"},
+ {"SURINAME", "SUR"},
+ {"SWAZILAND", "SWZ"},
+ {"SWEDEN", "SWE"},
+ {"SWITZERLAND", "CHE"},
+ {"SYRIA", "SYR"},
+ {"TAIWAN", "TWN"},
+ {"TANZANIA", "TZA"},
+ {"THAILAND", "THA"},
+ {"THE NETHERLANDS", "NLD"},
+ {"TRINIDAD AND TOBAGO", "TTO"},
+ {"TUNISIA", "TUN"},
+ {"TURKEY", "TUR"},
+ {"TURKMENISTAN", "TKM"},
+ {"UGANDA", "UGA"},
+ {"UKRAINE", "UKR"},
+ {"UNITED ARAB EMIRATES", "ARE"},
+ {"UNITED KINGDOM", "GBR"},
+ {"URUGUAY", "URY"},
+ {"UZBEKISTAN", "UZB"},
+ {"VENEZUELA", "VEN"},
+ {"VIETNAM", "VNM"},
+ {"YEMEN", "YEM"},
+ {"ZAMBIA", "ZMB"},
+ {"ZIMBABWE", "ZWE"},
+ {"CIS", "RUS"},
+ {"CZECHOSLOVAKIA", "CZE"},
+ {"MACEDONIA", "MKD"},
+ {"SERBIA AND MONTENEGRO", "SCG"},
+};
+
+constexpr NameMapping UTL_GDK_TERRITORY_ISO_A3_TO_ORACLE_MAPPINGS[] = {
+ {"ABW", "ARUBA"},
+ {"AFG", "AFGHANISTAN"},
+ {"AGO", "ANGOLA"},
+ {"ALB", "ALBANIA"},
+ {"ARE", "UNITED ARAB EMIRATES"},
+ {"ARG", "ARGENTINA"},
+ {"ARM", "ARMENIA"},
+ {"ATG", "ANTIGUA AND BARBUDA"},
+ {"AUS", "AUSTRALIA"},
+ {"AUT", "AUSTRIA"},
+ {"BEL", "BELGIUM"},
+ {"BGD", "BANGLADESH"},
+ {"BGR", "BULGARIA"},
+ {"BHR", "BAHRAIN"},
+ {"BHS", "BAHAMAS"},
+ {"BIH", "BOSNIA AND HERZEGOVINA"},
+ {"BLR", "BELARUS"},
+ {"BMU", "BERMUDA"},
+ {"BOB", "BOLIVIA"},
+ {"BRA", "BRAZIL"},
+ {"BRB", "BARBADOS"},
+ {"BWA", "BOTSWANA"},
+ {"BZD", "BELIZE"},
+ {"CAN", "CANADA"},
+ {"CHE", "SWITZERLAND"},
+ {"CHL", "CHILE"},
+ {"CHN", "CHINA"},
+ {"CIV", "IVORY COAST"},
+ {"CMR", "CAMEROON"},
+ {"COD", "CONGO KINSHASA"},
+ {"COG", "CONGO BRAZZAVILLE"},
+ {"COL", "COLOMBIA"},
+ {"CRI", "COSTA RICA"},
+ {"CUW", "CURACAO"},
+ {"CYM", "CAYMAN ISLANDS"},
+ {"CYP", "CYPRUS"},
+ {"CZE", "CZECH REPUBLIC"},
+ {"DEU", "GERMANY"},
+ {"DJI", "DJIBOUTI"},
+ {"DMA", "DOMINICA"},
+ {"DNK", "DENMARK"},
+ {"DOM", "DOMINICAN REPUBLIC"},
+ {"DZA", "ALGERIA"},
+ {"ECU", "ECUADOR"},
+ {"EGY", "EGYPT"},
+ {"ESP", "SPAIN"},
+ {"EST", "ESTONIA"},
+ {"ETH", "ETHIOPIA"},
+ {"FIN", "FINLAND"},
+ {"FRA", "FRANCE"},
+ {"GAB", "GABON"},
+ {"GBR", "UNITED KINGDOM"},
+ {"GEO", "GEORGIA"},
+ {"GHA", "GHANA"},
+ {"GRC", "GREECE"},
+ {"GRD", "GRENADA"},
+ {"GTM", "GUATEMALA"},
+ {"GUY", "GUYANA"},
+ {"HKG", "HONG KONG"},
+ {"HND", "HONDURAS"},
+ {"HRV", "CROATIA"},
+ {"HTI", "HAITI"},
+ {"HUN", "HUNGARY"},
+ {"IDN", "INDONESIA"},
+ {"IND", "INDIA"},
+ {"IRL", "IRELAND"},
+ {"IRN", "IRAN"},
+ {"IRQ", "IRAQ"},
+ {"ISL", "ICELAND"},
+ {"ISR", "ISRAEL"},
+ {"ITA", "ITALY"},
+ {"JAM", "JAMAICA"},
+ {"JOR", "JORDAN"},
+ {"JPN", "JAPAN"},
+ {"KAZ", "KAZAKHSTAN"},
+ {"KEN", "KENYA"},
+ {"KGZ", "KYRGYZSTAN"},
+ {"KHM", "CAMBODIA"},
+ {"KNA", "SAINT KITTS AND NEVIS"},
+ {"KOR", "KOREA"},
+ {"KWT", "KUWAIT"},
+ {"LAO", "LAOS"},
+ {"LBN", "LEBANON"},
+ {"LBY", "LIBYA"},
+ {"LCA", "SAINT LUCIA"},
+ {"LIE", "LIECHTENSTEIN"},
+ {"LKA", "SRI LANKA"},
+ {"LTU", "LITHUANIA"},
+ {"LUX", "LUXEMBOURG"},
+ {"LVA", "LATVIA"},
+ {"MAC", "MACAO"},
+ {"MAR", "MOROCCO"},
+ {"MDA", "MOLDOVA"},
+ {"MDV", "MALDIVES"},
+ {"MEX", "MEXICO"},
+ {"MKD", "FYR MACEDONIA"},
+ {"MLT", "MALTA"},
+ {"MMR", "MYANMAR"},
+ {"MNE", "MONTENEGRO"},
+ {"MOZ", "MOZAMBIQUE"},
+ {"MRT", "MAURITANIA"},
+ {"MUS", "MAURITIUS"},
+ {"MWI", "MALAWI"},
+ {"MYS", "MALAYSIA"},
+ {"NAM", "NAMIBIA"},
+ {"NGA", "NIGERIA"},
+ {"NIC", "NICARAGUA"},
+ {"NLD", "THE NETHERLANDS"},
+ {"NOR", "NORWAY"},
+ {"NPL", "NEPAL"},
+ {"NZL", "NEW ZEALAND"},
+ {"OMN", "OMAN"},
+ {"PAK", "PAKISTAN"},
+ {"PAN", "PANAMA"},
+ {"PER", "PERU"},
+ {"PHL", "PHILIPPINES"},
+ {"POL", "POLAND"},
+ {"PRI", "PUERTO RICO"},
+ {"PRT", "PORTUGAL"},
+ {"PYG", "PARAGUAY"},
+ {"QAT", "QATAR"},
+ {"ROM", "ROMANIA"},
+ {"RUS", "RUSSIA"},
+ {"SAU", "SAUDI ARABIA"},
+ {"SCG", "SERBIA AND MONTENEGRO"},
+ {"SDN", "SUDAN"},
+ {"SEN", "SENEGAL"},
+ {"SGP", "SINGAPORE"},
+ {"SLE", "SIERRA LEONE"},
+ {"SLV", "EL SALVADOR"},
+ {"SOM", "SOMALIA"},
+ {"SRB", "SERBIA"},
+ {"SSD", "SOUTH SUDAN"},
+ {"SUR", "SURINAME"},
+ {"SVK", "SLOVAKIA"},
+ {"SVN", "SLOVENIA"},
+ {"SWE", "SWEDEN"},
+ {"SWZ", "SWAZILAND"},
+ {"SYR", "SYRIA"},
+ {"THA", "THAILAND"},
+ {"TKM", "TURKMENISTAN"},
+ {"TTO", "TRINIDAD AND TOBAGO"},
+ {"TUN", "TUNISIA"},
+ {"TUR", "TURKEY"},
+ {"TWN", "TAIWAN"},
+ {"TZA", "TANZANIA"},
+ {"UGA", "UGANDA"},
+ {"UKR", "UKRAINE"},
+ {"URY", "URUGUAY"},
+ {"USA", "AMERICA"},
+ {"UZB", "UZBEKISTAN"},
+ {"VEN", "VENEZUELA"},
+ {"VNM", "VIETNAM"},
+ {"YEM", "YEMEN"},
+ {"ZAF", "SOUTH AFRICA"},
+ {"ZMB", "ZAMBIA"},
+ {"ZWE", "ZIMBABWE"},
+};
+
+inline bool
+utl_gdk_is_empty_cstring(const char* const value)
+{
+ return value[0] == '\0';
+}
+
+const char*
+utl_gdk_find_name_mapping(const char* const source, const NameMapping* const mappings,
+ const size_t mappings_count)
+{
+ for (size_t i = 0; i < mappings_count; ++i)
+ {
+ if (pg_strcasecmp(source, mappings[i].source_name) == 0)
+ {
+ return mappings[i].mapped_name;
+ }
+ }
+
+ return nullptr;
+}
+
+template <size_t mappings_count>
+inline const char*
+utl_gdk_find_name_mapping(const char* const source,
+ const NameMapping (&mappings)[mappings_count])
+{
+ return utl_gdk_find_name_mapping(source, mappings, mappings_count);
+}
+
+const char*
+utl_gdk_find_charset_mapping(const char* const charset, const int32 direction)
+{
+ if (direction == UTL_GDK_ORACLE_TO_IANA)
+ {
+ return utl_gdk_find_name_mapping(charset,
+ UTL_GDK_CHARSET_ORACLE_TO_IANA_MAPPINGS);
+ }
+
+ if (direction == UTL_GDK_IANA_TO_ORACLE)
+ {
+ return utl_gdk_find_name_mapping(charset,
+ UTL_GDK_CHARSET_IANA_TO_ORACLE_MAPPINGS);
+ }
+
+ return nullptr;
+}
+
+const char*
+utl_gdk_find_language_mapping(const char* const language, const int32 direction)
+{
+ if (direction == UTL_GDK_ORACLE_TO_ISO)
+ {
+ return utl_gdk_find_name_mapping(language,
+ UTL_GDK_LANGUAGE_ORACLE_TO_ISO_MAPPINGS);
+ }
+
+ if (direction == UTL_GDK_ISO_TO_ORACLE)
+ {
+ return utl_gdk_find_name_mapping(language,
+ UTL_GDK_LANGUAGE_ISO_TO_ORACLE_MAPPINGS);
+ }
+
+ return nullptr;
+}
+
+const char*
+utl_gdk_find_territory_mapping(const char* const territory, const int32 direction)
+{
+ if (direction == UTL_GDK_ORACLE_TO_ISO)
+ {
+ return utl_gdk_find_name_mapping(territory,
+ UTL_GDK_TERRITORY_ORACLE_TO_ISO_A2_MAPPINGS);
+ }
+
+ if (direction == UTL_GDK_ISO_TO_ORACLE)
+ {
+ return utl_gdk_find_name_mapping(territory,
+ UTL_GDK_TERRITORY_ISO_A2_TO_ORACLE_MAPPINGS);
+ }
+
+ if (direction == UTL_GDK_ORACLE_TO_ISO_A3)
+ {
+ return utl_gdk_find_name_mapping(territory,
+ UTL_GDK_TERRITORY_ORACLE_TO_ISO_A3_MAPPINGS);
+ }
+
+ if (direction == UTL_GDK_ISO_A3_TO_ORACLE)
+ {
+ return utl_gdk_find_name_mapping(territory,
+ UTL_GDK_TERRITORY_ISO_A3_TO_ORACLE_MAPPINGS);
+ }
+
+ return nullptr;
+}
+
+Datum
+utl_gdk_charset_map_impl(FunctionCallInfo fcinfo, const int32 direction)
+{
+ char* const charset = text_to_cstring(PG_GETARG_TEXT_PP(0));
+
+ if (utl_gdk_is_empty_cstring(charset))
+ {
+ pfree(charset);
+ PG_RETURN_NULL();
+ }
+
+ const char* const mapped_charset = utl_gdk_find_charset_mapping(charset, direction);
+ pfree(charset);
+
+ if (mapped_charset == nullptr)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_TEXT_P(cstring_to_text(mapped_charset));
+}
+
+Datum
+utl_gdk_language_map_impl(FunctionCallInfo fcinfo, const int32 direction)
+{
+ char* const language = text_to_cstring(PG_GETARG_TEXT_PP(0));
+
+ if (utl_gdk_is_empty_cstring(language))
+ {
+ pfree(language);
+ PG_RETURN_NULL();
+ }
+
+ const char* const mapped_language = utl_gdk_find_language_mapping(language, direction);
+ pfree(language);
+
+ if (mapped_language == nullptr)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_TEXT_P(cstring_to_text(mapped_language));
+}
+
+Datum
+utl_gdk_territory_map_impl(FunctionCallInfo fcinfo, const int32 direction)
+{
+ char* const territory = text_to_cstring(PG_GETARG_TEXT_PP(0));
+
+ if (utl_gdk_is_empty_cstring(territory))
+ {
+ pfree(territory);
+ PG_RETURN_NULL();
+ }
+
+ const char* const mapped_territory = utl_gdk_find_territory_mapping(territory, direction);
+ pfree(territory);
+
+ if (mapped_territory == nullptr)
+ {
+ PG_RETURN_NULL();
+ }
+
+ PG_RETURN_TEXT_P(cstring_to_text(mapped_territory));
+}
+} // namespace
+
+/*
+ * @qdb_func: utl_gdk_charset_map(text) returns text
+ * @ora_func: UTL_GDK.CHARSET_MAP(VARCHAR2)
+ */
+extern "C" Datum
+utl_gdk_charset_map0(PG_FUNCTION_ARGS)
+{
+ return DirectFunctionCall1(utl_gdk_oracle_charset_to_iana, PG_GETARG_DATUM(0));
+}
+
+/*
+ * @qdb_func: utl_gdk_charset_map(text, int4) returns text
+ * @ora_func: UTL_GDK.CHARSET_MAP(VARCHAR2, BINARY_INTEGER)
+ */
+extern "C" Datum
+utl_gdk_charset_map1(PG_FUNCTION_ARGS)
+{
+ const int32 direction = PG_GETARG_INT32(1);
+
+ return utl_gdk_charset_map_impl(fcinfo, direction);
+}
+
+/*
+ * @qdb_func: utl_gdk_oracle_charset_to_iana(text) returns text
+ */
+extern "C" Datum
+utl_gdk_oracle_charset_to_iana(PG_FUNCTION_ARGS)
+{
+ return utl_gdk_charset_map_impl(fcinfo, UTL_GDK_ORACLE_TO_IANA);
+}
+
+/*
+ * @qdb_func: utl_gdk_language_map(text) returns text
+ * @ora_func: UTL_GDK.LANGUAGE_MAP(VARCHAR2)
+ */
+extern "C" Datum
+utl_gdk_language_map0(PG_FUNCTION_ARGS)
+{
+ return utl_gdk_language_map_impl(fcinfo, UTL_GDK_ORACLE_TO_ISO);
+}
+
+/*
+ * @qdb_func: utl_gdk_language_map(text, int4) returns text
+ * @ora_func: UTL_GDK.LANGUAGE_MAP(VARCHAR2, BINARY_INTEGER)
+ */
+extern "C" Datum
+utl_gdk_language_map1(PG_FUNCTION_ARGS)
+{
+ const int32 direction = PG_GETARG_INT32(1);
+
+ return utl_gdk_language_map_impl(fcinfo, direction);
+}
+
+/*
+ * @qdb_func: utl_gdk_territory_map(text) returns text
+ * @ora_func: UTL_GDK.TERRITORY_MAP(VARCHAR2)
+ */
+extern "C" Datum
+utl_gdk_territory_map0(PG_FUNCTION_ARGS)
+{
+ return utl_gdk_territory_map_impl(fcinfo, UTL_GDK_ORACLE_TO_ISO);
+}
+
+/*
+ * @qdb_func: utl_gdk_territory_map(text, int4) returns text
+ * @ora_func: UTL_GDK.TERRITORY_MAP(VARCHAR2, BINARY_INTEGER)
+ */
+extern "C" Datum
+utl_gdk_territory_map1(PG_FUNCTION_ARGS)
+{
+ const int32 direction = PG_GETARG_INT32(1);
+
+ return utl_gdk_territory_map_impl(fcinfo, direction);
+}
+
+extern "C" Datum
+utl_gdk_get_version(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_TEXT_P(cstring_to_text(RUDB_UTL_GDK_VERSION));
+}
diff --git a/src/backend/utils/dbms/utl_gdk/utl_gdk.hpp b/src/backend/utils/dbms/utl_gdk/utl_gdk.hpp
new file mode 100644
index 0000000..8bdea8c
--- /dev/null
+++ b/src/backend/utils/dbms/utl_gdk/utl_gdk.hpp
@@ -0,0 +1,107 @@
+#ifndef UTL_GDK_HPP
+#define UTL_GDK_HPP
+
+extern "C" {
+#include "postgres.h"
+#include "fmgr.h"
+}
+
+/**
+ * @brief Oracle-совместимые функции пакета UTL_GDK.
+ * @details Пакет предоставляет отображения между внутренними NLS-именами Oracle
+ * и внешними стандартными обозначениями кодировок, языков и территорий.
+ * Реализация использует статические таблицы соответствий, полученные
+ * из Oracle Database 23ai Free 23.5.0.24.07, поэтому функции не читают
+ * внешние файлы во время выполнения и остаются immutable.
+ */
+extern "C" {
+ /**
+ * @brief Отображает имя кодировки Oracle в IANA-имя кодировки.
+ * @details Публичная SQL-функция @c utl_gdk_charset_map(text). Использует
+ * направление по умолчанию @c ORACLE_TO_IANA: Oracle charset -> IANA.
+ * Пустая строка и неизвестная кодировка возвращают SQL NULL.
+ * @return text с IANA-именем кодировки либо SQL NULL.
+ */
+ Datum utl_gdk_charset_map0(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Отображает имя кодировки в заданном направлении Oracle/IANA.
+ * @details Публичная SQL-функция @c utl_gdk_charset_map(text,int4).
+ * Поддерживаемые значения @c flag:
+ * - 1: Oracle charset -> IANA charset;
+ * - 2: IANA charset -> Oracle charset.
+ * Неподдерживаемый flag, пустая строка и неизвестная кодировка
+ * возвращают SQL NULL.
+ * @return text с найденным именем кодировки либо SQL NULL.
+ */
+ Datum utl_gdk_charset_map1(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Возвращает IANA-имя кодировки для Oracle-имени набора символов.
+ * @details Пустая строка, `NULL` и неизвестная кодировка возвращают SQL `NULL`.
+ * Примеры:
+ * SELECT utl_gdk_oracle_charset_to_iana('AL32UTF8');
+ * SELECT utl_gdk_oracle_charset_to_iana('JA16SJIS');
+ * SELECT utl_gdk_oracle_charset_to_iana('UNKNOWN_CHARSET');
+ * @param oracle_charset Oracle-имя набора символов.
+ * @return IANA-имя кодировки либо SQL `NULL`.
+ */
+ Datum utl_gdk_oracle_charset_to_iana(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Отображает имя языка Oracle в ISO-код языка.
+ * @details Публичная SQL-функция @c utl_gdk_language_map(text). Использует
+ * направление по умолчанию @c ORACLE_TO_ISO: Oracle language -> ISO.
+ * Пустая строка и неизвестный язык возвращают SQL NULL.
+ * @return text с ISO-кодом языка либо SQL NULL.
+ */
+ Datum utl_gdk_language_map0(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Отображает имя языка в заданном направлении Oracle/ISO.
+ * @details Публичная SQL-функция @c utl_gdk_language_map(text,int4).
+ * Поддерживаемые значения @c flag:
+ * - 3: Oracle language -> ISO language;
+ * - 4: ISO language -> Oracle language.
+ * Неподдерживаемый flag, пустая строка и неизвестный язык
+ * возвращают SQL NULL.
+ * @return text с найденным именем языка либо SQL NULL.
+ */
+ Datum utl_gdk_language_map1(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Отображает имя территории Oracle в ISO 3166-1 alpha-2.
+ * @details Публичная SQL-функция @c utl_gdk_territory_map(text). Использует
+ * направление по умолчанию @c ORACLE_TO_ISO: Oracle territory ->
+ * ISO alpha-2. Пустая строка и неизвестная территория возвращают
+ * SQL NULL.
+ * @return text с ISO alpha-2 кодом территории либо SQL NULL.
+ */
+ Datum utl_gdk_territory_map0(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Отображает имя территории в заданном направлении Oracle/ISO.
+ * @details Публичная SQL-функция @c utl_gdk_territory_map(text,int4).
+ * Поддерживаемые значения @c flag:
+ * - 3: Oracle territory -> ISO alpha-2;
+ * - 4: ISO alpha-2 -> Oracle territory;
+ * - 5: Oracle territory -> ISO alpha-3;
+ * - 6: ISO alpha-3 -> Oracle territory.
+ * Неподдерживаемый flag, пустая строка и неизвестная территория
+ * возвращают SQL NULL.
+ * @return text с найденным именем/кодом территории либо SQL NULL.
+ */
+ Datum utl_gdk_territory_map1(PG_FUNCTION_ARGS);
+
+ /**
+ * @brief Возвращает версию пакета UTL_GDK.
+ * @details Возвращает строку версии реализации RUDB для SQL-visible API пакета.
+ * Примеры:
+ * SELECT UTL_GDK.GET_VERSION() FROM dual;
+ * SELECT utl_gdk_get_version();
+ * @return text с версией пакета.
+ */
+ Datum utl_gdk_get_version(PG_FUNCTION_ARGS);
+}
+
+#endif // UTL_GDK_HPP
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index d992da4..982d69b 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -605,6 +605,7 @@
static int server_version_num;
static char *debug_io_direct_string;
static char *restrict_nonsystem_relation_kind_string;
+static char *dbms_tns_tns_admin;
#ifdef HAVE_SYSLOG
#define DEFAULT_SYSLOG_FACILITY LOG_LOCAL0
@@ -4765,6 +4766,17 @@
},
{
+ {"dbms_tns.tns_admin", PGC_SUSET, FILE_LOCATIONS,
+ gettext_noop("Sets the DBMS_TNS configuration directory."),
+ NULL,
+ GUC_SUPERUSER_ONLY
+ },
+ &dbms_tns_tns_admin,
+ NULL,
+ NULL, NULL, NULL
+ },
+
+ {
{"ssl_library", PGC_INTERNAL, PRESET_OPTIONS,
gettext_noop("Shows the name of the SSL library."),
NULL,
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index 6e66ad8..fe1dbc0 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -301,11 +301,6 @@
{
char *endptr;
unsigned long optval;
- if (!optarg)
- {
- pg_log_error_hint("optarg unexpectedly NULL");
- exit(1);
- }
switch (c)
{
@@ -410,6 +405,8 @@
break;
case 7:
errno = 0;
+ if (optarg == NULL)
+ pg_fatal("invalid start block");
optval = strtoul(optarg, &endptr, 10);
if (endptr == optarg || *endptr != '\0' || errno != 0)
pg_fatal("invalid start block");
@@ -419,6 +416,8 @@
break;
case 8:
errno = 0;
+ if (optarg == NULL)
+ pg_fatal("invalid end block");
optval = strtoul(optarg, &endptr, 10);
if (endptr == optarg || *endptr != '\0' || errno != 0)
pg_fatal("invalid end block");
diff --git a/src/common/coder.cpp b/src/common/coder.cpp
new file mode 100644
index 0000000..b643cab
--- /dev/null
+++ b/src/common/coder.cpp
@@ -0,0 +1,321 @@
+#include "coder.hpp"
+
+namespace Coder {
+ typedef uint8_t vect[4];
+
+ thread_local uint8_t key[32] =
+ {
+ 0xff, 0xee, 0xdd, 0xcc,
+ 0xbb, 0xaa, 0x99, 0x88,
+ 0x77, 0x66, 0x55, 0x44,
+ 0x33, 0x22, 0x11, 0x00,
+ 0xf0, 0xf1, 0xf2, 0xf3,
+ 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9, 0xfa, 0xfb,
+ 0xfc, 0xfd, 0xfe, 0xff
+ }; //Ключ шифрования
+
+ thread_local unsigned char Pi[8][16]=
+ {
+ {1,7,14,13,0,5,8,3,4,15,10,6,9,12,11,2},
+ {8,14,2,5,6,9,1,12,15,4,11,0,13,10,3,7},
+ {5,13,15,6,9,2,12,10,11,7,8,1,4,3,14,0},
+ {7,15,5,10,8,1,6,13,0,9,3,14,11,4,2,12},
+ {12,8,2,1,13,4,15,6,7,0,10,5,3,14,9,11},
+ {11,3,5,8,2,15,10,13,14,1,7,4,12,9,6,0},
+ {6,8,2,3,9,10,5,12,1,14,4,7,11,13,0,15},
+ {12,4,6,2,10,5,11,9,14,8,13,7,0,3,15,1}
+ }; //Таблица подстановок
+
+
+ void Transform_T(const uint8_t *in_data, uint8_t *out_data)
+ {
+ uint8_t first_part_byte, sec_part_byte;
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ // Извлекаем первую 4-битную часть байта
+ first_part_byte = (in_data[i] & 0xf0) >> 4;
+ // Извлекаем вторую 4-битную часть байта
+ sec_part_byte = (in_data[i] & 0x0f);
+ // Выполняем замену в соответствии с таблицей подстановок
+ first_part_byte = Pi[i * 2][first_part_byte];
+ sec_part_byte = Pi[i * 2 + 1][sec_part_byte];
+ // «Склеиваем» обе 4-битные части обратно в байт
+ out_data[i] = (first_part_byte << 4) | sec_part_byte;
+ }
+ }
+
+ //Сложение двух двоичных векторов по модулю 2
+ void Sum_ABS_2(const uint8_t *a, const uint8_t *b, uint8_t *c)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ c[i] = a[i]^b[i];
+ }
+
+ //Сложение двух двоичных векторов по модулю 32
+ void Sum_ABS_32(const uint8_t *a, const uint8_t *b, uint8_t *c)
+ {
+ int i;
+ unsigned int internal = 0;
+ for (i = 3; i >= 0; i--)
+ {
+ internal = a[i] + b[i] + (internal >> 8);
+ c[i] = internal & 0xff;
+ }
+ }
+
+ //Развертывание ключа
+ void Expand_Key(vect* iter_key)
+ {
+ for(uint8_t i=0; i<8; i++) {
+ memcpy(iter_key[i], key + 4*i, 4);
+ memcpy(iter_key[i+8], key + 4*i, 4);
+ memcpy(iter_key[i+16], key + 4*i, 4);
+ memcpy(iter_key[i+24], key + 4*(7-i), 4);
+ }
+ }
+
+ void Transform_g(const uint8_t *k, const uint8_t *a, uint8_t *out_data)
+ {
+ uint8_t internal[4];
+ uint32_t out_data_32;
+ // Складываем по модулю 32 правую половину блока с итерационным ключом
+ Sum_ABS_32(a, k, internal);
+ // Производим нелинейное биективное преобразование результата
+ Transform_T(internal, internal);
+ // Преобразовываем четырехбайтный вектор в одно 32-битное число
+ out_data_32 = internal[0];
+ out_data_32 = (out_data_32 << 8) + internal[1];
+ out_data_32 = (out_data_32 << 8) + internal[2];
+ out_data_32 = (out_data_32 << 8) + internal[3];
+ // Циклически сдвигаем все влево на 11 разрядов
+ out_data_32 = (out_data_32 << 11)|(out_data_32 >> 21);
+ // Преобразовываем 32-битный результат сдвига обратно в 4-байтовый вектор
+ out_data[3] = out_data_32;
+ out_data[2] = out_data_32 >> 8;
+ out_data[1] = out_data_32 >> 16;
+ out_data[0] = out_data_32 >> 24;
+ }
+
+ void Transform_G(const uint8_t *k, const uint8_t *a, uint8_t *out_data)
+ {
+ uint8_t a_0[4]; // Правая половина блока
+ uint8_t a_1[4]; // Левая половина блока
+ uint8_t G[4];
+
+ int i;
+ // Делим 64-битный исходный блок на две части
+ for(i = 0; i < 4; i++)
+ {
+ a_0[i] = a[4 + i];
+ a_1[i] = a[i];
+ }
+
+ // Производим преобразование g
+ Transform_g(k, a_0, G);
+ // Ксорим результат преобразования g с левой половиной блока
+ Sum_ABS_2(a_1, G, G);
+
+ for(i = 0; i < 4; i++)
+ {
+ a_1[i] = a_0[i];
+ a_0[i] = G[i];
+ }
+
+ // Сводим правую и левую части блока в одно целое
+ for(i = 0; i < 4; i++)
+ {
+ out_data[i] = a_1[i];
+ out_data[4 + i] = a_0[i];
+ }
+ }
+
+ void Transform_G_Fin(const uint8_t *k, const uint8_t *a, uint8_t *out_data)
+ {
+ uint8_t a_0[4]; // Правая половина блока
+ uint8_t a_1[4]; // Левая половина блока
+ uint8_t G[4];
+
+ int i;
+ // Делим 64-битный исходный блок на две части
+ for(i = 0; i < 4; i++)
+ {
+ a_0[i] = a[4 + i];
+ a_1[i] = a[i];
+ }
+
+ // Производим преобразование g
+ Transform_g(k, a_0, G);
+ // Ксорим результат преобразования g с левой половиной блока
+ Sum_ABS_2(a_1, G, G);
+
+ for(i = 0; i < 4; i++)
+ a_1[i] = G[i];
+
+ for(i = 0; i < 4; i++)
+ {
+ out_data[i] = a_1[i];
+ out_data[4 + i] = a_0[i];
+ }
+ }
+
+ void Encrypt(const uint8_t *blk, uint8_t *out_blk, vect* iter_key)
+ {
+ int i;
+ Transform_G(iter_key[0], blk, out_blk);
+ for(i = 1; i < 31; i++)
+ Transform_G(iter_key[i], out_blk, out_blk);
+ Transform_G_Fin(iter_key[31], out_blk, out_blk);
+ }
+
+ void Decrypt(const uint8_t *blk, uint8_t *out_blk, vect* iter_key)
+ {
+ int i;
+ Transform_G(iter_key[31], blk, out_blk);
+ for(i = 30; i > 0; i--)
+ Transform_G(iter_key[i], out_blk, out_blk);
+ Transform_G_Fin(iter_key[0], out_blk, out_blk);
+ }
+
+ std::string Encode(std::string str) {
+ vect iter_key[32];
+ Expand_Key(iter_key);
+ size_t i = 0;
+ while(i + 7 < str.length()) {
+ uint8_t block[8];
+ for(size_t j = 0; j < 8; j++) {
+ block[j] = static_cast<uint8_t>(str[i+j]);
+ }
+ Encrypt(block, block, iter_key);
+ for(size_t j = 0; j < 8; j++) {
+ str[i+j] = static_cast<char>(block[j]);
+ }
+ i = i + 8;
+ }
+ if(i < str.length()) {
+ uint8_t block[8];
+ size_t j = 0;
+ while(j + i < str.length()) {
+ block[j] = static_cast<uint8_t>(str[i+j]);
+ j++;
+ }
+ while(j < 8) {
+ block[j] = static_cast<uint8_t>(' ');
+ j++;
+ }
+ Encrypt(block, block, iter_key);
+ str.resize(i+8);
+ for(size_t j = 0; j < 8; j++) {
+ str[i+j] = static_cast<char>(block[j]);
+ }
+ }
+ return str;
+ }
+
+ uint8_t CharToUint8_t(char& ch) {
+ if((ch>='0')&&(ch<='9')) {
+ return static_cast<uint8_t>(ch - '0');
+ } else {
+ return static_cast<uint8_t>(10 + ch - 'a');
+ }
+ }
+
+ std::string HexToStr(std::string& hexstr) {
+ std::string str(hexstr.length()/2, ' ');
+ size_t j=0;
+ for(size_t i=0; i<hexstr.length(); i=i+2){
+ uint8_t ch1, ch2;
+ ch1 = 16*CharToUint8_t(hexstr[i]);
+ ch2 = CharToUint8_t(hexstr[i+1]);
+ str[j++] = static_cast<char>(ch1 + ch2);
+ }
+ return str;
+ }
+
+ std::string Decode(std::string str) {
+ vect iter_key[32];
+ Expand_Key(iter_key);
+ size_t i = 0;
+ while(i + 7 < str.length()) {
+ uint8_t block[8];
+ for(size_t j = 0; j < 8; j++) {
+ block[j] = static_cast<uint8_t>(str[i+j]);
+ }
+ Decrypt(block, block, iter_key);
+ for(size_t j = 0; j < 8; j++) {
+ str[i+j] = static_cast<char>(block[j]);
+ }
+ i = i + 8;
+ }
+ if(i > 0){
+ while(str[--i] == ' ') {}
+ str.resize(++i);
+ }
+ return str;
+ }
+
+ bool CheckHex(const std::string& str) {
+ if(str.length()%16!=0) {
+ return false;
+ } else {
+ for(char ch : str) {
+ if(!(((ch>='0')&&(ch<='9'))||((ch>='a')&&(ch<='f'))))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ std::string str_to_hex(const unsigned char* data, size_t length) {
+ std::ostringstream oss;
+ for (size_t i = 0; i < length; ++i) {
+ oss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(data[i]);
+ }
+ return oss.str();
+ }
+
+ std::string hex_to_str(const std::string& hex) {
+ std::vector<unsigned char> bytes;
+ size_t length = hex.length();
+
+ // Проверяем, что длина строки четная
+ if (length % 2 != 0) {
+ throw std::invalid_argument("Hex string must have an even length");
+ }
+
+ for (size_t i = 0; i < length; i += 2) {
+ std::string byteString = hex.substr(i, 2);
+ unsigned char byte = static_cast<unsigned char>(std::stoi(byteString, nullptr, 16));
+ bytes.push_back(byte);
+ }
+
+ std::ostringstream result;
+ for (const auto& b : bytes) {
+ result << b;
+ }
+
+ return result.str();
+ }
+
+ std::string decode_pwd(std::string pwd)
+ {
+ if (pwd.rfind(HASH_KWD) != 0)
+ return pwd;
+
+ pwd = pwd.substr(strlen(HASH_KWD));
+ pwd = Decode(hex_to_str(pwd)).substr(strlen(pPASSWORDSALT));
+ return pwd;
+ }
+
+ std::string encode_pwd(std::string pwd)
+ {
+ if (pwd.rfind(HASH_KWD) == 0)
+ return pwd;
+
+ auto hased_pwd = Encode(pPASSWORDSALT + pwd);
+ pwd = HASH_KWD + str_to_hex(reinterpret_cast<const unsigned char*>(hased_pwd.c_str()), hased_pwd.size());
+ return pwd;
+ }
+}
\ No newline at end of file
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index bea73cd..65a7e30 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -1,3 +1,4 @@
+
#----------------------------------------------------------------------
#
# pg_proc.dat
@@ -18376,7 +18377,7 @@
proisstrict => 'f'
}
,
- {
+{
oid => '11036',
descr => 'Извлекает сообщение из указанной очереди с полезной нагрузкой в формате OPAQUE/XMLTYPE.',
proname => 'dbms_aq_dequeue',
@@ -18388,8 +18389,481 @@
proargnames => '{queue_name,dequeue_options,message_properties,payload,msgid}',
prosrc => 'dbms_aq_dequeue_ovr1',
proisstrict => 'f'
- }
+}
,
+# BEGIN QDB_DBMS_GEN dbms_tns_internal
+{
+ oid => '11745',
+ descr => 'Разрешает TNS-имя в строковое представление подключения.',
+ proname => 'dbms_tns_resolve_tnsname',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'text',
+ prosrc => 'dbms_tns_resolve_tnsname',
+ proisstrict => 'f'
+},
+{
+ oid => '14775',
+ descr => 'Проверяет доступность конфигурации tnsnames.ora для разрешения TNS-имён.',
+ proname => 'dbms_tns_has_tnsnames_config',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_tns_has_tnsnames_config',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN dbms_tns_internal
+# BEGIN QDB_DBMS_GEN dbms_json_internal
+{
+ oid => '11817',
+ descr => 'Возвращает DDL представления по data guide без фактического создания view.',
+ proname => 'dbms_json_build_dataguide',
+ provolatile => 'v',
+ prorettype => 'jsonb',
+ proargtypes => 'jsonb',
+ proargnames => '{json_data}',
+ prosrc => 'dbms_json_build_dataguide',
+ proisstrict => 'f'
+},
+{
+ oid => '11818',
+ descr => 'Возвращает data guide для JSON-колонки в упрощенном PostgreSQL-варианте.',
+ proname => 'dbms_json_get_index_dataguide',
+ provolatile => 'v',
+ prorettype => 'clob',
+ proargtypes => 'varchar2 varchar2 int4 int4',
+ proargnames => '{tablename,jcolname,format,pretty}',
+ prosrc => 'dbms_json_get_index_dataguide',
+ proisstrict => 'f'
+},
+{
+ oid => '11819',
+ descr => 'Возвращает DDL представления по data guide без фактического создания view.',
+ proname => 'dbms_json_get_view_sql',
+ provolatile => 'v',
+ prorettype => 'clob',
+ proargtypes => 'varchar2 varchar2 varchar2 jsonb bool int4 varchar2 bool varchar2 bool',
+ proargnames => '{viewname,tablename,jcolname,dataguide,materialize,mvrefreshmode,path,resolvenameconflicts,colnameprefix,mixedcasecolumns}',
+ prosrc => 'dbms_json_get_view_sql',
+ proisstrict => 'f'
+},
+{
+ oid => '11820',
+ descr => 'Добавляет виртуальные колонки по упрощенному data guide.',
+ proname => 'dbms_json_add_virtual_columns',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 jsonb bool varchar2 bool',
+ proargnames => '{tablename,jcolname,dataguide,resolvenameconflicts,colnameprefix,mixedcasecolumns}',
+ prosrc => 'dbms_json_add_virtual_columns',
+ proisstrict => 'f'
+},
+{
+ oid => '11821',
+ descr => 'Создает view или materialized view по упрощенному data guide.',
+ proname => 'dbms_json_create_view',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 jsonb varchar2 bool int4 varchar2 bool varchar2 bool',
+ proargnames => '{viewname,tablename,jcolname,dataguide,resourcepath,materialize,mvrefreshmode,path,resolvenameconflicts,colnameprefix,mixedcasecolumns}',
+ prosrc => 'dbms_json_create_view',
+ proisstrict => 'f'
+},
+{
+ oid => '9974',
+ descr => 'Создает view или materialized view по упрощенному data guide с дополнительным служебным параметром.',
+ proname => 'dbms_json_create_view2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 jsonb varchar2 bool int4 varchar2 bool varchar2 bool int4',
+ proargnames => '{viewname,tablename,jcolname,dataguide,resourcepath,materialize,mvrefreshmode,path,resolvenameconflicts,colnameprefix,mixedcasecolumns,service_arg}',
+ prosrc => 'dbms_json_create_view2',
+ proisstrict => 'f'
+},
+{
+ oid => '11822',
+ descr => 'Удаляет виртуальные колонки в упрощенном PostgreSQL-варианте.',
+ proname => 'dbms_json_drop_virtual_columns',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ proargnames => '{tablename,jcolname}',
+ prosrc => 'dbms_json_drop_virtual_columns',
+ proisstrict => 'f'
+},
+{
+ oid => '11823',
+ descr => 'Проверяет возможность миграции текстового JSON в JSON type в упрощенном PostgreSQL-варианте.',
+ proname => 'dbms_json_json_type_convertible_check',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 bool bool',
+ proargnames => '{owner,tablename,columnname,statustablename,fastcheck,appendstatus}',
+ prosrc => 'dbms_json_json_type_convertible_check',
+ proisstrict => 'f'
+},
+{
+ oid => '11824',
+ descr => 'Сохраняет preferred name для JSON path в упрощенном DBMS_JSON.',
+ proname => 'dbms_json_rename_column',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 int4 varchar2',
+ proargnames => '{tablename,jcolname,path,type,preferred_name}',
+ prosrc => 'dbms_json_rename_column',
+ proisstrict => 'f'
+},
+{
+ oid => '11827',
+ descr => 'Создает view по path, используя упрощенный DBMS_JSON metadata storage.',
+ proname => 'dbms_json_create_view_on_path',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 int4',
+ proargnames => '{viewname,tablename,jcolname,path,frequency}',
+ prosrc => 'dbms_json_create_view_on_path',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN dbms_json_internal
+# BEGIN QDB_DBMS_GEN dbms_json_schema_internal
+{
+ oid => '9975',
+ descr => 'Проверяет корректность JSON Schema с дополнительным служебным параметром.',
+ proname => 'dbms_json_schema_is_schema_valid2',
+ provolatile => 'v',
+ prorettype => 'binary_integer',
+ proargtypes => 'jsonb int4',
+ proargnames => '{json_data,service_arg}',
+ prosrc => 'dbms_json_schema_is_schema_valid2',
+ proisstrict => 'f'
+},
+{
+ oid => '11812',
+ descr => 'Проверяет, является ли JSON Schema валидной.',
+ proname => 'dbms_json_schema_is_schema_valid',
+ provolatile => 'v',
+ prorettype => 'binary_integer',
+ proargtypes => 'jsonb',
+ proargnames => '{json_data}',
+ prosrc => 'dbms_json_schema_is_schema_valid',
+ proisstrict => 'f'
+},
+{
+ oid => '11813',
+ descr => 'Проверяет JSON-данные на соответствие JSON Schema.',
+ proname => 'dbms_json_schema_is_valid',
+ provolatile => 'v',
+ prorettype => 'binary_integer',
+ proargtypes => 'jsonb jsonb binary_integer',
+ proargnames => '{json_data,json_schema,raise_err}',
+ prosrc => 'dbms_json_schema_is_valid',
+ proisstrict => 'f'
+},
+{
+ oid => '11816',
+ descr => 'Возвращает отчёт об ошибках проверки JSON по JSON Schema.',
+ proname => 'dbms_json_schema_validate_report',
+ provolatile => 'v',
+ prorettype => 'clob',
+ proargtypes => 'varchar2 varchar2',
+ proargnames => '{json_data,json_schema}',
+ prosrc => 'dbms_json_schema_validate_report',
+ proisstrict => 'f'
+},
+{
+ oid => '11814',
+ descr => 'Возвращает отчёт об ошибках проверки JSONB по JSONB Schema.',
+ proname => 'dbms_json_schema_validate_report',
+ provolatile => 'v',
+ prorettype => 'clob',
+ proargtypes => 'jsonb jsonb',
+ proargnames => '{json_data,json_schema}',
+ prosrc => 'dbms_json_schema_validate_report',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN dbms_json_schema_internal
+# BEGIN QDB_DBMS_GEN dbms_trace_internal
+{
+ oid => '11763',
+ descr => 'Запускает PLSQL trace в текущей сессии.',
+ proname => 'dbms_trace_set_plsql_trace',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ proargnames => '{trace_level}',
+ prosrc => 'dbms_trace_set_plsql_trace',
+ proisstrict => 'f'
+},
+{
+ oid => '11764',
+ descr => 'Останавливает сбор trace-данных в текущей сессии.',
+ proname => 'dbms_trace_clear_plsql_trace',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_trace_clear_plsql_trace',
+ proisstrict => 'f'
+},
+{
+ oid => '14776',
+ descr => 'Возвращает текущее состояние трассировки для текущей сессии.',
+ proname => 'dbms_trace_is_enabled',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_trace_is_enabled',
+ proisstrict => 'f'
+},
+{
+ oid => '11765',
+ descr => 'Возвращает текущий уровень PLSQL trace.',
+ proname => 'dbms_trace_get_plsql_trace_level',
+ provolatile => 'v',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_trace_get_plsql_trace_level',
+ proisstrict => 'f'
+},
+{
+ oid => '11766',
+ descr => 'Возвращает версию пакета DBMS_TRACE.',
+ proname => 'dbms_trace_plsql_trace_version',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => '',
+ proallargtypes=> '{int4,int4}',
+ proargmodes => '{o,o}',
+ proargnames => '{major,minor}',
+ prosrc => 'dbms_trace_plsql_trace_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11767',
+ descr => 'Возвращает SQL-readable список trace runs.',
+ proname => 'dbms_trace_plsql_trace_runs',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => '',
+ prosrc => 'dbms_trace_plsql_trace_runs',
+ proisstrict => 'f'
+},
+{
+ oid => '11768',
+ descr => 'Возвращает SQL-readable список trace events.',
+ proname => 'dbms_trace_plsql_trace_events',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => '',
+ prosrc => 'dbms_trace_plsql_trace_events',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN dbms_trace_internal
+# BEGIN QDB_DBMS_GEN dbms_db_version_internal
+{
+ oid => '11769',
+ descr => 'Возвращает номер VERSION пакета DBMS_DB_VERSION.',
+ proname => 'dbms_db_version_version',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11770',
+ descr => 'Возвращает номер RELEASE пакета DBMS_DB_VERSION.',
+ proname => 'dbms_db_version_release',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_release',
+ proisstrict => 'f'
+},
+{
+ oid => '14777',
+ descr => 'Проверяет, что compatibility version DBMS_DB_VERSION меньше или равна указанной версии.',
+ proname => 'dbms_db_version_ver_le',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => 'int4 int4',
+ prosrc => 'dbms_db_version_ver_le',
+ proisstrict => 'f'
+},
+{
+ oid => '11771',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_9_1.',
+ proname => 'dbms_db_version_ver_le_9_1',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_9_1',
+ proisstrict => 'f'
+},
+{
+ oid => '11772',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_9_2.',
+ proname => 'dbms_db_version_ver_le_9_2',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_9_2',
+ proisstrict => 'f'
+},
+{
+ oid => '11773',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_9.',
+ proname => 'dbms_db_version_ver_le_9',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_9',
+ proisstrict => 'f'
+},
+{
+ oid => '11774',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_10_1.',
+ proname => 'dbms_db_version_ver_le_10_1',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_10_1',
+ proisstrict => 'f'
+},
+{
+ oid => '11775',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_10_2.',
+ proname => 'dbms_db_version_ver_le_10_2',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_10_2',
+ proisstrict => 'f'
+},
+{
+ oid => '11776',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_10.',
+ proname => 'dbms_db_version_ver_le_10',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_10',
+ proisstrict => 'f'
+},
+{
+ oid => '11777',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_11_1.',
+ proname => 'dbms_db_version_ver_le_11_1',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_11_1',
+ proisstrict => 'f'
+},
+{
+ oid => '11778',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_11_2.',
+ proname => 'dbms_db_version_ver_le_11_2',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_11_2',
+ proisstrict => 'f'
+},
+{
+ oid => '11779',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_11.',
+ proname => 'dbms_db_version_ver_le_11',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_11',
+ proisstrict => 'f'
+},
+{
+ oid => '11780',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_12_1.',
+ proname => 'dbms_db_version_ver_le_12_1',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_12_1',
+ proisstrict => 'f'
+},
+{
+ oid => '11781',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_12_2.',
+ proname => 'dbms_db_version_ver_le_12_2',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_12_2',
+ proisstrict => 'f'
+},
+{
+ oid => '11782',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_12.',
+ proname => 'dbms_db_version_ver_le_12',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_12',
+ proisstrict => 'f'
+},
+{
+ oid => '11783',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_18.',
+ proname => 'dbms_db_version_ver_le_18',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_18',
+ proisstrict => 'f'
+},
+{
+ oid => '11784',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_19.',
+ proname => 'dbms_db_version_ver_le_19',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_19',
+ proisstrict => 'f'
+},
+{
+ oid => '11785',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_20.',
+ proname => 'dbms_db_version_ver_le_20',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_20',
+ proisstrict => 'f'
+},
+{
+ oid => '11786',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_21.',
+ proname => 'dbms_db_version_ver_le_21',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_21',
+ proisstrict => 'f'
+},
+{
+ oid => '11787',
+ descr => 'Возвращает флаг DBMS_DB_VERSION.VER_LE_23.',
+ proname => 'dbms_db_version_ver_le_23',
+ provolatile => 's',
+ prorettype => 'bool',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_ver_le_23',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN dbms_db_version_internal
# BEGIN QDB_DBMS_GEN dbms_describe_internal
{
oid => '11062',
@@ -19826,6 +20300,1751 @@
proisstrict => 'f'
}
,
+# BEGIN QDB_DBMS_GEN htp_internal
+{
+ oid => '11388',
+ descr => 'Enables HTP test mode',
+ proname => 'htp_enable_test_mode',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ prosrc => 'htp_enable_test_mode',
+ proisstrict => 'f'
+},
+{
+ oid => '11389',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_adddefaulthtmlhdr',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'bool',
+ prosrc => 'htp_adddefaulthtmlhdr',
+ proisstrict => 'f'
+},
+{
+ oid => '11390',
+ descr => 'This procedure generates the<ADDRESS>and</ADDRESS>tags which specify the address, author and signature of a document.',
+ proname => 'htp_address',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_address',
+ proisstrict => 'f'
+},
+{
+ oid => '11391',
+ descr => 'Like the ANCHOR2 procedure, this procedure generates the<A>and</A>HTML tags which specify the source or destination of a hypertext link.',
+ proname => 'htp_anchor',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_anchor',
+ proisstrict => 'f'
+},
+{
+ oid => '11392',
+ descr => 'Like the ANCHOR procedure, this procedure generates the<A>and</A>HTML tags which specify the source or destination of a hypertext link.',
+ proname => 'htp_anchor2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_anchor2',
+ proisstrict => 'f'
+},
+{
+ oid => '11393',
+ descr => 'This procedure generates the<APPLET>tag which begins the invocation of a Java applet.',
+ proname => 'htp_appletopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number number varchar2',
+ prosrc => 'htp_appletopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11394',
+ descr => 'This procedure generates the<AREA>tag, which defines a client-side image map. The<AREA>tag defines areas within the image and destinations for the areas.',
+ proname => 'htp_area',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_area',
+ proisstrict => 'f'
+},
+{
+ oid => '11395',
+ descr => 'This procedure generates the<BASE>tag which records the URL of the document.',
+ proname => 'htp_base',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_base',
+ proisstrict => 'f'
+},
+{
+ oid => '11396',
+ descr => 'This procedure generates the<BASEFONT>tag which specifies the base font size for a Web page.',
+ proname => 'htp_basefont',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'htp_basefont',
+ proisstrict => 'f'
+},
+{
+ oid => '11397',
+ descr => 'This procedure generates the<BGSOUND>tag which includes audio for a Web page.',
+ proname => 'htp_bgsound',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_bgsound',
+ proisstrict => 'f'
+},
+{
+ oid => '11398',
+ descr => 'This procedure generates the<BIG>and</BIG>tags which direct the browser to render the text in a bigger font.',
+ proname => 'htp_big',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_big',
+ proisstrict => 'f'
+},
+{
+ oid => '11399',
+ descr => 'This procedure generates the<BLOCKQUOTE>tag, which marks the beginning of a section of quoted text.',
+ proname => 'htp_blockquoteopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_blockquoteopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11400',
+ descr => 'This procedure generates the<BODY>tag which marks the beginning of the body section of an HTML document.',
+ proname => 'htp_bodyopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_bodyopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11401',
+ descr => 'This procedure generates the<B>and</B>tags which direct the browser to display the text in boldface.',
+ proname => 'htp_bold',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_bold',
+ proisstrict => 'f'
+},
+{
+ oid => '11402',
+ descr => 'This procedure generates the<BR>tag which begins a new line of text.',
+ proname => 'htp_br',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_br',
+ proisstrict => 'f'
+},
+{
+ oid => '11403',
+ descr => 'This procedure generates the<CENTER>and</CENTER>tags which center a section of text within a Web page.',
+ proname => 'htp_center',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_center',
+ proisstrict => 'f'
+},
+{
+ oid => '11404',
+ descr => 'This procedure generates the<CITE>and</CITE>tags which direct the browser to render the text as a citation.',
+ proname => 'htp_cite',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_cite',
+ proisstrict => 'f'
+},
+{
+ oid => '11405',
+ descr => 'This procedure generates the<CODE>and</CODE>tags which direct the browser to render the text in monospace font or however "code" is defined stylistically.',
+ proname => 'htp_code',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_code',
+ proisstrict => 'f'
+},
+{
+ oid => '11406',
+ descr => 'This procedure generates the comment tags.',
+ proname => 'htp_comment',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_comment',
+ proisstrict => 'f'
+},
+{
+ oid => '11407',
+ descr => 'This procedure generates the<DFN>and</DFN>tags which direct the browser to mark the text in italics or however "definition" is described stylistically.',
+ proname => 'htp_dfn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_dfn',
+ proisstrict => 'f'
+},
+{
+ oid => '11408',
+ descr => 'This procedure generates the<DIV>tag which creates document divisions.',
+ proname => 'htp_div',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_div',
+ proisstrict => 'f'
+},
+{
+ oid => '11409',
+ descr => 'This procedure generates the<DD>tag, which inserts definitions of terms. Use this tag for a definition list<DL>. Terms are tagged<DT>and definitions are tagged<DD>.',
+ proname => 'htp_dlistdef',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_dlistdef',
+ proisstrict => 'f'
+},
+{
+ oid => '11410',
+ descr => 'This procedure generates the<DL>tag which starts a definition list. You end a definition list by means of the DLISTCLOSE Procedure.',
+ proname => 'htp_dlistopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_dlistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11411',
+ descr => 'This procedure generates the<DT>tag which defines a term in a definition list<DL>.',
+ proname => 'htp_dlistterm',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_dlistterm',
+ proisstrict => 'f'
+},
+{
+ oid => '11412',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_download_file',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 bool',
+ prosrc => 'htp_download_file',
+ proisstrict => 'f'
+},
+{
+ oid => '11413',
+ descr => 'This procedure generates the<EM>and</EM>tags, which define text to be emphasized.',
+ proname => 'htp_em',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_em',
+ proisstrict => 'f'
+},
+{
+ oid => '11414',
+ descr => 'This procedure generates the<EM>and</EM>tags, which define text to be emphasized.',
+ proname => 'htp_emphasis',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_emphasis',
+ proisstrict => 'f'
+},
+{
+ oid => '11415',
+ descr => 'This procedure replaces characters that have special meaning in HTML with their escape sequences.',
+ proname => 'htp_escape_sc',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_escape_sc',
+ proisstrict => 'f'
+},
+{
+ oid => '11416',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_flush_charset_convert',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_flush_charset_convert',
+ proisstrict => 'f'
+},
+{
+ oid => '11417',
+ descr => 'This procedure generates the<FONT>which marks the beginning of section of text with the specified font characteristics.',
+ proname => 'htp_fontopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_fontopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11418',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="checkbox"which inserts a checkbox element in a form.',
+ proname => 'htp_formcheckbox',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_formcheckbox',
+ proisstrict => 'f'
+},
+{
+ oid => '11419',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="file"which inserts a file form element. This is used for file uploading for a given page.',
+ proname => 'htp_formfile',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_formfile',
+ proisstrict => 'f'
+},
+{
+ oid => '11420',
+ descr => 'This procedure generates the<INPUT>tag with TYPE="hidden", which inserts a hidden form element.',
+ proname => 'htp_formhidden',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_formhidden',
+ proisstrict => 'f'
+},
+{
+ oid => '11421',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="image"which creates an image field that the user clicks to submit the form immediately.',
+ proname => 'htp_formimage',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_formimage',
+ proisstrict => 'f'
+},
+{
+ oid => '11422',
+ descr => 'This procedure generates the<FORM>tag which marks the beginning of a form section in an HTML document.',
+ proname => 'htp_formopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_formopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11423',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="password"which creates a single-line text entry field. When the user enters text in the field, each character is represented by one asterisk. This is used for entering passwords.',
+ proname => 'htp_formpassword',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_formpassword',
+ proisstrict => 'f'
+},
+{
+ oid => '11424',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="radio", which creates a radio button on the HTML form. Within a set of radio buttons, the user selects only one. Each radio button in the same set has the same name, but different values. The selected radio button generates a name/value pair.',
+ proname => 'htp_formradio',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_formradio',
+ proisstrict => 'f'
+},
+{
+ oid => '11425',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="reset"which creates a button that, when selected, resets the form fields to their initial values.',
+ proname => 'htp_formreset',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_formreset',
+ proisstrict => 'f'
+},
+{
+ oid => '11426',
+ descr => 'This procedure generates the<SELECT>tags which creates a Select form element.',
+ proname => 'htp_formselectopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 number varchar2',
+ prosrc => 'htp_formselectopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11427',
+ descr => 'This procedure generates the<OPTION>tag which represents one choice in a Select element.',
+ proname => 'htp_formselectoption',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_formselectoption',
+ proisstrict => 'f'
+},
+{
+ oid => '11428',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="submit"which creates a button that, when clicked, submits the form. If the button has aNAMEattribute, the button contributes a name/value pair to the submitted data.',
+ proname => 'htp_formsubmit',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_formsubmit',
+ proisstrict => 'f'
+},
+{
+ oid => '11429',
+ descr => 'This procedure generates the<INPUT>tag withTYPE="text", which creates a field for a single line of text.',
+ proname => 'htp_formtext',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_formtext',
+ proisstrict => 'f'
+},
+{
+ oid => '11430',
+ descr => 'This procedure generates the<TEXTAREA>tag, which creates a text field that has no predefined text in the text area. This field enables entering several lines of text.',
+ proname => 'htp_formtextarea',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number number varchar2 varchar2',
+ prosrc => 'htp_formtextarea',
+ proisstrict => 'f'
+},
+{
+ oid => '11431',
+ descr => 'This procedure generates the<TEXTAREA>tag, which creates a text field that has no predefined text in the text area. This field enables entering several lines of text.',
+ proname => 'htp_formtextarea2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number number varchar2 varchar2 varchar2',
+ prosrc => 'htp_formtextarea2',
+ proisstrict => 'f'
+},
+{
+ oid => '11432',
+ descr => 'This procedure generates the<TEXTAREA>which marks the beginning of a text area form element.',
+ proname => 'htp_formtextareaopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number number varchar2 varchar2',
+ prosrc => 'htp_formtextareaopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11433',
+ descr => 'This procedure generates the<TEXTAREA>which marks the beginning of a text area form element.',
+ proname => 'htp_formtextareaopen2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number number varchar2 varchar2 varchar2',
+ prosrc => 'htp_formtextareaopen2',
+ proisstrict => 'f'
+},
+{
+ oid => '11434',
+ descr => 'This procedure generates the<FRAME>tag which begins the characteristics of a frame created by a<FRAMESET>tag.',
+ proname => 'htp_frame',
+ provolatile => 'v',
+# prolang => 'sql',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_frame',
+ proisstrict => 'f'
+},
+{
+ oid => '11435',
+ descr => 'This procedure generates the<FRAMESET>tag which define a frameset section.',
+ proname => 'htp_framesetopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_framesetopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11436',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_get_download_files_list',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => '',
+ prosrc => 'htp_get_download_files_list',
+ proisstrict => 'f'
+},
+{
+ oid => '11437',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_get_line',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_get_line',
+ proisstrict => 'f'
+},
+{
+ oid => '11438',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_get_page',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'number',
+ prosrc => 'htp_get_page',
+ proisstrict => 'f'
+},
+{
+ oid => '11439',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_get_page_charset_convert',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'number varchar2',
+ prosrc => 'htp_get_page_charset_convert',
+ proisstrict => 'f'
+},
+{
+ oid => '11440',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_get_page_raw',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'number',
+ prosrc => 'htp_get_page_raw',
+ proisstrict => 'f'
+},
+{
+ oid => '11441',
+ descr => 'This procedure generates opening heading tags(<H1>to<H6>)and their corresponding closing tags (</H1>to</H6>).',
+ proname => 'htp_header',
+ provolatile => 'v',
+# prolang => 'sql',
+ prorettype => 'void',
+ proargtypes => 'number varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_header',
+ proisstrict => 'f'
+},
+{
+ oid => '11442',
+ descr => 'This procedure generates the<HR>tag, which generates a line in the HTML document.',
+ proname => 'htp_hr',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_hr',
+ proisstrict => 'f'
+},
+{
+ oid => '11443',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_htitle',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_htitle',
+ proisstrict => 'f'
+},
+{
+ oid => '11444',
+ descr => 'This procedure generates the<IMG>tag which directs the browser to load an image onto the HTML page.',
+ proname => 'htp_img',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_img',
+ proisstrict => 'f'
+},
+{
+ oid => '11445',
+ descr => 'This procedure generates the <IMG> tag, which directs the browser to load an image onto the HTML page.',
+ proname => 'htp_img2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_img2',
+ proisstrict => 'f'
+},
+{
+ oid => '11446',
+ descr => 'This procedure creates a single entry field with a prompting text, such as "enter value," then sends that value to the URL of the page or program.',
+ proname => 'htp_isindex',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_isindex',
+ proisstrict => 'f'
+},
+{
+ oid => '11447',
+ descr => 'This procedure generates the<I>and</I>tags which direct the browser to render the text in italics.',
+ proname => 'htp_italic',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_italic',
+ proisstrict => 'f'
+},
+{
+ oid => '11448',
+ descr => 'This procedure generates the<KBD>and</KBD>tags which direct the browser to render the text in monospace font.',
+ proname => 'htp_kbd',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_kbd',
+ proisstrict => 'f'
+},
+{
+ oid => '11449',
+ descr => 'This procedure generates the <KBD> and </KBD> tags, which direct the browser to render the text in monospace font.',
+ proname => 'htp_keyboard',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_keyboard',
+ proisstrict => 'f'
+},
+{
+ oid => '11450',
+ descr => 'This procedure generates the<HR>tag, which generates a line in the HTML document.',
+ proname => 'htp_line',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_line',
+ proisstrict => 'f'
+},
+{
+ oid => '11451',
+ descr => 'This procedure generates the<LINK>tag with theRELattribute which delineates the relationship described by the hypertext link from the anchor to the target. This is only used when theHREFattribute is present.',
+ proname => 'htp_linkrel',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_linkrel',
+ proisstrict => 'f'
+},
+{
+ oid => '11452',
+ descr => 'This procedure generates the<LINK>tag with theREVattribute which delineates the relationship described by the hypertext link from the target to the anchor.',
+ proname => 'htp_linkrev',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_linkrev',
+ proisstrict => 'f'
+},
+{
+ oid => '11453',
+ descr => 'This procedure generates the<LH>and</LH>tags which print an HTML tag at the beginning of the list.',
+ proname => 'htp_listheader',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_listheader',
+ proisstrict => 'f'
+},
+{
+ oid => '11454',
+ descr => 'This procedure generates the<LI>tag, which indicates a list item.',
+ proname => 'htp_listitem',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_listitem',
+ proisstrict => 'f'
+},
+{
+ oid => '11455',
+ descr => 'This procedure generates the<A>tag with theHREFset to mailto prepended to the mail address argument.',
+ proname => 'htp_mailto',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_mailto',
+ proisstrict => 'f'
+},
+{
+ oid => '11456',
+ descr => 'This procedure generates the<MAP>tag which mark the beginning of a set of regions in a client-side image map.',
+ proname => 'htp_mapopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_mapopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11457',
+ descr => 'This procedure generates the<META>tag, which embeds meta-information about the document and also specifies values for HTTP headers. For example, you can specify the expiration date, keywords, and author name.',
+ proname => 'htp_meta',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_meta',
+ proisstrict => 'f'
+},
+{
+ oid => '11458',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_nextid',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_nextid',
+ proisstrict => 'f'
+},
+{
+ oid => '11459',
+ descr => 'This procedure generates the<BR>tag which begins a new line of text.',
+ proname => 'htp_nl',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_nl',
+ proisstrict => 'f'
+},
+{
+ oid => '11460',
+ descr => 'This procedure generates the<NOBR>and</NOBR>tags which turn off line-breaking in a section of text.',
+ proname => 'htp_nobr',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_nobr',
+ proisstrict => 'f'
+},
+{
+ oid => '11461',
+ descr => 'This procedure generates the<OL>tag which marks the beginning of an ordered list. An ordered list presents a list of numbered items.',
+ proname => 'htp_olistopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_olistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11462',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_p_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11463',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'date',
+ prosrc => 'htp_p_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11464',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'htp_p_ovr3',
+ proisstrict => 'f'
+},
+{
+ oid => '11465',
+ descr => 'You can use this procedure to add attributes to the<P>tag created by the PARA Procedure.',
+ proname => 'htp_paragraph',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_paragraph',
+ proisstrict => 'f'
+},
+{
+ oid => '11466',
+ descr => 'This procedure generates the<PARAM>tag which specifies parameter values for Java applets.',
+ proname => 'htp_param',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_param',
+ proisstrict => 'f'
+},
+{
+ oid => '11467',
+ descr => 'This procedure generates the<PLAINTEXT>and</PLAINTEXT>tags which direct the browser to render the text they surround in fixed-width type.',
+ proname => 'htp_plaintext',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_plaintext',
+ proisstrict => 'f'
+},
+{
+ oid => '11468',
+ descr => 'This procedure generates the<PRE>tag which marks the beginning of a section of preformatted text in the body of the HTML page.',
+ proname => 'htp_preopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_preopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11469',
+ descr => 'These procedures generate the specified parameter as a string terminated with the\nnewline character.',
+ proname => 'htp_print',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_print_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11470',
+ descr => 'These procedures generate the specified parameter as a string terminated with the\nnewline character.',
+ proname => 'htp_print',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'date',
+ prosrc => 'htp_print_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11471',
+ descr => 'These procedures generate the specified parameter as a string terminated with the\nnewline character.',
+ proname => 'htp_print',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'htp_print_ovr3',
+ proisstrict => 'f'
+},
+{
+ oid => '11472',
+ descr => 'This procedure generates a string and replaces certain characters with a corresponding escape sequence.',
+ proname => 'htp_prints',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_prints',
+ proisstrict => 'f'
+},
+{
+ oid => '11473',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_print_header',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number',
+ prosrc => 'htp_print_header',
+ proisstrict => 'f'
+},
+{
+ oid => '11474',
+ descr => 'These procedures generate the specified parameter as a string.',
+ proname => 'htp_prn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_prn_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11475',
+ descr => 'These procedures generate the specified parameter as a string.',
+ proname => 'htp_prn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'date',
+ prosrc => 'htp_prn_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11476',
+ descr => 'These procedures generate the specified parameter as a string.',
+ proname => 'htp_prn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'htp_prn_ovr3',
+ proisstrict => 'f'
+},
+{
+ oid => '11477',
+ descr => 'This procedure generates a string and replaces certain characters with the corresponding escape sequence.',
+ proname => 'htp_ps',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_ps',
+ proisstrict => 'f'
+},
+{
+ oid => '11478',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_putraw',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'raw int4',
+ prosrc => 'htp_putraw',
+ proisstrict => 'f'
+},
+{
+ oid => '11479',
+ descr => 'This procedure generates the<S>and</S>tags which direct the browser to render the text they surround in strikethrough type.',
+ proname => 'htp_s',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_s',
+ proisstrict => 'f'
+},
+{
+ oid => '11480',
+ descr => 'This procedure generates the<SAMP>and</SAMP>tags which direct the browser to render the text they surround in monospace font or however "sample" is defined stylistically.',
+ proname => 'htp_sample',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_sample',
+ proisstrict => 'f'
+},
+{
+ oid => '11481',
+ descr => 'This procedure generates the<SCRIPT>and</SCRIPT>tags which contain a script written in languages such as JavaScript and VBscript.',
+ proname => 'htp_script',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_script',
+ proisstrict => 'f'
+},
+{
+ oid => '11482',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_sethttpcharset',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_sethttpcharset',
+ proisstrict => 'f'
+},
+{
+ oid => '11483',
+ descr => 'TODO: Добавить описание',
+ proname => 'htp_set_transfer_mode',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_set_transfer_mode',
+ proisstrict => 'f'
+},
+{
+ oid => '11484',
+ descr => 'This procedure generates the<SMALL>and</SMALL>tags, which direct the browser to render the text they surround using a small font.',
+ proname => 'htp_small',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_small',
+ proisstrict => 'f'
+},
+{
+ oid => '11485',
+ descr => 'This procedure generates the<STRIKE>and</STRIKE>tags which direct the browser to render the text they surround in strikethrough type.',
+ proname => 'htp_strike',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_strike',
+ proisstrict => 'f'
+},
+{
+ oid => '11486',
+ descr => 'This procedure generates the<STRONG>and</STRONG>tags which direct the browser to render the text they surround in bold, or however "strong" is defined.',
+ proname => 'htp_strong',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_strong',
+ proisstrict => 'f'
+},
+{
+ oid => '11487',
+ descr => 'This procedure generates the<STYLE>and</STYLE>tags which include a style sheet in a Web page.',
+ proname => 'htp_style',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_style',
+ proisstrict => 'f'
+},
+{
+ oid => '11488',
+ descr => 'This procedure generates the<SUB>and</SUB>tags which direct the browser to render the text they surround as subscript.',
+ proname => 'htp_sub',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_sub',
+ proisstrict => 'f'
+},
+{
+ oid => '11489',
+ descr => 'This procedure generates the<SUP>and</SUP>tags which direct the browser to render the text they surround as superscript.',
+ proname => 'htp_sup',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_sup',
+ proisstrict => 'f'
+},
+{
+ oid => '11490',
+ descr => 'This procedure generates the<CAPTION>and</CAPTION>tags which place a caption in an HTML table.',
+ proname => 'htp_tablecaption',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htp_tablecaption',
+ proisstrict => 'f'
+},
+{
+ oid => '11491',
+ descr => 'This procedure generates the<TD>and</TD>tags which insert data into a cell of an HTML table.',
+ proname => 'htp_tabledata',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_tabledata',
+ proisstrict => 'f'
+},
+{
+ oid => '11492',
+ descr => 'This procedure generates the<TH>and</TH>tags which insert a header cell in an HTML table.',
+ proname => 'htp_tableheader',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_tableheader',
+ proisstrict => 'f'
+},
+{
+ oid => '11493',
+ descr => 'This procedure generates the <TABLE> tag which marks the beginning of an HTML table.',
+ proname => 'htp_tableopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_tableopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11494',
+ descr => 'This procedure generates the<TR>tag which marks the beginning of a new row in an HTML table.',
+ proname => 'htp_tablerowopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_tablerowopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11495',
+ descr => 'This procedure generates the<TT>and</TT>tags which direct the browser to render the text they surround in a fixed width typewriter font, for example, the courier font.',
+ proname => 'htp_teletype',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_teletype',
+ proisstrict => 'f'
+},
+{
+ oid => '11496',
+ descr => 'This procedure generates the<TITLE>and</TITLE>tags which specify the text to display in the titlebar of the browser window.',
+ proname => 'htp_title',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_title',
+ proisstrict => 'f'
+},
+{
+ oid => '11497',
+ descr => 'This procedure generates the<UL>tag which marks the beginning of an unordered list. An unordered list presents items with bullets.',
+ proname => 'htp_ulistopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htp_ulistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11498',
+ descr => 'This procedure generates the<U>and</U>tags, which direct the browser to render the text they surround with an underline.',
+ proname => 'htp_underline',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_underline',
+ proisstrict => 'f'
+},
+{
+ oid => '11499',
+ descr => 'This procedure generates the<VAR>and</VAR>tags which direct the browser to render the text they surround in italics or however "variable" is defined stylistically.',
+ proname => 'htp_variable',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htp_variable',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN htp_internal
+# BEGIN QDB_DBMS_GEN owa_internal
+{
+ oid => '12001',
+ descr => 'Initialize request-scoped OWA page context from CGI arrays.',
+ proname => 'owa_init_cgi_env',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 _text _text',
+ proargnames => '{num_cgi_vars,param_name,param_val}',
+ prosrc => 'owa_init_cgi_env',
+ proisstrict => 'f'
+},
+{
+ oid => '9970',
+ descr => 'Initialize request-scoped OWA page context from CGI arrays with service parameter.',
+ proname => 'owa_init_cgi_env2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 _text _text int4',
+ proargnames => '{num_cgi_vars,param_name,param_val,service_arg}',
+ prosrc => 'owa_init_cgi_env2',
+ proisstrict => 'f'
+},
+{
+ oid => '12002',
+ descr => 'Append Set-Cookie event into OWA page context.',
+ proname => 'owa_cookie_send',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 timestamptz varchar2 varchar2 varchar2',
+ prosrc => 'owa_cookie_send',
+ proisstrict => 'f'
+},
+{
+ oid => '9971',
+ descr => 'Append Set-Cookie event into OWA page context with service parameter.',
+ proname => 'owa_cookie_send2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 timestamptz varchar2 varchar2 varchar2 int4',
+ proargnames => '{name,value,expires,path,domain,secure,service_arg}',
+ prosrc => 'owa_cookie_send2',
+ proisstrict => 'f'
+},
+{
+ oid => '12003',
+ descr => 'Set validation cache headers in OWA page context.',
+ proname => 'owa_cache_set_cache',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ proargnames => '{p_etag,p_level}',
+ prosrc => 'owa_cache_set_cache',
+ proisstrict => 'f'
+},
+{
+ oid => '12004',
+ descr => 'Set expires cache headers in OWA page context.',
+ proname => 'owa_cache_set_expires',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ proargnames => '{p_expires,p_level}',
+ prosrc => 'owa_cache_set_expires',
+ proisstrict => 'f'
+},
+{
+ oid => '12005',
+ descr => 'Set not-modified status in OWA page context.',
+ proname => 'owa_cache_set_not_modified',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_cache_set_not_modified',
+ proisstrict => 'f'
+},
+{
+ oid => '12006',
+ descr => 'Disable cache for current OWA request.',
+ proname => 'owa_cache_disable',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_cache_disable',
+ proisstrict => 'f'
+},
+{
+ oid => '12007',
+ descr => 'Set surrogate control header in OWA page context.',
+ proname => 'owa_cache_set_surrogate_control',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ proargnames => '{p_value}',
+ prosrc => 'owa_cache_set_surrogate_control',
+ proisstrict => 'f'
+},
+{
+ oid => '12008',
+ descr => 'Set request validation etag in OWA page context.',
+ proname => 'owa_cache_set_request_etag',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ proargnames => '{p_etag}',
+ prosrc => 'owa_cache_set_request_etag',
+ proisstrict => 'f'
+},
+{
+ oid => '12009',
+ descr => 'Set request validation level in OWA page context.',
+ proname => 'owa_cache_set_request_level',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ proargnames => '{p_level}',
+ prosrc => 'owa_cache_set_request_level',
+ proisstrict => 'f'
+},
+{
+ oid => '12010',
+ descr => 'Return cached validation etag from OWA page context.',
+ proname => 'owa_cache_get_etag',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prosrc => 'owa_cache_get_etag',
+ proisstrict => 'f'
+},
+{
+ oid => '9972',
+ descr => 'Return cached validation etag from OWA page context with service parameter.',
+ proname => 'owa_cache_get_etag2',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'int4',
+ proargnames => '{service_arg}',
+ prosrc => 'owa_cache_get_etag2',
+ proisstrict => 'f'
+},
+{
+ oid => '12011',
+ descr => 'Return cached level from OWA page context.',
+ proname => 'owa_cache_get_level',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prosrc => 'owa_cache_get_level',
+ proisstrict => 'f'
+},
+{
+ oid => '12012',
+ descr => 'Get CGI environment variable from OWA page context.',
+ proname => 'owa_util_get_cgi_env',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ proargnames => '{param_name}',
+ prosrc => 'owa_util_get_cgi_env',
+ proisstrict => 'f'
+},
+{
+ oid => '12013',
+ descr => 'Render and flush OWA page context.',
+ proname => 'owa_util_showpage',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_showpage',
+ proisstrict => 'f'
+},
+{
+ oid => '9973',
+ descr => 'Render and flush OWA page context with service parameter.',
+ proname => 'owa_util_showpage_utils',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ proargnames => '{service_arg}',
+ prosrc => 'owa_util_showpage_utils',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN owa_internal
+# htp void arguments
+{
+ oid => '11554',
+ descr => 'This procedure htp_appletclose.',
+ proname => 'htp_appletclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_appletclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11555',
+ descr => 'This procedure htp_blockquoteclose.',
+ proname => 'htp_blockquoteclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_blockquoteclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11556',
+ descr => 'This procedure htp_bodyclose.',
+ proname => 'htp_bodyclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_bodyclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11557',
+ descr => 'This procedure htp_centerclose.',
+ proname => 'htp_centerclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_centerclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11558',
+ descr => 'This procedure htp_centeropen.',
+ proname => 'htp_centeropen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_centeropen',
+ proisstrict => 'f'
+},
+{
+ oid => '11559',
+ descr => 'This procedure htp_dirlistclose.',
+ proname => 'htp_dirlistclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_dirlistclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11560',
+ descr => 'This procedure htp_dirlistopen.',
+ proname => 'htp_dirlistopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_dirlistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11561',
+ descr => 'This procedure htp_dlistclose.',
+ proname => 'htp_dlistclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_dlistclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11562',
+ descr => 'This procedure htp_flush.',
+ proname => 'htp_flush',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_flush',
+ proisstrict => 'f'
+},
+{
+ oid => '11563',
+ descr => 'This procedure htp_fontclose.',
+ proname => 'htp_fontclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_fontclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11564',
+ descr => 'This procedure htp_formclose.',
+ proname => 'htp_formclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_formclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11565',
+ descr => 'This procedure htp_formselectclose.',
+ proname => 'htp_formselectclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_formselectclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11566',
+ descr => 'This procedure htp_formtextareaclose.',
+ proname => 'htp_formtextareaclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_formtextareaclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11567',
+ descr => 'This procedure htp_framesetclose.',
+ proname => 'htp_framesetclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_framesetclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11568',
+ descr => 'This procedure htp_headclose.',
+ proname => 'htp_headclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_headclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11569',
+ descr => 'This procedure htp_headopen.',
+ proname => 'htp_headopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_headopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11570',
+ descr => 'This procedure htp_htmlclose.',
+ proname => 'htp_htmlclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_htmlclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11571',
+ descr => 'This procedure htp_htmlopen.',
+ proname => 'htp_htmlopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_htmlopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11572',
+ descr => 'This procedure htp_init.',
+ proname => 'htp_init',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_init',
+ proisstrict => 'f'
+},
+{
+ oid => '11573',
+ descr => 'This procedure htp_listingclose.',
+ proname => 'htp_listingclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_listingclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11574',
+ descr => 'This procedure htp_listingopen.',
+ proname => 'htp_listingopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_listingopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11575',
+ descr => 'This procedure htp_mapclose.',
+ proname => 'htp_mapclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_mapclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11576',
+ descr => 'This procedure htp_menulistclose.',
+ proname => 'htp_menulistclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_menulistclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11577',
+ descr => 'This procedure htp_menulistopen.',
+ proname => 'htp_menulistopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_menulistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11578',
+ descr => 'This procedure htp_noframesclose.',
+ proname => 'htp_noframesclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_noframesclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11579',
+ descr => 'This procedure htp_noframesopen.',
+ proname => 'htp_noframesopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_noframesopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11580',
+ descr => 'This procedure htp_olistclose.',
+ proname => 'htp_olistclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_olistclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11581',
+ descr => 'This procedure htp_para.',
+ proname => 'htp_para',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_para',
+ proisstrict => 'f'
+},
+{
+ oid => '11582',
+ descr => 'This procedure htp_preclose.',
+ proname => 'htp_preclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_preclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11583',
+ descr => 'This procedure htp_reset_get_page.',
+ proname => 'htp_reset_get_page',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_reset_get_page',
+ proisstrict => 'f'
+},
+{
+ oid => '11584',
+ descr => 'This procedure htp_showpage.',
+ proname => 'htp_showpage',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_showpage',
+ proisstrict => 'f'
+},
+{
+ oid => '11585',
+ descr => 'This procedure htp_tableclose.',
+ proname => 'htp_tableclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_tableclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11586',
+ descr => 'This procedure htp_tablerowclose.',
+ proname => 'htp_tablerowclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_tablerowclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11587',
+ descr => 'This procedure htp_ulistclose.',
+ proname => 'htp_ulistclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_ulistclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11588',
+ descr => 'This procedure htp_wbr.',
+ proname => 'htp_wbr',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'htp_wbr',
+ proisstrict => 'f'
+}
+# end htp void arguments
+,
+{
+ oid => '11333',
+ descr => 'UTL_GDK.CHARSET_MAP: отображение кодировки Oracle/IANA',
+ proname => 'utl_gdk_charset_map',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '1',
+ proargtypes => 'text',
+ prosrc => 'utl_gdk_charset_map0',
+ proisstrict => 't',
+ proparallel => 's'
+},
+{
+ oid => '11334',
+ descr => 'UTL_GDK.CHARSET_MAP: отображение кодировки Oracle/IANA с направлением отображения',
+ proname => 'utl_gdk_charset_map',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '2',
+ proargtypes => 'text int4',
+ prosrc => 'utl_gdk_charset_map1',
+ proisstrict => 't',
+ proparallel => 's'
+},
+{
+ oid => '14778',
+ descr => 'Возвращает IANA-имя кодировки для Oracle-имени набора символов.',
+ proname => 'utl_gdk_oracle_charset_to_iana',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '1',
+ proargtypes => 'text',
+ prosrc => 'utl_gdk_oracle_charset_to_iana',
+ proisstrict => 't',
+ proparallel => 's'
+},
+{
+ oid => '11335',
+ descr => 'UTL_GDK.LANGUAGE_MAP: отображение языка Oracle/ISO',
+ proname => 'utl_gdk_language_map',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '1',
+ proargtypes => 'text',
+ prosrc => 'utl_gdk_language_map0',
+ proisstrict => 't',
+ proparallel => 's'
+},
+{
+ oid => '11336',
+ descr => 'UTL_GDK.LANGUAGE_MAP: отображение языка Oracle/ISO с направлением отображения',
+ proname => 'utl_gdk_language_map',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '2',
+ proargtypes => 'text int4',
+ prosrc => 'utl_gdk_language_map1',
+ proisstrict => 't',
+ proparallel => 's'
+},
+{
+ oid => '11337',
+ descr => 'UTL_GDK.TERRITORY_MAP: отображение территории Oracle/ISO',
+ proname => 'utl_gdk_territory_map',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '1',
+ proargtypes => 'text',
+ prosrc => 'utl_gdk_territory_map0',
+ proisstrict => 't',
+ proparallel => 's'
+},
+{
+ oid => '11338',
+ descr => 'UTL_GDK.TERRITORY_MAP: отображение территории Oracle/ISO с направлением отображения',
+ proname => 'utl_gdk_territory_map',
+ provolatile => 'i',
+ prorettype => 'text',
+ pronargs => '2',
+ proargtypes => 'text int4',
+ prosrc => 'utl_gdk_territory_map1',
+ proisstrict => 't',
+ proparallel => 's'
+}
+,
{
oid => '8450',
descr => 'Возвращает метаданные DBMS пакетов',
@@ -19838,6 +22057,239 @@
}
,
{
+ oid => '14758',
+ descr => 'DBMS_WARNING: добавляет настройку предупреждения по категории',
+ proname => 'dbms_warning_add_warning_setting_cat',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ proargnames => '{warning_category,warning_value,scope}',
+ prosrc => 'dbms_warning_add_warning_setting_cat',
+ proisstrict => 'f'
+},
+{
+ oid => '14759',
+ descr => 'DBMS_WARNING: добавляет настройку предупреждения по номеру',
+ proname => 'dbms_warning_add_warning_setting_num',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'binary_integer varchar2 varchar2',
+ proargnames => '{warning_number,warning_value,scope}',
+ prosrc => 'dbms_warning_add_warning_setting_num',
+ proisstrict => 'f'
+},
+{
+ oid => '14760',
+ descr => 'DBMS_WARNING: возвращает категорию по номеру предупреждения',
+ proname => 'dbms_warning_get_category',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'binary_integer',
+ proargnames => '{warning_number}',
+ prosrc => 'dbms_warning_get_category',
+ proisstrict => 'f'
+},
+{
+ oid => '14761',
+ descr => 'DBMS_WARNING: возвращает настройку предупреждения по категории',
+ proname => 'dbms_warning_get_warning_setting_cat',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ proargnames => '{warning_category}',
+ prosrc => 'dbms_warning_get_warning_setting_cat',
+ proisstrict => 'f'
+},
+{
+ oid => '14762',
+ descr => 'DBMS_WARNING: возвращает настройку предупреждения по номеру',
+ proname => 'dbms_warning_get_warning_setting_num',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'binary_integer',
+ proargnames => '{warning_number}',
+ prosrc => 'dbms_warning_get_warning_setting_num',
+ proisstrict => 'f'
+},
+{
+ oid => '14763',
+ descr => 'DBMS_WARNING: возвращает строковое представление текущей настройки предупреждений',
+ proname => 'dbms_warning_get_warning_setting_string',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prosrc => 'dbms_warning_get_warning_setting_string',
+ proisstrict => 'f'
+},
+{
+ oid => '14779',
+ descr => 'DBMS_WARNING: нормализует строковое представление настройки предупреждений',
+ proname => 'dbms_warning_normalize_setting',
+ provolatile => 'i',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ proargnames => '{setting}',
+ prosrc => 'dbms_warning_normalize_setting',
+ proisstrict => 'f',
+ proparallel => 's'
+},
+{
+ oid => '14764',
+ descr => 'DBMS_WARNING: устанавливает строковое представление текущей настройки предупреждений',
+ proname => 'dbms_warning_set_warning_setting_string',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ proargnames => '{value,scope}',
+ prosrc => 'dbms_warning_set_warning_setting_string',
+ proisstrict => 'f'
+},
+{
+ oid => '14765',
+ descr => 'DBMS_SYSTEM.KSDWRT: записывает диагностическое сообщение в журнал сервера PostgreSQL',
+ proname => 'dbms_system_ksdwrt',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '2',
+ proargtypes => 'int4 text',
+ prosrc => 'dbms_system_ksdwrt',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14780',
+ descr => 'DBMS_SYSTEM: проверяет существование указанной сессии',
+ proname => 'dbms_system_is_valid_session',
+ provolatile => 'v',
+ prorettype => 'bool',
+ pronargs => '2',
+ proargtypes => 'int4 int4',
+ prosrc => 'dbms_system_is_valid_session',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14766',
+ descr => 'DBMS_SYSTEM.SET_EV: устанавливает диагностический event для текущей сессии; сейчас поддерживается только event 10046',
+ proname => 'dbms_system_set_ev',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '5',
+ proargtypes => 'int4 int4 int4 int4 text',
+ prosrc => 'dbms_system_set_ev',
+ proisstrict => 'f',
+ proparallel => 'u'
+},
+{
+ oid => '14767',
+ descr => 'DBMS_SYSTEM.READ_EV: возвращает уровень диагностического event для текущей сессии',
+ proname => 'dbms_system_read_ev',
+ provolatile => 'v',
+ prorettype => 'int4',
+ pronargs => '1',
+ proargtypes => 'int4',
+ prosrc => 'dbms_system_read_ev',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14768',
+ descr => 'DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION: включает или выключает SQL trace event 10046 для текущей сессии',
+ proname => 'dbms_system_set_sql_trace_in_session',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '3',
+ proargtypes => 'int4 int4 bool',
+ prosrc => 'dbms_system_set_sql_trace_in_session',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14769',
+ descr => 'DBMS_FILE_TRANSFER.COPY_FILE: копирует файл из одной директории в другую в пределах одной базы данных',
+ proname => 'dbms_file_transfer_copy_file',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '4',
+ proargtypes => 'text text text text',
+ prosrc => 'dbms_file_transfer_copy_file',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14781',
+ descr => 'Проверяет, что имя файла допустимо для операций передачи файлов.',
+ proname => 'dbms_file_transfer_is_safe_filename',
+ provolatile => 'i',
+ prorettype => 'bool',
+ pronargs => '1',
+ proargtypes => 'text',
+ prosrc => 'dbms_file_transfer_is_safe_filename',
+ proisstrict => 'f',
+ proparallel => 's'
+},
+{
+ oid => '14770',
+ descr => 'DBMS_FILE_TRANSFER.GET_FILE: копирование файла с удаленной файловой системы в локальную файловую систему',
+ proname => 'dbms_file_transfer_get_file',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '5',
+ proargtypes => 'text text text text text',
+ prosrc => 'dbms_file_transfer_get_file',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14771',
+ descr => 'Вспомогательная функция к dbms_file_transfer_get_file для считывания из файла на удаленном сервере по частям (чанками)',
+ proname => 'read_file_chunk',
+ provolatile => 'v',
+ prorettype => 'bytea',
+ pronargs => '4',
+ proargtypes => 'text text int8 int4',
+ prosrc => 'read_file_chunk',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14772',
+ descr => 'DBMS_FILE_TRANSFER.PUT_FILE: копирование файла с локальной файловой системы в удаленную файловую систему',
+ proname => 'dbms_file_transfer_put_file',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '5',
+ proargtypes => 'text text text text text',
+ prosrc => 'dbms_file_transfer_put_file',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14773',
+ descr => 'Вспомогательная функция к dbms_file_transfer_put_file для записи файла на удаленном сервере по частям (чанками)',
+ proname => 'write_file_chunk',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '4',
+ proargtypes => 'text text bytea int8',
+ prosrc => 'write_file_chunk',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
+ oid => '14774',
+ descr => 'Вспомогательная функция к dbms_file_transfer_put_file; удаляет файл из файловой системы',
+ proname => 'pg_file_unlink_custom',
+ provolatile => 'v',
+ prorettype => 'void',
+ pronargs => '1',
+ proargnames => '{full_path}',
+ proargtypes => 'text',
+ prosrc => 'pg_file_unlink_custom',
+ proisstrict => 't',
+ proparallel => 'u'
+},
+{
oid => '8451',
descr => 'Возвращает версию RUDB пакета DBMS_ALERT (Oracle DBMS_ALERT пакет)',
proname => 'dbms_alert_get_version',
@@ -19914,6 +22366,17 @@
}
,
{
+ oid => '11815',
+ descr => 'Возвращает версию RUDB пакета DBMS_JSON_SCHEMA (Oracle DBMS_JSON_SCHEMA пакет)',
+ proname => 'dbms_json_schema_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_json_schema_get_version',
+ proisstrict => 'f'
+}
+,
+{
oid => '8456',
descr => 'Возвращает версию RUDB пакета DBMS_DESCRIBE (Oracle DBMS_DESCRIBE пакет)',
proname => 'dbms_describe_get_version',
@@ -19969,6 +22432,105 @@
}
,
{
+ oid => '14784',
+ descr => 'Возвращает версию RUDB пакета DBMS_FILE_TRANSFER (Oracle DBMS_FILE_TRANSFER пакет)',
+ proname => 'dbms_file_transfer_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_file_transfer_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14785',
+ descr => 'Возвращает версию RUDB пакета DBMS_SYSTEM (Oracle DBMS_SYSTEM пакет)',
+ proname => 'dbms_system_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_system_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14786',
+ descr => 'Возвращает версию RUDB пакета UTL_GDK (Oracle UTL_GDK пакет)',
+ proname => 'utl_gdk_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'utl_gdk_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14787',
+ descr => 'Возвращает версию RUDB пакета DBMS_TNS (Oracle DBMS_TNS пакет)',
+ proname => 'dbms_tns_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_tns_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14788',
+ descr => 'Возвращает версию RUDB пакета DBMS_WARNING (Oracle DBMS_WARNING пакет)',
+ proname => 'dbms_warning_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_warning_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14789',
+ descr => 'Возвращает версию RUDB пакета DBMS_TRACE (Oracle DBMS_TRACE пакет)',
+ proname => 'dbms_trace_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_trace_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14790',
+ descr => 'Возвращает версию RUDB пакета DBMS_DB_VERSION (Oracle DBMS_DB_VERSION пакет)',
+ proname => 'dbms_db_version_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_db_version_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14791',
+ descr => 'Возвращает версию RUDB пакета DBMS_STAT_FUNCS (Oracle DBMS_STAT_FUNCS пакет)',
+ proname => 'dbms_stat_funcs_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_stat_funcs_get_version',
+ proisstrict => 'f'
+}
+,
+{
+ oid => '14792',
+ descr => 'Возвращает версию RUDB пакета DBMS_SQLSET (Oracle DBMS_SQLSET пакет)',
+ proname => 'dbms_sqlset_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_get_version',
+ proisstrict => 'f'
+}
+,
+{
oid => '8461',
descr => 'Возвращает версию RUDB пакета DBMS_RANDOM (Oracle DBMS_RANDOM пакет)',
proname => 'dbms_random_get_version',
@@ -20228,5 +22790,3630 @@
proargtypes => '',
prosrc => 'utl_file_get_version',
proisstrict => 'f'
+},
+{
+ oid => '8483',
+ descr => 'эквивалент SQL-оператору ALTER SESSION ADVISE COMMIT',
+ proname => 'dbms_transaction_advise_commit',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_advise_commit',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8484',
+ descr => 'эквивалент SQL-оператору ALTER SESSION ADVISE NOTHING',
+ proname => 'dbms_transaction_advise_nothing',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_advise_nothing',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8485',
+ descr => 'эквивалент SQL-оператору ALTER SESSION ADVISE ROLLBACK',
+ proname => 'dbms_transaction_advise_rollback',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_advise_rollback',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8486',
+ descr => 'эквивалент SQL-оператору COMMIT',
+ proname => 'dbms_transaction_commit',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_commit',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8487',
+ descr => 'эквивалент SQL-оператору COMMIT COMMENT <текст>',
+ proname => 'dbms_transaction_commit_comment',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_commit_comment',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8488',
+ descr => 'эквивалент SQL-оператору COMMIT FORCE <текст>, <число>',
+ proname => 'dbms_transaction_commit_force',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'dbms_transaction_commit_force',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8489',
+ descr => 'Возвращает идентификатор транзакции без сессии или XA-транзакции в сессии',
+ proname => 'dbms_transaction_get_transaction_id',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_get_transaction_id',
+ proisstrict => 'f'
+},
+{
+ oid => '8490',
+ descr => 'Возвращает таймаут (в секундах) ветки XA-транзакции или транзакции без сессии',
+ proname => 'dbms_transaction_get_transaction_timeout',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_get_transaction_timeout',
+ proisstrict => 'f'
+},
+{
+ oid => '8491',
+ descr => 'Возвращает тип активной транзакции в сессии',
+ proname => 'dbms_transaction_get_transaction_type',
+ provolatile => 'v',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_get_transaction_type',
+ proisstrict => 'f'
+},
+{
+ oid => '8492',
+ descr => 'возвращает локальный (для экземпляра) уникальный идентификатор текущей транзакции',
+ proname => 'dbms_transaction_local_transaction_id_full',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'bool',
+ prosrc => 'dbms_transaction_local_transaction_id_full',
+ proisstrict => 't'
+},
+{
+ oid => '8493',
+ descr => 'Удаляет записи, управляющие восстановлением базы данных с локального сайта',
+ proname => 'dbms_transaction_purge_lost_db_entry',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_purge_lost_db_entry',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '8494',
+ descr => 'удаляет информацию о транзакции со смешанным результатом',
+ proname => 'dbms_transaction_purge_mixed',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_purge_mixed',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '8495',
+ descr => 'эквивалент SQL-оператору SET TRANSACTION READ ONLY',
+ proname => 'dbms_transaction_read_only',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_read_only',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8496',
+ descr => 'эквивалент SQL-оператору SET TRANSACTION READ WRITE',
+ proname => 'dbms_transaction_read_write',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_read_write',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8497',
+ descr => 'эквивалент SQL-оператору ROLLBACK',
+ proname => 'dbms_transaction_rollback',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_rollback',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8498',
+ descr => 'эквивалент SQL-оператору ROLLBACK FORCE <текст>',
+ proname => 'dbms_transaction_rollback_force',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_rollback_force',
+ proisstrict => 't',
+ prokind => 'p',
+},
+{
+ oid => '8499',
+ descr => 'эквивалент SQL-оператору ROLLBACK TO SAVEPOINT <имя_точки_сохранения>',
+ proname => 'dbms_transaction_rollback_savepoint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_rollback_savepoint',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '8500',
+ descr => 'эквивалент SQL-оператору SAVEPOINT <имя_точки_сохранения>',
+ proname => 'dbms_transaction_savepoint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_savepoint',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '8501',
+ descr => 'Начинает локальную транзакцию или транзакцию без сессии',
+ proname => 'dbms_transaction_start_transaction_full',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'bytea binary_integer binary_integer binary_integer',
+ prosrc => 'dbms_transaction_start_transaction_full',
+ proisstrict => 'f'
+},
+{
+ oid => '8502',
+ descr => 'возвращает локальный уникальный положительный целочисленный идентификатор, упорядочивающий DML-операции транзакции',
+ proname => 'dbms_transaction_step_id',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_step_id',
+ proisstrict => 'f'
+},
+{
+ oid => '8503',
+ descr => 'Замораживает бессеансовую транзакцию',
+ proname => 'dbms_transaction_suspend_transaction',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'dbms_transaction_suspend_transaction',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8504',
+ descr => 'эквивалент SQL-оператору SET TRANSACTION USE ROLLBACK SEGMENT <имя_сегмента_отката>',
+ proname => 'dbms_transaction_use_rollback_segment',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_transaction_use_rollback_segment',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8505',
+ descr => 'Компилирует указанный объект (процедура/функция/пакет).',
+ proname => 'dbms_ddl_alter_compile',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 bool',
+ prosrc => 'dbms_ddl_alter_compile',
+ proisstrict => 'f'
+},
+{
+ oid => '8506',
+ descr => 'Изменяет указанную объектную таблицу, чтобы она не была таблицей по умолчанию для ссылок в схеме.',
+ proname => 'dbms_ddl_alter_table_not_referenceable',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'dbms_ddl_alter_table_not_referenceable',
+ proisstrict => 'f'
+},
+{
+ oid => '8507',
+ descr => 'Изменяет указанную объектную таблицу, чтобы она стала таблицей для ссылок в заданной схеме.',
+ proname => 'dbms_ddl_alter_table_referenceable',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'dbms_ddl_alter_table_referenceable',
+ proisstrict => 'f'
+},
+{
+ oid => '8508',
+ descr => 'Выполняет анализ указанного объекта в базе данных.',
+ proname => 'dbms_ddl_analyze_object',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 number number varchar2 varchar2',
+ prosrc => 'dbms_ddl_analyze_object',
+ proisstrict => 'f'
+},
+{
+ oid => '8509',
+ descr => 'Создает обертку для указанного SQL DDL.',
+ proname => 'dbms_ddl_create_wrapped',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_ddl_create_wrapped_ovr1',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8510',
+ descr => 'Создает обертку на основе строки DDL и границ.',
+ proname => 'dbms_ddl_create_wrapped',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '_varchar2 binary_integer binary_integer',
+ prosrc => 'dbms_ddl_create_wrapped_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '8512',
+ descr => 'Возвращает TRUE, если указанный DML или DDL триггер настроен на выполнение один раз.',
+ proname => 'dbms_ddl_is_trigger_fire_once',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'dbms_ddl_is_trigger_fire_once',
+ proisstrict => 'f'
+},
+{
+ oid => '8513',
+ descr => 'Возвращает TRUE, если указанный триггер настроен на выполнение единожды.',
+ proname => 'dbms_ddl_is_trigger_fire_once_internal',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'dbms_ddl_is_trigger_fire_once_internal',
+ proisstrict => 'f'
+},
+{
+ oid => '8514',
+ descr => 'Устанавливает свойства активации для указанного триггера.',
+ proname => 'dbms_ddl_set_trigger_firing_property',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 bool',
+ prosrc => 'dbms_ddl_set_trigger_firing_property_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '8515',
+ descr => 'Устанавливает свойства активации для указанного триггера.',
+ proname => 'dbms_ddl_set_trigger_firing_property',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 binary_integer bool',
+ prosrc => 'dbms_ddl_set_trigger_firing_property_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '8516',
+ descr => 'Создает обертку для указанного SQL DDL.',
+ proname => 'dbms_ddl_wrap',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_ddl_wrap_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '8517',
+ descr => 'Создает обертку на основе планов DDL и заданных границ.',
+ proname => 'dbms_ddl_wrap',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '_varchar2 binary_integer binary_integer',
+ prosrc => 'dbms_ddl_wrap_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '8527',
+ descr => 'Создает обертку на основе планов DDL и заданных границ.',
+ proname => 'dbms_ddl_wrap',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'bytea',
+ prosrc => 'dbms_ddl_wrap_ovr4',
+ proisstrict => 't'
+}
+{
+ oid => '8518',
+ descr => 'This procedure adds content to an existing Multi_Line Data Type',
+ proname => 'owa_text_add2multi',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 record',
+ proallargtypes => '{varchar2,record}',
+ proargmodes => '{i,b}',
+ proargnames => '{STREAM,MLINE}',
+ prosrc => 'owa_text_add2multi_ovr1',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '8519',
+ descr => 'This procedure adds content to an existing Multi_Line Data Type',
+ proname => 'owa_text_add2multi',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 record bool',
+ proallargtypes => '{varchar2,record,bool}',
+ proargmodes => '{i,b,i}',
+ proargnames => '{STREAM,MLINE,CONTINUE}',
+ prosrc => 'owa_text_add2multi_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8520',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_text_new_multi',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => '',
+ prosrc => 'owa_text_new_multi_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '8521',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_text_new_multi',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'record',
+ proallargtypes => '{record}',
+ proargmodes => '{o}',
+ proargnames => '{MLINE}',
+ prosrc => 'owa_text_new_multi_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8522',
+ descr => 'This function or procedure creates a new OWA_TEX.ROW_LIST DATA TYPE.',
+ proname => 'owa_text_new_row_list',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => '',
+ prosrc => 'owa_text_new_row_list_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '8523',
+ descr => 'This function or procedure creates a new OWA_TEX.ROW_LIST DATA TYPE.',
+ proname => 'owa_text_new_row_list',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'record',
+ proallargtypes => '{record}',
+ proargmodes => '{o}',
+ proargnames => '{RLIST}',
+ prosrc => 'owa_text_new_row_list_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8524',
+ descr => 'This procedure uses the PRINT Procedures or the PRN Procedures to print the "rows" field of the OWA_TEXT.MULTI_LINE DATA TYPE.',
+ proname => 'owa_text_print_multi',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'record',
+ proargnames => '{MLINE}',
+ prosrc => 'owa_text_print_multi',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8525',
+ descr => 'This procedure uses the PRINT Procedures or the PRN Procedures to print the "rows" field of the OWA_TEXT.ROW_LIST DATA TYPE.',
+ proname => 'owa_text_print_row_list',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'record',
+ proargnames => '{RLINE}',
+ prosrc => 'owa_text_print_row_list',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '8526',
+ descr => 'This procedure converts a string to a multi_line data type.',
+ proname => 'owa_text_stream2multi',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'varchar2 record',
+ proallargtypes => '{varchar2,record}',
+ proargmodes => '{i,o}',
+ proargnames => '{STREAM,MLINE}',
+ prosrc => 'owa_text_stream2multi',
+ proisstrict => 'f'
+},
+{
+ oid => '8528',
+ descr => 'This procedure converts a string to a multi_line data type.',
+ proname => 'owa_text_stream2multi2',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'varchar2 record int4',
+ proallargtypes => '{varchar2,record,int4}',
+ proargmodes => '{i,o,i}',
+ proargnames => '{STREAM,MLINE,LEN}',
+ prosrc => 'owa_text_stream2multi2',
+ proisstrict => 'f'
+},
+# BEGIN QDB_DBMS_GEN htf_internal
+{
+ oid => '11653',
+ descr => 'генерирует теги <ADDRESS> и </ADDRESS>, которые задают адрес, автора и подпись документа.',
+ proname => 'htf_address',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_address',
+ proisstrict => 'f'
+},
+{
+ oid => '11654',
+ descr => 'как и функция ANCHOR2, генерирует HTML-теги <A> и </A>, задающие источник или назначение гиперссылки.',
+ proname => 'htf_anchor',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_anchor',
+ proisstrict => 'f'
+},
+{
+ oid => '11655',
+ descr => 'как и функция ANCHOR, генерирует HTML-теги <A> и </A>, задающие источник или назначение гиперссылки.',
+ proname => 'htf_anchor2',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_anchor2',
+ proisstrict => 'f'
+},
+{
+ oid => '11656',
+ descr => 'генерирует тег <APPLET>, который начинает выполнение Java-апплета.',
+ proname => 'htf_appletopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number number varchar2',
+ prosrc => 'htf_appletopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11657',
+ descr => 'генерирует тег <AREA>, который определяет активные области на клиентской карте изображения.',
+ proname => 'htf_area',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_area',
+ proisstrict => 'f'
+},
+{
+ oid => '11658',
+ descr => 'генерирует тег <BASE>, который записывает базовый URL документа.',
+ proname => 'htf_base',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_base',
+ proisstrict => 'f'
+},
+{
+ oid => '11659',
+ descr => 'генерирует тег <BASEFONT>, который задает базовый размер шрифта для веб-страницы.',
+ proname => 'htf_basefont',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'number varchar2',
+ prosrc => 'htf_basefont',
+ proisstrict => 'f'
+},
+{
+ oid => '11660',
+ descr => 'генерирует тег <BGSOUND>, который добавляет фоновый звук на веб-страницу.',
+ proname => 'htf_bgsound',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_bgsound',
+ proisstrict => 'f'
+},
+{
+ oid => '11661',
+ descr => 'генерирует теги <BIG> и </BIG>, которые указывают браузеру отображать текст увеличенным шрифтом.',
+ proname => 'htf_big',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_big',
+ proisstrict => 'f'
+},
+{
+ oid => '11662',
+ descr => 'генерирует тег <BLOCKQUOTE>, который отмечает начало блока цитируемого текста.',
+ proname => 'htf_blockquoteopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_blockquoteopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11663',
+ descr => 'генерирует тег <BODY>, который отмечает начало тела HTML-документа.',
+ proname => 'htf_bodyopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_bodyopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11664',
+ descr => 'генерирует теги <B> и </B>, которые указывают браузеру отображать текст жирным шрифтом.',
+ proname => 'htf_bold',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_bold',
+ proisstrict => 'f'
+},
+{
+ oid => '11665',
+ descr => 'генерирует тег <BR>, который начинает новую строку текста.',
+ proname => 'htf_br',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_br',
+ proisstrict => 'f'
+},
+{
+ oid => '11666',
+ descr => 'генерирует теги <CENTER> и </CENTER>, которые центрируют секцию текста на веб-странице.',
+ proname => 'htf_center',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_center',
+ proisstrict => 'f'
+},
+{
+ oid => '11667',
+ descr => 'генерирует теги <CITE> и </CITE>, которые указывают браузеру отображать текст как цитату.',
+ proname => 'htf_cite',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_cite',
+ proisstrict => 'f'
+},
+{
+ oid => '11668',
+ descr => 'генерирует теги <CODE> и </CODE>, которые указывают браузеру отображать текст моноширинным шрифтом.',
+ proname => 'htf_code',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_code',
+ proisstrict => 'f'
+},
+{
+ oid => '11669',
+ descr => 'возвращает Unicode кодовую точку для указанного символа.',
+ proname => 'htf_codepoint',
+ provolatile => 'v',
+ prorettype => 'binary_integer',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_codepoint',
+ proisstrict => 'f'
+},
+{
+ oid => '11670',
+ descr => 'генерирует HTML-комментарий.',
+ proname => 'htf_comment',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_comment',
+ proisstrict => 'f'
+},
+{
+ oid => '11671',
+ descr => 'генерирует теги <DFN> и </DFN>, которые указывают браузеру выделять текст как определение.',
+ proname => 'htf_dfn',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_dfn',
+ proisstrict => 'f'
+},
+{
+ oid => '11672',
+ descr => 'генерирует тег <DIV>, который создает разделы документа.',
+ proname => 'htf_div',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_div',
+ proisstrict => 'f'
+},
+{
+ oid => '11673',
+ descr => 'генерирует тег <DD>, который вставляет определение термина в список определений.',
+ proname => 'htf_dlistdef',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_dlistdef',
+ proisstrict => 'f'
+},
+{
+ oid => '11674',
+ descr => 'генерирует тег <DL>, который начинает список определений.',
+ proname => 'htf_dlistopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_dlistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11675',
+ descr => 'генерирует тег <DT>, который определяет термин в списке определений.',
+ proname => 'htf_dlistterm',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_dlistterm',
+ proisstrict => 'f'
+},
+{
+ oid => '11676',
+ descr => 'генерирует теги <EM> и </EM>, которые определяют текст для выделения.',
+ proname => 'htf_em',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_em',
+ proisstrict => 'f'
+},
+{
+ oid => '11677',
+ descr => 'генерирует теги <EM> и </EM>, которые определяют текст для выделения (синоним EM).',
+ proname => 'htf_emphasis',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_emphasis',
+ proisstrict => 'f'
+},
+{
+ oid => '11678',
+ descr => 'заменяет символы, имеющие специальное значение в HTML, их escape-последовательностями.',
+ proname => 'htf_escape_sc',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_escape_sc',
+ proisstrict => 'f'
+},
+{
+ oid => '11679',
+ descr => 'эта устаревшая функция заменяет символы, имеющие специальное значение в HTML и HTTP, их escape-последовательностями.',
+ proname => 'htf_escape_url',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_escape_url',
+ proisstrict => 'f'
+},
+{
+ oid => '11680',
+ descr => 'генерирует тег <FONT>, отмечающий начало секции текста с указанными характеристиками шрифта.',
+ proname => 'htf_fontopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_fontopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11681',
+ descr => 'форматирует значения колонок внутри HTML-таблицы, используя функцию TABLEDATA. Позволяет лучше управлять HTML-таблицами.',
+ proname => 'htf_format_cell',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_format_cell',
+ proisstrict => 'f'
+},
+{
+ oid => '11682',
+ descr => 'генерирует тег <INPUT> с TYPE="checkbox", создающий элемент флажка в форме.',
+ proname => 'htf_formcheckbox',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_formcheckbox',
+ proisstrict => 'f'
+},
+{
+ oid => '11683',
+ descr => 'генерирует тег <INPUT> с TYPE="file", создающий элемент для загрузки файлов.',
+ proname => 'htf_formfile',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_formfile',
+ proisstrict => 'f'
+},
+{
+ oid => '11684',
+ descr => 'генерирует тег <INPUT> с TYPE="hidden", создающий скрытый элемент формы.',
+ proname => 'htf_formhidden',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_formhidden',
+ proisstrict => 'f'
+},
+{
+ oid => '11685',
+ descr => 'генерирует тег <INPUT> с TYPE="image", создающий поле-изображение для немедленной отправки формы.',
+ proname => 'htf_formimage',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_formimage',
+ proisstrict => 'f'
+},
+{
+ oid => '11686',
+ descr => 'генерирует тег <FORM>, отмечающий начало секции формы в HTML-документе.',
+ proname => 'htf_formopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_formopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11687',
+ descr => 'генерирует тег <INPUT> с TYPE="password", создающий поле для ввода пароля.',
+ proname => 'htf_formpassword',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_formpassword',
+ proisstrict => 'f'
+},
+{
+ oid => '11688',
+ descr => 'генерирует тег <INPUT> с TYPE="radio", создающий переключатель в HTML-форме.',
+ proname => 'htf_formradio',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_formradio',
+ proisstrict => 'f'
+},
+{
+ oid => '11689',
+ descr => 'генерирует тег <INPUT> с TYPE="reset", создающий кнопку сброса формы.',
+ proname => 'htf_formreset',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_formreset',
+ proisstrict => 'f'
+},
+{
+ oid => '11690',
+ descr => 'генерирует тег <SELECT>, создающий элемент выбора в форме.',
+ proname => 'htf_formselectopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 number varchar2',
+ prosrc => 'htf_formselectopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11691',
+ descr => 'генерирует тег <OPTION>, представляющий один пункт выбора в элементе SELECT.',
+ proname => 'htf_formselectoption',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_formselectoption',
+ proisstrict => 'f'
+},
+{
+ oid => '11692',
+ descr => 'генерирует тег <INPUT> с TYPE="submit", создающий кнопку отправки формы.',
+ proname => 'htf_formsubmit',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_formsubmit',
+ proisstrict => 'f'
+},
+{
+ oid => '11693',
+ descr => 'генерирует тег <INPUT> с TYPE="text", создающий поле для ввода одной строки текста.',
+ proname => 'htf_formtext',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_formtext',
+ proisstrict => 'f'
+},
+{
+ oid => '11694',
+ descr => 'генерирует тег <TEXTAREA>, создающий многострочное текстовое поле.',
+ proname => 'htf_formtextarea',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number number varchar2 varchar2',
+ prosrc => 'htf_formtextarea',
+ proisstrict => 'f'
+},
+{
+ oid => '11695',
+ descr => 'генерирует тег <TEXTAREA> с поддержкой атрибута WRAP.',
+ proname => 'htf_formtextarea2',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number number varchar2 varchar2 varchar2',
+ prosrc => 'htf_formtextarea2',
+ proisstrict => 'f'
+},
+{
+ oid => '11696',
+ descr => 'генерирует открывающий тег <TEXTAREA> для многострочного текстового поля.',
+ proname => 'htf_formtextareaopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number number varchar2 varchar2',
+ prosrc => 'htf_formtextareaopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11697',
+ descr => 'генерирует открывающий тег <TEXTAREA> с поддержкой атрибута WRAP.',
+ proname => 'htf_formtextareaopen2',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number number varchar2 varchar2 varchar2',
+ prosrc => 'htf_formtextareaopen2',
+ proisstrict => 'f'
+},
+{
+ oid => '11698',
+ descr => 'генерирует тег <FRAME>, определяющий характеристики фрейма в наборе <FRAMESET>.',
+ proname => 'htf_frame',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_frame',
+ proisstrict => 'f'
+},
+{
+ oid => '11699',
+ descr => 'генерирует тег <FRAMESET>, определяющий набор фреймов.',
+ proname => 'htf_framesetopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_framesetopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11700',
+ descr => 'генерирует парные теги заголовков <H1>-<H6>.',
+ proname => 'htf_header',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'number varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_header',
+ proisstrict => 'f'
+},
+{
+ oid => '11701',
+ descr => 'генерирует тег <HR>, создающий горизонтальную линию в HTML-документе.',
+ proname => 'htf_hr',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_hr',
+ proisstrict => 'f'
+},
+{
+ oid => '11702',
+ descr => 'устаревшая функция для создания заголовков (используйте HEADER).',
+ proname => 'htf_htitle',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_htitle',
+ proisstrict => 'f'
+},
+{
+ oid => '11703',
+ descr => 'генерирует тег <IMG>, встраивающий изображение в HTML-страницу.',
+ proname => 'htf_img',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_img',
+ proisstrict => 'f'
+},
+{
+ oid => '11704',
+ descr => 'генерирует тег <IMG> с поддержкой клиентских карт.',
+ proname => 'htf_img2',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_img2',
+ proisstrict => 'f'
+},
+{
+ oid => '11705',
+ descr => 'создает однострочное поле ввода с подсказкой для поиска.',
+ proname => 'htf_isindex',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_isindex',
+ proisstrict => 'f'
+},
+{
+ oid => '11706',
+ descr => 'генерирует теги <I> и </I> для отображения текста курсивом.',
+ proname => 'htf_italic',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_italic',
+ proisstrict => 'f'
+},
+{
+ oid => '11707',
+ descr => 'генерирует теги <KBD> и </KBD> для отображения клавиатурного ввода.',
+ proname => 'htf_kbd',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_kbd',
+ proisstrict => 'f'
+},
+{
+ oid => '11708',
+ descr => 'синоним функции KBD.',
+ proname => 'htf_keyboard',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_keyboard',
+ proisstrict => 'f'
+},
+{
+ oid => '11709',
+ descr => 'синоним функции HR (горизонтальная линия).',
+ proname => 'htf_line',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_line',
+ proisstrict => 'f'
+},
+{
+ oid => '11710',
+ descr => 'генерирует тег <LINK> с атрибутом REL.',
+ proname => 'htf_linkrel',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_linkrel',
+ proisstrict => 'f'
+},
+{
+ oid => '11711',
+ descr => 'генерирует тег <LINK> с атрибутом REV.',
+ proname => 'htf_linkrev',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_linkrev',
+ proisstrict => 'f'
+},
+{
+ oid => '11712',
+ descr => 'генерирует теги <LH> и </LH> для заголовка списка.',
+ proname => 'htf_listheader',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_listheader',
+ proisstrict => 'f'
+},
+{
+ oid => '11713',
+ descr => 'генерирует тег <LI> для элемента списка.',
+ proname => 'htf_listitem',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_listitem',
+ proisstrict => 'f'
+},
+{
+ oid => '11714',
+ descr => 'генерирует mailto-ссылку на email-адрес.',
+ proname => 'htf_mailto',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_mailto',
+ proisstrict => 'f'
+},
+{
+ oid => '11715',
+ descr => 'генерирует тег <MAP> для начала определения карты изображения.',
+ proname => 'htf_mapopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_mapopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11716',
+ descr => 'генерирует тег <META> для мета-информации документа.',
+ proname => 'htf_meta',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_meta',
+ proisstrict => 'f'
+},
+{
+ oid => '11717',
+ descr => 'устаревшая функция для указания следующего идентификатора.',
+ proname => 'htf_nextid',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_nextid',
+ proisstrict => 'f'
+},
+{
+ oid => '11718',
+ descr => 'синоним функции BR (новая строка).',
+ proname => 'htf_nl',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_nl',
+ proisstrict => 'f'
+},
+{
+ oid => '11719',
+ descr => 'генерирует теги <NOBR> и </NOBR> для отключения переноса строк.',
+ proname => 'htf_nobr',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_nobr',
+ proisstrict => 'f'
+},
+{
+ oid => '11720',
+ descr => 'генерирует тег <OL> для начала нумерованного списка.',
+ proname => 'htf_olistopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_olistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11721',
+ descr => 'генерирует открывающий тег <P> с атрибутами.',
+ proname => 'htf_paragraph',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_paragraph',
+ proisstrict => 'f'
+},
+{
+ oid => '11722',
+ descr => 'генерирует тег <PARAM> для задания параметров Java-апплета.',
+ proname => 'htf_param',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_param',
+ proisstrict => 'f'
+},
+{
+ oid => '11723',
+ descr => 'генерирует теги <PLAINTEXT> для отображения текста фиксированным шрифтом.',
+ proname => 'htf_plaintext',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_plaintext',
+ proisstrict => 'f'
+},
+{
+ oid => '11724',
+ descr => 'генерирует тег <PRE> для предварительно форматированного текста.',
+ proname => 'htf_preopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_preopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11725',
+ descr => 'генерирует теги <S> и </S> для перечеркнутого текста.',
+ proname => 'htf_s',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_s',
+ proisstrict => 'f'
+},
+{
+ oid => '11726',
+ descr => 'генерирует теги <SAMP> для отображения образцов вывода.',
+ proname => 'htf_sample',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_sample',
+ proisstrict => 'f'
+},
+{
+ oid => '11727',
+ descr => 'генерирует теги <SCRIPT> для встраивания скриптов.',
+ proname => 'htf_script',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_script',
+ proisstrict => 'f'
+},
+{
+ oid => '11728',
+ descr => 'устанавливает режим экранирования HTML-символов.',
+ proname => 'htf_set_html_escaping_mode',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_set_html_escaping_mode',
+ proisstrict => 'f'
+},
+{
+ oid => '11729',
+ descr => 'генерирует теги <SMALL> и </SMALL> для мелкого текста.',
+ proname => 'htf_small',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_small',
+ proisstrict => 'f'
+},
+{
+ oid => '11730',
+ descr => 'генерирует теги <STRIKE> и </STRIKE> для зачеркнутого текста.',
+ proname => 'htf_strike',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_strike',
+ proisstrict => 'f'
+},
+{
+ oid => '11731',
+ descr => 'генерирует теги <STRONG> и </STRONG> для выделения жирным шрифтом.',
+ proname => 'htf_strong',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_strong',
+ proisstrict => 'f'
+},
+{
+ oid => '11732',
+ descr => 'генерирует теги <STYLE> и </STYLE> для встраивания CSS.',
+ proname => 'htf_style',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_style',
+ proisstrict => 'f'
+},
+{
+ oid => '11733',
+ descr => 'генерирует теги <SUB> и </SUB> для нижнего индекса.',
+ proname => 'htf_sub',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_sub',
+ proisstrict => 'f'
+},
+{
+ oid => '11734',
+ descr => 'генерирует теги <SUP> и </SUP> для верхнего индекса.',
+ proname => 'htf_sup',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_sup',
+ proisstrict => 'f'
+},
+{
+ oid => '11735',
+ descr => 'генерирует теги <CAPTION> и </CAPTION> для заголовка таблицы.',
+ proname => 'htf_tablecaption',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'htf_tablecaption',
+ proisstrict => 'f'
+},
+{
+ oid => '11736',
+ descr => 'генерирует теги <TD> и </TD> для ячейки данных таблицы.',
+ proname => 'htf_tabledata',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_tabledata',
+ proisstrict => 'f'
+},
+{
+ oid => '11737',
+ descr => 'генерирует теги <TH> и </TH> для ячейки-заголовка таблицы.',
+ proname => 'htf_tableheader',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_tableheader',
+ proisstrict => 'f'
+},
+{
+ oid => '11738',
+ descr => 'генерирует тег <TABLE> для начала HTML-таблицы.',
+ proname => 'htf_tableopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_tableopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11739',
+ descr => 'генерирует тег <TR> для начала строки таблицы.',
+ proname => 'htf_tablerowopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_tablerowopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11740',
+ descr => 'генерирует теги <TT> и </TT> для текста фиксированной ширины.',
+ proname => 'htf_teletype',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_teletype',
+ proisstrict => 'f'
+},
+{
+ oid => '11741',
+ descr => 'генерирует теги <TITLE> и </TITLE> для заголовка окна браузера.',
+ proname => 'htf_title',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_title',
+ proisstrict => 'f'
+},
+{
+ oid => '11742',
+ descr => 'генерирует тег <UL> для начала ненумерованного списка.',
+ proname => 'htf_ulistopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'htf_ulistopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11743',
+ descr => 'генерирует теги <U> и </U> для подчеркнутого текста.',
+ proname => 'htf_underline',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_underline',
+ proisstrict => 'f'
+},
+{
+ oid => '11744',
+ descr => 'генерирует теги <VAR> и </VAR> для обозначения переменной.',
+ proname => 'htf_variable',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'htf_variable',
+ proisstrict => 'f'
+},
+# END QDB_DBMS_GEN htf_internal
+{
+ oid => '11748',
+ descr => 'Очищает список ключевых столбцов.',
+ proname => 'dbms_xmlstore_clearkeycolumnlist',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ prosrc => 'dbms_xmlstore_clearkeycolumnlist',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '11749',
+ descr => 'Очищает список обновляемых столбцов.',
+ proname => 'dbms_xmlstore_clearupdatecolumnlist',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ prosrc => 'dbms_xmlstore_clearupdatecolumnlist',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '11750',
+ descr => 'Закрывает и освобождает конкретный контекст сохранения.',
+ proname => 'dbms_xmlstore_closecontext',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ prosrc => 'dbms_xmlstore_closecontext',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '9976',
+ descr => 'Закрывает и освобождает конкретный контекст сохранения с дополнительным служебным параметром.',
+ proname => 'dbms_xmlstore_closecontext_tmp',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 int4',
+ proargnames => '{ctxhdl,service_arg}',
+ prosrc => 'dbms_xmlstore_closecontext_tmp',
+ proisstrict => 'f'
+},
+{
+ oid => '11751',
+ descr => 'Удаляет записи, соответствующие данным из XML-документа, из таблицы, указанной во время создания контекста.',
+ proname => 'dbms_xmlstore_deletexml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlstore_deletexml_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11752',
+ descr => 'Удаляет записи, соответствующие данным из XML-документа, из таблицы, указанной во время создания контекста.',
+ proname => 'dbms_xmlstore_deletexml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 xmltype',
+ prosrc => 'dbms_xmlstore_deletexml_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11753',
+ descr => 'Вставляет XML-документ в таблицу, указанную при создании контекста.',
+ proname => 'dbms_xmlstore_insertxml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlstore_insertxml_ovr1',
+ proisstrict => 't'
+},
+{
+ oid => '11754',
+ descr => 'Вставляет XML-документ в таблицу, указанную при создании контекста.',
+ proname => 'dbms_xmlstore_insertxml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 xmltype',
+ prosrc => 'dbms_xmlstore_insertxml_ovr2',
+ proisstrict => 't'
+},
+{
+ oid => '11755',
+ descr => 'CREATE CONTEXT создает контекст сохранения и возвращает дескриптор контекста.',
+ proname => 'dbms_xmlstore_newcontext',
+ provolatile => 'v',
+ prorettype => 'int4',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_xmlstore_newcontext',
+ proisstrict => 'f'
+},
+{
+ oid => '11756',
+ descr => 'Метод добавляет столбец в список ключевых столбцов.',
+ proname => 'dbms_xmlstore_setkeycolumn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlstore_setkeycolumn',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '11757',
+ descr => 'Устанавливает флаг, определяющий сохранение символов пробела при обработке XML-документа.',
+ proname => 'dbms_xmlstore_setpreservewhitespace',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number bool',
+ prosrc => 'dbms_xmlstore_setpreservewhitespace',
+ proisstrict => 'f'
+},
+{
+ oid => '11758',
+ descr => 'Назначает тег, используемый для группировки элементов XML, соответствующих записям базы данных.',
+ proname => 'dbms_xmlstore_setrowtag',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlstore_setrowtag',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '11759',
+ descr => 'Метод добавляет столбец в список обновляемых столбцов.',
+ proname => 'dbms_xmlstore_setupdatecolumn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlstore_setupdatecolumn',
+ proisstrict => 't',
+ prokind => 'p'
+},
+{
+ oid => '11760',
+ descr => 'Обновляет таблицу на основании данных из XML-документа.',
+ proname => 'dbms_xmlstore_updatexml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlstore_updatexml_ovr1',
+ proisstrict => 't'
+},
+{
+ oid => '11761',
+ descr => 'Обновляет таблицу на основании данных из XML-документа.',
+ proname => 'dbms_xmlstore_updatexml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 xmltype',
+ prosrc => 'dbms_xmlstore_updatexml_ovr2',
+ proisstrict => 't'
+},
+{
+ oid => '11339',
+ descr => 'Подбирает экспоненциальное распределение для числовой колонки.',
+ proname => 'dbms_stat_funcs_exponential_dist_fit',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'text text text text numeric numeric',
+ proallargtypes => '{text,text,text,text,numeric,numeric,numeric}',
+ proargmodes => '{i,i,i,i,b,b,o}',
+ proargnames => '{ownername,tablename,columnname,test_type,lambda,mu,sig}',
+ prokind => 'f',
+ prosrc => 'dbms_stat_funcs_exponential_dist_fit',
+ proisstrict => 'f'
+},
+{
+ oid => '11340',
+ descr => 'Подбирает нормальное распределение для числовой колонки.',
+ proname => 'dbms_stat_funcs_normal_dist_fit',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'text text text text numeric numeric',
+ proallargtypes => '{text,text,text,text,numeric,numeric,numeric}',
+ proargmodes => '{i,i,i,i,b,b,o}',
+ proargnames => '{ownername,tablename,columnname,test_type,mean,stdev,sig}',
+ prokind => 'f',
+ prosrc => 'dbms_stat_funcs_normal_dist_fit',
+ proisstrict => 'f'
+},
+{
+ oid => '14782',
+ descr => 'Вычисляет значимость статистики Колмогорова-Смирнова.',
+ proname => 'dbms_stat_funcs_ks_pvalue',
+ provolatile => 'i',
+ prorettype => 'float8',
+ proargtypes => 'float8 int4',
+ proargnames => '{statistic,sample_count}',
+ prosrc => 'dbms_stat_funcs_ks_pvalue',
+ proisstrict => 'f',
+ proparallel => 's'
+},
+{
+ oid => '11341',
+ descr => 'Подбирает распределение Пуассона для числовой колонки.',
+ proname => 'dbms_stat_funcs_poisson_dist_fit',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'text text text text numeric',
+ proallargtypes => '{text,text,text,text,numeric,numeric}',
+ proargmodes => '{i,i,i,i,b,o}',
+ proargnames => '{ownername,tablename,columnname,test_type,lambda,sig}',
+ prokind => 'f',
+ prosrc => 'dbms_stat_funcs_poisson_dist_fit',
+ proisstrict => 'f'
+},
+{
+ oid => '11342',
+ descr => 'Возвращает сводную статистику по числовой колонке.',
+ proname => 'dbms_stat_funcs_summary',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'text text text numeric',
+ proallargtypes => '{text,text,text,numeric,numeric,numeric,numeric,numeric,numeric,_numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,_numeric,_numeric,_numeric}',
+ proargmodes => '{i,i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}',
+ proargnames => '{ownername,tablename,columnname,sigma_value,count,min,max,range,mean,cmode,variance,stddev,quantile_5,quantile_25,median,quantile_75,quantile_95,plus_x_sigma,minus_x_sigma,extreme_values,top_5_values,bottom_5_values}',
+ prosrc => 'dbms_stat_funcs_summary',
+ proisstrict => 'f'
+},
+{
+ oid => '11343',
+ descr => 'Подбирает равномерное распределение для числовой колонки.',
+ proname => 'dbms_stat_funcs_uniform_dist_fit',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'text text text text text numeric numeric',
+ proallargtypes => '{text,text,text,text,text,numeric,numeric,numeric}',
+ proargmodes => '{i,i,i,i,i,b,b,o}',
+ proargnames => '{ownername,tablename,columnname,var_type,test_type,parama,paramb,sig}',
+ prokind => 'f',
+ prosrc => 'dbms_stat_funcs_uniform_dist_fit',
+ proisstrict => 'f'
+},
+{
+ oid => '11344',
+ descr => 'Подбирает распределение Вейбулла для числовой колонки.',
+ proname => 'dbms_stat_funcs_weibull_dist_fit',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'text text text text numeric numeric numeric',
+ proallargtypes => '{text,text,text,text,numeric,numeric,numeric,numeric}',
+ proargmodes => '{i,i,i,i,b,b,b,o}',
+ proargnames => '{ownername,tablename,columnname,test_type,alpha,mu,beta,sig}',
+ prokind => 'f',
+ prosrc => 'dbms_stat_funcs_weibull_dist_fit',
+ proisstrict => 'f'
+},
+{
+ oid => '11345',
+ descr => 'Неподдерживаемая compatibility-функция DBMS_SQLSET.ADD_REFERENCE',
+ proname => 'dbms_sqlset_add_reference',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'text text text',
+ proargnames => '{sqlset_name,description,sqlset_owner}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_add_reference',
+ proisstrict => 'f'
+},
+{
+ oid => '11346',
+ descr => 'Создаёт session-local SQL tuning set текущего пользователя',
+ proname => 'dbms_sqlset_create_sqlset_0',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'text text text',
+ proargnames => '{sqlset_name,description,sqlset_owner}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_create_sqlset',
+ proisstrict => 'f'
+},
+{
+ oid => '11347',
+ descr => 'Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_CURSOR_CACHE',
+ proname => 'dbms_sqlset_select_cursor_cache',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => 'text text text text text numeric numeric text text',
+ proargnames => '{basic_filter,object_filter,ranking_measure1,ranking_measure2,ranking_measure3,result_percentage,result_limit,attribute_list,recursive_sql}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_select_cursor_cache',
+ proisstrict => 'f'
+},
+{
+ oid => '11348',
+ descr => 'Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_SQLPA_TASK',
+ proname => 'dbms_sqlset_select_sqlpa_task',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => 'text text text text text text text',
+ proargnames => '{task_name,task_owner,execution_name,level_filter,basic_filter,object_filter,attribute_list}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_select_sqlpa_task',
+ proisstrict => 'f'
+},
+{
+ oid => '11349',
+ descr => 'Возвращает поддерживаемые строки session-local SQL tuning set как именованный record',
+ proname => 'dbms_sqlset_select_sqlset',
+ provolatile => 'v',
+ proretset => 't',
+ prorettype => 'record',
+ proargtypes => 'text text text text text text numeric numeric text text text text',
+ proallargtypes => '{text,text,text,text,text,text,numeric,numeric,text,text,text,text,text,numeric,text,text,text,text,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,bytea,numeric,numeric,text,numeric,numeric,text,numeric,numeric,text,numeric,numeric,numeric,text,text,text,numeric,numeric,numeric,text}',
+ proargmodes => '{i,i,i,i,i,i,i,i,i,i,i,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,o,o,o,o,o,o,o,o,o,o,o,o}',
+ proargnames => '{sqlset_name,basic_filter,object_filter,ranking_measure1,ranking_measure2,ranking_measure3,result_percentage,result_limit,attribute_list,plan_filter,sqlset_owner,recursive_sql,sql_id,force_matching_signature,sql_text,parsing_schema_name,module,action,elapsed_time,cpu_time,buffer_gets,disk_reads,direct_writes,rows_processed,fetches,executions,end_of_fetch_count,optimizer_cost,optimizer_env,priority,command_type,first_load_time,stat_period,active_stat_period,other,plan_hash_value,con_dbid,last_exec_start_time,sharable_mem,exact_matching_signature,result_cache_executions,sql_profile,sql_plan_baseline,sql_patch,avg_hard_parse_time,user_io_wait_time,io_interconnect_bytes,parsing_user_name}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_select_sqlset',
+ proisstrict => 'f'
+},
+{
+ oid => '14783',
+ descr => 'Нормализует список атрибутов SQLSET для выборки строк SQL tuning set.',
+ proname => 'dbms_sqlset_normalize_attribute_list',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => 'text',
+ proargnames => '{attribute_list}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_normalize_attribute_list',
+ proisstrict => 'f',
+ proparallel => 's'
+},
+{
+ oid => '11350',
+ descr => 'Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_SQL_TRACE',
+ proname => 'dbms_sqlset_select_sql_trace',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => 'text text text text numeric numeric text text numeric',
+ proargnames => '{directory,file_name,mapping_table_name,mapping_table_owner,select_mode,options,pattern_start,pattern_end,result_limit}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_select_sql_trace',
+ proisstrict => 'f'
+},
+{
+ oid => '11351',
+ descr => 'Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_WORKLOAD_REPOSITORY',
+ proname => 'dbms_sqlset_select_workload_repository',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => 'numeric numeric text text text text text numeric numeric text text numeric',
+ proargnames => '{begin_snap,end_snap,basic_filter,object_filter,ranking_measure1,ranking_measure2,ranking_measure3,result_percentage,result_limit,attribute_list,recursive_sql,dbid}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_select_workload_repository_0',
+ proisstrict => 'f'
+},
+{
+ oid => '11352',
+ descr => 'Неподдерживаемая compatibility-функция DBMS_SQLSET.SELECT_WORKLOAD_REPOSITORY',
+ proname => 'dbms_sqlset_select_workload_repository',
+ provolatile => 'v',
+ proretset => 't',
+ prorows => '1000',
+ prorettype => 'record',
+ proargtypes => 'text text text text text text numeric numeric text text numeric',
+ proargnames => '{baseline_name,basic_filter,object_filter,ranking_measure1,ranking_measure2,ranking_measure3,result_percentage,result_limit,attribute_list,recursive_sql,dbid}',
+ prokind => 'f',
+ prosrc => 'dbms_sqlset_select_workload_repository_1',
+ proisstrict => 'f'
+},
+{
+ oid => '11353',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.CAPTURE_CURSOR_CACHE',
+ proname => 'dbms_sqlset_capture_cursor_cache',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text numeric numeric text numeric text text text',
+ proargnames => '{sqlset_name,time_limit,repeat_interval,capture_option,capture_mode,basic_filter,sqlset_owner,recursive_sql}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_capture_cursor_cache',
+ proisstrict => 'f'
+},
+{
+ oid => '11354',
+ descr => 'Создаёт session-local SQL tuning set текущего пользователя',
+ proname => 'dbms_sqlset_create_sqlset_1',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text text',
+ proargnames => '{sqlset_name,description,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_create_sqlset_proc',
+ proisstrict => 'f'
+},
+{
+ oid => '11355',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.CREATE_STGTAB',
+ proname => 'dbms_sqlset_create_stgtab',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text text numeric',
+ proargnames => '{table_name,schema_name,tablespace_name,db_version}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_create_stgtab',
+ proisstrict => 'f'
+},
+{
+ oid => '11356',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.DELETE_SQLSET',
+ proname => 'dbms_sqlset_delete_sqlset',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text text',
+ proargnames => '{sqlset_name,basic_filter,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_delete_sqlset',
+ proisstrict => 'f'
+},
+{
+ oid => '11357',
+ descr => 'Удаляет session-local SQL tuning set текущего пользователя',
+ proname => 'dbms_sqlset_drop_sqlset',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text',
+ proargnames => '{sqlset_name,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_drop_sqlset',
+ proisstrict => 'f'
+},
+{
+ oid => '11358',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.DROP_SQLSET_BY_PREFIX',
+ proname => 'dbms_sqlset_drop_sqlset_by_prefix',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text numeric numeric',
+ proargnames => '{sqlset_prefix,expiration_days,time_limit}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_drop_sqlset_by_prefix',
+ proisstrict => 'f'
+},
+{
+ oid => '11359',
+ descr => 'Загружает строки из refcursor в session-local SQL tuning set текущего пользователя',
+ proname => 'dbms_sqlset_load_sqlset',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text refcursor text text text text bool numeric text',
+ proargnames => '{sqlset_name,populate_cursor,load_option,update_option,update_condition,update_attributes,ignore_null,commit_rows,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_load_sqlset',
+ proisstrict => 'f'
+},
+{
+ oid => '11360',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.PACK_STGTAB',
+ proname => 'dbms_sqlset_pack_stgtab',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text text text numeric',
+ proargnames => '{sqlset_name,sqlset_owner,staging_table_name,staging_schema_owner,db_version}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_pack_stgtab',
+ proisstrict => 'f'
+},
+{
+ oid => '11361',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.REMAP_STGTAB',
+ proname => 'dbms_sqlset_remap_stgtab',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text text text text text numeric numeric',
+ proargnames => '{old_sqlset_name,old_sqlset_owner,new_sqlset_name,new_sqlset_owner,staging_table_name,staging_schema_owner,old_con_dbid,new_con_dbid}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_remap_stgtab',
+ proisstrict => 'f'
+},
+{
+ oid => '11362',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.REMOVE_REFERENCE',
+ proname => 'dbms_sqlset_remove_reference',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text numeric text numeric',
+ proargnames => '{sqlset_name,reference_id,sqlset_owner,force_remove}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_remove_reference',
+ proisstrict => 'f'
+},
+{
+ oid => '11363',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.UNPACK_STGTAB',
+ proname => 'dbms_sqlset_unpack_stgtab',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text text text text',
+ proargnames => '{sqlset_name,sqlset_owner,replace,staging_table_name,staging_schema_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_unpack_stgtab',
+ proisstrict => 'f'
+},
+{
+ oid => '11364',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.UPDATE_SQLSET',
+ proname => 'dbms_sqlset_update_sqlset_0',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text numeric text text text',
+ proargnames => '{sqlset_name,sql_id,plan_hash_value,attribute_name,attribute_value,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_update_sqlset_0',
+ proisstrict => 'f'
+},
+{
+ oid => '11365',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.UPDATE_SQLSET',
+ proname => 'dbms_sqlset_update_sqlset_1',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text numeric text text text',
+ proargnames => '{sqlset_name,sql_id,plan_hash_value,attribute_name,attribute_value,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_update_sqlset_1',
+ proisstrict => 'f'
+},
+{
+ oid => '11366',
+ descr => 'Неподдерживаемая compatibility-процедура DBMS_SQLSET.UPDATE_SQLSET',
+ proname => 'dbms_sqlset_update_sqlset_2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'text text numeric text numeric text',
+ proargnames => '{sqlset_name,sql_id,plan_hash_value,attribute_name,attribute_value,sqlset_owner}',
+ prokind => 'p',
+ prosrc => 'dbms_sqlset_update_sqlset_2',
+ proisstrict => 'f'
+},
+{
+ oid => '11367',
+ descr => 'Возвращает константу DBMS_SQLSET.MODE_REPLACE_OLD_STATS.',
+ proname => 'dbms_sqlset_mode_replace_old_stats',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_mode_replace_old_stats',
+ proisstrict => 'f'
+},
+{
+ oid => '11368',
+ descr => 'Возвращает константу DBMS_SQLSET.MODE_ACCUMULATE_STATS.',
+ proname => 'dbms_sqlset_mode_accumulate_stats',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_mode_accumulate_stats',
+ proisstrict => 'f'
+},
+{
+ oid => '11369',
+ descr => 'Возвращает константу DBMS_SQLSET.HAS_RECURSIVE_SQL.',
+ proname => 'dbms_sqlset_has_recursive_sql',
+ provolatile => 's',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_has_recursive_sql',
+ proisstrict => 'f'
+},
+{
+ oid => '11370',
+ descr => 'Возвращает константу DBMS_SQLSET.NO_RECURSIVE_SQL.',
+ proname => 'dbms_sqlset_no_recursive_sql',
+ provolatile => 's',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_no_recursive_sql',
+ proisstrict => 'f'
+},
+{
+ oid => '11371',
+ descr => 'Возвращает константу DBMS_SQLSET.SINGLE_EXECUTION.',
+ proname => 'dbms_sqlset_single_execution',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_single_execution',
+ proisstrict => 'f'
+},
+{
+ oid => '11372',
+ descr => 'Возвращает константу DBMS_SQLSET.ALL_EXECUTIONS.',
+ proname => 'dbms_sqlset_all_executions',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_all_executions',
+ proisstrict => 'f'
+},
+{
+ oid => '11373',
+ descr => 'Возвращает константу DBMS_SQLSET.LIMITED_COMMAND_TYPE.',
+ proname => 'dbms_sqlset_limited_command_type',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_limited_command_type',
+ proisstrict => 'f'
+},
+{
+ oid => '11374',
+ descr => 'Возвращает константу DBMS_SQLSET.ALL_COMMAND_TYPE.',
+ proname => 'dbms_sqlset_all_command_type',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_all_command_type',
+ proisstrict => 'f'
+},
+{
+ oid => '11375',
+ descr => 'Возвращает константу DBMS_SQLSET.STS_STGTAB_10_2_VERSION.',
+ proname => 'dbms_sqlset_sts_stgtab_10_2_version',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_sts_stgtab_10_2_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11376',
+ descr => 'Возвращает константу DBMS_SQLSET.STS_STGTAB_11_1_VERSION.',
+ proname => 'dbms_sqlset_sts_stgtab_11_1_version',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_sts_stgtab_11_1_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11377',
+ descr => 'Возвращает константу DBMS_SQLSET.STS_STGTAB_11_2_VERSION.',
+ proname => 'dbms_sqlset_sts_stgtab_11_2_version',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_sts_stgtab_11_2_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11378',
+ descr => 'Возвращает константу DBMS_SQLSET.STS_STGTAB_12_1_VERSION.',
+ proname => 'dbms_sqlset_sts_stgtab_12_1_version',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_sts_stgtab_12_1_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11379',
+ descr => 'Возвращает константу DBMS_SQLSET.STS_STGTAB_12_2_VERSION.',
+ proname => 'dbms_sqlset_sts_stgtab_12_2_version',
+ provolatile => 's',
+ prorettype => 'int4',
+ proargtypes => '',
+ prosrc => 'dbms_sqlset_sts_stgtab_12_2_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11828',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_clearkeycolumnlist',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'dbms_xmlsave_clearkeycolumnlist',
+ proisstrict => 'f'
+},
+{
+ oid => '11829',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_clearupdatecolumnlist',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'dbms_xmlsave_clearupdatecolumnlist',
+ proisstrict => 'f'
+},
+{
+ oid => '11830',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_closecontext',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ prosrc => 'dbms_xmlsave_closecontext',
+ proisstrict => 't'
+},
+{
+ oid => '9977',
+ descr => 'Закрывает и освобождает конкретный контекст сохранения с дополнительным служебным параметром.',
+ proname => 'dbms_xmlsave_closecontext2',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4 int4',
+ proargnames => '{ctxhdl,service_arg}',
+ prosrc => 'dbms_xmlsave_closecontext2',
+ proisstrict => 'f'
+},
+{
+ oid => '11831',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_deletexml',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'dbms_xmlsave_deletexml_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11832',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_deletexml',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number clob',
+ prosrc => 'dbms_xmlsave_deletexml_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11833',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_getexceptioncontent',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'number',
+ prosrc => 'dbms_xmlsave_getexceptioncontent',
+ proisstrict => 'f'
+},
+{
+ oid => '11834',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_insertxml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlsave_insertxml',
+ proisstrict => 't'
+},
+{
+ oid => '11835',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_newcontext',
+ provolatile => 'v',
+ prorettype => 'int4',
+ proargtypes => 'varchar2',
+ prosrc => 'dbms_xmlsave_newcontext',
+ proisstrict => 't'
+},
+{
+ oid => '11836',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_propagateoriginalexception',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number bool',
+ prosrc => 'dbms_xmlsave_propagateoriginalexception',
+ proisstrict => 'f'
+},
+{
+ oid => '11837',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_p_propagateoriginalexception',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_p_propagateoriginalexception',
+ proisstrict => 'f'
+},
+{
+ oid => '11838',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_p_setpreservewhitespace',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_p_setpreservewhitespace',
+ proisstrict => 'f'
+},
+{
+ oid => '11839',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_p_setsqltoxmlnameesc',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_p_setsqltoxmlnameesc',
+ proisstrict => 'f'
+},
+{
+ oid => '11840',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_p_setxslt',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2 varchar2',
+ prosrc => 'dbms_xmlsave_p_setxslt_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11841',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_p_setxslt',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number clob varchar2',
+ prosrc => 'dbms_xmlsave_p_setxslt_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11842',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_p_usedbdates',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_p_usedbdates',
+ proisstrict => 'f'
+},
+{
+ oid => '11843',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_removexsltparam',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'dbms_xmlsave_removexsltparam',
+ proisstrict => 'f'
+},
+{
+ oid => '11844',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setbatchsize',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_setbatchsize',
+ proisstrict => 'f'
+},
+{
+ oid => '11845',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setcommitbatch',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_setcommitbatch',
+ proisstrict => 'f'
+},
+{
+ oid => '11846',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setdateformat',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'dbms_xmlsave_setdateformat',
+ proisstrict => 'f'
+},
+{
+ oid => '11847',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setignorecase',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'dbms_xmlsave_setignorecase',
+ proisstrict => 'f'
+},
+{
+ oid => '11848',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setkeycolumn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'dbms_xmlsave_setkeycolumn',
+ proisstrict => 'f'
+},
+{
+ oid => '11849',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setpreservewhitespace',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number bool',
+ prosrc => 'dbms_xmlsave_setpreservewhitespace',
+ proisstrict => 'f'
+},
+{
+ oid => '11850',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setrowtag',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'dbms_xmlsave_setrowtag',
+ proisstrict => 'f'
+},
+{
+ oid => '11851',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setsqltoxmlnameescaping',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number bool',
+ prosrc => 'dbms_xmlsave_setsqltoxmlnameescaping',
+ proisstrict => 'f'
+},
+{
+ oid => '11852',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setupdatecolumn',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'dbms_xmlsave_setupdatecolumn',
+ proisstrict => 'f'
+},
+{
+ oid => '11853',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setxslt',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2 varchar2',
+ prosrc => 'dbms_xmlsave_setxslt_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11854',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setxslt',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number clob varchar2',
+ prosrc => 'dbms_xmlsave_setxslt_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11855',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_setxsltparam',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2 varchar2',
+ prosrc => 'dbms_xmlsave_setxsltparam',
+ proisstrict => 'f'
+},
+{
+ oid => '11856',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_updatexml',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'int4 varchar2',
+ prosrc => 'dbms_xmlsave_updatexml',
+ proisstrict => 'f'
+},
+{
+ oid => '11857',
+ descr => 'TODO: Добавить описание',
+ proname => 'dbms_xmlsave_usedbdates',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number bool',
+ prosrc => 'dbms_xmlsave_usedbdates',
+ proisstrict => 'f'
+},
+{
+ oid => '11858',
+ descr => 'экранирует специальные символы.',
+ proname => 'htf_escape_oracle_full',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htf_escape_oracle_full',
+ proisstrict => 'f'
+},
+{
+ oid => '11380',
+ descr => 'Скелет FETCH_OBJ_NAME для пакета DBMS_ASH',
+ proname => 'dbms_ash_fetch_obj_name',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number number number varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{p_obj_id,p_dbid,p_con_dbid,p_is_local,p_local_type,p_is_old,p_time_limit}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_fetch_obj_name',
+ proisstrict => 'f'
+},
+{
+ oid => '11381',
+ descr => 'Скелет FETCH_PROCEDURE_NAME для пакета DBMS_ASH',
+ proname => 'dbms_ash_fetch_procedure_name',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'number number number varchar2',
+ proargnames => '{p_obj_id,p_subobj_id,p_con_dbid,p_time_limit}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_fetch_procedure_name',
+ proisstrict => 'f'
+},
+{
+ oid => '11382',
+ descr => 'Скелет FETCH_SQLTEXT для пакета DBMS_ASH',
+ proname => 'dbms_ash_fetch_sqltext',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 number number varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{p_sqlid,p_dbid,p_con_dbid,p_is_local,p_is_pdb,p_is_old,p_time_limit}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_fetch_sqltext',
+ proisstrict => 'f'
+},
+{
+ oid => '11383',
+ descr => 'Скелет FETCH_USER_NAME для пакета DBMS_ASH',
+ proname => 'dbms_ash_fetch_user_name',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'number number varchar2',
+ proargnames => '{p_user_id,p_con_dbid,p_time_limit}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_fetch_user_name',
+ proisstrict => 'f'
+},
+{
+ oid => '11384',
+ descr => 'Скелет GETADDITIONALINFO для пакета DBMS_ASH',
+ proname => 'dbms_ash_getadditionalinfo',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number number varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{dbid,instance_number,real_time_mode,show_sql,dim_list,sqlid_list,plsql_list,object_list,user_list}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getadditionalinfo',
+ proisstrict => 'f'
+},
+{
+ oid => '11385',
+ descr => 'Скелет GETAWRINFO для пакета DBMS_ASH',
+ proname => 'dbms_ash_getawrinfo',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2 varchar2 number varchar2',
+ proargnames => '{p_dbid,p_begin_time_utc,p_end_time_utc,p_inst_num,show_sql}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getawrinfo',
+ proisstrict => 'f'
+},
+{
+ oid => '11386',
+ descr => 'Скелет GETCPUINFO для пакета DBMS_ASH',
+ proname => 'dbms_ash_getcpuinfo',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2 number varchar2 varchar2',
+ proargnames => '{dbid,observationtime,instance_number,ignore_cpu_history,show_sql}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getcpuinfo',
+ proisstrict => 'f'
+},
+{
+ oid => '11387',
+ descr => 'Скелет GETDATA для пакета DBMS_ASH',
+ proname => 'dbms_ash_getdata',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{data_type,time_type,filter_list,args}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getdata',
+ proisstrict => 'f'
+},
+{
+ oid => '11500',
+ descr => 'Скелет GETDATAHISTORICAL для пакета DBMS_ASH',
+ proname => 'dbms_ash_getdatahistorical',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{dbid,filter_list,begin_time_utc,end_time_utc,time_since_sec,show_sql,verbose_xml,include_bg,instance_number,minimize_cost,resolution,monitoring_mode,memory_only,dimensions}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getdatahistorical',
+ proisstrict => 'f'
+},
+{
+ oid => '11501',
+ descr => 'Скелет GETDATAREALTIME для пакета DBMS_ASH',
+ proname => 'dbms_ash_getdatarealtime',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{filter_list,time_since_sec,show_sql,verbose_xml,include_bg,instance_number,minimize_cost,resolution,monitoring_mode,memory_only,dimensions}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getdatarealtime',
+ proisstrict => 'f'
+},
+{
+ oid => '11502',
+ descr => 'Скелет GETHISTOGRAMHISTORICAL для пакета DBMS_ASH',
+ proname => 'dbms_ash_gethistogramhistorical',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2',
+ proargnames => '{dbid,filter_list,begin_time_utc,end_time_utc,time_since_sec,show_sql,verbose_xml,include_bg,instance_number,ignore_cpu_history,resolution,memory_only}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_gethistogramhistorical',
+ proisstrict => 'f'
+},
+{
+ oid => '11503',
+ descr => 'Скелет GETHISTOGRAMREALTIME для пакета DBMS_ASH',
+ proname => 'dbms_ash_gethistogramrealtime',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2',
+ proargnames => '{filter_list,time_since_sec,show_sql,verbose_xml,include_bg,instance_number,ignore_cpu_history,resolution,memory_only}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_gethistogramrealtime',
+ proisstrict => 'f'
+},
+{
+ oid => '11504',
+ descr => 'Скелет GETSQLTEXT для пакета DBMS_ASH',
+ proname => 'dbms_ash_getsqltext',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2',
+ proargnames => '{p_dbid,p_sql_ids}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getsqltext',
+ proisstrict => 'f'
+},
+{
+ oid => '11505',
+ descr => 'Скелет GETTIMEFORMAT для пакета DBMS_ASH',
+ proname => 'dbms_ash_gettimeformat',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prokind => 'f',
+ prosrc => 'dbms_ash_gettimeformat',
+ proisstrict => 'f'
+},
+{
+ oid => '11506',
+ descr => 'Скелет GETTIMEPICKERHISTORICAL для пакета DBMS_ASH',
+ proname => 'dbms_ash_gettimepickerhistorical',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2 varchar2 number varchar2 varchar2 number varchar2 varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{dbid,begin_time_utc,end_time_utc,time_since_sec,show_sql,verbose_xml,instance_number,awr_info,ignore_cpu_history,resolution,include_bg,memory_only}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_gettimepickerhistorical',
+ proisstrict => 'f'
+},
+{
+ oid => '11507',
+ descr => 'Скелет GETTIMEPICKERREALTIME для пакета DBMS_ASH',
+ proname => 'dbms_ash_gettimepickerrealtime',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'number varchar2 varchar2 number varchar2 varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{time_since_sec,show_sql,verbose_xml,instance_number,awr_info,ignore_cpu_history,resolution,include_bg,memory_only}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_gettimepickerrealtime',
+ proisstrict => 'f'
+},
+{
+ oid => '11508',
+ descr => 'Скелет GETVERSION для пакета DBMS_ASH',
+ proname => 'dbms_ash_getversion',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => '',
+ prokind => 'f',
+ prosrc => 'dbms_ash_getversion',
+ proisstrict => 'f'
+},
+{
+ oid => '11509',
+ descr => 'Скелет GET_BLOCKING_SESSION_DATA для пакета DBMS_ASH',
+ proname => 'dbms_ash_get_blocking_session_data',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 number varchar2 varchar2',
+ proargnames => '{data_type,source_type,filter_list,begin_time_utc,end_time_utc,time_since_sec,show_sql,filter_common_user}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_get_blocking_session_data',
+ proisstrict => 'f'
+},
+{
+ oid => '11510',
+ descr => 'Скелет INCREMENTDATA для пакета DBMS_ASH',
+ proname => 'dbms_ash_incrementdata',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 varchar2 number varchar2 varchar2 varchar2 number varchar2 varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{filter_list,begin_time_utc,bucket_size,show_sql,verbose_xml,include_bg,instance_number,minimize_cost,resolution,monitoring_mode,memory_only,dimensions}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_incrementdata',
+ proisstrict => 'f'
+},
+{
+ oid => '11511',
+ descr => 'Скелет INCREMENTHISTOGRAM для пакета DBMS_ASH',
+ proname => 'dbms_ash_incrementhistogram',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 varchar2 number varchar2 varchar2 varchar2 number varchar2 varchar2',
+ proargnames => '{filter_list,begin_time_utc,bucket_size,show_sql,verbose_xml,include_bg,instance_number,resolution,memory_only}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_incrementhistogram',
+ proisstrict => 'f'
+},
+{
+ oid => '11512',
+ descr => 'Скелет INCREMENTTIMEPICKER для пакета DBMS_ASH',
+ proname => 'dbms_ash_incrementtimepicker',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => 'varchar2 number varchar2 varchar2 number varchar2 varchar2 varchar2 varchar2',
+ proargnames => '{begin_time_utc,bucket_size,show_sql,verbose_xml,instance_number,awr_info,resolution,include_bg,memory_only}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_incrementtimepicker',
+ proisstrict => 'f'
+},
+{
+ oid => '11513',
+ descr => 'Скелет STR_TO_ASCII для пакета DBMS_ASH',
+ proname => 'dbms_ash_str_to_ascii',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ proargnames => '{s}',
+ prokind => 'f',
+ prosrc => 'dbms_ash_str_to_ascii',
+ proisstrict => 'f'
+},
+{
+ oid => '11514',
+ descr => 'Возвращает версию RUDB пакета DBMS_ASH.',
+ proname => 'dbms_ash_get_version',
+ provolatile => 's',
+ prorettype => 'text',
+ proargtypes => '',
+ prokind => 'f',
+ prosrc => 'dbms_ash_get_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11515',
+ descr => 'Generated mock stub for package DBMS_ASH. Manual implementation required.',
+ proname => 'dbms_ash_mock',
+ provolatile => 'v',
+ prorettype => 'text',
+ proargtypes => '',
+ prokind => 'f',
+ prosrc => 'dbms_ash_mock',
+ proisstrict => 'f'
+},
+{
+ oid => '11859',
+ descr => 'экранирует специальные символы.',
+ proname => 'htp_escape_oracle_full',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2',
+ prosrc => 'htp_escape_oracle_full',
+ proisstrict => 'f'
+},
+{
+ oid => '11860',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number varchar2',
+ prosrc => 'owa_pattern_amatch_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11861',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number varchar2 varchar2',
+ prosrc => 'owa_pattern_amatch_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11862',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number',
+ proallargtypes => '{varchar2,number,int4}',
+ proargmodes => '{i,i,b}',
+ prosrc => 'owa_pattern_amatch_ovr3',
+ proisstrict => 'f'
+},
+{
+ oid => '11863',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number int4 varchar2',
+ proallargtypes => '{varchar2,number,int4,varchar2}',
+ proargmodes => '{i,i,b,i}',
+ prosrc => 'owa_pattern_amatch_ovr4',
+ proisstrict => 'f'
+},
+{
+ oid => '11864',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number varchar2 _varchar2',
+ proallargtypes => '{varchar2,number,varchar2,_varchar2}',
+ proargmodes => '{i,i,i,o}',
+ prosrc => 'owa_pattern_amatch_ovr5',
+ proisstrict => 'f'
+},
+{
+ oid => '11865',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number varchar2 _varchar2 varchar2',
+ proallargtypes => '{varchar2,number,varchar2,_varchar2,varchar2}',
+ proargmodes => '{i,i,i,o,i}',
+ prosrc => 'owa_pattern_amatch_ovr6',
+ proisstrict => 'f'
+},
+{
+ oid => '11866',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number int4 _varchar2',
+ proallargtypes => '{varchar2,number,int4,_varchar2}',
+ proargmodes => '{i,i,b,o}',
+ prosrc => 'owa_pattern_amatch_ovr7',
+ proisstrict => 'f'
+},
+{
+ oid => '11867',
+ descr => 'This function specifies if a pattern occurs in a particular location in a string.',
+ proname => 'owa_pattern_amatch',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 number int4 _varchar2 varchar2',
+ proallargtypes => '{varchar2,number,int4,_varchar2,varchar2}',
+ proargmodes => '{i,i,b,o,i}',
+ prosrc => 'owa_pattern_amatch_ovr8',
+ proisstrict => 'f'
+},
+{
+ oid => '11868',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ proallargtypes => '{varchar2,varchar2,varchar2}',
+ proargmodes => '{b,i,i}',
+ prosrc => 'owa_pattern_change_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11869',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ proallargtypes => '{varchar2,varchar2,varchar2,varchar2}',
+ proargmodes => '{b,i,i,i}',
+ prosrc => 'owa_pattern_change_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11870',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ proallargtypes => '{varchar2,varchar2,varchar2}',
+ proargmodes => '{b,i,i}',
+ prosrc => 'owa_pattern_change_ovr3',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11871',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2',
+ proallargtypes => '{varchar2,varchar2,varchar2,varchar2}',
+ proargmodes => '{b,i,i,i}',
+ prosrc => 'owa_pattern_change_ovr4',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11872',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 varchar2',
+ proallargtypes => '{record,varchar2,varchar2}',
+ proargmodes => '{b,i,i}',
+ prosrc => 'owa_pattern_change_ovr5',
+ proisstrict => 'f'
+},
+{
+ oid => '11873',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'record varchar2 varchar2 varchar2',
+ proallargtypes => '{record,varchar2,varchar2,varchar2}',
+ proargmodes => '{b,i,i,i}',
+ prosrc => 'owa_pattern_change_ovr6',
+ proisstrict => 'f'
+},
+{
+ oid => '11874',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'record varchar2 varchar2',
+ proallargtypes => '{record,varchar2,varchar2}',
+ proargmodes => '{b,i,i}',
+ prosrc => 'owa_pattern_change_ovr7',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11875',
+ descr => 'This function or procedure searches and replaces a string ormulti_linedatatype. If multiple overlapping strings match the regular expression, this subprogram takes the longest match.',
+ proname => 'owa_pattern_change_p',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'record varchar2 varchar2 varchar2',
+ proallargtypes => '{record,varchar2,varchar2,varchar2}',
+ proargmodes => '{b,i,i,i}',
+ prosrc => 'owa_pattern_change_ovr8',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11876',
+ descr => 'This procedure converts a VARCHAR2 string into anOWA_PATTERN.PATTERN DATA TYPE.',
+ proname => 'owa_pattern_getpat',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'int4',
+ proallargtypes => '{varchar2,int4}',
+ proargmodes => '{i,b}',
+ prosrc => 'owa_pattern_getpat',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11877',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'owa_pattern_match_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11878',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 varchar2 varchar2',
+ prosrc => 'owa_pattern_match_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11879',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2',
+ proallargtypes => '{varchar2,int4}',
+ proargmodes => '{i,b,i}',
+ prosrc => 'owa_pattern_match_ovr3',
+ proisstrict => 'f'
+},
+{
+ oid => '11880',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 int4 varchar2',
+ proallargtypes => '{varchar2,int4,varchar2}',
+ proargmodes => '{i,b,i}',
+ prosrc => 'owa_pattern_match_ovr4',
+ proisstrict => 'f'
+},
+{
+ oid => '11881',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 varchar2 _varchar2',
+ proallargtypes => '{varchar2,varchar2,_varchar2}',
+ proargmodes => '{i,i,o}',
+ prosrc => 'owa_pattern_match_ovr5',
+ proisstrict => 'f'
+},
+{
+ oid => '11882',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 varchar2 _varchar2 varchar2',
+ proallargtypes => '{varchar2,varchar2,_varchar2,varchar2}',
+ proargmodes => '{i,i,o,i}',
+ prosrc => 'owa_pattern_match_ovr6',
+ proisstrict => 'f'
+},
+{
+ oid => '11883',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 int4 _varchar2',
+ proallargtypes => '{varchar2,int4,_varchar2}',
+ proargmodes => '{i,b,o}',
+ prosrc => 'owa_pattern_match_ovr7',
+ proisstrict => 'f'
+},
+{
+ oid => '11884',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 int4 _varchar2 varchar2',
+ proallargtypes => '{varchar2,int4,_varchar2,varchar2}',
+ proargmodes => '{i,b,o,i}',
+ prosrc => 'owa_pattern_match_ovr8',
+ proisstrict => 'f'
+},
+{
+ oid => '11885',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'record varchar2 record',
+ proallargtypes => '{record,varchar2,record}',
+ proargmodes => '{i,i,o}',
+ prosrc => 'owa_pattern_match_ovr9',
+ proisstrict => 'f'
+},
+{
+ oid => '11886',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'record varchar2 varchar2 varchar2',
+ proallargtypes => '{record,varchar2,record,varchar2}',
+ proargmodes => '{i,i,o,i}',
+ prosrc => 'owa_pattern_match_ovr10',
+ proisstrict => 'f'
+},
+{
+ oid => '11887',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'record int4 record',
+ proallargtypes => '{record,int4,record}',
+ proargmodes => '{i,b,o}',
+ prosrc => 'owa_pattern_match_ovr11',
+ proisstrict => 'f'
+},
+{
+ oid => '11888',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'record int4 record varchar2',
+ proallargtypes => '{record,int4,record,varchar2}',
+ proargmodes => '{i,b,o,i}',
+ prosrc => 'owa_pattern_match_ovr12',
+ proisstrict => 'f'
+},
+{
+ oid => '11889',
+ descr => 'This function determines if a string contains the specified pattern. The pattern can contain regular expressions. If multiple overlapping strings can match the regular expression, this function takes the longest match.',
+ proname => 'owa_pattern_match2',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 varchar2 int4',
+ prosrc => 'owa_pattern_match2',
+ proisstrict => 't'
+},
+{
+ oid => '11890',
+ descr => 'OWA_MATCH.MATCH',
+ proname => 'owa_match_match',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 _varchar2 _varchar2 bool',
+ prosrc => 'owa_match_match',
+ proisstrict => 'f'
+},
+{
+ oid => '11891',
+ descr => 'OWA_MATCH.MATCH2',
+ proname => 'owa_match_match2',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 _varchar2 _varchar2 bool int4',
+ prosrc => 'owa_match_match',
+ proisstrict => 't'
+},
+{
+ oid => '11892',
+ descr => 'This function prepares a SQL query by binding variables to it, and stores the output in an opened cursor. Use this function as a parameter to a procedure sending a dynamically generated query. Specify up to 25 bind variables.',
+ proname => 'owa_util_bind_variables',
+ provolatile => 'v',
+ prorettype => 'number',
+ proargtypes => 'varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2 varchar2',
+ prosrc => 'owa_util_bind_variables',
+ proisstrict => 'f'
+},
+{
+ oid => '11893',
+ descr => 'These procedures creates a calendar in HTML with a visible border. Each date in the calendar can contain any number of hypertext links.',
+ proname => 'owa_util_calendarprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'owa_util_calendarprint_ovr1',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11894',
+ descr => 'These procedures creates a calendar in HTML with a visible border. Each date in the calendar can contain any number of hypertext links.',
+ proname => 'owa_util_calendarprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2',
+ prosrc => 'owa_util_calendarprint_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11895',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number _varchar2 varchar2',
+ prosrc => 'owa_util_cellsprint_ovr1',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11896',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number varchar2',
+ prosrc => 'owa_util_cellsprint_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11897',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number varchar2',
+ prosrc => 'owa_util_cellsprint_ovr3',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11898',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number varchar2 number bool',
+ proallargtypes => '{varchar2,number,varchar2,number,bool}',
+ proargmodes => '{i,i,i,i,o}',
+ prosrc => 'owa_util_cellsprint_ovr4',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11899',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number varchar2 number bool',
+ proallargtypes => '{number,number,varchar2,number,bool}',
+ proargmodes => '{i,i,i,i,o}',
+ prosrc => 'owa_util_cellsprint_ovr5',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11900',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number varchar2 number',
+ proallargtypes => '{varchar2,number,varchar2,number}',
+ proargmodes => '{i,i,i,o}',
+ prosrc => 'owa_util_cellsprint_ovr6',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11901',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number varchar2 number',
+ proallargtypes => '{number,number,varchar2,number}',
+ proargmodes => '{i,i,i,o}',
+ prosrc => 'owa_util_cellsprint_ovr7',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11902',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number varchar2 number bool number',
+ proallargtypes => '{varchar2,number,varchar2,number,bool,number}',
+ proargmodes => '{i,i,i,i,o,o}',
+ prosrc => 'owa_util_cellsprint_ovr8',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11903',
+ descr => 'This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table.',
+ proname => 'owa_util_cellsprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number varchar2 number bool number',
+ proallargtypes => '{number,number,varchar2,number,bool,number}',
+ proargmodes => '{i,i,i,i,o,o}',
+ prosrc => 'owa_util_cellsprint_ovr9',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11904',
+ descr => 'This procedure generates three HTML form elements that allow the user to select the day, the month, and the year.',
+ proname => 'owa_util_choose_date',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 date',
+ prosrc => 'owa_util_choose_date',
+ proisstrict => 'f'
+},
+{
+ oid => '11905',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_comma_to_ident_arr',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 _nvarchar2 _number number',
+ proallargtypes => '{varchar2,_nvarchar2,_number,number}',
+ proargmodes => '{i,o,o,o}',
+ prosrc => 'owa_util_comma_to_ident_arr_ovr1',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11906',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_comma_to_ident_arr',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 _varchar2 _number number',
+ proallargtypes => '{varchar2,_varchar2,_number,number}',
+ proargmodes => '{i,o,o,o}',
+ prosrc => 'owa_util_comma_to_ident_arr_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11907',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_describe_cols',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'owa_util_describe_cols',
+ proisstrict => 'f'
+},
+{
+ oid => '11909',
+ descr => 'This function returns the full virtual path of the PL/SQL Gateway that is handling the request.',
+ proname => 'owa_util_get_owa_service_path',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_get_owa_service_path',
+ proisstrict => 'f'
+},
+{
+ oid => '11910',
+ descr => 'This function returns the name of the procedure that is being invoked by the PL/SQL Gateway.',
+ proname => 'owa_util_get_procedure',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_get_procedure',
+ proisstrict => 'f'
+},
+{
+ oid => '11911',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_get_version',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_get_version',
+ proisstrict => 'f'
+},
+{
+ oid => '11912',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_ite',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'bool varchar2 varchar2',
+ prosrc => 'owa_util_ite',
+ proisstrict => 'f'
+},
+{
+ oid => '11913',
+ descr => 'This procedure generates an HTML selection list form element from the output of a SQL query.',
+ proname => 'owa_util_listprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2 number bool',
+ prosrc => 'owa_util_listprint_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11914',
+ descr => 'This procedure generates an HTML selection list form element from the output of a SQL query.',
+ proname => 'owa_util_listprint',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 number bool',
+ prosrc => 'owa_util_listprint_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11915',
+ descr => 'This procedure changes the default MIME header that the script returns. This procedure must come before anyHTP.PRINT or HTP.PRNcalls to direct the script not to use the default MIME header.',
+ proname => 'owa_util_mime_header',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 bool varchar2',
+ prosrc => 'owa_util_mime_header',
+ proisstrict => 'f'
+},
+{
+ oid => '11916',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_name_resolve',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'varchar2',
+ prosrc => 'owa_util_name_resolve',
+ proisstrict => 'f'
+},
+{
+ oid => '11917',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_path_to_me',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_path_to_me',
+ proisstrict => 'f'
+},
+{
+ oid => '11918',
+ descr => 'This procedure specifies that the application server is to visit the specified URL. The URL may specify either a Web page to return or a program to execute.',
+ proname => 'owa_util_redirect_url',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 bool',
+ prosrc => 'owa_util_redirect_url',
+ proisstrict => 'f'
+},
+{
+ oid => '11919',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_resolve_table',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'varchar2 varchar2',
+ prosrc => 'owa_util_resolve_table',
+ proisstrict => 'f'
+},
+{
+ oid => '11920',
+ descr => 'This procedure prints the source of the specified procedure, function, or package. If a procedure or function which belongs to a package is specified, then the entire package is displayed.',
+ proname => 'owa_util_showsource',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'owa_util_showsource',
+ proisstrict => 'f'
+},
+{
+ oid => '11921',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_show_query_columns',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'owa_util_show_query_columns',
+ proisstrict => 'f'
+},
+{
+ oid => '11922',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_signature',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_signature_ovr1',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11923',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_signature',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'owa_util_signature_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11924',
+ descr => 'This procedure sends a standard HTTP status code to the client.',
+ proname => 'owa_util_status_line',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number varchar2 bool',
+ prosrc => 'owa_util_status_line',
+ proisstrict => 'f'
+},
+{
+ oid => '11925',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tablecaption',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 varchar2 number',
+ prosrc => 'owa_util_tablecaption',
+ proisstrict => 'f'
+},
+{
+ oid => '11926',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number',
+ prosrc => 'owa_util_tableclose_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11927',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableclose',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'number number',
+ prosrc => 'owa_util_tableclose_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11928',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tabledata',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number varchar2 varchar2 number',
+ prosrc => 'owa_util_tabledata',
+ proisstrict => 'f'
+},
+{
+ oid => '11929',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableheader',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number varchar2 varchar2 number',
+ prosrc => 'owa_util_tableheader_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11930',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableheader',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => 'varchar2 number varchar2 varchar2 number number',
+ prosrc => 'owa_util_tableheader_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11931',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableheaderrowclose',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number',
+ prosrc => 'owa_util_tableheaderrowclose_ovr1',
+ proisstrict => 'f'
+},
+{
+ oid => '11932',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableheaderrowclose',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number number',
+ prosrc => 'owa_util_tableheaderrowclose_ovr2',
+ proisstrict => 'f'
+},
+{
+ oid => '11933',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableheaderrowopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number',
+ proallargtypes => '{varchar2,number}',
+ proargmodes => '{b,i}',
+ prosrc => 'owa_util_tableheaderrowopen_ovr1',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11934',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableheaderrowopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number number',
+ proallargtypes => '{varchar2,number,number}',
+ proargmodes => '{b,o,i}',
+ prosrc => 'owa_util_tableheaderrowopen_ovr2',
+ proisstrict => 'f',
+ prokind => 'p'
+},
+{
+ oid => '11935',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tablenodata',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 varchar2 number number number',
+ prosrc => 'owa_util_tablenodata',
+ proisstrict => 'f'
+},
+{
+ oid => '11936',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tableopen',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2 number',
+ prosrc => 'owa_util_tableopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11937',
+ descr => 'This function generates either preformatted tables or HTML tables (depending on the capabilities of the users browser) from database tables.',
+ proname => 'owa_util_tableprint',
+ provolatile => 'v',
+ prorettype => 'bool',
+ proargtypes => 'varchar2 varchar2 number varchar2 varchar2 varchar2 number number',
+ prosrc => 'owa_util_tableprint',
+ proisstrict => 'f'
+},
+{
+ oid => '11938',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tablerowclose',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number',
+ prosrc => 'owa_util_tablerowclose',
+ proisstrict => 'f'
+},
+{
+ oid => '11939',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_tablerowopen',
+ provolatile => 'v',
+ prorettype => 'varchar2',
+ proargtypes => 'varchar2 number',
+ prosrc => 'owa_util_tablerowopen',
+ proisstrict => 'f'
+},
+{
+ oid => '11940',
+ descr => 'This function converts the DATETYPE Datatype to the standard OracleDATEtype.',
+ proname => 'owa_util_todate',
+ provolatile => 'v',
+ prorettype => 'date',
+ proargtypes => '_varchar2',
+ prosrc => 'owa_util_todate',
+ proisstrict => 'f'
+},
+{
+ oid => '11941',
+ descr => 'TODO: Добавить описание',
+ proname => 'owa_util_validate_arg',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => 'varchar2',
+ prosrc => 'owa_util_validate_arg',
+ proisstrict => 'f'
+},
+{
+ oid => '11942',
+ descr => 'This procedure returns information (in the form of output parameters) about the PL/SQL code unit that invoked it.',
+ proname => 'owa_util_who_called_me',
+ provolatile => 'v',
+ prorettype => 'record',
+ proargtypes => '',
+ prosrc => 'owa_util_who_called_me',
+ proisstrict => 'f'
+},
+{
+ oid => '11943',
+ descr => 'TODO',
+ proname => 'owa_util_http_header_close',
+ provolatile => 'v',
+ prorettype => 'void',
+ proargtypes => '',
+ prosrc => 'owa_util_http_header_close',
+ proisstrict => 'f',
+ prokind => 'p',
}
]
diff --git a/src/include/common/coder.hpp b/src/include/common/coder.hpp
new file mode 100644
index 0000000..d978f78
--- /dev/null
+++ b/src/include/common/coder.hpp
@@ -0,0 +1,18 @@
+#ifndef CODER_HPP
+#define CODER_HPP
+
+#include <iostream>
+#include <cstring>
+#include <vector>
+#include <iomanip>
+#include <sstream>
+
+// XXX
+#define pPASSWORDSALT "passwordsalt"
+#define HASH_KWD "#@b*!a^&-"
+
+namespace Coder {
+ std::string Encode(std::string str);
+ std::string Decode(std::string str);
+};
+#endif // CODER_HPP
diff --git a/src/include/dbms/htp.h b/src/include/dbms/htp.h
new file mode 100644
index 0000000..0ef59c1
--- /dev/null
+++ b/src/include/dbms/htp.h
@@ -0,0 +1,173 @@
+#ifndef DBMS_HTP_H
+#define DBMS_HTP_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+
+Datum htp_adddefaulthtmlhdr(PG_FUNCTION_ARGS);
+Datum htp_address(PG_FUNCTION_ARGS);
+Datum htp_anchor(PG_FUNCTION_ARGS);
+Datum htp_anchor2(PG_FUNCTION_ARGS);
+Datum htp_appletopen(PG_FUNCTION_ARGS);
+Datum htp_area(PG_FUNCTION_ARGS);
+Datum htp_base(PG_FUNCTION_ARGS);
+Datum htp_basefont(PG_FUNCTION_ARGS);
+Datum htp_bgsound(PG_FUNCTION_ARGS);
+Datum htp_big(PG_FUNCTION_ARGS);
+Datum htp_blockquoteopen(PG_FUNCTION_ARGS);
+Datum htp_bodyopen(PG_FUNCTION_ARGS);
+Datum htp_bold(PG_FUNCTION_ARGS);
+Datum htp_br(PG_FUNCTION_ARGS);
+Datum htp_center(PG_FUNCTION_ARGS);
+Datum htp_cite(PG_FUNCTION_ARGS);
+Datum htp_code(PG_FUNCTION_ARGS);
+Datum htp_comment(PG_FUNCTION_ARGS);
+Datum htp_dfn(PG_FUNCTION_ARGS);
+Datum htp_div(PG_FUNCTION_ARGS);
+Datum htp_dlistdef(PG_FUNCTION_ARGS);
+Datum htp_dlistopen(PG_FUNCTION_ARGS);
+Datum htp_dlistterm(PG_FUNCTION_ARGS);
+Datum htp_download_file(PG_FUNCTION_ARGS);
+Datum htp_em(PG_FUNCTION_ARGS);
+Datum htp_emphasis(PG_FUNCTION_ARGS);
+Datum htp_escape_oracle_full(PG_FUNCTION_ARGS);
+Datum htp_escape_sc(PG_FUNCTION_ARGS);
+Datum htp_flush_charset_convert(PG_FUNCTION_ARGS);
+Datum htp_fontopen(PG_FUNCTION_ARGS);
+Datum htp_formcheckbox(PG_FUNCTION_ARGS);
+Datum htp_formfile(PG_FUNCTION_ARGS);
+Datum htp_formhidden(PG_FUNCTION_ARGS);
+Datum htp_formimage(PG_FUNCTION_ARGS);
+Datum htp_formopen(PG_FUNCTION_ARGS);
+Datum htp_formpassword(PG_FUNCTION_ARGS);
+Datum htp_formradio(PG_FUNCTION_ARGS);
+Datum htp_formreset(PG_FUNCTION_ARGS);
+Datum htp_formselectopen(PG_FUNCTION_ARGS);
+Datum htp_formselectoption(PG_FUNCTION_ARGS);
+Datum htp_formsubmit(PG_FUNCTION_ARGS);
+Datum htp_formtext(PG_FUNCTION_ARGS);
+Datum htp_formtextarea(PG_FUNCTION_ARGS);
+Datum htp_formtextarea2(PG_FUNCTION_ARGS);
+Datum htp_formtextareaopen(PG_FUNCTION_ARGS);
+Datum htp_formtextareaopen2(PG_FUNCTION_ARGS);
+Datum htp_frame(PG_FUNCTION_ARGS);
+Datum htp_framesetopen(PG_FUNCTION_ARGS);
+Datum htp_get_download_files_list(PG_FUNCTION_ARGS);
+Datum htp_get_line(PG_FUNCTION_ARGS);
+Datum htp_get_page(PG_FUNCTION_ARGS);
+Datum htp_get_page_charset_convert(PG_FUNCTION_ARGS);
+Datum htp_get_page_raw(PG_FUNCTION_ARGS);
+Datum htp_header(PG_FUNCTION_ARGS);
+Datum htp_hr(PG_FUNCTION_ARGS);
+Datum htp_htitle(PG_FUNCTION_ARGS);
+Datum htp_img(PG_FUNCTION_ARGS);
+Datum htp_img2(PG_FUNCTION_ARGS);
+Datum htp_isindex(PG_FUNCTION_ARGS);
+Datum htp_italic(PG_FUNCTION_ARGS);
+Datum htp_kbd(PG_FUNCTION_ARGS);
+Datum htp_keyboard(PG_FUNCTION_ARGS);
+Datum htp_line(PG_FUNCTION_ARGS);
+Datum htp_linkrel(PG_FUNCTION_ARGS);
+Datum htp_linkrev(PG_FUNCTION_ARGS);
+Datum htp_listheader(PG_FUNCTION_ARGS);
+Datum htp_listitem(PG_FUNCTION_ARGS);
+Datum htp_mailto(PG_FUNCTION_ARGS);
+Datum htp_mapopen(PG_FUNCTION_ARGS);
+Datum htp_meta(PG_FUNCTION_ARGS);
+Datum htp_nextid(PG_FUNCTION_ARGS);
+Datum htp_nl(PG_FUNCTION_ARGS);
+Datum htp_nobr(PG_FUNCTION_ARGS);
+Datum htp_olistopen(PG_FUNCTION_ARGS);
+Datum htp_p_ovr1(PG_FUNCTION_ARGS);
+Datum htp_p_ovr2(PG_FUNCTION_ARGS);
+Datum htp_p_ovr3(PG_FUNCTION_ARGS);
+Datum htp_paragraph(PG_FUNCTION_ARGS);
+Datum htp_param(PG_FUNCTION_ARGS);
+Datum htp_plaintext(PG_FUNCTION_ARGS);
+Datum htp_preopen(PG_FUNCTION_ARGS);
+Datum htp_print_ovr1(PG_FUNCTION_ARGS);
+Datum htp_print_ovr2(PG_FUNCTION_ARGS);
+Datum htp_print_ovr3(PG_FUNCTION_ARGS);
+Datum htp_prints(PG_FUNCTION_ARGS);
+Datum htp_print_header(PG_FUNCTION_ARGS);
+Datum htp_prn_ovr1(PG_FUNCTION_ARGS);
+Datum htp_prn_ovr2(PG_FUNCTION_ARGS);
+Datum htp_prn_ovr3(PG_FUNCTION_ARGS);
+Datum htp_ps(PG_FUNCTION_ARGS);
+Datum htp_putraw(PG_FUNCTION_ARGS);
+Datum htp_s(PG_FUNCTION_ARGS);
+Datum htp_sample(PG_FUNCTION_ARGS);
+Datum htp_script(PG_FUNCTION_ARGS);
+Datum htp_sethttpcharset(PG_FUNCTION_ARGS);
+Datum htp_set_transfer_mode(PG_FUNCTION_ARGS);
+Datum htp_small(PG_FUNCTION_ARGS);
+Datum htp_strike(PG_FUNCTION_ARGS);
+Datum htp_strong(PG_FUNCTION_ARGS);
+Datum htp_style(PG_FUNCTION_ARGS);
+Datum htp_sub(PG_FUNCTION_ARGS);
+Datum htp_sup(PG_FUNCTION_ARGS);
+Datum htp_tablecaption(PG_FUNCTION_ARGS);
+Datum htp_tabledata(PG_FUNCTION_ARGS);
+Datum htp_tableheader(PG_FUNCTION_ARGS);
+Datum htp_tableopen(PG_FUNCTION_ARGS);
+Datum htp_tablerowopen(PG_FUNCTION_ARGS);
+Datum htp_teletype(PG_FUNCTION_ARGS);
+Datum htp_title(PG_FUNCTION_ARGS);
+Datum htp_ulistopen(PG_FUNCTION_ARGS);
+Datum htp_underline(PG_FUNCTION_ARGS);
+Datum htp_variable(PG_FUNCTION_ARGS);
+
+Datum htp_appletclose(PG_FUNCTION_ARGS);
+Datum htp_blockquoteclose(PG_FUNCTION_ARGS);
+Datum htp_bodyclose(PG_FUNCTION_ARGS);
+Datum htp_centerclose(PG_FUNCTION_ARGS);
+Datum htp_centeropen(PG_FUNCTION_ARGS);
+Datum htp_dirlistclose(PG_FUNCTION_ARGS);
+Datum htp_dirlistopen(PG_FUNCTION_ARGS);
+Datum htp_dlistclose(PG_FUNCTION_ARGS);
+Datum htp_flush(PG_FUNCTION_ARGS);
+Datum htp_fontclose(PG_FUNCTION_ARGS);
+Datum htp_formclose(PG_FUNCTION_ARGS);
+Datum htp_formselectclose(PG_FUNCTION_ARGS);
+Datum htp_formtextareaclose(PG_FUNCTION_ARGS);
+Datum htp_framesetclose(PG_FUNCTION_ARGS);
+Datum htp_headclose(PG_FUNCTION_ARGS);
+Datum htp_headopen(PG_FUNCTION_ARGS);
+Datum htp_htmlclose(PG_FUNCTION_ARGS);
+Datum htp_htmlopen(PG_FUNCTION_ARGS);
+Datum htp_init(PG_FUNCTION_ARGS);
+Datum htp_listingclose(PG_FUNCTION_ARGS);
+Datum htp_listingopen(PG_FUNCTION_ARGS);
+Datum htp_mapclose(PG_FUNCTION_ARGS);
+Datum htp_menulistclose(PG_FUNCTION_ARGS);
+Datum htp_menulistopen(PG_FUNCTION_ARGS);
+Datum htp_noframesclose(PG_FUNCTION_ARGS);
+Datum htp_noframesopen(PG_FUNCTION_ARGS);
+Datum htp_olistclose(PG_FUNCTION_ARGS);
+Datum htp_para(PG_FUNCTION_ARGS);
+Datum htp_preclose(PG_FUNCTION_ARGS);
+Datum htp_reset_get_page(PG_FUNCTION_ARGS);
+Datum htp_showpage(PG_FUNCTION_ARGS);
+Datum htp_tableclose(PG_FUNCTION_ARGS);
+Datum htp_tablerowclose(PG_FUNCTION_ARGS);
+Datum htp_ulistclose(PG_FUNCTION_ARGS);
+Datum htp_wbr(PG_FUNCTION_ARGS);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // DBMS_HTP_H
+
diff --git a/src/include/dbms/owa.h b/src/include/dbms/owa.h
new file mode 100644
index 0000000..eb8b33d
--- /dev/null
+++ b/src/include/dbms/owa.h
@@ -0,0 +1,116 @@
+#ifndef DBMS_OWA_H
+#define DBMS_OWA_H
+
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include "postgres.h"
+#include "fmgr.h"
+#include "datatype/timestamp.h"
+
+Datum owa_init_cgi_env(PG_FUNCTION_ARGS);
+Datum owa_init_cgi_env2(PG_FUNCTION_ARGS);
+Datum owa_cookie_send(PG_FUNCTION_ARGS);
+Datum owa_cookie_send2(PG_FUNCTION_ARGS);
+Datum owa_cache_disable(PG_FUNCTION_ARGS);
+Datum owa_cache_set_cache(PG_FUNCTION_ARGS);
+Datum owa_cache_set_expires(PG_FUNCTION_ARGS);
+Datum owa_cache_set_not_modified(PG_FUNCTION_ARGS);
+Datum owa_cache_set_surrogate_control(PG_FUNCTION_ARGS);
+Datum owa_cache_set_request_etag(PG_FUNCTION_ARGS);
+Datum owa_cache_set_request_level(PG_FUNCTION_ARGS);
+Datum owa_cache_get_etag(PG_FUNCTION_ARGS);
+Datum owa_cache_get_etag2(PG_FUNCTION_ARGS);
+Datum owa_cache_get_level(PG_FUNCTION_ARGS);
+Datum owa_util_get_cgi_env(PG_FUNCTION_ARGS);
+Datum owa_util_showpage(PG_FUNCTION_ARGS);
+Datum owa_util_showpage_utils(PG_FUNCTION_ARGS);
+
+#ifdef __cplusplus
+} /* extern "C" */
+
+namespace Owa
+{
+enum class EventKind
+{
+ BodyText,
+ Cookie,
+ Cache,
+ Status
+};
+
+enum class PageState
+{
+ HeadersOpen,
+ BodyStarted
+};
+
+struct CookieData
+{
+ std::string name;
+ std::string value;
+ bool has_expires = false;
+ TimestampTz expires = 0;
+ bool has_path = false;
+ std::string path;
+ bool has_domain = false;
+ std::string domain;
+ bool has_secure = false;
+};
+
+struct EventEntry
+{
+ EventKind kind;
+ SubTransactionId subxid;
+ std::string bodyText;
+ CookieData cookieData;
+ std::string cacheEtag;
+ std::string cacheLevel;
+ int32 cacheExpires = 0;
+ bool cacheDisabled = false;
+ std::string cacheSurrogateControl;
+ int32 statusCode = 0;
+ std::string statusReason;
+};
+
+struct PageContext
+{
+ std::vector<EventEntry> events;
+ PageState state = PageState::HeadersOpen;
+ bool hasRequestCacheEtag = false;
+ std::string requestCacheEtag;
+ bool hasRequestCacheLevel = false;
+ std::string requestCacheLevel;
+ bool hasRequestProtocol = false;
+ std::string requestProtocol;
+ std::unordered_map<std::string, std::string> cgiValues;
+};
+
+extern PageContext *current_page_context_;
+extern bool xact_callback_registered_;
+extern bool subxact_callback_registered_;
+
+std::string textToString(text *value);
+void validateHeaderValue(const std::string &arg_value, const char *arg_name);
+void validateCookieName(const std::string &cookie_name);
+void validateCacheEtag(const std::string &etag_value);
+std::string validateAndNormalizeCacheLevel(const std::string &level_value);
+std::string renderCacheHeaders(const std::string &etag_value, const std::string &level_value);
+void validateCacheExpires(int32 expires_value);
+std::string renderExpiresHeaders(int32 expires_value, const std::string &level_value);
+void validateSurrogateControlValue(const std::string &value);
+void ensureCallbackRegistered(void);
+void ensurePageContextViaServiceInit(void);
+void resetPageContext(void);
+void appendHtpText(const char *text, bool add_new_line);
+std::string normalizeCgiName(const std::string &cgi_name);
+}
+#endif
+
+#endif /* DBMS_OWA_H */
diff --git a/src/include/dbms/owa_pattern.h b/src/include/dbms/owa_pattern.h
new file mode 100644
index 0000000..a760144
--- /dev/null
+++ b/src/include/dbms/owa_pattern.h
@@ -0,0 +1,55 @@
+#ifndef OWA_PATTERN_INTERNAL_HPP
+#define OWA_PATTERN_INTERNAL_HPP
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+
+Datum owa_pattern_amatch_ovr1(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr2(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr3(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr4(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr5(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr6(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr7(PG_FUNCTION_ARGS);
+Datum owa_pattern_amatch_ovr8(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr1(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr2(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr3(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr4(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr5(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr6(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr7(PG_FUNCTION_ARGS);
+Datum owa_pattern_change_ovr8(PG_FUNCTION_ARGS);
+Datum owa_pattern_getpat(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr1(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr2(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr3(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr4(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr5(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr6(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr7(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr8(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr9(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr10(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr11(PG_FUNCTION_ARGS);
+Datum owa_pattern_match_ovr12(PG_FUNCTION_ARGS);
+Datum owa_pattern_match2(PG_FUNCTION_ARGS);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // OWA_PATTERN_INTERNAL_HPP
+
diff --git a/src/include/dbms/owa_text.h b/src/include/dbms/owa_text.h
new file mode 100644
index 0000000..d13c3a4
--- /dev/null
+++ b/src/include/dbms/owa_text.h
@@ -0,0 +1,36 @@
+#ifndef OWA_TEXT_INTERNAL_HPP
+#define OWA_TEXT_INTERNAL_HPP
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include "postgres.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
+#include "utils/numeric.h"
+#include "utils/date.h"
+#include "utils/timestamp.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+
+Datum owa_text_add2multi_ovr1(PG_FUNCTION_ARGS);
+Datum owa_text_add2multi_ovr2(PG_FUNCTION_ARGS);
+Datum owa_text_new_multi_ovr1(PG_FUNCTION_ARGS);
+Datum owa_text_new_multi_ovr2(PG_FUNCTION_ARGS);
+Datum owa_text_new_row_list_ovr1(PG_FUNCTION_ARGS);
+Datum owa_text_new_row_list_ovr2(PG_FUNCTION_ARGS);
+Datum owa_text_print_multi(PG_FUNCTION_ARGS);
+Datum owa_text_print_row_list(PG_FUNCTION_ARGS);
+Datum owa_text_stream2multi(PG_FUNCTION_ARGS);
+Datum owa_text_stream2multi2(PG_FUNCTION_ARGS);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // OWA_TEXT_INTERNAL_HPP
+
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index fdc815a..ec4391a 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -262,6 +262,9 @@
/* Define to 1 if you have the `pam' library (-lpam). */
#undef HAVE_LIBPAM
+/* Define to 1 if you have the `pcre2-8' library (-lpcre2-8). */
+#undef HAVE_LIBPCRE2_8
+
/* Define if you have a function readline library */
#undef HAVE_LIBREADLINE
@@ -733,6 +736,9 @@
/* Define to 1 to build with PAM support. (--with-pam) */
#undef USE_PAM
+/* Define to 1 to build with PCRE2 support (--with-pcre2) */
+#undef USE_PCRE2
+
/* Define to 1 to use software CRC-32C implementation (slicing-by-8). */
#undef USE_SLICING_BY_8_CRC32C
diff --git a/src/include/utils/coder.h b/src/include/utils/coder.h
new file mode 100644
index 0000000..32f5ced
--- /dev/null
+++ b/src/include/utils/coder.h
@@ -0,0 +1,20 @@
+#ifndef CODER_H
+#define CODER_H
+
+// XXX
+#define pPASSWORDSALT "passwordsalt"
+#define HASH_KWD "#@b*!a^&-"
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern char *pg_kuzn_encode(const char *str, size_t len);
+extern char *pg_kuzn_decode(const char *str, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // CODER_H
diff --git a/src/include/utils/dbms_warning.h b/src/include/utils/dbms_warning.h
new file mode 100644
index 0000000..9ea585d
--- /dev/null
+++ b/src/include/utils/dbms_warning.h
@@ -0,0 +1,23 @@
+#ifndef DBMS_WARNING_H
+#define DBMS_WARNING_H
+
+#include "postgres.h"
+
+typedef enum DBMSWarningCompilerMode
+{
+ DBMS_WARNING_COMPILER_MODE_DISABLE,
+ DBMS_WARNING_COMPILER_MODE_ENABLE,
+ DBMS_WARNING_COMPILER_MODE_ERROR,
+} DBMSWarningCompilerMode;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+DBMSWarningCompilerMode dbms_warning_get_compiler_warning_mode(bool* is_explicit);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // DBMS_WARNING_H
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index 09707d0..c1b810b 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -21,11 +21,14 @@
#include "catalog/namespace.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
+#include "common/base64.h"
#include "funcapi.h"
#include "nodes/makefuncs.h"
#include "parser/parse_node.h"
#include "plpgsql.h"
+#include "utils/dbms_warning.h"
#include "utils/builtins.h"
+#include "utils/coder.h"
#include "utils/fmgroids.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
@@ -77,6 +80,7 @@
const CachedFunctionHashKey *hashkey,
CachedFunction *cfunc,
bool forValidator);
+static void plpgsql_apply_dbms_warning_mode(PLpgSQL_function *function);
static void plpgsql_compile_error_callback(void *arg);
static void add_parameter_name(PLpgSQL_nsitem_type itemtype, int itemno, const char *name);
static void add_dummy_return(PLpgSQL_function *function);
@@ -141,6 +145,27 @@
yyscan_t yyscanner;
};
+static char*
+unwrap_source(char *wrapped_source, size_t len)
+{
+ char *result = NULL;
+ size_t decoded_source_len = pg_b64_dec_len(len);
+ char* decoded_source = palloc(decoded_source_len + 1);
+
+ int ret = pg_b64_decode(wrapped_source, len, (uint8_t*)decoded_source,
+ decoded_source_len);
+ if (ret == -1)
+ {
+ goto finish;
+ }
+
+ result = pg_kuzn_decode(decoded_source, decoded_source_len);
+
+finish:
+ pfree(decoded_source);
+ return result;
+}
+
/*
* This is the slow part of plpgsql_compile().
*
@@ -201,6 +226,30 @@
*/
prosrcdatum = SysCacheGetAttrNotNull(PROCOID, procTup, Anum_pg_proc_prosrc);
proc_source = TextDatumGetCString(prosrcdatum);
+
+ {
+ char *wrapcomment_begin = strstr(proc_source, "/* WRAPPEDpgSQL ");
+ if (wrapcomment_begin != NULL)
+ {
+ char *unwrapped_source;
+ /* 16 is the len of WRAPPEDpgSQL prefix */
+ char *wrapped_code_start = wrapcomment_begin + 16;
+ char *wrapped_code_end = strstr(wrapped_code_start, " */");
+ if (wrapped_code_end != NULL)
+ {
+ size_t wrapped_code_len = wrapped_code_end - wrapped_code_start;
+ char *wrapped_code = palloc(wrapped_code_len + 1);
+ memcpy(wrapped_code, wrapped_code_start, wrapped_code_len);
+ wrapped_code[wrapped_code_len] = '\0';
+ unwrapped_source = unwrap_source(wrapped_code + 1,
+ wrapped_code_len - 10);
+ pfree(wrapped_code);
+ pfree(proc_source);
+ proc_source = unwrapped_source;
+ }
+ }
+ }
+
scanner = plpgsql_scanner_init(proc_source);
plpgsql_error_funcname = pstrdup(NameStr(procStruct->proname));
@@ -248,6 +297,8 @@
/* only promote extra warnings and errors at CREATE FUNCTION time */
function->extra_warnings = forValidator ? plpgsql_extra_warnings : 0;
function->extra_errors = forValidator ? plpgsql_extra_errors : 0;
+ if (forValidator)
+ plpgsql_apply_dbms_warning_mode(function);
if (is_dml_trigger)
function->fn_is_trigger = PLPGSQL_DML_TRIGGER;
@@ -720,11 +771,37 @@
plpgsql_error_funcname = NULL;
plpgsql_check_syntax = false;
+ plpgsql_curr_compile = NULL;
MemoryContextSwitchTo(plpgsql_compile_tmp_cxt);
plpgsql_compile_tmp_cxt = NULL;
}
+static void
+plpgsql_apply_dbms_warning_mode(PLpgSQL_function *function)
+{
+ bool is_explicit = false;
+ const DBMSWarningCompilerMode mode = dbms_warning_get_compiler_warning_mode(&is_explicit);
+
+ if (!is_explicit)
+ return;
+
+ function->extra_warnings &= ~PLPGSQL_XCHECK_SHADOWVAR;
+ function->extra_errors &= ~PLPGSQL_XCHECK_SHADOWVAR;
+
+ switch (mode)
+ {
+ case DBMS_WARNING_COMPILER_MODE_DISABLE:
+ break;
+ case DBMS_WARNING_COMPILER_MODE_ENABLE:
+ function->extra_warnings |= PLPGSQL_XCHECK_SHADOWVAR;
+ break;
+ case DBMS_WARNING_COMPILER_MODE_ERROR:
+ function->extra_errors |= PLPGSQL_XCHECK_SHADOWVAR;
+ break;
+ }
+}
+
/* ----------
* plpgsql_compile_inline Make an execution tree for an anonymous code block.
*
diff --git a/src/test/regress/expected/dbms_db_version.out b/src/test/regress/expected/dbms_db_version.out
new file mode 100644
index 0000000..44ca111
--- /dev/null
+++ b/src/test/regress/expected/dbms_db_version.out
@@ -0,0 +1,73 @@
+-- DBMS_DB_VERSION regression coverage.
+-- no_package_constant_artifacts
+SELECT dbms_db_version_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT
+ dbms_db_version_version() AS version_value,
+ dbms_db_version_release() AS release_value,
+ dbms_db_version_ver_le(23, 0) AS service_ver_le_23_0,
+ dbms_db_version_ver_le(21, 0) AS service_ver_le_21_0,
+ dbms_db_version_ver_le_9_1() AS ver_le_9_1,
+ dbms_db_version_ver_le_9_2() AS ver_le_9_2,
+ dbms_db_version_ver_le_9() AS ver_le_9,
+ dbms_db_version_ver_le_10_1() AS ver_le_10_1,
+ dbms_db_version_ver_le_10_2() AS ver_le_10_2,
+ dbms_db_version_ver_le_10() AS ver_le_10,
+ dbms_db_version_ver_le_11_1() AS ver_le_11_1,
+ dbms_db_version_ver_le_11_2() AS ver_le_11_2,
+ dbms_db_version_ver_le_11() AS ver_le_11,
+ dbms_db_version_ver_le_12_1() AS ver_le_12_1,
+ dbms_db_version_ver_le_12_2() AS ver_le_12_2,
+ dbms_db_version_ver_le_12() AS ver_le_12,
+ dbms_db_version_ver_le_18() AS ver_le_18,
+ dbms_db_version_ver_le_19() AS ver_le_19,
+ dbms_db_version_ver_le_20() AS ver_le_20,
+ dbms_db_version_ver_le_21() AS ver_le_21,
+ dbms_db_version_ver_le_23() AS ver_le_23;
+ version_value | release_value | service_ver_le_23_0 | service_ver_le_21_0 | ver_le_9_1 | ver_le_9_2 | ver_le_9 | ver_le_10_1 | ver_le_10_2 | ver_le_10 | ver_le_11_1 | ver_le_11_2 | ver_le_11 | ver_le_12_1 | ver_le_12_2 | ver_le_12 | ver_le_18 | ver_le_19 | ver_le_20 | ver_le_21 | ver_le_23
+---------------+---------------+---------------------+---------------------+------------+------------+----------+-------------+-------------+-----------+-------------+-------------+-----------+-------------+-------------+-----------+-----------+-----------+-----------+-----------+-----------
+ 23 | 0 | t | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | f | t
+(1 row)
+
+SELECT proname, oid
+FROM pg_proc
+WHERE proname LIKE 'dbms_db_version_%'
+ORDER BY oid;
+ proname | oid
+-----------------------------+-------
+ dbms_db_version_version | 11769
+ dbms_db_version_release | 11770
+ dbms_db_version_ver_le_9_1 | 11771
+ dbms_db_version_ver_le_9_2 | 11772
+ dbms_db_version_ver_le_9 | 11773
+ dbms_db_version_ver_le_10_1 | 11774
+ dbms_db_version_ver_le_10_2 | 11775
+ dbms_db_version_ver_le_10 | 11776
+ dbms_db_version_ver_le_11_1 | 11777
+ dbms_db_version_ver_le_11_2 | 11778
+ dbms_db_version_ver_le_11 | 11779
+ dbms_db_version_ver_le_12_1 | 11780
+ dbms_db_version_ver_le_12_2 | 11781
+ dbms_db_version_ver_le_12 | 11782
+ dbms_db_version_ver_le_18 | 11783
+ dbms_db_version_ver_le_19 | 11784
+ dbms_db_version_ver_le_20 | 11785
+ dbms_db_version_ver_le_21 | 11786
+ dbms_db_version_ver_le_23 | 11787
+ dbms_db_version_ver_le | 14777
+ dbms_db_version_get_version | 14790
+(21 rows)
+
+SELECT count(*) = 20 AS package_functions_registered
+FROM pg_proc
+WHERE proname LIKE 'dbms_db_version_%'
+ AND prorettype IN ('int4'::regtype, 'bool'::regtype);
+ package_functions_registered
+------------------------------
+ t
+(1 row)
+
diff --git a/src/test/regress/expected/dbms_ddl.out b/src/test/regress/expected/dbms_ddl.out
new file mode 100644
index 0000000..44e0b8c
--- /dev/null
+++ b/src/test/regress/expected/dbms_ddl.out
@@ -0,0 +1,11 @@
+SELECT DBMS_DDL_WRAP($code$
+CREATE FUNCTION test() RETURNS INTEGER LANGUAGE plpgsql
+AS $$
+ RETURN 777;
+$$;
+$code$);
+ dbms_ddl_wrap
+-------------------------------------------------------------------
+ /* WRAPPEDpgSQL =AQyi5/lKGSmzHLFR19b8jBfddR+7SoPT44/oB808D0FD= */
+(1 row)
+
diff --git a/src/test/regress/expected/dbms_file_transfer.out b/src/test/regress/expected/dbms_file_transfer.out
new file mode 100644
index 0000000..6c9d3de
--- /dev/null
+++ b/src/test/regress/expected/dbms_file_transfer.out
@@ -0,0 +1,125 @@
+-- DBMS_FILE_TRANSFER: минимальный smoke test локальных операций с файлами.
+-- Сценарий ограничен безопасной локальной файловой системой и не использует dblink.
+\! rm -rf /tmp/rudb_dbms_file_transfer_regress
+\! mkdir -p /tmp/rudb_dbms_file_transfer_regress/src /tmp/rudb_dbms_file_transfer_regress/dst
+\! python3 -c "from pathlib import Path; Path('/tmp/rudb_dbms_file_transfer_regress/src/source.bin').write_bytes(bytes(range(256)) * 2)"
+SELECT dbms_file_transfer_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT dbms_file_transfer_is_safe_filename('sample.txt') AS safe_filename_ok;
+ safe_filename_ok
+------------------
+ t
+(1 row)
+
+SELECT dbms_file_transfer_is_safe_filename('../sample.txt') AS unsafe_filename_rejected;
+ unsafe_filename_rejected
+--------------------------
+ f
+(1 row)
+
+SELECT 'ok' AS result
+FROM (SELECT dbms_file_transfer_copy_file(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ '/tmp/rudb_dbms_file_transfer_regress/dst',
+ 'copied.bin'
+)) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT length(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/dst/copied.bin')) AS copied_len;
+ copied_len
+------------
+ 512
+(1 row)
+
+SELECT encode(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/dst/copied.bin'), 'hex') =
+ encode(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/src/source.bin'), 'hex') AS copied_matches_source;
+ copied_matches_source
+-----------------------
+ t
+(1 row)
+
+SELECT encode(read_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ 0,
+ 16
+), 'hex') AS first_chunk_hex;
+ first_chunk_hex
+----------------------------------
+ 000102030405060708090a0b0c0d0e0f
+(1 row)
+
+SELECT encode(read_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ 510,
+ 8
+), 'hex') AS tail_chunk_hex;
+ tail_chunk_hex
+----------------
+ feff
+(1 row)
+
+SELECT read_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ 0,
+ 0
+) IS NULL AS zero_limit_is_null;
+ zero_limit_is_null
+--------------------
+ t
+(1 row)
+
+SELECT 'ok' AS result
+FROM (SELECT write_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/dst',
+ 'written.bin',
+ decode('010203', 'hex'),
+ 0
+)) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT 'ok' AS result
+FROM (SELECT write_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/dst',
+ 'written.bin',
+ decode('0405', 'hex'),
+ 3
+)) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT encode(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/dst/written.bin'), 'hex') AS written_hex;
+ written_hex
+-------------
+ 0102030405
+(1 row)
+
+SELECT 'ok' AS result
+FROM (SELECT pg_file_unlink_custom('/tmp/rudb_dbms_file_transfer_regress/dst/written.bin')) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT pg_stat_file('/tmp/rudb_dbms_file_transfer_regress/dst/written.bin', true) IS NULL AS written_removed;
+ written_removed
+-----------------
+ t
+(1 row)
+
+\! rm -rf /tmp/rudb_dbms_file_transfer_regress
diff --git a/src/test/regress/expected/dbms_json.out b/src/test/regress/expected/dbms_json.out
new file mode 100644
index 0000000..dccb326
--- /dev/null
+++ b/src/test/regress/expected/dbms_json.out
@@ -0,0 +1,370 @@
+SET client_min_messages = warning;
+-- DBMS_JSON.BUILD_DATAGUIDE
+SELECT EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(dbms_json_build_dataguide('{"id": 10, "name": "alice"}'::jsonb)) elem
+ WHERE elem->>'path' = '$.id' AND elem->>'type' = 'number'
+) AS has_id_path,
+EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(dbms_json_build_dataguide('{"id": 10, "name": "alice"}'::jsonb)) elem
+ WHERE elem->>'path' = '$.name' AND elem->>'type' = 'string'
+) AS has_name_path;
+ has_id_path | has_name_path
+-------------+---------------
+ t | t
+(1 row)
+
+SELECT EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(dbms_json_build_dataguide('{"info": {"score": 42}}'::jsonb)) elem
+ WHERE elem->>'path' = '$.info.score'
+) AS has_nested_score_path;
+ has_nested_score_path
+-----------------------
+ t
+(1 row)
+
+SELECT dbms_json_build_dataguide('[1,2,3]'::jsonb);
+ERROR: DBMS_JSON.BUILD_DATAGUIDE expects root JSON object
+-- DBMS_JSON.GET_INDEX_DATAGUIDE and RENAME_COLUMN metadata
+DROP TABLE IF EXISTS dbms_json_metadata;
+DROP TABLE IF EXISTS t_json_guide;
+CREATE TABLE t_json_guide
+(
+ j1 jsonb
+);
+INSERT INTO t_json_guide
+VALUES ('{"id": 10, "name": "alice"}'),
+ ('{"id": 20, "name": "bob"}');
+SELECT dbms_json_get_index_dataguide('t_json_guide', 'j1', 1) LIKE '%$.id%' AS has_id,
+ dbms_json_get_index_dataguide('t_json_guide', 'j1', 1) LIKE '%$.name%' AS has_name;
+ has_id | has_name
+--------+----------
+ t | t
+(1 row)
+
+SELECT dbms_json_rename_column('t_json_guide', 'j1', '$.name', 2, 'preferred_name');
+ dbms_json_rename_column
+-------------------------
+
+(1 row)
+
+SELECT dbms_json_get_index_dataguide('t_json_guide', 'j1', 1) LIKE '%preferred_name%' AS has_preferred_name;
+ has_preferred_name
+--------------------
+ t
+(1 row)
+
+SELECT position(E'\n' in dbms_json_get_index_dataguide('t_json_guide', 'j1', 1, 1)::text) > 0 AS pretty_has_newline;
+ pretty_has_newline
+--------------------
+ t
+(1 row)
+
+SELECT dbms_json_get_index_dataguide('t_json_guide', 'j1', 99);
+ERROR: DBMS_JSON.GET_INDEX_DATAGUIDE invalid format
+DETAIL: format=99
+-- DBMS_JSON.GET_VIEW_SQL
+DROP SCHEMA IF EXISTS "HR" CASCADE;
+CREATE SCHEMA "HR";
+SET search_path TO "HR", public;
+CREATE TABLE "HR"."T1" ("J1" jsonb);
+INSERT INTO "HR"."T1"("J1") VALUES ('{"id":1,"a":10,"b":"txt","info":[{"val":5}]}'::jsonb);
+SELECT dbms_json_get_view_sql('V1', 'T1', 'J1',
+ '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}') LIKE
+ 'CREATE OR REPLACE VIEW "HR".v1 AS SELECT JT.%JSON_TABLE%' AS get_view_sql_has_create;
+ get_view_sql_has_create
+-------------------------
+ t
+(1 row)
+
+SELECT dbms_json_get_view_sql(NULL, 'T1', 'J1',
+ '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}') LIKE
+ 'SELECT JT.%JSON_TABLE%' AS get_view_sql_select_only;
+ get_view_sql_select_only
+--------------------------
+ t
+(1 row)
+
+SELECT dbms_json_get_view_sql('V_EMPTY', 'T1', 'J1',
+ '{"type":"object","properties":{}}') = '' AS get_view_sql_empty;
+ get_view_sql_empty
+--------------------
+ t
+(1 row)
+
+SELECT dbms_json_get_view_sql('V_ERR', 'T1', 'J1',
+ '{"type":"object","properties":{"f1":{"type":"number","o:length":4,"o:preferred_column_name":"col"},"f2":{"type":"number","o:length":4,"o:preferred_column_name":"col"}}}',
+ resolvenameconflicts => false);
+ERROR: invalid data guide: column name conflict
+DETAIL: column_name=col
+RESET search_path;
+DROP SCHEMA "HR" CASCADE;
+-- DBMS_JSON.CREATE_VIEW and CREATE_VIEW_ON_PATH
+DROP VIEW IF EXISTS v_json_simple;
+DROP VIEW IF EXISTS v_json_path_auto;
+DROP VIEW IF EXISTS v_json_path_renamed;
+DROP VIEW IF EXISTS customer_profile_view;
+DROP TABLE IF EXISTS t_json_view;
+DROP TABLE IF EXISTS t_json_path;
+DROP TABLE IF EXISTS customers;
+DROP TABLE IF EXISTS dbms_json_metadata;
+CREATE TABLE t_json_view
+(
+ j1 jsonb
+);
+INSERT INTO t_json_view
+VALUES ('{"id": 10, "name": "alice", "info": {"score": 42}}');
+SELECT dbms_json_create_view(
+ 'v_json_simple',
+ 't_json_view',
+ 'j1',
+ '[{"path":"$.id","type":"number","column":"id"},{"path":"$.name","type":"string","column":"name"}]'::jsonb
+);
+ dbms_json_create_view
+-----------------------
+
+(1 row)
+
+SELECT to_regclass('v_json_simple') AS created_view;
+ created_view
+---------------
+ v_json_simple
+(1 row)
+
+TABLE v_json_simple;
+ id | name
+----+-------
+ 10 | alice
+(1 row)
+
+CREATE TABLE customers
+(
+ customer_json jsonb
+);
+INSERT INTO customers
+VALUES ('{"customer": {"id": 101, "name": "Alice", "city": "Moscow"}}');
+SELECT dbms_json_create_view(
+ 'customer_profile_view',
+ 'customers',
+ 'customer_json',
+ '[{"path":"$.customer.id","type":"number","column":"customer_id"},
+ {"path":"$.customer.name","type":"string","column":"customer_name"},
+ {"path":"$.customer.city","type":"string","column":"customer_city"}]'::jsonb,
+ path => '$.customer'
+);
+ dbms_json_create_view
+-----------------------
+
+(1 row)
+
+TABLE customer_profile_view;
+ customer_id | customer_name | customer_city
+-------------+---------------+---------------
+ 101 | Alice | Moscow
+(1 row)
+
+CREATE TABLE t_json_path
+(
+ j1 jsonb
+);
+INSERT INTO t_json_path
+VALUES ('{"info": {"score": 42, "label": "gold"}}');
+SELECT dbms_json_create_view_on_path('v_json_path_auto', 't_json_path', 'j1', '$.info');
+ dbms_json_create_view_on_path
+-------------------------------
+
+(1 row)
+
+TABLE v_json_path_auto;
+ label | score
+-------+-------
+ gold | 42
+(1 row)
+
+SELECT dbms_json_rename_column('t_json_path', 'j1', '$.info.label', 2, 'preferred_label');
+ dbms_json_rename_column
+-------------------------
+
+(1 row)
+
+SELECT dbms_json_create_view_on_path('v_json_path_renamed', 't_json_path', 'j1', '$.info');
+ dbms_json_create_view_on_path
+-------------------------------
+
+(1 row)
+
+SELECT column_name
+FROM information_schema.columns
+WHERE table_name = 'v_json_path_renamed'
+ORDER BY ordinal_position;
+ column_name
+-----------------
+ preferred_label
+ score
+(2 rows)
+
+TABLE v_json_path_renamed;
+ preferred_label | score
+-----------------+-------
+ gold | 42
+(1 row)
+
+SELECT dbms_json_create_view('v_json_bad_resource', 't_json_view', 'j1',
+ '[{"path":"$.id","type":"number","column":"id"}]'::jsonb,
+ '/tmp/resource');
+ERROR: DBMS_JSON.CREATE_VIEW resourcepath is not supported
+DETAIL: resourcepath must be NULL
+SELECT dbms_json_create_view2(
+ 'v_json_service',
+ 't_json_view',
+ 'j1',
+ '[{"path":"$.id","type":"number","column":"id"},{"path":"$.name","type":"string","column":"name"}]'::jsonb,
+ NULL::varchar2,
+ false,
+ 1,
+ '$'::varchar2,
+ true,
+ NULL::varchar2,
+ false,
+ 0::int4
+);
+ dbms_json_create_view2
+------------------------
+
+(1 row)
+
+SELECT to_regclass('v_json_service') AS created_service_view;
+ created_service_view
+----------------------
+ v_json_service
+(1 row)
+
+TABLE v_json_service;
+ id | name
+----+-------
+ 10 | alice
+(1 row)
+
+SELECT dbms_json_create_view_on_path('v_json_path_freq', 't_json_path', 'j1', '$.info', 1);
+ERROR: DBMS_JSON.CREATE_VIEW_ON_PATH frequency is not supported in simplified mode
+DETAIL: frequency=1
+SELECT dbms_json_create_view_on_path('v_json_path_empty', 't_json_path', 'j1', '$.missing');
+ERROR: DBMS_JSON.CREATE_VIEW_ON_PATH found no scalar fields
+DETAIL: path=$.missing
+-- DBMS_JSON.ADD_VIRTUAL_COLUMNS and DROP_VIRTUAL_COLUMNS
+DROP TABLE IF EXISTS t_json_vc;
+CREATE TABLE t_json_vc
+(
+ j1 jsonb
+);
+INSERT INTO t_json_vc
+VALUES ('{"id": 10, "name": "alice"}');
+SELECT dbms_json_add_virtual_columns(
+ 't_json_vc',
+ 'j1',
+ '[{"path":"$.id","type":"number","column":"id"},{"path":"$.name","type":"string","column":"name"}]'::jsonb
+);
+ dbms_json_add_virtual_columns
+-------------------------------
+
+(1 row)
+
+SELECT column_name
+FROM information_schema.columns
+WHERE table_name = 't_json_vc'
+ORDER BY ordinal_position;
+ column_name
+-------------
+ j1
+ id
+ name
+(3 rows)
+
+TABLE t_json_vc;
+ j1 | id | name
+-----------------------------+----+-------
+ {"id": 10, "name": "alice"} | 10 | alice
+(1 row)
+
+SELECT dbms_json_drop_virtual_columns('t_json_vc', 'j1');
+ dbms_json_drop_virtual_columns
+--------------------------------
+
+(1 row)
+
+SELECT column_name
+FROM information_schema.columns
+WHERE table_name = 't_json_vc'
+ORDER BY ordinal_position;
+ column_name
+-------------
+ j1
+(1 row)
+
+SELECT dbms_json_add_virtual_columns(
+ 't_json_vc',
+ 'j1',
+ '[{"path":"$.a","type":"number","column":"dup"},{"path":"$.b","type":"number","column":"dup"}]'::jsonb,
+ false
+);
+ERROR: invalid data guide: column name conflict
+DETAIL: column_name=dup
+-- DBMS_JSON.JSON_TYPE_CONVERTIBLE_CHECK
+DROP TABLE IF EXISTS status_json_check;
+DROP TABLE IF EXISTS t_json_convert;
+CREATE TABLE t_json_convert
+(
+ j1 jsonb
+);
+INSERT INTO t_json_convert
+VALUES ('{"id": 10}'),
+ ('{"id": 20}'),
+ (NULL);
+SELECT dbms_json_json_type_convertible_check('public', 't_json_convert', 'j1', 'status_json_check');
+ dbms_json_json_type_convertible_check
+---------------------------------------
+
+(1 row)
+
+SELECT to_regclass('public.status_json_check') AS created_status_table;
+ created_status_table
+----------------------
+ status_json_check
+(1 row)
+
+SELECT count(*) AS checked_rows, bool_and(is_convertible) AS all_convertible
+FROM status_json_check;
+ checked_rows | all_convertible
+--------------+-----------------
+ 2 | t
+(1 row)
+
+SELECT dbms_json_json_type_convertible_check('public', 't_json_convert', 'j1', 'status_json_check', false, true);
+ dbms_json_json_type_convertible_check
+---------------------------------------
+
+(1 row)
+
+SELECT count(*) AS checked_rows_after_append
+FROM status_json_check;
+ checked_rows_after_append
+---------------------------
+ 4
+(1 row)
+
+-- Cleanup
+DROP VIEW IF EXISTS v_json_simple;
+DROP VIEW IF EXISTS v_json_service;
+DROP VIEW IF EXISTS v_json_path_auto;
+DROP VIEW IF EXISTS v_json_path_renamed;
+DROP VIEW IF EXISTS customer_profile_view;
+DROP TABLE IF EXISTS t_json_view;
+DROP TABLE IF EXISTS t_json_path;
+DROP TABLE IF EXISTS customers;
+DROP TABLE IF EXISTS t_json_guide;
+DROP TABLE IF EXISTS t_json_vc;
+DROP TABLE IF EXISTS t_json_convert;
+DROP TABLE IF EXISTS status_json_check;
+DROP TABLE IF EXISTS dbms_json_metadata;
diff --git a/src/test/regress/expected/dbms_json_schema.out b/src/test/regress/expected/dbms_json_schema.out
new file mode 100644
index 0000000..b6d2543
--- /dev/null
+++ b/src/test/regress/expected/dbms_json_schema.out
@@ -0,0 +1,120 @@
+SET client_min_messages = warning;
+-- DBMS_JSON_SCHEMA.IS_SCHEMA_VALID
+SELECT dbms_json_schema_is_schema_valid('{"type": "string"}'::jsonb) AS valid_schema;
+ valid_schema
+--------------
+ 1
+(1 row)
+
+SELECT dbms_json_schema_is_schema_valid('{"type": "invalid_type_name"}'::jsonb) AS invalid_schema;
+ invalid_schema
+----------------
+ 0
+(1 row)
+
+SELECT dbms_json_schema_is_schema_valid('{
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {"type": "integer"},
+ "name": {"type": "string"}
+ },
+ "required": ["id"]
+ }
+ }
+}'::jsonb) AS nested_schema_valid;
+ nested_schema_valid
+---------------------
+ 1
+(1 row)
+
+SELECT dbms_json_schema_is_schema_valid2('{"type":"string"}'::jsonb, 0::int4) AS valid_schema_ext;
+ valid_schema_ext
+------------------
+ 1
+(1 row)
+
+SELECT dbms_json_schema_is_schema_valid(NULL::jsonb);
+ERROR: ORA-64403: input cannot be NULL
+SELECT dbms_json_schema_is_schema_valid('{ "wrong" : }'::jsonb);
+ERROR: invalid input syntax for type json
+LINE 1: SELECT dbms_json_schema_is_schema_valid('{ "wrong" : }'::jso...
+ ^
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 1: { "wrong" : }
+-- DBMS_JSON_SCHEMA.IS_VALID
+SELECT dbms_json_schema_is_valid(
+ '{"a": 1}'::jsonb,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::jsonb
+) AS data_valid;
+ data_valid
+------------
+ 1
+(1 row)
+
+SELECT dbms_json_schema_is_valid(
+ '{"a": "str"}'::jsonb,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::jsonb
+) AS data_invalid;
+ data_invalid
+--------------
+ 0
+(1 row)
+
+SELECT dbms_json_schema_is_valid(
+ '{"a": "str"}'::jsonb,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::jsonb,
+ 1
+);
+ dbms_json_schema_is_valid
+---------------------------
+ 0
+(1 row)
+
+-- DBMS_JSON_SCHEMA.VALIDATE_REPORT varchar2 overload
+SELECT (dbms_json_schema_validate_report(
+ '{"a": 1}'::varchar2,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::varchar2
+)::jsonb)->>'valid' AS varchar_report_valid;
+ varchar_report_valid
+----------------------
+ true
+(1 row)
+
+SELECT ((dbms_json_schema_validate_report(
+ '{"a": "str"}'::varchar2,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::varchar2
+)::jsonb)->>'valid') AS varchar_report_valid,
+jsonb_array_length((dbms_json_schema_validate_report(
+ '{"a": "str"}'::varchar2,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::varchar2
+)::jsonb)->'errors') > 0 AS varchar_report_has_errors;
+ varchar_report_valid | varchar_report_has_errors
+----------------------+---------------------------
+ false | t
+(1 row)
+
+-- DBMS_JSON_SCHEMA.VALIDATE_REPORT jsonb overload
+SELECT (dbms_json_schema_validate_report(
+ '{"name":"Test"}'::jsonb,
+ '{"type":"object","required":["name"]}'::jsonb
+)::jsonb)->>'valid' AS jsonb_report_valid;
+ jsonb_report_valid
+--------------------
+ true
+(1 row)
+
+SELECT dbms_json_schema_validate_report(NULL::varchar2, NULL::varchar2) IS NULL AS null_report_is_null;
+ null_report_is_null
+---------------------
+ t
+(1 row)
+
+SELECT dbms_json_schema_validate_report('{invalid_json}'::varchar2, '{"type":"object"}'::varchar2);
+ERROR: invalid JSON input
+DETAIL: [json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing object key - invalid literal; last read: '{i'; expected string literal
+SELECT dbms_json_schema_validate_report('{"a":1}'::varchar2, '{"type": "object", "properties": { invalid } }'::varchar2);
+ERROR: invalid JSON input
+DETAIL: [json.exception.parse_error.101] parse error at line 1, column 36: syntax error while parsing object key - invalid literal; last read: '"properties": { i'; expected string literal
diff --git a/src/test/regress/expected/dbms_sqlset.out b/src/test/regress/expected/dbms_sqlset.out
new file mode 100644
index 0000000..8199e8d
--- /dev/null
+++ b/src/test/regress/expected/dbms_sqlset.out
@@ -0,0 +1,627 @@
+-- DBMS_SQLSET regression coverage.
+-- no_package_constant_artifacts
+SELECT dbms_sqlset_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT
+ dbms_sqlset_mode_replace_old_stats() AS mode_replace_old_stats,
+ dbms_sqlset_mode_accumulate_stats() AS mode_accumulate_stats,
+ dbms_sqlset_has_recursive_sql() AS has_recursive_sql,
+ dbms_sqlset_no_recursive_sql() AS no_recursive_sql,
+ dbms_sqlset_single_execution() AS single_execution,
+ dbms_sqlset_all_executions() AS all_executions,
+ dbms_sqlset_limited_command_type() AS limited_command_type,
+ dbms_sqlset_all_command_type() AS all_command_type,
+ dbms_sqlset_sts_stgtab_10_2_version() AS sts_stgtab_10_2_version,
+ dbms_sqlset_sts_stgtab_11_1_version() AS sts_stgtab_11_1_version,
+ dbms_sqlset_sts_stgtab_11_2_version() AS sts_stgtab_11_2_version,
+ dbms_sqlset_sts_stgtab_12_1_version() AS sts_stgtab_12_1_version,
+ dbms_sqlset_sts_stgtab_12_2_version() AS sts_stgtab_12_2_version;
+ mode_replace_old_stats | mode_accumulate_stats | has_recursive_sql | no_recursive_sql | single_execution | all_executions | limited_command_type | all_command_type | sts_stgtab_10_2_version | sts_stgtab_11_1_version | sts_stgtab_11_2_version | sts_stgtab_12_1_version | sts_stgtab_12_2_version
+------------------------+-----------------------+-------------------+------------------+------------------+----------------+----------------------+------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------
+ 1 | 2 | Y | N | 1 | 2 | 1 | 2 | 1 | 2 | 3 | 5 | 6
+(1 row)
+
+SELECT dbms_sqlset_normalize_attribute_list(NULL) AS normalized_attribute_list_default;
+ normalized_attribute_list_default
+-----------------------------------
+ TYPICAL
+(1 row)
+
+SELECT dbms_sqlset_normalize_attribute_list('basic') AS normalized_attribute_list_basic;
+ normalized_attribute_list_basic
+---------------------------------
+ BASIC
+(1 row)
+
+SELECT proname, oid
+FROM pg_proc
+WHERE proname IN (
+ 'dbms_sqlset_mode_replace_old_stats',
+ 'dbms_sqlset_mode_accumulate_stats',
+ 'dbms_sqlset_has_recursive_sql',
+ 'dbms_sqlset_no_recursive_sql',
+ 'dbms_sqlset_single_execution',
+ 'dbms_sqlset_all_executions',
+ 'dbms_sqlset_limited_command_type',
+ 'dbms_sqlset_all_command_type',
+ 'dbms_sqlset_sts_stgtab_10_2_version',
+ 'dbms_sqlset_sts_stgtab_11_1_version',
+ 'dbms_sqlset_sts_stgtab_11_2_version',
+ 'dbms_sqlset_sts_stgtab_12_1_version',
+ 'dbms_sqlset_sts_stgtab_12_2_version'
+)
+ORDER BY oid;
+ proname | oid
+-------------------------------------+-------
+ dbms_sqlset_mode_replace_old_stats | 11367
+ dbms_sqlset_mode_accumulate_stats | 11368
+ dbms_sqlset_has_recursive_sql | 11369
+ dbms_sqlset_no_recursive_sql | 11370
+ dbms_sqlset_single_execution | 11371
+ dbms_sqlset_all_executions | 11372
+ dbms_sqlset_limited_command_type | 11373
+ dbms_sqlset_all_command_type | 11374
+ dbms_sqlset_sts_stgtab_10_2_version | 11375
+ dbms_sqlset_sts_stgtab_11_1_version | 11376
+ dbms_sqlset_sts_stgtab_11_2_version | 11377
+ dbms_sqlset_sts_stgtab_12_1_version | 11378
+ dbms_sqlset_sts_stgtab_12_2_version | 11379
+(13 rows)
+
+SELECT count(*) = 13 AS package_constants_registered
+FROM pg_proc
+WHERE proname LIKE 'dbms_sqlset_%'
+ AND proargtypes = ''::oidvector
+ AND prorettype IN ('int4'::regtype, 'varchar2'::regtype);
+ package_constants_registered
+------------------------------
+ t
+(1 row)
+
+SELECT proname, oidvectortypes(proargtypes) AS argtypes
+FROM pg_proc
+WHERE proname IN (
+ 'dbms_sqlset_load_sqlset',
+ 'dbms_sqlset_select_sqlset',
+ 'dbms_sqlset_select_cursor_cache',
+ 'dbms_sqlset_select_sql_trace',
+ 'dbms_sqlset_select_workload_repository',
+ 'dbms_sqlset_capture_cursor_cache',
+ 'dbms_sqlset_create_stgtab',
+ 'dbms_sqlset_drop_sqlset_by_prefix',
+ 'dbms_sqlset_pack_stgtab',
+ 'dbms_sqlset_remap_stgtab',
+ 'dbms_sqlset_remove_reference',
+ 'dbms_sqlset_update_sqlset_0',
+ 'dbms_sqlset_update_sqlset_1',
+ 'dbms_sqlset_update_sqlset_2'
+)
+ORDER BY proname, argtypes;
+ proname | argtypes
+----------------------------------------+---------------------------------------------------------------------------------------
+ dbms_sqlset_capture_cursor_cache | text, numeric, numeric, text, numeric, text, text, text
+ dbms_sqlset_create_stgtab | text, text, text, numeric
+ dbms_sqlset_drop_sqlset_by_prefix | text, numeric, numeric
+ dbms_sqlset_load_sqlset | text, refcursor, text, text, text, text, boolean, numeric, text
+ dbms_sqlset_pack_stgtab | text, text, text, text, numeric
+ dbms_sqlset_remap_stgtab | text, text, text, text, text, text, numeric, numeric
+ dbms_sqlset_remove_reference | text, numeric, text, numeric
+ dbms_sqlset_select_cursor_cache | text, text, text, text, text, numeric, numeric, text, text
+ dbms_sqlset_select_sql_trace | text, text, text, text, numeric, numeric, text, text, numeric
+ dbms_sqlset_select_sqlset | text, text, text, text, text, text, numeric, numeric, text, text, text, text
+ dbms_sqlset_select_workload_repository | numeric, numeric, text, text, text, text, text, numeric, numeric, text, text, numeric
+ dbms_sqlset_select_workload_repository | text, text, text, text, text, text, numeric, numeric, text, text, numeric
+ dbms_sqlset_update_sqlset_0 | text, text, numeric, text, text, text
+ dbms_sqlset_update_sqlset_1 | text, text, numeric, text, text, text
+ dbms_sqlset_update_sqlset_2 | text, text, numeric, text, numeric, text
+(15 rows)
+
+CALL dbms_sqlset_drop_sqlset(NULL, NULL);
+ERROR: ORA-13755: invalid "SQL Tuning Set" name
+CALL dbms_sqlset_drop_sqlset('sts_missing', NULL);
+ERROR: ORA-13754: "SQL Tuning Set" "sts_missing" does not exist.
+SELECT dbms_sqlset_create_sqlset_0('sts_load', 'load test');
+ dbms_sqlset_create_sqlset_0
+-----------------------------
+ sts_load
+(1 row)
+
+SELECT dbms_sqlset_create_sqlset_0('sts_empty');
+ dbms_sqlset_create_sqlset_0
+-----------------------------
+ sts_empty
+(1 row)
+
+SELECT dbms_sqlset_create_sqlset_0() LIKE 'STS_%' AS generated_name;
+ generated_name
+----------------
+ t
+(1 row)
+
+CALL dbms_sqlset_create_sqlset_1('sts_proc');
+CALL dbms_sqlset_create_sqlset_1('sts_proc');
+ERROR: ORA-13753: "SQL Tuning Set" "sts_proc" already exists.
+SELECT dbms_sqlset_create_sqlset_0('sts_load', NULL, NULL);
+ERROR: ORA-13753: "SQL Tuning Set" "sts_load" already exists.
+SELECT dbms_sqlset_create_sqlset_0('sts_owner', NULL, 'dbms_sqlset_non_current_owner_' || current_user);
+ERROR: DBMS_SQLSET.CREATE_SQLSET не поддерживает sqlset_owner вне текущего пользователя
+CALL dbms_sqlset_drop_sqlset('sts_load', 'dbms_sqlset_non_current_owner_' || current_user);
+ERROR: DBMS_SQLSET.DROP_SQLSET не поддерживает sqlset_owner вне текущего пользователя
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', NULL, NULL, true, NULL, 'dbms_sqlset_non_current_owner_' || current_user);
+ERROR: DBMS_SQLSET.LOAD_SQLSET не поддерживает sqlset_owner вне текущего пользователя
+-- SELECT_SQLSET rejects explicit non-current owner.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, 'dbms_sqlset_non_current_owner_' || current_user, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает sqlset_owner вне текущего пользователя
+SELECT count(*) AS empty_rows
+FROM dbms_sqlset_select_sqlset('sts_empty');
+ empty_rows
+------------
+ 0
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, 'orig'),
+ ('sql2', 222, 'select 2', 'module2', 'action2', 11, 21, 31, 41, 51, 1, 'row2')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'accumulate');
+ CLOSE c;
+END
+$$;
+SELECT count(*) AS load_rows,
+ max(CASE WHEN sql_id = 'sql1' THEN module END) AS sql1_module,
+ max(CASE WHEN sql_id = 'sql1' THEN action END) AS sql1_action,
+ max(CASE WHEN sql_id = 'sql1' THEN sql_text END) AS sql1_sql_text,
+ max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time,
+ max(CASE WHEN sql_id = 'sql1' THEN buffer_gets END) AS sql1_buffer_gets,
+ max(CASE WHEN sql_id = 'sql1' THEN disk_reads END) AS sql1_disk_reads,
+ max(CASE WHEN sql_id = 'sql1' THEN rows_processed END) AS sql1_rows_processed,
+ max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other
+FROM dbms_sqlset_select_sqlset('sts_load');
+ load_rows | sql1_module | sql1_action | sql1_sql_text | sql1_executions | sql1_elapsed_time | sql1_cpu_time | sql1_buffer_gets | sql1_disk_reads | sql1_rows_processed | sql1_other
+-----------+-------------+-------------+---------------+-----------------+-------------------+---------------+------------------+-----------------+---------------------+------------
+ 2 | module1 | action1 | select 1 | 2 | 10 | 20 | 30 | 40 | 50 | orig
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, 'orig'),
+ ('sql2', 222, 'select 2', 'module2', 'action2', 11, 21, 31, 41, 51, 1, 'row2')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c);
+ CLOSE c;
+END
+$$;
+SELECT count(*) AS duplicate_insert_rows
+FROM dbms_sqlset_select_sqlset('sts_load');
+ duplicate_insert_rows
+-----------------------
+ 2
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select changed', 'module_changed', 'action_changed', 100, 200, 300, 400, 500, 20, 'replace')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge');
+ CLOSE c;
+END
+$$;
+SELECT max(CASE WHEN sql_id = 'sql1' THEN module END) AS sql1_module_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN action END) AS sql1_action_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN sql_text END) AS sql1_sql_text_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN buffer_gets END) AS sql1_buffer_gets_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN disk_reads END) AS sql1_disk_reads_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN rows_processed END) AS sql1_rows_processed_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_after_replace
+FROM dbms_sqlset_select_sqlset('sts_load');
+ sql1_module_after_replace | sql1_action_after_replace | sql1_sql_text_after_replace | sql1_executions_after_replace | sql1_elapsed_time_after_replace | sql1_cpu_time_after_replace | sql1_buffer_gets_after_replace | sql1_disk_reads_after_replace | sql1_rows_processed_after_replace | sql1_other_after_replace
+---------------------------+---------------------------+-----------------------------+-------------------------------+---------------------------------+-----------------------------+--------------------------------+-------------------------------+-----------------------------------+--------------------------
+ module1 | action1 | select 1 | 20 | 100 | 200 | 300 | 400 | 500 | replace
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql3', 333, 'select 3', 'module3', 'action3', 12, 22, 32, 42, 52, 1, 'row3')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'update');
+ CLOSE c;
+END
+$$;
+SELECT count(*) AS update_missing_rows
+FROM dbms_sqlset_select_sqlset('sts_load');
+ update_missing_rows
+---------------------
+ 2
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql3', 333, 'select 3', 'module3', 'action3', 12, 22, 32, 42, 52, 1, 'row3')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge');
+ CLOSE c;
+END
+$$;
+SELECT count(*) AS merge_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'BASIC', NULL, NULL, NULL);
+ merge_rows
+------------
+ 3
+(1 row)
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_basic_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_basic_elapsed_time
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'BASIC', NULL, NULL, NULL);
+ sql1_basic_executions | sql1_basic_elapsed_time
+-----------------------+-------------------------
+ |
+(1 row)
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_typical_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_typical_elapsed_time
+FROM dbms_sqlset_select_sqlset('sts_load');
+ sql1_typical_executions | sql1_typical_elapsed_time
+-------------------------+---------------------------
+ 20 | 100
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, NULL)
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge');
+ CLOSE c;
+END
+$$;
+SELECT max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_preserved
+FROM dbms_sqlset_select_sqlset('sts_load');
+ sql1_other_preserved
+----------------------
+ replace
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, NULL)
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', NULL, NULL, false);
+ CLOSE c;
+END
+$$;
+SELECT max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_cleared
+FROM dbms_sqlset_select_sqlset('sts_load');
+ sql1_other_cleared
+--------------------
+
+(1 row)
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 1, 2, 3, 4, 5, 3, NULL)
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'accumulate');
+ CLOSE c;
+END
+$$;
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time,
+ max(CASE WHEN sql_id = 'sql1' THEN buffer_gets END) AS sql1_buffer_gets,
+ max(CASE WHEN sql_id = 'sql1' THEN disk_reads END) AS sql1_disk_reads,
+ max(CASE WHEN sql_id = 'sql1' THEN rows_processed END) AS sql1_rows_processed,
+ max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_after_accumulate
+FROM dbms_sqlset_select_sqlset('sts_load');
+ sql1_executions | sql1_elapsed_time | sql1_cpu_time | sql1_buffer_gets | sql1_disk_reads | sql1_rows_processed | sql1_other_after_accumulate
+-----------------+-------------------+---------------+------------------+-----------------+---------------------+-----------------------------
+ 5 | 11 | 22 | 33 | 44 | 55 |
+(1 row)
+
+SELECT count(*) AS limit_zero_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, 1, 0);
+ limit_zero_rows
+-----------------
+ 0
+(1 row)
+
+SELECT count(*) AS empty_string_rows
+FROM dbms_sqlset_select_sqlset('sts_load', '', '', '', '', '', 1, 1, '', '', '', dbms_sqlset_has_recursive_sql());
+ empty_string_rows
+-------------------
+ 1
+(1 row)
+
+SELECT count(*) AS has_recursive_sql_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 1, 'TYPICAL', NULL, NULL, 'HAS_RECURSIVE_SQL');
+ has_recursive_sql_rows
+------------------------
+ 1
+(1 row)
+
+SELECT count(*) AS named_record_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 1, 'TYPICAL', NULL, NULL, dbms_sqlset_has_recursive_sql());
+ named_record_rows
+-------------------
+ 1
+(1 row)
+
+-- SELECT_SQLSET accepts numeric args without quotes.
+SELECT count(*) AS numeric_args_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, 1, 1, 'TYPICAL', NULL, NULL, NULL);
+ numeric_args_rows
+-------------------
+ 1
+(1 row)
+
+-- LOAD_SQLSET accepts empty update_condition and update_attributes.
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select empty options', 'module_empty', 'action_empty', 101, 202, 303, 404, 505, 21, 'empty_opts')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', '', '', true, NULL, NULL);
+ CLOSE c;
+END
+$$;
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions_after_empty_options,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time_after_empty_options,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time_after_empty_options
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+ sql1_executions_after_empty_options | sql1_elapsed_time_after_empty_options | sql1_cpu_time_after_empty_options
+-------------------------------------+---------------------------------------+-----------------------------------
+ 21 | 101 | 202
+(1 row)
+
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'bad', 'replace', NULL, NULL, true, NULL, NULL);
+ERROR: ORA-13779: invalid load option
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'bad', NULL, NULL, true, NULL, NULL);
+ERROR: ORA-19371: invalid update option
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', 'new.executions > old.executions', NULL, true, NULL, NULL);
+ERROR: DBMS_SQLSET.LOAD_SQLSET не поддерживает update_condition
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', NULL, 'executions', true, NULL, NULL);
+ERROR: DBMS_SQLSET.LOAD_SQLSET не поддерживает update_attributes
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', NULL, NULL, true, 1.5, NULL);
+ERROR: DBMS_SQLSET.LOAD_SQLSET не поддерживает commit_rows
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_missing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+ERROR: ORA-13754: "SQL Tuning Set" "sts_missing" does not exist.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', 'x', NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает basic_filter
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, 'x', NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает object_filter
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, 'x', NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает ranking_measure
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, 2, NULL, 'TYPICAL', NULL, NULL, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает result_percentage
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 1.5, 'TYPICAL', NULL, NULL, NULL);
+ERROR: ORA-13765: Value "1.5" is illegal for a result limit.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 9223372036854775808, 'TYPICAL', NULL, NULL, NULL);
+ERROR: ORA-13765: Value "9223372036854775808" is illegal for a result limit.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ALL', NULL, NULL, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает attribute_list => ALL
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', 'x', NULL, NULL);
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает plan_filter
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, dbms_sqlset_no_recursive_sql());
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает recursive_sql
+-- SELECT_SQLSET rejects NO_RECURSIVE_SQL literal.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, 'NO_RECURSIVE_SQL');
+ERROR: DBMS_SQLSET.SELECT_SQLSET не поддерживает recursive_sql
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, -1, 'TYPICAL', NULL, NULL, NULL);
+ERROR: ORA-13765: Value "-1" is illegal for a result limit.
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sqlx', 999, 'select x', 'modulex', 'actionx', 1, 1, 1, 1, 1, 1, 'complex')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ object_list
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', NULL, NULL, true, NULL, NULL);
+ CLOSE c;
+END
+$$;
+ERROR: DBMS_SQLSET.LOAD_SQLSET не поддерживает столбец "object_list"
+CONTEXT: SQL statement "CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', NULL, NULL, true, NULL, NULL)"
+PL/pgSQL function inline_code_block line 23 at CALL
+SELECT count(*) AS final_named_record_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, dbms_sqlset_has_recursive_sql());
+ final_named_record_rows
+-------------------------
+ 3
+(1 row)
+
+SELECT dbms_sqlset_add_reference(NULL, NULL, NULL);
+ERROR: Неподдерживаемая compatibility-функция DBMS_SQLSET.ADD_REFERENCE
+SELECT count(*) AS final_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+ final_rows
+------------
+ 3
+(1 row)
+
+CALL dbms_sqlset_drop_sqlset('sts_empty', NULL);
+CALL dbms_sqlset_drop_sqlset('sts_load', NULL);
+CALL dbms_sqlset_drop_sqlset('sts_proc', NULL);
diff --git a/src/test/regress/expected/dbms_stat_funcs.out b/src/test/regress/expected/dbms_stat_funcs.out
new file mode 100644
index 0000000..74f56f4
--- /dev/null
+++ b/src/test/regress/expected/dbms_stat_funcs.out
@@ -0,0 +1,649 @@
+\pset format unaligned
+\pset tuples_only on
+\set ON_ERROR_STOP on
+SET client_min_messages TO warning;
+SELECT dbms_stat_funcs_get_version() AS package_version;
+1.0.0
+SELECT round(dbms_stat_funcs_ks_pvalue(0.1::float8, 20)::numeric, 12) AS ks_pvalue_smoke;
+0.983366233894
+-- Общий setup: тестовые таблицы для DBMS_STAT_FUNCS regression.
+-- Числовые наборы основаны на Oracle evidence; значения не менять без новой проверки.
+DROP TABLE IF EXISTS dbms_stat_funcs_fit_data;
+DROP TABLE IF EXISTS dbms_stat_funcs_empty_numeric;
+DROP TABLE IF EXISTS dbms_stat_funcs_all_null_numeric;
+DROP TABLE IF EXISTS dbms_stat_funcs_small_numeric;
+DROP TABLE IF EXISTS dbms_stat_funcs_normal_constant;
+DROP TABLE IF EXISTS dbms_stat_funcs_poisson_integer;
+DROP TABLE IF EXISTS dbms_stat_funcs_poisson_fractional;
+DROP TABLE IF EXISTS dbms_stat_funcs_poisson_negative;
+DROP TABLE IF EXISTS dbms_stat_funcs_weibull_below_mu;
+DROP TABLE IF EXISTS dbms_stat_funcs_summary_outliers;
+DROP TABLE IF EXISTS dbms_stat_funcs_non_numeric_text;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_data;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_empty;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_all_null;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_boundary_data;
+CREATE TABLE dbms_stat_funcs_fit_data AS
+SELECT
+ gs AS id,
+ CASE WHEN gs <= 12 THEN round(((power(1.35::numeric, gs) - 1) / 2)::numeric, 4) END AS exp_val,
+ CASE WHEN gs <= 12 THEN round(((gs - 6.5) / 2)::numeric, 2) END AS normal_val,
+ CASE WHEN gs <= 16 THEN mod(gs + 2, 6)::numeric END AS poisson_val,
+ CASE WHEN gs <= 19 THEN gs::numeric / 20 END AS uniform_val,
+ mod(gs - 1, 5) + 1 AS uniform_disc_val,
+ CASE gs
+ WHEN 1 THEN 0.743105016956::numeric
+ WHEN 2 THEN 1.091435259916::numeric
+ WHEN 3 THEN 1.320284714299::numeric
+ WHEN 4 THEN 1.510484082144::numeric
+ WHEN 5 THEN 1.684835840746::numeric
+ WHEN 6 THEN 1.855480371447::numeric
+ WHEN 7 THEN 2.032677918568::numeric
+ WHEN 8 THEN 2.230052810922::numeric
+ WHEN 9 THEN 2.475872419937::numeric
+ WHEN 10 THEN 2.883130685581::numeric
+ END AS weibull_val,
+ CASE WHEN gs <= 10 THEN gs::numeric END AS summary_val,
+ CASE gs
+ WHEN 1 THEN 1::numeric
+ WHEN 2 THEN 1::numeric
+ WHEN 3 THEN 2::numeric
+ WHEN 4 THEN 2::numeric
+ WHEN 5 THEN 3::numeric
+ WHEN 6 THEN 4::numeric
+ WHEN 7 THEN 4::numeric
+ WHEN 8 THEN 4::numeric
+ WHEN 9 THEN 5::numeric
+ WHEN 10 THEN 6::numeric
+ WHEN 11 THEN 6::numeric
+ WHEN 12 THEN 6::numeric
+ WHEN 13 THEN 7::numeric
+ WHEN 14 THEN 8::numeric
+ WHEN 15 THEN 8::numeric
+ WHEN 16 THEN 9::numeric
+ WHEN 17 THEN 9::numeric
+ WHEN 18 THEN 9::numeric
+ WHEN 19 THEN 10::numeric
+ WHEN 20 THEN 10::numeric
+ END AS dupes_val,
+ CASE WHEN mod(gs, 2) = 0 THEN gs::numeric END AS nullable_val,
+ 'text-' || gs::text AS text_val
+FROM generate_series(1, 20) AS gs;
+CREATE TABLE dbms_stat_funcs_empty_numeric AS
+SELECT CAST(NULL AS numeric) AS x
+WHERE FALSE;
+CREATE TABLE dbms_stat_funcs_all_null_numeric AS
+SELECT gs AS id, CAST(NULL AS numeric) AS x
+FROM generate_series(1, 5) AS gs;
+CREATE TABLE dbms_stat_funcs_small_numeric AS
+SELECT *
+FROM (VALUES (1, 10::numeric), (2, 20::numeric)) AS t(id, x);
+CREATE TABLE dbms_stat_funcs_summary_outliers AS
+SELECT *
+FROM (
+ VALUES
+ (1, -50::numeric),
+ (2, 1::numeric),
+ (3, 2::numeric),
+ (4, 3::numeric),
+ (5, 4::numeric),
+ (6, 5::numeric),
+ (7, 6::numeric),
+ (8, 7::numeric),
+ (9, 8::numeric),
+ (10, 9::numeric),
+ (11, 10::numeric),
+ (12, 100::numeric)
+) AS t(id, x);
+CREATE TABLE dbms_stat_funcs_normal_constant AS
+SELECT gs AS id, 5::numeric AS x
+FROM generate_series(1, 10) AS gs;
+CREATE TABLE dbms_stat_funcs_poisson_integer AS
+SELECT row_number() OVER () AS id, x
+FROM (
+ VALUES
+ (0::numeric),
+ (0::numeric),
+ (1::numeric),
+ (1::numeric),
+ (1::numeric),
+ (2::numeric),
+ (2::numeric),
+ (2::numeric),
+ (3::numeric),
+ (4::numeric)
+) AS t(x);
+CREATE TABLE dbms_stat_funcs_poisson_fractional AS
+SELECT *
+FROM (
+ VALUES
+ (1, 0.5::numeric),
+ (2, 1.2::numeric),
+ (3, 2.7::numeric),
+ (4, 3.1::numeric),
+ (5, 4.8::numeric),
+ (6, 5.5::numeric)
+) AS t(id, x);
+CREATE TABLE dbms_stat_funcs_poisson_negative AS
+SELECT *
+FROM (
+ VALUES
+ (1, -2::numeric),
+ (2, -1::numeric),
+ (3, 0::numeric),
+ (4, 1::numeric),
+ (5, 2::numeric),
+ (6, 3::numeric)
+) AS t(id, x);
+CREATE TABLE dbms_stat_funcs_weibull_below_mu AS
+SELECT *
+FROM (
+ VALUES
+ (1, 0.25::numeric),
+ (2, 0.75::numeric),
+ (3, 1.25::numeric),
+ (4, 1.75::numeric)
+) AS t(id, x);
+CREATE TABLE dbms_stat_funcs_non_numeric_text AS
+SELECT *
+FROM (VALUES (1, 'text-1'::text), (2, 'text-2'::text)) AS t(id, x);
+CREATE TABLE dbms_stat_funcs_uniform_data (
+ id int,
+ uniform_val numeric,
+ uniform_disc_val numeric,
+ text_val text
+);
+INSERT INTO dbms_stat_funcs_uniform_data
+SELECT
+ gs,
+ CASE WHEN gs <= 19 THEN gs::numeric / 20 END,
+ mod(gs - 1, 5) + 1,
+ 'text-' || gs::text
+FROM generate_series(1, 20) AS gs;
+CREATE TABLE dbms_stat_funcs_uniform_empty (
+ x numeric
+);
+CREATE TABLE dbms_stat_funcs_uniform_all_null (
+ x numeric
+);
+INSERT INTO dbms_stat_funcs_uniform_all_null VALUES
+ (NULL),
+ (NULL),
+ (NULL);
+CREATE TABLE dbms_stat_funcs_uniform_boundary_data AS
+SELECT *
+FROM (
+ VALUES
+ (1, 0::numeric),
+ (2, 0.25::numeric),
+ (3, 0.5::numeric),
+ (4, 0.75::numeric),
+ (5, 1::numeric)
+) AS t(id, x);
+SET client_min_messages TO notice;
+-- Helpers: приводят record-return функции к стабильному текстовому формату expected/out.
+CREATE OR REPLACE FUNCTION format_summary_numeric(p_value numeric)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT CASE
+ WHEN p_value IS NULL THEN '<NULL>'
+ ELSE regexp_replace(
+ regexp_replace(
+ to_char(round(p_value, 12), 'FM999999999999999999999990D999999999999'),
+ '0+$', ''),
+ '\.$', '')
+ END;
+$$;
+CREATE OR REPLACE FUNCTION format_summary_numeric_array(p_values numeric[])
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ l_text text;
+BEGIN
+ IF p_values IS NULL THEN
+ RETURN '<NULL_COLLECTION>';
+ END IF;
+
+ IF cardinality(p_values) = 0 THEN
+ RETURN '[]|count|0';
+ END IF;
+
+ SELECT '[' || string_agg(format_summary_numeric(v), ',' ORDER BY ord) || ']|count|' || cardinality(p_values)::text
+ INTO l_text
+ FROM unnest(p_values) WITH ORDINALITY AS u(v, ord);
+ RETURN l_text;
+END;
+$$;
+CREATE OR REPLACE FUNCTION summary_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_sigma numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+ sigma_sql text;
+BEGIN
+ sigma_sql := CASE WHEN p_sigma IS NULL THEN 'NULL::numeric' ELSE p_sigma::text END;
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_summary(%L, %L, %L, %s)',
+ p_owner, p_table, p_column, sigma_sql
+ ) INTO r;
+
+ RETURN
+ 'count=' || format_summary_numeric(r."count") ||
+ ';min=' || format_summary_numeric(r.min) ||
+ ';max=' || format_summary_numeric(r.max) ||
+ ';range=' || format_summary_numeric(r."range") ||
+ ';mean=' || format_summary_numeric(r.mean) ||
+ ';cmode=' || format_summary_numeric_array(r.cmode) ||
+ ';variance=' || format_summary_numeric(r.variance) ||
+ ';stddev=' || format_summary_numeric(r.stddev) ||
+ ';q5=' || format_summary_numeric(r.quantile_5) ||
+ ';q25=' || format_summary_numeric(r.quantile_25) ||
+ ';median=' || format_summary_numeric(r.median) ||
+ ';q75=' || format_summary_numeric(r.quantile_75) ||
+ ';q95=' || format_summary_numeric(r.quantile_95) ||
+ ';plus=' || format_summary_numeric(r.plus_x_sigma) ||
+ ';minus=' || format_summary_numeric(r.minus_x_sigma) ||
+ ';extreme=' || format_summary_numeric_array(r.extreme_values) ||
+ ';top=' || format_summary_numeric_array(r.top_5_values) ||
+ ';bottom=' || format_summary_numeric_array(r.bottom_5_values);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION dist_fit_result3_text(
+ p_first_label text,
+ p_first numeric,
+ p_second_label text,
+ p_second numeric,
+ p_sig numeric
+)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT 'sig=' || format_summary_numeric(p_sig) ||
+ ' ' || p_first_label || '=' || format_summary_numeric(p_first) ||
+ ' ' || p_second_label || '=' || format_summary_numeric(p_second);
+$$;
+CREATE OR REPLACE FUNCTION dist_fit_result2_text(
+ p_first_label text,
+ p_first numeric,
+ p_sig numeric
+)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT 'sig=' || format_summary_numeric(p_sig) ||
+ ' ' || p_first_label || '=' || format_summary_numeric(p_first);
+$$;
+CREATE OR REPLACE FUNCTION weibull_fit_result_text(
+ p_alpha numeric,
+ p_mu numeric,
+ p_beta numeric,
+ p_sig numeric
+)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT 'sig=' || format_summary_numeric(p_sig) ||
+ ' alpha=' || format_summary_numeric(p_alpha) ||
+ ' mu=' || format_summary_numeric(p_mu) ||
+ ' beta=' || format_summary_numeric(p_beta);
+$$;
+CREATE OR REPLACE FUNCTION exp_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_lambda numeric,
+ p_mu numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_exponential_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_lambda, p_mu
+ ) INTO r;
+ RETURN dist_fit_result3_text('lambda', r.lambda, 'mu', r.mu, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION exp_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_lambda numeric,
+ p_mu numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_exponential_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_lambda, p_mu
+ ) INTO r;
+ RETURN dist_fit_result3_text('lambda', r.lambda, 'mu', r.mu, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION normal_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_mean numeric,
+ p_stdev numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_normal_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_mean, p_stdev
+ ) INTO r;
+ RETURN dist_fit_result3_text('mean', r.mean, 'stdev', r.stdev, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION normal_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_mean numeric,
+ p_stdev numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_normal_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_mean, p_stdev
+ ) INTO r;
+ RETURN dist_fit_result3_text('mean', r.mean, 'stdev', r.stdev, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION poisson_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_lambda numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_poisson_dist_fit(%L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_lambda
+ ) INTO r;
+ RETURN dist_fit_result2_text('lambda', r.lambda, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION poisson_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_lambda numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_poisson_dist_fit(%L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_lambda
+ ) INTO r;
+ RETURN dist_fit_result2_text('lambda', r.lambda, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION uniform_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_var_type text,
+ p_test_type text,
+ p_param_a numeric,
+ p_param_b numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_uniform_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_var_type, p_test_type, p_param_a, p_param_b
+ ) INTO r;
+ RETURN dist_fit_result3_text('paramA', r.parama, 'paramB', r.paramb, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION uniform_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_param_a numeric,
+ p_param_b numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_uniform_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', p_param_a, p_param_b
+ ) INTO r;
+ RETURN dist_fit_result3_text('paramA', r.parama, 'paramB', r.paramb, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION weibull_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_alpha numeric,
+ p_mu numeric,
+ p_beta numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_weibull_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_alpha, p_mu, p_beta
+ ) INTO r;
+ RETURN weibull_fit_result_text(r.alpha, r.mu, r.beta, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+CREATE OR REPLACE FUNCTION weibull_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_alpha numeric,
+ p_mu numeric,
+ p_beta numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_weibull_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_alpha, p_mu, p_beta
+ ) INTO r;
+ RETURN weibull_fit_result_text(r.alpha, r.mu, r.beta, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+-- Smoke-check: все SQL entrypoints пакета зарегистрированы в catalog.
+SELECT count(*) = 8 AS dbms_stat_funcs_entrypoints_present
+FROM pg_proc
+WHERE proname LIKE 'dbms_stat_funcs_%';
+t
+-- SUMMARY: базовые сценарии, NULL sigma и основные error paths.
+SELECT 'summary_default_sigma' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_fit_data', 'summary_val', 3) AS result;
+summary_default_sigma|count=10;min=1;max=10;range=9;mean=5.5;cmode=[1,2,3,4,5,6,7,8,9,10]|count|10;variance=9.166666666667;stddev=3.027650354097;q5=1.45;q25=3.25;median=5.5;q75=7.75;q95=9.55;plus=14.582951062293;minus=-3.582951062292;extreme=[]|count|0;top=[10,9,8,7,6]|count|5;bottom=[5,4,3,2,1]|count|5
+SELECT 'summary_sigma_null' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_fit_data', 'summary_val', NULL) AS result;
+summary_sigma_null|count=10;min=1;max=10;range=9;mean=5.5;cmode=[1,2,3,4,5,6,7,8,9,10]|count|10;variance=9.166666666667;stddev=3.027650354097;q5=1.45;q25=3.25;median=5.5;q75=7.75;q95=9.55;plus=<NULL>;minus=<NULL>;extreme=[]|count|0;top=[10,9,8,7,6]|count|5;bottom=[5,4,3,2,1]|count|5
+SELECT 'summary_empty_table' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_empty_numeric', 'x', 3) AS result;
+summary_empty_table|count=<NULL>;min=<NULL>;max=<NULL>;range=<NULL>;mean=<NULL>;cmode=[]|count|0;variance=<NULL>;stddev=<NULL>;q5=<NULL>;q25=<NULL>;median=<NULL>;q75=<NULL>;q95=<NULL>;plus=<NULL>;minus=<NULL>;extreme=[]|count|0;top=[]|count|0;bottom=[]|count|0
+SELECT 'summary_all_null' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_all_null_numeric', 'x', 3) AS result;
+summary_all_null|count=0;min=<NULL>;max=<NULL>;range=<NULL>;mean=<NULL>;cmode=[<NULL>]|count|1;variance=<NULL>;stddev=<NULL>;q5=<NULL>;q25=<NULL>;median=<NULL>;q75=<NULL>;q95=<NULL>;plus=<NULL>;minus=<NULL>;extreme=[]|count|0;top=[]|count|0;bottom=[]|count|0
+SELECT 'summary_non_numeric_column' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_fit_data', 'text_val', 3) AS result;
+summary_non_numeric_column|ERROR|22023
+-- EXPONENTIAL_DIST_FIT: KS работает, AD/CHI возвращают NULL sig.
+SELECT 'exp_ks_default' AS case_name,
+ exp_call_default(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 1, 0) AS result;
+exp_ks_default|sig=0.019817038961 lambda=1 mu=0
+SELECT 'exp_ks' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'KOLMOGOROV_SMIRNOV', 1, 0) AS result;
+exp_ks|sig=0.019817038961 lambda=1 mu=0
+SELECT 'exp_ad_sig_null' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'ANDERSON_DARLING', 1, 0) AS result;
+exp_ad_sig_null|sig=<NULL> lambda=1 mu=0
+SELECT 'exp_chi_sig_null' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'CHI_SQUARED', 1, 0) AS result;
+exp_chi_sig_null|sig=<NULL> lambda=1 mu=0
+SELECT 'exp_lambda_null' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'KOLMOGOROV_SMIRNOV', NULL, 0) AS result;
+exp_lambda_null|sig=<NULL> lambda=<NULL> mu=0
+SELECT 'exp_non_numeric_column' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_non_numeric_text', 'x', 'KOLMOGOROV_SMIRNOV', 1, 0) AS result;
+exp_non_numeric_column|ERROR|22P02
+-- NORMAL_DIST_FIT: KS работает, SHAPIRO_WILKS/AD/CHI возвращают NULL sig.
+SELECT 'normal_default_test_type' AS case_name,
+ normal_call_default(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 0, 1) AS result;
+normal_default_test_type|sig=0.506786114418 mean=0 stdev=1
+SELECT 'normal_shapiro_sig_null' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'SHAPIRO_WILKS', 0, 1) AS result;
+normal_shapiro_sig_null|sig=<NULL> mean=0 stdev=1
+SELECT 'normal_ks' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'KOLMOGOROV_SMIRNOV', 0, 1) AS result;
+normal_ks|sig=0.506786114418 mean=0 stdev=1
+SELECT 'normal_ad_sig_null' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'ANDERSON_DARLING', 0, 1) AS result;
+normal_ad_sig_null|sig=<NULL> mean=0 stdev=1
+SELECT 'normal_chi_sig_null' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'CHI_SQUARED', 0, 1) AS result;
+normal_chi_sig_null|sig=<NULL> mean=0 stdev=1
+SELECT 'normal_stdev_zero' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'KOLMOGOROV_SMIRNOV', 0, 0) AS result;
+normal_stdev_zero|ERROR|22004
+-- POISSON_DIST_FIT: KS работает, AD/CHI возвращают NULL sig.
+SELECT 'poisson_ks_default' AS case_name,
+ poisson_call_default(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 2) AS result;
+poisson_ks_default|sig=0.996149756203 lambda=2
+SELECT 'poisson_ks' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'KOLMOGOROV_SMIRNOV', 2) AS result;
+poisson_ks|sig=0.996149756203 lambda=2
+SELECT 'poisson_ad_sig_null' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'ANDERSON_DARLING', 2) AS result;
+poisson_ad_sig_null|sig=<NULL> lambda=2
+SELECT 'poisson_chi_sig_null' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'CHI_SQUARED', 2) AS result;
+poisson_chi_sig_null|sig=<NULL> lambda=2
+SELECT 'poisson_lambda_null' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'KOLMOGOROV_SMIRNOV', NULL) AS result;
+poisson_lambda_null|sig=<NULL> lambda=<NULL>
+-- UNIFORM_DIST_FIT: CONTINUOUS + KS работает, остальные проверенные комбинации возвращают NULL sig.
+SELECT 'uniform_default_var_and_test_type' AS case_name,
+ uniform_call_default(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 0, 1) AS result;
+uniform_default_var_and_test_type|sig=0.999999999696 paramA=0 paramB=1
+SELECT 'uniform_continuous_ks' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', 0, 1) AS result;
+uniform_continuous_ks|sig=0.999999999696 paramA=0 paramB=1
+SELECT 'uniform_continuous_ad_sig_null' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'ANDERSON_DARLING', 0, 1) AS result;
+uniform_continuous_ad_sig_null|sig=<NULL> paramA=0 paramB=1
+SELECT 'uniform_continuous_chi_sig_null' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'CHI_SQUARED', 0, 1) AS result;
+uniform_continuous_chi_sig_null|sig=<NULL> paramA=0 paramB=1
+SELECT 'uniform_discrete_ks_sig_null' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_disc_val', 'DISCRETE', 'KOLMOGOROV_SMIRNOV', 1, 5) AS result;
+uniform_discrete_ks_sig_null|sig=<NULL> paramA=1 paramB=5
+SELECT 'uniform_param_a_eq_b' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', 1, 1) AS result;
+uniform_param_a_eq_b|ERROR|22012
+-- WEIBULL_DIST_FIT: KS работает, AD/CHI возвращают NULL sig.
+SELECT 'weibull_default_test_type' AS case_name,
+ weibull_call_default(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 2, 0, 1.5) AS result;
+weibull_default_test_type|sig=0.880285391446 alpha=2 mu=0 beta=1.5
+SELECT 'weibull_ks' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'KOLMOGOROV_SMIRNOV', 2, 0, 1.5) AS result;
+weibull_ks|sig=0.880285391446 alpha=2 mu=0 beta=1.5
+SELECT 'weibull_ad_sig_null' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'ANDERSON_DARLING', 2, 0, 1.5) AS result;
+weibull_ad_sig_null|sig=<NULL> alpha=2 mu=0 beta=1.5
+SELECT 'weibull_chi_sig_null' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'CHI_SQUARED', 2, 0, 1.5) AS result;
+weibull_chi_sig_null|sig=<NULL> alpha=2 mu=0 beta=1.5
+SELECT 'weibull_alpha_null' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'KOLMOGOROV_SMIRNOV', NULL, 0, 1.5) AS result;
+weibull_alpha_null|sig=<NULL> alpha=<NULL> mu=0 beta=1.5
+SELECT 'weibull_alpha_zero' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'KOLMOGOROV_SMIRNOV', 0, 0, 1.5) AS result;
+weibull_alpha_zero|ERROR|22012
diff --git a/src/test/regress/expected/dbms_system.out b/src/test/regress/expected/dbms_system.out
new file mode 100644
index 0000000..39b460a
--- /dev/null
+++ b/src/test/regress/expected/dbms_system.out
@@ -0,0 +1,275 @@
+-- DBMS_SYSTEM: минимальный регрессионный smoke test.
+-- Проверяем только стабильное состояние event 10046 и то, что trace hooks
+-- не ломают выполнение обычных SQL-команд.
+-- LOG/WARNING-сообщения специально подавляем, потому что в них есть
+-- динамические значения backend pid / sid / duration_ms.
+SET client_min_messages TO error;
+-- В начале теста сбрасываем возможное состояние текущего backend-а.
+SELECT dbms_system_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT dbms_system_set_sql_trace_in_session(pg_backend_pid(), 1, false);
+ dbms_system_set_sql_trace_in_session
+--------------------------------------
+
+(1 row)
+
+SELECT dbms_system_is_valid_session(-1, -1) AS invalid_session_is_false;
+ invalid_session_is_false
+--------------------------
+ f
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 0
+(1 row)
+
+-- Включаем event 10046 через SET_EV.
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 10046, 1, '');
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 1
+(1 row)
+
+-- Эти команды должны трассироваться внутри backend-а, но LOG-вывод
+-- подавлен через client_min_messages = error.
+SELECT 1 AS traced_select;
+ traced_select
+---------------
+ 1
+(1 row)
+
+CREATE TEMP TABLE dbms_system_trace_test(id int, name text);
+INSERT INTO dbms_system_trace_test VALUES (1, 'one'), (2, 'two');
+UPDATE dbms_system_trace_test
+SET name = 'updated'
+WHERE id = 1;
+DELETE FROM dbms_system_trace_test
+WHERE id = 2;
+SELECT id, name
+FROM dbms_system_trace_test
+ORDER BY id;
+ id | name
+----+---------
+ 1 | updated
+(1 row)
+
+-- Проверяем, что NULL в nm доходит до C-функции.
+-- Для этого dbms_system_set_ev должен быть proisstrict = false.
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 10046, 8, NULL);
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 8
+(1 row)
+
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 10046, 12, '');
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 12
+(1 row)
+
+-- Неподдержанный event должен быть NOOP.
+-- WARNING подавлен через client_min_messages = error.
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 99999, 3, '');
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 12
+(1 row)
+
+-- Чужая сессия не поддерживается и должна быть NOOP.
+-- WARNING подавлен через client_min_messages = error.
+SELECT dbms_system_set_ev(pg_backend_pid() + 1000000, 1, 10046, 0, '');
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 12
+(1 row)
+
+-- Выключаем event 10046 через SET_SQL_TRACE_IN_SESSION.
+SELECT dbms_system_set_sql_trace_in_session(pg_backend_pid(), 1, false);
+ dbms_system_set_sql_trace_in_session
+--------------------------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046);
+ dbms_system_read_ev
+---------------------
+ 0
+(1 row)
+
+-- Эта команда не должна трассироваться после выключения event 10046.
+SELECT 2 AS not_traced_select;
+ not_traced_select
+-------------------
+ 2
+(1 row)
+
+-- Неподдержанные events читаются как 0.
+SELECT dbms_system_read_ev(99999);
+ dbms_system_read_ev
+---------------------
+ 0
+(1 row)
+
+-- Проверяем, что KSDWRT вызывается без ошибки.
+-- LOG подавлен через client_min_messages = error.
+SELECT dbms_system_ksdwrt(2, 'DBMS_SYSTEM regression test message');
+ dbms_system_ksdwrt
+--------------------
+
+(1 row)
+
+RESET client_min_messages;
+-- DBMS_SYSTEM: executor error trace regression.
+-- Проверяем логирование ошибочных executor-запросов без подмены исходной ошибки.
+SET client_min_messages = warning;
+CREATE TEMP TABLE dbms_system_executor_error_regress(value int4);
+INSERT INTO dbms_system_executor_error_regress(value) VALUES (0);
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 1::int4, 'executor-error-regress'::text);
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046) AS trace_level_enabled;
+ trace_level_enabled
+---------------------
+ 1
+(1 row)
+
+-- Деление должно выполняться в executor, поэтому значение берётся из таблицы, а не из константы 1 / 0.
+\set VERBOSITY sqlstate
+SELECT 1 / value AS must_fail_division_by_zero FROM dbms_system_executor_error_regress;
+ERROR: 22012
+-- Дополнительно проверяем, что текст исходной ошибки не заменён нашим trace-логированием.
+\set VERBOSITY terse
+SELECT 1 / value AS must_fail_division_by_zero FROM dbms_system_executor_error_regress;
+ERROR: division by zero
+\set VERBOSITY default
+-- Если trace frame был очищен в PG_CATCH, следующий executor-запрос должен нормально завершиться.
+SELECT 200 AS after_error_ok;
+ after_error_ok
+----------------
+ 200
+(1 row)
+
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 0::int4, 'executor-error-regress'::text);
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046) AS trace_level_after;
+ trace_level_after
+-------------------
+ 0
+(1 row)
+
+-- DBMS_SYSTEM: utility error trace regression.
+SET client_min_messages = warning;
+DROP TABLE IF EXISTS dbms_system_utility_error_base;
+CREATE TEMP TABLE dbms_system_utility_error_base(value int4);
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 1::int4, 'utility-error-regress'::text);
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046) AS trace_level_enabled;
+ trace_level_enabled
+---------------------
+ 1
+(1 row)
+
+\set VERBOSITY sqlstate
+DROP TABLE dbms_system_utility_error_missing;
+ERROR: 42P01
+ALTER TABLE dbms_system_utility_error_base ALTER COLUMN missing_column TYPE int4;
+ERROR: 42703
+\set VERBOSITY terse
+DROP TABLE dbms_system_utility_error_missing;
+ERROR: table "dbms_system_utility_error_missing" does not exist
+ALTER TABLE dbms_system_utility_error_base ALTER COLUMN missing_column TYPE int4;
+ERROR: column "missing_column" of relation "dbms_system_utility_error_base" does not exist
+\set VERBOSITY default
+SELECT 300 AS after_utility_errors_ok;
+ after_utility_errors_ok
+-------------------------
+ 300
+(1 row)
+
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 0::int4, 'utility-error-regress'::text);
+ dbms_system_set_ev
+--------------------
+
+(1 row)
+
+SELECT dbms_system_read_ev(10046) AS trace_level_after;
+ trace_level_after
+-------------------
+ 0
+(1 row)
+
+DROP TABLE dbms_system_utility_error_base;
+-- DBMS_SYSTEM: KSDWRT destination regression.
+SET client_min_messages = warning;
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(1, 'ksdwrt regression trace only')) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(2, 'ksdwrt regression server log only')) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(3, 'ksdwrt regression trace and server log')) s;
+ result
+--------
+ ok
+(1 row)
+
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(999, 'ksdwrt regression invalid destination')) s;
+WARNING: DBMS_SYSTEM.KSDWRT: unsupported destination 999, noop
+ result
+--------
+ ok
+(1 row)
+
diff --git a/src/test/regress/expected/dbms_tns.out b/src/test/regress/expected/dbms_tns.out
new file mode 100644
index 0000000..46f85ca
--- /dev/null
+++ b/src/test/regress/expected/dbms_tns.out
@@ -0,0 +1,479 @@
+-- Базовый flat API для DBMS_TNS.
+-- На этом этапе функция ещё не парсит Oracle Net, поэтому любые входы
+-- без полноценной поддержки должны возвращать SQL NULL.
+SELECT dbms_tns_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname(NULL) IS NULL AS null_input_is_null;
+ null_input_is_null
+--------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('') IS NULL AS empty_input_is_null;
+ empty_input_is_null
+---------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('UNKNOWN_ALIAS') IS NULL AS unknown_input_is_null;
+ unknown_input_is_null
+-----------------------
+ t
+(1 row)
+
+-- Built-in GUC registration.
+SHOW dbms_tns.tns_admin;
+ dbms_tns.tns_admin
+--------------------
+
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns';
+SHOW dbms_tns.tns_admin;
+ dbms_tns.tns_admin
+--------------------
+ /tmp/rudb_dbms_tns
+(1 row)
+
+SELECT dbms_tns_has_tnsnames_config() IN (true, false) AS has_tnsnames_config_smoke;
+ has_tnsnames_config_smoke
+---------------------------
+ t
+(1 row)
+
+RESET dbms_tns.tns_admin;
+SHOW dbms_tns.tns_admin;
+ dbms_tns.tns_admin
+--------------------
+
+(1 row)
+
+CREATE ROLE regress_dbms_tns_nosuper NOSUPERUSER;
+SET SESSION AUTHORIZATION regress_dbms_tns_nosuper;
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns';
+ERROR: permission denied to set parameter "dbms_tns.tns_admin"
+SELECT dbms_tns_resolve_tnsname('UNKNOWN_ALIAS') IS NULL AS denied_for_non_superuser;
+ERROR: must be superuser to call dbms_tns_resolve_tnsname()
+SELECT dbms_tns_resolve_tnsname(NULL) IS NULL AS denied_null_for_non_superuser;
+ERROR: must be superuser to call dbms_tns_resolve_tnsname()
+RESET SESSION AUTHORIZATION;
+DROP ROLE regress_dbms_tns_nosuper;
+-- TNSNAMES alias lookup.
+\! rm -rf /tmp/rudb_dbms_tns_todo06_valid /tmp/rudb_dbms_tns_todo06_ezconnect /tmp/rudb_dbms_tns_todo06_missing /tmp/rudb_dbms_tns_todo06_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo06_valid /tmp/rudb_dbms_tns_todo06_ezconnect /tmp/rudb_dbms_tns_todo06_missing /tmp/rudb_dbms_tns_todo06_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo06_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'TESTDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' 'testdb, TestDb = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' 'ALIAS1, ALIAS2 = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=alias-host.local)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=aliassvc)))' 'DUPDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dup-first.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dupfirst)))' 'DUPDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dup-second.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dupsecond)))' 'SPACEDDB = (DESCRIPTION=' ' (ADDRESS=' ' (PROTOCOL=TCP)' ' (HOST=spaced-host.local)' ' (PORT=1523)' ' )' ' (CONNECT_DATA=' ' (SERVICE_NAME=spacedsvc)' ' )' ')' > /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora"
+\! sh -c "cp /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora /tmp/rudb_dbms_tns_todo06_ezconnect/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(EZCONNECT)' > /tmp/rudb_dbms_tns_todo06_ezconnect/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo06_missing/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo06_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=broken.local)(PORT=1521))' > /tmp/rudb_dbms_tns_todo06_malformed/tnsnames.ora"
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_valid';
+SELECT dbms_tns_has_tnsnames_config() AS valid_tnsnames_config_present;
+ valid_tnsnames_config_present
+-------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NOT NULL AS testdb_resolved;
+ testdb_resolved
+-----------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('testdb') = dbms_tns_resolve_tnsname('TESTDB') AS alias_case_insensitive;
+ alias_case_insensitive
+------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('TestDb') = dbms_tns_resolve_tnsname('TESTDB') AS alias_mixed_case_insensitive;
+ alias_mixed_case_insensitive
+------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('ALIAS1') = dbms_tns_resolve_tnsname('ALIAS2') AS alias_list_same_descriptor;
+ alias_list_same_descriptor
+----------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DUPDB') LIKE '%dup-second.local%' AS duplicate_last_wins;
+ duplicate_last_wins
+---------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('SPACEDDB') LIKE '%spaced-host.local%' AS multiline_normalized;
+ multiline_normalized
+----------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('UNKNOWN_ALIAS') IS NULL AS unknown_alias_is_null;
+ unknown_alias_is_null
+-----------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_ezconnect';
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NULL AS ezconnect_only_ignores_tnsnames;
+ ezconnect_only_ignores_tnsnames
+---------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_missing';
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NULL AS missing_tnsnames_is_null;
+ missing_tnsnames_is_null
+--------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENDB') IS NULL AS malformed_tnsnames_is_null;
+ malformed_tnsnames_is_null
+----------------------------
+ t
+(1 row)
+
+-- Easy Connect resolver.
+\! rm -rf /tmp/rudb_dbms_tns_todo08_ezconnect_only /tmp/rudb_dbms_tns_todo08_tnsnames_only /tmp/rudb_dbms_tns_todo08_mixed /tmp/rudb_dbms_tns_todo08_missing_sqlnet /tmp/rudb_dbms_tns_todo08_malformed_sqlnet
+\! rm -rf /tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames
+\! mkdir -p /tmp/rudb_dbms_tns_todo08_ezconnect_only /tmp/rudb_dbms_tns_todo08_tnsnames_only /tmp/rudb_dbms_tns_todo08_mixed /tmp/rudb_dbms_tns_todo08_missing_sqlnet /tmp/rudb_dbms_tns_todo08_malformed_sqlnet /tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(EZCONNECT)' > /tmp/rudb_dbms_tns_todo08_ezconnect_only/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo08_tnsnames_only/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)' > /tmp/rudb_dbms_tns_todo08_mixed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)' > /tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames/sqlnet.ora"
+\! sh -c "cp /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora /tmp/rudb_dbms_tns_todo08_tnsnames_only/tnsnames.ora"
+\! sh -c "cp /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora /tmp/rudb_dbms_tns_todo08_mixed/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(EZCONNECT' > /tmp/rudb_dbms_tns_todo08_malformed_sqlnet/sqlnet.ora"
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_ezconnect_only';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_double_slash_default_port;
+ easyconnect_double_slash_default_port
+---------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('//localhost:1521/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_double_slash_explicit_port;
+ easyconnect_double_slash_explicit_port
+----------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('localhost:1521/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_plain_explicit_port;
+ easyconnect_plain_explicit_port
+---------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_plain_default_port;
+ easyconnect_plain_default_port
+--------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('//localhost:badport/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=badport))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_badport_literal;
+ easyconnect_badport_literal
+-----------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('//localhost:1521/') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=)))' AS easyconnect_empty_service;
+ easyconnect_empty_service
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('host:port') IS NULL AS easyconnect_missing_service_is_null;
+ easyconnect_missing_service_is_null
+-------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('host:/service') IS NULL AS easyconnect_empty_port_is_null;
+ easyconnect_empty_port_is_null
+--------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('//host//service') IS NULL AS easyconnect_double_slash_service_is_null;
+ easyconnect_double_slash_service_is_null
+------------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('host/service/extra') IS NULL AS easyconnect_extra_path_is_null;
+ easyconnect_extra_path_is_null
+--------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('/service') IS NULL AS easyconnect_empty_host_is_null;
+ easyconnect_empty_host_is_null
+--------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_tnsnames_only';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') IS NULL AS easyconnect_gated_by_tnsnames_only;
+ easyconnect_gated_by_tnsnames_only
+------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('TESTDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' AS tnsnames_alias_still_resolves;
+ tnsnames_alias_still_resolves
+-------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_mixed';
+SELECT dbms_tns_resolve_tnsname('TESTDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' AS tnsnames_still_resolves_with_ezconnect;
+ tnsnames_still_resolves_with_ezconnect
+----------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_resolves_with_tnsnames_coexistence;
+ easyconnect_resolves_with_tnsnames_coexistence
+------------------------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_fallback_after_tnsnames_missing;
+ easyconnect_fallback_after_tnsnames_missing
+---------------------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_missing_sqlnet';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') IS NULL AS missing_sqlnet_is_null;
+ missing_sqlnet_is_null
+------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_malformed_sqlnet';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') IS NULL AS malformed_sqlnet_is_null;
+ malformed_sqlnet_is_null
+--------------------------
+ t
+(1 row)
+
+-- Parser hardening: CRLF and quoted values.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed
+\! sh -c "printf '%s\r\n' \"NAMES.DIRECTORY_PATH=(TNSNAMES)\" \"# comment line\" \" CRLFDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=crlf-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=crlfsvc))) # trailing comment\" \"QUOTEDDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='quoted-host.local')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='quotedsvc')))\" \"HASHDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='host#1.local')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='svc#1')))\" \"PARENDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='host(1).local')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='svc(1)')))\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid/tnsnames.ora"
+\! sh -c "printf '%s\r\n' \"NAMES.DIRECTORY_PATH=(TNSNAMES)\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid/sqlnet.ora"
+\! sh -c "printf '%s\r\n' \"NAMES.DIRECTORY_PATH=(TNSNAMES)\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed/sqlnet.ora"
+\! sh -c "printf '%s\r\n' \"BROKENQUOTE = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='broken.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=broken)))\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed/tnsnames.ora"
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_crlf_quotes_valid';
+SELECT dbms_tns_resolve_tnsname('CRLFDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=crlf-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=crlfsvc)))' AS crlf_line_endings_resolve;
+ crlf_line_endings_resolve
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('QUOTEDDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=''quoted-host.local'')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=''quotedsvc'')))' AS quoted_value_resolve;
+ quoted_value_resolve
+----------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('HASHDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=''host#1.local'')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=''svc#1'')))' AS hash_inside_quoted_value_resolve;
+ hash_inside_quoted_value_resolve
+----------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('PARENDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=''host(1).local'')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=''svc(1)'')))' AS parentheses_inside_quoted_value_resolve;
+ parentheses_inside_quoted_value_resolve
+-----------------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENQUOTE') IS NULL AS unterminated_quote_is_null;
+ unterminated_quote_is_null
+----------------------------
+ t
+(1 row)
+
+-- Parser hardening: ADDRESS_LIST.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_address_list_valid /tmp/rudb_dbms_tns_todo10_address_list_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_address_list_valid /tmp/rudb_dbms_tns_todo10_address_list_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_address_list_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'TESTDB = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host2.local)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' 'MULTIADDR = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host3.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host4.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=multisvc)))' > /tmp/rudb_dbms_tns_todo10_address_list_valid/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_address_list_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENDB = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=broken1.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=broken))' > /tmp/rudb_dbms_tns_todo10_address_list_malformed/tnsnames.ora"
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_address_list_valid';
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NOT NULL AS address_list_resolves;
+ address_list_resolves
+-----------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('TESTDB') LIKE '%host1.local%' AS address_list_contains_host1;
+ address_list_contains_host1
+-----------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('TESTDB') LIKE '%host2.local%' AS address_list_contains_host2;
+ address_list_contains_host2
+-----------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('TESTDB') LIKE '%ADDRESS_LIST%' OR dbms_tns_resolve_tnsname('TESTDB') LIKE '%host1.local%' AS address_list_has_address_list_or_hosts;
+ address_list_has_address_list_or_hosts
+----------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('MULTIADDR') IS NOT NULL AS multiple_addresses_under_description_resolve;
+ multiple_addresses_under_description_resolve
+----------------------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_address_list_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENDB') IS NULL AS malformed_address_list_is_null;
+ malformed_address_list_is_null
+--------------------------------
+ t
+(1 row)
+
+-- Parser hardening: DESCRIPTION_LIST.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_description_list_valid /tmp/rudb_dbms_tns_todo10_description_list_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_description_list_valid /tmp/rudb_dbms_tns_todo10_description_list_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_description_list_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'DESCDB = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host1.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=svc1)))(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host2.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=svc2))))' 'DESCADDR = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host3.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host4.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=svc3))))' 'DESCLIST = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host5.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host6.local)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=svc4))))' > /tmp/rudb_dbms_tns_todo10_description_list_valid/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_description_list_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENDESC = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=broken1.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=broken1)))' > /tmp/rudb_dbms_tns_todo10_description_list_malformed/tnsnames.ora"
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_description_list_valid';
+SELECT dbms_tns_resolve_tnsname('DESCDB') IS NOT NULL AS description_list_resolves;
+ description_list_resolves
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%host1.local%' AS description_list_contains_host1;
+ description_list_contains_host1
+---------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%host2.local%' AS description_list_contains_host2;
+ description_list_contains_host2
+---------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%svc1%' AS description_list_contains_service1;
+ description_list_contains_service1
+------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%svc2%' AS description_list_contains_service2;
+ description_list_contains_service2
+------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DESCADDR') IS NOT NULL AS description_list_with_address_entries_resolves;
+ description_list_with_address_entries_resolves
+------------------------------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('DESCLIST') IS NOT NULL AS description_list_with_address_list_resolves;
+ description_list_with_address_list_resolves
+---------------------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_description_list_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENDESC') IS NULL AS malformed_description_list_is_null;
+ malformed_description_list_is_null
+------------------------------------
+ t
+(1 row)
+
+-- Parser hardening: connect descriptor options.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_connect_options_valid /tmp/rudb_dbms_tns_todo10_connect_options_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_connect_options_valid /tmp/rudb_dbms_tns_todo10_connect_options_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_connect_options_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'OPTDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=opt-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=optsvc)(CONNECT_TIMEOUT=3)(RETRY_COUNT=2)(RETRY_DELAY=1)(SDU=8192)(SOURCE_ROUTE=ON)(LOAD_BALANCE=ON)(FAILOVER=ON)))' 'OPTNEST = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=nested1.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=nested2.local)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=nestedsvc)(CONNECT_TIMEOUT=3)(RETRY_COUNT=2)(RETRY_DELAY=1)(SDU=8192)(SOURCE_ROUTE=ON)(LOAD_BALANCE=ON)(FAILOVER=ON)))' > /tmp/rudb_dbms_tns_todo10_connect_options_valid/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_connect_options_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENOPT = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=brokenopt.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=brokenopt)(CONNECT_TIMEOUT=3)(RETRY_COUNT=2)(RETRY_DELAY=1)(SDU=8192)(SOURCE_ROUTE=ON)(LOAD_BALANCE=ON)(FAILOVER=ON))' > /tmp/rudb_dbms_tns_todo10_connect_options_malformed/tnsnames.ora"
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_connect_options_valid';
+SELECT dbms_tns_resolve_tnsname('OPTDB') IS NOT NULL AS connect_options_resolves;
+ connect_options_resolves
+--------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%CONNECT_TIMEOUT=3%' AS connect_timeout_preserved;
+ connect_timeout_preserved
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%RETRY_COUNT=2%' AS retry_count_preserved;
+ retry_count_preserved
+-----------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%RETRY_DELAY=1%' AS retry_delay_preserved;
+ retry_delay_preserved
+-----------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%SDU=8192%' AS sdu_preserved;
+ sdu_preserved
+---------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%SOURCE_ROUTE=ON%' AS source_route_preserved;
+ source_route_preserved
+------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%LOAD_BALANCE=ON%' AS load_balance_preserved;
+ load_balance_preserved
+------------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%FAILOVER=ON%' AS failover_preserved;
+ failover_preserved
+--------------------
+ t
+(1 row)
+
+SELECT dbms_tns_resolve_tnsname('OPTNEST') IS NOT NULL AS connect_options_with_nested_address_resolves;
+ connect_options_with_nested_address_resolves
+----------------------------------------------
+ t
+(1 row)
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_connect_options_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENOPT') IS NULL AS malformed_connect_options_is_null;
+ malformed_connect_options_is_null
+-----------------------------------
+ t
+(1 row)
+
diff --git a/src/test/regress/expected/dbms_trace.out b/src/test/regress/expected/dbms_trace.out
new file mode 100644
index 0000000..f67735f
--- /dev/null
+++ b/src/test/regress/expected/dbms_trace.out
@@ -0,0 +1,537 @@
+-- DBMS_TRACE regression coverage.
+--
+-- Single-file coverage for:
+-- - catalog/signature presence
+-- - safe MVP runtime behavior
+-- - explicit not-implemented stubs
+SET client_min_messages TO info;
+\getenv libdir PG_LIBDIR
+\getenv dlsuffix PG_DLSUFFIX
+\set regresslib :libdir '/regress' :dlsuffix
+CREATE FUNCTION regress_dbms_trace_snapshot() RETURNS text
+ AS :'regresslib', 'regress_dbms_trace_snapshot' LANGUAGE C STRICT;
+SELECT dbms_trace_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT dbms_trace_is_enabled() AS trace_disabled_by_default;
+ trace_disabled_by_default
+---------------------------
+ f
+(1 row)
+
+SELECT dbms_trace_set_plsql_trace(1);
+ dbms_trace_set_plsql_trace
+----------------------------
+
+(1 row)
+
+SELECT dbms_trace_is_enabled() AS trace_enabled_after_set;
+ trace_enabled_after_set
+-------------------------
+ t
+(1 row)
+
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT dbms_trace_is_enabled() AS trace_disabled_after_clear;
+ trace_disabled_after_clear
+----------------------------
+ f
+(1 row)
+
+DO $$
+DECLARE
+ v_count integer;
+ v_args text;
+ v_result text;
+BEGIN
+ SELECT count(*)
+ INTO v_count
+ FROM pg_proc
+ WHERE proname IN (
+ 'dbms_trace_set_plsql_trace',
+ 'dbms_trace_clear_plsql_trace',
+ 'dbms_trace_is_enabled',
+ 'dbms_trace_get_plsql_trace_level',
+ 'dbms_trace_plsql_trace_version',
+ 'dbms_trace_get_version'
+ );
+
+ IF v_count <> 6 THEN
+ RAISE EXCEPTION 'expected 6 dbms_trace entries, found %', v_count;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_is_enabled';
+ IF v_args <> '' OR v_result <> 'boolean' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_is_enabled: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_set_plsql_trace';
+ IF v_args <> 'trace_level integer' OR v_result <> 'void' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_set_plsql_trace: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_clear_plsql_trace';
+ IF v_args <> '' OR v_result <> 'void' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_clear_plsql_trace: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_get_plsql_trace_level';
+ IF v_args <> '' OR v_result <> 'integer' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_get_plsql_trace_level: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_plsql_trace_version';
+ IF v_args <> 'OUT major integer, OUT minor integer' OR v_result <> 'record' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_plsql_trace_version: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_get_version';
+ IF v_args <> '' OR v_result <> 'text' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_get_version: args=%, result=%', v_args, v_result;
+ END IF;
+
+ RAISE INFO 'catalog signatures => 6 entrypoints verified';
+END $$;
+INFO: catalog signatures => 6 entrypoints verified
+DO $$
+DECLARE
+ v_count integer;
+BEGIN
+ SELECT count(*)
+ INTO v_count
+ FROM pg_proc
+ WHERE proname IN (
+ 'dbms_trace_plsql_trace_runs',
+ 'dbms_trace_plsql_trace_events'
+ );
+
+ IF v_count <> 2 THEN
+ RAISE EXCEPTION 'expected 2 SQL-readable dbms_trace trace functions, found %', v_count;
+ END IF;
+
+ IF to_regclass('plsql_trace_runs') IS NULL OR to_regclass('plsql_trace_events') IS NULL THEN
+ RAISE EXCEPTION 'expected SQL-readable trace views to exist';
+ END IF;
+
+ RAISE INFO 'SQL-readable trace functions/views => present';
+END $$;
+INFO: SQL-readable trace functions/views => present
+-- Direct record-return SRF calls with shortened caller descriptors must be safe.
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT count(*) >= 0 AS direct_empty_events_ok
+ FROM dbms_trace_plsql_trace_events() AS e(
+ event_type text,
+ run_id integer,
+ event_seq integer,
+ unit_name text,
+ subprogram_name text
+ );
+ direct_empty_events_ok
+------------------------
+ t
+(1 row)
+
+SELECT count(*) >= 0 AS direct_empty_runs_ok
+ FROM dbms_trace_plsql_trace_runs() AS r(
+ run_id integer,
+ trace_level integer,
+ event_count integer
+ );
+ direct_empty_runs_ok
+----------------------
+ t
+(1 row)
+
+DO $$
+DECLARE
+ v_snapshot text;
+BEGIN
+ PERFORM dbms_trace_clear_plsql_trace();
+ PERFORM dbms_trace_set_plsql_trace(1);
+ v_snapshot := regress_dbms_trace_snapshot();
+ IF v_snapshot NOT LIKE 'enabled=true trace_mask=1 active_run_id=% next_run_id=% next_event_seq=% trace_rows_count=% last_event_type=SET' THEN
+ RAISE EXCEPTION 'unexpected snapshot after SET: %', v_snapshot;
+ END IF;
+
+ PERFORM dbms_trace_clear_plsql_trace();
+ v_snapshot := regress_dbms_trace_snapshot();
+ IF v_snapshot NOT LIKE 'enabled=false trace_mask=0 active_run_id=0 next_run_id=% next_event_seq=% trace_rows_count=% last_event_type=CLEAR' THEN
+ RAISE EXCEPTION 'unexpected snapshot after CLEAR: %', v_snapshot;
+ END IF;
+
+ PERFORM dbms_trace_clear_plsql_trace();
+ v_snapshot := regress_dbms_trace_snapshot();
+ IF v_snapshot NOT LIKE 'enabled=false trace_mask=0 active_run_id=0 next_run_id=% next_event_seq=% trace_rows_count=% last_event_type=CLEAR' THEN
+ RAISE EXCEPTION 'unexpected snapshot after repeated CLEAR: %', v_snapshot;
+ END IF;
+
+ RAISE INFO 'CLEAR_PLSQL_TRACE shutdown + idempotence => OK';
+END $$;
+INFO: CLEAR_PLSQL_TRACE shutdown + idempotence => OK
+DO $$
+DECLARE
+BEGIN
+ PERFORM dbms_trace_clear_plsql_trace();
+ PERFORM dbms_trace_set_plsql_trace(1);
+ PERFORM dbms_trace_set_plsql_trace(1 + 2);
+ PERFORM dbms_trace_set_plsql_trace(1.5::integer);
+ PERFORM dbms_trace_set_plsql_trace(0);
+ PERFORM dbms_trace_set_plsql_trace(-1);
+ PERFORM dbms_trace_set_plsql_trace(1048576);
+ PERFORM dbms_trace_clear_plsql_trace();
+ RAISE INFO 'SET_PLSQL_TRACE safe numeric cases => OK';
+END $$;
+INFO: SET_PLSQL_TRACE safe numeric cases => OK
+DO $$
+DECLARE
+ v_state text;
+ v_msg text;
+BEGIN
+ BEGIN
+ PERFORM dbms_trace_set_plsql_trace(NULL::integer);
+ RAISE EXCEPTION 'dbms_trace_set_plsql_trace(NULL::integer) unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '22023' OR v_msg <> 'SET_PLSQL_TRACE requires a trace level' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_set_plsql_trace(NULL::integer): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'SET_PLSQL_TRACE(NULL::integer) => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_set_plsql_trace('abc'::integer);
+ RAISE EXCEPTION 'dbms_trace_set_plsql_trace(''abc''::integer) unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '22P02' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_set_plsql_trace(''abc''::integer): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'SET_PLSQL_TRACE(''abc''::integer) => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_set_plsql_trace(999999999999999999999999::integer);
+ RAISE EXCEPTION 'dbms_trace_set_plsql_trace(999999999999999999999999::integer) unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '22003' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_set_plsql_trace(999999999999999999999999::integer): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'SET_PLSQL_TRACE(999999999999999999999999::integer) => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_get_plsql_trace_level();
+ RAISE EXCEPTION 'dbms_trace_get_plsql_trace_level() unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '0A000' OR v_msg <> 'DBMS_TRACE.GET_PLSQL_TRACE_LEVEL is not implemented yet' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_get_plsql_trace_level(): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'GET_PLSQL_TRACE_LEVEL => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_plsql_trace_version();
+ RAISE EXCEPTION 'dbms_trace_plsql_trace_version() unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '0A000' OR v_msg <> 'DBMS_TRACE.PLSQL_TRACE_VERSION is not implemented yet' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_plsql_trace_version(): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'PLSQL_TRACE_VERSION => state=% msg=%', v_state, v_msg;
+ END;
+END $$;
+INFO: SET_PLSQL_TRACE(NULL::integer) => state=22023 msg=SET_PLSQL_TRACE requires a trace level
+INFO: SET_PLSQL_TRACE('abc'::integer) => state=22P02 msg=invalid input syntax for type integer: "abc"
+INFO: SET_PLSQL_TRACE(999999999999999999999999::integer) => state=22003 msg=integer out of range
+INFO: GET_PLSQL_TRACE_LEVEL => state=0A000 msg=DBMS_TRACE.GET_PLSQL_TRACE_LEVEL is not implemented yet
+INFO: PLSQL_TRACE_VERSION => state=0A000 msg=DBMS_TRACE.PLSQL_TRACE_VERSION is not implemented yet
+CREATE OR REPLACE FUNCTION dbms_trace_probe_inner(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN x + 1;
+END;
+$$;
+CREATE OR REPLACE FUNCTION dbms_trace_probe_outer(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN dbms_trace_probe_inner(x) + 1;
+END;
+$$;
+DROP FUNCTION IF EXISTS dbms_trace_events_outer(integer);
+NOTICE: function dbms_trace_events_outer(pg_catalog.int4) does not exist, skipping
+DROP FUNCTION IF EXISTS dbms_trace_events_inner(integer);
+NOTICE: function dbms_trace_events_inner(pg_catalog.int4) does not exist, skipping
+CREATE FUNCTION dbms_trace_events_inner(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN x + 1;
+END;
+$$;
+CREATE FUNCTION dbms_trace_events_outer(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN dbms_trace_events_inner(x) + 1;
+END;
+$$;
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT dbms_trace_set_plsql_trace(1);
+ dbms_trace_set_plsql_trace
+----------------------------
+
+(1 row)
+
+SELECT dbms_trace_events_outer(10) AS demo_result;
+ demo_result
+-------------
+ 12
+(1 row)
+
+WITH latest_run AS (
+ SELECT max(run_id) AS run_id FROM plsql_trace_runs
+),
+direct_events AS (
+ SELECT
+ event_type,
+ run_id,
+ event_seq,
+ unit_name,
+ subprogram_name
+ FROM dbms_trace_plsql_trace_events() AS e(
+ event_type text,
+ run_id integer,
+ event_seq integer,
+ unit_name text,
+ subprogram_name text
+ )
+ WHERE run_id = (SELECT run_id FROM latest_run)
+),
+direct_runs AS (
+ SELECT
+ run_id,
+ trace_level,
+ event_count
+ FROM dbms_trace_plsql_trace_runs() AS r(
+ run_id integer,
+ trace_level integer,
+ event_count integer
+ )
+ WHERE run_id = (SELECT run_id FROM latest_run)
+)
+SELECT
+ (SELECT count(*) FROM direct_events) AS direct_event_rows,
+ (SELECT event_count FROM direct_runs) AS direct_run_event_count,
+ (SELECT count(*) FROM direct_events) = (SELECT event_count FROM direct_runs) AS direct_event_count_matches;
+ direct_event_rows | direct_run_event_count | direct_event_count_matches
+-------------------+------------------------+----------------------------
+ 5 | 5 | t
+(1 row)
+
+SELECT
+ event_type,
+ run_id IS NOT NULL AS run_id_ok,
+ event_seq IS NOT NULL AS event_seq_ok,
+ coalesce(unit_name <> '', true) AS unit_name_ok,
+ coalesce(subprogram_name <> '', true) AS subprogram_name_ok
+FROM dbms_trace_plsql_trace_events() AS e(
+ event_type text,
+ run_id integer,
+ event_seq integer,
+ unit_name text,
+ subprogram_name text
+)
+WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs)
+ORDER BY event_seq;
+ event_type | run_id_ok | event_seq_ok | unit_name_ok | subprogram_name_ok
+------------+-----------+--------------+--------------+--------------------
+ SET_TRACE | t | t | t | t
+ CALL | t | t | t | t
+ CALL | t | t | t | t
+ RETURN | t | t | t | t
+ RETURN | t | t | t | t
+(5 rows)
+
+SELECT
+ run_id IS NOT NULL AS run_id_ok,
+ trace_level,
+ event_count >= 0 AS event_count_ok
+FROM dbms_trace_plsql_trace_runs() AS r(
+ run_id integer,
+ trace_level integer,
+ event_count integer
+)
+WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs);
+ run_id_ok | trace_level | event_count_ok
+-----------+-------------+----------------
+ t | 1 | t
+(1 row)
+
+DO $$
+DECLARE
+ v_state text;
+ v_msg text;
+BEGIN
+ BEGIN
+ PERFORM 1
+ FROM dbms_trace_plsql_trace_events() AS e(foo text);
+ RAISE EXCEPTION 'dbms_trace_plsql_trace_events() with unsupported column unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '0A000' OR v_msg <> 'unsupported DBMS_TRACE event output column "foo"' THEN
+ RAISE EXCEPTION 'unexpected error for unsupported DBMS_TRACE event column: state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'unsupported DBMS_TRACE event column => state=% msg=%', v_state, v_msg;
+ END;
+END $$;
+INFO: unsupported DBMS_TRACE event column => state=0A000 msg=unsupported DBMS_TRACE event output column "foo"
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+DROP FUNCTION dbms_trace_events_outer(integer);
+DROP FUNCTION dbms_trace_events_inner(integer);
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT dbms_trace_set_plsql_trace(1);
+ dbms_trace_set_plsql_trace
+----------------------------
+
+(1 row)
+
+SELECT dbms_trace_probe_outer(10);
+ dbms_trace_probe_outer
+------------------------
+ 12
+(1 row)
+
+SELECT regress_dbms_trace_snapshot();
+ regress_dbms_trace_snapshot
+---------------------------------------------------------------------------------------------------------------------
+ enabled=true trace_mask=1 active_run_id=5 next_run_id=6 next_event_seq=6 trace_rows_count=19 last_event_type=RETURN
+(1 row)
+
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT dbms_trace_probe_outer(20);
+ dbms_trace_probe_outer
+------------------------
+ 22
+(1 row)
+
+SELECT regress_dbms_trace_snapshot();
+ regress_dbms_trace_snapshot
+---------------------------------------------------------------------------------------------------------------------
+ enabled=false trace_mask=0 active_run_id=0 next_run_id=6 next_event_seq=7 trace_rows_count=20 last_event_type=CLEAR
+(1 row)
+
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT dbms_trace_set_plsql_trace(7);
+ dbms_trace_set_plsql_trace
+----------------------------
+
+(1 row)
+
+SELECT dbms_trace_probe_outer(10);
+ dbms_trace_probe_outer
+------------------------
+ 12
+(1 row)
+
+SELECT dbms_trace_clear_plsql_trace();
+ dbms_trace_clear_plsql_trace
+------------------------------
+
+(1 row)
+
+SELECT run_id,
+ trace_mask,
+ is_active,
+ event_count,
+ started_at IS NOT NULL AS started,
+ ended_at IS NOT NULL AS ended
+ FROM plsql_trace_runs
+ WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs);
+ run_id | trace_mask | is_active | event_count | started | ended
+--------+------------+-----------+-------------+---------+-------
+ 6 | 7 | f | 6 | t | t
+(1 row)
+
+SELECT event_seq,
+ event_type,
+ coalesce(subprogram_name, '-') AS subprogram_name
+ FROM plsql_trace_events
+ WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs)
+ ORDER BY event_seq;
+ event_seq | event_type | subprogram_name
+-----------+-------------+------------------------
+ 1 | SET_TRACE | -
+ 2 | CALL | dbms_trace_probe_outer
+ 3 | CALL | dbms_trace_probe_inner
+ 4 | RETURN | dbms_trace_probe_inner
+ 5 | RETURN | dbms_trace_probe_outer
+ 6 | CLEAR_TRACE | -
+(6 rows)
+
+DROP FUNCTION dbms_trace_probe_outer(integer);
+DROP FUNCTION dbms_trace_probe_inner(integer);
+RESET client_min_messages;
diff --git a/src/test/regress/expected/dbms_warning.out b/src/test/regress/expected/dbms_warning.out
new file mode 100644
index 0000000..49cb093
--- /dev/null
+++ b/src/test/regress/expected/dbms_warning.out
@@ -0,0 +1,459 @@
+-- Проверка DBMS_WARNING: точки входа, строковый API и хук компилятора.
+SELECT dbms_warning_get_version() AS package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+SELECT count(*) = 9 AS dbms_warning_entrypoints_present
+FROM pg_proc
+WHERE proname LIKE 'dbms_warning_%';
+ dbms_warning_entrypoints_present
+----------------------------------
+ t
+(1 row)
+
+SELECT proname || '|' ||
+ coalesce(pg_get_function_identity_arguments(oid), '') || '|' ||
+ prorettype::regtype::text || '|' ||
+ prosrc AS entrypoint_signature
+FROM pg_proc
+WHERE proname LIKE 'dbms_warning_%'
+ORDER BY proname;
+ entrypoint_signature
+------------------------------------------------------------------------------------------------------------------------------------------------------
+ dbms_warning_add_warning_setting_cat|warning_category varchar2, warning_value varchar2, scope varchar2|void|dbms_warning_add_warning_setting_cat
+ dbms_warning_add_warning_setting_num|warning_number binary_integer, warning_value varchar2, scope varchar2|void|dbms_warning_add_warning_setting_num
+ dbms_warning_get_category|warning_number binary_integer|varchar2|dbms_warning_get_category
+ dbms_warning_get_version||text|dbms_warning_get_version
+ dbms_warning_get_warning_setting_cat|warning_category varchar2|varchar2|dbms_warning_get_warning_setting_cat
+ dbms_warning_get_warning_setting_num|warning_number binary_integer|varchar2|dbms_warning_get_warning_setting_num
+ dbms_warning_get_warning_setting_string||varchar2|dbms_warning_get_warning_setting_string
+ dbms_warning_normalize_setting|setting varchar2|varchar2|dbms_warning_normalize_setting
+ dbms_warning_set_warning_setting_string|value varchar2, scope varchar2|void|dbms_warning_set_warning_setting_string
+(9 rows)
+
+CREATE OR REPLACE FUNCTION warning_try_set(value text, scope text)
+RETURNS text AS $$
+BEGIN
+ PERFORM dbms_warning_set_warning_setting_string(value, scope);
+ RETURN 'OK';
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN SQLSTATE;
+END
+$$ LANGUAGE plpgsql;
+-- Проверка строкового API для сессионного PLSQL_WARNINGS.
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS default_is_disable_all;
+ default_is_disable_all
+------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_normalize_setting('enable:all') = 'ENABLE:ALL' AS normalize_enable_all;
+ normalize_enable_all
+----------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL', 'SESSION') = 'OK' AS enable_all_set_ok;
+ enable_all_set_ok
+-------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL' AS enable_all_get;
+ enable_all_get
+----------------
+ t
+(1 row)
+
+SELECT warning_try_set('disable:all', 'session') = 'OK' AS lowercase_set_ok;
+ lowercase_set_ok
+------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS lowercase_get;
+ lowercase_get
+---------------
+ t
+(1 row)
+
+SELECT warning_try_set(' Enable : All ', ' SESSION ') = 'OK' AS mixed_case_spacing_set_ok;
+ mixed_case_spacing_set_ok
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL' AS mixed_case_spacing_get;
+ mixed_case_spacing_get
+------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ERROR:ALL', 'SESSION') = 'OK' AS error_all_set_ok;
+ error_all_set_ok
+------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ERROR:ALL' AS error_all_get;
+ error_all_get
+---------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:SEVERE', 'SESSION') = 'OK' AS enable_severe_set_ok;
+ enable_severe_set_ok
+----------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:SEVERE' AS enable_severe_get;
+ enable_severe_get
+-------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:INFORMATIONAL', 'SESSION') = 'OK' AS enable_informational_set_ok;
+ enable_informational_set_ok
+-----------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:INFORMATIONAL' AS enable_informational_get;
+ enable_informational_get
+--------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:PERFORMANCE', 'SESSION') = 'OK' AS enable_performance_set_ok;
+ enable_performance_set_ok
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:PERFORMANCE' AS enable_performance_get;
+ enable_performance_get
+------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('DISABLE:PERFORMANCE', 'SESSION') = 'OK' AS disable_performance_set_ok;
+ disable_performance_set_ok
+----------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:PERFORMANCE' AS disable_performance_get;
+ disable_performance_get
+-------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL,DISABLE:PERFORMANCE', 'SESSION') = 'OK' AS ordered_clauses_set_ok;
+ ordered_clauses_set_ok
+------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL,DISABLE:PERFORMANCE' AS ordered_clauses_get;
+ ordered_clauses_get
+---------------------
+ t
+(1 row)
+
+SELECT warning_try_set('DISABLE:ALL,ENABLE:SEVERE', 'SESSION') = 'OK' AS disable_then_severe_set_ok;
+ disable_then_severe_set_ok
+----------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL,ENABLE:SEVERE' AS disable_then_severe_get;
+ disable_then_severe_get
+-------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ERROR:06002', 'SESSION') = 'OK' AS error_number_set_ok;
+ error_number_set_ok
+---------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ERROR:6002' AS error_number_get;
+ error_number_get
+------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:6002', 'SESSION') = 'OK' AS enable_number_set_ok;
+ enable_number_set_ok
+----------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:6002' AS enable_number_get;
+ enable_number_get
+-------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE : ( 06002 , 06003 )', 'SESSION') = 'OK' AS enable_number_list_set_ok;
+ enable_number_list_set_ok
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:(6002,6003)' AS enable_number_list_get;
+ enable_number_list_get
+------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('DISABLE:ALL', 'SESSION') = 'OK' AS cleanup_disable_all_set_ok;
+ cleanup_disable_all_set_ok
+----------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS cleanup_disable_all_get;
+ cleanup_disable_all_get
+-------------------------
+ t
+(1 row)
+
+-- Проверка отказов без повреждения предыдущего состояния.
+SELECT warning_try_set('ENABLE:ALL,DISABLE:PERFORMANCE', 'SESSION') = 'OK' AS state_a_set_ok;
+ state_a_set_ok
+----------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL,DISABLE:PERFORMANCE' AS state_a_get;
+ state_a_get
+-------------
+ t
+(1 row)
+
+SELECT warning_try_set('', 'SESSION') = '22023' AS empty_value_rejected;
+ empty_value_rejected
+----------------------
+ t
+(1 row)
+
+SELECT warning_try_set(' ', 'SESSION') = '22023' AS whitespace_value_rejected;
+ whitespace_value_rejected
+---------------------------
+ t
+(1 row)
+
+SELECT warning_try_set(NULL, 'SESSION') = '22004' AS null_value_rejected;
+ null_value_rejected
+---------------------
+ t
+(1 row)
+
+SELECT warning_try_set('BAD:ALL', 'SESSION') = '22023' AS invalid_action_rejected;
+ invalid_action_rejected
+-------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:BAD', 'SESSION') = '22023' AS invalid_selector_rejected;
+ invalid_selector_rejected
+---------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:', 'SESSION') = '22023' AS missing_selector_rejected;
+ missing_selector_rejected
+---------------------------
+ t
+(1 row)
+
+SELECT warning_try_set(':ALL', 'SESSION') = '22023' AS missing_action_rejected;
+ missing_action_rejected
+-------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLEALL', 'SESSION') = '22023' AS missing_colon_rejected;
+ missing_colon_rejected
+------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL,', 'SESSION') = '22023' AS trailing_comma_rejected;
+ trailing_comma_rejected
+-------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL,,DISABLE:ALL', 'SESSION') = '22023' AS empty_clause_rejected;
+ empty_clause_rejected
+-----------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:(6002,)', 'SESSION') = '22023' AS malformed_numeric_list_rejected;
+ malformed_numeric_list_rejected
+---------------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:(abc)', 'SESSION') = '22023' AS non_numeric_list_item_rejected;
+ non_numeric_list_item_rejected
+--------------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:-1', 'SESSION') = '22023' AS negative_number_rejected;
+ negative_number_rejected
+--------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL', 'BAD') = '22023' AS invalid_scope_rejected;
+ invalid_scope_rejected
+------------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL', NULL) = '22004' AS null_scope_rejected;
+ null_scope_rejected
+---------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL', '') = '22023' AS empty_scope_rejected;
+ empty_scope_rejected
+----------------------
+ t
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL', 'SYSTEM') = '42501' AS system_scope_rejected;
+ system_scope_rejected
+-----------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL,DISABLE:PERFORMANCE' AS state_preserved_after_failed_set;
+ state_preserved_after_failed_set
+----------------------------------
+ t
+(1 row)
+
+-- Проверка интеграции компилятора: non-ALL строка не ломает helper, ALL-level
+-- поведение по-прежнему определяет shadow-variable warning.
+SELECT warning_try_set('ENABLE:SEVERE', 'SESSION') = 'OK' AS compiler_non_all_set_ok;
+ compiler_non_all_set_ok
+-------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:SEVERE' AS compiler_non_all_get;
+ compiler_non_all_get
+----------------------
+ t
+(1 row)
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_non_all(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+SELECT dbms_warning_shadow_non_all(1);
+ dbms_warning_shadow_non_all
+-----------------------------
+ 1
+(1 row)
+
+SELECT warning_try_set('DISABLE:ALL', 'SESSION') = 'OK' AS compiler_disable_all_set_ok;
+ compiler_disable_all_set_ok
+-----------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS compiler_disable_all_get;
+ compiler_disable_all_get
+--------------------------
+ t
+(1 row)
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_disable(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+SELECT dbms_warning_shadow_disable(1);
+ dbms_warning_shadow_disable
+-----------------------------
+ 1
+(1 row)
+
+SELECT warning_try_set('ENABLE:ALL', 'SESSION') = 'OK' AS compiler_enable_all_set_ok;
+ compiler_enable_all_set_ok
+----------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL' AS compiler_enable_all_get;
+ compiler_enable_all_get
+-------------------------
+ t
+(1 row)
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_enable(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+WARNING: variable "in1" shadows a previously defined variable
+LINE 4: in1 int;
+ ^
+SELECT dbms_warning_shadow_enable(1);
+ dbms_warning_shadow_enable
+----------------------------
+ 1
+(1 row)
+
+SELECT warning_try_set('ERROR:ALL', 'SESSION') = 'OK' AS compiler_error_all_set_ok;
+ compiler_error_all_set_ok
+---------------------------
+ t
+(1 row)
+
+SELECT dbms_warning_get_warning_setting_string() = 'ERROR:ALL' AS compiler_error_all_get;
+ compiler_error_all_get
+------------------------
+ t
+(1 row)
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_error(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+ERROR: variable "in1" shadows a previously defined variable
+LINE 4: in1 int;
+ ^
+SELECT to_regprocedure('dbms_warning_shadow_error(integer)') IS NULL AS shadow_error_absent;
+ shadow_error_absent
+---------------------
+ t
+(1 row)
+
diff --git a/src/test/regress/expected/dbms_xmlsave.out b/src/test/regress/expected/dbms_xmlsave.out
new file mode 100644
index 0000000..8f8dd86
--- /dev/null
+++ b/src/test/regress/expected/dbms_xmlsave.out
@@ -0,0 +1,20 @@
+SET client_min_messages = notice;
+DROP TABLE IF EXISTS t_xmlsave_service;
+NOTICE: table "t_xmlsave_service" does not exist, skipping
+CREATE TABLE t_xmlsave_service
+(
+ id int4
+);
+DO $$
+DECLARE
+ v_handle int4;
+BEGIN
+ RAISE NOTICE 'Expected: DBMS_XMLSAVE context closed';
+ v_handle := dbms_xmlsave_newcontext('t_xmlsave_service'::varchar2);
+ PERFORM dbms_xmlsave_closecontext2(v_handle, 0::int4);
+ RAISE NOTICE 'Actual: DBMS_XMLSAVE context closed';
+END;
+$$;
+NOTICE: Expected: DBMS_XMLSAVE context closed
+NOTICE: Actual: DBMS_XMLSAVE context closed
+DROP TABLE IF EXISTS t_xmlsave_service;
diff --git a/src/test/regress/expected/dbms_xmlstore.out b/src/test/regress/expected/dbms_xmlstore.out
new file mode 100644
index 0000000..bea37b8
--- /dev/null
+++ b/src/test/regress/expected/dbms_xmlstore.out
@@ -0,0 +1,20 @@
+SET client_min_messages = notice;
+DROP TABLE IF EXISTS t_xmlstore_service;
+NOTICE: table "t_xmlstore_service" does not exist, skipping
+CREATE TABLE t_xmlstore_service
+(
+ id int4
+);
+DO $$
+DECLARE
+ v_handle int4;
+BEGIN
+ RAISE NOTICE 'Expected: DBMS_XMLSTORE context closed';
+ v_handle := dbms_xmlstore_newcontext('t_xmlstore_service'::varchar2);
+ PERFORM dbms_xmlstore_closecontext_tmp(v_handle, 0::int4);
+ RAISE NOTICE 'Actual: DBMS_XMLSTORE context closed';
+END;
+$$;
+NOTICE: Expected: DBMS_XMLSTORE context closed
+NOTICE: Actual: DBMS_XMLSTORE context closed
+DROP TABLE IF EXISTS t_xmlstore_service;
diff --git a/src/test/regress/expected/htf.out b/src/test/regress/expected/htf.out
new file mode 100644
index 0000000..8008436
--- /dev/null
+++ b/src/test/regress/expected/htf.out
@@ -0,0 +1,618 @@
+select htf_appletopen('"q Я"',3,4,'c" Я');
+ htf_appletopen
+-----------------------------------------------------
+ <applet code="q Я" width=3 height=4 c" Я>
+(1 row)
+
+select htf_address('"qw Я"','"qa Я"','"qs Я"','c" Я');
+ htf_address
+------------------------------------------------------------------------------------------------------
+ <address clear=""qs Я"" nowrap="nowrap" c" Я>"qw Я"</address>
+(1 row)
+
+select htf_address('','','','');
+ htf_address
+---------------------
+ <address></address>
+(1 row)
+
+select htf_bodyopen('"qw Я"','"qw Я"');
+ htf_bodyopen
+---------------------------------------------------------
+ <body background=""qw Я"" "qw Я">
+(1 row)
+
+select htf_escape_sc('"qw Я"');
+ htf_escape_sc
+------------------
+ "qw Я"
+(1 row)
+
+select htf_escape_sc('');
+ htf_escape_sc
+---------------
+
+(1 row)
+
+select htf_escape_url(NULL);
+ htf_escape_url
+----------------
+
+(1 row)
+
+select htf_formselectopen('"q Я"','"qSa - Я"',4,'c" Я');
+ htf_formselectopen
+--------------------------------------------------------------------
+ "qSa - Я"<select name=""q Я"" size="4" c" Я>
+(1 row)
+
+select htf_mapopen('"qw Я"','"qw Я"');
+ htf_mapopen
+--------------------------------------------------
+ <map name=""qw Я"" "qw Я">
+(1 row)
+
+select htf_mapopen(NULL,NULL);
+ htf_mapopen
+---------------
+ <map name="">
+(1 row)
+
+select htf_formtext('"qw Я"','"qa Я"','"qs Я"','c" Я', 'att"rib');
+ htf_formtext
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <input type="text" name=""qw Я"" size=""qa Я"" maxlength=""qs Я"" value="c" Я" att"rib />
+(1 row)
+
+select htf_formtext(NULL,NULL,NULL,NULL,NULL);
+ htf_formtext
+-------------------------------
+ <input type="text" name="" />
+(1 row)
+
+select htf_formtextareaopen('"qw Я"',2.2,7,'c" Я', 'att"rib');
+ htf_formtextareaopen
+----------------------------------------------------------------------------------------------------------
+ <textarea name=""qw Я"" rows="2.2" cols="7" align="c" Я" att"rib>
+(1 row)
+
+select htf_formtextareaopen(NULL,NULL,NULL,NULL,NULL);
+ htf_formtextareaopen
+------------------------------------
+ <textarea name="" rows="" cols="">
+(1 row)
+
+select htf_formtextareaopen2('"qw Я"',2.2,7,'c" Я','c" Я', 'att"rib');
+ htf_formtextareaopen2
+---------------------------------------------------------------------------------------------------------------------------------------
+ <textarea name=""qw Я"" rows="2.2" cols="7" align="c" Я" wrap="c" Я" att"rib>
+(1 row)
+
+select htf_formtextarea('"qw Я"',2.2, 7, 'c" Я', 'att"rib');
+ htf_formtextarea
+---------------------------------------------------------------------------------------------------------------------
+ <textarea name=""qw Я"" rows="2.2" cols="7" align="c" Я" att"rib></textarea>
+(1 row)
+
+select htf_formtextarea2(NULL,NULL,NULL,NULL,NULL,NULL);
+ htf_formtextarea2
+-----------------------------------------------
+ <textarea name="" rows="" cols=""></textarea>
+(1 row)
+
+select htf_anchor(NULL,NULL,NULL,NULL);
+ htf_anchor
+----------------------------------------------------------------------------
+ <!-- ERROR in anchor2 usage, curl and cname cannot be NULL --><a name=" ">
+(1 row)
+
+select htf_anchor('','','','');
+ htf_anchor
+----------------------------------------------------------------------------
+ <!-- ERROR in anchor2 usage, curl and cname cannot be NULL --><a name=" ">
+(1 row)
+
+select htf_anchor('"q Я"','"q Я"','"q Я"','"q Я"');
+ htf_anchor
+-----------------------------------------------------------------------------------------------
+ <a href=""q Я"" name=""q Я"" "q Я">"q Я"</a>
+(1 row)
+
+select htf_anchor2(NULL,NULL,NULL,NULL,NULL);
+ htf_anchor2
+----------------------------------------------------------------------------
+ <!-- ERROR in anchor2 usage, curl and cname cannot be NULL --><a name=" ">
+(1 row)
+
+select htf_anchor2('','','','','');
+ htf_anchor2
+----------------------------------------------------------------------------
+ <!-- ERROR in anchor2 usage, curl and cname cannot be NULL --><a name=" ">
+(1 row)
+
+select htf_anchor2('"q Я"','"q Я"','"q Я"','"q Я"','"q Я"');
+ htf_anchor2
+------------------------------------------------------------------------------------------------------------------------------------
+ <a href=""q Я"" name=""q Я"" target=""q Я"" "q Я">"q Я"</a>
+(1 row)
+
+select htf_area('"q Я"','"q Я"','"q Я"','"q Я"','"q Я"','"q Я"');
+ htf_area
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <area shape=""q Я"" coords=""q Я"" href=""q Я"" nohref="nohref" target=""q Я"" "q Я" />
+(1 row)
+
+select htf_area(NULL,NULL,NULL,NULL,NULL,NULL);
+ htf_area
+--------------------
+ <area coords="" />
+(1 row)
+
+select htf_center(NULL);
+ htf_center
+-------------------
+ <center></center>
+(1 row)
+
+select htf_center('"q Я"');
+ htf_center
+-----------------------------------------
+ <center>"q Я"</center>
+(1 row)
+
+select htf_cite('"qw Я"','"qw Я"');
+ htf_cite
+---------------------------------------------
+ <cite "qw Я">"qw Я"</cite>
+(1 row)
+
+select htf_cite(NULL, NULL);
+ htf_cite
+---------------
+ <cite></cite>
+(1 row)
+
+select htf_code(NULL, NULL);
+ htf_code
+---------------
+ <code></code>
+(1 row)
+
+select htf_code('"qw Я"','"qw Я"');
+ htf_code
+---------------------------------------------
+ <code "qw Я">"qw Я"</code>
+(1 row)
+
+select htf_codepoint('Яa"qw Я"');
+ htf_codepoint
+---------------
+ 1071
+(1 row)
+
+select htf_comment(' "qw Я"');
+ htf_comment
+-------------------------------------
+ <!-- '' "qw Я" -->
+(1 row)
+
+select htf_comment(NULL);
+ htf_comment
+-------------
+ <!-- '' -->
+(1 row)
+
+select htf_dfn('"qw Я"','"qw Я"');
+ htf_dfn
+-------------------------------------------
+ <dfn "qw Я">"qw Я"</dfn>
+(1 row)
+
+select htf_dfn(NULL, NULL);
+ htf_dfn
+-------------
+ <dfn></dfn>
+(1 row)
+
+select htf_div('"qw Я"','"qw Я"');
+ htf_div
+---------------------------------------------------
+ <div align=""qw Я"" "qw Я">
+(1 row)
+
+select htf_div(NULL, NULL);
+ htf_div
+---------
+ <div>
+(1 row)
+
+select htf_dlistdef('"qw Я"','"q-w Я"','"qw Я"');
+ htf_dlistdef
+--------------------------------------------------------------------------
+ <dd clear=""q-w Я"" "qw Я">"qw Я"
+(1 row)
+
+select htf_dlistdef(NULL, NULL, NULL);
+ htf_dlistdef
+--------------
+ <dd>
+(1 row)
+
+select htf_dlistopen('"qw Я"','"q-w Я"');
+ htf_dlistopen
+---------------------------------------------------
+ <dl clear=""qw Я"" "q-w Я">
+(1 row)
+
+select htf_dlistopen(NULL, NULL);
+ htf_dlistopen
+---------------
+ <dl>
+(1 row)
+
+select htf_dlistterm('"qw Я"','"q-w Я"','"qw Я"');
+ htf_dlistterm
+--------------------------------------------------------------------------
+ <dt clear=""q-w Я"" "qw Я">"qw Я"
+(1 row)
+
+select htf_em('"qw Я"','"qw Я"');
+ htf_em
+-----------------------------------------
+ <em "qw Я">"qw Я"</em>
+(1 row)
+
+select htf_em(NULL, NULL);
+ htf_em
+-----------
+ <em></em>
+(1 row)
+
+select htf_emphasis(NULL, NULL);
+ htf_emphasis
+--------------
+ <em></em>
+(1 row)
+
+select htf_emphasis('"qw Я"','"qw Я"');
+ htf_emphasis
+-----------------------------------------
+ <em "qw Я">"qw Я"</em>
+(1 row)
+
+select htf_fontopen(NULL, NULL, NULL, NULL);
+ htf_fontopen
+--------------
+ <font>
+(1 row)
+
+select htf_fontopen('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_fontopen
+----------------------------------------------------------------------------------------------------------------------------
+ <font color=""qw Я"" face=""qw Я"" size=""qw Я"" "qw Я">
+(1 row)
+
+select htf_format_cell(NULL, NULL);
+ htf_format_cell
+-----------------
+ <td></td>
+(1 row)
+
+select htf_format_cell('"qw Я"','a="s"');
+ htf_format_cell
+----------------------------------
+ <td>"qw Я"</td>
+(1 row)
+
+select htf_formcheckbox(NULL, NULL, NULL, NULL);
+ htf_formcheckbox
+-----------------------------------
+ <input type="checkbox" name="" />
+(1 row)
+
+select htf_formcheckbox('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_formcheckbox
+-----------------------------------------------------------------------------------------------------------------------------
+ <input type="checkbox" name=""qw Я"" value=""qw Я"" checked="checked" "qw Я" />
+(1 row)
+
+select htf_formfile(NULL, NULL, NULL);
+ htf_formfile
+-----------------------
+ <input type="file" />
+(1 row)
+
+select htf_formfile('"qw Я"','"qw Я"','"qw Я"');
+ htf_formfile
+--------------------------------------------------------------------------------------------------------
+ <input type="file" name=""qw Я"" accept=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_formhidden(NULL, NULL, NULL);
+ htf_formhidden
+------------------------------------------
+ <input type="hidden" name="" value="" />
+(1 row)
+
+select htf_formhidden('"qw Я"','"qw Я"','"qw Я"');
+ htf_formhidden
+---------------------------------------------------------------------------------------------------------
+ <input type="hidden" name=""qw Я"" value=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_formimage(NULL, NULL, NULL, NULL);
+ htf_formimage
+---------------------------------------
+ <input type="image" name="" src="" />
+(1 row)
+
+select htf_formimage('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_formimage
+-------------------------------------------------------------------------------------------------------------------------------------------
+ <input type="image" name=""qw Я"" src=""qw Я"" align=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_formopen(NULL, NULL, NULL, NULL, NULL);
+ htf_formopen
+----------------------------
+ <form action="" method="">
+(1 row)
+
+select htf_formopen('"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_formopen
+------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <form action=""qw Я"" method=""qw Я"" target=""qw Я"" enctype=""qw Я"" "qw Я">
+(1 row)
+
+select htf_formpassword(NULL, NULL, NULL, NULL, NULL);
+ htf_formpassword
+-----------------------------------
+ <input type="password" name="" />
+(1 row)
+
+select htf_formpassword('"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_formpassword
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <input type="password" name=""qw Я"" size=""qw Я"" maxlength=""qw Я"" value=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_formradio(NULL, NULL, NULL, NULL);
+ htf_formradio
+-----------------------------------------
+ <input type="radio" name="" value="" />
+(1 row)
+
+select htf_formradio('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_formradio
+--------------------------------------------------------------------------------------------------------------------------
+ <input type="radio" name=""qw Я"" value=""qw Я"" checked="checked" "qw Я" />
+(1 row)
+
+select htf_formreset(NULL, NULL);
+ htf_formreset
+---------------------------------
+ <input type="reset" VALUE="" />
+(1 row)
+
+select htf_formreset('"qw Я"', '"qw Я"');
+ htf_formreset
+--------------------------------------------------------------------
+ <input type="reset" VALUE=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_formselectoption(NULL, NULL, NULL);
+ htf_formselectoption
+----------------------
+ <option></option>
+(1 row)
+
+select htf_formselectoption('"qw Я"1','"qw Я"2','"qw Я"3');
+ htf_formselectoption
+-----------------------------------------------------------------------
+ <option selected="selected" "qw Я"3>"qw Я"1</option>
+(1 row)
+
+select htf_formsubmit(NULL, NULL, NULL);
+ htf_formsubmit
+-------------------------
+ <input type="submit" />
+(1 row)
+
+select htf_formsubmit('"qw Я"','"qw Я"','"qw Я"');
+ htf_formsubmit
+---------------------------------------------------------------------------------------------------------
+ <input type="submit" name=""qw Я"" value=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_frame(NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ htf_frame
+------------------
+ <frame src="" />
+(1 row)
+
+select htf_frame('"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_frame
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <frame src=""qw Я"" name=""qw Я"" marginwidth=""qw Я"" marginheight=""qw Я"" scrolling=""qw Я"" noresize="noresize" "qw Я" />
+(1 row)
+
+select htf_framesetopen(NULL, NULL, NULL);
+ htf_framesetopen
+------------------
+ <frameset>
+(1 row)
+
+select htf_framesetopen('"qw Я"','"qw Я"','"qw Я"');
+ htf_framesetopen
+-------------------------------------------------------------------------------------------
+ <frameset rows=""qw Я"" cols=""qw Я"" "qw Я">
+(1 row)
+
+select htf_header(NULL, NULL, NULL, NULL, NULL, NULL);
+ htf_header
+------------
+ <h></h>
+(1 row)
+
+select htf_header(4,'"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_header
+-----------------------------------------------------------------------------------------------------------------------------------
+ <h4 align=""qw Я"" clear=""qw Я"" nowrap="nowrap" "qw Я">"qw Я"</h4>
+(1 row)
+
+select htf_hr(NULL, NULL, NULL);
+ htf_hr
+--------
+ <hr />
+(1 row)
+
+select htf_hr('"qw Я"','"qw Я"','"qw Я"');
+ htf_hr
+---------------------------------------------------------------------------
+ <hr clear=""qw Я"" src=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_htitle(NULL, NULL, NULL, NULL, NULL, NULL);
+ htf_htitle
+------------------------
+ <title></title><h></h>
+(1 row)
+
+select htf_htitle('1"qw Я"',1, '2"qw Я"','3"qw Я"','4"qw Я"','5"qw Я"');
+ htf_htitle
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <title>1"qw Я"</title><h1 align="2"qw Я"" clear="4"qw Я"" nowrap="nowrap" 5"qw Я">1"qw Я"</h1>
+(1 row)
+
+select htf_img(NULL, NULL, NULL, NULL, NULL);
+ htf_img
+----------------
+ <img src="" />
+(1 row)
+
+select htf_img('"qw Я"', '"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_img
+-----------------------------------------------------------------------------------------------------------------------------
+ <img src=""qw Я"" align=""qw Я"" alt=""qw Я"" ismap="ismap" "qw Я" />
+(1 row)
+
+select htf_img2(NULL, NULL, NULL, NULL, NULL, NULL);
+ htf_img2
+----------------
+ <img src="" />
+(1 row)
+
+select htf_img2('"qw Я"','"qw Я"', '"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_img2
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ <img src=""qw Я"" align=""qw Я"" alt=""qw Я"" ismap="ismap" usemap=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_isindex(NULL, NULL);
+ htf_isindex
+-------------
+ <isindex>
+(1 row)
+
+select htf_isindex('"qw Я"','"qw Я"');
+ htf_isindex
+-------------------------------------------------------------------------
+ <isindex prompt=""qw Я"" href=""qw Я"">
+(1 row)
+
+select htf_italic(NULL, NULL);
+ htf_italic
+------------
+ <i></i>
+(1 row)
+
+select htf_italic('"qw Я"','"qw Я"');
+ htf_italic
+---------------------------------------
+ <i "qw Я">"qw Я"</i>
+(1 row)
+
+select htf_kbd(NULL, NULL);
+ htf_kbd
+-------------
+ <kbd></kbd>
+(1 row)
+
+select htf_kbd('"qw Я"','"qw Я"');
+ htf_kbd
+-------------------------------------------
+ <kbd "qw Я">"qw Я"</kbd>
+(1 row)
+
+select htf_keyboard(NULL, NULL);
+ htf_keyboard
+--------------
+ <kbd></kbd>
+(1 row)
+
+select htf_keyboard('"qw Я"','"qw Я"');
+ htf_keyboard
+-------------------------------------------
+ <kbd "qw Я">"qw Я"</kbd>
+(1 row)
+
+select htf_line(NULL, NULL, NULL);
+ htf_line
+----------
+ <hr />
+(1 row)
+
+select htf_line('"qw Я"','"qw Я"', '"qw Я"');
+ htf_line
+---------------------------------------------------------------------------
+ <hr clear=""qw Я"" src=""qw Я"" "qw Я" />
+(1 row)
+
+select htf_linkrel(NULL, NULL, NULL);
+ htf_linkrel
+-------------------------
+ <link rel="" href="" />
+(1 row)
+
+select htf_linkrel('"qw Я"','"qw Я"', '"qw Я"');
+ htf_linkrel
+----------------------------------------------------------------------------------------------------------
+ <link rel=""qw Я"" href=""qw Я"" title=""qw Я"" />
+(1 row)
+
+select htf_linkrev(NULL, NULL, NULL);
+ htf_linkrev
+-------------------------
+ <link rev="" href="" />
+(1 row)
+
+select htf_linkrev('"qw Я"','"qw Я"', '"qw Я"');
+ htf_linkrev
+----------------------------------------------------------------------------------------------------------
+ <link rev=""qw Я"" href=""qw Я"" title=""qw Я"" />
+(1 row)
+
+select htf_listheader(NULL, NULL);
+ htf_listheader
+----------------
+ <lh></lh>
+(1 row)
+
+select htf_listheader('"qw Я"','"qw Я"');
+ htf_listheader
+-----------------------------------------
+ <lh "qw Я">"qw Я"</lh>
+(1 row)
+
+select htf_listitem(NULL, NULL, NULL, NULL, NULL);
+ htf_listitem
+--------------
+ <li>
+(1 row)
+
+select htf_listitem('"qw Я"', '"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+ htf_listitem
+---------------------------------------------------------------------------------------------------------------------------------------------------
+ <li clear=""qw Я"" dingbat=""qw Я"" src=""qw Я"" "qw Я">"qw Я"
+(1 row)
+
diff --git a/src/test/regress/expected/htp.out b/src/test/regress/expected/htp.out
new file mode 100644
index 0000000..77e3f81
--- /dev/null
+++ b/src/test/regress/expected/htp.out
@@ -0,0 +1,1246 @@
+select htp_enable_test_mode(1);
+NOTICE: HTML:
+test mode on
+
+ htp_enable_test_mode
+----------------------
+
+(1 row)
+
+select htp_appletopen('my_app=let.class&я', 100, 200, 'f');
+NOTICE: HTML:
+<applet code=my_app=let.class&я width=100 height=200 f>
+
+ htp_appletopen
+----------------
+
+(1 row)
+
+select htp_appletclose();
+NOTICE: HTML:
+</applet>
+
+ htp_appletclose
+-----------------
+
+(1 row)
+
+select htp_blockquoteopen('1', '2', '3');
+NOTICE: HTML:
+<blockquote clear="2" nowrap="nowrap" 3>
+
+ htp_blockquoteopen
+--------------------
+
+(1 row)
+
+select htp_blockquoteclose();
+NOTICE: HTML:
+</blockquote>
+
+ htp_blockquoteclose
+---------------------
+
+(1 row)
+
+select htp_blockquoteopen('s', '12.,3_-_321 Россия!', 'id="my_quote" !@#$%^&*( .');
+NOTICE: HTML:
+<blockquote clear="12.,3_-_321 Россия!" nowrap="nowrap" id="my_quote" !@#$%^&*( .>
+
+ htp_blockquoteopen
+--------------------
+
+(1 row)
+
+select htp_blockquoteclose();
+NOTICE: HTML:
+</blockquote>
+
+ htp_blockquoteclose
+---------------------
+
+(1 row)
+
+select htp_bodyopen('/images/background.gif.Стиль', 'Вася BGPROPERTIES="fixed"');
+NOTICE: HTML:
+<body background="/images/background.gif.Стиль" Вася BGPROPERTIES="fixed">
+
+ htp_bodyopen
+--------------
+
+(1 row)
+
+select htp_bodyclose();
+NOTICE: HTML:
+</body>
+
+ htp_bodyclose
+---------------
+
+(1 row)
+
+select htp_dlistopen('hjv', 'class="my-definition-list"');
+NOTICE: HTML:
+<dl clear="hjv" class="my-definition-list">
+
+ htp_dlistopen
+---------------
+
+(1 row)
+
+select htp_dlistclose();
+NOTICE: HTML:
+</dl>
+
+ htp_dlistclose
+----------------
+
+(1 row)
+
+select htp_formopen('/cgi-bin/&search.pl', 'G/ET-я', 'Яr/esults_frame', 'Яr/e', 'name="search_form" class="search-form"');
+NOTICE: HTML:
+<form action="/cgi-bin/&search.pl" method="G/ET-я" target="Яr/esults_frame" enctype="Яr/e" name="search_form" class="search-form">
+
+ htp_formopen
+--------------
+
+(1 row)
+
+select htp_formclose();
+NOTICE: HTML:
+</form>
+
+ htp_formclose
+---------------
+
+(1 row)
+
+select htp_fontopen('BL/UE', 'Verd/ana', '3/4', 'name="search_form" class="search-form"');
+NOTICE: HTML:
+<font color="BL/UE" face="Verd/ana" size="3/4" name="search_form" class="search-form">
+
+ htp_fontopen
+--------------
+
+(1 row)
+
+select htp_fontclose();
+NOTICE: HTML:
+</font>
+
+ htp_fontclose
+---------------
+
+(1 row)
+
+select htp_formselectopen('"hobby_list', 'Ва"ши хобби: ', 8.7, 'multiple style="width: 200px;"');
+NOTICE: HTML:
+ Ва"ши хобби: <select name=""hobby_list" size="8.7" multiple style="width: 200px;">
+
+ htp_formselectopen
+--------------------
+
+(1 row)
+
+select htp_formselectclose();
+NOTICE: HTML:
+</select>
+
+ htp_formselectclose
+---------------------
+
+(1 row)
+
+select htp_framesetopen('', '25%, 75%', 'border="1"');
+NOTICE: HTML:
+<frameset cols="25%, 75%" border="1">
+
+ htp_framesetopen
+------------------
+
+(1 row)
+
+select htp_framesetclose();
+NOTICE: HTML:
+</frameset>
+
+ htp_framesetclose
+-------------------
+
+(1 row)
+
+select htp_mapopen(NULL, NULL);
+NOTICE: HTML:
+<map name="">
+
+ htp_mapopen
+-------------
+
+(1 row)
+
+select htp_mapclose();
+NOTICE: HTML:
+</map>
+
+ htp_mapclose
+--------------
+
+(1 row)
+
+select htp_olistopen('both"', 'soft"', NULL);
+NOTICE: HTML:
+<ol clear="both"" wrap="soft"">
+
+ htp_olistopen
+---------------
+
+(1 row)
+
+select htp_olistclose();
+NOTICE: HTML:
+</ol>
+
+ htp_olistclose
+----------------
+
+(1 row)
+
+select htp_preopen('both"', '80"', 'class="source-code" style="font-size:12px;"');
+NOTICE: HTML:
+<pre clear="both"" width="80"" class="source-code" style="font-size:12px;">
+
+ htp_preopen
+-------------
+
+(1 row)
+
+select htp_preclose();
+NOTICE: HTML:
+</pre>
+
+ htp_preclose
+--------------
+
+(1 row)
+
+select htp_tableopen(' ', ' ', ' ', ' ', ' ');
+NOTICE: HTML:
+<table   nowrap="nowrap" align=" " clear=" " >
+
+ htp_tableopen
+---------------
+
+(1 row)
+
+select htp_tableclose();
+NOTICE: HTML:
+</table>
+
+ htp_tableclose
+----------------
+
+(1 row)
+
+select htp_tablerowopen('CENTER"', 'MIDDLE"', '1"', 'yes"', 'style="background-color: #E0E0E0;"');
+NOTICE: HTML:
+<tr align="CENTER"" valign="MIDDLE"" dp="1"" nowrap="nowrap" style="background-color: #E0E0E0;">
+
+ htp_tablerowopen
+------------------
+
+(1 row)
+
+select htp_tablerowclose();
+NOTICE: HTML:
+</tr>
+
+ htp_tablerowclose
+-------------------
+
+(1 row)
+
+select htp_ulistopen('a"', 'HORIZ"', '⚡', 'd"', 'class="energy-list" id="main"');
+NOTICE: HTML:
+<ul clear="a"" wrap="HORIZ"" dingbat="⚡" src="d"" class="energy-list" id="main">
+
+ htp_ulistopen
+---------------
+
+(1 row)
+
+select htp_ulistclose();
+NOTICE: HTML:
+</ul>
+
+ htp_ulistclose
+----------------
+
+(1 row)
+
+select htp_centeropen();
+NOTICE: HTML:
+<center>
+
+ htp_centeropen
+----------------
+
+(1 row)
+
+select htp_centerclose();
+NOTICE: HTML:
+</center>
+
+ htp_centerclose
+-----------------
+
+(1 row)
+
+select htp_dirlistopen();
+NOTICE: HTML:
+<dir>
+
+ htp_dirlistopen
+-----------------
+
+(1 row)
+
+select htp_dirlistclose();
+NOTICE: HTML:
+</dir>
+
+ htp_dirlistclose
+------------------
+
+(1 row)
+
+select htp_headopen();
+NOTICE: HTML:
+<head>
+
+ htp_headopen
+--------------
+
+(1 row)
+
+select htp_headclose();
+NOTICE: HTML:
+</head>
+
+ htp_headclose
+---------------
+
+(1 row)
+
+select htp_htmlopen();
+NOTICE: HTML:
+<html>
+
+ htp_htmlopen
+--------------
+
+(1 row)
+
+select htp_htmlclose();
+NOTICE: HTML:
+</html>
+
+ htp_htmlclose
+---------------
+
+(1 row)
+
+select htp_listingopen();
+NOTICE: HTML:
+<listing>
+
+ htp_listingopen
+-----------------
+
+(1 row)
+
+select htp_listingclose();
+NOTICE: HTML:
+</listing>
+
+ htp_listingclose
+------------------
+
+(1 row)
+
+select htp_menulistopen();
+NOTICE: HTML:
+<menu>
+
+ htp_menulistopen
+------------------
+
+(1 row)
+
+select htp_menulistclose();
+NOTICE: HTML:
+</menu>
+
+ htp_menulistclose
+-------------------
+
+(1 row)
+
+select htp_noframesopen();
+NOTICE: HTML:
+<noframes>
+
+ htp_noframesopen
+------------------
+
+(1 row)
+
+select htp_noframesclose();
+NOTICE: HTML:
+</noframes>
+
+ htp_noframesclose
+-------------------
+
+(1 row)
+
+select htp_escape_sc('Россия qwerasdf1234" & . @ '' ');
+NOTICE: HTML:
+Россия qwerasdf1234" & . @ '
+
+ htp_escape_sc
+---------------
+
+(1 row)
+
+select htp_escape_sc('Visit <our site> & enjoy! !@#$%^&*()_+|/');
+NOTICE: HTML:
+Visit <our site> & enjoy! !@#$%^&*()_+|/
+
+ htp_escape_sc
+---------------
+
+(1 row)
+
+select htp_formcheckbox('"interests', '"travel', '9', 'style="color: blue;"');
+NOTICE: HTML:
+<input type="checkbox" name=""interests" value=""travel" checked="checked" style="color: blue;" />
+
+ htp_formcheckbox
+------------------
+
+(1 row)
+
+select htp_formfile('"interests', '"travel', 'style="color: blue;"');
+NOTICE: HTML:
+<input type="file" name=""interests" accept=""travel" style="color: blue;" />
+
+ htp_formfile
+--------------
+
+(1 row)
+
+select htp_formhidden('"i', '"t', 'style="c"');
+NOTICE: HTML:
+<input type="hidden" name=""i" value=""t" style="c" />
+
+ htp_formhidden
+----------------
+
+(1 row)
+
+select htp_formimage('"i', '"t', '"','style="c"');
+NOTICE: HTML:
+<input type="image" name=""i" src=""t" align=""" style="c" />
+
+ htp_formimage
+---------------
+
+(1 row)
+
+select htp_formpassword('"i', '"t', '"','"w"', 'style="c"');
+NOTICE: HTML:
+<input type="password" name=""i" size=""t" maxlength=""" value=""w"" style="c" />
+
+ htp_formpassword
+------------------
+
+(1 row)
+
+select htp_formradio('"i', '"t', '"', 'style="c"');
+NOTICE: HTML:
+<input type="radio" name=""i" value=""t" checked="checked" style="c" />
+
+ htp_formradio
+---------------
+
+(1 row)
+
+select htp_formreset('"i', 'style="c"');
+NOTICE: HTML:
+<input type="reset" VALUE=""i" style="c" />
+
+ htp_formreset
+---------------
+
+(1 row)
+
+select htp_formselectoption('"i', '"','style="c"');
+NOTICE: HTML:
+<option selected="selected" style="c">"i</option>
+
+ htp_formselectoption
+----------------------
+
+(1 row)
+
+select htp_formsubmit('"i', '"','style="c"');
+NOTICE: HTML:
+<input type="submit" name=""i" value=""" style="c" />
+
+ htp_formsubmit
+----------------
+
+(1 row)
+
+select htp_formtext('"i', '"','"9"', '"2"', 'style="c"');
+NOTICE: HTML:
+<input type="text" name=""i" size=""" maxlength=""9"" value=""2"" style="c" />
+
+ htp_formtext
+--------------
+
+(1 row)
+
+select htp_formtextarea('"i', 2, 9, '"2"', 'style="c"');
+NOTICE: HTML:
+<textarea name=""i" rows="2" cols="9" align=""2"" style="c"></textarea>
+
+ htp_formtextarea
+------------------
+
+(1 row)
+
+select htp_formtextarea2('"i', 2.9, 9, '"2"', ' ', 'style="c"');
+NOTICE: HTML:
+<textarea name=""i" rows="2.9" cols="9" align=""2"" wrap=" " style="c"></textarea>
+
+ htp_formtextarea2
+-------------------
+
+(1 row)
+
+select htp_address(NULL, '', 'Б"al l*', 'style="font-style: italic;"');
+NOTICE: HTML:
+<address clear="Б"al l*" style="font-style: italic;"></address>
+
+ htp_address
+-------------
+
+(1 row)
+
+select htp_anchor(NULL, 'NEW* сайт', 'x"в', 'class="external"');
+NOTICE: HTML:
+<a name="x"в" class="external">NEW* сайт</a>
+
+ htp_anchor
+------------
+
+(1 row)
+
+select htp_area('x"в','x"в','x"в','x"в','x"в', 'b"Я');
+NOTICE: HTML:
+<area shape="x"в" coord="x"в" href="x"в" nohref="nohref" target="x"в" b"Я />
+
+ htp_area
+----------
+
+(1 row)
+
+-- htp_em tests
+select htp_em('NICE');
+NOTICE: HTML:
+<em>NICE</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('найс'); -- converts russian symbols in html unicode codes
+NOTICE: HTML:
+<em>найс</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('🙂'); -- emoji is converted to html unicode too
+NOTICE: HTML:
+<em>🙂</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('<script>alert(1)</script>');
+NOTICE: HTML:
+<em><script>alert(1)</script></em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Test ''Single Quotes''');
+NOTICE: HTML:
+<em>Test 'Single Quotes'</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('A < B > C & D');
+NOTICE: HTML:
+<em>A < B > C & D</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Tab s Here');
+NOTICE: HTML:
+<em>Tab s Here</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Line
+Break');
+NOTICE: HTML:
+<em>Line
+Break</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em(''); -- Empty string
+NOTICE: HTML:
+<em></em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em(NULL); -- NULL value
+NOTICE: HTML:
+<em></em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em(' '); -- Single space
+NOTICE: HTML:
+<em> </em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Emphasized', 'class="highlight"');
+NOTICE: HTML:
+<em class="highlight">Emphasized</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Text', 'style="font-weight: bold;"');
+NOTICE: HTML:
+<em style="font-weight: bold;">Text</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Link', 'id="my-id"');
+NOTICE: HTML:
+<em id="my-id">Link</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Mixed', 'class="test" id="x" style="color:red"');
+NOTICE: HTML:
+<em class="test" id="x" style="color:red">Mixed</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('<script>', 'onclick="alert(1)"');
+NOTICE: HTML:
+<em onclick="alert(1)"><script></em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Text', 'data-value="<script>"');
+NOTICE: HTML:
+<em data-value="<script>">Text</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Emphasized');
+NOTICE: HTML:
+<em>Emphasized</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em(NULL, 'class="test"');
+NOTICE: HTML:
+<em class="test"></em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Text', NULL);
+NOTICE: HTML:
+<em>Text</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em('Text', '');
+NOTICE: HTML:
+<em>Text</em>
+
+ htp_em
+--------
+
+(1 row)
+
+select htp_em(NULL, NULL);
+NOTICE: HTML:
+<em></em>
+
+ htp_em
+--------
+
+(1 row)
+
+-- htp_frame tests
+select htp_frame('https://awww.ru');
+NOTICE: HTML:
+<frame src="https://awww.ru" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('найс'); -- outputs unicode
+NOTICE: HTML:
+<frame src="найс" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('<script>alert(1)</script>');
+NOTICE: HTML:
+<frame src="<script>alert(1)</script>" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('A < B > C & D');
+NOTICE: HTML:
+<frame src="A < B > C & D" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('Line
+Break');
+NOTICE: HTML:
+<frame src="Line
+Break" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame(''); -- Empty string
+NOTICE: HTML:
+<frame src="(null)" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame(NULL); -- NULL value
+NOTICE: HTML:
+<frame src="(null)" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame(' ');
+NOTICE: HTML:
+<frame src=" " />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('Col1 Col2 Col3'); -- Tab handling
+NOTICE: HTML:
+<frame src="Col1 Col2 Col3" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame(chr(9) || 'Test' || chr(9));
+NOTICE: HTML:
+<frame src=" Test " />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://awww.ru', 'art site', '100', '100', 'yes', '555', 'index_rate=100'); -- name escapes space!
+NOTICE: HTML:
+<frame src="https://awww.ru" name="art site" marginwidth="100" marginheight="100" scrolling="yes" noresize="noresize" index_rate=100 />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://awww.ru', 'space_test', '1 00', '10 0', 'ye s', '555', 'index_rate=10 0'); -- all attrs are escaping space but not cattr
+NOTICE: HTML:
+<frame src="https://awww.ru" name="space_test" marginwidth="1 00" marginheight="10 0" scrolling="ye s" noresize="noresize" index_rate=10 0 />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://awww.ru', '555', 'abc', 'zyx', '444', 'canresize', 'index_rate=100'); -- attrs are messed up logically
+NOTICE: HTML:
+<frame src="https://awww.ru" name="555" marginwidth="abc" marginheight="zyx" scrolling="444" noresize="noresize" index_rate=100 />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://awww.ru', 'абв', 'где', 'ёжз', 'ийк', 'лмн', 'index_rate=опр'); -- attrs are escaping unicode, noresize is ok, cattrs is not escaped
+NOTICE: HTML:
+<frame src="https://awww.ru" name="абв" marginwidth="где" marginheight="ёжз" scrolling="ийк" noresize="noresize" index_rate=опр />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://awww.ru', 'symbols_linebreaks_test', 'F < G > H & I',
+ 'J < K >
+ L & M', 'E < O > P & N',
+ 'Q < R > S & T', 'U < V > W & X');
+NOTICE: HTML:
+<frame src="https://awww.ru" name="symbols_linebreaks_test" marginwidth="F < G > H & I" marginheight="J < K > 
                               L & M" scrolling="E < O > P & N" noresize="noresize" U < V > W & X />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://spaces.nul0', '', '', '', '', '', '');
+NOTICE: HTML:
+<frame src="https://spaces.nul0" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://spaces.nul1', ' ', ' ', ' ', ' ', ' ', ' ');
+NOTICE: HTML:
+<frame src="https://spaces.nul1" name=" " marginwidth=" " marginheight=" " scrolling=" " noresize="noresize" />
+
+ htp_frame
+-----------
+
+(1 row)
+
+select htp_frame('https://symbols.esc', '\n', '\r', '\t', '\\', '\n', '\n'); -- '\' is escaped as html unicode for attrs
+NOTICE: HTML:
+<frame src="https://symbols.esc" name="\n" marginwidth="\r" marginheight="\t" scrolling="\\" noresize="noresize" \n />
+
+ htp_frame
+-----------
+
+(1 row)
+
+-- htp_header tests
+select htp_header(NULL, 'Invalid tag');
+NOTICE: HTML:
+<h>Invalid tag</h>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, 'Pretty Normal');
+NOTICE: HTML:
+<h1>Pretty Normal</h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(7, 'Tag overflow'); -- 7 is converted to 6
+NOTICE: HTML:
+<h6>Tag overflow</h6>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(0, 'Invalid 0 tag'); -- 0 is okay
+NOTICE: HTML:
+<h0>Invalid 0 tag</h0>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(13, 'найс'); -- converts russian symbols in html unicode codes
+NOTICE: HTML:
+<h6>найс</h6>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(-2, '🙂'); -- emoji is converted to html unicode too, -2 is 2
+NOTICE: HTML:
+<h2>🙂</h2>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(-12, '🙂'); -- emoji is converted to html unicode too, -12 is 6
+NOTICE: HTML:
+<h6>🙂</h6>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, '<script>alert(1)</script>');
+NOTICE: HTML:
+<h1><script>alert(1)</script></h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, 'A < B > C & D');
+NOTICE: HTML:
+<h1>A < B > C & D</h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, 'Line
+Break');
+NOTICE: HTML:
+<h1>Line
+Break</h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, ''); -- Empty string
+NOTICE: HTML:
+<h1></h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, NULL); -- NULL value
+NOTICE: HTML:
+<h1></h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, ' '); -- Single space
+NOTICE: HTML:
+<h1> </h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(1, 'A < B > C & D', 'A < B > C & D', 'A < B > C & D', 'A < B > C & D', 'A < B > C & D');
+NOTICE: HTML:
+<h1 align="A < B > C & D" nowrap="nowrap" clear="A < B > C & D" A < B > C & D>A < B > C & D</h1>
+
+ htp_header
+------------
+
+(1 row)
+
+select htp_header(2, '', '', '', '', '');
+NOTICE: HTML:
+<h2></h2>
+
+ htp_header
+------------
+
+(1 row)
+
+-- OWA_UTIL.SHOWPAGE extended call form with HTP output
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'HTP_SHOWPAGE_UTILS_BODY';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM htp_p('HTP_SHOWPAGE_UTILS_BODY'::varchar2);
+ PERFORM owa_util_showpage_utils(0::int4);
+END $$;
+NOTICE: Expected:
+NOTICE: HTP_SHOWPAGE_UTILS_BODY
+NOTICE: Actual:
+NOTICE: HTP_SHOWPAGE_UTILS_BODY
+
+-- htp_dlistterm tests
+select htp_dlistterm();
+NOTICE: HTML:
+<dt>
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('anna');
+NOTICE: HTML:
+<dt>anna
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm(NULL);
+NOTICE: HTML:
+<dt>
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('');
+NOTICE: HTML:
+<dt>
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('найс'); -- converts russian symbols in html unicode codes
+NOTICE: HTML:
+<dt>найс
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('🙂'); -- emoji is converted to html unicode too
+NOTICE: HTML:
+<dt>🙂
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('<script>alert(1)</script>');
+NOTICE: HTML:
+<dt><script>alert(1)</script>
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('A < B > C & D'); -- converts special symbols to html unicode
+NOTICE: HTML:
+<dt>A < B > C & D
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('Line
+Break');
+NOTICE: HTML:
+<dt>Line
+Break
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('some term', 'not clear', 'index_rate=100'); -- cclear escapes space
+NOTICE: HTML:
+<dt clear="not clear" index_rate=100>some term
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('ийк', 'лмн', 'index_rate=опр');
+NOTICE: HTML:
+<dt clear="лмн" index_rate=опр>ийк
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('E < O > P & N', 'Q < R > S & T', 'U < V > W & X');
+NOTICE: HTML:
+<dt clear="Q < R > S & T" U < V > W & X>E < O > P & N
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('', '', '');
+NOTICE: HTML:
+<dt>
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm(' ', ' ', ' '); -- cclear escapes space
+NOTICE: HTML:
+<dt clear=" " >
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm('\n', '\r', '\t'); -- cclear escapes slash
+NOTICE: HTML:
+<dt clear="\r" \t>\n
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm(chr(9) || 'Test' || chr(9), 'Col1 Col2 Col3', chr(9) || 'Test' || chr(9)); -- cclear escapes tabs
+NOTICE: HTML:
+<dt clear="Col1	Col2	Col3" Test > Test
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_dlistterm(chr(1) || chr(2) || chr(3), chr(27), chr(8));
+NOTICE: HTML:
+<dt clear="" >
+
+ htp_dlistterm
+---------------
+
+(1 row)
+
+select htp_enable_test_mode(0);
+NOTICE: HTML:
+<dt clear="" >
+test mode off
+
+ htp_enable_test_mode
+----------------------
+
+(1 row)
+
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 22badaa..ca1c3b0 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -180,10 +180,10 @@
10447 | utl_compress_lz_compress | 10448 | utl_compress_lz_compress
11298 | dbms_report_format_report | 11299 | dbms_report_format_report
11304 | dbms_report_get_report | 11305 | dbms_report_get_report
+ 10517 | utl_compress_lz_uncompress_extract | 10518 | utl_compress_lz_uncompress_extract
10308 | utl_compress_lz_compress_raw | 10446 | utl_compress_lz_compress
10309 | utl_compress_lz_compress_blob | 10448 | utl_compress_lz_compress
10452 | utl_compress_lz_compress_open | 10453 | utl_compress_lz_compress_open
- 10517 | utl_compress_lz_uncompress_extract | 10518 | utl_compress_lz_uncompress_extract
(35 rows)
-- Look for uses of different type OIDs in the argument/result type fields
@@ -238,7 +238,8 @@
timestamp without time zone | timestamp with time zone
bit | bit varying
txid_snapshot | pg_snapshot
-(7 rows)
+ jsonb | varchar2
+(8 rows)
SELECT DISTINCT p1.proargtypes[1]::regtype, p2.proargtypes[1]::regtype
FROM pg_proc AS p1, pg_proc AS p2
@@ -259,8 +260,9 @@
timestamp without time zone | timestamp with time zone
bit | bit varying
txid_snapshot | pg_snapshot
+ jsonb | varchar2
anyrange | anymultirange
-(6 rows)
+(7 rows)
SELECT DISTINCT p1.proargtypes[2]::regtype, p2.proargtypes[2]::regtype
FROM pg_proc AS p1, pg_proc AS p2
@@ -532,7 +534,10 @@
11034 | dbms_aq_enqueue | 25 2249 2249 25 9167 | {25,2249,2249,25,9167} | {i,i,i,i,o}
11036 | dbms_aq_dequeue | 25 2249 2249 25 9167 | {25,2249,2249,25,9167} | {i,i,i,o,o}
11309 | dbms_report_get_timing_info | 23 1700 1700 | {23,1700,1700} | {i,o,o}
-(3 rows)
+ 8521 | owa_text_new_multi | 2249 | {2249} | {o}
+ 8523 | owa_text_new_row_list | 2249 | {2249} | {o}
+ 8526 | owa_text_stream2multi | 4702 2249 | {4702,2249} | {i,o}
+(6 rows)
-- Check for type of the variadic array parameter's elements.
-- provariadic should be ANYOID if the type of the last element is ANYOID,
diff --git a/src/test/regress/expected/owa_cache.out b/src/test/regress/expected/owa_cache.out
new file mode 100644
index 0000000..c43327e
--- /dev/null
+++ b/src/test/regress/expected/owa_cache.out
@@ -0,0 +1,617 @@
+-- SET_CACHE
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ETag: "v1"';
+ RAISE NOTICE 'Cache-Control: no-cache, private';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_util_showpage();
+END;
+$$;
+NOTICE: Expected:
+NOTICE: ETag: "v1"
+NOTICE: Cache-Control: no-cache, private
+NOTICE: Actual:
+NOTICE: ETag: "v1"
+Cache-Control: no-cache, private
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ETag: "v1"';
+ RAISE NOTICE 'Cache-Control: no-cache, public';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('v1', 'SYSTEM');
+ PERFORM owa_util_showpage();
+END;
+$$;
+NOTICE: Expected:
+NOTICE: ETag: "v1"
+NOTICE: Cache-Control: no-cache, public
+NOTICE: Actual:
+NOTICE: ETag: "v1"
+Cache-Control: no-cache, public
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache(REPEAT('1', 56), 'USER');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('tag', 'INVALID_LEVEL');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+-- SET_EXPIRES
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(60, 'USER');
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(1, 'SYSTEM');
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(0, 'USER');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(60, 'NOT_A_LEVEL');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+-- GET_LEVEL
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Level: ';
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+NOTICE: Expected: Level:
+NOTICE: Actual: Level:
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Level: USER';
+ nm[1] := 'OWA_CACHE_LEVEL';
+ vl[1] := 'USER';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+NOTICE: Expected: Level: USER
+NOTICE: Actual: Level: USER
+-- SET_REQUEST_LEVEL
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Level: USER';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_level('USER');
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+NOTICE: Expected: Level: USER
+NOTICE: Actual: Level: USER
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_level('INVALID_LEVEL');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Level: SYSTEM';
+ nm[1] := 'HTTP_OWA_CACHE_LEVEL';
+ vl[1] := 'SYSTEM';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+NOTICE: Expected: Level: SYSTEM
+NOTICE: Actual: Level: SYSTEM
+-- SET_NOT_MODIFIED: успешный сценарий при совпадении request/response ETag
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v1';
+ nm[2] := 'REQUEST_PROTOCOL';
+ vl[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, nm, vl);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success';
+END $$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+-- SET_NOT_MODIFIED: request-side level участвует в сравнении
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success (No match by level)';
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v1';
+ nm[2] := 'REQUEST_PROTOCOL';
+ vl[2] := 'HTTP/1.1';
+ nm[3] := 'OWA_CACHE_LEVEL';
+ vl[3] := 'SYSTEM';
+ PERFORM owa_init_cgi_env(3, nm, vl);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success (No match by level)';
+END $$;
+NOTICE: Expected: Status: Success (No match by level)
+NOTICE: Actual: Status: Success (No match by level)
+-- SET_NOT_MODIFIED: без REQUEST_PROTOCOL совпавший ETag дает исключение
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v1';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ BEGIN
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+--------------------------------------------------------------------------------
+-- Set Not Modified part 2.
+--------------------------------------------------------------------------------
+-- Тест 1: Элементарный успех
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ v_n[1] := 'HTTP_IF_NONE_MATCH'; v_v[1] := 'v1';
+ v_n[2] := 'REQUEST_PROTOCOL'; v_v[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, v_n, v_v);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+-- Тест 2: Исключение на NULL
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ PERFORM owa_init_cgi_env(0, v_n, v_v);
+ PERFORM owa_cache_set_cache(NULL, 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+-- Тест 3: XML успех
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ v_n[1] := 'HTTP_IF_NONE_MATCH'; v_v[1] := '<a><b>1</b></a>';
+ v_n[2] := 'REQUEST_PROTOCOL'; v_v[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, v_n, v_v);
+ PERFORM owa_cache_set_cache('<a><b>1</b></a>', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+-- Тест 4: Несовпадение
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success (No match)';
+ v_n[1] := 'HTTP_IF_NONE_MATCH'; v_v[1] := 'old';
+ v_n[2] := 'REQUEST_PROTOCOL'; v_v[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, v_n, v_v);
+ PERFORM owa_cache_set_cache('new', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success (No match)';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Status: Success (No match)
+NOTICE: Actual: Status: Success (No match)
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag---------------------------------
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag--------------------------------
+-- 1. Элементарный тест: GET_ETAG до установки значения
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ RAISE NOTICE 'Expected: ETag: ';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+NOTICE: Expected: ETag:
+NOTICE: Actual: ETag:
+-- 2. Входящий ETag через CGI
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v123';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: v123';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+NOTICE: Expected: ETag: v123
+NOTICE: Actual: ETag: v123
+-- 3. GET_ETAG после SET_CACHE не должен читать response-side context
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ PERFORM owa_cache_set_cache('NEW_TAG', 'USER');
+ RAISE NOTICE 'Expected: ETag: ';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+NOTICE: Expected: ETag:
+NOTICE: Actual: ETag:
+-- 4. XML структура во входящем ETag
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := '<r><id>1</id><v>A</v></r>';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: <r><id>1</id><v>A</v></r>';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+NOTICE: Expected: ETag: <r><id>1</id><v>A</v></r>
+NOTICE: Actual: ETag: <r><id>1</id><v>A</v></r>
+-- 5. Граничное условие: 55 символов во входящем ETag
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+ v_tag TEXT := 'TAG_123456789012345678901234567890123456789012345678901';
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := v_tag;
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: %', v_tag;
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+NOTICE: Expected: ETag: TAG_123456789012345678901234567890123456789012345678901
+NOTICE: Actual: ETag: TAG_123456789012345678901234567890123456789012345678901
+-- 6. Прямой вызов SET_REQUEST_ETAG
+DO $$
+DECLARE
+ v_tag TEXT := 'DIRECT_ETAG';
+BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_etag(v_tag);
+ RAISE NOTICE 'Expected: ETag: %', v_tag;
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+NOTICE: Expected: ETag: DIRECT_ETAG
+NOTICE: Actual: ETag: DIRECT_ETAG
+-- 7. Входящий ETag через расширенную форму чтения
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'service-etag';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: service-etag';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag2(0::int4), '');
+END $$;
+NOTICE: Expected: ETag: service-etag
+NOTICE: Actual: ETag: service-etag
+-- 8. Тест на исключение: слишком длинный ETag в SET_REQUEST_ETAG
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_etag(REPEAT('q', 56));
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+-- 9. Тест на исключение (Невалидный уровень в SET_CACHE)
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_cache_set_cache('tag', 'INVALID_LEVEL');
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+--SET_SURROGATE_CONTROL
+-- Тест 1: Элементарный успех
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_cache_set_surrogate_control('content="ORA:20"');
+ RAISE NOTICE 'Actual: Status: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+-- Тест 2: Исключение на NULL
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ PERFORM owa_cache_set_surrogate_control(NULL);
+ RAISE NOTICE 'Actual: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+-- Тест 3: XML успех
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_cache_set_surrogate_control('<cache><ttl>60</ttl></cache>');
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+-- Тест 4: Граничное условие 55 символов
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_cache_set_surrogate_control(REPEAT('x', 55));
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+NOTICE: Expected: Status: Success
+NOTICE: Actual: Status: Success
+-- Тест 5: Исключение на 56 символов
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ PERFORM owa_cache_set_surrogate_control(REPEAT('a', 56));
+ RAISE NOTICE 'Actual: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected: Caught exception
+NOTICE: Actual: Caught exception
+--6
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ PERFORM owa_cache_set_surrogate_control('content="ORA:20"');
+ PERFORM owa_util_showpage();
+END;
+$$;
+NOTICE: Surrogate-Control: content="ORA:20"
+
+--7
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ PERFORM owa_cache_set_surrogate_control('<cache><ttl>60</ttl></cache>');
+ PERFORM owa_util_showpage();
+END;
+$$;
+NOTICE: Surrogate-Control: <cache><ttl>60</ttl></cache>
+
+--DISABLE
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_CACHE';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('v_disable', 'USER');
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_CACHE'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected:
+NOTICE: BODY_DISABLE_CACHE
+NOTICE: Actual:
+NOTICE: BODY_DISABLE_CACHE
+
+-- Тест 2: SET_EXPIRES + DISABLE оставляет только body.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_EXPIRES';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(60, 'USER');
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_EXPIRES'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected:
+NOTICE: BODY_DISABLE_EXPIRES
+NOTICE: Actual:
+NOTICE: BODY_DISABLE_EXPIRES
+
+-- Тест 3: Повторный вызов DISABLE не ломает body.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_REPEAT';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_disable();
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_REPEAT'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected:
+NOTICE: BODY_DISABLE_REPEAT
+NOTICE: Actual:
+NOTICE: BODY_DISABLE_REPEAT
+
+-- Тест 4: Без REQUEST_PROTOCOL body тоже выводится.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_NO_PROTOCOL';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_NO_PROTOCOL'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+NOTICE: Expected:
+NOTICE: BODY_DISABLE_NO_PROTOCOL
+NOTICE: Actual:
+NOTICE: BODY_DISABLE_NO_PROTOCOL
+
diff --git a/src/test/regress/expected/owa_cookie.out b/src/test/regress/expected/owa_cookie.out
new file mode 100644
index 0000000..39aeb90
--- /dev/null
+++ b/src/test/regress/expected/owa_cookie.out
@@ -0,0 +1,239 @@
+-- OWA_COOKIE.SEND behavior checks.
+SET client_min_messages TO notice;
+SET TIME ZONE 'UTC';
+-- Test 1: duplicate cookie names must stay as separate Set-Cookie lines.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: session_id=111;';
+ RAISE NOTICE 'Set-Cookie: session_id=222;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('session_id'::varchar2, '111'::varchar2);
+ PERFORM owa_cookie_send('session_id'::varchar2, '222'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: session_id=111;
+NOTICE: Set-Cookie: session_id=222;
+NOTICE: Actual:
+NOTICE: Set-Cookie: session_id=111;
+Set-Cookie: session_id=222;
+
+-- Test 2: expires/path/domain attributes are preserved and formatted.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: test_pref=dark_mode; expires=Thu, 21-May-2026 10:11:12 GMT; path=/app;';
+ RAISE NOTICE 'domain=example.com;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'test_pref'::varchar2,
+ 'dark_mode'::varchar2,
+ '2026-05-21 10:11:12+00'::timestamptz,
+ '/app'::varchar2,
+ 'example.com'::varchar2,
+ NULL::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: test_pref=dark_mode; expires=Thu, 21-May-2026 10:11:12 GMT; path=/app;
+NOTICE: domain=example.com;
+NOTICE: Actual:
+NOTICE: Set-Cookie: test_pref=dark_mode; expires=Thu, 21-May-2026 10:11:12 GMT; path=/app; domain=example.com;
+
+-- Test 3: body output and cookies keep call order in final page.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Exception SQLSTATE=22023';
+ RAISE NOTICE '<html><body>Hello</body></html>';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM htp_p('<html><body>Hello</body></html>'::varchar2);
+ BEGIN
+ PERFORM owa_cookie_send('late_cookie'::varchar2, 'oops'::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Exception SQLSTATE=22023
+NOTICE: <html><body>Hello</body></html>
+NOTICE: Actual:
+NOTICE: Exception SQLSTATE=22023
+NOTICE: <html><body>Hello</body></html>
+
+-- Test 4: smoke check for the basic send call.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: session_id=12345;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('session_id'::varchar2, '12345'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: session_id=12345;
+NOTICE: Actual:
+NOTICE: Set-Cookie: session_id=12345;
+
+-- Test 5: all SEND arguments are provided, including secure.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: all_args_cookie=all_args_value; expires=Fri, 22-May-2026 01:02:03 GMT;';
+ RAISE NOTICE 'path=/secure-zone; domain=example.org; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'all_args_cookie'::varchar2,
+ 'all_args_value'::varchar2,
+ '2026-05-22 01:02:03+00'::timestamptz,
+ '/secure-zone'::varchar2,
+ 'example.org'::varchar2,
+ 'TRUE'::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: all_args_cookie=all_args_value; expires=Fri, 22-May-2026 01:02:03 GMT;
+NOTICE: path=/secure-zone; domain=example.org; secure;
+NOTICE: Actual:
+NOTICE: Set-Cookie: all_args_cookie=all_args_value; expires=Fri, 22-May-2026 01:02:03 GMT; path=/secure-zone; domain=example.org; secure;
+
+-- Test 6: CGI initialization accepts the extended call form.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'CGI REQUEST_PROTOCOL=HTTP/1.1';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env2(
+ 1,
+ ARRAY['REQUEST_PROTOCOL']::text[],
+ ARRAY['HTTP/1.1']::text[],
+ 0::int4
+ );
+ RAISE NOTICE 'CGI REQUEST_PROTOCOL=%', owa_util_get_cgi_env('REQUEST_PROTOCOL');
+END $$;
+NOTICE: Expected:
+NOTICE: CGI REQUEST_PROTOCOL=HTTP/1.1
+NOTICE: Actual:
+NOTICE: CGI REQUEST_PROTOCOL=HTTP/1.1
+-- CONSTRAINT TEST
+-- Test 7: documented header-context restriction.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'No exception';
+ RAISE NOTICE 'Set-Cookie: no_ctx=x;';
+ RAISE NOTICE 'Actual:';
+ BEGIN
+ PERFORM owa_cookie_send('no_ctx'::varchar2, 'x'::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ IF _actual = 'No exception' THEN
+ PERFORM owa_util_showpage();
+ END IF;
+END $$;
+NOTICE: Expected:
+NOTICE: No exception
+NOTICE: Set-Cookie: no_ctx=x;
+NOTICE: Actual:
+NOTICE: No exception
+NOTICE: Set-Cookie: no_ctx=x;
+
+-- CONSTRAINT TEST
+-- Test 8: NULL cookie name behavior.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'No exception';
+ RAISE NOTICE 'Set-Cookie: =x;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(NULL::varchar2, 'x'::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ IF _actual = 'No exception' THEN
+ PERFORM owa_util_showpage();
+ END IF;
+END $$;
+NOTICE: Expected:
+NOTICE: No exception
+NOTICE: Set-Cookie: =x;
+NOTICE: Actual:
+NOTICE: No exception
+NOTICE: Set-Cookie: =x;
+
+-- CONSTRAINT TEST
+-- Test 9: NULL cookie value behavior.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'No exception';
+ RAISE NOTICE 'Set-Cookie: x=;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('x'::varchar2, NULL::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ IF _actual = 'No exception' THEN
+ PERFORM owa_util_showpage();
+ END IF;
+END $$;
+NOTICE: Expected:
+NOTICE: No exception
+NOTICE: Set-Cookie: x=;
+NOTICE: Actual:
+NOTICE: No exception
+NOTICE: Set-Cookie: x=;
+
+-- Test 10: extended SEND form keeps the regular Set-Cookie output.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: service_cookie=service_value;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send2(
+ 'service_cookie'::varchar2,
+ 'service_value'::varchar2,
+ NULL::timestamptz,
+ NULL::varchar2,
+ NULL::varchar2,
+ NULL::varchar2,
+ 0::int4
+ );
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: service_cookie=service_value;
+NOTICE: Actual:
+NOTICE: Set-Cookie: service_cookie=service_value;
+
diff --git a/src/test/regress/expected/owa_cookie_constraints.out b/src/test/regress/expected/owa_cookie_constraints.out
new file mode 100644
index 0000000..91f7878
--- /dev/null
+++ b/src/test/regress/expected/owa_cookie_constraints.out
@@ -0,0 +1,286 @@
+-- Additional OWA_COOKIE.SEND tests.
+SET client_min_messages TO notice;
+SET TIME ZONE 'UTC';
+-- Test C01: render order and date format.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: order_check=v1; expires=Fri, 22-May-2026 01:02:03 GMT; path=/a; domain=example.org; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'order_check'::varchar2,
+ 'v1'::varchar2,
+ '2026-05-22 01:02:03+00'::timestamptz,
+ '/a'::varchar2,
+ 'example.org'::varchar2,
+ 'X'::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: order_check=v1; expires=Fri, 22-May-2026 01:02:03 GMT; path=/a; domain=example.org; secure;
+NOTICE: Actual:
+NOTICE: Set-Cookie: order_check=v1; expires=Fri, 22-May-2026 01:02:03 GMT; path=/a; domain=example.org; secure;
+
+-- CONSTRAINT TEST
+-- Test C02: send before body is allowed.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: before_body=ok;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('before_body'::varchar2, 'ok'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: before_body=ok;
+NOTICE: Actual:
+NOTICE: Set-Cookie: before_body=ok;
+
+-- CONSTRAINT TEST
+-- Test C03: send after body is rejected.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR OWA_COOKIE.SEND must be called in HTTP header context';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM htp_p('BODY_ONE'::varchar2);
+ BEGIN
+ PERFORM owa_cookie_send('after_body'::varchar2, 'must_fail'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('OWA_COOKIE.SEND must be called in HTTP header context' in SQLERRM) > 0 THEN
+ _actual := 'ERROR OWA_COOKIE.SEND must be called in HTTP header context';
+ ELSE
+ RAISE;
+ END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR OWA_COOKIE.SEND must be called in HTTP header context
+NOTICE: Actual:
+NOTICE: ERROR OWA_COOKIE.SEND must be called in HTTP header context
+-- CONSTRAINT TEST
+-- Test C04: after showpage header state is reset and send works again.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_TWO';
+ RAISE NOTICE 'Set-Cookie: after_flush=ok_again;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM htp_p('BODY_TWO'::varchar2);
+ PERFORM owa_util_showpage();
+ PERFORM owa_cookie_send('after_flush'::varchar2, 'ok_again'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: BODY_TWO
+NOTICE: Set-Cookie: after_flush=ok_again;
+NOTICE: Actual:
+NOTICE: BODY_TWO
+
+NOTICE: Set-Cookie: after_flush=ok_again;
+
+-- CONSTRAINT TEST
+-- Test C05: secure NULL => secure attribute absent.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: secure_null=v1;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('secure_null'::varchar2, 'v1'::varchar2, NULL, NULL, NULL, NULL);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: secure_null=v1;
+NOTICE: Actual:
+NOTICE: Set-Cookie: secure_null=v1;
+
+-- CONSTRAINT TEST
+-- Test C06: secure non-NULL => secure attribute present.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: secure_x=v2; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('secure_x'::varchar2, 'v2'::varchar2, NULL, NULL, NULL, 'X'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: secure_x=v2; secure;
+NOTICE: Actual:
+NOTICE: Set-Cookie: secure_x=v2; secure;
+
+-- CONSTRAINT TEST
+-- Test C07: secure empty string (non-NULL) => secure attribute present.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: secure_empty=v3; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('secure_empty'::varchar2, 'v3'::varchar2, NULL, NULL, NULL, ''::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: secure_empty=v3; secure;
+NOTICE: Actual:
+NOTICE: Set-Cookie: secure_empty=v3; secure;
+
+-- CONSTRAINT TEST
+-- Test C08: CR in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(E'bad\rname'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR invalid character in name
+NOTICE: Actual:
+NOTICE: ERROR invalid character in name
+-- CONSTRAINT TEST
+-- Test C09: LF in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(E'bad\nname'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR invalid character in name
+NOTICE: Actual:
+NOTICE: ERROR invalid character in name
+-- CONSTRAINT TEST
+-- Test C18: non-ASCII in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('имя'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR invalid character in name
+NOTICE: Actual:
+NOTICE: ERROR invalid character in name
+-- CONSTRAINT TEST
+-- Test C19: non-ASCII in value.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in value';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('n'::varchar2, 'значение'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in value' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in value'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR invalid character in value
+NOTICE: Actual:
+NOTICE: ERROR invalid character in value
+-- Test C23: printable ASCII succeeds.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: ascii_ok=ABC-123_~; path=/ok-path; domain=example.net; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'ascii_ok'::varchar2,
+ 'ABC-123_~'::varchar2,
+ NULL,
+ '/ok-path'::varchar2,
+ 'example.net'::varchar2,
+ 'secure-token'::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+NOTICE: Expected:
+NOTICE: Set-Cookie: ascii_ok=ABC-123_~; path=/ok-path; domain=example.net; secure;
+NOTICE: Actual:
+NOTICE: Set-Cookie: ascii_ok=ABC-123_~; path=/ok-path; domain=example.net; secure;
+
+-- CONSTRAINT TEST
+-- Test C24: empty name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR cookie name must not be empty';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(''::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('cookie name must not be empty' in SQLERRM) > 0 THEN _actual := 'ERROR cookie name must not be empty'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR cookie name must not be empty
+NOTICE: Actual:
+NOTICE: ERROR cookie name must not be empty
+-- CONSTRAINT TEST
+-- Test C25: space in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid cookie name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('bad name'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid cookie name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid cookie name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+NOTICE: Expected:
+NOTICE: ERROR invalid cookie name
+NOTICE: Actual:
+NOTICE: ERROR invalid cookie name
diff --git a/src/test/regress/expected/owa_pattern.out b/src/test/regress/expected/owa_pattern.out
new file mode 100644
index 0000000..4ea6485
--- /dev/null
+++ b/src/test/regress/expected/owa_pattern.out
@@ -0,0 +1,6 @@
+SELECT OWA_PATTERN_MATCH('test 12345', '\\d{5}');
+ owa_pattern_match
+-------------------
+ t
+(1 row)
+
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index 6cf828c..c53474b 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -2717,6 +2717,25 @@
name,
description
FROM pg_get_wait_events() pg_get_wait_events(type, name, description);
+plsql_trace_events| SELECT event_type,
+ run_id,
+ event_seq,
+ event_timestamp,
+ unit_name,
+ subprogram_name,
+ nesting_depth,
+ line_no,
+ sql_text,
+ error_code,
+ comment
+ FROM dbms_trace_plsql_trace_events() t(event_type text, run_id bigint, event_seq bigint, event_timestamp timestamp with time zone, unit_name text, subprogram_name text, nesting_depth integer, line_no integer, sql_text text, error_code integer, comment text);
+plsql_trace_runs| SELECT run_id,
+ trace_mask,
+ started_at,
+ ended_at,
+ event_count,
+ is_active
+ FROM dbms_trace_plsql_trace_runs() t(run_id bigint, trace_mask integer, started_at timestamp with time zone, ended_at timestamp with time zone, event_count integer, is_active boolean);
SELECT tablename, rulename, definition FROM pg_rules
WHERE schemaname = 'pg_catalog'
ORDER BY tablename, rulename;
diff --git a/src/test/regress/expected/utl_file.out b/src/test/regress/expected/utl_file.out
index f6a5359..a5af579 100644
--- a/src/test/regress/expected/utl_file.out
+++ b/src/test/regress/expected/utl_file.out
@@ -1,4 +1,5 @@
-- Подготовка окружения для тестов UTL_FILE.
+\! sh -c "rm -rf /tmp/rudb_utl_file_regress && mkdir -m 0777 /tmp/rudb_utl_file_regress"
DO $$
BEGIN
SET LOCAL client_min_messages TO 'warning';
@@ -10,10 +11,10 @@
DELETE FROM utl_file_dir
WHERE dirname = 'UTL_TEST_DIR'
- OR dir = '/tmp';
+ OR dir = '/tmp/rudb_utl_file_regress';
INSERT INTO utl_file_dir (dirname, dir)
-VALUES ('UTL_TEST_DIR', '/tmp');
+VALUES ('UTL_TEST_DIR', '/tmp/rudb_utl_file_regress');
RESET client_min_messages;
END $$;
@@ -373,3 +374,4 @@
RAISE INFO 'utl_file_fremove => %', v_exists::text;
END $$;
INFO: utl_file_fremove => false
+\! rm -rf /tmp/rudb_utl_file_regress
diff --git a/src/test/regress/expected/utl_gdk.out b/src/test/regress/expected/utl_gdk.out
new file mode 100644
index 0000000..24d6a48
--- /dev/null
+++ b/src/test/regress/expected/utl_gdk.out
@@ -0,0 +1,243 @@
+-- CHARSET_MAP: Oracle <-> IANA.
+select utl_gdk_get_version() as package_version;
+ package_version
+-----------------
+ 1.0.0
+(1 row)
+
+select utl_gdk_oracle_charset_to_iana('AL32UTF8') as mapped_service;
+ mapped_service
+----------------
+ UTF-8
+(1 row)
+
+select utl_gdk_charset_map('AL32UTF8') as mapped;
+ mapped
+--------
+ UTF-8
+(1 row)
+
+select utl_gdk_charset_map('al32utf8') as mapped;
+ mapped
+--------
+ UTF-8
+(1 row)
+
+select utl_gdk_charset_map('AL16UTF16', 1) as mapped;
+ mapped
+----------
+ UTF-16BE
+(1 row)
+
+select utl_gdk_charset_map('UTF-16BE', 2) as mapped;
+ mapped
+-----------
+ AL16UTF16
+(1 row)
+
+select utl_gdk_charset_map('JA16SJIS', 1) as mapped;
+ mapped
+-----------
+ SHIFT_JIS
+(1 row)
+
+select utl_gdk_charset_map('shift_jis', 2) as mapped;
+ mapped
+----------
+ JA16SJIS
+(1 row)
+
+select utl_gdk_charset_map('WE8MSWIN1252', 1) as mapped;
+ mapped
+--------------
+ WINDOWS-1252
+(1 row)
+
+select utl_gdk_charset_map('windows-1252', 2) as mapped;
+ mapped
+--------------
+ WE8MSWIN1252
+(1 row)
+
+select utl_gdk_charset_map('AR8ADOS710', 1) is null as empty_oracle_charset_mapping_is_null;
+ empty_oracle_charset_mapping_is_null
+--------------------------------------
+ t
+(1 row)
+
+select utl_gdk_charset_map('UNKNOWN_CHARSET', 1) is null as unknown_charset_is_null;
+ unknown_charset_is_null
+-------------------------
+ t
+(1 row)
+
+select utl_gdk_charset_map('AL32UTF8', 999) is null as invalid_charset_flag_is_null;
+ invalid_charset_flag_is_null
+------------------------------
+ t
+(1 row)
+
+select utl_gdk_charset_map(NULL, 1) is null as null_charset_input_is_null;
+ null_charset_input_is_null
+----------------------------
+ t
+(1 row)
+
+select utl_gdk_charset_map('', 1) is null as empty_charset_input_is_null;
+ empty_charset_input_is_null
+-----------------------------
+ t
+(1 row)
+
+-- LANGUAGE_MAP: Oracle <-> ISO.
+select utl_gdk_language_map('AMERICAN') as mapped;
+ mapped
+--------
+ en
+(1 row)
+
+select utl_gdk_language_map('american') as mapped;
+ mapped
+--------
+ en
+(1 row)
+
+select utl_gdk_language_map('ENGLISH', 3) as mapped;
+ mapped
+--------
+ en
+(1 row)
+
+select utl_gdk_language_map('en', 4) as mapped;
+ mapped
+---------
+ ENGLISH
+(1 row)
+
+select utl_gdk_language_map('FR', 4) as mapped;
+ mapped
+--------
+ FRENCH
+(1 row)
+
+select utl_gdk_language_map('BENGALI', 3) as mapped;
+ mapped
+--------
+ bn
+(1 row)
+
+select utl_gdk_language_map('bn', 4) as mapped;
+ mapped
+--------
+ BANGLA
+(1 row)
+
+select utl_gdk_language_map('UNKNOWN_LANGUAGE', 3) is null as unknown_language_is_null;
+ unknown_language_is_null
+--------------------------
+ t
+(1 row)
+
+select utl_gdk_language_map('AMERICAN', 999) is null as invalid_language_flag_is_null;
+ invalid_language_flag_is_null
+-------------------------------
+ t
+(1 row)
+
+select utl_gdk_language_map(NULL, 3) is null as null_language_input_is_null;
+ null_language_input_is_null
+-----------------------------
+ t
+(1 row)
+
+select utl_gdk_language_map('', 3) is null as empty_language_input_is_null;
+ empty_language_input_is_null
+------------------------------
+ t
+(1 row)
+
+-- TERRITORY_MAP: Oracle <-> ISO alpha-2/alpha-3.
+select utl_gdk_territory_map('AMERICA') as mapped;
+ mapped
+--------
+ US
+(1 row)
+
+select utl_gdk_territory_map('america') as mapped;
+ mapped
+--------
+ US
+(1 row)
+
+select utl_gdk_territory_map('THE NETHERLANDS', 3) as mapped;
+ mapped
+--------
+ NL
+(1 row)
+
+select utl_gdk_territory_map('nl', 4) as mapped;
+ mapped
+-----------------
+ THE NETHERLANDS
+(1 row)
+
+select utl_gdk_territory_map('AMERICA', 5) as mapped;
+ mapped
+--------
+ USA
+(1 row)
+
+select utl_gdk_territory_map('USA', 6) as mapped;
+ mapped
+---------
+ AMERICA
+(1 row)
+
+select utl_gdk_territory_map('BOLIVIA', 5) as mapped;
+ mapped
+--------
+ BOB
+(1 row)
+
+select utl_gdk_territory_map('bob', 6) as mapped;
+ mapped
+---------
+ BOLIVIA
+(1 row)
+
+select utl_gdk_territory_map('AZERBAIJAN', 3) as mapped;
+ mapped
+--------
+ AZ
+(1 row)
+
+select utl_gdk_territory_map('AZERBAIJAN', 5) is null as empty_oracle_territory_a3_mapping_is_null;
+ empty_oracle_territory_a3_mapping_is_null
+-------------------------------------------
+ t
+(1 row)
+
+select utl_gdk_territory_map('UNKNOWN_TERRITORY', 3) is null as unknown_territory_is_null;
+ unknown_territory_is_null
+---------------------------
+ t
+(1 row)
+
+select utl_gdk_territory_map('AMERICA', 999) is null as invalid_territory_flag_is_null;
+ invalid_territory_flag_is_null
+--------------------------------
+ t
+(1 row)
+
+select utl_gdk_territory_map(NULL, 3) is null as null_territory_input_is_null;
+ null_territory_input_is_null
+------------------------------
+ t
+(1 row)
+
+select utl_gdk_territory_map('', 3) is null as empty_territory_input_is_null;
+ empty_territory_input_is_null
+-------------------------------
+ t
+(1 row)
+
diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule
index 1e65ef2..3f379ba 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -142,4 +142,7 @@
test: tablespace
# DBMS functions
-test: utl_compress utl_compress1 utl_raw utl_file utl_http utl_ref dbms_describe
+test: utl_compress utl_compress1 utl_raw utl_file utl_http utl_ref dbms_describe dbms_tns owa_cookie owa_cache dbms_warning dbms_trace dbms_system dbms_file_transfer dbms_sqlset dbms_stat_funcs htp htf owa_pattern
+test: dbms_json dbms_json_schema
+test: dbms_xmlstore dbms_xmlsave
+test: dbms_ddl
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index fc16b7b..0bac0ce 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -30,6 +30,7 @@
#include "executor/executor.h"
#include "executor/spi.h"
#include "funcapi.h"
+#include "lib/stringinfo.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/supportnodes.h"
@@ -80,6 +81,19 @@
static void regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
+typedef struct DbmsTraceDebugSnapshot
+{
+ bool enabled;
+ int32 trace_mask;
+ int64 active_run_id;
+ int64 next_run_id;
+ int64 next_event_seq;
+ int32 trace_rows_count;
+ char last_event_type[16];
+} DbmsTraceDebugSnapshot;
+
+extern void dbms_trace_get_debug_snapshot(DbmsTraceDebugSnapshot *out);
+
PG_MODULE_MAGIC_EXT(
.name = "regress",
.version = PG_VERSION
@@ -453,6 +467,7 @@
}
PG_FUNCTION_INFO_V1(regress_setenv);
+PG_FUNCTION_INFO_V1(regress_dbms_trace_snapshot);
Datum
regress_setenv(PG_FUNCTION_ARGS)
@@ -469,6 +484,28 @@
PG_RETURN_VOID();
}
+Datum
+regress_dbms_trace_snapshot(PG_FUNCTION_ARGS)
+{
+ DbmsTraceDebugSnapshot snap;
+ StringInfoData buf;
+
+ dbms_trace_get_debug_snapshot(&snap);
+
+ initStringInfo(&buf);
+ appendStringInfo(&buf,
+ "enabled=%s trace_mask=%d active_run_id=%lld next_run_id=%lld next_event_seq=%lld trace_rows_count=%d last_event_type=%s",
+ snap.enabled ? "true" : "false",
+ snap.trace_mask,
+ (long long) snap.active_run_id,
+ (long long) snap.next_run_id,
+ (long long) snap.next_event_seq,
+ snap.trace_rows_count,
+ snap.last_event_type[0] != '\0' ? snap.last_event_type : "none");
+
+ PG_RETURN_TEXT_P(cstring_to_text(buf.data));
+}
+
/* Sleep until no process has a given PID. */
PG_FUNCTION_INFO_V1(wait_pid);
diff --git a/src/test/regress/sql/dbms_db_version.sql b/src/test/regress/sql/dbms_db_version.sql
new file mode 100644
index 0000000..210807f
--- /dev/null
+++ b/src/test/regress/sql/dbms_db_version.sql
@@ -0,0 +1,37 @@
+-- DBMS_DB_VERSION regression coverage.
+-- no_package_constant_artifacts
+
+SELECT dbms_db_version_get_version() AS package_version;
+
+SELECT
+ dbms_db_version_version() AS version_value,
+ dbms_db_version_release() AS release_value,
+ dbms_db_version_ver_le(23, 0) AS service_ver_le_23_0,
+ dbms_db_version_ver_le(21, 0) AS service_ver_le_21_0,
+ dbms_db_version_ver_le_9_1() AS ver_le_9_1,
+ dbms_db_version_ver_le_9_2() AS ver_le_9_2,
+ dbms_db_version_ver_le_9() AS ver_le_9,
+ dbms_db_version_ver_le_10_1() AS ver_le_10_1,
+ dbms_db_version_ver_le_10_2() AS ver_le_10_2,
+ dbms_db_version_ver_le_10() AS ver_le_10,
+ dbms_db_version_ver_le_11_1() AS ver_le_11_1,
+ dbms_db_version_ver_le_11_2() AS ver_le_11_2,
+ dbms_db_version_ver_le_11() AS ver_le_11,
+ dbms_db_version_ver_le_12_1() AS ver_le_12_1,
+ dbms_db_version_ver_le_12_2() AS ver_le_12_2,
+ dbms_db_version_ver_le_12() AS ver_le_12,
+ dbms_db_version_ver_le_18() AS ver_le_18,
+ dbms_db_version_ver_le_19() AS ver_le_19,
+ dbms_db_version_ver_le_20() AS ver_le_20,
+ dbms_db_version_ver_le_21() AS ver_le_21,
+ dbms_db_version_ver_le_23() AS ver_le_23;
+
+SELECT proname, oid
+FROM pg_proc
+WHERE proname LIKE 'dbms_db_version_%'
+ORDER BY oid;
+
+SELECT count(*) = 20 AS package_functions_registered
+FROM pg_proc
+WHERE proname LIKE 'dbms_db_version_%'
+ AND prorettype IN ('int4'::regtype, 'bool'::regtype);
diff --git a/src/test/regress/sql/dbms_ddl.sql b/src/test/regress/sql/dbms_ddl.sql
new file mode 100644
index 0000000..3a2c821
--- /dev/null
+++ b/src/test/regress/sql/dbms_ddl.sql
@@ -0,0 +1,6 @@
+SELECT DBMS_DDL_WRAP($code$
+CREATE FUNCTION test() RETURNS INTEGER LANGUAGE plpgsql
+AS $$
+ RETURN 777;
+$$;
+$code$);
\ No newline at end of file
diff --git a/src/test/regress/sql/dbms_file_transfer.sql b/src/test/regress/sql/dbms_file_transfer.sql
new file mode 100644
index 0000000..deb193f
--- /dev/null
+++ b/src/test/regress/sql/dbms_file_transfer.sql
@@ -0,0 +1,69 @@
+-- DBMS_FILE_TRANSFER: минимальный smoke test локальных операций с файлами.
+-- Сценарий ограничен безопасной локальной файловой системой и не использует dblink.
+
+\! rm -rf /tmp/rudb_dbms_file_transfer_regress
+\! mkdir -p /tmp/rudb_dbms_file_transfer_regress/src /tmp/rudb_dbms_file_transfer_regress/dst
+\! python3 -c "from pathlib import Path; Path('/tmp/rudb_dbms_file_transfer_regress/src/source.bin').write_bytes(bytes(range(256)) * 2)"
+
+SELECT dbms_file_transfer_get_version() AS package_version;
+SELECT dbms_file_transfer_is_safe_filename('sample.txt') AS safe_filename_ok;
+SELECT dbms_file_transfer_is_safe_filename('../sample.txt') AS unsafe_filename_rejected;
+
+SELECT 'ok' AS result
+FROM (SELECT dbms_file_transfer_copy_file(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ '/tmp/rudb_dbms_file_transfer_regress/dst',
+ 'copied.bin'
+)) s;
+
+SELECT length(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/dst/copied.bin')) AS copied_len;
+
+SELECT encode(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/dst/copied.bin'), 'hex') =
+ encode(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/src/source.bin'), 'hex') AS copied_matches_source;
+
+SELECT encode(read_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ 0,
+ 16
+), 'hex') AS first_chunk_hex;
+
+SELECT encode(read_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ 510,
+ 8
+), 'hex') AS tail_chunk_hex;
+
+SELECT read_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/src',
+ 'source.bin',
+ 0,
+ 0
+) IS NULL AS zero_limit_is_null;
+
+SELECT 'ok' AS result
+FROM (SELECT write_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/dst',
+ 'written.bin',
+ decode('010203', 'hex'),
+ 0
+)) s;
+
+SELECT 'ok' AS result
+FROM (SELECT write_file_chunk(
+ '/tmp/rudb_dbms_file_transfer_regress/dst',
+ 'written.bin',
+ decode('0405', 'hex'),
+ 3
+)) s;
+
+SELECT encode(pg_read_binary_file('/tmp/rudb_dbms_file_transfer_regress/dst/written.bin'), 'hex') AS written_hex;
+
+SELECT 'ok' AS result
+FROM (SELECT pg_file_unlink_custom('/tmp/rudb_dbms_file_transfer_regress/dst/written.bin')) s;
+
+SELECT pg_stat_file('/tmp/rudb_dbms_file_transfer_regress/dst/written.bin', true) IS NULL AS written_removed;
+
+\! rm -rf /tmp/rudb_dbms_file_transfer_regress
diff --git a/src/test/regress/sql/dbms_jsno_get_veiw_sql.sql b/src/test/regress/sql/dbms_jsno_get_veiw_sql.sql
new file mode 100644
index 0000000..de7fd48
--- /dev/null
+++ b/src/test/regress/sql/dbms_jsno_get_veiw_sql.sql
@@ -0,0 +1,118 @@
+-- Тест 1: Элементарный тест (создание простого представления)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}';
+ v_res TEXT;
+ v_exp TEXT := 'CREATE OR REPLACE VIEW "HR"."V1" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"id" number path ''$.id'')JT';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql('V1', 'T1', 'J1', v_dg);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- Тест 2: Перегрузка с NULL (возвращает только SELECT)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}';
+ v_res TEXT;
+ v_exp TEXT := 'SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"id" number path ''$.id'')JT';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql(NULL, 'T1', 'J1', v_dg);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- Тест 3: Граничное условие (пустой набор узлов в Data Guide)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{}}';
+ v_res TEXT;
+ v_exp TEXT := '';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql('V_EMPTY', 'T1', 'J1', v_dg);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- Тест 4: Тест посложнее (несколько завершённых узлов)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"a":{"type":"number","o:length":4,"o:preferred_column_name":"a"},"b":{"type":"string","o:length":10,"o:preferred_column_name":"b"}}}';
+ v_res TEXT;
+ v_exp TEXT := 'CREATE OR REPLACE VIEW "HR"."V_MULTI" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"a" number path ''$.a'',
+"b" varchar2(10) path ''$.b'')JT';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql('V_MULTI', 'T1', 'J1', v_dg);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- Тест 5: Параметр path (вложенный путь)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"info":{"type":"object","properties":{"val":{"type":"number","o:length":4,"o:preferred_column_name":"val"}}}}}';
+ v_res TEXT;
+ v_exp TEXT := 'CREATE OR REPLACE VIEW "HR"."V_PATH" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$.info[*]'' COLUMNS
+"val" number path ''$.val'')JT';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql('V_PATH', 'T1', 'J1', v_dg, path => '$.info');
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- Тест 6: Материализованное представление (materialize => TRUE)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}';
+ v_res TEXT;
+ v_exp TEXT := 'CREATE MATERIALIZED VIEW "HR"."V_MV"BUILD IMMEDIATE REFRESH FAST ON STATEMENT WITH ROWID
+AS SELECT RT."ROWID" ROW_ID, JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"id" number path ''$.id'')JT';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql('V_MV', 'T1', 'J1', v_dg, materialize => true);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- Тест 7: Исключение при ошибке логики (конфликт имен)
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"f1":{"type":"number","o:length":4,"o:preferred_column_name":"col"},"f2":{"type":"number","o:length":4,"o:preferred_column_name":"col"}}}';
+ v_res TEXT;
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ v_res := dbms_json_get_view_sql('V_ERR', 'T1', 'J1', v_dg, resolvenameconflicts => false);
+ RAISE NOTICE 'Actual: %', v_res;
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ -- SQLSTATE 42701 (пример кода ошибки дублирования в PG)
+END $$;
+
+-- Тест 8: Параметр colnameprefix
+DO $$
+DECLARE
+ v_dg TEXT := '{"type":"object","properties":{"item":{"type":"number","o:length":4,"o:preferred_column_name":"item"}}}';
+ v_res TEXT;
+ v_exp TEXT := 'CREATE OR REPLACE VIEW "HR"."V_PRE" AS SELECT JT.*
+FROM "HR"."T1" RT,
+JSON_TABLE("J1", ''$[*]'' COLUMNS
+"P_item" number path ''$.item'')JT';
+BEGIN
+ RAISE NOTICE 'Expected: %', v_exp;
+ v_res := dbms_json_get_view_sql('V_PRE', 'T1', 'J1', v_dg, colnameprefix => 'P_');
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
diff --git a/src/test/regress/sql/dbms_json.sql b/src/test/regress/sql/dbms_json.sql
new file mode 100644
index 0000000..a318c94
--- /dev/null
+++ b/src/test/regress/sql/dbms_json.sql
@@ -0,0 +1,225 @@
+SET client_min_messages = warning;
+
+-- DBMS_JSON.BUILD_DATAGUIDE
+SELECT EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(dbms_json_build_dataguide('{"id": 10, "name": "alice"}'::jsonb)) elem
+ WHERE elem->>'path' = '$.id' AND elem->>'type' = 'number'
+) AS has_id_path,
+EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(dbms_json_build_dataguide('{"id": 10, "name": "alice"}'::jsonb)) elem
+ WHERE elem->>'path' = '$.name' AND elem->>'type' = 'string'
+) AS has_name_path;
+
+SELECT EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(dbms_json_build_dataguide('{"info": {"score": 42}}'::jsonb)) elem
+ WHERE elem->>'path' = '$.info.score'
+) AS has_nested_score_path;
+
+SELECT dbms_json_build_dataguide('[1,2,3]'::jsonb);
+
+-- DBMS_JSON.GET_INDEX_DATAGUIDE and RENAME_COLUMN metadata
+DROP TABLE IF EXISTS dbms_json_metadata;
+DROP TABLE IF EXISTS t_json_guide;
+
+CREATE TABLE t_json_guide
+(
+ j1 jsonb
+);
+
+INSERT INTO t_json_guide
+VALUES ('{"id": 10, "name": "alice"}'),
+ ('{"id": 20, "name": "bob"}');
+
+SELECT dbms_json_get_index_dataguide('t_json_guide', 'j1', 1) LIKE '%$.id%' AS has_id,
+ dbms_json_get_index_dataguide('t_json_guide', 'j1', 1) LIKE '%$.name%' AS has_name;
+
+SELECT dbms_json_rename_column('t_json_guide', 'j1', '$.name', 2, 'preferred_name');
+SELECT dbms_json_get_index_dataguide('t_json_guide', 'j1', 1) LIKE '%preferred_name%' AS has_preferred_name;
+SELECT position(E'\n' in dbms_json_get_index_dataguide('t_json_guide', 'j1', 1, 1)::text) > 0 AS pretty_has_newline;
+SELECT dbms_json_get_index_dataguide('t_json_guide', 'j1', 99);
+
+-- DBMS_JSON.GET_VIEW_SQL
+DROP SCHEMA IF EXISTS "HR" CASCADE;
+CREATE SCHEMA "HR";
+SET search_path TO "HR", public;
+CREATE TABLE "HR"."T1" ("J1" jsonb);
+INSERT INTO "HR"."T1"("J1") VALUES ('{"id":1,"a":10,"b":"txt","info":[{"val":5}]}'::jsonb);
+
+SELECT dbms_json_get_view_sql('V1', 'T1', 'J1',
+ '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}') LIKE
+ 'CREATE OR REPLACE VIEW "HR".v1 AS SELECT JT.%JSON_TABLE%' AS get_view_sql_has_create;
+
+SELECT dbms_json_get_view_sql(NULL, 'T1', 'J1',
+ '{"type":"object","properties":{"id":{"type":"number","o:length":4,"o:preferred_column_name":"id"}}}') LIKE
+ 'SELECT JT.%JSON_TABLE%' AS get_view_sql_select_only;
+
+SELECT dbms_json_get_view_sql('V_EMPTY', 'T1', 'J1',
+ '{"type":"object","properties":{}}') = '' AS get_view_sql_empty;
+
+SELECT dbms_json_get_view_sql('V_ERR', 'T1', 'J1',
+ '{"type":"object","properties":{"f1":{"type":"number","o:length":4,"o:preferred_column_name":"col"},"f2":{"type":"number","o:length":4,"o:preferred_column_name":"col"}}}',
+ resolvenameconflicts => false);
+
+RESET search_path;
+DROP SCHEMA "HR" CASCADE;
+
+-- DBMS_JSON.CREATE_VIEW and CREATE_VIEW_ON_PATH
+DROP VIEW IF EXISTS v_json_simple;
+DROP VIEW IF EXISTS v_json_path_auto;
+DROP VIEW IF EXISTS v_json_path_renamed;
+DROP VIEW IF EXISTS customer_profile_view;
+DROP TABLE IF EXISTS t_json_view;
+DROP TABLE IF EXISTS t_json_path;
+DROP TABLE IF EXISTS customers;
+DROP TABLE IF EXISTS dbms_json_metadata;
+
+CREATE TABLE t_json_view
+(
+ j1 jsonb
+);
+
+INSERT INTO t_json_view
+VALUES ('{"id": 10, "name": "alice", "info": {"score": 42}}');
+
+SELECT dbms_json_create_view(
+ 'v_json_simple',
+ 't_json_view',
+ 'j1',
+ '[{"path":"$.id","type":"number","column":"id"},{"path":"$.name","type":"string","column":"name"}]'::jsonb
+);
+SELECT to_regclass('v_json_simple') AS created_view;
+TABLE v_json_simple;
+
+CREATE TABLE customers
+(
+ customer_json jsonb
+);
+
+INSERT INTO customers
+VALUES ('{"customer": {"id": 101, "name": "Alice", "city": "Moscow"}}');
+
+SELECT dbms_json_create_view(
+ 'customer_profile_view',
+ 'customers',
+ 'customer_json',
+ '[{"path":"$.customer.id","type":"number","column":"customer_id"},
+ {"path":"$.customer.name","type":"string","column":"customer_name"},
+ {"path":"$.customer.city","type":"string","column":"customer_city"}]'::jsonb,
+ path => '$.customer'
+);
+TABLE customer_profile_view;
+
+CREATE TABLE t_json_path
+(
+ j1 jsonb
+);
+
+INSERT INTO t_json_path
+VALUES ('{"info": {"score": 42, "label": "gold"}}');
+
+SELECT dbms_json_create_view_on_path('v_json_path_auto', 't_json_path', 'j1', '$.info');
+TABLE v_json_path_auto;
+
+SELECT dbms_json_rename_column('t_json_path', 'j1', '$.info.label', 2, 'preferred_label');
+SELECT dbms_json_create_view_on_path('v_json_path_renamed', 't_json_path', 'j1', '$.info');
+SELECT column_name
+FROM information_schema.columns
+WHERE table_name = 'v_json_path_renamed'
+ORDER BY ordinal_position;
+TABLE v_json_path_renamed;
+
+SELECT dbms_json_create_view('v_json_bad_resource', 't_json_view', 'j1',
+ '[{"path":"$.id","type":"number","column":"id"}]'::jsonb,
+ '/tmp/resource');
+SELECT dbms_json_create_view2(
+ 'v_json_service',
+ 't_json_view',
+ 'j1',
+ '[{"path":"$.id","type":"number","column":"id"},{"path":"$.name","type":"string","column":"name"}]'::jsonb,
+ NULL::varchar2,
+ false,
+ 1,
+ '$'::varchar2,
+ true,
+ NULL::varchar2,
+ false,
+ 0::int4
+);
+SELECT to_regclass('v_json_service') AS created_service_view;
+TABLE v_json_service;
+SELECT dbms_json_create_view_on_path('v_json_path_freq', 't_json_path', 'j1', '$.info', 1);
+SELECT dbms_json_create_view_on_path('v_json_path_empty', 't_json_path', 'j1', '$.missing');
+
+-- DBMS_JSON.ADD_VIRTUAL_COLUMNS and DROP_VIRTUAL_COLUMNS
+DROP TABLE IF EXISTS t_json_vc;
+CREATE TABLE t_json_vc
+(
+ j1 jsonb
+);
+
+INSERT INTO t_json_vc
+VALUES ('{"id": 10, "name": "alice"}');
+
+SELECT dbms_json_add_virtual_columns(
+ 't_json_vc',
+ 'j1',
+ '[{"path":"$.id","type":"number","column":"id"},{"path":"$.name","type":"string","column":"name"}]'::jsonb
+);
+SELECT column_name
+FROM information_schema.columns
+WHERE table_name = 't_json_vc'
+ORDER BY ordinal_position;
+TABLE t_json_vc;
+
+SELECT dbms_json_drop_virtual_columns('t_json_vc', 'j1');
+SELECT column_name
+FROM information_schema.columns
+WHERE table_name = 't_json_vc'
+ORDER BY ordinal_position;
+SELECT dbms_json_add_virtual_columns(
+ 't_json_vc',
+ 'j1',
+ '[{"path":"$.a","type":"number","column":"dup"},{"path":"$.b","type":"number","column":"dup"}]'::jsonb,
+ false
+);
+
+-- DBMS_JSON.JSON_TYPE_CONVERTIBLE_CHECK
+DROP TABLE IF EXISTS status_json_check;
+DROP TABLE IF EXISTS t_json_convert;
+
+CREATE TABLE t_json_convert
+(
+ j1 jsonb
+);
+
+INSERT INTO t_json_convert
+VALUES ('{"id": 10}'),
+ ('{"id": 20}'),
+ (NULL);
+
+SELECT dbms_json_json_type_convertible_check('public', 't_json_convert', 'j1', 'status_json_check');
+SELECT to_regclass('public.status_json_check') AS created_status_table;
+SELECT count(*) AS checked_rows, bool_and(is_convertible) AS all_convertible
+FROM status_json_check;
+
+SELECT dbms_json_json_type_convertible_check('public', 't_json_convert', 'j1', 'status_json_check', false, true);
+SELECT count(*) AS checked_rows_after_append
+FROM status_json_check;
+
+-- Cleanup
+DROP VIEW IF EXISTS v_json_simple;
+DROP VIEW IF EXISTS v_json_service;
+DROP VIEW IF EXISTS v_json_path_auto;
+DROP VIEW IF EXISTS v_json_path_renamed;
+DROP VIEW IF EXISTS customer_profile_view;
+DROP TABLE IF EXISTS t_json_view;
+DROP TABLE IF EXISTS t_json_path;
+DROP TABLE IF EXISTS customers;
+DROP TABLE IF EXISTS t_json_guide;
+DROP TABLE IF EXISTS t_json_vc;
+DROP TABLE IF EXISTS t_json_convert;
+DROP TABLE IF EXISTS status_json_check;
+DROP TABLE IF EXISTS dbms_json_metadata;
diff --git a/src/test/regress/sql/dbms_json_schema.sql b/src/test/regress/sql/dbms_json_schema.sql
new file mode 100644
index 0000000..df00af7
--- /dev/null
+++ b/src/test/regress/sql/dbms_json_schema.sql
@@ -0,0 +1,63 @@
+SET client_min_messages = warning;
+
+-- DBMS_JSON_SCHEMA.IS_SCHEMA_VALID
+SELECT dbms_json_schema_is_schema_valid('{"type": "string"}'::jsonb) AS valid_schema;
+SELECT dbms_json_schema_is_schema_valid('{"type": "invalid_type_name"}'::jsonb) AS invalid_schema;
+SELECT dbms_json_schema_is_schema_valid('{
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {"type": "integer"},
+ "name": {"type": "string"}
+ },
+ "required": ["id"]
+ }
+ }
+}'::jsonb) AS nested_schema_valid;
+SELECT dbms_json_schema_is_schema_valid2('{"type":"string"}'::jsonb, 0::int4) AS valid_schema_ext;
+SELECT dbms_json_schema_is_schema_valid(NULL::jsonb);
+SELECT dbms_json_schema_is_schema_valid('{ "wrong" : }'::jsonb);
+
+-- DBMS_JSON_SCHEMA.IS_VALID
+SELECT dbms_json_schema_is_valid(
+ '{"a": 1}'::jsonb,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::jsonb
+) AS data_valid;
+
+SELECT dbms_json_schema_is_valid(
+ '{"a": "str"}'::jsonb,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::jsonb
+) AS data_invalid;
+
+SELECT dbms_json_schema_is_valid(
+ '{"a": "str"}'::jsonb,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::jsonb,
+ 1
+);
+
+-- DBMS_JSON_SCHEMA.VALIDATE_REPORT varchar2 overload
+SELECT (dbms_json_schema_validate_report(
+ '{"a": 1}'::varchar2,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::varchar2
+)::jsonb)->>'valid' AS varchar_report_valid;
+
+SELECT ((dbms_json_schema_validate_report(
+ '{"a": "str"}'::varchar2,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::varchar2
+)::jsonb)->>'valid') AS varchar_report_valid,
+jsonb_array_length((dbms_json_schema_validate_report(
+ '{"a": "str"}'::varchar2,
+ '{"type": "object", "properties": {"a": {"type": "number"}}}'::varchar2
+)::jsonb)->'errors') > 0 AS varchar_report_has_errors;
+
+-- DBMS_JSON_SCHEMA.VALIDATE_REPORT jsonb overload
+SELECT (dbms_json_schema_validate_report(
+ '{"name":"Test"}'::jsonb,
+ '{"type":"object","required":["name"]}'::jsonb
+)::jsonb)->>'valid' AS jsonb_report_valid;
+
+SELECT dbms_json_schema_validate_report(NULL::varchar2, NULL::varchar2) IS NULL AS null_report_is_null;
+SELECT dbms_json_schema_validate_report('{invalid_json}'::varchar2, '{"type":"object"}'::varchar2);
+SELECT dbms_json_schema_validate_report('{"a":1}'::varchar2, '{"type": "object", "properties": { invalid } }'::varchar2);
diff --git a/src/test/regress/sql/dbms_sqlset.sql b/src/test/regress/sql/dbms_sqlset.sql
new file mode 100644
index 0000000..f3a5848
--- /dev/null
+++ b/src/test/regress/sql/dbms_sqlset.sql
@@ -0,0 +1,468 @@
+-- DBMS_SQLSET regression coverage.
+-- no_package_constant_artifacts
+
+SELECT dbms_sqlset_get_version() AS package_version;
+
+SELECT
+ dbms_sqlset_mode_replace_old_stats() AS mode_replace_old_stats,
+ dbms_sqlset_mode_accumulate_stats() AS mode_accumulate_stats,
+ dbms_sqlset_has_recursive_sql() AS has_recursive_sql,
+ dbms_sqlset_no_recursive_sql() AS no_recursive_sql,
+ dbms_sqlset_single_execution() AS single_execution,
+ dbms_sqlset_all_executions() AS all_executions,
+ dbms_sqlset_limited_command_type() AS limited_command_type,
+ dbms_sqlset_all_command_type() AS all_command_type,
+ dbms_sqlset_sts_stgtab_10_2_version() AS sts_stgtab_10_2_version,
+ dbms_sqlset_sts_stgtab_11_1_version() AS sts_stgtab_11_1_version,
+ dbms_sqlset_sts_stgtab_11_2_version() AS sts_stgtab_11_2_version,
+ dbms_sqlset_sts_stgtab_12_1_version() AS sts_stgtab_12_1_version,
+ dbms_sqlset_sts_stgtab_12_2_version() AS sts_stgtab_12_2_version;
+
+SELECT dbms_sqlset_normalize_attribute_list(NULL) AS normalized_attribute_list_default;
+SELECT dbms_sqlset_normalize_attribute_list('basic') AS normalized_attribute_list_basic;
+
+SELECT proname, oid
+FROM pg_proc
+WHERE proname IN (
+ 'dbms_sqlset_mode_replace_old_stats',
+ 'dbms_sqlset_mode_accumulate_stats',
+ 'dbms_sqlset_has_recursive_sql',
+ 'dbms_sqlset_no_recursive_sql',
+ 'dbms_sqlset_single_execution',
+ 'dbms_sqlset_all_executions',
+ 'dbms_sqlset_limited_command_type',
+ 'dbms_sqlset_all_command_type',
+ 'dbms_sqlset_sts_stgtab_10_2_version',
+ 'dbms_sqlset_sts_stgtab_11_1_version',
+ 'dbms_sqlset_sts_stgtab_11_2_version',
+ 'dbms_sqlset_sts_stgtab_12_1_version',
+ 'dbms_sqlset_sts_stgtab_12_2_version'
+)
+ORDER BY oid;
+
+SELECT count(*) = 13 AS package_constants_registered
+FROM pg_proc
+WHERE proname LIKE 'dbms_sqlset_%'
+ AND proargtypes = ''::oidvector
+ AND prorettype IN ('int4'::regtype, 'varchar2'::regtype);
+
+SELECT proname, oidvectortypes(proargtypes) AS argtypes
+FROM pg_proc
+WHERE proname IN (
+ 'dbms_sqlset_load_sqlset',
+ 'dbms_sqlset_select_sqlset',
+ 'dbms_sqlset_select_cursor_cache',
+ 'dbms_sqlset_select_sql_trace',
+ 'dbms_sqlset_select_workload_repository',
+ 'dbms_sqlset_capture_cursor_cache',
+ 'dbms_sqlset_create_stgtab',
+ 'dbms_sqlset_drop_sqlset_by_prefix',
+ 'dbms_sqlset_pack_stgtab',
+ 'dbms_sqlset_remap_stgtab',
+ 'dbms_sqlset_remove_reference',
+ 'dbms_sqlset_update_sqlset_0',
+ 'dbms_sqlset_update_sqlset_1',
+ 'dbms_sqlset_update_sqlset_2'
+)
+ORDER BY proname, argtypes;
+
+CALL dbms_sqlset_drop_sqlset(NULL, NULL);
+CALL dbms_sqlset_drop_sqlset('sts_missing', NULL);
+
+SELECT dbms_sqlset_create_sqlset_0('sts_load', 'load test');
+SELECT dbms_sqlset_create_sqlset_0('sts_empty');
+SELECT dbms_sqlset_create_sqlset_0() LIKE 'STS_%' AS generated_name;
+CALL dbms_sqlset_create_sqlset_1('sts_proc');
+CALL dbms_sqlset_create_sqlset_1('sts_proc');
+SELECT dbms_sqlset_create_sqlset_0('sts_load', NULL, NULL);
+SELECT dbms_sqlset_create_sqlset_0('sts_owner', NULL, 'dbms_sqlset_non_current_owner_' || current_user);
+CALL dbms_sqlset_drop_sqlset('sts_load', 'dbms_sqlset_non_current_owner_' || current_user);
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', NULL, NULL, true, NULL, 'dbms_sqlset_non_current_owner_' || current_user);
+-- SELECT_SQLSET rejects explicit non-current owner.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, 'dbms_sqlset_non_current_owner_' || current_user, NULL);
+
+SELECT count(*) AS empty_rows
+FROM dbms_sqlset_select_sqlset('sts_empty');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, 'orig'),
+ ('sql2', 222, 'select 2', 'module2', 'action2', 11, 21, 31, 41, 51, 1, 'row2')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'accumulate');
+ CLOSE c;
+END
+$$;
+
+SELECT count(*) AS load_rows,
+ max(CASE WHEN sql_id = 'sql1' THEN module END) AS sql1_module,
+ max(CASE WHEN sql_id = 'sql1' THEN action END) AS sql1_action,
+ max(CASE WHEN sql_id = 'sql1' THEN sql_text END) AS sql1_sql_text,
+ max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time,
+ max(CASE WHEN sql_id = 'sql1' THEN buffer_gets END) AS sql1_buffer_gets,
+ max(CASE WHEN sql_id = 'sql1' THEN disk_reads END) AS sql1_disk_reads,
+ max(CASE WHEN sql_id = 'sql1' THEN rows_processed END) AS sql1_rows_processed,
+ max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, 'orig'),
+ ('sql2', 222, 'select 2', 'module2', 'action2', 11, 21, 31, 41, 51, 1, 'row2')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c);
+ CLOSE c;
+END
+$$;
+
+SELECT count(*) AS duplicate_insert_rows
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select changed', 'module_changed', 'action_changed', 100, 200, 300, 400, 500, 20, 'replace')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge');
+ CLOSE c;
+END
+$$;
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN module END) AS sql1_module_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN action END) AS sql1_action_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN sql_text END) AS sql1_sql_text_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN buffer_gets END) AS sql1_buffer_gets_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN disk_reads END) AS sql1_disk_reads_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN rows_processed END) AS sql1_rows_processed_after_replace,
+ max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_after_replace
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql3', 333, 'select 3', 'module3', 'action3', 12, 22, 32, 42, 52, 1, 'row3')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'update');
+ CLOSE c;
+END
+$$;
+
+SELECT count(*) AS update_missing_rows
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql3', 333, 'select 3', 'module3', 'action3', 12, 22, 32, 42, 52, 1, 'row3')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge');
+ CLOSE c;
+END
+$$;
+
+SELECT count(*) AS merge_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'BASIC', NULL, NULL, NULL);
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_basic_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_basic_elapsed_time
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'BASIC', NULL, NULL, NULL);
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_typical_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_typical_elapsed_time
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, NULL)
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge');
+ CLOSE c;
+END
+$$;
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_preserved
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 10, 20, 30, 40, 50, 2, NULL)
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', NULL, NULL, false);
+ CLOSE c;
+END
+$$;
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_cleared
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select 1', 'module1', 'action1', 1, 2, 3, 4, 5, 3, NULL)
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'accumulate');
+ CLOSE c;
+END
+$$;
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time,
+ max(CASE WHEN sql_id = 'sql1' THEN buffer_gets END) AS sql1_buffer_gets,
+ max(CASE WHEN sql_id = 'sql1' THEN disk_reads END) AS sql1_disk_reads,
+ max(CASE WHEN sql_id = 'sql1' THEN rows_processed END) AS sql1_rows_processed,
+ max(CASE WHEN sql_id = 'sql1' THEN other END) AS sql1_other_after_accumulate
+FROM dbms_sqlset_select_sqlset('sts_load');
+
+SELECT count(*) AS limit_zero_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, 1, 0);
+
+SELECT count(*) AS empty_string_rows
+FROM dbms_sqlset_select_sqlset('sts_load', '', '', '', '', '', 1, 1, '', '', '', dbms_sqlset_has_recursive_sql());
+
+SELECT count(*) AS has_recursive_sql_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 1, 'TYPICAL', NULL, NULL, 'HAS_RECURSIVE_SQL');
+
+SELECT count(*) AS named_record_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 1, 'TYPICAL', NULL, NULL, dbms_sqlset_has_recursive_sql());
+
+-- SELECT_SQLSET accepts numeric args without quotes.
+SELECT count(*) AS numeric_args_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, 1, 1, 'TYPICAL', NULL, NULL, NULL);
+
+-- LOAD_SQLSET accepts empty update_condition and update_attributes.
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sql1', 111, 'select empty options', 'module_empty', 'action_empty', 101, 202, 303, 404, 505, 21, 'empty_opts')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ other
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', '', '', true, NULL, NULL);
+ CLOSE c;
+END
+$$;
+
+SELECT max(CASE WHEN sql_id = 'sql1' THEN executions END) AS sql1_executions_after_empty_options,
+ max(CASE WHEN sql_id = 'sql1' THEN elapsed_time END) AS sql1_elapsed_time_after_empty_options,
+ max(CASE WHEN sql_id = 'sql1' THEN cpu_time END) AS sql1_cpu_time_after_empty_options
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'bad', 'replace', NULL, NULL, true, NULL, NULL);
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'bad', NULL, NULL, true, NULL, NULL);
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', 'new.executions > old.executions', NULL, true, NULL, NULL);
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', NULL, 'executions', true, NULL, NULL);
+CALL dbms_sqlset_load_sqlset('sts_load', NULL, 'insert', 'replace', NULL, NULL, true, 1.5, NULL);
+
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_missing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', 'x', NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, 'x', NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, 'x', NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, 2, NULL, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 1.5, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, 9223372036854775808, 'TYPICAL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ALL', NULL, NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', 'x', NULL, NULL);
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, dbms_sqlset_no_recursive_sql());
+-- SELECT_SQLSET rejects NO_RECURSIVE_SQL literal.
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, 'NO_RECURSIVE_SQL');
+SELECT count(*) FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, -1, 'TYPICAL', NULL, NULL, NULL);
+
+DO $$
+DECLARE
+ c refcursor;
+BEGIN
+ OPEN c FOR
+ SELECT *
+ FROM (VALUES
+ ('sqlx', 999, 'select x', 'modulex', 'actionx', 1, 1, 1, 1, 1, 1, 'complex')
+ ) AS v(
+ sql_id,
+ plan_hash_value,
+ sql_text,
+ module,
+ action,
+ elapsed_time,
+ cpu_time,
+ buffer_gets,
+ disk_reads,
+ rows_processed,
+ executions,
+ object_list
+ );
+ CALL dbms_sqlset_load_sqlset('sts_load', c, 'merge', 'replace', NULL, NULL, true, NULL, NULL);
+ CLOSE c;
+END
+$$;
+
+SELECT count(*) AS final_named_record_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, dbms_sqlset_has_recursive_sql());
+
+SELECT dbms_sqlset_add_reference(NULL, NULL, NULL);
+
+SELECT count(*) AS final_rows
+FROM dbms_sqlset_select_sqlset('sts_load', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TYPICAL', NULL, NULL, NULL);
+
+CALL dbms_sqlset_drop_sqlset('sts_empty', NULL);
+CALL dbms_sqlset_drop_sqlset('sts_load', NULL);
+CALL dbms_sqlset_drop_sqlset('sts_proc', NULL);
diff --git a/src/test/regress/sql/dbms_stat_funcs.sql b/src/test/regress/sql/dbms_stat_funcs.sql
new file mode 100644
index 0000000..a6ddb17
--- /dev/null
+++ b/src/test/regress/sql/dbms_stat_funcs.sql
@@ -0,0 +1,689 @@
+\pset format unaligned
+\pset tuples_only on
+\set ON_ERROR_STOP on
+
+SET client_min_messages TO warning;
+
+SELECT dbms_stat_funcs_get_version() AS package_version;
+SELECT round(dbms_stat_funcs_ks_pvalue(0.1::float8, 20)::numeric, 12) AS ks_pvalue_smoke;
+
+-- Общий setup: тестовые таблицы для DBMS_STAT_FUNCS regression.
+-- Числовые наборы основаны на Oracle evidence; значения не менять без новой проверки.
+DROP TABLE IF EXISTS dbms_stat_funcs_fit_data;
+DROP TABLE IF EXISTS dbms_stat_funcs_empty_numeric;
+DROP TABLE IF EXISTS dbms_stat_funcs_all_null_numeric;
+DROP TABLE IF EXISTS dbms_stat_funcs_small_numeric;
+DROP TABLE IF EXISTS dbms_stat_funcs_normal_constant;
+DROP TABLE IF EXISTS dbms_stat_funcs_poisson_integer;
+DROP TABLE IF EXISTS dbms_stat_funcs_poisson_fractional;
+DROP TABLE IF EXISTS dbms_stat_funcs_poisson_negative;
+DROP TABLE IF EXISTS dbms_stat_funcs_weibull_below_mu;
+DROP TABLE IF EXISTS dbms_stat_funcs_summary_outliers;
+DROP TABLE IF EXISTS dbms_stat_funcs_non_numeric_text;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_data;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_empty;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_all_null;
+DROP TABLE IF EXISTS dbms_stat_funcs_uniform_boundary_data;
+
+CREATE TABLE dbms_stat_funcs_fit_data AS
+SELECT
+ gs AS id,
+ CASE WHEN gs <= 12 THEN round(((power(1.35::numeric, gs) - 1) / 2)::numeric, 4) END AS exp_val,
+ CASE WHEN gs <= 12 THEN round(((gs - 6.5) / 2)::numeric, 2) END AS normal_val,
+ CASE WHEN gs <= 16 THEN mod(gs + 2, 6)::numeric END AS poisson_val,
+ CASE WHEN gs <= 19 THEN gs::numeric / 20 END AS uniform_val,
+ mod(gs - 1, 5) + 1 AS uniform_disc_val,
+ CASE gs
+ WHEN 1 THEN 0.743105016956::numeric
+ WHEN 2 THEN 1.091435259916::numeric
+ WHEN 3 THEN 1.320284714299::numeric
+ WHEN 4 THEN 1.510484082144::numeric
+ WHEN 5 THEN 1.684835840746::numeric
+ WHEN 6 THEN 1.855480371447::numeric
+ WHEN 7 THEN 2.032677918568::numeric
+ WHEN 8 THEN 2.230052810922::numeric
+ WHEN 9 THEN 2.475872419937::numeric
+ WHEN 10 THEN 2.883130685581::numeric
+ END AS weibull_val,
+ CASE WHEN gs <= 10 THEN gs::numeric END AS summary_val,
+ CASE gs
+ WHEN 1 THEN 1::numeric
+ WHEN 2 THEN 1::numeric
+ WHEN 3 THEN 2::numeric
+ WHEN 4 THEN 2::numeric
+ WHEN 5 THEN 3::numeric
+ WHEN 6 THEN 4::numeric
+ WHEN 7 THEN 4::numeric
+ WHEN 8 THEN 4::numeric
+ WHEN 9 THEN 5::numeric
+ WHEN 10 THEN 6::numeric
+ WHEN 11 THEN 6::numeric
+ WHEN 12 THEN 6::numeric
+ WHEN 13 THEN 7::numeric
+ WHEN 14 THEN 8::numeric
+ WHEN 15 THEN 8::numeric
+ WHEN 16 THEN 9::numeric
+ WHEN 17 THEN 9::numeric
+ WHEN 18 THEN 9::numeric
+ WHEN 19 THEN 10::numeric
+ WHEN 20 THEN 10::numeric
+ END AS dupes_val,
+ CASE WHEN mod(gs, 2) = 0 THEN gs::numeric END AS nullable_val,
+ 'text-' || gs::text AS text_val
+FROM generate_series(1, 20) AS gs;
+
+CREATE TABLE dbms_stat_funcs_empty_numeric AS
+SELECT CAST(NULL AS numeric) AS x
+WHERE FALSE;
+
+CREATE TABLE dbms_stat_funcs_all_null_numeric AS
+SELECT gs AS id, CAST(NULL AS numeric) AS x
+FROM generate_series(1, 5) AS gs;
+
+CREATE TABLE dbms_stat_funcs_small_numeric AS
+SELECT *
+FROM (VALUES (1, 10::numeric), (2, 20::numeric)) AS t(id, x);
+
+CREATE TABLE dbms_stat_funcs_summary_outliers AS
+SELECT *
+FROM (
+ VALUES
+ (1, -50::numeric),
+ (2, 1::numeric),
+ (3, 2::numeric),
+ (4, 3::numeric),
+ (5, 4::numeric),
+ (6, 5::numeric),
+ (7, 6::numeric),
+ (8, 7::numeric),
+ (9, 8::numeric),
+ (10, 9::numeric),
+ (11, 10::numeric),
+ (12, 100::numeric)
+) AS t(id, x);
+
+CREATE TABLE dbms_stat_funcs_normal_constant AS
+SELECT gs AS id, 5::numeric AS x
+FROM generate_series(1, 10) AS gs;
+
+CREATE TABLE dbms_stat_funcs_poisson_integer AS
+SELECT row_number() OVER () AS id, x
+FROM (
+ VALUES
+ (0::numeric),
+ (0::numeric),
+ (1::numeric),
+ (1::numeric),
+ (1::numeric),
+ (2::numeric),
+ (2::numeric),
+ (2::numeric),
+ (3::numeric),
+ (4::numeric)
+) AS t(x);
+
+CREATE TABLE dbms_stat_funcs_poisson_fractional AS
+SELECT *
+FROM (
+ VALUES
+ (1, 0.5::numeric),
+ (2, 1.2::numeric),
+ (3, 2.7::numeric),
+ (4, 3.1::numeric),
+ (5, 4.8::numeric),
+ (6, 5.5::numeric)
+) AS t(id, x);
+
+CREATE TABLE dbms_stat_funcs_poisson_negative AS
+SELECT *
+FROM (
+ VALUES
+ (1, -2::numeric),
+ (2, -1::numeric),
+ (3, 0::numeric),
+ (4, 1::numeric),
+ (5, 2::numeric),
+ (6, 3::numeric)
+) AS t(id, x);
+
+CREATE TABLE dbms_stat_funcs_weibull_below_mu AS
+SELECT *
+FROM (
+ VALUES
+ (1, 0.25::numeric),
+ (2, 0.75::numeric),
+ (3, 1.25::numeric),
+ (4, 1.75::numeric)
+) AS t(id, x);
+
+CREATE TABLE dbms_stat_funcs_non_numeric_text AS
+SELECT *
+FROM (VALUES (1, 'text-1'::text), (2, 'text-2'::text)) AS t(id, x);
+
+CREATE TABLE dbms_stat_funcs_uniform_data (
+ id int,
+ uniform_val numeric,
+ uniform_disc_val numeric,
+ text_val text
+);
+
+INSERT INTO dbms_stat_funcs_uniform_data
+SELECT
+ gs,
+ CASE WHEN gs <= 19 THEN gs::numeric / 20 END,
+ mod(gs - 1, 5) + 1,
+ 'text-' || gs::text
+FROM generate_series(1, 20) AS gs;
+
+CREATE TABLE dbms_stat_funcs_uniform_empty (
+ x numeric
+);
+
+CREATE TABLE dbms_stat_funcs_uniform_all_null (
+ x numeric
+);
+
+INSERT INTO dbms_stat_funcs_uniform_all_null VALUES
+ (NULL),
+ (NULL),
+ (NULL);
+
+CREATE TABLE dbms_stat_funcs_uniform_boundary_data AS
+SELECT *
+FROM (
+ VALUES
+ (1, 0::numeric),
+ (2, 0.25::numeric),
+ (3, 0.5::numeric),
+ (4, 0.75::numeric),
+ (5, 1::numeric)
+) AS t(id, x);
+
+SET client_min_messages TO notice;
+
+-- Helpers: приводят record-return функции к стабильному текстовому формату expected/out.
+CREATE OR REPLACE FUNCTION format_summary_numeric(p_value numeric)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT CASE
+ WHEN p_value IS NULL THEN '<NULL>'
+ ELSE regexp_replace(
+ regexp_replace(
+ to_char(round(p_value, 12), 'FM999999999999999999999990D999999999999'),
+ '0+$', ''),
+ '\.$', '')
+ END;
+$$;
+
+CREATE OR REPLACE FUNCTION format_summary_numeric_array(p_values numeric[])
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ l_text text;
+BEGIN
+ IF p_values IS NULL THEN
+ RETURN '<NULL_COLLECTION>';
+ END IF;
+
+ IF cardinality(p_values) = 0 THEN
+ RETURN '[]|count|0';
+ END IF;
+
+ SELECT '[' || string_agg(format_summary_numeric(v), ',' ORDER BY ord) || ']|count|' || cardinality(p_values)::text
+ INTO l_text
+ FROM unnest(p_values) WITH ORDINALITY AS u(v, ord);
+ RETURN l_text;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION summary_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_sigma numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+ sigma_sql text;
+BEGIN
+ sigma_sql := CASE WHEN p_sigma IS NULL THEN 'NULL::numeric' ELSE p_sigma::text END;
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_summary(%L, %L, %L, %s)',
+ p_owner, p_table, p_column, sigma_sql
+ ) INTO r;
+
+ RETURN
+ 'count=' || format_summary_numeric(r."count") ||
+ ';min=' || format_summary_numeric(r.min) ||
+ ';max=' || format_summary_numeric(r.max) ||
+ ';range=' || format_summary_numeric(r."range") ||
+ ';mean=' || format_summary_numeric(r.mean) ||
+ ';cmode=' || format_summary_numeric_array(r.cmode) ||
+ ';variance=' || format_summary_numeric(r.variance) ||
+ ';stddev=' || format_summary_numeric(r.stddev) ||
+ ';q5=' || format_summary_numeric(r.quantile_5) ||
+ ';q25=' || format_summary_numeric(r.quantile_25) ||
+ ';median=' || format_summary_numeric(r.median) ||
+ ';q75=' || format_summary_numeric(r.quantile_75) ||
+ ';q95=' || format_summary_numeric(r.quantile_95) ||
+ ';plus=' || format_summary_numeric(r.plus_x_sigma) ||
+ ';minus=' || format_summary_numeric(r.minus_x_sigma) ||
+ ';extreme=' || format_summary_numeric_array(r.extreme_values) ||
+ ';top=' || format_summary_numeric_array(r.top_5_values) ||
+ ';bottom=' || format_summary_numeric_array(r.bottom_5_values);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION dist_fit_result3_text(
+ p_first_label text,
+ p_first numeric,
+ p_second_label text,
+ p_second numeric,
+ p_sig numeric
+)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT 'sig=' || format_summary_numeric(p_sig) ||
+ ' ' || p_first_label || '=' || format_summary_numeric(p_first) ||
+ ' ' || p_second_label || '=' || format_summary_numeric(p_second);
+$$;
+
+CREATE OR REPLACE FUNCTION dist_fit_result2_text(
+ p_first_label text,
+ p_first numeric,
+ p_sig numeric
+)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT 'sig=' || format_summary_numeric(p_sig) ||
+ ' ' || p_first_label || '=' || format_summary_numeric(p_first);
+$$;
+
+CREATE OR REPLACE FUNCTION weibull_fit_result_text(
+ p_alpha numeric,
+ p_mu numeric,
+ p_beta numeric,
+ p_sig numeric
+)
+RETURNS text
+LANGUAGE sql
+AS $$
+ SELECT 'sig=' || format_summary_numeric(p_sig) ||
+ ' alpha=' || format_summary_numeric(p_alpha) ||
+ ' mu=' || format_summary_numeric(p_mu) ||
+ ' beta=' || format_summary_numeric(p_beta);
+$$;
+
+CREATE OR REPLACE FUNCTION exp_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_lambda numeric,
+ p_mu numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_exponential_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_lambda, p_mu
+ ) INTO r;
+ RETURN dist_fit_result3_text('lambda', r.lambda, 'mu', r.mu, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION exp_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_lambda numeric,
+ p_mu numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_exponential_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_lambda, p_mu
+ ) INTO r;
+ RETURN dist_fit_result3_text('lambda', r.lambda, 'mu', r.mu, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION normal_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_mean numeric,
+ p_stdev numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_normal_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_mean, p_stdev
+ ) INTO r;
+ RETURN dist_fit_result3_text('mean', r.mean, 'stdev', r.stdev, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION normal_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_mean numeric,
+ p_stdev numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_normal_dist_fit(%L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_mean, p_stdev
+ ) INTO r;
+ RETURN dist_fit_result3_text('mean', r.mean, 'stdev', r.stdev, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION poisson_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_lambda numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_poisson_dist_fit(%L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_lambda
+ ) INTO r;
+ RETURN dist_fit_result2_text('lambda', r.lambda, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION poisson_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_lambda numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_poisson_dist_fit(%L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_lambda
+ ) INTO r;
+ RETURN dist_fit_result2_text('lambda', r.lambda, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION uniform_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_var_type text,
+ p_test_type text,
+ p_param_a numeric,
+ p_param_b numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_uniform_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_var_type, p_test_type, p_param_a, p_param_b
+ ) INTO r;
+ RETURN dist_fit_result3_text('paramA', r.parama, 'paramB', r.paramb, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION uniform_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_param_a numeric,
+ p_param_b numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_uniform_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', p_param_a, p_param_b
+ ) INTO r;
+ RETURN dist_fit_result3_text('paramA', r.parama, 'paramB', r.paramb, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION weibull_call(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_test_type text,
+ p_alpha numeric,
+ p_mu numeric,
+ p_beta numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_weibull_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, p_test_type, p_alpha, p_mu, p_beta
+ ) INTO r;
+ RETURN weibull_fit_result_text(r.alpha, r.mu, r.beta, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION weibull_call_default(
+ p_owner text,
+ p_table text,
+ p_column text,
+ p_alpha numeric,
+ p_mu numeric,
+ p_beta numeric
+)
+RETURNS text
+LANGUAGE plpgsql
+AS $$
+DECLARE
+ r record;
+BEGIN
+ EXECUTE format(
+ 'SELECT * FROM dbms_stat_funcs_weibull_dist_fit(%L, %L, %L, %L, %L, %L, %L)',
+ p_owner, p_table, p_column, 'KOLMOGOROV_SMIRNOV', p_alpha, p_mu, p_beta
+ ) INTO r;
+ RETURN weibull_fit_result_text(r.alpha, r.mu, r.beta, r.sig);
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN 'ERROR|' || SQLSTATE;
+END;
+$$;
+
+-- Smoke-check: все SQL entrypoints пакета зарегистрированы в catalog.
+SELECT count(*) = 8 AS dbms_stat_funcs_entrypoints_present
+FROM pg_proc
+WHERE proname LIKE 'dbms_stat_funcs_%';
+
+-- SUMMARY: базовые сценарии, NULL sigma и основные error paths.
+SELECT 'summary_default_sigma' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_fit_data', 'summary_val', 3) AS result;
+
+SELECT 'summary_sigma_null' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_fit_data', 'summary_val', NULL) AS result;
+
+SELECT 'summary_empty_table' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_empty_numeric', 'x', 3) AS result;
+
+SELECT 'summary_all_null' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_all_null_numeric', 'x', 3) AS result;
+
+SELECT 'summary_non_numeric_column' AS case_name,
+ summary_call(current_schema(), 'dbms_stat_funcs_fit_data', 'text_val', 3) AS result;
+
+
+-- EXPONENTIAL_DIST_FIT: KS работает, AD/CHI возвращают NULL sig.
+SELECT 'exp_ks_default' AS case_name,
+ exp_call_default(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 1, 0) AS result;
+
+SELECT 'exp_ks' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'KOLMOGOROV_SMIRNOV', 1, 0) AS result;
+
+SELECT 'exp_ad_sig_null' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'ANDERSON_DARLING', 1, 0) AS result;
+
+SELECT 'exp_chi_sig_null' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'CHI_SQUARED', 1, 0) AS result;
+
+SELECT 'exp_lambda_null' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_fit_data', 'exp_val', 'KOLMOGOROV_SMIRNOV', NULL, 0) AS result;
+
+SELECT 'exp_non_numeric_column' AS case_name,
+ exp_call(current_schema(), 'dbms_stat_funcs_non_numeric_text', 'x', 'KOLMOGOROV_SMIRNOV', 1, 0) AS result;
+
+
+-- NORMAL_DIST_FIT: KS работает, SHAPIRO_WILKS/AD/CHI возвращают NULL sig.
+SELECT 'normal_default_test_type' AS case_name,
+ normal_call_default(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 0, 1) AS result;
+
+SELECT 'normal_shapiro_sig_null' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'SHAPIRO_WILKS', 0, 1) AS result;
+
+SELECT 'normal_ks' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'KOLMOGOROV_SMIRNOV', 0, 1) AS result;
+
+SELECT 'normal_ad_sig_null' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'ANDERSON_DARLING', 0, 1) AS result;
+
+SELECT 'normal_chi_sig_null' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'CHI_SQUARED', 0, 1) AS result;
+
+SELECT 'normal_stdev_zero' AS case_name,
+ normal_call(current_schema(), 'dbms_stat_funcs_fit_data', 'normal_val', 'KOLMOGOROV_SMIRNOV', 0, 0) AS result;
+
+
+-- POISSON_DIST_FIT: KS работает, AD/CHI возвращают NULL sig.
+SELECT 'poisson_ks_default' AS case_name,
+ poisson_call_default(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 2) AS result;
+
+SELECT 'poisson_ks' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'KOLMOGOROV_SMIRNOV', 2) AS result;
+
+SELECT 'poisson_ad_sig_null' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'ANDERSON_DARLING', 2) AS result;
+
+SELECT 'poisson_chi_sig_null' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'CHI_SQUARED', 2) AS result;
+
+SELECT 'poisson_lambda_null' AS case_name,
+ poisson_call(current_schema(), 'dbms_stat_funcs_poisson_integer', 'x', 'KOLMOGOROV_SMIRNOV', NULL) AS result;
+
+
+-- UNIFORM_DIST_FIT: CONTINUOUS + KS работает, остальные проверенные комбинации возвращают NULL sig.
+SELECT 'uniform_default_var_and_test_type' AS case_name,
+ uniform_call_default(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 0, 1) AS result;
+
+SELECT 'uniform_continuous_ks' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', 0, 1) AS result;
+
+SELECT 'uniform_continuous_ad_sig_null' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'ANDERSON_DARLING', 0, 1) AS result;
+
+SELECT 'uniform_continuous_chi_sig_null' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'CHI_SQUARED', 0, 1) AS result;
+
+SELECT 'uniform_discrete_ks_sig_null' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_disc_val', 'DISCRETE', 'KOLMOGOROV_SMIRNOV', 1, 5) AS result;
+
+SELECT 'uniform_param_a_eq_b' AS case_name,
+ uniform_call(current_schema(), 'dbms_stat_funcs_uniform_data', 'uniform_val', 'CONTINUOUS', 'KOLMOGOROV_SMIRNOV', 1, 1) AS result;
+
+
+-- WEIBULL_DIST_FIT: KS работает, AD/CHI возвращают NULL sig.
+SELECT 'weibull_default_test_type' AS case_name,
+ weibull_call_default(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 2, 0, 1.5) AS result;
+
+SELECT 'weibull_ks' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'KOLMOGOROV_SMIRNOV', 2, 0, 1.5) AS result;
+
+SELECT 'weibull_ad_sig_null' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'ANDERSON_DARLING', 2, 0, 1.5) AS result;
+
+SELECT 'weibull_chi_sig_null' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'CHI_SQUARED', 2, 0, 1.5) AS result;
+
+SELECT 'weibull_alpha_null' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'KOLMOGOROV_SMIRNOV', NULL, 0, 1.5) AS result;
+
+SELECT 'weibull_alpha_zero' AS case_name,
+ weibull_call(current_schema(), 'dbms_stat_funcs_fit_data', 'weibull_val', 'KOLMOGOROV_SMIRNOV', 0, 0, 1.5) AS result;
diff --git a/src/test/regress/sql/dbms_system.sql b/src/test/regress/sql/dbms_system.sql
new file mode 100644
index 0000000..91c7013
--- /dev/null
+++ b/src/test/regress/sql/dbms_system.sql
@@ -0,0 +1,137 @@
+-- DBMS_SYSTEM: минимальный регрессионный smoke test.
+-- Проверяем только стабильное состояние event 10046 и то, что trace hooks
+-- не ломают выполнение обычных SQL-команд.
+-- LOG/WARNING-сообщения специально подавляем, потому что в них есть
+-- динамические значения backend pid / sid / duration_ms.
+
+SET client_min_messages TO error;
+
+-- В начале теста сбрасываем возможное состояние текущего backend-а.
+SELECT dbms_system_get_version() AS package_version;
+SELECT dbms_system_set_sql_trace_in_session(pg_backend_pid(), 1, false);
+SELECT dbms_system_is_valid_session(-1, -1) AS invalid_session_is_false;
+
+SELECT dbms_system_read_ev(10046);
+
+-- Включаем event 10046 через SET_EV.
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 10046, 1, '');
+
+SELECT dbms_system_read_ev(10046);
+
+-- Эти команды должны трассироваться внутри backend-а, но LOG-вывод
+-- подавлен через client_min_messages = error.
+SELECT 1 AS traced_select;
+
+CREATE TEMP TABLE dbms_system_trace_test(id int, name text);
+
+INSERT INTO dbms_system_trace_test VALUES (1, 'one'), (2, 'two');
+
+UPDATE dbms_system_trace_test
+SET name = 'updated'
+WHERE id = 1;
+
+DELETE FROM dbms_system_trace_test
+WHERE id = 2;
+
+SELECT id, name
+FROM dbms_system_trace_test
+ORDER BY id;
+
+-- Проверяем, что NULL в nm доходит до C-функции.
+-- Для этого dbms_system_set_ev должен быть proisstrict = false.
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 10046, 8, NULL);
+
+SELECT dbms_system_read_ev(10046);
+
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 10046, 12, '');
+
+SELECT dbms_system_read_ev(10046);
+
+-- Неподдержанный event должен быть NOOP.
+-- WARNING подавлен через client_min_messages = error.
+SELECT dbms_system_set_ev(pg_backend_pid(), 1, 99999, 3, '');
+
+SELECT dbms_system_read_ev(10046);
+
+-- Чужая сессия не поддерживается и должна быть NOOP.
+-- WARNING подавлен через client_min_messages = error.
+SELECT dbms_system_set_ev(pg_backend_pid() + 1000000, 1, 10046, 0, '');
+
+SELECT dbms_system_read_ev(10046);
+
+-- Выключаем event 10046 через SET_SQL_TRACE_IN_SESSION.
+SELECT dbms_system_set_sql_trace_in_session(pg_backend_pid(), 1, false);
+
+SELECT dbms_system_read_ev(10046);
+
+-- Эта команда не должна трассироваться после выключения event 10046.
+SELECT 2 AS not_traced_select;
+
+-- Неподдержанные events читаются как 0.
+SELECT dbms_system_read_ev(99999);
+
+-- Проверяем, что KSDWRT вызывается без ошибки.
+-- LOG подавлен через client_min_messages = error.
+SELECT dbms_system_ksdwrt(2, 'DBMS_SYSTEM regression test message');
+
+RESET client_min_messages;
+
+
+-- DBMS_SYSTEM: executor error trace regression.
+-- Проверяем логирование ошибочных executor-запросов без подмены исходной ошибки.
+SET client_min_messages = warning;
+
+CREATE TEMP TABLE dbms_system_executor_error_regress(value int4);
+INSERT INTO dbms_system_executor_error_regress(value) VALUES (0);
+
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 1::int4, 'executor-error-regress'::text);
+SELECT dbms_system_read_ev(10046) AS trace_level_enabled;
+
+-- Деление должно выполняться в executor, поэтому значение берётся из таблицы, а не из константы 1 / 0.
+\set VERBOSITY sqlstate
+SELECT 1 / value AS must_fail_division_by_zero FROM dbms_system_executor_error_regress;
+
+-- Дополнительно проверяем, что текст исходной ошибки не заменён нашим trace-логированием.
+\set VERBOSITY terse
+SELECT 1 / value AS must_fail_division_by_zero FROM dbms_system_executor_error_regress;
+\set VERBOSITY default
+
+-- Если trace frame был очищен в PG_CATCH, следующий executor-запрос должен нормально завершиться.
+SELECT 200 AS after_error_ok;
+
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 0::int4, 'executor-error-regress'::text);
+SELECT dbms_system_read_ev(10046) AS trace_level_after;
+
+
+-- DBMS_SYSTEM: utility error trace regression.
+SET client_min_messages = warning;
+
+DROP TABLE IF EXISTS dbms_system_utility_error_base;
+CREATE TEMP TABLE dbms_system_utility_error_base(value int4);
+
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 1::int4, 'utility-error-regress'::text);
+SELECT dbms_system_read_ev(10046) AS trace_level_enabled;
+
+\set VERBOSITY sqlstate
+DROP TABLE dbms_system_utility_error_missing;
+ALTER TABLE dbms_system_utility_error_base ALTER COLUMN missing_column TYPE int4;
+
+\set VERBOSITY terse
+DROP TABLE dbms_system_utility_error_missing;
+ALTER TABLE dbms_system_utility_error_base ALTER COLUMN missing_column TYPE int4;
+
+\set VERBOSITY default
+SELECT 300 AS after_utility_errors_ok;
+
+SELECT dbms_system_set_ev(pg_backend_pid()::int4, 0::int4, 10046::int4, 0::int4, 'utility-error-regress'::text);
+SELECT dbms_system_read_ev(10046) AS trace_level_after;
+DROP TABLE dbms_system_utility_error_base;
+
+
+-- DBMS_SYSTEM: KSDWRT destination regression.
+SET client_min_messages = warning;
+
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(1, 'ksdwrt regression trace only')) s;
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(2, 'ksdwrt regression server log only')) s;
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(3, 'ksdwrt regression trace and server log')) s;
+SELECT 'ok' AS result FROM (SELECT dbms_system_ksdwrt(999, 'ksdwrt regression invalid destination')) s;
diff --git a/src/test/regress/sql/dbms_tns.sql b/src/test/regress/sql/dbms_tns.sql
new file mode 100644
index 0000000..a61d791
--- /dev/null
+++ b/src/test/regress/sql/dbms_tns.sql
@@ -0,0 +1,173 @@
+-- Базовый flat API для DBMS_TNS.
+-- На этом этапе функция ещё не парсит Oracle Net, поэтому любые входы
+-- без полноценной поддержки должны возвращать SQL NULL.
+
+SELECT dbms_tns_get_version() AS package_version;
+SELECT dbms_tns_resolve_tnsname(NULL) IS NULL AS null_input_is_null;
+SELECT dbms_tns_resolve_tnsname('') IS NULL AS empty_input_is_null;
+SELECT dbms_tns_resolve_tnsname('UNKNOWN_ALIAS') IS NULL AS unknown_input_is_null;
+
+-- Built-in GUC registration.
+SHOW dbms_tns.tns_admin;
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns';
+SHOW dbms_tns.tns_admin;
+SELECT dbms_tns_has_tnsnames_config() IN (true, false) AS has_tnsnames_config_smoke;
+RESET dbms_tns.tns_admin;
+SHOW dbms_tns.tns_admin;
+
+CREATE ROLE regress_dbms_tns_nosuper NOSUPERUSER;
+SET SESSION AUTHORIZATION regress_dbms_tns_nosuper;
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns';
+SELECT dbms_tns_resolve_tnsname('UNKNOWN_ALIAS') IS NULL AS denied_for_non_superuser;
+SELECT dbms_tns_resolve_tnsname(NULL) IS NULL AS denied_null_for_non_superuser;
+RESET SESSION AUTHORIZATION;
+DROP ROLE regress_dbms_tns_nosuper;
+
+-- TNSNAMES alias lookup.
+\! rm -rf /tmp/rudb_dbms_tns_todo06_valid /tmp/rudb_dbms_tns_todo06_ezconnect /tmp/rudb_dbms_tns_todo06_missing /tmp/rudb_dbms_tns_todo06_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo06_valid /tmp/rudb_dbms_tns_todo06_ezconnect /tmp/rudb_dbms_tns_todo06_missing /tmp/rudb_dbms_tns_todo06_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo06_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'TESTDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' 'testdb, TestDb = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' 'ALIAS1, ALIAS2 = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=alias-host.local)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=aliassvc)))' 'DUPDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dup-first.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dupfirst)))' 'DUPDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dup-second.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dupsecond)))' 'SPACEDDB = (DESCRIPTION=' ' (ADDRESS=' ' (PROTOCOL=TCP)' ' (HOST=spaced-host.local)' ' (PORT=1523)' ' )' ' (CONNECT_DATA=' ' (SERVICE_NAME=spacedsvc)' ' )' ')' > /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora"
+\! sh -c "cp /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora /tmp/rudb_dbms_tns_todo06_ezconnect/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(EZCONNECT)' > /tmp/rudb_dbms_tns_todo06_ezconnect/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo06_missing/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo06_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=broken.local)(PORT=1521))' > /tmp/rudb_dbms_tns_todo06_malformed/tnsnames.ora"
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_valid';
+SELECT dbms_tns_has_tnsnames_config() AS valid_tnsnames_config_present;
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NOT NULL AS testdb_resolved;
+SELECT dbms_tns_resolve_tnsname('testdb') = dbms_tns_resolve_tnsname('TESTDB') AS alias_case_insensitive;
+SELECT dbms_tns_resolve_tnsname('TestDb') = dbms_tns_resolve_tnsname('TESTDB') AS alias_mixed_case_insensitive;
+SELECT dbms_tns_resolve_tnsname('ALIAS1') = dbms_tns_resolve_tnsname('ALIAS2') AS alias_list_same_descriptor;
+SELECT dbms_tns_resolve_tnsname('DUPDB') LIKE '%dup-second.local%' AS duplicate_last_wins;
+SELECT dbms_tns_resolve_tnsname('SPACEDDB') LIKE '%spaced-host.local%' AS multiline_normalized;
+SELECT dbms_tns_resolve_tnsname('UNKNOWN_ALIAS') IS NULL AS unknown_alias_is_null;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_ezconnect';
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NULL AS ezconnect_only_ignores_tnsnames;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_missing';
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NULL AS missing_tnsnames_is_null;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo06_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENDB') IS NULL AS malformed_tnsnames_is_null;
+
+-- Easy Connect resolver.
+\! rm -rf /tmp/rudb_dbms_tns_todo08_ezconnect_only /tmp/rudb_dbms_tns_todo08_tnsnames_only /tmp/rudb_dbms_tns_todo08_mixed /tmp/rudb_dbms_tns_todo08_missing_sqlnet /tmp/rudb_dbms_tns_todo08_malformed_sqlnet
+\! rm -rf /tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames
+\! mkdir -p /tmp/rudb_dbms_tns_todo08_ezconnect_only /tmp/rudb_dbms_tns_todo08_tnsnames_only /tmp/rudb_dbms_tns_todo08_mixed /tmp/rudb_dbms_tns_todo08_missing_sqlnet /tmp/rudb_dbms_tns_todo08_malformed_sqlnet /tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(EZCONNECT)' > /tmp/rudb_dbms_tns_todo08_ezconnect_only/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo08_tnsnames_only/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)' > /tmp/rudb_dbms_tns_todo08_mixed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)' > /tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames/sqlnet.ora"
+\! sh -c "cp /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora /tmp/rudb_dbms_tns_todo08_tnsnames_only/tnsnames.ora"
+\! sh -c "cp /tmp/rudb_dbms_tns_todo06_valid/tnsnames.ora /tmp/rudb_dbms_tns_todo08_mixed/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(EZCONNECT' > /tmp/rudb_dbms_tns_todo08_malformed_sqlnet/sqlnet.ora"
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_ezconnect_only';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_double_slash_default_port;
+SELECT dbms_tns_resolve_tnsname('//localhost:1521/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_double_slash_explicit_port;
+SELECT dbms_tns_resolve_tnsname('localhost:1521/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_plain_explicit_port;
+SELECT dbms_tns_resolve_tnsname('localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_plain_default_port;
+SELECT dbms_tns_resolve_tnsname('//localhost:badport/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=badport))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_badport_literal;
+SELECT dbms_tns_resolve_tnsname('//localhost:1521/') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=)))' AS easyconnect_empty_service;
+SELECT dbms_tns_resolve_tnsname('host:port') IS NULL AS easyconnect_missing_service_is_null;
+SELECT dbms_tns_resolve_tnsname('host:/service') IS NULL AS easyconnect_empty_port_is_null;
+SELECT dbms_tns_resolve_tnsname('//host//service') IS NULL AS easyconnect_double_slash_service_is_null;
+SELECT dbms_tns_resolve_tnsname('host/service/extra') IS NULL AS easyconnect_extra_path_is_null;
+SELECT dbms_tns_resolve_tnsname('/service') IS NULL AS easyconnect_empty_host_is_null;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_tnsnames_only';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') IS NULL AS easyconnect_gated_by_tnsnames_only;
+SELECT dbms_tns_resolve_tnsname('TESTDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' AS tnsnames_alias_still_resolves;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_mixed';
+SELECT dbms_tns_resolve_tnsname('TESTDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' AS tnsnames_still_resolves_with_ezconnect;
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_resolves_with_tnsnames_coexistence;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_mixed_missing_tnsnames';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=freepdb1)))' AS easyconnect_fallback_after_tnsnames_missing;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_missing_sqlnet';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') IS NULL AS missing_sqlnet_is_null;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo08_malformed_sqlnet';
+SELECT dbms_tns_resolve_tnsname('//localhost/freepdb1') IS NULL AS malformed_sqlnet_is_null;
+
+-- Parser hardening: CRLF and quoted values.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed
+\! sh -c "printf '%s\r\n' \"NAMES.DIRECTORY_PATH=(TNSNAMES)\" \"# comment line\" \" CRLFDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=crlf-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=crlfsvc))) # trailing comment\" \"QUOTEDDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='quoted-host.local')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='quotedsvc')))\" \"HASHDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='host#1.local')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='svc#1')))\" \"PARENDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='host(1).local')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='svc(1)')))\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid/tnsnames.ora"
+\! sh -c "printf '%s\r\n' \"NAMES.DIRECTORY_PATH=(TNSNAMES)\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_valid/sqlnet.ora"
+\! sh -c "printf '%s\r\n' \"NAMES.DIRECTORY_PATH=(TNSNAMES)\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed/sqlnet.ora"
+\! sh -c "printf '%s\r\n' \"BROKENQUOTE = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='broken.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=broken)))\" > /tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed/tnsnames.ora"
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_crlf_quotes_valid';
+SELECT dbms_tns_resolve_tnsname('CRLFDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=crlf-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=crlfsvc)))' AS crlf_line_endings_resolve;
+SELECT dbms_tns_resolve_tnsname('QUOTEDDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=''quoted-host.local'')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=''quotedsvc'')))' AS quoted_value_resolve;
+SELECT dbms_tns_resolve_tnsname('HASHDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=''host#1.local'')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=''svc#1'')))' AS hash_inside_quoted_value_resolve;
+SELECT dbms_tns_resolve_tnsname('PARENDB') = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=''host(1).local'')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=''svc(1)'')))' AS parentheses_inside_quoted_value_resolve;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_crlf_quotes_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENQUOTE') IS NULL AS unterminated_quote_is_null;
+
+-- Parser hardening: ADDRESS_LIST.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_address_list_valid /tmp/rudb_dbms_tns_todo10_address_list_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_address_list_valid /tmp/rudb_dbms_tns_todo10_address_list_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_address_list_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'TESTDB = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host2.local)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=testsvc)))' 'MULTIADDR = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host3.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host4.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=multisvc)))' > /tmp/rudb_dbms_tns_todo10_address_list_valid/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_address_list_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENDB = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=broken1.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=broken))' > /tmp/rudb_dbms_tns_todo10_address_list_malformed/tnsnames.ora"
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_address_list_valid';
+SELECT dbms_tns_resolve_tnsname('TESTDB') IS NOT NULL AS address_list_resolves;
+SELECT dbms_tns_resolve_tnsname('TESTDB') LIKE '%host1.local%' AS address_list_contains_host1;
+SELECT dbms_tns_resolve_tnsname('TESTDB') LIKE '%host2.local%' AS address_list_contains_host2;
+SELECT dbms_tns_resolve_tnsname('TESTDB') LIKE '%ADDRESS_LIST%' OR dbms_tns_resolve_tnsname('TESTDB') LIKE '%host1.local%' AS address_list_has_address_list_or_hosts;
+SELECT dbms_tns_resolve_tnsname('MULTIADDR') IS NOT NULL AS multiple_addresses_under_description_resolve;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_address_list_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENDB') IS NULL AS malformed_address_list_is_null;
+
+-- Parser hardening: DESCRIPTION_LIST.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_description_list_valid /tmp/rudb_dbms_tns_todo10_description_list_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_description_list_valid /tmp/rudb_dbms_tns_todo10_description_list_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_description_list_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'DESCDB = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host1.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=svc1)))(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host2.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=svc2))))' 'DESCADDR = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host3.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host4.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=svc3))))' 'DESCLIST = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host5.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host6.local)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=svc4))))' > /tmp/rudb_dbms_tns_todo10_description_list_valid/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_description_list_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENDESC = (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=broken1.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=broken1)))' > /tmp/rudb_dbms_tns_todo10_description_list_malformed/tnsnames.ora"
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_description_list_valid';
+SELECT dbms_tns_resolve_tnsname('DESCDB') IS NOT NULL AS description_list_resolves;
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%host1.local%' AS description_list_contains_host1;
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%host2.local%' AS description_list_contains_host2;
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%svc1%' AS description_list_contains_service1;
+SELECT dbms_tns_resolve_tnsname('DESCDB') LIKE '%svc2%' AS description_list_contains_service2;
+SELECT dbms_tns_resolve_tnsname('DESCADDR') IS NOT NULL AS description_list_with_address_entries_resolves;
+SELECT dbms_tns_resolve_tnsname('DESCLIST') IS NOT NULL AS description_list_with_address_list_resolves;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_description_list_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENDESC') IS NULL AS malformed_description_list_is_null;
+
+-- Parser hardening: connect descriptor options.
+\! rm -rf /tmp/rudb_dbms_tns_todo10_connect_options_valid /tmp/rudb_dbms_tns_todo10_connect_options_malformed
+\! mkdir -p /tmp/rudb_dbms_tns_todo10_connect_options_valid /tmp/rudb_dbms_tns_todo10_connect_options_malformed
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_connect_options_valid/sqlnet.ora"
+\! sh -c "printf '%s\n' 'OPTDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=opt-host.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=optsvc)(CONNECT_TIMEOUT=3)(RETRY_COUNT=2)(RETRY_DELAY=1)(SDU=8192)(SOURCE_ROUTE=ON)(LOAD_BALANCE=ON)(FAILOVER=ON)))' 'OPTNEST = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=nested1.local)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=nested2.local)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=nestedsvc)(CONNECT_TIMEOUT=3)(RETRY_COUNT=2)(RETRY_DELAY=1)(SDU=8192)(SOURCE_ROUTE=ON)(LOAD_BALANCE=ON)(FAILOVER=ON)))' > /tmp/rudb_dbms_tns_todo10_connect_options_valid/tnsnames.ora"
+\! sh -c "printf '%s\n' 'NAMES.DIRECTORY_PATH=(TNSNAMES)' > /tmp/rudb_dbms_tns_todo10_connect_options_malformed/sqlnet.ora"
+\! sh -c "printf '%s\n' 'BROKENOPT = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=brokenopt.local)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=brokenopt)(CONNECT_TIMEOUT=3)(RETRY_COUNT=2)(RETRY_DELAY=1)(SDU=8192)(SOURCE_ROUTE=ON)(LOAD_BALANCE=ON)(FAILOVER=ON))' > /tmp/rudb_dbms_tns_todo10_connect_options_malformed/tnsnames.ora"
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_connect_options_valid';
+SELECT dbms_tns_resolve_tnsname('OPTDB') IS NOT NULL AS connect_options_resolves;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%CONNECT_TIMEOUT=3%' AS connect_timeout_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%RETRY_COUNT=2%' AS retry_count_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%RETRY_DELAY=1%' AS retry_delay_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%SDU=8192%' AS sdu_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%SOURCE_ROUTE=ON%' AS source_route_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%LOAD_BALANCE=ON%' AS load_balance_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTDB') LIKE '%FAILOVER=ON%' AS failover_preserved;
+SELECT dbms_tns_resolve_tnsname('OPTNEST') IS NOT NULL AS connect_options_with_nested_address_resolves;
+
+SET dbms_tns.tns_admin = '/tmp/rudb_dbms_tns_todo10_connect_options_malformed';
+SELECT dbms_tns_resolve_tnsname('BROKENOPT') IS NULL AS malformed_connect_options_is_null;
diff --git a/src/test/regress/sql/dbms_trace.sql b/src/test/regress/sql/dbms_trace.sql
new file mode 100644
index 0000000..bb408b5
--- /dev/null
+++ b/src/test/regress/sql/dbms_trace.sql
@@ -0,0 +1,400 @@
+-- DBMS_TRACE regression coverage.
+--
+-- Single-file coverage for:
+-- - catalog/signature presence
+-- - safe MVP runtime behavior
+-- - explicit not-implemented stubs
+
+SET client_min_messages TO info;
+\getenv libdir PG_LIBDIR
+\getenv dlsuffix PG_DLSUFFIX
+\set regresslib :libdir '/regress' :dlsuffix
+
+CREATE FUNCTION regress_dbms_trace_snapshot() RETURNS text
+ AS :'regresslib', 'regress_dbms_trace_snapshot' LANGUAGE C STRICT;
+
+SELECT dbms_trace_get_version() AS package_version;
+SELECT dbms_trace_is_enabled() AS trace_disabled_by_default;
+SELECT dbms_trace_set_plsql_trace(1);
+SELECT dbms_trace_is_enabled() AS trace_enabled_after_set;
+SELECT dbms_trace_clear_plsql_trace();
+SELECT dbms_trace_is_enabled() AS trace_disabled_after_clear;
+
+DO $$
+DECLARE
+ v_count integer;
+ v_args text;
+ v_result text;
+BEGIN
+ SELECT count(*)
+ INTO v_count
+ FROM pg_proc
+ WHERE proname IN (
+ 'dbms_trace_set_plsql_trace',
+ 'dbms_trace_clear_plsql_trace',
+ 'dbms_trace_is_enabled',
+ 'dbms_trace_get_plsql_trace_level',
+ 'dbms_trace_plsql_trace_version',
+ 'dbms_trace_get_version'
+ );
+
+ IF v_count <> 6 THEN
+ RAISE EXCEPTION 'expected 6 dbms_trace entries, found %', v_count;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_is_enabled';
+ IF v_args <> '' OR v_result <> 'boolean' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_is_enabled: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_set_plsql_trace';
+ IF v_args <> 'trace_level integer' OR v_result <> 'void' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_set_plsql_trace: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_clear_plsql_trace';
+ IF v_args <> '' OR v_result <> 'void' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_clear_plsql_trace: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_get_plsql_trace_level';
+ IF v_args <> '' OR v_result <> 'integer' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_get_plsql_trace_level: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_plsql_trace_version';
+ IF v_args <> 'OUT major integer, OUT minor integer' OR v_result <> 'record' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_plsql_trace_version: args=%, result=%', v_args, v_result;
+ END IF;
+
+ SELECT pg_get_function_arguments(oid), pg_get_function_result(oid)
+ INTO v_args, v_result
+ FROM pg_proc
+ WHERE proname = 'dbms_trace_get_version';
+ IF v_args <> '' OR v_result <> 'text' THEN
+ RAISE EXCEPTION 'signature mismatch for dbms_trace_get_version: args=%, result=%', v_args, v_result;
+ END IF;
+
+ RAISE INFO 'catalog signatures => 6 entrypoints verified';
+END $$;
+
+DO $$
+DECLARE
+ v_count integer;
+BEGIN
+ SELECT count(*)
+ INTO v_count
+ FROM pg_proc
+ WHERE proname IN (
+ 'dbms_trace_plsql_trace_runs',
+ 'dbms_trace_plsql_trace_events'
+ );
+
+ IF v_count <> 2 THEN
+ RAISE EXCEPTION 'expected 2 SQL-readable dbms_trace trace functions, found %', v_count;
+ END IF;
+
+ IF to_regclass('plsql_trace_runs') IS NULL OR to_regclass('plsql_trace_events') IS NULL THEN
+ RAISE EXCEPTION 'expected SQL-readable trace views to exist';
+ END IF;
+
+ RAISE INFO 'SQL-readable trace functions/views => present';
+END $$;
+
+-- Direct record-return SRF calls with shortened caller descriptors must be safe.
+SELECT dbms_trace_clear_plsql_trace();
+
+SELECT count(*) >= 0 AS direct_empty_events_ok
+ FROM dbms_trace_plsql_trace_events() AS e(
+ event_type text,
+ run_id integer,
+ event_seq integer,
+ unit_name text,
+ subprogram_name text
+ );
+
+SELECT count(*) >= 0 AS direct_empty_runs_ok
+ FROM dbms_trace_plsql_trace_runs() AS r(
+ run_id integer,
+ trace_level integer,
+ event_count integer
+ );
+
+DO $$
+DECLARE
+ v_snapshot text;
+BEGIN
+ PERFORM dbms_trace_clear_plsql_trace();
+ PERFORM dbms_trace_set_plsql_trace(1);
+ v_snapshot := regress_dbms_trace_snapshot();
+ IF v_snapshot NOT LIKE 'enabled=true trace_mask=1 active_run_id=% next_run_id=% next_event_seq=% trace_rows_count=% last_event_type=SET' THEN
+ RAISE EXCEPTION 'unexpected snapshot after SET: %', v_snapshot;
+ END IF;
+
+ PERFORM dbms_trace_clear_plsql_trace();
+ v_snapshot := regress_dbms_trace_snapshot();
+ IF v_snapshot NOT LIKE 'enabled=false trace_mask=0 active_run_id=0 next_run_id=% next_event_seq=% trace_rows_count=% last_event_type=CLEAR' THEN
+ RAISE EXCEPTION 'unexpected snapshot after CLEAR: %', v_snapshot;
+ END IF;
+
+ PERFORM dbms_trace_clear_plsql_trace();
+ v_snapshot := regress_dbms_trace_snapshot();
+ IF v_snapshot NOT LIKE 'enabled=false trace_mask=0 active_run_id=0 next_run_id=% next_event_seq=% trace_rows_count=% last_event_type=CLEAR' THEN
+ RAISE EXCEPTION 'unexpected snapshot after repeated CLEAR: %', v_snapshot;
+ END IF;
+
+ RAISE INFO 'CLEAR_PLSQL_TRACE shutdown + idempotence => OK';
+END $$;
+
+DO $$
+DECLARE
+BEGIN
+ PERFORM dbms_trace_clear_plsql_trace();
+ PERFORM dbms_trace_set_plsql_trace(1);
+ PERFORM dbms_trace_set_plsql_trace(1 + 2);
+ PERFORM dbms_trace_set_plsql_trace(1.5::integer);
+ PERFORM dbms_trace_set_plsql_trace(0);
+ PERFORM dbms_trace_set_plsql_trace(-1);
+ PERFORM dbms_trace_set_plsql_trace(1048576);
+ PERFORM dbms_trace_clear_plsql_trace();
+ RAISE INFO 'SET_PLSQL_TRACE safe numeric cases => OK';
+END $$;
+
+DO $$
+DECLARE
+ v_state text;
+ v_msg text;
+BEGIN
+ BEGIN
+ PERFORM dbms_trace_set_plsql_trace(NULL::integer);
+ RAISE EXCEPTION 'dbms_trace_set_plsql_trace(NULL::integer) unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '22023' OR v_msg <> 'SET_PLSQL_TRACE requires a trace level' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_set_plsql_trace(NULL::integer): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'SET_PLSQL_TRACE(NULL::integer) => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_set_plsql_trace('abc'::integer);
+ RAISE EXCEPTION 'dbms_trace_set_plsql_trace(''abc''::integer) unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '22P02' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_set_plsql_trace(''abc''::integer): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'SET_PLSQL_TRACE(''abc''::integer) => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_set_plsql_trace(999999999999999999999999::integer);
+ RAISE EXCEPTION 'dbms_trace_set_plsql_trace(999999999999999999999999::integer) unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '22003' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_set_plsql_trace(999999999999999999999999::integer): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'SET_PLSQL_TRACE(999999999999999999999999::integer) => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_get_plsql_trace_level();
+ RAISE EXCEPTION 'dbms_trace_get_plsql_trace_level() unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '0A000' OR v_msg <> 'DBMS_TRACE.GET_PLSQL_TRACE_LEVEL is not implemented yet' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_get_plsql_trace_level(): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'GET_PLSQL_TRACE_LEVEL => state=% msg=%', v_state, v_msg;
+ END;
+
+ BEGIN
+ PERFORM dbms_trace_plsql_trace_version();
+ RAISE EXCEPTION 'dbms_trace_plsql_trace_version() unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '0A000' OR v_msg <> 'DBMS_TRACE.PLSQL_TRACE_VERSION is not implemented yet' THEN
+ RAISE EXCEPTION 'unexpected error for dbms_trace_plsql_trace_version(): state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'PLSQL_TRACE_VERSION => state=% msg=%', v_state, v_msg;
+ END;
+END $$;
+
+CREATE OR REPLACE FUNCTION dbms_trace_probe_inner(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN x + 1;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION dbms_trace_probe_outer(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN dbms_trace_probe_inner(x) + 1;
+END;
+$$;
+
+DROP FUNCTION IF EXISTS dbms_trace_events_outer(integer);
+DROP FUNCTION IF EXISTS dbms_trace_events_inner(integer);
+
+CREATE FUNCTION dbms_trace_events_inner(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN x + 1;
+END;
+$$;
+
+CREATE FUNCTION dbms_trace_events_outer(x integer)
+RETURNS integer
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ RETURN dbms_trace_events_inner(x) + 1;
+END;
+$$;
+
+SELECT dbms_trace_clear_plsql_trace();
+SELECT dbms_trace_set_plsql_trace(1);
+SELECT dbms_trace_events_outer(10) AS demo_result;
+
+WITH latest_run AS (
+ SELECT max(run_id) AS run_id FROM plsql_trace_runs
+),
+direct_events AS (
+ SELECT
+ event_type,
+ run_id,
+ event_seq,
+ unit_name,
+ subprogram_name
+ FROM dbms_trace_plsql_trace_events() AS e(
+ event_type text,
+ run_id integer,
+ event_seq integer,
+ unit_name text,
+ subprogram_name text
+ )
+ WHERE run_id = (SELECT run_id FROM latest_run)
+),
+direct_runs AS (
+ SELECT
+ run_id,
+ trace_level,
+ event_count
+ FROM dbms_trace_plsql_trace_runs() AS r(
+ run_id integer,
+ trace_level integer,
+ event_count integer
+ )
+ WHERE run_id = (SELECT run_id FROM latest_run)
+)
+SELECT
+ (SELECT count(*) FROM direct_events) AS direct_event_rows,
+ (SELECT event_count FROM direct_runs) AS direct_run_event_count,
+ (SELECT count(*) FROM direct_events) = (SELECT event_count FROM direct_runs) AS direct_event_count_matches;
+
+SELECT
+ event_type,
+ run_id IS NOT NULL AS run_id_ok,
+ event_seq IS NOT NULL AS event_seq_ok,
+ coalesce(unit_name <> '', true) AS unit_name_ok,
+ coalesce(subprogram_name <> '', true) AS subprogram_name_ok
+FROM dbms_trace_plsql_trace_events() AS e(
+ event_type text,
+ run_id integer,
+ event_seq integer,
+ unit_name text,
+ subprogram_name text
+)
+WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs)
+ORDER BY event_seq;
+
+SELECT
+ run_id IS NOT NULL AS run_id_ok,
+ trace_level,
+ event_count >= 0 AS event_count_ok
+FROM dbms_trace_plsql_trace_runs() AS r(
+ run_id integer,
+ trace_level integer,
+ event_count integer
+)
+WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs);
+
+DO $$
+DECLARE
+ v_state text;
+ v_msg text;
+BEGIN
+ BEGIN
+ PERFORM 1
+ FROM dbms_trace_plsql_trace_events() AS e(foo text);
+ RAISE EXCEPTION 'dbms_trace_plsql_trace_events() with unsupported column unexpectedly succeeded';
+ EXCEPTION WHEN OTHERS THEN
+ GET STACKED DIAGNOSTICS v_state = RETURNED_SQLSTATE, v_msg = MESSAGE_TEXT;
+ IF v_state <> '0A000' OR v_msg <> 'unsupported DBMS_TRACE event output column "foo"' THEN
+ RAISE EXCEPTION 'unexpected error for unsupported DBMS_TRACE event column: state=%, msg=%', v_state, v_msg;
+ END IF;
+ RAISE INFO 'unsupported DBMS_TRACE event column => state=% msg=%', v_state, v_msg;
+ END;
+END $$;
+
+SELECT dbms_trace_clear_plsql_trace();
+
+DROP FUNCTION dbms_trace_events_outer(integer);
+DROP FUNCTION dbms_trace_events_inner(integer);
+
+SELECT dbms_trace_clear_plsql_trace();
+SELECT dbms_trace_set_plsql_trace(1);
+SELECT dbms_trace_probe_outer(10);
+SELECT regress_dbms_trace_snapshot();
+SELECT dbms_trace_clear_plsql_trace();
+SELECT dbms_trace_probe_outer(20);
+SELECT regress_dbms_trace_snapshot();
+
+SELECT dbms_trace_clear_plsql_trace();
+SELECT dbms_trace_set_plsql_trace(7);
+SELECT dbms_trace_probe_outer(10);
+SELECT dbms_trace_clear_plsql_trace();
+
+SELECT run_id,
+ trace_mask,
+ is_active,
+ event_count,
+ started_at IS NOT NULL AS started,
+ ended_at IS NOT NULL AS ended
+ FROM plsql_trace_runs
+ WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs);
+
+SELECT event_seq,
+ event_type,
+ coalesce(subprogram_name, '-') AS subprogram_name
+ FROM plsql_trace_events
+ WHERE run_id = (SELECT max(run_id) FROM plsql_trace_runs)
+ ORDER BY event_seq;
+
+DROP FUNCTION dbms_trace_probe_outer(integer);
+DROP FUNCTION dbms_trace_probe_inner(integer);
+
+RESET client_min_messages;
diff --git a/src/test/regress/sql/dbms_warning.sql b/src/test/regress/sql/dbms_warning.sql
new file mode 100644
index 0000000..b5860d4
--- /dev/null
+++ b/src/test/regress/sql/dbms_warning.sql
@@ -0,0 +1,154 @@
+-- Проверка DBMS_WARNING: точки входа, строковый API и хук компилятора.
+
+SELECT dbms_warning_get_version() AS package_version;
+
+SELECT count(*) = 9 AS dbms_warning_entrypoints_present
+FROM pg_proc
+WHERE proname LIKE 'dbms_warning_%';
+
+SELECT proname || '|' ||
+ coalesce(pg_get_function_identity_arguments(oid), '') || '|' ||
+ prorettype::regtype::text || '|' ||
+ prosrc AS entrypoint_signature
+FROM pg_proc
+WHERE proname LIKE 'dbms_warning_%'
+ORDER BY proname;
+
+CREATE OR REPLACE FUNCTION warning_try_set(value text, scope text)
+RETURNS text AS $$
+BEGIN
+ PERFORM dbms_warning_set_warning_setting_string(value, scope);
+ RETURN 'OK';
+EXCEPTION
+ WHEN OTHERS THEN
+ RETURN SQLSTATE;
+END
+$$ LANGUAGE plpgsql;
+
+-- Проверка строкового API для сессионного PLSQL_WARNINGS.
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS default_is_disable_all;
+SELECT dbms_warning_normalize_setting('enable:all') = 'ENABLE:ALL' AS normalize_enable_all;
+
+SELECT warning_try_set('ENABLE:ALL', 'SESSION') = 'OK' AS enable_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL' AS enable_all_get;
+
+SELECT warning_try_set('disable:all', 'session') = 'OK' AS lowercase_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS lowercase_get;
+
+SELECT warning_try_set(' Enable : All ', ' SESSION ') = 'OK' AS mixed_case_spacing_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL' AS mixed_case_spacing_get;
+
+SELECT warning_try_set('ERROR:ALL', 'SESSION') = 'OK' AS error_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ERROR:ALL' AS error_all_get;
+
+SELECT warning_try_set('ENABLE:SEVERE', 'SESSION') = 'OK' AS enable_severe_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:SEVERE' AS enable_severe_get;
+
+SELECT warning_try_set('ENABLE:INFORMATIONAL', 'SESSION') = 'OK' AS enable_informational_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:INFORMATIONAL' AS enable_informational_get;
+
+SELECT warning_try_set('ENABLE:PERFORMANCE', 'SESSION') = 'OK' AS enable_performance_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:PERFORMANCE' AS enable_performance_get;
+
+SELECT warning_try_set('DISABLE:PERFORMANCE', 'SESSION') = 'OK' AS disable_performance_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:PERFORMANCE' AS disable_performance_get;
+
+SELECT warning_try_set('ENABLE:ALL,DISABLE:PERFORMANCE', 'SESSION') = 'OK' AS ordered_clauses_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL,DISABLE:PERFORMANCE' AS ordered_clauses_get;
+
+SELECT warning_try_set('DISABLE:ALL,ENABLE:SEVERE', 'SESSION') = 'OK' AS disable_then_severe_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL,ENABLE:SEVERE' AS disable_then_severe_get;
+
+SELECT warning_try_set('ERROR:06002', 'SESSION') = 'OK' AS error_number_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ERROR:6002' AS error_number_get;
+
+SELECT warning_try_set('ENABLE:6002', 'SESSION') = 'OK' AS enable_number_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:6002' AS enable_number_get;
+
+SELECT warning_try_set('ENABLE : ( 06002 , 06003 )', 'SESSION') = 'OK' AS enable_number_list_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:(6002,6003)' AS enable_number_list_get;
+
+SELECT warning_try_set('DISABLE:ALL', 'SESSION') = 'OK' AS cleanup_disable_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS cleanup_disable_all_get;
+
+-- Проверка отказов без повреждения предыдущего состояния.
+SELECT warning_try_set('ENABLE:ALL,DISABLE:PERFORMANCE', 'SESSION') = 'OK' AS state_a_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL,DISABLE:PERFORMANCE' AS state_a_get;
+
+SELECT warning_try_set('', 'SESSION') = '22023' AS empty_value_rejected;
+SELECT warning_try_set(' ', 'SESSION') = '22023' AS whitespace_value_rejected;
+SELECT warning_try_set(NULL, 'SESSION') = '22004' AS null_value_rejected;
+SELECT warning_try_set('BAD:ALL', 'SESSION') = '22023' AS invalid_action_rejected;
+SELECT warning_try_set('ENABLE:BAD', 'SESSION') = '22023' AS invalid_selector_rejected;
+SELECT warning_try_set('ENABLE:', 'SESSION') = '22023' AS missing_selector_rejected;
+SELECT warning_try_set(':ALL', 'SESSION') = '22023' AS missing_action_rejected;
+SELECT warning_try_set('ENABLEALL', 'SESSION') = '22023' AS missing_colon_rejected;
+SELECT warning_try_set('ENABLE:ALL,', 'SESSION') = '22023' AS trailing_comma_rejected;
+SELECT warning_try_set('ENABLE:ALL,,DISABLE:ALL', 'SESSION') = '22023' AS empty_clause_rejected;
+SELECT warning_try_set('ENABLE:(6002,)', 'SESSION') = '22023' AS malformed_numeric_list_rejected;
+SELECT warning_try_set('ENABLE:(abc)', 'SESSION') = '22023' AS non_numeric_list_item_rejected;
+SELECT warning_try_set('ENABLE:-1', 'SESSION') = '22023' AS negative_number_rejected;
+SELECT warning_try_set('ENABLE:ALL', 'BAD') = '22023' AS invalid_scope_rejected;
+SELECT warning_try_set('ENABLE:ALL', NULL) = '22004' AS null_scope_rejected;
+SELECT warning_try_set('ENABLE:ALL', '') = '22023' AS empty_scope_rejected;
+SELECT warning_try_set('ENABLE:ALL', 'SYSTEM') = '42501' AS system_scope_rejected;
+
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL,DISABLE:PERFORMANCE' AS state_preserved_after_failed_set;
+
+-- Проверка интеграции компилятора: non-ALL строка не ломает helper, ALL-level
+-- поведение по-прежнему определяет shadow-variable warning.
+SELECT warning_try_set('ENABLE:SEVERE', 'SESSION') = 'OK' AS compiler_non_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:SEVERE' AS compiler_non_all_get;
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_non_all(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+
+SELECT dbms_warning_shadow_non_all(1);
+
+SELECT warning_try_set('DISABLE:ALL', 'SESSION') = 'OK' AS compiler_disable_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'DISABLE:ALL' AS compiler_disable_all_get;
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_disable(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+
+SELECT dbms_warning_shadow_disable(1);
+
+SELECT warning_try_set('ENABLE:ALL', 'SESSION') = 'OK' AS compiler_enable_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ENABLE:ALL' AS compiler_enable_all_get;
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_enable(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+
+SELECT dbms_warning_shadow_enable(1);
+
+SELECT warning_try_set('ERROR:ALL', 'SESSION') = 'OK' AS compiler_error_all_set_ok;
+SELECT dbms_warning_get_warning_setting_string() = 'ERROR:ALL' AS compiler_error_all_get;
+
+CREATE OR REPLACE FUNCTION dbms_warning_shadow_error(in1 int)
+RETURNS int AS $$
+DECLARE
+ in1 int;
+BEGIN
+ RETURN 1;
+END
+$$ LANGUAGE plpgsql;
+
+SELECT to_regprocedure('dbms_warning_shadow_error(integer)') IS NULL AS shadow_error_absent;
diff --git a/src/test/regress/sql/dbms_xmlsave.sql b/src/test/regress/sql/dbms_xmlsave.sql
new file mode 100644
index 0000000..7b52b24
--- /dev/null
+++ b/src/test/regress/sql/dbms_xmlsave.sql
@@ -0,0 +1,20 @@
+SET client_min_messages = notice;
+
+DROP TABLE IF EXISTS t_xmlsave_service;
+CREATE TABLE t_xmlsave_service
+(
+ id int4
+);
+
+DO $$
+DECLARE
+ v_handle int4;
+BEGIN
+ RAISE NOTICE 'Expected: DBMS_XMLSAVE context closed';
+ v_handle := dbms_xmlsave_newcontext('t_xmlsave_service'::varchar2);
+ PERFORM dbms_xmlsave_closecontext2(v_handle, 0::int4);
+ RAISE NOTICE 'Actual: DBMS_XMLSAVE context closed';
+END;
+$$;
+
+DROP TABLE IF EXISTS t_xmlsave_service;
diff --git a/src/test/regress/sql/dbms_xmlstore.sql b/src/test/regress/sql/dbms_xmlstore.sql
new file mode 100644
index 0000000..e1fcda1
--- /dev/null
+++ b/src/test/regress/sql/dbms_xmlstore.sql
@@ -0,0 +1,20 @@
+SET client_min_messages = notice;
+
+DROP TABLE IF EXISTS t_xmlstore_service;
+CREATE TABLE t_xmlstore_service
+(
+ id int4
+);
+
+DO $$
+DECLARE
+ v_handle int4;
+BEGIN
+ RAISE NOTICE 'Expected: DBMS_XMLSTORE context closed';
+ v_handle := dbms_xmlstore_newcontext('t_xmlstore_service'::varchar2);
+ PERFORM dbms_xmlstore_closecontext_tmp(v_handle, 0::int4);
+ RAISE NOTICE 'Actual: DBMS_XMLSTORE context closed';
+END;
+$$;
+
+DROP TABLE IF EXISTS t_xmlstore_service;
diff --git a/src/test/regress/sql/htf.sql b/src/test/regress/sql/htf.sql
new file mode 100644
index 0000000..46f686e
--- /dev/null
+++ b/src/test/regress/sql/htf.sql
@@ -0,0 +1,103 @@
+select htf_appletopen('"q Я"',3,4,'c" Я');
+select htf_address('"qw Я"','"qa Я"','"qs Я"','c" Я');
+select htf_address('','','','');
+select htf_bodyopen('"qw Я"','"qw Я"');
+select htf_escape_sc('"qw Я"');
+select htf_escape_sc('');
+select htf_escape_url(NULL);
+select htf_formselectopen('"q Я"','"qSa - Я"',4,'c" Я');
+select htf_mapopen('"qw Я"','"qw Я"');
+select htf_mapopen(NULL,NULL);
+select htf_formtext('"qw Я"','"qa Я"','"qs Я"','c" Я', 'att"rib');
+select htf_formtext(NULL,NULL,NULL,NULL,NULL);
+select htf_formtextareaopen('"qw Я"',2.2,7,'c" Я', 'att"rib');
+select htf_formtextareaopen(NULL,NULL,NULL,NULL,NULL);
+select htf_formtextareaopen2('"qw Я"',2.2,7,'c" Я','c" Я', 'att"rib');
+select htf_formtextarea('"qw Я"',2.2, 7, 'c" Я', 'att"rib');
+select htf_formtextarea2(NULL,NULL,NULL,NULL,NULL,NULL);
+select htf_anchor(NULL,NULL,NULL,NULL);
+select htf_anchor('','','','');
+select htf_anchor('"q Я"','"q Я"','"q Я"','"q Я"');
+select htf_anchor2(NULL,NULL,NULL,NULL,NULL);
+select htf_anchor2('','','','','');
+select htf_anchor2('"q Я"','"q Я"','"q Я"','"q Я"','"q Я"');
+select htf_area('"q Я"','"q Я"','"q Я"','"q Я"','"q Я"','"q Я"');
+select htf_area(NULL,NULL,NULL,NULL,NULL,NULL);
+select htf_center(NULL);
+select htf_center('"q Я"');
+select htf_cite('"qw Я"','"qw Я"');
+select htf_cite(NULL, NULL);
+select htf_code(NULL, NULL);
+select htf_code('"qw Я"','"qw Я"');
+select htf_codepoint('Яa"qw Я"');
+select htf_comment(' "qw Я"');
+select htf_comment(NULL);
+select htf_dfn('"qw Я"','"qw Я"');
+select htf_dfn(NULL, NULL);
+select htf_div('"qw Я"','"qw Я"');
+select htf_div(NULL, NULL);
+select htf_dlistdef('"qw Я"','"q-w Я"','"qw Я"');
+select htf_dlistdef(NULL, NULL, NULL);
+select htf_dlistopen('"qw Я"','"q-w Я"');
+select htf_dlistopen(NULL, NULL);
+select htf_dlistterm('"qw Я"','"q-w Я"','"qw Я"');
+select htf_em('"qw Я"','"qw Я"');
+select htf_em(NULL, NULL);
+select htf_emphasis(NULL, NULL);
+select htf_emphasis('"qw Я"','"qw Я"');
+select htf_fontopen(NULL, NULL, NULL, NULL);
+select htf_fontopen('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_format_cell(NULL, NULL);
+select htf_format_cell('"qw Я"','a="s"');
+select htf_formcheckbox(NULL, NULL, NULL, NULL);
+select htf_formcheckbox('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_formfile(NULL, NULL, NULL);
+select htf_formfile('"qw Я"','"qw Я"','"qw Я"');
+select htf_formhidden(NULL, NULL, NULL);
+select htf_formhidden('"qw Я"','"qw Я"','"qw Я"');
+select htf_formimage(NULL, NULL, NULL, NULL);
+select htf_formimage('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_formopen(NULL, NULL, NULL, NULL, NULL);
+select htf_formopen('"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_formpassword(NULL, NULL, NULL, NULL, NULL);
+select htf_formpassword('"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_formradio(NULL, NULL, NULL, NULL);
+select htf_formradio('"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_formreset(NULL, NULL);
+select htf_formreset('"qw Я"', '"qw Я"');
+select htf_formselectoption(NULL, NULL, NULL);
+select htf_formselectoption('"qw Я"1','"qw Я"2','"qw Я"3');
+select htf_formsubmit(NULL, NULL, NULL);
+select htf_formsubmit('"qw Я"','"qw Я"','"qw Я"');
+select htf_frame(NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+select htf_frame('"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_framesetopen(NULL, NULL, NULL);
+select htf_framesetopen('"qw Я"','"qw Я"','"qw Я"');
+select htf_header(NULL, NULL, NULL, NULL, NULL, NULL);
+select htf_header(4,'"qw Я"','"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_hr(NULL, NULL, NULL);
+select htf_hr('"qw Я"','"qw Я"','"qw Я"');
+select htf_htitle(NULL, NULL, NULL, NULL, NULL, NULL);
+select htf_htitle('1"qw Я"',1, '2"qw Я"','3"qw Я"','4"qw Я"','5"qw Я"');
+select htf_img(NULL, NULL, NULL, NULL, NULL);
+select htf_img('"qw Я"', '"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_img2(NULL, NULL, NULL, NULL, NULL, NULL);
+select htf_img2('"qw Я"','"qw Я"', '"qw Я"','"qw Я"','"qw Я"','"qw Я"');
+select htf_isindex(NULL, NULL);
+select htf_isindex('"qw Я"','"qw Я"');
+select htf_italic(NULL, NULL);
+select htf_italic('"qw Я"','"qw Я"');
+select htf_kbd(NULL, NULL);
+select htf_kbd('"qw Я"','"qw Я"');
+select htf_keyboard(NULL, NULL);
+select htf_keyboard('"qw Я"','"qw Я"');
+select htf_line(NULL, NULL, NULL);
+select htf_line('"qw Я"','"qw Я"', '"qw Я"');
+select htf_linkrel(NULL, NULL, NULL);
+select htf_linkrel('"qw Я"','"qw Я"', '"qw Я"');
+select htf_linkrev(NULL, NULL, NULL);
+select htf_linkrev('"qw Я"','"qw Я"', '"qw Я"');
+select htf_listheader(NULL, NULL);
+select htf_listheader('"qw Я"','"qw Я"');
+select htf_listitem(NULL, NULL, NULL, NULL, NULL);
+select htf_listitem('"qw Я"', '"qw Я"','"qw Я"','"qw Я"','"qw Я"');
diff --git a/src/test/regress/sql/htp.sql b/src/test/regress/sql/htp.sql
new file mode 100644
index 0000000..52dc498
--- /dev/null
+++ b/src/test/regress/sql/htp.sql
@@ -0,0 +1,163 @@
+select htp_enable_test_mode(1);
+
+select htp_appletopen('my_app=let.class&я', 100, 200, 'f');
+select htp_appletclose();
+select htp_blockquoteopen('1', '2', '3');
+select htp_blockquoteclose();
+select htp_blockquoteopen('s', '12.,3_-_321 Россия!', 'id="my_quote" !@#$%^&*( .');
+select htp_blockquoteclose();
+select htp_bodyopen('/images/background.gif.Стиль', 'Вася BGPROPERTIES="fixed"');
+select htp_bodyclose();
+select htp_dlistopen('hjv', 'class="my-definition-list"');
+select htp_dlistclose();
+select htp_formopen('/cgi-bin/&search.pl', 'G/ET-я', 'Яr/esults_frame', 'Яr/e', 'name="search_form" class="search-form"');
+select htp_formclose();
+select htp_fontopen('BL/UE', 'Verd/ana', '3/4', 'name="search_form" class="search-form"');
+select htp_fontclose();
+select htp_formselectopen('"hobby_list', 'Ва"ши хобби: ', 8.7, 'multiple style="width: 200px;"');
+select htp_formselectclose();
+select htp_framesetopen('', '25%, 75%', 'border="1"');
+select htp_framesetclose();
+select htp_mapopen(NULL, NULL);
+select htp_mapclose();
+select htp_olistopen('both"', 'soft"', NULL);
+select htp_olistclose();
+select htp_preopen('both"', '80"', 'class="source-code" style="font-size:12px;"');
+select htp_preclose();
+select htp_tableopen(' ', ' ', ' ', ' ', ' ');
+select htp_tableclose();
+select htp_tablerowopen('CENTER"', 'MIDDLE"', '1"', 'yes"', 'style="background-color: #E0E0E0;"');
+select htp_tablerowclose();
+select htp_ulistopen('a"', 'HORIZ"', '⚡', 'd"', 'class="energy-list" id="main"');
+select htp_ulistclose();
+select htp_centeropen();
+select htp_centerclose();
+select htp_dirlistopen();
+select htp_dirlistclose();
+select htp_headopen();
+select htp_headclose();
+select htp_htmlopen();
+select htp_htmlclose();
+select htp_listingopen();
+select htp_listingclose();
+select htp_menulistopen();
+select htp_menulistclose();
+select htp_noframesopen();
+select htp_noframesclose();
+select htp_escape_sc('Россия qwerasdf1234" & . @ '' ');
+select htp_escape_sc('Visit <our site> & enjoy! !@#$%^&*()_+|/');
+select htp_formcheckbox('"interests', '"travel', '9', 'style="color: blue;"');
+select htp_formfile('"interests', '"travel', 'style="color: blue;"');
+select htp_formhidden('"i', '"t', 'style="c"');
+select htp_formimage('"i', '"t', '"','style="c"');
+select htp_formpassword('"i', '"t', '"','"w"', 'style="c"');
+select htp_formradio('"i', '"t', '"', 'style="c"');
+select htp_formreset('"i', 'style="c"');
+select htp_formselectoption('"i', '"','style="c"');
+select htp_formsubmit('"i', '"','style="c"');
+select htp_formtext('"i', '"','"9"', '"2"', 'style="c"');
+select htp_formtextarea('"i', 2, 9, '"2"', 'style="c"');
+select htp_formtextarea2('"i', 2.9, 9, '"2"', ' ', 'style="c"');
+select htp_address(NULL, '', 'Б"al l*', 'style="font-style: italic;"');
+select htp_anchor(NULL, 'NEW* сайт', 'x"в', 'class="external"');
+select htp_area('x"в','x"в','x"в','x"в','x"в', 'b"Я');
+
+-- htp_em tests
+select htp_em('NICE');
+select htp_em('найс'); -- converts russian symbols in html unicode codes
+select htp_em('🙂'); -- emoji is converted to html unicode too
+select htp_em('<script>alert(1)</script>');
+select htp_em('Test ''Single Quotes''');
+select htp_em('A < B > C & D');
+select htp_em('Tab s Here');
+select htp_em('Line
+Break');
+select htp_em(''); -- Empty string
+select htp_em(NULL); -- NULL value
+select htp_em(' '); -- Single space
+select htp_em('Emphasized', 'class="highlight"');
+select htp_em('Text', 'style="font-weight: bold;"');
+select htp_em('Link', 'id="my-id"');
+select htp_em('Mixed', 'class="test" id="x" style="color:red"');
+select htp_em('<script>', 'onclick="alert(1)"');
+select htp_em('Text', 'data-value="<script>"');
+select htp_em('Emphasized');
+select htp_em(NULL, 'class="test"');
+select htp_em('Text', NULL);
+select htp_em('Text', '');
+select htp_em(NULL, NULL);
+
+-- htp_frame tests
+select htp_frame('https://awww.ru');
+select htp_frame('найс'); -- outputs unicode
+select htp_frame('<script>alert(1)</script>');
+select htp_frame('A < B > C & D');
+select htp_frame('Line
+Break');
+select htp_frame(''); -- Empty string
+select htp_frame(NULL); -- NULL value
+select htp_frame(' ');
+select htp_frame('Col1 Col2 Col3'); -- Tab handling
+select htp_frame(chr(9) || 'Test' || chr(9));
+select htp_frame('https://awww.ru', 'art site', '100', '100', 'yes', '555', 'index_rate=100'); -- name escapes space!
+select htp_frame('https://awww.ru', 'space_test', '1 00', '10 0', 'ye s', '555', 'index_rate=10 0'); -- all attrs are escaping space but not cattr
+select htp_frame('https://awww.ru', '555', 'abc', 'zyx', '444', 'canresize', 'index_rate=100'); -- attrs are messed up logically
+select htp_frame('https://awww.ru', 'абв', 'где', 'ёжз', 'ийк', 'лмн', 'index_rate=опр'); -- attrs are escaping unicode, noresize is ok, cattrs is not escaped
+select htp_frame('https://awww.ru', 'symbols_linebreaks_test', 'F < G > H & I',
+ 'J < K >
+ L & M', 'E < O > P & N',
+ 'Q < R > S & T', 'U < V > W & X');
+select htp_frame('https://spaces.nul0', '', '', '', '', '', '');
+select htp_frame('https://spaces.nul1', ' ', ' ', ' ', ' ', ' ', ' ');
+select htp_frame('https://symbols.esc', '\n', '\r', '\t', '\\', '\n', '\n'); -- '\' is escaped as html unicode for attrs
+
+-- htp_header tests
+select htp_header(NULL, 'Invalid tag');
+select htp_header(1, 'Pretty Normal');
+select htp_header(7, 'Tag overflow'); -- 7 is converted to 6
+select htp_header(0, 'Invalid 0 tag'); -- 0 is okay
+select htp_header(13, 'найс'); -- converts russian symbols in html unicode codes
+select htp_header(-2, '🙂'); -- emoji is converted to html unicode too, -2 is 2
+select htp_header(-12, '🙂'); -- emoji is converted to html unicode too, -12 is 6
+select htp_header(1, '<script>alert(1)</script>');
+select htp_header(1, 'A < B > C & D');
+select htp_header(1, 'Line
+Break');
+select htp_header(1, ''); -- Empty string
+select htp_header(1, NULL); -- NULL value
+select htp_header(1, ' '); -- Single space
+select htp_header(1, 'A < B > C & D', 'A < B > C & D', 'A < B > C & D', 'A < B > C & D', 'A < B > C & D');
+select htp_header(2, '', '', '', '', '');
+
+-- OWA_UTIL.SHOWPAGE extended call form with HTP output
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'HTP_SHOWPAGE_UTILS_BODY';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM htp_p('HTP_SHOWPAGE_UTILS_BODY'::varchar2);
+ PERFORM owa_util_showpage_utils(0::int4);
+END $$;
+
+-- htp_dlistterm tests
+select htp_dlistterm();
+select htp_dlistterm('anna');
+select htp_dlistterm(NULL);
+select htp_dlistterm('');
+select htp_dlistterm('найс'); -- converts russian symbols in html unicode codes
+select htp_dlistterm('🙂'); -- emoji is converted to html unicode too
+select htp_dlistterm('<script>alert(1)</script>');
+select htp_dlistterm('A < B > C & D'); -- converts special symbols to html unicode
+select htp_dlistterm('Line
+Break');
+select htp_dlistterm('some term', 'not clear', 'index_rate=100'); -- cclear escapes space
+select htp_dlistterm('ийк', 'лмн', 'index_rate=опр');
+select htp_dlistterm('E < O > P & N', 'Q < R > S & T', 'U < V > W & X');
+select htp_dlistterm('', '', '');
+select htp_dlistterm(' ', ' ', ' '); -- cclear escapes space
+select htp_dlistterm('\n', '\r', '\t'); -- cclear escapes slash
+select htp_dlistterm(chr(9) || 'Test' || chr(9), 'Col1 Col2 Col3', chr(9) || 'Test' || chr(9)); -- cclear escapes tabs
+select htp_dlistterm(chr(1) || chr(2) || chr(3), chr(27), chr(8));
+
+select htp_enable_test_mode(0);
diff --git a/src/test/regress/sql/is_valid_function.sql b/src/test/regress/sql/is_valid_function.sql
new file mode 100644
index 0000000..715b8d8
--- /dev/null
+++ b/src/test/regress/sql/is_valid_function.sql
@@ -0,0 +1,96 @@
+-- ТЕСТ 1: Элементарный тест (Валидные данные)
+DO $$
+DECLARE
+ v_res integer;
+BEGIN
+ RAISE NOTICE 'Expected: 1';
+ v_res := dbms_json_schema_is_valid('{"id": 1}'::jsonb, '{"type": "object"}'::jsonb);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- ТЕСТ 2: Граничное условие (Пустой объект и пустая схема)
+DO $$
+DECLARE
+ v_res integer;
+BEGIN
+ RAISE NOTICE 'Expected: 1';
+ v_res := dbms_json_schema_is_valid('{}'::jsonb, '{}'::jsonb);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- ТЕСТ 3: Отрицательный тест (Данные не соответствуют типу в схеме)
+DO $$
+DECLARE
+ v_res integer;
+BEGIN
+ RAISE NOTICE 'Expected: 0';
+ v_res := dbms_json_schema_is_valid('{"age": "ten"}'::jsonb, '{"properties":{"age":{"type":"number"}}}'::jsonb);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- ТЕСТ 4: Исключение при RAISE_ERROR (Невалидная сама схема)
+DO $$
+DECLARE
+ v_res integer;
+ -- В Oracle RAISE_ERROR обычно константа 1
+ RAISE_ERROR integer := 1;
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ v_res := dbms_json_schema_is_valid(
+ '{"a":1}'::jsonb,
+ '{"type": "unknown_type"}'::jsonb,
+ RAISE_ERROR
+ );
+ RAISE NOTICE 'Actual: %', v_res;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+
+-- ТЕСТ 5: Ошибка при NULL входах
+DO $$
+DECLARE
+ v_res integer;
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ v_res := dbms_json_schema_is_valid(NULL, '{}'::jsonb);
+ RAISE NOTICE 'Actual: %', v_res;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+
+-- ТЕСТ 6: Сложный вложенный JSON (Невалидный -> возврат 0)
+DO $$
+DECLARE
+ v_data jsonb;
+ v_schema jsonb;
+ v_res integer;
+BEGIN
+ RAISE NOTICE 'Expected: 0';
+ v_data := '{"a": {"b": 100}}'::jsonb;
+ v_schema := '{"properties": {"a": {"properties": {"b": {"type": "string"}}}}}'::jsonb;
+ v_res := dbms_json_schema_is_valid(v_data, v_schema);
+ RAISE NOTICE 'Actual: %', v_res;
+END $$;
+
+-- ТЕСТ 7: Исключение (Синтаксическая ошибка в схеме + RAISE_ERROR)
+DO $$
+DECLARE
+ v_res integer;
+ RAISE_ERROR integer := 1;
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ v_res := dbms_json_schema_is_valid(
+ '{"a":1}'::jsonb,
+ '{"type": "invalid"}'::jsonb,
+ RAISE_ERROR
+ );
+ RAISE NOTICE 'Actual: %', v_res;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
diff --git a/src/test/regress/sql/is_valid_function_oracle.sql b/src/test/regress/sql/is_valid_function_oracle.sql
new file mode 100755
index 0000000..3034684
--- /dev/null
+++ b/src/test/regress/sql/is_valid_function_oracle.sql
@@ -0,0 +1,101 @@
+-- ТЕСТ 1: Элементарный тест (Валидные данные)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 1');
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(JSON('{"id": 1}'), JSON('{"type": "object"}'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- ТЕСТ 2: Граничное условие (Пустой объект и пустая схема)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 1');
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(JSON('{}'), JSON('{}'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- ТЕСТ 3: Отрицательный тест (Данные не соответствуют типу в схеме) (Дубль №6).
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 0');
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(JSON('{"age": "ten"}'), JSON('{"properties":{"age":{"type":"number"}}}'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- ТЕСТ 4: Исключение при RAISE_ERROR (Невалидная сама схема)
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(
+ JSON('{"a":1}'),
+ JSON('{"type": "unknown_type"}'),
+ DBMS_JSON_SCHEMA.RAISE_ERROR
+ );
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- ТЕСТ 5: Ошибка при NULL входах
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(NULL, JSON('{}'));
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- ТЕСТ 6: Сложный вложенный JSON (Невалидный -> возврат 0)
+SET SERVEROUTPUT ON
+DECLARE
+ v_data JSON;
+ v_schema JSON;
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: 0');
+ v_data := JSON('{"a": {"b": 100}}');
+ v_schema := JSON('{"properties": {"a": {"properties": {"b": {"type": "string"}}}}}');
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(v_data, v_schema);
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+END;
+/
+
+-- ТЕСТ 7: Исключение (Синтаксическая ошибка в схеме + RAISE_ERROR) (Дубль №4).
+SET SERVEROUTPUT ON
+DECLARE
+ v_res PLS_INTEGER;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ -- Ошибка: лишняя запятая или неверный тип
+ v_res := DBMS_JSON_SCHEMA.IS_VALID(
+ JSON('{"a":1}'),
+ JSON('{"type": "invalid"}'),
+ DBMS_JSON_SCHEMA.RAISE_ERROR
+ );
+ DBMS_OUTPUT.PUT_LINE('Actual: ' || v_res);
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+
+
+
diff --git a/src/test/regress/sql/owa_cache.sql b/src/test/regress/sql/owa_cache.sql
new file mode 100644
index 0000000..68a686a
--- /dev/null
+++ b/src/test/regress/sql/owa_cache.sql
@@ -0,0 +1,561 @@
+-- SET_CACHE
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ETag: "v1"';
+ RAISE NOTICE 'Cache-Control: no-cache, private';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_util_showpage();
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ETag: "v1"';
+ RAISE NOTICE 'Cache-Control: no-cache, public';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('v1', 'SYSTEM');
+ PERFORM owa_util_showpage();
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache(REPEAT('1', 56), 'USER');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('tag', 'INVALID_LEVEL');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+
+-- SET_EXPIRES
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(60, 'USER');
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(1, 'SYSTEM');
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(0, 'USER');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(60, 'NOT_A_LEVEL');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+
+-- GET_LEVEL
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Level: ';
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Level: USER';
+ nm[1] := 'OWA_CACHE_LEVEL';
+ vl[1] := 'USER';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+
+-- SET_REQUEST_LEVEL
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Level: USER';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_level('USER');
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_level('INVALID_LEVEL');
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END;
+$$;
+
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Level: SYSTEM';
+ nm[1] := 'HTTP_OWA_CACHE_LEVEL';
+ vl[1] := 'SYSTEM';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Actual: Level: %', COALESCE(owa_cache_get_level(), '');
+END;
+$$;
+
+-- SET_NOT_MODIFIED: успешный сценарий при совпадении request/response ETag
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v1';
+ nm[2] := 'REQUEST_PROTOCOL';
+ vl[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, nm, vl);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success';
+END $$;
+
+-- SET_NOT_MODIFIED: request-side level участвует в сравнении
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success (No match by level)';
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v1';
+ nm[2] := 'REQUEST_PROTOCOL';
+ vl[2] := 'HTTP/1.1';
+ nm[3] := 'OWA_CACHE_LEVEL';
+ vl[3] := 'SYSTEM';
+ PERFORM owa_init_cgi_env(3, nm, vl);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success (No match by level)';
+END $$;
+
+-- SET_NOT_MODIFIED: без REQUEST_PROTOCOL совпавший ETag дает исключение
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v1';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ BEGIN
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+
+--------------------------------------------------------------------------------
+-- Set Not Modified part 2.
+--------------------------------------------------------------------------------
+
+-- Тест 1: Элементарный успех
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ v_n[1] := 'HTTP_IF_NONE_MATCH'; v_v[1] := 'v1';
+ v_n[2] := 'REQUEST_PROTOCOL'; v_v[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, v_n, v_v);
+ PERFORM owa_cache_set_cache('v1', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 2: Исключение на NULL
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ PERFORM owa_init_cgi_env(0, v_n, v_v);
+ PERFORM owa_cache_set_cache(NULL, 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 3: XML успех
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ v_n[1] := 'HTTP_IF_NONE_MATCH'; v_v[1] := '<a><b>1</b></a>';
+ v_n[2] := 'REQUEST_PROTOCOL'; v_v[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, v_n, v_v);
+ PERFORM owa_cache_set_cache('<a><b>1</b></a>', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 4: Несовпадение
+DO $$
+DECLARE
+ v_n text[];
+ v_v text[];
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success (No match)';
+ v_n[1] := 'HTTP_IF_NONE_MATCH'; v_v[1] := 'old';
+ v_n[2] := 'REQUEST_PROTOCOL'; v_v[2] := 'HTTP/1.1';
+ PERFORM owa_init_cgi_env(2, v_n, v_v);
+ PERFORM owa_cache_set_cache('new', 'USER');
+ PERFORM owa_cache_set_not_modified();
+ RAISE NOTICE 'Actual: Status: Success (No match)';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+
+
+
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag---------------------------------
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag--------------------------------
+-- 1. Элементарный тест: GET_ETAG до установки значения
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ RAISE NOTICE 'Expected: ETag: ';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+
+-- 2. Входящий ETag через CGI
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'v123';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: v123';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+
+-- 3. GET_ETAG после SET_CACHE не должен читать response-side context
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ PERFORM owa_cache_set_cache('NEW_TAG', 'USER');
+ RAISE NOTICE 'Expected: ETag: ';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+
+-- 4. XML структура во входящем ETag
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := '<r><id>1</id><v>A</v></r>';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: <r><id>1</id><v>A</v></r>';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+
+-- 5. Граничное условие: 55 символов во входящем ETag
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+ v_tag TEXT := 'TAG_123456789012345678901234567890123456789012345678901';
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := v_tag;
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: %', v_tag;
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+
+-- 6. Прямой вызов SET_REQUEST_ETAG
+DO $$
+DECLARE
+ v_tag TEXT := 'DIRECT_ETAG';
+BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_etag(v_tag);
+ RAISE NOTICE 'Expected: ETag: %', v_tag;
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag(), '');
+END $$;
+
+-- 7. Входящий ETag через расширенную форму чтения
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ nm[1] := 'HTTP_IF_NONE_MATCH';
+ vl[1] := 'service-etag';
+ PERFORM owa_init_cgi_env(1, nm, vl);
+ RAISE NOTICE 'Expected: ETag: service-etag';
+ RAISE NOTICE 'Actual: ETag: %', COALESCE(owa_cache_get_etag2(0::int4), '');
+END $$;
+
+-- 8. Тест на исключение: слишком длинный ETag в SET_REQUEST_ETAG
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_request_etag(REPEAT('q', 56));
+ RAISE NOTICE 'Actual: Success';
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+
+-- 9. Тест на исключение (Невалидный уровень в SET_CACHE)
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ RAISE NOTICE 'Expected: Caught exception';
+ BEGIN
+ PERFORM owa_cache_set_cache('tag', 'INVALID_LEVEL');
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+ END;
+END $$;
+
+
+--SET_SURROGATE_CONTROL
+
+-- Тест 1: Элементарный успех
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_cache_set_surrogate_control('content="ORA:20"');
+ RAISE NOTICE 'Actual: Status: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 2: Исключение на NULL
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ PERFORM owa_cache_set_surrogate_control(NULL);
+ RAISE NOTICE 'Actual: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 3: XML успех
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_cache_set_surrogate_control('<cache><ttl>60</ttl></cache>');
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+
+-- Тест 4: Граничное условие 55 символов
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Status: Success';
+ PERFORM owa_cache_set_surrogate_control(REPEAT('x', 55));
+ RAISE NOTICE 'Actual: Status: Success';
+END;
+$$;
+
+-- Тест 5: Исключение на 56 символов
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected: Caught exception';
+ PERFORM owa_cache_set_surrogate_control(REPEAT('a', 56));
+ RAISE NOTICE 'Actual: Success';
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+--6
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ PERFORM owa_cache_set_surrogate_control('content="ORA:20"');
+ PERFORM owa_util_showpage();
+END;
+$$;
+
+--7
+DO $$
+DECLARE
+ nm text[];
+ vl text[];
+BEGIN
+ PERFORM owa_init_cgi_env(0, nm, vl);
+ PERFORM owa_cache_set_surrogate_control('<cache><ttl>60</ttl></cache>');
+ PERFORM owa_util_showpage();
+END;
+$$;
+
+
+--DISABLE
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_CACHE';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_cache('v_disable', 'USER');
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_CACHE'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 2: SET_EXPIRES + DISABLE оставляет только body.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_EXPIRES';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_set_expires(60, 'USER');
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_EXPIRES'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 3: Повторный вызов DISABLE не ломает body.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_REPEAT';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_disable();
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_REPEAT'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
+
+-- Тест 4: Без REQUEST_PROTOCOL body тоже выводится.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_DISABLE_NO_PROTOCOL';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env(0, NULL, NULL);
+ PERFORM owa_cache_disable();
+ PERFORM htp_p('BODY_DISABLE_NO_PROTOCOL'::varchar2);
+ PERFORM owa_util_showpage();
+EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Actual: Caught exception';
+END;
+$$;
\ No newline at end of file
diff --git a/src/test/regress/sql/owa_cache_oracle.sql b/src/test/regress/sql/owa_cache_oracle.sql
new file mode 100644
index 0000000..ece64cc
--- /dev/null
+++ b/src/test/regress/sql/owa_cache_oracle.sql
@@ -0,0 +1,623 @@
+
+-- 1. Элементарный тест SET_CACHE (USER)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_cache('v1', 'USER');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 2. Элементарный тест SET_CACHE (SYSTEM)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_cache('v1', 'SYSTEM');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 3. Граничное условие: ETag ровно 55 символов
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_cache('1234567890123456789012345678901234567890123456789012345', 'USER');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 4. Исключение: ETag > 55 символов (56 символов)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ owa_cache.set_cache('12345678901234567890123456789012345678901234567890123456', 'USER');
+EXCEPTION WHEN VALUE_ERROR THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+ -- SQLCODE -06502
+END;
+/
+
+-- 5. Исключение: Неверный уровень в SET_CACHE
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ owa_cache.set_cache('v1', 'PRIVATE');
+EXCEPTION WHEN VALUE_ERROR THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- 6. Тест SET_CACHE с XML структурой в качестве ETag (простой)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_cache('<id>101</id>', 'USER');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 7. Тест SET_CACHE со сложной XML структурой (в пределах 55 символов)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_cache('<root><item id="1" val="A"/></root>', 'SYSTEM');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 8. Элементарный тест SET_EXPIRES
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_expires(60, 'USER');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 9. Граничное условие: SET_EXPIRES минимальное значение (1)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_expires(1, 'SYSTEM');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 10. Граничное условие: SET_EXPIRES максимальное значение (525600)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ owa_cache.set_expires(525600, 'USER');
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+END;
+/
+
+-- 11. Исключение: SET_EXPIRES значение ноль
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ owa_cache.set_expires(0, 'USER');
+EXCEPTION WHEN VALUE_ERROR THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- 12. Исключение: SET_EXPIRES значение выше лимита (525601)
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ owa_cache.set_expires(525601, 'USER');
+EXCEPTION WHEN VALUE_ERROR THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- 13. Исключение: SET_EXPIRES отрицательное значение
+SET SERVEROUTPUT ON
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ owa_cache.set_expires(-10, 'USER');
+EXCEPTION WHEN VALUE_ERROR THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+-- GET_LEVEL
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ owa.init_cgi_env(0, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: Level: ');
+ DBMS_OUTPUT.PUT_LINE('Actual: Level: ' || owa_cache.get_level);
+END;
+/
+
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ nm(1) := 'OWA_CACHE_LEVEL'; vl(1) := 'USER';
+ owa.init_cgi_env(1, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: Level: USER');
+ DBMS_OUTPUT.PUT_LINE('Actual: Level: ' || owa_cache.get_level);
+END;
+/
+
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ nm(1) := 'HTTP_OWA_CACHE_LEVEL'; vl(1) := 'SYSTEM';
+ owa.init_cgi_env(1, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: Level: SYSTEM');
+ DBMS_OUTPUT.PUT_LINE('Actual: Level: ' || owa_cache.get_level);
+END;
+/
+
+
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag---------------------------------
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag--------------------------------
+--ETag ETag ETag--------------------------------
+
+-- 1. Элементарный тест: Чтение пустого значения (начальное состояние)
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ owa.init_cgi_env(0, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: ETag: ');
+ DBMS_OUTPUT.PUT_LINE('Actual: ETag: ' || owa_cache.get_etag);
+END;
+/
+
+-- 2. Попытка эмуляции входящего ETag через CGI (Проверка особенности)
+-- Мы передаем заголовок, но увидим, вернет ли его get_etag в этой версии БД
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ nm(1) := 'HTTP_IF_NONE_MATCH'; vl(1) := 'v123';
+ owa.init_cgi_env(1, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: ETag: ');
+ DBMS_OUTPUT.PUT_LINE('Actual: ETag: ' || owa_cache.get_etag);
+END;
+/
+
+-- 3. Тест: GET_ETAG после SET_CACHE (Разделение входа и выхода)
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ owa.init_cgi_env(0, nm, vl);
+ owa_cache.set_cache('NEW_TAG', 'USER');
+ DBMS_OUTPUT.PUT_LINE('Expected: ETag: ');
+ DBMS_OUTPUT.PUT_LINE('Actual: ETag: ' || owa_cache.get_etag);
+END;
+/
+
+-- 4. Тест: XML структура из нескольких завершенных узлов
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ nm(1) := 'HTTP_IF_NONE_MATCH'; vl(1) := '<r><id>1</id><v>A</v></r>';
+ owa.init_cgi_env(1, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: ETag: ');
+ DBMS_OUTPUT.PUT_LINE('Actual: ETag: ' || owa_cache.get_etag);
+END;
+/
+
+-- 5. Граничное условие: Ровно 55 символов во входящем теге
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+ v_tag VARCHAR2(55) := 'TAG_123456789012345678901234567890123456789012345678901';
+BEGIN
+ nm(1) := 'HTTP_IF_NONE_MATCH'; vl(1) := v_tag;
+ owa.init_cgi_env(1, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: ETag: ');
+ DBMS_OUTPUT.PUT_LINE('Actual: ETag: ' || owa_cache.get_etag);
+END;
+/
+
+-- 6. Тест на исключение: Валидация p_level в связанном методе set_cache
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ owa.init_cgi_env(0, nm, vl);
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ BEGIN
+ owa_cache.set_cache('tag', 'INVALID_LEVEL');
+ EXCEPTION WHEN VALUE_ERROR THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+ END;
+END;
+/
+
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Status: Success');
+ nm(1) := 'HTTP_IF_NONE_MATCH'; vl(1) := 'v1';
+ nm(2) := 'REQUEST_PROTOCOL'; vl(2) := 'HTTP/1.1';
+ owa.init_cgi_env(2, nm, vl);
+ owa_cache.set_cache('v1', 'USER');
+ owa_cache.set_not_modified;
+ DBMS_OUTPUT.PUT_LINE('Actual: Status: Success');
+END;
+/
+
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Status: Success (No match by level)');
+ nm(1) := 'HTTP_IF_NONE_MATCH'; vl(1) := 'v1';
+ nm(2) := 'REQUEST_PROTOCOL'; vl(2) := 'HTTP/1.1';
+ nm(3) := 'OWA_CACHE_LEVEL'; vl(3) := 'SYSTEM';
+ owa.init_cgi_env(3, nm, vl);
+ owa_cache.set_cache('v1', 'USER');
+ owa_cache.set_not_modified;
+ DBMS_OUTPUT.PUT_LINE('Actual: Status: Success (No match by level)');
+END;
+/
+
+SET SERVEROUTPUT ON
+DECLARE
+ nm owa.vc_arr; vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ nm(1) := 'HTTP_IF_NONE_MATCH'; vl(1) := 'v1';
+ owa.init_cgi_env(1, nm, vl);
+ BEGIN
+ owa_cache.set_cache('v1', 'USER');
+ owa_cache.set_not_modified;
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+ EXCEPTION WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+ END;
+END;
+/
+
+
+--SET_NOT_MODIFIED
+
+
+SET SERVEROUTPUT ON
+-- Тест 1: Элементарный тест. Короткий ETag и валидный уровень.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_CACHE('123', 'USER');
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Status: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 2: Граничное условие. Пустой ETag (NULL).
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_CACHE(NULL, 'USER');
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 3: Тест для xml из нескольких завершённых узлов.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_xml VARCHAR2(100) := '<a><b>1</b></a>';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_CACHE(v_xml, 'USER');
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 4: Посложнее. Проверка на недопустимый уровень кэширования.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_CACHE('123', 'INVALID_LEVEL_VALUE_TOO_LONG');
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+
+
+--=============================================
+SET SERVEROUTPUT ON
+-- Тест 1: Элементарный тест (УСПЕХ). Совпадение ETag + наличие Протокола.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Status: Success');
+ -- 1. Имитируем заголовок соответствия
+ v_n(1) := 'HTTP_IF_NONE_MATCH'; v_v(1) := 'v1';
+ -- 2. ОБЯЗАТЕЛЬНО: Протокол, иначе OWA_UTIL упадет при попытке выставить 304 статус
+ v_n(2) := 'REQUEST_PROTOCOL'; v_v(2) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(2, v_n, v_v);
+
+ OWA_CACHE.SET_CACHE('v1', 'USER');
+ -- Теперь метод найдет совпадение и сможет корректно вызвать STATUS_LINE(304)
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Status: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception: ' || SQLERRM);
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 2: Граничное условие (ИСКЛЮЧЕНИЕ). NULL в SET_CACHE всегда запрещен.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_CACHE(NULL, 'USER');
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 3: Тест для xml (УСПЕХ). Совпадение XML структур.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_xml VARCHAR2(100) := '<a><b>1</b></a>';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Status: Success');
+ v_n(1) := 'HTTP_IF_NONE_MATCH'; v_v(1) := v_xml;
+ v_n(2) := 'REQUEST_PROTOCOL'; v_v(2) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(2, v_n, v_v);
+
+ OWA_CACHE.SET_CACHE(v_xml, 'USER');
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Status: Success');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 4: Логика несовпадения (УСПЕХ). Если ETag НЕ совпадает, метод просто ничего не делает.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Status: Success (No match)');
+ v_n(1) := 'HTTP_IF_NONE_MATCH'; v_v(1) := 'old_v';
+ v_n(2) := 'REQUEST_PROTOCOL'; v_v(2) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(2, v_n, v_v);
+
+ OWA_CACHE.SET_CACHE('new_v', 'USER');
+ -- Совпадения нет -> блок кода со статусом 304 пропускается -> ошибки нет.
+ OWA_CACHE.SET_NOT_MODIFIED;
+ DBMS_OUTPUT.PUT_LINE('Actual: Status: Success (No match)');
+EXCEPTION
+ WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE('Actual: Caught exception');
+END;
+/
+
+
+--SET_SURROGATE_CONTROL
+
+SET SERVEROUTPUT ON
+-- Тест 1: Элементарный успешный вызов.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_actual VARCHAR2(4000) := 'Success';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ v_n(1) := 'REQUEST_PROTOCOL'; v_v(1) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(1, v_n, v_v);
+ BEGIN
+ OWA_CACHE.SET_SURROGATE_CONTROL('content="ORA:20"');
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Caught exception';
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 2: NULL даёт исключение.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_actual VARCHAR2(4000) := 'Success';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ v_n(1) := 'REQUEST_PROTOCOL'; v_v(1) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(1, v_n, v_v);
+ BEGIN
+ OWA_CACHE.SET_SURROGATE_CONTROL(NULL);
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Caught exception';
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 3: XML-значение проходит без исключения.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_xml VARCHAR2(100) := '<cache><ttl>60</ttl></cache>';
+ v_actual VARCHAR2(4000) := 'Success';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ v_n(1) := 'REQUEST_PROTOCOL'; v_v(1) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(1, v_n, v_v);
+ BEGIN
+ OWA_CACHE.SET_SURROGATE_CONTROL(v_xml);
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Caught exception';
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 4: Ровно 55 символов проходит без исключения.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_val VARCHAR2(100) := RPAD('max-age=3600, content="part1"', 55, 'x');
+ v_actual VARCHAR2(4000) := 'Success';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Success');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ v_n(1) := 'REQUEST_PROTOCOL'; v_v(1) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(1, v_n, v_v);
+ BEGIN
+ OWA_CACHE.SET_SURROGATE_CONTROL(v_val);
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Caught exception';
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 5: 56 символов, фактическое поведение Oracle в SQL*Plus.
+DECLARE
+ v_n OWA.VC_ARR;
+ v_v OWA.VC_ARR;
+ v_val VARCHAR2(100) := RPAD('a', 56, 'b');
+ v_actual VARCHAR2(4000) := 'Success';
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected: Caught exception');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ v_n(1) := 'REQUEST_PROTOCOL'; v_v(1) := 'HTTP/1.1';
+ OWA.INIT_CGI_ENV(1, v_n, v_v);
+ BEGIN
+ OWA_CACHE.SET_SURROGATE_CONTROL(v_val);
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Caught exception';
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+--DISABLE
+
+SET SERVEROUTPUT ON
+-- Тест 1: BODY выводится и cache-ветка не мешает ответу.
+DECLARE
+ v_n OWA.VC_ARR; v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('BODY_DISABLE_CACHE');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_CACHE('v_disable', 'USER');
+ OWA_CACHE.DISABLE;
+ htp.p('BODY_DISABLE_CACHE');
+ owa_util.showpage;
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 2: SET_EXPIRES + DISABLE оставляет только body.
+DECLARE
+ v_n OWA.VC_ARR; v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('BODY_DISABLE_EXPIRES');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.SET_EXPIRES(60, 'USER');
+ OWA_CACHE.DISABLE;
+ htp.p('BODY_DISABLE_EXPIRES');
+ owa_util.showpage;
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 3: Повторный вызов DISABLE не ломает body.
+DECLARE
+ v_n OWA.VC_ARR; v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('BODY_DISABLE_REPEAT');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.DISABLE;
+ OWA_CACHE.DISABLE;
+ htp.p('BODY_DISABLE_REPEAT');
+ owa_util.showpage;
+END;
+/
+
+SET SERVEROUTPUT ON
+-- Тест 4: Без REQUEST_PROTOCOL body тоже выводится.
+DECLARE
+ v_n OWA.VC_ARR; v_v OWA.VC_ARR;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('BODY_DISABLE_NO_PROTOCOL');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ OWA.INIT_CGI_ENV(0, v_n, v_v);
+ OWA_CACHE.DISABLE;
+ htp.p('BODY_DISABLE_NO_PROTOCOL');
+ owa_util.showpage;
+END;
+/
+
diff --git a/src/test/regress/sql/owa_cookie.sql b/src/test/regress/sql/owa_cookie.sql
new file mode 100644
index 0000000..1638b58
--- /dev/null
+++ b/src/test/regress/sql/owa_cookie.sql
@@ -0,0 +1,188 @@
+-- OWA_COOKIE.SEND behavior checks.
+SET client_min_messages TO notice;
+SET TIME ZONE 'UTC';
+
+-- Test 1: duplicate cookie names must stay as separate Set-Cookie lines.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: session_id=111;';
+ RAISE NOTICE 'Set-Cookie: session_id=222;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('session_id'::varchar2, '111'::varchar2);
+ PERFORM owa_cookie_send('session_id'::varchar2, '222'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- Test 2: expires/path/domain attributes are preserved and formatted.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: test_pref=dark_mode; expires=Thu, 21-May-2026 10:11:12 GMT; path=/app;';
+ RAISE NOTICE 'domain=example.com;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'test_pref'::varchar2,
+ 'dark_mode'::varchar2,
+ '2026-05-21 10:11:12+00'::timestamptz,
+ '/app'::varchar2,
+ 'example.com'::varchar2,
+ NULL::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+
+-- Test 3: body output and cookies keep call order in final page.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Exception SQLSTATE=22023';
+ RAISE NOTICE '<html><body>Hello</body></html>';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM htp_p('<html><body>Hello</body></html>'::varchar2);
+ BEGIN
+ PERFORM owa_cookie_send('late_cookie'::varchar2, 'oops'::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ PERFORM owa_util_showpage();
+END $$;
+
+-- Test 4: smoke check for the basic send call.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: session_id=12345;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('session_id'::varchar2, '12345'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- Test 5: all SEND arguments are provided, including secure.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: all_args_cookie=all_args_value; expires=Fri, 22-May-2026 01:02:03 GMT;';
+ RAISE NOTICE 'path=/secure-zone; domain=example.org; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'all_args_cookie'::varchar2,
+ 'all_args_value'::varchar2,
+ '2026-05-22 01:02:03+00'::timestamptz,
+ '/secure-zone'::varchar2,
+ 'example.org'::varchar2,
+ 'TRUE'::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+
+-- Test 6: CGI initialization accepts the extended call form.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'CGI REQUEST_PROTOCOL=HTTP/1.1';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env2(
+ 1,
+ ARRAY['REQUEST_PROTOCOL']::text[],
+ ARRAY['HTTP/1.1']::text[],
+ 0::int4
+ );
+ RAISE NOTICE 'CGI REQUEST_PROTOCOL=%', owa_util_get_cgi_env('REQUEST_PROTOCOL');
+END $$;
+
+-- CONSTRAINT TEST
+-- Test 7: documented header-context restriction.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'No exception';
+ RAISE NOTICE 'Set-Cookie: no_ctx=x;';
+ RAISE NOTICE 'Actual:';
+ BEGIN
+ PERFORM owa_cookie_send('no_ctx'::varchar2, 'x'::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ IF _actual = 'No exception' THEN
+ PERFORM owa_util_showpage();
+ END IF;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test 8: NULL cookie name behavior.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'No exception';
+ RAISE NOTICE 'Set-Cookie: =x;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(NULL::varchar2, 'x'::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ IF _actual = 'No exception' THEN
+ PERFORM owa_util_showpage();
+ END IF;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test 9: NULL cookie value behavior.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'No exception';
+ RAISE NOTICE 'Set-Cookie: x=;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('x'::varchar2, NULL::varchar2);
+ _actual := 'No exception';
+ EXCEPTION WHEN OTHERS THEN
+ _actual := format('Exception SQLSTATE=%s', SQLSTATE);
+ END;
+ RAISE NOTICE '%', _actual;
+ IF _actual = 'No exception' THEN
+ PERFORM owa_util_showpage();
+ END IF;
+END $$;
+
+-- Test 10: extended SEND form keeps the regular Set-Cookie output.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: service_cookie=service_value;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send2(
+ 'service_cookie'::varchar2,
+ 'service_value'::varchar2,
+ NULL::timestamptz,
+ NULL::varchar2,
+ NULL::varchar2,
+ NULL::varchar2,
+ 0::int4
+ );
+ PERFORM owa_util_showpage();
+END $$;
diff --git a/src/test/regress/sql/owa_cookie_constraints.sql b/src/test/regress/sql/owa_cookie_constraints.sql
new file mode 100644
index 0000000..341b54a
--- /dev/null
+++ b/src/test/regress/sql/owa_cookie_constraints.sql
@@ -0,0 +1,234 @@
+-- Additional OWA_COOKIE.SEND tests.
+SET client_min_messages TO notice;
+SET TIME ZONE 'UTC';
+
+-- Test C01: render order and date format.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: order_check=v1; expires=Fri, 22-May-2026 01:02:03 GMT; path=/a; domain=example.org; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'order_check'::varchar2,
+ 'v1'::varchar2,
+ '2026-05-22 01:02:03+00'::timestamptz,
+ '/a'::varchar2,
+ 'example.org'::varchar2,
+ 'X'::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C02: send before body is allowed.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: before_body=ok;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('before_body'::varchar2, 'ok'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C03: send after body is rejected.
+DO $$
+DECLARE
+ _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR OWA_COOKIE.SEND must be called in HTTP header context';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM htp_p('BODY_ONE'::varchar2);
+ BEGIN
+ PERFORM owa_cookie_send('after_body'::varchar2, 'must_fail'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('OWA_COOKIE.SEND must be called in HTTP header context' in SQLERRM) > 0 THEN
+ _actual := 'ERROR OWA_COOKIE.SEND must be called in HTTP header context';
+ ELSE
+ RAISE;
+ END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C04: after showpage header state is reset and send works again.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'BODY_TWO';
+ RAISE NOTICE 'Set-Cookie: after_flush=ok_again;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM htp_p('BODY_TWO'::varchar2);
+ PERFORM owa_util_showpage();
+ PERFORM owa_cookie_send('after_flush'::varchar2, 'ok_again'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C05: secure NULL => secure attribute absent.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: secure_null=v1;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('secure_null'::varchar2, 'v1'::varchar2, NULL, NULL, NULL, NULL);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C06: secure non-NULL => secure attribute present.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: secure_x=v2; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('secure_x'::varchar2, 'v2'::varchar2, NULL, NULL, NULL, 'X'::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C07: secure empty string (non-NULL) => secure attribute present.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: secure_empty=v3; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send('secure_empty'::varchar2, 'v3'::varchar2, NULL, NULL, NULL, ''::varchar2);
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C08: CR in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(E'bad\rname'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C09: LF in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(E'bad\nname'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C18: non-ASCII in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('имя'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C19: non-ASCII in value.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid character in value';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('n'::varchar2, 'значение'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid character in value' in SQLERRM) > 0 THEN _actual := 'ERROR invalid character in value'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+
+-- Test C23: printable ASCII succeeds.
+DO $$
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'Set-Cookie: ascii_ok=ABC-123_~; path=/ok-path; domain=example.net; secure;';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ PERFORM owa_cookie_send(
+ 'ascii_ok'::varchar2,
+ 'ABC-123_~'::varchar2,
+ NULL,
+ '/ok-path'::varchar2,
+ 'example.net'::varchar2,
+ 'secure-token'::varchar2
+ );
+ PERFORM owa_util_showpage();
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C24: empty name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR cookie name must not be empty';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send(''::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('cookie name must not be empty' in SQLERRM) > 0 THEN _actual := 'ERROR cookie name must not be empty'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
+
+-- CONSTRAINT TEST
+-- Test C25: space in name.
+DO $$
+DECLARE _actual text := 'UNSET';
+BEGIN
+ RAISE NOTICE 'Expected:';
+ RAISE NOTICE 'ERROR invalid cookie name';
+ RAISE NOTICE 'Actual:';
+ PERFORM owa_init_cgi_env();
+ BEGIN
+ PERFORM owa_cookie_send('bad name'::varchar2, 'v'::varchar2);
+ _actual := 'NO_ERROR';
+ EXCEPTION WHEN OTHERS THEN
+ IF position('invalid cookie name' in SQLERRM) > 0 THEN _actual := 'ERROR invalid cookie name'; ELSE RAISE; END IF;
+ END;
+ RAISE NOTICE '%', _actual;
+END $$;
diff --git a/src/test/regress/sql/owa_cookie_constraints_oracle.sql b/src/test/regress/sql/owa_cookie_constraints_oracle.sql
new file mode 100644
index 0000000..072b011
--- /dev/null
+++ b/src/test/regress/sql/owa_cookie_constraints_oracle.sql
@@ -0,0 +1,334 @@
+-- Oracle syntax version of owa_cookie_constraints tests.
+-- Reduced to non-duplicate checks based on final Oracle output.
+
+SET SERVEROUTPUT ON
+
+-- Test C01: render order and date format.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: order_check=v1; expires=Fri, 22-May-2026 01:02:03 GMT; path=/a; domain=example.org; secure;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'order_check',
+ value => 'v1',
+ expires => TO_DATE('2026-05-22 01:02:03', 'YYYY-MM-DD HH24:MI:SS'),
+ path => '/a',
+ domain => 'example.org',
+ secure => 'X'
+ );
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C02: send before body is allowed.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: before_body=ok;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send('before_body', 'ok');
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C03: send after body is rejected.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR OWA_COOKIE.SEND must be called in HTTP header context');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ htp.p('BODY_ONE');
+ BEGIN
+ owa_cookie.send('after_body', 'must_fail');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'OWA_COOKIE.SEND must be called in HTTP header context') > 0 THEN
+ v_actual := 'ERROR OWA_COOKIE.SEND must be called in HTTP header context';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C04: after showpage header state is reset and send works again.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Content-type: text/html');
+ DBMS_OUTPUT.PUT_LINE('Content-length: 9');
+ DBMS_OUTPUT.PUT_LINE('');
+ DBMS_OUTPUT.PUT_LINE('BODY_TWO');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: after_flush=ok_again;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ htp.p('BODY_TWO');
+ owa_util.showpage;
+ owa_cookie.send('after_flush', 'ok_again');
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C05: secure NULL => secure attribute absent.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: secure_null=v1;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'secure_null',
+ value => 'v1'
+ );
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C06: secure non-NULL => secure attribute present.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: secure_x=v2; secure;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'secure_x',
+ value => 'v2',
+ secure => 'X'
+ );
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C07: secure empty string (non-NULL) Oracle behavior.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: secure_empty=v3; secure;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'secure_empty',
+ value => 'v3',
+ secure => ''
+ );
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C08: CR in name.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR invalid character in name');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => 'bad' || CHR(13) || 'name', value => 'v');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'invalid character in name') > 0 THEN
+ v_actual := 'ERROR invalid character in name';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C09: LF in name.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR invalid character in name');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => 'bad' || CHR(10) || 'name', value => 'v');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'invalid character in name') > 0 THEN
+ v_actual := 'ERROR invalid character in name';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C18: non-ASCII in name.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR invalid character in name');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => 'имя', value => 'v');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'invalid character in name') > 0 THEN
+ v_actual := 'ERROR invalid character in name';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C19: non-ASCII in value.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR invalid character in value');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => 'n', value => 'значение');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'invalid character in value') > 0 THEN
+ v_actual := 'ERROR invalid character in value';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+-- Test C23: printable ASCII succeeds.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: ascii_ok=ABC-123_~; path=/ok-path; domain=example.net; secure;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'ascii_ok',
+ value => 'ABC-123_~',
+ path => '/ok-path',
+ domain => 'example.net',
+ secure => 'secure-token'
+ );
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C24: empty name.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR cookie name must not be empty');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => '', value => 'v');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'cookie name must not be empty') > 0 THEN
+ v_actual := 'ERROR cookie name must not be empty';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test C25: space in name.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('ERROR invalid cookie name');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => 'bad name', value => 'v');
+ v_actual := 'NO_ERROR';
+ EXCEPTION
+ WHEN OTHERS THEN
+ IF INSTR(SQLERRM, 'invalid cookie name') > 0 THEN
+ v_actual := 'ERROR invalid cookie name';
+ ELSE
+ v_actual := 'ERROR SQLCODE=' || SQLCODE;
+ END IF;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+END;
+/
diff --git a/src/test/regress/sql/owa_cookie_oracle.sql b/src/test/regress/sql/owa_cookie_oracle.sql
new file mode 100644
index 0000000..ba8cef1
--- /dev/null
+++ b/src/test/regress/sql/owa_cookie_oracle.sql
@@ -0,0 +1,186 @@
+-- Oracle OWA_COOKIE.SEND behavior checks.
+-- This file mirrors the PostgreSQL test semantics one-to-one.
+
+SET SERVEROUTPUT ON
+
+-- Test 1: duplicate cookie names must stay as separate Set-Cookie lines.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: session_id=111;');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: session_id=222;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send('session_id', '111');
+ owa_cookie.send('session_id', '222');
+ owa_util.showpage;
+END;
+/
+
+-- Test 2: expires/path/domain attributes are preserved and formatted.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: test_pref=dark_mode; expires=Thu, 21-May-2026 10:11:12 GMT; path=/app;');
+ DBMS_OUTPUT.PUT_LINE('domain=example.com;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'test_pref',
+ value => 'dark_mode',
+ expires => TO_DATE('2026-05-21 10:11:12', 'YYYY-MM-DD HH24:MI:SS'),
+ path => '/app',
+ domain => 'example.com'
+ );
+ owa_util.showpage;
+END;
+/
+
+-- Test 3: body output and cookies keep call order in final page.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Exception SQLSTATE=22023');
+ DBMS_OUTPUT.PUT_LINE('<html><body>Hello</body></html>');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ htp.p('<html><body>Hello</body></html>');
+ BEGIN
+ owa_cookie.send('late_cookie', 'oops');
+ v_actual := 'No exception';
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Exception SQLSTATE=22023';
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+ owa_util.showpage;
+END;
+/
+
+-- Test 4: smoke check for the basic send call.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: session_id=12345;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(name => 'session_id', value => '12345');
+ owa_util.showpage;
+END;
+/
+
+-- Test 5: all SEND arguments are provided, including secure.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: all_args_cookie=all_args_value; expires=Fri, 22-May-2026 01:02:03 GMT;');
+ DBMS_OUTPUT.PUT_LINE('path=/secure-zone; domain=example.org; secure;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ owa_cookie.send(
+ name => 'all_args_cookie',
+ value => 'all_args_value',
+ expires => TO_DATE('2026-05-22 01:02:03', 'YYYY-MM-DD HH24:MI:SS'),
+ path => '/secure-zone',
+ domain => 'example.org',
+ secure => 'TRUE'
+ );
+ owa_util.showpage;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test 6: documented header-context restriction.
+DECLARE
+ v_actual VARCHAR2(4000);
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('No exception');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: no_ctx=x;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ BEGIN
+ owa_cookie.send('no_ctx', 'x');
+ v_actual := 'No exception';
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Exception SQLCODE=' || SQLCODE;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+ IF v_actual = 'No exception' THEN
+ owa_util.showpage;
+ END IF;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test 7: NULL cookie name behavior.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('No exception');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: =x;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+
+ BEGIN
+ owa_cookie.send(name => NULL, value => 'x');
+ v_actual := 'No exception';
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Exception SQLCODE=' || SQLCODE;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+ IF v_actual = 'No exception' THEN
+ owa_util.showpage;
+ END IF;
+END;
+/
+
+-- CONSTRAINT TEST
+-- Test 8: NULL cookie value behavior.
+DECLARE
+ nm owa.vc_arr;
+ vl owa.vc_arr;
+ v_actual VARCHAR2(4000);
+BEGIN
+ DBMS_OUTPUT.PUT_LINE('Expected:');
+ DBMS_OUTPUT.PUT_LINE('No exception');
+ DBMS_OUTPUT.PUT_LINE('Set-Cookie: x=;');
+ DBMS_OUTPUT.PUT_LINE('Actual:');
+ htp.init;
+ owa.init_cgi_env(0, nm, vl);
+ BEGIN
+ owa_cookie.send(name => 'x', value => NULL);
+ v_actual := 'No exception';
+ EXCEPTION
+ WHEN OTHERS THEN
+ v_actual := 'Exception SQLCODE=' || SQLCODE;
+ END;
+ DBMS_OUTPUT.PUT_LINE(v_actual);
+ IF v_actual = 'No exception' THEN
+ owa_util.showpage;
+ END IF;
+END;
+/
diff --git a/src/test/regress/sql/owa_pattern.sql b/src/test/regress/sql/owa_pattern.sql
new file mode 100644
index 0000000..deec047
--- /dev/null
+++ b/src/test/regress/sql/owa_pattern.sql
@@ -0,0 +1 @@
+SELECT OWA_PATTERN_MATCH('test 12345', '\\d{5}');
\ No newline at end of file
diff --git a/src/test/regress/sql/utl_file.sql b/src/test/regress/sql/utl_file.sql
index 29d6ad1..9ebd09e 100644
--- a/src/test/regress/sql/utl_file.sql
+++ b/src/test/regress/sql/utl_file.sql
@@ -1,4 +1,5 @@
-- Подготовка окружения для тестов UTL_FILE.
+\! sh -c "rm -rf /tmp/rudb_utl_file_regress && mkdir -m 0777 /tmp/rudb_utl_file_regress"
DO $$
BEGIN
@@ -11,10 +12,10 @@
DELETE FROM utl_file_dir
WHERE dirname = 'UTL_TEST_DIR'
- OR dir = '/tmp';
+ OR dir = '/tmp/rudb_utl_file_regress';
INSERT INTO utl_file_dir (dirname, dir)
-VALUES ('UTL_TEST_DIR', '/tmp');
+VALUES ('UTL_TEST_DIR', '/tmp/rudb_utl_file_regress');
RESET client_min_messages;
END $$;
@@ -370,3 +371,5 @@
RAISE INFO 'utl_file_fremove => %', v_exists::text;
END $$;
+
+\! rm -rf /tmp/rudb_utl_file_regress
diff --git a/src/test/regress/sql/utl_gdk.sql b/src/test/regress/sql/utl_gdk.sql
new file mode 100644
index 0000000..588af86
--- /dev/null
+++ b/src/test/regress/sql/utl_gdk.sql
@@ -0,0 +1,45 @@
+-- CHARSET_MAP: Oracle <-> IANA.
+select utl_gdk_get_version() as package_version;
+select utl_gdk_oracle_charset_to_iana('AL32UTF8') as mapped_service;
+select utl_gdk_charset_map('AL32UTF8') as mapped;
+select utl_gdk_charset_map('al32utf8') as mapped;
+select utl_gdk_charset_map('AL16UTF16', 1) as mapped;
+select utl_gdk_charset_map('UTF-16BE', 2) as mapped;
+select utl_gdk_charset_map('JA16SJIS', 1) as mapped;
+select utl_gdk_charset_map('shift_jis', 2) as mapped;
+select utl_gdk_charset_map('WE8MSWIN1252', 1) as mapped;
+select utl_gdk_charset_map('windows-1252', 2) as mapped;
+select utl_gdk_charset_map('AR8ADOS710', 1) is null as empty_oracle_charset_mapping_is_null;
+select utl_gdk_charset_map('UNKNOWN_CHARSET', 1) is null as unknown_charset_is_null;
+select utl_gdk_charset_map('AL32UTF8', 999) is null as invalid_charset_flag_is_null;
+select utl_gdk_charset_map(NULL, 1) is null as null_charset_input_is_null;
+select utl_gdk_charset_map('', 1) is null as empty_charset_input_is_null;
+
+-- LANGUAGE_MAP: Oracle <-> ISO.
+select utl_gdk_language_map('AMERICAN') as mapped;
+select utl_gdk_language_map('american') as mapped;
+select utl_gdk_language_map('ENGLISH', 3) as mapped;
+select utl_gdk_language_map('en', 4) as mapped;
+select utl_gdk_language_map('FR', 4) as mapped;
+select utl_gdk_language_map('BENGALI', 3) as mapped;
+select utl_gdk_language_map('bn', 4) as mapped;
+select utl_gdk_language_map('UNKNOWN_LANGUAGE', 3) is null as unknown_language_is_null;
+select utl_gdk_language_map('AMERICAN', 999) is null as invalid_language_flag_is_null;
+select utl_gdk_language_map(NULL, 3) is null as null_language_input_is_null;
+select utl_gdk_language_map('', 3) is null as empty_language_input_is_null;
+
+-- TERRITORY_MAP: Oracle <-> ISO alpha-2/alpha-3.
+select utl_gdk_territory_map('AMERICA') as mapped;
+select utl_gdk_territory_map('america') as mapped;
+select utl_gdk_territory_map('THE NETHERLANDS', 3) as mapped;
+select utl_gdk_territory_map('nl', 4) as mapped;
+select utl_gdk_territory_map('AMERICA', 5) as mapped;
+select utl_gdk_territory_map('USA', 6) as mapped;
+select utl_gdk_territory_map('BOLIVIA', 5) as mapped;
+select utl_gdk_territory_map('bob', 6) as mapped;
+select utl_gdk_territory_map('AZERBAIJAN', 3) as mapped;
+select utl_gdk_territory_map('AZERBAIJAN', 5) is null as empty_oracle_territory_a3_mapping_is_null;
+select utl_gdk_territory_map('UNKNOWN_TERRITORY', 3) is null as unknown_territory_is_null;
+select utl_gdk_territory_map('AMERICA', 999) is null as invalid_territory_flag_is_null;
+select utl_gdk_territory_map(NULL, 3) is null as null_territory_input_is_null;
+select utl_gdk_territory_map('', 3) is null as empty_territory_input_is_null;
--
Gitblit v1.10.0